eas-cli 7.1.2 → 7.2.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 (41) hide show
  1. package/README.md +64 -62
  2. package/build/build/metadata.js +3 -3
  3. package/build/build/types.d.ts +1 -0
  4. package/build/build/types.js +1 -0
  5. package/build/commands/build/list.d.ts +1 -0
  6. package/build/commands/build/list.js +12 -0
  7. package/build/commands/build/run.js +3 -3
  8. package/build/commands/update/index.d.ts +0 -1
  9. package/build/commands/update/index.js +3 -8
  10. package/build/credentials/android/actions/{AssignGoogleServiceAccountKey.d.ts → AssignGoogleServiceAccountKeyForFcmV1.d.ts} +1 -1
  11. package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForFcmV1.js +19 -0
  12. package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForSubmissions.d.ts +8 -0
  13. package/build/credentials/android/actions/{AssignGoogleServiceAccountKey.js → AssignGoogleServiceAccountKeyForSubmissions.js} +3 -3
  14. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.js +1 -1
  15. package/build/credentials/android/actions/{SetUpGoogleServiceAccountKey.d.ts → SetUpGoogleServiceAccountKeyForFcmV1.d.ts} +1 -1
  16. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.js +59 -0
  17. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.d.ts +10 -0
  18. package/build/credentials/android/actions/{SetUpGoogleServiceAccountKey.js → SetUpGoogleServiceAccountKeyForSubmissions.js} +5 -5
  19. package/build/credentials/android/api/GraphqlClient.d.ts +2 -1
  20. package/build/credentials/android/api/GraphqlClient.js +5 -1
  21. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.d.ts +1 -0
  22. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.js +26 -0
  23. package/build/credentials/android/utils/googleServiceAccountKey.js +1 -1
  24. package/build/credentials/android/utils/printCredentials.js +24 -2
  25. package/build/credentials/ios/actions/CreateAscApiKey.js +1 -5
  26. package/build/credentials/manager/Actions.d.ts +22 -16
  27. package/build/credentials/manager/Actions.js +22 -16
  28. package/build/credentials/manager/AndroidActions.d.ts +3 -1
  29. package/build/credentials/manager/AndroidActions.js +46 -12
  30. package/build/credentials/manager/ManageAndroid.js +30 -12
  31. package/build/graphql/generated.d.ts +198 -0
  32. package/build/graphql/generated.js +3 -0
  33. package/build/graphql/types/Build.js +1 -0
  34. package/build/graphql/types/credentials/AndroidAppCredentials.js +4 -0
  35. package/build/project/customBuildConfig.js +1 -1
  36. package/build/project/publish.d.ts +1 -2
  37. package/build/project/publish.js +1 -4
  38. package/build/run/utils.js +1 -1
  39. package/build/submit/android/ServiceAccountSource.js +2 -2
  40. package/oclif.manifest.json +7 -7
  41. package/package.json +6 -6
@@ -130,7 +130,7 @@ function validateChosenBuild(maybeBuild, selectedPlatform) {
130
130
  return maybeBuild;
131
131
  }
