eas-cli 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +26 -26
  2. package/build/analytics.js +6 -9
  3. package/build/build/android/build.js +6 -8
  4. package/build/build/android/configure.d.ts +6 -1
  5. package/build/build/android/configure.js +31 -5
  6. package/build/build/android/prepareJob.js +3 -3
  7. package/build/build/android/version.d.ts +15 -0
  8. package/build/build/android/version.js +75 -1
  9. package/build/build/context.d.ts +2 -0
  10. package/build/build/context.js +8 -0
  11. package/build/build/ios/UpdatesModule.js +3 -1
  12. package/build/build/ios/configure.js +1 -1
  13. package/build/build/ios/credentials.js +2 -7
  14. package/build/build/ios/prepareJob.js +3 -14
  15. package/build/build/ios/version.d.ts +1 -1
  16. package/build/build/ios/version.js +5 -23
  17. package/build/build/utils/printBuildInfo.js +1 -1
  18. package/build/build/utils/updates.js +1 -1
  19. package/build/build/utils/version.d.ts +7 -0
  20. package/build/build/utils/version.js +37 -0
  21. package/build/commands/branch/create.js +1 -4
  22. package/build/commands/branch/delete.js +1 -4
  23. package/build/commands/branch/list.js +1 -4
  24. package/build/commands/branch/publish.js +2 -5
  25. package/build/commands/branch/rename.js +1 -4
  26. package/build/commands/branch/view.js +1 -4
  27. package/build/commands/build/cancel.js +1 -2
  28. package/build/commands/build/configure.js +2 -2
  29. package/build/commands/build/index.js +15 -6
  30. package/build/commands/build/list.js +1 -2
  31. package/build/commands/build/view.js +1 -2
  32. package/build/commands/channel/create.js +1 -4
  33. package/build/commands/channel/edit.js +1 -4
  34. package/build/commands/channel/list.js +1 -4
  35. package/build/commands/channel/rollout.js +1 -4
  36. package/build/commands/channel/view.js +1 -4
  37. package/build/commands/config.js +1 -2
  38. package/build/commands/credentials.js +5 -1
  39. package/build/commands/device/list.js +1 -2
  40. package/build/commands/device/view.js +1 -2
  41. package/build/commands/project/info.js +1 -4
  42. package/build/commands/project/init.js +1 -4
  43. package/build/commands/secret/create.js +1 -2
  44. package/build/commands/secret/delete.js +1 -2
  45. package/build/commands/secret/list.js +1 -2
  46. package/build/commands/submit.js +2 -3
  47. package/build/commands/webhook/create.js +1 -4
  48. package/build/commands/webhook/delete.js +1 -4
  49. package/build/commands/webhook/list.js +1 -4
  50. package/build/credentials/android/AndroidCredentialsProvider.d.ts +2 -2
  51. package/build/credentials/android/actions/AssignFcm.d.ts +2 -2
  52. package/build/credentials/android/actions/AssignGoogleServiceAccountKey.d.ts +8 -0
  53. package/build/credentials/android/actions/AssignGoogleServiceAccountKey.js +19 -0
  54. package/build/credentials/android/actions/BuildCredentialsUtils.d.ts +5 -5
  55. package/build/credentials/android/actions/CreateFcm.d.ts +2 -2
  56. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +3 -2
  57. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.js +19 -11
  58. package/build/credentials/android/actions/CreateKeystore.d.ts +2 -2
  59. package/build/credentials/android/actions/DownloadKeystore.d.ts +3 -3
  60. package/build/credentials/android/actions/RemoveFcm.d.ts +2 -2
  61. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +13 -0
  62. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.js +48 -0
  63. package/build/credentials/android/actions/RemoveKeystore.d.ts +2 -2
  64. package/build/credentials/android/actions/SetupBuildCredentials.d.ts +5 -5
  65. package/build/credentials/android/actions/SetupBuildCredentialsFromCredentialsJson.d.ts +2 -2
  66. package/build/credentials/android/actions/SetupGoogleServiceAccountKey.d.ts +10 -0
  67. package/build/credentials/android/actions/SetupGoogleServiceAccountKey.js +59 -0
  68. package/build/credentials/android/actions/UpdateCredentialsJson.d.ts +2 -2
  69. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +8 -0
  70. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.js +23 -0
  71. package/build/credentials/android/api/GraphqlClient.d.ts +5 -2
  72. package/build/credentials/android/api/GraphqlClient.js +20 -3
  73. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.d.ts +1 -0
  74. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.js +26 -0
  75. package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.d.ts +1 -0
  76. package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.js +17 -0
  77. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +4 -0
  78. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +31 -0
  79. package/build/credentials/android/credentials.d.ts +2 -0
  80. package/build/credentials/android/utils/googleServiceAccountKey.d.ts +3 -0
  81. package/build/credentials/android/utils/googleServiceAccountKey.js +90 -1
  82. package/build/credentials/android/utils/printCredentials.js +67 -28
  83. package/build/credentials/context.d.ts +17 -21
  84. package/build/credentials/context.js +21 -26
  85. package/build/credentials/credentialsJson/update.d.ts +3 -3
  86. package/build/credentials/ios/IosCredentialsProvider.d.ts +2 -2
  87. package/build/credentials/ios/actions/AppleTeamUtils.d.ts +2 -2
  88. package/build/credentials/ios/actions/AssignPushKey.d.ts +2 -2
  89. package/build/credentials/ios/actions/BuildCredentialsUtils.d.ts +8 -8
  90. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +2 -2
  91. package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +2 -2
  92. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +2 -2
  93. package/build/credentials/ios/actions/CreatePushKey.d.ts +2 -2
  94. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +4 -4
  95. package/build/credentials/ios/actions/DistributionCertificateUtils.js +3 -3
  96. package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -2
  97. package/build/credentials/ios/actions/PushKeyUtils.d.ts +4 -4
  98. package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -3
  99. package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +2 -2
  100. package/build/credentials/ios/actions/RemovePushKey.d.ts +3 -3
  101. package/build/credentials/ios/actions/SetupAdhocProvisioningProfile.d.ts +4 -3
  102. package/build/credentials/ios/actions/SetupAdhocProvisioningProfile.js +48 -4
  103. package/build/credentials/ios/actions/SetupBuildCredentials.d.ts +2 -2
  104. package/build/credentials/ios/actions/SetupBuildCredentialsFromCredentialsJson.d.ts +2 -2
  105. package/build/credentials/ios/actions/SetupDistributionCertificate.d.ts +3 -3
  106. package/build/credentials/ios/actions/SetupInternalProvisioningProfile.d.ts +2 -2
  107. package/build/credentials/ios/actions/SetupProvisioningProfile.d.ts +6 -6
  108. package/build/credentials/ios/actions/SetupPushKey.d.ts +3 -3
  109. package/build/credentials/ios/actions/SetupTargetBuildCredentials.d.ts +4 -4
  110. package/build/credentials/ios/actions/SetupTargetBuildCredentialsFromCredentialsJson.d.ts +5 -5
  111. package/build/credentials/ios/actions/UpdateCredentialsJson.d.ts +2 -2
  112. package/build/credentials/ios/appstore/AppStoreApi.d.ts +4 -15
  113. package/build/credentials/ios/appstore/AppStoreApi.js +4 -12
  114. package/build/credentials/ios/appstore/entitlements.js +14 -13
  115. package/build/credentials/ios/utils/printCredentials.js +83 -51
  116. package/build/credentials/ios/validators/validateDistributionCertificate.d.ts +2 -2
  117. package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +2 -2
  118. package/build/credentials/ios/validators/validatePushKey.d.ts +2 -2
  119. package/build/credentials/manager/HelperActions.d.ts +4 -0
  120. package/build/credentials/manager/ManageAndroid.d.ts +18 -12
  121. package/build/credentials/manager/ManageAndroid.js +72 -10
  122. package/build/credentials/manager/ManageIos.d.ts +3 -2
  123. package/build/credentials/manager/SelectAndroidBuildCredentials.d.ts +3 -3
  124. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +3 -4
  125. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +0 -1
  126. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.d.ts +3 -3
  127. package/build/credentials/manager/SelectPlatform.d.ts +3 -3
  128. package/build/devices/context.js +1 -1
  129. package/build/graphql/generated.d.ts +60 -1
  130. package/build/graphql/types/credentials/AndroidAppCredentials.js +6 -0
  131. package/build/project/android/applicationId.js +2 -2
  132. package/build/project/projectUtils.d.ts +4 -1
  133. package/build/project/projectUtils.js +13 -3
  134. package/build/project/publish.d.ts +3 -3
  135. package/build/project/publish.js +10 -10
  136. package/build/submit/android/AndroidSubmitCommand.js +3 -8
  137. package/build/submit/android/AndroidSubmitter.js +31 -9
  138. package/build/submit/android/ServiceAccountSource.d.ts +24 -5
  139. package/build/submit/android/ServiceAccountSource.js +54 -75
  140. package/build/submit/context.d.ts +14 -7
  141. package/build/submit/context.js +18 -4
  142. package/build/submit/ios/AppProduce.js +3 -3
  143. package/build/submit/ios/AppSpecificPasswordSource.js +1 -1
  144. package/build/submit/ios/IosSubmitCommand.js +1 -1
  145. package/build/utils/json.js +2 -6
  146. package/build/vcs/local.js +7 -7
  147. package/oclif.manifest.json +1 -1
  148. package/package.json +9 -8
