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,3 +1,3 @@
1
- import { Context } from '../../context';
1
+ import { CredentialsContext } from '../../context';
2
2
  import { PushKey } from '../appstore/Credentials.types';
3
- export declare function isPushKeyValidAndTrackedAsync(ctx: Context, pushKey: PushKey): Promise<boolean>;
3
+ export declare function isPushKeyValidAndTrackedAsync(ctx: CredentialsContext, pushKey: PushKey): Promise<boolean>;
@@ -1,3 +1,7 @@
1
+ import { CredentialsContext } from '../context';
2
+ export interface Action<T = void> {
3
+ runAsync(ctx: CredentialsContext): Promise<T>;
4
+ }
1
5
  export declare class PressAnyKeyToContinue {
2
6
  runAsync(): Promise<void>;
3
7
  }
@@ -1,17 +1,23 @@
1
- import { Action, Context } from '../context';
1
+ import { CredentialsContext } from '../context';
2
+ import { Action } from './HelperActions';
2
3
  declare enum ActionType {
3
4
  ManageBuildCredentials = 0,
4
5
  ManageFcm = 1,
5
- ManageCredentialsJson = 2,
6
- GoBackToCaller = 3,
7
- GoBackToHighLevelActions = 4,
8
- CreateKeystore = 5,
9
- DownloadKeystore = 6,
10
- RemoveKeystore = 7,
11
- CreateFcm = 8,
12
- RemoveFcm = 9,
13
- UpdateCredentialsJson = 10,
14
- SetupBuildCredentialsFromCredentialsJson = 11
6
+ ManageGoogleServiceAccountKey = 2,
7
+ ManageCredentialsJson = 3,
8
+ GoBackToCaller = 4,
9
+ GoBackToHighLevelActions = 5,
10
+ CreateKeystore = 6,
11
+ DownloadKeystore = 7,
12
+ RemoveKeystore = 8,
13
+ CreateFcm = 9,
14
+ RemoveFcm = 10,
15
+ CreateGsaKey = 11,
16
+ UseExistingGsaKey = 12,
17
+ RemoveGsaKey = 13,
18
+ SetupGsaKey = 14,
19
+ UpdateCredentialsJson = 15,
20
+ SetupBuildCredentialsFromCredentialsJson = 16
15
21
  }