132
132
  async function maybeGetBuildAsync(graphqlClient, flags, projectId, paginatedQueryOptions) {
133
- const distributionType = flags.selectedPlatform === generated_1.AppPlatform.Ios ? generated_1.DistributionType.Simulator : undefined;
133
+ const simulator = flags.selectedPlatform === generated_1.AppPlatform.Ios ? true : undefined;
134
134
  if (flags.runArchiveFlags.id) {
135
135
  const build = await BuildQuery_1.BuildQuery.byIdAsync(graphqlClient, flags.runArchiveFlags.id);
136
136
  return validateChosenBuild(build, flags.selectedPlatform);
@@ -144,9 +144,9 @@ async function maybeGetBuildAsync(graphqlClient, flags, projectId, paginatedQuer
144
144
  title: `Select ${platform_1.appPlatformDisplayNames[flags.selectedPlatform]} ${flags.selectedPlatform === generated_1.AppPlatform.Ios ? 'simulator' : 'emulator'} build to run for ${await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId)} app`,
145
145
  filter: {
146
146
  platform: flags.selectedPlatform,
147
- distribution: distributionType,
148
147
  status: generated_1.BuildStatus.Finished,
149
148
  buildProfile: flags.profile,
149
+ simulator,
150
150
  },
151
151
  paginatedQueryOptions,
152
152
  selectPromptDisabledFunction: build => !(0, utils_1.isRunnableOnSimulatorOrEmulator)(build),
@@ -159,9 +159,9 @@ async function maybeGetBuildAsync(graphqlClient, flags, projectId, paginatedQuer
159
159
  projectId,
160
160
  filter: {
161
161
  platform: flags.selectedPlatform,
162
- distribution: distributionType,
163
162
  status: generated_1.BuildStatus.Finished,
164
163
  buildProfile: flags.profile,
164
+ simulator,
165
165
  },
166
166
  });
167
167
  return validateChosenBuild(latestBuild, flags.selectedPlatform);
@@ -13,7 +13,6 @@ export default class UpdatePublish extends EasCommand {
13
13
  'skip-bundler': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
14
  'clear-cache': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
16
- dev: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
16
  auto: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
17
  'private-key-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
18
  };
@@ -31,7 +31,7 @@ class UpdatePublish extends EasCommand_1.default {
31
31
  async runAsync() {
32
32
  const { flags: rawFlags } = await this.parse(_a);
33
33
  const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(rawFlags);
34
- const { auto: autoFlag, platform: platformFlag, channelName: channelNameArg, dev, updateMessage: updateMessageArg, inputDir, skipBundler, clearCache, privateKeyPath, json: jsonFlag, nonInteractive, branchName: branchNameArg, } = this.sanitizeFlags(rawFlags);
34
+ const { auto: autoFlag, platform: platformFlag, channelName: channelNameArg, updateMessage: updateMessageArg, inputDir, skipBundler, clearCache, privateKeyPath, json: jsonFlag, nonInteractive, branchName: branchNameArg, } = this.sanitizeFlags(rawFlags);
35
35
  const { getDynamicPublicProjectConfigAsync, getDynamicPrivateProjectConfigAsync, loggedIn: { graphqlClient }, vcsClient, } = await this.getContextAsync(_a, {
36
36
  nonInteractive,
37
37
  });
@@ -72,7 +72,7 @@ class UpdatePublish extends EasCommand_1.default {
72
72
  if (!skipBundler) {
73
73
  const bundleSpinner = (0, ora_1.ora)().start('Exporting...');
74
74
  try {
75
- await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir, dev, exp, platformFlag, clearCache });
75
+ await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir, exp, platformFlag, clearCache });
76
76
  bundleSpinner.succeed('Exported bundle(s)');
77
77
  }
78
78
  catch (e) {
@@ -299,7 +299,7 @@ class UpdatePublish extends EasCommand_1.default {
299
299
  sanitizeFlags(flags) {
300
300
  var _b, _c;
301
301
  const nonInteractive = (_b = flags['non-interactive']) !== null && _b !== void 0 ? _b : false;
302
- const { auto, branch: branchName, channel: channelName, dev, message: updateMessage } = flags;
302
+ const { auto, branch: branchName, channel: channelName, message: updateMessage } = flags;
303
303
  if (nonInteractive && !auto && !(updateMessage && (branchName || channelName))) {
304
304
  core_1.Errors.error('--branch and --message, or --channel and --message are required when updating in non-interactive mode unless --auto is specified', { exit: 1 });
305
305
  }
@@ -319,7 +319,6 @@ class UpdatePublish extends EasCommand_1.default {
319
319
  auto,
320
320
  branchName,
321
321
  channelName,
322
- dev,
323
322
  updateMessage,
324
323
  inputDir: flags['input-dir'],
325
324
  skipBundler: flags['skip-bundler'],
@@ -378,10 +377,6 @@ UpdatePublish.flags = {
378
377
  default: 'all',
379
378
  required: false,
380
379
  }),
381
- dev: core_1.Flags.boolean({
382
- description: 'Publish a development bundle',
383
- default: false,
384
- }),
385
380
  auto: core_1.Flags.boolean({
386
381
  description: 'Use the current git branch and commit message for the EAS branch and update message',
387
382
  default: false,
@@ -1,7 +1,7 @@
1
1
  import { CommonAndroidAppCredentialsFragment, GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare class AssignGoogleServiceAccountKey {
4
+ export declare class AssignGoogleServiceAccountKeyForFcmV1 {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
7
  runAsync(ctx: CredentialsContext, googleServiceAccountKey: GoogleServiceAccountKeyFragment): Promise<CommonAndroidAppCredentialsFragment>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssignGoogleServiceAccountKeyForFcmV1 = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const log_1 = tslib_1.__importDefault(require("../../../log"));
6
+ class AssignGoogleServiceAccountKeyForFcmV1 {
7
+ constructor(app) {
8
+ this.app = app;
9
+ }
10
+ async runAsync(ctx, googleServiceAccountKey) {
11
+ const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(ctx.graphqlClient, this.app);
12
+ const updatedAppCredentials = await ctx.android.updateAndroidAppCredentialsAsync(ctx.graphqlClient, appCredentials, {
13
+ googleServiceAccountKeyForFcmV1Id: googleServiceAccountKey.id,
14
+ });
15
+ log_1.default.succeed(`Google Service Account Key assigned to ${this.app.androidApplicationIdentifier} for FCM V1`);
16
+ return updatedAppCredentials;
17
+ }
18
+ }
19
+ exports.AssignGoogleServiceAccountKeyForFcmV1 = AssignGoogleServiceAccountKeyForFcmV1;
@@ -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 AssignGoogleServiceAccountKeyForSubmissions {
5
+ private app;
6
+ constructor(app: AppLookupParams);
7
+ runAsync(ctx: CredentialsContext, googleServiceAccountKey: GoogleServiceAccountKeyFragment): Promise<CommonAndroidAppCredentialsFragment>;
8
+ }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AssignGoogleServiceAccountKey = void 0;
3
+ exports.AssignGoogleServiceAccountKeyForSubmissions = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const log_1 = tslib_1.__importDefault(require("../../../log"));
6
- class AssignGoogleServiceAccountKey {
6
+ class AssignGoogleServiceAccountKeyForSubmissions {
7
7
  constructor(app) {
8
8
  this.app = app;
9
9
  }
@@ -16,4 +16,4 @@ class AssignGoogleServiceAccountKey {
16
16
  return updatedAppCredentials;
17
17
  }
18
18
  }
19
- exports.AssignGoogleServiceAccountKey = AssignGoogleServiceAccountKey;
19
+ exports.AssignGoogleServiceAccountKeyForSubmissions = AssignGoogleServiceAccountKeyForSubmissions;
@@ -35,7 +35,7 @@ class CreateGoogleServiceAccountKey {
35
35
  if (detectedPath) {
36
36
  return detectedPath;
37
37
  }
38
- log_1.default.log(`${chalk_1.default.bold('A Google Service Account JSON key is required to upload your app to Google Play Store')}.\n` +
38
+ log_1.default.log(`${chalk_1.default.bold('A Google Service Account JSON key is required for uploading your app to Google Play Store, and for sending Android Notifications via FCM V1.')}.\n` +
39
39
  `If you're not sure what this is or how to create one, ${(0, log_1.learnMore)('https://expo.fyi/creating-google-service-account', { learnMoreMessage: 'learn more' })}`);
40
40
  const { filePath } = await (0, prompts_1.promptAsync)({
41
41
  name: 'filePath',
@@ -1,7 +1,7 @@
1
1
  import { CommonAndroidAppCredentialsFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare class SetUpGoogleServiceAccountKey {
4
+ export declare class SetUpGoogleServiceAccountKeyForFcmV1 {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
7
  runAsync(ctx: CredentialsContext): Promise<CommonAndroidAppCredentialsFragment>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetUpGoogleServiceAccountKeyForFcmV1 = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
6
+ const AssignGoogleServiceAccountKeyForFcmV1_1 = require("./AssignGoogleServiceAccountKeyForFcmV1");
7
+ const CreateGoogleServiceAccountKey_1 = require("./CreateGoogleServiceAccountKey");
8
+ const UseExistingGoogleServiceAccountKey_1 = require("./UseExistingGoogleServiceAccountKey");
9
+ const log_1 = tslib_1.__importDefault(require("../../../log"));
10
+ const prompts_1 = require("../../../prompts");
11
+ const errors_1 = require("../../errors");
12
+ class SetUpGoogleServiceAccountKeyForFcmV1 {
13
+ constructor(app) {
14
+ this.app = app;
15
+ }
16
+ async runAsync(ctx) {
17
+ const isKeySetup = await this.isGoogleServiceAccountKeySetupAsync(ctx);
18
+ if (isKeySetup) {
19
+ log_1.default.succeed('Google Service Account Key for FCM V1 already set up.');
20
+ return (0, nullthrows_1.default)(await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app), 'androidAppCredentials cannot be null if google service account key is already set up');
21
+ }
22
+ if (ctx.nonInteractive) {
23
+ throw new errors_1.MissingCredentialsNonInteractiveError('Google Service Account Keys cannot be set up in --non-interactive mode.');
24
+ }
25
+ const keysForAccount = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(ctx.graphqlClient, 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 AssignGoogleServiceAccountKeyForFcmV1_1.AssignGoogleServiceAccountKeyForFcmV1(this.app).runAsync(ctx, googleServiceAccountKey);
34
+ }
35
+ async isGoogleServiceAccountKeySetupAsync(ctx) {
36
+ const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
37
+ return !!(appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.googleServiceAccountKeyForFcmV1);
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 FCM V1:',
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.SetUpGoogleServiceAccountKeyForFcmV1 = SetUpGoogleServiceAccountKeyForFcmV1;
@@ -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 SetUpGoogleServiceAccountKeyForSubmissions {
5
+ private app;
6
+ constructor(app: AppLookupParams);
7
+ runAsync(ctx: CredentialsContext): Promise<CommonAndroidAppCredentialsFragment>;
8
+ private isGoogleServiceAccountKeySetupAsync;
9
+ private createOrUseExistingKeyAsync;
10
+ }
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetUpGoogleServiceAccountKey = void 0;
3
+ exports.SetUpGoogleServiceAccountKeyForSubmissions = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
6
- const AssignGoogleServiceAccountKey_1 = require("./AssignGoogleServiceAccountKey");
6
+ const AssignGoogleServiceAccountKeyForSubmissions_1 = require("./AssignGoogleServiceAccountKeyForSubmissions");
7
7
  const CreateGoogleServiceAccountKey_1 = require("./CreateGoogleServiceAccountKey");
8
8
  const UseExistingGoogleServiceAccountKey_1 = require("./UseExistingGoogleServiceAccountKey");
9
9
  const log_1 = tslib_1.__importDefault(require("../../../log"));
10
10
  const prompts_1 = require("../../../prompts");
11
11
  const errors_1 = require("../../errors");
12
- class SetUpGoogleServiceAccountKey {
12
+ class SetUpGoogleServiceAccountKeyForSubmissions {
13
13
  constructor(app) {
14
14
  this.app = app;
15
15
  }
@@ -30,7 +30,7 @@ class SetUpGoogleServiceAccountKey {
30
30
  else {
31
31
  googleServiceAccountKey = await this.createOrUseExistingKeyAsync(ctx);
32
32
  }
33
- return await new AssignGoogleServiceAccountKey_1.AssignGoogleServiceAccountKey(this.app).runAsync(ctx, googleServiceAccountKey);
33
+ return await new AssignGoogleServiceAccountKeyForSubmissions_1.AssignGoogleServiceAccountKeyForSubmissions(this.app).runAsync(ctx, googleServiceAccountKey);
34
34
  }
35
35
  async isGoogleServiceAccountKeySetupAsync(ctx) {
36
36
  const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
@@ -56,4 +56,4 @@ class SetUpGoogleServiceAccountKey {
56
56
  return ((_a = (await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(this.app.account).runAsync(ctx))) !== null && _a !== void 0 ? _a : (await this.createOrUseExistingKeyAsync(ctx)));
57
57
  }
58
58
  }
59
- exports.SetUpGoogleServiceAccountKey = SetUpGoogleServiceAccountKey;
59
+ exports.SetUpGoogleServiceAccountKeyForSubmissions = SetUpGoogleServiceAccountKeyForSubmissions;
@@ -11,9 +11,10 @@ export declare function getAndroidAppBuildCredentialsListAsync(graphqlClient: Ex
11
11
  export declare function getLegacyAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment | null>;
12
12
  export declare function getLegacyAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment | null>;
13
13
  export declare function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment>;
14
- export declare function updateAndroidAppCredentialsAsync(graphqlClient: ExpoGraphqlClient, appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }: {
14
+ export declare function updateAndroidAppCredentialsAsync(graphqlClient: ExpoGraphqlClient, appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, googleServiceAccountKeyForSubmissionsId, googleServiceAccountKeyForFcmV1Id, }: {
15
15
  androidFcmId?: string;
16
16
  googleServiceAccountKeyForSubmissionsId?: string;
17
+ googleServiceAccountKeyForFcmV1Id?: string;
17
18
  }): Promise<CommonAndroidAppCredentialsFragment>;
18
19
  export declare function updateAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, buildCredentials: AndroidAppBuildCredentialsFragment, { androidKeystoreId, }: {
19
20
  androidKeystoreId: string;
@@ -50,7 +50,7 @@ async function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync
50
50
  }
51
51
  }
52
52
  exports.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync = createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync;
53
- async function updateAndroidAppCredentialsAsync(graphqlClient, appCredentials, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }) {
53
+ async function updateAndroidAppCredentialsAsync(graphqlClient, appCredentials, { androidFcmId, googleServiceAccountKeyForSubmissionsId, googleServiceAccountKeyForFcmV1Id, }) {
54
54
  let updatedAppCredentials = appCredentials;
55
55
  if (androidFcmId) {
56
56
  updatedAppCredentials = await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setFcmKeyAsync(graphqlClient, appCredentials.id, androidFcmId);
@@ -59,6 +59,10 @@ async function updateAndroidAppCredentialsAsync(graphqlClient, appCredentials, {
59
59
  updatedAppCredentials =
60
60
  await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setGoogleServiceAccountKeyForSubmissionsAsync(graphqlClient, appCredentials.id, googleServiceAccountKeyForSubmissionsId);
61
61
  }
62
+ if (googleServiceAccountKeyForFcmV1Id) {
63
+ updatedAppCredentials =
64
+ await AndroidAppCredentialsMutation_1.AndroidAppCredentialsMutation.setGoogleServiceAccountKeyForFcmV1Async(graphqlClient, appCredentials.id, googleServiceAccountKeyForFcmV1Id);
65
+ }
62
66
  return updatedAppCredentials;
63
67
  }
64
68
  exports.updateAndroidAppCredentialsAsync = updateAndroidAppCredentialsAsync;
@@ -6,4 +6,5 @@ export declare const AndroidAppCredentialsMutation: {
6
6
  }, appId: string, applicationIdentifier: string): Promise<CommonAndroidAppCredentialsFragment>;
7
7
  setFcmKeyAsync(graphqlClient: ExpoGraphqlClient, androidAppCredentialsId: string, fcmId: string): Promise<CommonAndroidAppCredentialsFragment>;
8
8
  setGoogleServiceAccountKeyForSubmissionsAsync(graphqlClient: ExpoGraphqlClient, androidAppCredentialsId: string, googleServiceAccountKeyId: string): Promise<CommonAndroidAppCredentialsFragment>;
9
+ setGoogleServiceAccountKeyForFcmV1Async(graphqlClient: ExpoGraphqlClient, androidAppCredentialsId: string, googleServiceAccountKeyId: string): Promise<CommonAndroidAppCredentialsFragment>;
9
10
  };
@@ -83,4 +83,30 @@ exports.AndroidAppCredentialsMutation = {
83
83
  (0, assert_1.default)(data.androidAppCredentials.setGoogleServiceAccountKeyForSubmissions, 'GraphQL: `setGoogleServiceAccountKeyForSubmissions` not defined in server response');
84
84
  return data.androidAppCredentials.setGoogleServiceAccountKeyForSubmissions;
85
85
  },
86
+ async setGoogleServiceAccountKeyForFcmV1Async(graphqlClient, androidAppCredentialsId, googleServiceAccountKeyId) {
87
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
88
+ .mutation((0, graphql_tag_1.default) `
89
+ mutation SetGoogleServiceAccountKeyForFcmV1Mutation(
90
+ $androidAppCredentialsId: ID!
91
+ $googleServiceAccountKeyId: ID!
92
+ ) {
93
+ androidAppCredentials {
94
+ setGoogleServiceAccountKeyForFcmV1(
95
+ id: $androidAppCredentialsId
96
+ googleServiceAccountKeyId: $googleServiceAccountKeyId
97
+ ) {
98
+ id
99
+ ...CommonAndroidAppCredentialsFragment
100
+ }
101
+ }
102
+ }
103
+ ${(0, graphql_1.print)(AndroidAppCredentials_1.CommonAndroidAppCredentialsFragmentNode)}
104
+ `, {
105
+ androidAppCredentialsId,
106
+ googleServiceAccountKeyId,
107
+ })
108
+ .toPromise());
109
+ (0, assert_1.default)(data.androidAppCredentials.setGoogleServiceAccountKeyForFcmV1, 'GraphQL: `setGoogleServiceAccountKeyForFcmV1` not defined in server response');
110
+ return data.androidAppCredentials.setGoogleServiceAccountKeyForFcmV1;
111
+ },
86
112
  };
@@ -74,7 +74,7 @@ function formatGoogleServiceAccountKey({ projectIdentifier, privateKeyIdentifier
74
74
  async function detectGoogleServiceAccountKeyPathAsync(projectDir) {
75
75
  const foundFilePaths = await (0, fast_glob_1.default)('**/*.json', {
76
76
  cwd: projectDir,
77
- ignore: ['app.json', 'package*.json', 'tsconfig.json', 'node_modules'],
77
+ ignore: ['app.json', 'package*.json', 'tsconfig.json', 'node_modules', 'google-services.json'],
78
78
  });
79
79
  const googleServiceFiles = foundFilePaths
80
80
  .map(file => path_1.default.join(projectDir, file))
@@ -22,7 +22,7 @@ function displayEmptyAndroidCredentials(appLookupParams) {
22
22
  exports.displayEmptyAndroidCredentials = displayEmptyAndroidCredentials;
23
23
  function displayAndroidFcmCredentials(appCredentials) {
24
24
  const maybeFcm = appCredentials.androidFcm;
25
- log_1.default.log((0, formatFields_1.default)([{ label: 'Push Notifications (FCM)', value: '' }], {
25
+ log_1.default.log((0, formatFields_1.default)([{ label: 'Push Notifications (FCM Legacy)', value: '' }], {
26
26
  labelFormat: chalk_1.default.cyan.bold,
27
27
  }));
28
28
  if (!maybeFcm) {
@@ -49,7 +49,28 @@ function displayAndroidFcmCredentials(appCredentials) {
49
49
  }
50
50
  function displayGoogleServiceAccountKeyForSubmissions(appCredentials) {
51
51
  const maybeGsaKey = appCredentials.googleServiceAccountKeyForSubmissions;
52
- log_1.default.log((0, formatFields_1.default)([{ label: 'Google Service Account Key For Submissions', value: '' }], {
52
+ log_1.default.log((0, formatFields_1.default)([{ label: 'Submissions: Google Service Account Key for Play Store Submissions', value: '' }], {
53
+ labelFormat: chalk_1.default.cyan.bold,
54
+ }));
55
+ if (!maybeGsaKey) {
56
+ log_1.default.log((0, formatFields_1.default)([{ label: '', value: 'None assigned yet' }]));
57
+ log_1.default.newLine();
58
+ return;
59
+ }
60
+ const { projectIdentifier, privateKeyIdentifier, clientEmail, clientIdentifier, updatedAt } = maybeGsaKey;
61
+ const fields = [
62
+ { label: 'Project ID', value: projectIdentifier },
63
+ { label: 'Client Email', value: clientEmail },
64
+ { label: 'Client ID', value: clientIdentifier },
65
+ { label: 'Private Key ID', value: privateKeyIdentifier },
66
+ { label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` },
67
+ ];
68
+ log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
69
+ log_1.default.newLine();
70
+ }
71
+ function displayGoogleServiceAccountKeyForFcmV1(appCredentials) {
72
+ const maybeGsaKey = appCredentials.googleServiceAccountKeyForFcmV1;
73
+ log_1.default.log((0, formatFields_1.default)([{ label: 'Push Notifications (FCM V1): Google Service Account Key For FCM V1', value: '' }], {
53
74
  labelFormat: chalk_1.default.cyan.bold,
54
75
  }));
55
76
  if (!maybeGsaKey) {
@@ -70,6 +91,7 @@ function displayGoogleServiceAccountKeyForSubmissions(appCredentials) {
70
91
  }
71
92
  function displayEASAndroidAppCredentials(appCredentials) {
72
93
  displayAndroidFcmCredentials(appCredentials);
94
+ displayGoogleServiceAccountKeyForFcmV1(appCredentials);
73
95
  displayGoogleServiceAccountKeyForSubmissions(appCredentials);
74
96
  const sortedBuildCredentialsList = (0, BuildCredentialsUtils_1.sortBuildCredentials)(appCredentials.androidAppBuildCredentialsList);
75
97
  for (const buildCredentials of sortedBuildCredentialsList) {
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateAscApiKey = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const AscApiKeyUtils_1 = require("./AscApiKeyUtils");
6
- const log_1 = tslib_1.__importDefault(require("../../../log"));
7
5
  class CreateAscApiKey {
8
6
  constructor(account) {
9
7
  this.account = account;
@@ -13,9 +11,7 @@ class CreateAscApiKey {
13
11
  throw new Error(`A new App Store Connect API Key cannot be created in non-interactive mode.`);
14
12
  }
15
13
  const ascApiKey = await (0, AscApiKeyUtils_1.provideOrGenerateAscApiKeyAsync)(ctx, purpose);
16
- const result = await ctx.ios.createAscApiKeyAsync(ctx.graphqlClient, this.account, ascApiKey);
17
- log_1.default.succeed('Created App Store Connect API Key');
18
- return result;
14
+ return await ctx.ios.createAscApiKeyAsync(ctx.graphqlClient, this.account, ascApiKey);
19
15
  }
20
16
  }
21
17
  exports.CreateAscApiKey = CreateAscApiKey;
@@ -11,22 +11,28 @@ export declare enum Scope {
11
11
  export declare enum AndroidActionType {
12
12
  ManageBuildCredentials = 0,
13
13
  ManageFcm = 1,
14
- ManageGoogleServiceAccountKey = 2,
15
- ManageCredentialsJson = 3,
16
- GoBackToCaller = 4,
17
- GoBackToHighLevelActions = 5,
18
- CreateKeystore = 6,
19
- SetDefaultKeystore = 7,
20
- DownloadKeystore = 8,
21
- RemoveKeystore = 9,
22
- CreateFcm = 10,
23
- RemoveFcm = 11,
24
- CreateGsaKey = 12,
25
- UseExistingGsaKey = 13,
26
- RemoveGsaKey = 14,
27
- SetUpGsaKey = 15,
28
- UpdateCredentialsJson = 16,
29
- SetUpBuildCredentialsFromCredentialsJson = 17
14
+ ManageGoogleServiceAccountKeyForSubmissions = 2,
15
+ ManageGoogleServiceAccount = 3,
16
+ ManageGoogleServiceAccountKeyForFcmV1 = 4,
17
+ ManageCredentialsJson = 5,
18
+ GoBackToCaller = 6,
19
+ GoBackToHighLevelActions = 7,
20
+ CreateKeystore = 8,
21
+ SetDefaultKeystore = 9,
22
+ DownloadKeystore = 10,
23
+ RemoveKeystore = 11,
24
+ CreateFcm = 12,
25
+ RemoveFcm = 13,
26
+ CreateGsaKey = 14,
27
+ UseExistingGsaKeyForSubmissions = 15,
28
+ RemoveGsaKey = 16,
29
+ SetUpGsaKeyForSubmissions = 17,
30
+ CreateGsaKeyForFcmV1 = 18,
31
+ UseExistingGsaKeyForFcmV1 = 19,
32
+ RemoveGsaKeyForFcmV1 = 20,
33
+ SetUpGsaKeyForFcmV1 = 21,
34
+ UpdateCredentialsJson = 22,
35
+ SetUpBuildCredentialsFromCredentialsJson = 23
30
36
  }
31
37
  export declare enum IosActionType {
32
38
  ManageCredentialsJson = 0,
@@ -11,22 +11,28 @@ var AndroidActionType;
11
11
  (function (AndroidActionType) {
12
12
  AndroidActionType[AndroidActionType["ManageBuildCredentials"] = 0] = "ManageBuildCredentials";
13
13
  AndroidActionType[AndroidActionType["ManageFcm"] = 1] = "ManageFcm";
14
- AndroidActionType[AndroidActionType["ManageGoogleServiceAccountKey"] = 2] = "ManageGoogleServiceAccountKey";
15
- AndroidActionType[AndroidActionType["ManageCredentialsJson"] = 3] = "ManageCredentialsJson";
16
- AndroidActionType[AndroidActionType["GoBackToCaller"] = 4] = "GoBackToCaller";
17
- AndroidActionType[AndroidActionType["GoBackToHighLevelActions"] = 5] = "GoBackToHighLevelActions";
18
- AndroidActionType[AndroidActionType["CreateKeystore"] = 6] = "CreateKeystore";
19
- AndroidActionType[AndroidActionType["SetDefaultKeystore"] = 7] = "SetDefaultKeystore";
20
- AndroidActionType[AndroidActionType["DownloadKeystore"] = 8] = "DownloadKeystore";
21
- AndroidActionType[AndroidActionType["RemoveKeystore"] = 9] = "RemoveKeystore";
22
- AndroidActionType[AndroidActionType["CreateFcm"] = 10] = "CreateFcm";
23
- AndroidActionType[AndroidActionType["RemoveFcm"] = 11] = "RemoveFcm";
24
- AndroidActionType[AndroidActionType["CreateGsaKey"] = 12] = "CreateGsaKey";
25
- AndroidActionType[AndroidActionType["UseExistingGsaKey"] = 13] = "UseExistingGsaKey";
26
- AndroidActionType[AndroidActionType["RemoveGsaKey"] = 14] = "RemoveGsaKey";
27
- AndroidActionType[AndroidActionType["SetUpGsaKey"] = 15] = "SetUpGsaKey";
28
- AndroidActionType[AndroidActionType["UpdateCredentialsJson"] = 16] = "UpdateCredentialsJson";
29
- AndroidActionType[AndroidActionType["SetUpBuildCredentialsFromCredentialsJson"] = 17] = "SetUpBuildCredentialsFromCredentialsJson";
14
+ AndroidActionType[AndroidActionType["ManageGoogleServiceAccountKeyForSubmissions"] = 2] = "ManageGoogleServiceAccountKeyForSubmissions";
15
+ AndroidActionType[AndroidActionType["ManageGoogleServiceAccount"] = 3] = "ManageGoogleServiceAccount";
16
+ AndroidActionType[AndroidActionType["ManageGoogleServiceAccountKeyForFcmV1"] = 4] = "ManageGoogleServiceAccountKeyForFcmV1";
17
+ AndroidActionType[AndroidActionType["ManageCredentialsJson"] = 5] = "ManageCredentialsJson";
18
+ AndroidActionType[AndroidActionType["GoBackToCaller"] = 6] = "GoBackToCaller";
19
+ AndroidActionType[AndroidActionType["GoBackToHighLevelActions"] = 7] = "GoBackToHighLevelActions";
20
+ AndroidActionType[AndroidActionType["CreateKeystore"] = 8] = "CreateKeystore";
21
+ AndroidActionType[AndroidActionType["SetDefaultKeystore"] = 9] = "SetDefaultKeystore";
22
+ AndroidActionType[AndroidActionType["DownloadKeystore"] = 10] = "DownloadKeystore";
23
+ AndroidActionType[AndroidActionType["RemoveKeystore"] = 11] = "RemoveKeystore";
24
+ AndroidActionType[AndroidActionType["CreateFcm"] = 12] = "CreateFcm";
25
+ AndroidActionType[AndroidActionType["RemoveFcm"] = 13] = "RemoveFcm";
26
+ AndroidActionType[AndroidActionType["CreateGsaKey"] = 14] = "CreateGsaKey";
27
+ AndroidActionType[AndroidActionType["UseExistingGsaKeyForSubmissions"] = 15] = "UseExistingGsaKeyForSubmissions";
28
+ AndroidActionType[AndroidActionType["RemoveGsaKey"] = 16] = "RemoveGsaKey";
29
+ AndroidActionType[AndroidActionType["SetUpGsaKeyForSubmissions"] = 17] = "SetUpGsaKeyForSubmissions";
30
+ AndroidActionType[AndroidActionType["CreateGsaKeyForFcmV1"] = 18] = "CreateGsaKeyForFcmV1";
31
+ AndroidActionType[AndroidActionType["UseExistingGsaKeyForFcmV1"] = 19] = "UseExistingGsaKeyForFcmV1";
32
+ AndroidActionType[AndroidActionType["RemoveGsaKeyForFcmV1"] = 20] = "RemoveGsaKeyForFcmV1";
33
+ AndroidActionType[AndroidActionType["SetUpGsaKeyForFcmV1"] = 21] = "SetUpGsaKeyForFcmV1";
34
+ AndroidActionType[AndroidActionType["UpdateCredentialsJson"] = 22] = "UpdateCredentialsJson";
35
+ AndroidActionType[AndroidActionType["SetUpBuildCredentialsFromCredentialsJson"] = 23] = "SetUpBuildCredentialsFromCredentialsJson";
30
36
  })(AndroidActionType || (exports.AndroidActionType = AndroidActionType = {}));
31
37
  var IosActionType;
32
38
  (function (IosActionType) {
@@ -3,4 +3,6 @@ export declare const highLevelActions: ActionInfo[];
3
3
  export declare const credentialsJsonActions: ActionInfo[];
4
4
  export declare const buildCredentialsActions: ActionInfo[];
5
5
  export declare const fcmActions: ActionInfo[];
6
- export declare const gsaKeyActions: ActionInfo[];
6
+ export declare const gsaKeyActionsForFcmV1: ActionInfo[];
7
+ export declare const gsaKeyActionsForSubmissions: ActionInfo[];
8
+ export declare const gsaActions: ActionInfo[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gsaKeyActions = exports.fcmActions = exports.buildCredentialsActions = exports.credentialsJsonActions = exports.highLevelActions = void 0;
3
+ exports.gsaActions = exports.gsaKeyActionsForSubmissions = exports.gsaKeyActionsForFcmV1 = exports.fcmActions = exports.buildCredentialsActions = exports.credentialsJsonActions = exports.highLevelActions = void 0;
4
4
  const Actions_1 = require("./Actions");
5
5
  exports.highLevelActions = [
6
6
  {
@@ -9,13 +9,13 @@ exports.highLevelActions = [
9
9
  scope: Actions_1.Scope.Manager,
10
10
  },
11
11
  {
12
- value: Actions_1.AndroidActionType.ManageFcm,
13
- title: 'Push Notifications: Manage your FCM API Key',
12
+ value: Actions_1.AndroidActionType.ManageGoogleServiceAccount,
13
+ title: 'Google Service Account',
14
14
  scope: Actions_1.Scope.Manager,
15
15
  },
16
16
  {
17
- value: Actions_1.AndroidActionType.ManageGoogleServiceAccountKey,
18
- title: 'Google Service Account: Manage your Service Account Key',
17
+ value: Actions_1.AndroidActionType.ManageFcm,
18
+ title: 'Push Notifications (Legacy): Manage your FCM (Legacy) API Key',
19
19
  scope: Actions_1.Scope.Manager,
20
20
  },
21
21
  {
@@ -90,20 +90,54 @@ exports.fcmActions = [
90
90
  scope: Actions_1.Scope.Manager,
91
91
  },
92
92
  ];
93
- exports.gsaKeyActions = [
93
+ exports.gsaKeyActionsForFcmV1 = [
94
94
  {
95
- value: Actions_1.AndroidActionType.SetUpGsaKey,
96
- title: 'Set up a Google Service Account Key',
95
+ value: Actions_1.AndroidActionType.SetUpGsaKeyForFcmV1,
96
+ title: 'Set up a Google Service Account Key for Push Notifications (FCM V1)',
97
97
  scope: Actions_1.Scope.Project,
98
98
  },
99
99
  {
100
- value: Actions_1.AndroidActionType.CreateGsaKey,
101
- title: 'Upload a Google Service Account Key',
100
+ value: Actions_1.AndroidActionType.UseExistingGsaKeyForFcmV1,
101
+ title: 'Select an existing Google Service Account Key for Push Notifications (FCM V1)',
102
+ scope: Actions_1.Scope.Project,
103
+ },
104
+ {
105
+ value: Actions_1.AndroidActionType.GoBackToHighLevelActions,
106
+ title: 'Go back',
107
+ scope: Actions_1.Scope.Manager,
108
+ },
109
+ ];
110
+ exports.gsaKeyActionsForSubmissions = [
111
+ {
112
+ value: Actions_1.AndroidActionType.SetUpGsaKeyForSubmissions,
113
+ title: 'Set up a Google Service Account Key for Play Store Submissions',
114
+ scope: Actions_1.Scope.Project,
115
+ },
116
+ {
117
+ value: Actions_1.AndroidActionType.UseExistingGsaKeyForSubmissions,
118
+ title: 'Select an existing Google Service Account Key for Play Store Submissions',
102
119
  scope: Actions_1.Scope.Project,
103
120
  },
104
121
  {
105
- value: Actions_1.AndroidActionType.UseExistingGsaKey,
106
- title: 'Use an existing Google Service Account Key',
122
+ value: Actions_1.AndroidActionType.GoBackToHighLevelActions,
123
+ title: 'Go back',
124
+ scope: Actions_1.Scope.Manager,
125
+ },
126
+ ];
127
+ exports.gsaActions = [
128
+ {
129
+ value: Actions_1.AndroidActionType.ManageGoogleServiceAccountKeyForSubmissions,
130
+ title: 'Manage your Google Service Account Key for Play Store Submissions',
131
+ scope: Actions_1.Scope.Manager,
132
+ },
133
+ {
134
+ value: Actions_1.AndroidActionType.ManageGoogleServiceAccountKeyForFcmV1,
135
+ title: 'Manage your Google Service Account Key for Push Notifications (FCM V1)',
136
+ scope: Actions_1.Scope.Manager,
137
+ },
138
+ {
139
+ value: Actions_1.AndroidActionType.CreateGsaKey,
140
+ title: 'Upload a Google Service Account Key',
107
141
  scope: Actions_1.Scope.Project,
108
142
  },
109
143
  {