@@ -1,8 +1,8 @@
1
1
  import { AndroidFcmFragment, CommonAndroidAppCredentialsFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  export declare class AssignFcm {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
- runAsync(ctx: Context, fcm: AndroidFcmFragment): Promise<CommonAndroidAppCredentialsFragment>;
7
+ runAsync(ctx: CredentialsContext, fcm: AndroidFcmFragment): Promise<CommonAndroidAppCredentialsFragment>;
8
8
  }
@@ -0,0 +1,8 @@
1
+ import { CommonAndroidAppCredentialsFragment, GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
2
+ import { CredentialsContext } from '../../context';
3
+ import { AppLookupParams } from '../api/GraphqlClient';
4
+ export declare class AssignGoogleServiceAccountKey {
5
+ private app;
6
+ constructor(app: AppLookupParams);
7
+ runAsync(ctx: CredentialsContext, googleServiceAccountKey: GoogleServiceAccountKeyFragment): Promise<CommonAndroidAppCredentialsFragment>;
8
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssignGoogleServiceAccountKey = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
6
+ class AssignGoogleServiceAccountKey {
7
+ constructor(app) {
8
+ this.app = app;
9
+ }
10
+ async runAsync(ctx, googleServiceAccountKey) {
11
+ const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(this.app);
12
+ const updatedAppCredentials = await ctx.android.updateAndroidAppCredentialsAsync(appCredentials, {
13
+ googleServiceAccountKeyForSubmissionsId: googleServiceAccountKey.id,
14
+ });
15
+ log_1.default.succeed(`Google Service Account Key assigned to ${this.app.androidApplicationIdentifier} for submissions`);
16
+ return updatedAppCredentials;
17
+ }
18
+ }
19
+ exports.AssignGoogleServiceAccountKey = AssignGoogleServiceAccountKey;
@@ -1,15 +1,15 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../../graphql/generated';
2
2
  import { GradleBuildContext } from '../../../project/android/gradle';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  import { AppLookupParams } from '../api/GraphqlClient';
5
5
  /**
6
6
  * Legacy credentials can be copied over to EAS if the user does not have
7
7
  * EAS credentials set up yet
8
8
  */
9
- export declare function canCopyLegacyCredentialsAsync(ctx: Context, app: AppLookupParams): Promise<boolean>;
10
- export declare function promptUserAndCopyLegacyCredentialsAsync(ctx: Context, app: AppLookupParams): Promise<void>;
11
- export declare function getAppLookupParamsFromContextAsync(ctx: Context, gradleContext?: GradleBuildContext): Promise<AppLookupParams>;
12
- export declare function createOrUpdateDefaultAndroidAppBuildCredentialsAsync(ctx: Context, appLookupParams: AppLookupParams, { androidKeystoreId, }: {
9
+ export declare function canCopyLegacyCredentialsAsync(ctx: CredentialsContext, app: AppLookupParams): Promise<boolean>;
10
+ export declare function promptUserAndCopyLegacyCredentialsAsync(ctx: CredentialsContext, app: AppLookupParams): Promise<void>;
11
+ export declare function getAppLookupParamsFromContextAsync(ctx: CredentialsContext, gradleContext?: GradleBuildContext): Promise<AppLookupParams>;
12
+ export declare function createOrUpdateDefaultAndroidAppBuildCredentialsAsync(ctx: CredentialsContext, appLookupParams: AppLookupParams, { androidKeystoreId, }: {
13
13
  androidKeystoreId: string;
14
14
  }): Promise<AndroidAppBuildCredentialsFragment>;
15
15
  export declare function promptForNameAsync(): Promise<string>;
@@ -1,8 +1,8 @@
1
1
  import { AndroidFcmFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  export declare class CreateFcm {
5
5
  private account;
6
6
  constructor(account: Account);
7
- runAsync(ctx: Context): Promise<AndroidFcmFragment>;
7
+ runAsync(ctx: CredentialsContext): Promise<AndroidFcmFragment>;
8
8
  }
@@ -1,9 +1,10 @@
1
1
  import { GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  export declare class CreateGoogleServiceAccountKey {
5
5
  private account;
6
6
  constructor(account: Account);
7
- runAsync(ctx: Context): Promise<GoogleServiceAccountKeyFragment>;
7
+ runAsync(ctx: CredentialsContext): Promise<GoogleServiceAccountKeyFragment>;
8
8
  private provideAsync;
9
+ private provideKeyJsonPathAsync;
9
10
  }
@@ -13,27 +13,35 @@ class CreateGoogleServiceAccountKey {
13
13
  if (ctx.nonInteractive) {
14
14
  throw new Error(`New Google Service Account Key cannot be created in non-interactive mode.`);
15
15
  }
16
- const jsonKeyObject = await this.provideAsync();
16
+ const jsonKeyObject = await this.provideAsync(ctx);
17
17
  const gsaKeyFragment = await ctx.android.createGoogleServiceAccountKeyAsync(this.account, jsonKeyObject);
18
18
  log_1.default.succeed('Uploaded Google Service Account Key.');
19
19
  return gsaKeyFragment;
20
20
  }
21
- async provideAsync() {
21
+ async provideAsync(ctx) {
22
22
  try {
23
- const { keyJsonPath } = await (0, prompts_1.promptAsync)([
24
- {
25
- type: 'text',
26
- name: 'keyJsonPath',
27
- message: 'Path to Google Service Account Key JSON file:',
28
- validate: (value) => value.length > 0 || "Path can't be empty",
29
- },
30
- ]);
23
+ const keyJsonPath = await this.provideKeyJsonPathAsync(ctx);
31
24
  return (0, googleServiceAccountKey_1.readAndValidateServiceAccountKey)(keyJsonPath);
32
25
  }
33
26
  catch (e) {
34
27
  log_1.default.error(e);
35
- return await this.provideAsync();
28
+ return await this.provideAsync(ctx);
36
29
  }
37
30
  }
31
+ async provideKeyJsonPathAsync(ctx) {
32
+ const detectedPath = await (0, googleServiceAccountKey_1.detectGoogleServiceAccountKeyPathAsync)(ctx.projectDir);
33
+ if (detectedPath) {
34
+ return detectedPath;
35
+ }
36
+ const { keyJsonPath } = await (0, prompts_1.promptAsync)([
37
+ {
38
+ type: 'text',
39
+ name: 'keyJsonPath',
40
+ message: 'Path to Google Service Account Key JSON file:',
41
+ validate: (value) => value.length > 0 || "Path can't be empty",
42
+ },
43
+ ]);
44
+ return keyJsonPath;
45
+ }
38
46
  }
39
47
  exports.CreateGoogleServiceAccountKey = CreateGoogleServiceAccountKey;
@@ -1,9 +1,9 @@
1
1
  import { AndroidKeystoreFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  export declare class CreateKeystore {
5
5
  private account;
6
6
  constructor(account: Account);
7
- runAsync(ctx: Context): Promise<AndroidKeystoreFragment>;
7
+ runAsync(ctx: CredentialsContext): Promise<AndroidKeystoreFragment>;
8
8
  private provideOrGenerateAsync;
9
9
  }
@@ -1,5 +1,5 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  interface DownloadKeystoreOptions {
5
5
  app: AppLookupParams;
@@ -9,11 +9,11 @@ interface DownloadKeystoreOptions {
9
9
  export declare class DownloadKeystore {
10
10
  private options;
11
11
  constructor(options: DownloadKeystoreOptions);
12
- runAsync(ctx: Context, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
12
+ runAsync(ctx: CredentialsContext, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
13
13
  }
14
14
  export declare class BackupKeystore {
15
15
  private app;
16
16
  constructor(app: AppLookupParams);
17
- runAsync(ctx: Context, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
17
+ runAsync(ctx: CredentialsContext, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
18
18
  }
19
19
  export {};
@@ -1,7 +1,7 @@
1
- import { Context } from '../../context';
1
+ import { CredentialsContext } from '../../context';
2
2
  import { AppLookupParams } from '../api/GraphqlClient';
3
3
  export declare class RemoveFcm {
4
4
  private app;
5
5
  constructor(app: AppLookupParams);
6
- runAsync(ctx: Context): Promise<void>;
6
+ runAsync(ctx: CredentialsContext): Promise<void>;
7
7
  }
@@ -0,0 +1,13 @@
1
+ import { GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
2
+ import { Account } from '../../../user/Account';
3
+ import { CredentialsContext } from '../../context';
4
+ export declare class SelectAndRemoveGoogleServiceAccountKey {
5
+ private account;
6
+ constructor(account: Account);
7
+ runAsync(ctx: CredentialsContext): Promise<void>;
8
+ }
9
+ export declare class RemoveGoogleServiceAccountKey {
10
+ private googleServiceAccountKey;
11
+ constructor(googleServiceAccountKey: GoogleServiceAccountKeyFragment);
12
+ runAsync(ctx: CredentialsContext): Promise<void>;
13
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RemoveGoogleServiceAccountKey = exports.SelectAndRemoveGoogleServiceAccountKey = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
6
+ const prompts_1 = require("../../../prompts");
7
+ const googleServiceAccountKey_1 = require("../utils/googleServiceAccountKey");
8
+ class SelectAndRemoveGoogleServiceAccountKey {
9
+ constructor(account) {
10
+ this.account = account;
11
+ }
12
+ async runAsync(ctx) {
13
+ if (ctx.nonInteractive) {
14
+ throw new Error(`Cannot select and remove Google Service Account Keys in non-interactive mode.`);
15
+ }
16
+ const gsaKeyFragments = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(this.account);
17
+ if (gsaKeyFragments.length === 0) {
18
+ log_1.default.warn("There aren't any Google Service Account Keys associated with your account.");
19
+ return;
20
+ }
21
+ const selected = await (0, googleServiceAccountKey_1.selectGoogleServiceAccountKeyAsync)(gsaKeyFragments);
22
+ await new RemoveGoogleServiceAccountKey(selected).runAsync(ctx);
23
+ log_1.default.succeed('Removed Google Service Account Key.');
24
+ log_1.default.newLine();
25
+ }
26
+ }
27
+ exports.SelectAndRemoveGoogleServiceAccountKey = SelectAndRemoveGoogleServiceAccountKey;
28
+ class RemoveGoogleServiceAccountKey {
29
+ constructor(googleServiceAccountKey) {
30
+ this.googleServiceAccountKey = googleServiceAccountKey;
31
+ }
32
+ async runAsync(ctx) {
33
+ if (ctx.nonInteractive) {
34
+ throw new Error(`Cannot remove Google Service Account Keys in non-interactive mode`);
35
+ }
36
+ // TODO(quin): add an extra edge on GoogleServiceAccountKey to find the apps using it
37
+ const confirm = await (0, prompts_1.confirmAsync)({
38
+ message: `Deleting this Google Service Account Key may affect your projects that rely on it. Do you want to continue?`,
39
+ });
40
+ if (!confirm) {
41
+ log_1.default.log('Aborting');
42
+ return;
43
+ }
44
+ log_1.default.log('Removing Google Service Account Key.');
45
+ await ctx.android.deleteGoogleServiceAccountKeyAsync(this.googleServiceAccountKey);
46
+ }
47
+ }
48
+ exports.RemoveGoogleServiceAccountKey = RemoveGoogleServiceAccountKey;
@@ -1,9 +1,9 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  export declare class RemoveKeystore {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
- runAsync(ctx: Context, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
7
+ runAsync(ctx: CredentialsContext, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
8
8
  displayWarning(): void;
9
9
  }
@@ -1,5 +1,5 @@
1
1
  import { AndroidAppBuildCredentialsFragment, AndroidKeystoreFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  interface Options {
5
5
  app: AppLookupParams;
@@ -12,20 +12,20 @@ interface Options {
12
12
  export declare class SetupBuildCredentials {
13
13
  private options;
14
14
  constructor(options: Options);
15
- runAsync(ctx: Context): Promise<AndroidAppBuildCredentialsFragment>;
15
+ runAsync(ctx: CredentialsContext): Promise<AndroidAppBuildCredentialsFragment>;
16
16
  assignBuildCredentialsAsync({ ctx, app, name, keystore, }: {
17
- ctx: Context;
17
+ ctx: CredentialsContext;
18
18
  app: AppLookupParams;
19
19
  name?: string;
20
20
  keystore: AndroidKeystoreFragment;
21
21
  }): Promise<AndroidAppBuildCredentialsFragment>;
22
22
  getFullySetupBuildCredentialsAsync({ ctx, app, name, }: {
23
- ctx: Context;
23
+ ctx: CredentialsContext;
24
24
  app: AppLookupParams;
25
25
  name?: string;
26
26
  }): Promise<AndroidAppBuildCredentialsFragment | null>;
27
27
  getFullySetupBuildCredentialsByNameAsync({ ctx, app, name, }: {
28
- ctx: Context;
28
+ ctx: CredentialsContext;
29
29
  app: AppLookupParams;
30
30
  name: string;
31
31
  }): Promise<AndroidAppBuildCredentialsFragment | null>;
@@ -1,8 +1,8 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  export declare class SetupBuildCredentialsFromCredentialsJson {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
- runAsync(ctx: Context): Promise<AndroidAppBuildCredentialsFragment | null>;
7
+ runAsync(ctx: CredentialsContext): Promise<AndroidAppBuildCredentialsFragment | null>;
8
8
  }
@@ -0,0 +1,10 @@
1
+ import { CommonAndroidAppCredentialsFragment } from '../../../graphql/generated';
2
+ import { CredentialsContext } from '../../context';
3
+ import { AppLookupParams } from '../api/GraphqlClient';
4
+ export declare class SetupGoogleServiceAccountKey {
5
+ private app;
6
+ constructor(app: AppLookupParams);
7
+ runAsync(ctx: CredentialsContext): Promise<CommonAndroidAppCredentialsFragment>;
8
+ private isGoogleServiceAccountKeySetupAsync;
9
+ private createOrUseExistingKeyAsync;
10
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetupGoogleServiceAccountKey = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
6
+ const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
7
+ const prompts_1 = require("../../../prompts");
8
+ const errors_1 = require("../../errors");
9
+ const AssignGoogleServiceAccountKey_1 = require("./AssignGoogleServiceAccountKey");
10
+ const CreateGoogleServiceAccountKey_1 = require("./CreateGoogleServiceAccountKey");
11
+ const UseExistingGoogleServiceAccountKey_1 = require("./UseExistingGoogleServiceAccountKey");
12
+ class SetupGoogleServiceAccountKey {
13
+ constructor(app) {
14
+ this.app = app;
15
+ }
16
+ async runAsync(ctx) {
17
+ if (ctx.nonInteractive) {
18
+ throw new errors_1.MissingCredentialsNonInteractiveError('Google Service Account Keys cannot be set up in --non-interactive mode.');
19
+ }
20
+ const isKeySetup = await this.isGoogleServiceAccountKeySetupAsync(ctx);
21
+ if (isKeySetup) {
22
+ log_1.default.succeed('Google Service Account Key already set up.');
23
+ return (0, nullthrows_1.default)(await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(this.app), 'androidAppCredentials cannot be null if google service account key is already set up');
24
+ }
25
+ const keysForAccount = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(this.app.account);
26
+ let googleServiceAccountKey = null;
27
+ if (keysForAccount.length === 0) {
28
+ googleServiceAccountKey = await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(this.app.account).runAsync(ctx);
29
+ }
30
+ else {
31
+ googleServiceAccountKey = await this.createOrUseExistingKeyAsync(ctx);
32
+ }
33
+ return await new AssignGoogleServiceAccountKey_1.AssignGoogleServiceAccountKey(this.app).runAsync(ctx, googleServiceAccountKey);
34
+ }
35
+ async isGoogleServiceAccountKeySetupAsync(ctx) {
36
+ const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(this.app);
37
+ return !!(appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.googleServiceAccountKeyForSubmissions);
38
+ }
39
+ async createOrUseExistingKeyAsync(ctx) {
40
+ var _a;
41
+ const { action } = await (0, prompts_1.promptAsync)({
42
+ type: 'select',
43
+ name: 'action',
44
+ message: 'Select the Google Service Account Key to use for your project:',
45
+ choices: [
46
+ {
47
+ title: '[Choose an existing key]',
48
+ value: 'CHOOSE_EXISTING',
49
+ },
50
+ { title: '[Upload a new service account key]', value: 'GENERATE' },
51
+ ],
52
+ });
53
+ if (action === 'GENERATE') {
54
+ return await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(this.app.account).runAsync(ctx);
55
+ }
56
+ return ((_a = (await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(this.app.account).runAsync(ctx))) !== null && _a !== void 0 ? _a : (await this.createOrUseExistingKeyAsync(ctx)));
57
+ }
58
+ }
59
+ exports.SetupGoogleServiceAccountKey = SetupGoogleServiceAccountKey;
@@ -1,5 +1,5 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  export declare class UpdateCredentialsJson {
4
- runAsync(ctx: Context, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
4
+ runAsync(ctx: CredentialsContext, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
5
5
  }
@@ -0,0 +1,8 @@
1
+ import { GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
2
+ import { Account } from '../../../user/Account';
3
+ import { CredentialsContext } from '../../context';
4
+ export declare class UseExistingGoogleServiceAccountKey {
5
+ private account;
6
+ constructor(account: Account);
7
+ runAsync(ctx: CredentialsContext): Promise<GoogleServiceAccountKeyFragment | null>;
8
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UseExistingGoogleServiceAccountKey = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
6
+ const googleServiceAccountKey_1 = require("../utils/googleServiceAccountKey");
7
+ class UseExistingGoogleServiceAccountKey {
8
+ constructor(account) {
9
+ this.account = account;
10
+ }
11
+ async runAsync(ctx) {
12
+ if (ctx.nonInteractive) {
13
+ throw new Error(`Existing Google Service Account Key cannot be chosen in non-interactive mode.`);
14
+ }
15
+ const gsaKeyFragments = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(this.account);
16
+ if (gsaKeyFragments.length === 0) {
17
+ log_1.default.error("There aren't any Google Service Account Keys associated with your account.");
18
+ return null;
19
+ }
20
+ return await (0, googleServiceAccountKey_1.selectGoogleServiceAccountKeyAsync)(gsaKeyFragments);
21
+ }
22
+ }
23
+ exports.UseExistingGoogleServiceAccountKey = UseExistingGoogleServiceAccountKey;
@@ -11,8 +11,9 @@ export declare function getAndroidAppBuildCredentialsListAsync(appLookupParams:
11
11
  export declare function getLegacyAndroidAppCredentialsWithCommonFieldsAsync(appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment | null>;
12
12
  export declare function getLegacyAndroidAppBuildCredentialsAsync(appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment | null>;
13
13
  export declare function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment>;
14
- export declare function updateAndroidAppCredentialsAsync(appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, }: {
15
- androidFcmId: string;
14
+ export declare function updateAndroidAppCredentialsAsync(appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }: {
15
+ androidFcmId?: string;
16
+ googleServiceAccountKeyForSubmissionsId?: string;
16
17
  }): Promise<CommonAndroidAppCredentialsFragment>;
17
18
  export declare function updateAndroidAppBuildCredentialsAsync(buildCredentials: AndroidAppBuildCredentialsFragment, { androidKeystoreId, }: {
18
19
  androidKeystoreId: string;
@@ -33,4 +34,6 @@ export declare function deleteKeystoreAsync(keystore: AndroidKeystoreFragment):
33
34
  export declare function createFcmAsync(account: Account, fcmApiKey: string, version: AndroidFcmVersion): Promise<AndroidFcmFragment>;
34
35
  export declare function deleteFcmAsync(fcm: AndroidFcmFragment): Promise<void>;
35
36
  export declare function createGoogleServiceAccountKeyAsync(account: Account, jsonKey: GoogleServiceAccountKey): Promise<GoogleServiceAccountKeyFragment>;
37
+ export declare function deleteGoogleServiceAccountKeyAsync(googleServiceAccountKey: GoogleServiceAccountKeyFragment): Promise<void>;
38
+ export declare function getGoogleServiceAccountKeysForAccountAsync(account: Account): Promise<GoogleServiceAccountKeyFragment[]>;
36
39
  export declare const formatProjectFullName: ({ account, projectName }: AppLookupParams) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatProjectFullName = exports.createGoogleServiceAccountKeyAsync = exports.deleteFcmAsync = exports.createFcmAsync = exports.deleteKeystoreAsync = exports.createKeystoreAsync = exports.createOrUpdateDefaultIosAppBuildCredentialsAsync = exports.createOrUpdateAndroidAppBuildCredentialsByNameAsync = exports.getAndroidAppBuildCredentialsByNameAsync = exports.getDefaultAndroidAppBuildCredentialsAsync = exports.createAndroidAppBuildCredentialsAsync = exports.updateAndroidAppBuildCredentialsAsync = exports.updateAndroidAppCredentialsAsync = exports.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync = exports.getLegacyAndroidAppBuildCredentialsAsync = exports.getLegacyAndroidAppCredentialsWithCommonFieldsAsync = exports.getAndroidAppBuildCredentialsListAsync = exports.getAndroidAppCredentialsWithCommonFieldsAsync = void 0;
3
+ exports.formatProjectFullName = exports.getGoogleServiceAccountKeysForAccountAsync = exports.deleteGoogleServiceAccountKeyAsync = exports.createGoogleServiceAccountKeyAsync = exports.deleteFcmAsync = exports.createFcmAsync = exports.deleteKeystoreAsync = exports.createKeystoreAsync = exports.createOrUpdateDefaultIosAppBuildCredentialsAsync = exports.createOrUpdateAndroidAppBuildCredentialsByNameAsync = exports.getAndroidAppBuildCredentialsByNameAsync = exports.getDefaultAndroidAppBuildCredentialsAsync = exports.createAndroidAppBuildCredentialsAsync = exports.updateAndroidAppBuildCredentialsAsync = exports.updateAndroidAppCredentialsAsync = exports.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync = exports.getLegacyAndroidAppBuildCredentialsAsync = exports.getLegacyAndroidAppCredentialsWithCommonFieldsAsync = exports.getAndroidAppBuildCredentialsListAsync = exports.getAndroidAppCredentialsWithCommonFieldsAsync = void 0;
4
4
  const AppQuery_1 = require("../../ios/api/graphql/queries/AppQuery");
5
5
  const AndroidAppBuildCredentialsMutation_1 = require("./graphql/mutations/AndroidAppBuildCredentialsMutation");
6
6
  const AndroidAppCredentialsMutation_1 = require("./graphql/mutations/AndroidAppCredentialsMutation");
@@ -8,6 +8,7 @@ const AndroidFcmMutation_1 = require("./graphql/mutations/AndroidFcmMutation");
8
8
  const AndroidKeystoreMutation_1 = require("./graphql/mutations/AndroidKeystoreMutation");
9
9
  const GoogleServiceAccountKeyMutation_1 = require("./graphql/mutations/GoogleServiceAccountKeyMutation");
10
10
  const AndroidAppCredentialsQuery_1 = require("./graphql/queries/AndroidAppCredentialsQuery");
11
+ const GoogleServiceAccountKeyQuery_1 = require("./graphql/queries/GoogleServiceAccountKeyQuery");
11
12
  async function getAndroidAppCredentialsWithCommonFieldsAsync(appLookupParams) {
12
13
  const { androidApplicationIdentifier } = appLookupParams;
13
14
  const projectFullName = (0, exports.formatProjectFullName)(appLookupParams);
@@ -49,8 +50,16 @@ async function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync
49
50
  }
50
51
  }
51
52
  exports.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync = createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync;
52
- async function updateAndroidAppCredentialsAsync(appCredentials, { androidFcmId, }) {
53
- return await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setFcmKeyAsync(appCredentials.id, androidFcmId);
53
+ async function updateAndroidAppCredentialsAsync(appCredentials, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }) {
54
+ let updatedAppCredentials = appCredentials;
55
+ if (androidFcmId) {
56
+ updatedAppCredentials = await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setFcmKeyAsync(appCredentials.id, androidFcmId);
57
+ }
58
+ if (googleServiceAccountKeyForSubmissionsId) {
59
+ updatedAppCredentials =
60
+ await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setGoogleServiceAccountKeyForSubmissionsAsync(appCredentials.id, googleServiceAccountKeyForSubmissionsId);
61
+ }
62
+ return updatedAppCredentials;
54
63
  }
55
64
  exports.updateAndroidAppCredentialsAsync = updateAndroidAppCredentialsAsync;
56
65
  async function updateAndroidAppBuildCredentialsAsync(buildCredentials, { androidKeystoreId, }) {
@@ -129,6 +138,14 @@ async function createGoogleServiceAccountKeyAsync(account, jsonKey) {
129
138
  return await GoogleServiceAccountKeyMutation_1.GoogleServiceAccountKeyMutation.createGoogleServiceAccountKeyAsync({ jsonKey }, account.id);
130
139
  }
131
140
  exports.createGoogleServiceAccountKeyAsync = createGoogleServiceAccountKeyAsync;
141
+ async function deleteGoogleServiceAccountKeyAsync(googleServiceAccountKey) {
142
+ return await GoogleServiceAccountKeyMutation_1.GoogleServiceAccountKeyMutation.deleteGoogleServiceAccountKeyAsync(googleServiceAccountKey.id);
143
+ }
144
+ exports.deleteGoogleServiceAccountKeyAsync = deleteGoogleServiceAccountKeyAsync;
145
+ async function getGoogleServiceAccountKeysForAccountAsync(account) {
146
+ return await GoogleServiceAccountKeyQuery_1.GoogleServiceAccountKeyQuery.getAllForAccountAsync(account.name);
147
+ }
148
+ exports.getGoogleServiceAccountKeysForAccountAsync = getGoogleServiceAccountKeysForAccountAsync;
132
149
  async function getAppAsync(appLookupParams) {
133
150
  const projectFullName = (0, exports.formatProjectFullName)(appLookupParams);
134
151
  return await AppQuery_1.AppQuery.byFullNameAsync(projectFullName);
@@ -4,4 +4,5 @@ export declare const AndroidAppCredentialsMutation: {
4
4
  fcmId?: string;
5
5
  }, appId: string, applicationIdentifier: string): Promise<CommonAndroidAppCredentialsFragment>;
6
6
  setFcmKeyAsync(androidAppCredentialsId: string, fcmId: string): Promise<CommonAndroidAppCredentialsFragment>;
7
+ setGoogleServiceAccountKeyForSubmissionsAsync(androidAppCredentialsId: string, googleServiceAccountKeyId: string): Promise<CommonAndroidAppCredentialsFragment>;
7
8
  };
@@ -57,4 +57,30 @@ exports.AndroidAppCredentialsMutation = {
57
57
  (0, assert_1.default)(data.androidAppCredentials.setFcm, 'GraphQL: `setFcm` not defined in server response');
58
58
  return data.androidAppCredentials.setFcm;
59
59
  },
60
+ async setGoogleServiceAccountKeyForSubmissionsAsync(androidAppCredentialsId, googleServiceAccountKeyId) {
61
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
62
+ .mutation((0, graphql_tag_1.default) `
63
+ mutation SetGoogleServiceAccountKeyForSubmissionsMutation(
64
+ $androidAppCredentialsId: ID!
65
+ $googleServiceAccountKeyId: ID!
66
+ ) {
67
+ androidAppCredentials {
68
+ setGoogleServiceAccountKeyForSubmissions(
69
+ id: $androidAppCredentialsId
70
+ googleServiceAccountKeyId: $googleServiceAccountKeyId
71
+ ) {
72
+ id
73
+ ...CommonAndroidAppCredentialsFragment
74
+ }
75
+ }
76
+ }
77
+ ${(0, graphql_1.print)(AndroidAppCredentials_1.CommonAndroidAppCredentialsFragmentNode)}
78
+ `, {
79
+ androidAppCredentialsId,
80
+ googleServiceAccountKeyId,
81
+ })
82
+ .toPromise());
83
+ (0, assert_1.default)(data.androidAppCredentials.setGoogleServiceAccountKeyForSubmissions, 'GraphQL: `setGoogleServiceAccountKeyForSubmissions` not defined in server response');
84
+ return data.androidAppCredentials.setGoogleServiceAccountKeyForSubmissions;
85
+ },
60
86
  };
@@ -1,4 +1,5 @@
1
1
  import { GoogleServiceAccountKeyFragment, GoogleServiceAccountKeyInput } from '../../../../../graphql/generated';
2
2
  export declare const GoogleServiceAccountKeyMutation: {
3
3
  createGoogleServiceAccountKeyAsync(googleServiceAccountKeyInput: GoogleServiceAccountKeyInput, accountId: string): Promise<GoogleServiceAccountKeyFragment>;
4
+ deleteGoogleServiceAccountKeyAsync(googleServiceAccountKeyId: string): Promise<void>;
4
5
  };
@@ -34,4 +34,21 @@ exports.GoogleServiceAccountKeyMutation = {
34
34
  (0, assert_1.default)(data.googleServiceAccountKey.createGoogleServiceAccountKey, 'GraphQL: `createAndroidFcm` not defined in server response');
35
35
  return data.googleServiceAccountKey.createGoogleServiceAccountKey;
36
36
  },
37
+ async deleteGoogleServiceAccountKeyAsync(googleServiceAccountKeyId) {
38
+ await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
39
+ .mutation((0, graphql_tag_1.default) `
40
+ mutation DeleteGoogleServiceAccountKeyMutation($googleServiceAccountKeyId: ID!) {
41
+ googleServiceAccountKey {
42
+ deleteGoogleServiceAccountKey(id: $googleServiceAccountKeyId) {
43
+ id
44
+ }
45
+ }
46
+ }
47
+ `, {
48
+ googleServiceAccountKeyId,
49
+ }, {
50
+ additionalTypenames: ['GoogleServiceAccountKey', 'AndroidAppCredentials'],
51
+ })
52
+ .toPromise());
53
+ },
37
54
  };
@@ -0,0 +1,4 @@
1
+ import { GoogleServiceAccountKeyFragment } from '../../../../../graphql/generated';
2
+ export declare const GoogleServiceAccountKeyQuery: {
3
+ getAllForAccountAsync(accountName: string): Promise<GoogleServiceAccountKeyFragment[]>;
4
+ };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GoogleServiceAccountKeyQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_1 = require("graphql");
6
+ const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
7
+ const client_1 = require("../../../../../graphql/client");
8
+ const GoogleServiceAccountKey_1 = require("../../../../../graphql/types/credentials/GoogleServiceAccountKey");
9
+ exports.GoogleServiceAccountKeyQuery = {
10
+ async getAllForAccountAsync(accountName) {
11
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
12
+ .query((0, graphql_tag_1.default) `
13
+ query GoogleServiceAccountKeyByAccountQuery($accountName: String!) {
14
+ account {
15
+ byName(accountName: $accountName) {
16
+ id
17
+ googleServiceAccountKeys {
18
+ id
19
+ ...GoogleServiceAccountKeyFragment
20
+ }
21
+ }
22
+ }
23
+ }
24
+ ${(0, graphql_1.print)(GoogleServiceAccountKey_1.GoogleServiceAccountKeyFragmentNode)}
25
+ `, {
26
+ accountName,
27
+ })
28
+ .toPromise());
29
+ return data.account.byName.googleServiceAccountKeys;
30
+ },
31
+ };
@@ -15,6 +15,8 @@ export declare type KeystoreWithType = Keystore & {
15
15
  export declare type GoogleServiceAccountKey = {
16
16
  [key: string]: any;
17
17
  private_key: string;
18
+ type: string;
19
+ client_email: string;
18
20
  };
19
21
  export declare type AndroidCredentials = {
20
22
  experienceName: string;
@@ -1,4 +1,7 @@
1
1
  import Joi from 'joi';
2
+ import { GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
2
3
  import { GoogleServiceAccountKey } from '../credentials';
3
4
  export declare const MinimalGoogleServiceAccountKeySchema: Joi.ObjectSchema<any>;
4
5
  export declare function readAndValidateServiceAccountKey(keyJsonPath: string): GoogleServiceAccountKey;
6
+ export declare function selectGoogleServiceAccountKeyAsync(keys: GoogleServiceAccountKeyFragment[]): Promise<GoogleServiceAccountKeyFragment>;
7
+ export declare function detectGoogleServiceAccountKeyPathAsync(projectDir: string): Promise<string | null>;