16
22
  declare enum Scope {
17
23
  Project = 0,
@@ -25,7 +31,7 @@ declare type ActionInfo = {
25
31
  export declare class ManageAndroid {
26
32
  private callingAction;
27
33
  constructor(callingAction: Action);
28
- runAsync(ctx: Context, currentActions?: ActionInfo[]): Promise<void>;
34
+ runAsync(ctx: CredentialsContext, currentActions?: ActionInfo[]): Promise<void>;
29
35
  private createProjectContextAsync;
30
36
  private runProjectSpecificActionAsync;
31
37
  }
@@ -11,14 +11,19 @@ const prompts_1 = require("../../prompts");
11
11
  const Account_1 = require("../../user/Account");
12
12
  const actions_1 = require("../../user/actions");
13
13
  const AssignFcm_1 = require("../android/actions/AssignFcm");
14
+ const AssignGoogleServiceAccountKey_1 = require("../android/actions/AssignGoogleServiceAccountKey");
14
15
  const BuildCredentialsUtils_1 = require("../android/actions/BuildCredentialsUtils");
15
16
  const CreateFcm_1 = require("../android/actions/CreateFcm");
17
+ const CreateGoogleServiceAccountKey_1 = require("../android/actions/CreateGoogleServiceAccountKey");
16
18
  const CreateKeystore_1 = require("../android/actions/CreateKeystore");
17
19
  const DownloadKeystore_1 = require("../android/actions/DownloadKeystore");
18
20
  const RemoveFcm_1 = require("../android/actions/RemoveFcm");
21
+ const RemoveGoogleServiceAccountKey_1 = require("../android/actions/RemoveGoogleServiceAccountKey");
19
22
  const RemoveKeystore_1 = require("../android/actions/RemoveKeystore");
20
23
  const SetupBuildCredentialsFromCredentialsJson_1 = require("../android/actions/SetupBuildCredentialsFromCredentialsJson");
24
+ const SetupGoogleServiceAccountKey_1 = require("../android/actions/SetupGoogleServiceAccountKey");
21
25
  const UpdateCredentialsJson_1 = require("../android/actions/UpdateCredentialsJson");
26
+ const UseExistingGoogleServiceAccountKey_1 = require("../android/actions/UseExistingGoogleServiceAccountKey");
22
27
  const printCredentials_1 = require("../android/utils/printCredentials");
23
28
  const HelperActions_1 = require("./HelperActions");
24
29
  const SelectAndroidBuildCredentials_1 = require("./SelectAndroidBuildCredentials");
@@ -27,16 +32,21 @@ var ActionType;
27
32
  (function (ActionType) {
28
33
  ActionType[ActionType["ManageBuildCredentials"] = 0] = "ManageBuildCredentials";
29
34
  ActionType[ActionType["ManageFcm"] = 1] = "ManageFcm";
30
- ActionType[ActionType["ManageCredentialsJson"] = 2] = "ManageCredentialsJson";
31
- ActionType[ActionType["GoBackToCaller"] = 3] = "GoBackToCaller";
32
- ActionType[ActionType["GoBackToHighLevelActions"] = 4] = "GoBackToHighLevelActions";
33
- ActionType[ActionType["CreateKeystore"] = 5] = "CreateKeystore";
34
- ActionType[ActionType["DownloadKeystore"] = 6] = "DownloadKeystore";
35
- ActionType[ActionType["RemoveKeystore"] = 7] = "RemoveKeystore";
36
- ActionType[ActionType["CreateFcm"] = 8] = "CreateFcm";
37
- ActionType[ActionType["RemoveFcm"] = 9] = "RemoveFcm";
38
- ActionType[ActionType["UpdateCredentialsJson"] = 10] = "UpdateCredentialsJson";
39
- ActionType[ActionType["SetupBuildCredentialsFromCredentialsJson"] = 11] = "SetupBuildCredentialsFromCredentialsJson";
35
+ ActionType[ActionType["ManageGoogleServiceAccountKey"] = 2] = "ManageGoogleServiceAccountKey";
36
+ ActionType[ActionType["ManageCredentialsJson"] = 3] = "ManageCredentialsJson";
37
+ ActionType[ActionType["GoBackToCaller"] = 4] = "GoBackToCaller";
38
+ ActionType[ActionType["GoBackToHighLevelActions"] = 5] = "GoBackToHighLevelActions";
39
+ ActionType[ActionType["CreateKeystore"] = 6] = "CreateKeystore";
40
+ ActionType[ActionType["DownloadKeystore"] = 7] = "DownloadKeystore";
41
+ ActionType[ActionType["RemoveKeystore"] = 8] = "RemoveKeystore";
42
+ ActionType[ActionType["CreateFcm"] = 9] = "CreateFcm";
43
+ ActionType[ActionType["RemoveFcm"] = 10] = "RemoveFcm";
44
+ ActionType[ActionType["CreateGsaKey"] = 11] = "CreateGsaKey";
45
+ ActionType[ActionType["UseExistingGsaKey"] = 12] = "UseExistingGsaKey";
46
+ ActionType[ActionType["RemoveGsaKey"] = 13] = "RemoveGsaKey";
47
+ ActionType[ActionType["SetupGsaKey"] = 14] = "SetupGsaKey";
48
+ ActionType[ActionType["UpdateCredentialsJson"] = 15] = "UpdateCredentialsJson";
49
+ ActionType[ActionType["SetupBuildCredentialsFromCredentialsJson"] = 16] = "SetupBuildCredentialsFromCredentialsJson";
40
50
  })(ActionType || (ActionType = {}));
41
51
  var Scope;
42
52
  (function (Scope) {
@@ -54,6 +64,11 @@ const highLevelActions = [
54
64
  title: 'Push Notifications: Manage your FCM Api Key',
55
65
  scope: Scope.Manager,
56
66
  },
67
+ {
68
+ value: ActionType.ManageGoogleServiceAccountKey,
69
+ title: 'Google Service Account: Manage your Service Account Key',
70
+ scope: Scope.Manager,
71
+ },
57
72
  {
58
73
  value: ActionType.ManageCredentialsJson,
59
74
  title: 'Credentials.json: Upload/Download credentials between EAS servers and your local json ',
@@ -121,6 +136,33 @@ const fcmActions = [
121
136
  scope: Scope.Manager,
122
137
  },
123
138
  ];
139
+ const gsaKeyActions = [
140
+ {
141
+ value: ActionType.SetupGsaKey,
142
+ title: 'Setup a Google Service Account Key',
143
+ scope: Scope.Project,
144
+ },
145
+ {
146
+ value: ActionType.CreateGsaKey,
147
+ title: 'Upload a Google Service Account Key',
148
+ scope: Scope.Project,
149
+ },
150
+ {
151
+ value: ActionType.UseExistingGsaKey,
152
+ title: 'Use an existing Google Service Account Key',
153
+ scope: Scope.Project,
154
+ },
155
+ {
156
+ value: ActionType.RemoveGsaKey,
157
+ title: 'Delete a Google Service Account Key',
158
+ scope: Scope.Project,
159
+ },
160
+ {
161
+ value: ActionType.GoBackToHighLevelActions,
162
+ title: 'Go back',
163
+ scope: Scope.Manager,
164
+ },
165
+ ];
124
166
  class ManageAndroid {
125
167
  constructor(callingAction) {
126
168
  this.callingAction = callingAction;
@@ -177,6 +219,10 @@ class ManageAndroid {
177
219
  currentActions = fcmActions;
178
220
  continue;
179
221
  }
222
+ else if (chosenAction === ActionType.ManageGoogleServiceAccountKey) {
223
+ currentActions = gsaKeyActions;
224
+ continue;
225
+ }
180
226
  else if (chosenAction === ActionType.ManageCredentialsJson) {
181
227
  currentActions = credentialsJsonActions;
182
228
  continue;
@@ -254,6 +300,22 @@ class ManageAndroid {
254
300
  else if (action === ActionType.RemoveFcm) {
255
301
  await new RemoveFcm_1.RemoveFcm(appLookupParams).runAsync(ctx);
256
302
  }
303
+ else if (action === ActionType.CreateGsaKey) {
304
+ const gsaKey = await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
305
+ await new AssignGoogleServiceAccountKey_1.AssignGoogleServiceAccountKey(appLookupParams).runAsync(ctx, gsaKey);
306
+ }
307
+ else if (action === ActionType.UseExistingGsaKey) {
308
+ const gsaKey = await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
309
+ if (gsaKey) {
310
+ await new AssignGoogleServiceAccountKey_1.AssignGoogleServiceAccountKey(appLookupParams).runAsync(ctx, gsaKey);
311
+ }
312
+ }
313
+ else if (action === ActionType.RemoveGsaKey) {
314
+ await new RemoveGoogleServiceAccountKey_1.SelectAndRemoveGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
315
+ }
316
+ else if (action === ActionType.SetupGsaKey) {
317
+ await new SetupGoogleServiceAccountKey_1.SetupGoogleServiceAccountKey(appLookupParams).runAsync(ctx);
318
+ }
257
319
  else if (action === ActionType.UpdateCredentialsJson) {
258
320
  const buildCredentials = await new SelectAndroidBuildCredentials_1.SelectExistingAndroidBuildCredentials(appLookupParams).runAsync(ctx);
259
321
  if (buildCredentials) {
@@ -1,4 +1,5 @@
1
- import { Action, Context } from '../context';
1
+ import { CredentialsContext } from '../context';
2
+ import { Action } from './HelperActions';
2
3
  declare enum ActionType {
3
4
  ManageCredentialsJson = 0,
4
5
  ManageBuildCredentials = 1,
@@ -30,7 +31,7 @@ declare type ActionInfo = {
30
31
  export declare class ManageIos {
31
32
  private callingAction;
32
33
  constructor(callingAction: Action);
33
- runAsync(ctx: Context, currentActions?: ActionInfo[]): Promise<void>;
34
+ runAsync(ctx: CredentialsContext, currentActions?: ActionInfo[]): Promise<void>;
34
35
  private createProjectContextAsync;
35
36
  private runAccountSpecificActionAsync;
36
37
  private runProjectSpecificActionAsync;
@@ -1,7 +1,7 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../graphql/generated';
2
2
  import { AppLookupParams } from '../android/api/GraphqlClient';
3
3
  import { AndroidAppBuildCredentialsMetadataInput } from '../android/api/graphql/mutations/AndroidAppBuildCredentialsMutation';
4
- import { Context } from '../context';
4
+ import { CredentialsContext } from '../context';
5
5
  export declare enum SelectAndroidBuildCredentialsResultType {
6
6
  CREATE_REQUEST = 0,
7
7
  EXISTING_CREDENTIALS = 1
@@ -12,7 +12,7 @@ export declare enum SelectAndroidBuildCredentialsResultType {
12
12
  export declare class SelectAndroidBuildCredentials {
13
13
  private app;
14
14
  constructor(app: AppLookupParams);
15
- runAsync(ctx: Context): Promise<{
15
+ runAsync(ctx: CredentialsContext): Promise<{
16
16
  resultType: SelectAndroidBuildCredentialsResultType.CREATE_REQUEST;
17
17
  result: AndroidAppBuildCredentialsMetadataInput;
18
18
  } | {
@@ -23,5 +23,5 @@ export declare class SelectAndroidBuildCredentials {
23
23
  export declare class SelectExistingAndroidBuildCredentials {
24
24
  private app;
25
25
  constructor(app: AppLookupParams);
26
- runAsync(ctx: Context): Promise<AndroidAppBuildCredentialsFragment | null>;
26
+ runAsync(ctx: CredentialsContext): Promise<AndroidAppBuildCredentialsFragment | null>;
27
27
  }
@@ -1,11 +1,10 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { BuildProfile } from '@expo/eas-json';
3
- import { Context } from '../context';
3
+ import { CredentialsContext } from '../context';
4
4
  export declare class SelectBuildProfileFromEasJson<T extends Platform> {
5
- private projectDir;
6
5
  private platform;
7
6
  private easJsonReader;
8
7
  constructor(projectDir: string, platform: T);
9
- runAsync(ctx: Context): Promise<BuildProfile<T>>;
10
- getProfileNameFromEasConfigAsync(ctx: Context): Promise<string>;
8
+ runAsync(ctx: CredentialsContext): Promise<BuildProfile<T>>;
9
+ getProfileNameFromEasConfigAsync(ctx: CredentialsContext): Promise<string>;
11
10
  }
@@ -7,7 +7,6 @@ const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
7
7
  const prompts_1 = require("../../prompts");
8
8
  class SelectBuildProfileFromEasJson {
9
9
  constructor(projectDir, platform) {
10
- this.projectDir = projectDir;
11
10
  this.platform = platform;
12
11
  this.easJsonReader = new eas_json_1.EasJsonReader(projectDir);
13
12
  }
@@ -1,9 +1,9 @@
1
1
  import { IosBuildProfile } from '@expo/eas-json';
2
2
  import { IosDistributionType as IosDistributionTypeGraphql } from '../../graphql/generated';
3
- import { Context } from '../context';
3
+ import { CredentialsContext } from '../context';
4
4
  export declare class SelectIosDistributionTypeGraphqlFromBuildProfile {
5
5
  private buildProfile;
6
6
  constructor(buildProfile: IosBuildProfile);
7
- runAsync(ctx: Context): Promise<IosDistributionTypeGraphql>;
8
- resolveInternalDistributionAsync(ctx: Context): Promise<IosDistributionTypeGraphql>;
7
+ runAsync(ctx: CredentialsContext): Promise<IosDistributionTypeGraphql>;
8
+ resolveInternalDistributionAsync(ctx: CredentialsContext): Promise<IosDistributionTypeGraphql>;
9
9
  }
@@ -1,4 +1,4 @@
1
- import { Action, Context } from '../context';
2
- export declare class SelectPlatform implements Action {
3
- runAsync(ctx: Context): Promise<void>;
1
+ import { CredentialsContext } from '../context';
2
+ export declare class SelectPlatform {
3
+ runAsync(ctx: CredentialsContext): Promise<void>;
4
4
  }
@@ -4,7 +4,7 @@ exports.createContextAsync = void 0;
4
4
  const config_1 = require("@expo/config");
5
5
  const projectUtils_1 = require("../project/projectUtils");
6
6
  async function createContextAsync({ appStore, cwd, user, }) {
7
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)(cwd);
7
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)({ cwd });
8
8
  let exp = null;
9
9
  if (projectDir) {
10
10
  const config = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
@@ -1837,16 +1837,25 @@ export declare type DeleteAndroidKeystoreResult = {
1837
1837
  };
1838
1838
  export declare type GoogleServiceAccountKeyMutation = {
1839
1839
  __typename?: 'GoogleServiceAccountKeyMutation';
1840
- /** Create an Google Service Account Key */
1840
+ /** Create a Google Service Account Key */
1841
1841
  createGoogleServiceAccountKey: GoogleServiceAccountKey;
1842
+ /** Delete a Google Service Account Key */
1843
+ deleteGoogleServiceAccountKey: DeleteGoogleServiceAccountKeyResult;
1842
1844
  };
1843
1845
  export declare type GoogleServiceAccountKeyMutationCreateGoogleServiceAccountKeyArgs = {
1844
1846
  googleServiceAccountKeyInput: GoogleServiceAccountKeyInput;
1845
1847
  accountId: Scalars['ID'];
1846
1848
  };
1849
+ export declare type GoogleServiceAccountKeyMutationDeleteGoogleServiceAccountKeyArgs = {
1850
+ id: Scalars['ID'];
1851
+ };
1847
1852
  export declare type GoogleServiceAccountKeyInput = {
1848
1853
  jsonKey: Scalars['JSONObject'];
1849
1854
  };
1855
+ export declare type DeleteGoogleServiceAccountKeyResult = {
1856
+ __typename?: 'DeleteGoogleServiceAccountKeyResult';
1857
+ id: Scalars['ID'];
1858
+ };
1850
1859
  export declare type AppleAppIdentifierMutation = {
1851
1860
  __typename?: 'AppleAppIdentifierMutation';
1852
1861
  /** Create an Identifier for an iOS App */
@@ -3266,6 +3275,21 @@ export declare type SetFcmMutation = ({
3266
3275
  } & Pick<AndroidAppCredentials, 'id'> & CommonAndroidAppCredentialsFragment)>;
3267
3276
  });
3268
3277
  });
3278
+ export declare type SetGoogleServiceAccountKeyForSubmissionsMutationVariables = Exact<{
3279
+ androidAppCredentialsId: Scalars['ID'];
3280
+ googleServiceAccountKeyId: Scalars['ID'];
3281
+ }>;
3282
+ export declare type SetGoogleServiceAccountKeyForSubmissionsMutation = ({
3283
+ __typename?: 'RootMutation';
3284
+ } & {
3285
+ androidAppCredentials: ({
3286
+ __typename?: 'AndroidAppCredentialsMutation';
3287
+ } & {
3288
+ setGoogleServiceAccountKeyForSubmissions?: Maybe<({
3289
+ __typename?: 'AndroidAppCredentials';
3290
+ } & Pick<AndroidAppCredentials, 'id'> & CommonAndroidAppCredentialsFragment)>;
3291
+ });
3292
+ });
3269
3293
  export declare type CreateAndroidFcmMutationVariables = Exact<{
3270
3294
  androidFcmInput: AndroidFcmInput;
3271
3295
  accountId: Scalars['ID'];
@@ -3339,6 +3363,20 @@ export declare type CreateGoogleServiceAccountKeyMutation = ({
3339
3363
  } & Pick<GoogleServiceAccountKey, 'id'> & GoogleServiceAccountKeyFragment);
3340
3364
  });
3341
3365
  });
3366
+ export declare type DeleteGoogleServiceAccountKeyMutationVariables = Exact<{
3367
+ googleServiceAccountKeyId: Scalars['ID'];
3368
+ }>;
3369
+ export declare type DeleteGoogleServiceAccountKeyMutation = ({
3370
+ __typename?: 'RootMutation';
3371
+ } & {
3372
+ googleServiceAccountKey: ({
3373
+ __typename?: 'GoogleServiceAccountKeyMutation';
3374
+ } & {
3375
+ deleteGoogleServiceAccountKey: ({
3376
+ __typename?: 'DeleteGoogleServiceAccountKeyResult';
3377
+ } & Pick<DeleteGoogleServiceAccountKeyResult, 'id'>);
3378
+ });
3379
+ });
3342
3380
  export declare type CommonAndroidAppCredentialsWithBuildCredentialsByApplicationIdentifierQueryVariables = Exact<{
3343
3381
  projectFullName: Scalars['String'];
3344
3382
  applicationIdentifier?: Maybe<Scalars['String']>;
@@ -3359,6 +3397,24 @@ export declare type CommonAndroidAppCredentialsWithBuildCredentialsByApplication
3359
3397
  });
3360
3398
  })>;
3361
3399
  });
3400
+ export declare type GoogleServiceAccountKeyByAccountQueryVariables = Exact<{
3401
+ accountName: Scalars['String'];
3402
+ }>;
3403
+ export declare type GoogleServiceAccountKeyByAccountQuery = ({
3404
+ __typename?: 'RootQuery';
3405
+ } & {
3406
+ account: ({
3407
+ __typename?: 'AccountQuery';
3408
+ } & {
3409
+ byName: ({
3410
+ __typename?: 'Account';
3411
+ } & Pick<Account, 'id'> & {
3412
+ googleServiceAccountKeys: Array<({
3413
+ __typename?: 'GoogleServiceAccountKey';
3414
+ } & Pick<GoogleServiceAccountKey, 'id'> & GoogleServiceAccountKeyFragment)>;
3415
+ });
3416
+ });
3417
+ });
3362
3418
  export declare type CreateAppleAppIdentifierMutationVariables = Exact<{
3363
3419
  appleAppIdentifierInput: AppleAppIdentifierInput;
3364
3420
  accountId: Scalars['ID'];
@@ -4421,6 +4477,9 @@ export declare type CommonAndroidAppCredentialsFragment = ({
4421
4477
  androidFcm?: Maybe<({
4422
4478
  __typename?: 'AndroidFcm';
4423
4479
  } & Pick<AndroidFcm, 'id'> & AndroidFcmFragment)>;
4480
+ googleServiceAccountKeyForSubmissions?: Maybe<({
4481
+ __typename?: 'GoogleServiceAccountKey';
4482
+ } & Pick<GoogleServiceAccountKey, 'id'> & GoogleServiceAccountKeyFragment)>;
4424
4483
  androidAppBuildCredentialsList: Array<({
4425
4484
  __typename?: 'AndroidAppBuildCredentials';
4426
4485
  } & Pick<AndroidAppBuildCredentials, 'id'> & AndroidAppBuildCredentialsFragment)>;
@@ -6,6 +6,7 @@ const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
6
6
  const App_1 = require("../App");
7
7
  const AndroidAppBuildCredentials_1 = require("./AndroidAppBuildCredentials");
8
8
  const AndroidFcm_1 = require("./AndroidFcm");
9
+ const GoogleServiceAccountKey_1 = require("./GoogleServiceAccountKey");
9
10
  exports.CommonAndroidAppCredentialsFragmentNode = (0, graphql_tag_1.default) `
10
11
  fragment CommonAndroidAppCredentialsFragment on AndroidAppCredentials {
11
12
  id
@@ -19,6 +20,10 @@ exports.CommonAndroidAppCredentialsFragmentNode = (0, graphql_tag_1.default) `
19
20
  id
20
21
  ...AndroidFcmFragment
21
22
  }
23
+ googleServiceAccountKeyForSubmissions {
24
+ id
25
+ ...GoogleServiceAccountKeyFragment
26
+ }
22
27
  androidAppBuildCredentialsList {
23
28
  id
24
29
  ...AndroidAppBuildCredentialsFragment
@@ -26,5 +31,6 @@ exports.CommonAndroidAppCredentialsFragmentNode = (0, graphql_tag_1.default) `
26
31
  }
27
32
  ${App_1.AppFragmentNode}
28
33
  ${AndroidFcm_1.AndroidFcmFragmentNode}
34
+ ${GoogleServiceAccountKey_1.GoogleServiceAccountKeyFragmentNode}
29
35
  ${AndroidAppBuildCredentials_1.AndroidAppBuildCredentialsFragmentNode}
30
36
  `;
@@ -47,10 +47,10 @@ async function getApplicationIdAsync(projectDir, exp, gradleContext) {
47
47
  buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
48
48
  }
49
49
  catch { }
50
- if (!buildGradlePath || !fs_extra_1.default.pathExistsSync(buildGradlePath)) {
50
+ if (!buildGradlePath || !(await fs_extra_1.default.pathExists(buildGradlePath))) {
51
51
  throw new Error(errorMessage);
52
52
  }
53
- const buildGradle = fs_extra_1.default.readFileSync(buildGradlePath, 'utf8');
53
+ const buildGradle = await fs_extra_1.default.readFile(buildGradlePath, 'utf8');
54
54
  const matchResult = buildGradle.match(/applicationId ['"](.*)['"]/);
55
55
  const applicationId = (0, nullthrows_1.default)(matchResult === null || matchResult === void 0 ? void 0 : matchResult[1], errorMessage);
56
56
  log_1.default.warn(`Unable to detect applicationId`);
@@ -5,7 +5,10 @@ import { Actor } from '../user/User';
5
5
  export declare function getProjectAccountName(exp: ExpoConfig, user: Actor): string;
6
6
  export declare function getUsername(exp: ExpoConfig, user: Actor): string | undefined;
7
7
  export declare function getProjectAccountNameAsync(exp: ExpoConfig): Promise<string>;
8
- export declare function findProjectRootAsync(cwd?: string): Promise<string | null>;
8
+ export declare function findProjectRootAsync({ cwd, defaultToProcessCwd, }?: {
9
+ cwd?: string;
10
+ defaultToProcessCwd?: boolean;
11
+ }): Promise<string>;
9
12
  export declare function setProjectIdAsync(projectDir: string, options?: {
10
13
  env?: Env;
11
14
  }): Promise<ExpoConfig | undefined>;
@@ -45,9 +45,19 @@ async function getProjectAccountNameAsync(exp) {
45
45
  return getProjectAccountName(exp, user);
46
46
  }
47
47
  exports.getProjectAccountNameAsync = getProjectAccountNameAsync;
48
- async function findProjectRootAsync(cwd) {
48
+ async function findProjectRootAsync({ cwd, defaultToProcessCwd = false, } = {}) {
49
49
  const projectRootDir = await (0, pkg_dir_1.default)(cwd);
50
- return projectRootDir !== null && projectRootDir !== void 0 ? projectRootDir : null;
50
+ if (!projectRootDir) {
51
+ if (!defaultToProcessCwd) {
52
+ throw new Error('Please run this command inside a project directory.');
53
+ }
54
+ else {
55
+ return process.cwd();
56
+ }
57
+ }
58
+ else {
59
+ return projectRootDir;
60
+ }
51
61
  }
52
62
  exports.findProjectRootAsync = findProjectRootAsync;
53
63
  async function setProjectIdAsync(projectDir, options = {}) {
@@ -106,7 +116,7 @@ async function getProjectIdAsync(exp, options = {}) {
106
116
  return localProjectId;
107
117
  }
108
118
  // Set the project ID if it is missing.
109
- const projectDir = await findProjectRootAsync(process.cwd());
119
+ const projectDir = await findProjectRootAsync();
110
120
  if (!projectDir) {
111
121
  throw new Error('Please run this command inside a project directory.');
112
122
  }
@@ -62,12 +62,12 @@ export declare function buildBundlesAsync({ projectDir, inputDir, }: {
62
62
  projectDir: string;
63
63
  inputDir: string;
64
64
  }): Promise<void>;
65
- export declare function resolveInputDirectory(customInputDirectory: string): string;
65
+ export declare function resolveInputDirectoryAsync(customInputDirectory: string): Promise<string>;
66
66
  export declare function loadMetadata(distRoot: string): Metadata;
67
- export declare function collectAssets({ inputDir, platforms, }: {
67
+ export declare function collectAssetsAsync({ inputDir, platforms, }: {
68
68
  inputDir: string;
69
69
  platforms: PublishPlatform[];
70
- }): CollectedAssets;
70
+ }): Promise<CollectedAssets>;
71
71
  export declare function filterOutAssetsThatAlreadyExistAsync(uniqueAssetsWithStorageKey: (RawAsset & {
72
72
  storageKey: string;
73
73
  })[]): Promise<(RawAsset & {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssets = exports.loadMetadata = exports.resolveInputDirectory = exports.buildBundlesAsync = exports.buildUnsortedUpdateInfoGroupAsync = exports.convertAssetToUpdateInfoGroupFormatAsync = exports.getStorageKeyForAssetAsync = exports.getStorageKey = exports.getBase64URLEncoding = exports.guessContentTypeFromExtension = exports.MetadataJoi = exports.TIMEOUT_LIMIT = void 0;
3
+ exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssetsAsync = exports.loadMetadata = exports.resolveInputDirectoryAsync = exports.buildBundlesAsync = exports.buildUnsortedUpdateInfoGroupAsync = exports.convertAssetToUpdateInfoGroupFormatAsync = exports.getStorageKeyForAssetAsync = exports.getStorageKey = exports.getBase64URLEncoding = exports.guessContentTypeFromExtension = exports.MetadataJoi = exports.TIMEOUT_LIMIT = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
6
6
  const crypto_1 = (0, tslib_1.__importDefault)(require("crypto"));
7
- const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
7
+ const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
8
8
  const joi_1 = (0, tslib_1.__importDefault)(require("joi"));
9
9
  const mime_1 = (0, tslib_1.__importDefault)(require("mime"));
10
10
  const path_1 = (0, tslib_1.__importDefault)(require("path"));
@@ -56,7 +56,7 @@ function getStorageKey(contentType, contentHash) {
56
56
  exports.getStorageKey = getStorageKey;
57
57
  async function calculateFileHashAsync(filePath, algorithm) {
58
58
  return new Promise((resolve, reject) => {
59
- const file = fs_1.default.createReadStream(filePath).on('error', reject);
59
+ const file = fs_extra_1.default.createReadStream(filePath).on('error', reject);
60
60
  const hash = file.pipe(crypto_1.default.createHash(algorithm)).on('error', reject);
61
61
  hash.on('finish', () => resolve(hash.read()));
62
62
  });
@@ -111,9 +111,9 @@ async function buildBundlesAsync({ projectDir, inputDir, }) {
111
111
  await (0, expoCommand_1.expoCommandAsync)(projectDir, ['export', '--output-dir', inputDir, '--experimental-bundle']);
112
112
  }
113
113
  exports.buildBundlesAsync = buildBundlesAsync;
114
- function resolveInputDirectory(customInputDirectory) {
114
+ async function resolveInputDirectoryAsync(customInputDirectory) {
115
115
  const distRoot = path_1.default.resolve(customInputDirectory);
116
- if (!fs_1.default.existsSync(distRoot)) {
116
+ if (!(await fs_extra_1.default.pathExists(distRoot))) {
117
117
  throw new Error(`The input directory "${customInputDirectory}" does not exist.
118
118
  You can allow us to build it for you by not setting the --skip-bundler flag.
119
119
  If you chose to build it yourself you'll need to run a command to build the JS
@@ -122,7 +122,7 @@ function resolveInputDirectory(customInputDirectory) {
122
122
  }
123
123
  return distRoot;
124
124
  }
125
- exports.resolveInputDirectory = resolveInputDirectory;
125
+ exports.resolveInputDirectoryAsync = resolveInputDirectoryAsync;
126
126
  function loadMetadata(distRoot) {
127
127
  const metadata = json_file_1.default.read(path_1.default.join(distRoot, 'metadata.json'));
128
128
  const { error } = exports.MetadataJoi.validate(metadata);
@@ -140,8 +140,8 @@ function loadMetadata(distRoot) {
140
140
  return metadata;
141
141
  }
142
142
  exports.loadMetadata = loadMetadata;
143
- function collectAssets({ inputDir, platforms, }) {
144
- const distRoot = resolveInputDirectory(inputDir);
143
+ async function collectAssetsAsync({ inputDir, platforms, }) {
144
+ const distRoot = await resolveInputDirectoryAsync(inputDir);
145
145
  const metadata = loadMetadata(distRoot);
146
146
  const assetsFinal = {};
147
147
  for (const platform of platforms) {
@@ -167,7 +167,7 @@ function collectAssets({ inputDir, platforms, }) {
167
167
  }
168
168
  return assetsFinal;
169
169
  }
170
- exports.collectAssets = collectAssets;
170
+ exports.collectAssetsAsync = collectAssetsAsync;
171
171
  async function filterOutAssetsThatAlreadyExistAsync(uniqueAssetsWithStorageKey) {
172
172
  const assetMetadata = await PublishQuery_1.PublishQuery.getAssetMetadataAsync(uniqueAssetsWithStorageKey.map(asset => asset.storageKey));
173
173
  const missingAssetKeys = assetMetadata
@@ -200,7 +200,7 @@ async function uploadAssetsAsync(assetsForUpdateInfoGroup) {
200
200
  const { specifications } = await PublishMutation_1.PublishMutation.getUploadURLsAsync(missingAssets.map(ma => ma.contentType));
201
201
  await Promise.all(missingAssets.map((missingAsset, i) => {
202
202
  const presignedPost = JSON.parse(specifications[i]);
203
- return (0, uploads_1.uploadWithPresignedPostAsync)(fs_1.default.createReadStream(missingAsset.path), presignedPost);
203
+ return (0, uploads_1.uploadWithPresignedPostAsync)(fs_extra_1.default.createReadStream(missingAsset.path), presignedPost);
204
204
  }));
205
205
  // Wait up to TIMEOUT_LIMIT for assets to be uploaded and processed
206
206
  const start = Date.now();
@@ -120,14 +120,9 @@ class AndroidSubmitCommand {
120
120
  path: serviceAccountKeyPath,
121
121
  });
122
122
  }
123
- else if (this.ctx.nonInteractive) {
124
- return (0, results_1.result)(new Error('Set serviceAccountKeyPath in the submit profile (eas.json).'));
125
- }
126
- else {
127
- return (0, results_1.result)({
128
- sourceType: ServiceAccountSource_1.ServiceAccountSourceType.detect,
129
- });
130
- }
123
+ return (0, results_1.result)({
124
+ sourceType: ServiceAccountSource_1.ServiceAccountSourceType.credentialsService,
125
+ });
131
126
  }
132
127
  }
133
128
  exports.default = AndroidSubmitCommand;