eas-cli 0.33.0 → 0.35.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 (170) hide show
  1. package/README.md +27 -27
  2. package/build/analytics.js +3 -9
  3. package/build/api.js +3 -3
  4. package/build/build/android/UpdatesModule.js +4 -15
  5. package/build/build/android/configure.js +2 -2
  6. package/build/build/android/graphql.js +2 -4
  7. package/build/build/android/prepareJob.js +4 -3
  8. package/build/build/build.js +2 -2
  9. package/build/build/configure.js +14 -7
  10. package/build/build/ios/UpdatesModule.js +6 -18
  11. package/build/build/ios/graphql.js +2 -23
  12. package/build/build/ios/prepareJob.js +4 -6
  13. package/build/build/metadata.js +5 -10
  14. package/build/build/utils/devClient.js +8 -5
  15. package/build/build/utils/formatBuild.js +1 -9
  16. package/build/build/utils/repository.js +10 -7
  17. package/build/build/utils/url.js +1 -1
  18. package/build/build/validate.js +4 -4
  19. package/build/commandUtils/EasCommand.d.ts +1 -0
  20. package/build/commandUtils/EasCommand.js +21 -0
  21. package/build/commands/branch/create.js +3 -2
  22. package/build/commands/branch/delete.js +1 -1
  23. package/build/commands/branch/list.js +1 -1
  24. package/build/commands/branch/publish.js +20 -48
  25. package/build/commands/branch/view.js +1 -1
  26. package/build/commands/build/index.js +43 -24
  27. package/build/commands/channel/edit.js +1 -1
  28. package/build/commands/channel/list.js +1 -1
  29. package/build/commands/channel/view.js +1 -1
  30. package/build/commands/diagnostics.js +2 -2
  31. package/build/commands/project/info.js +1 -1
  32. package/build/commands/secret/delete.js +1 -1
  33. package/build/commands/update/view.js +1 -1
  34. package/build/credentials/android/AndroidCredentialsProvider.js +2 -2
  35. package/build/credentials/android/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  36. package/build/credentials/android/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +3 -3
  37. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  38. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +3 -3
  39. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.d.ts → SetUpGoogleServiceAccountKey.d.ts} +1 -1
  40. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.js → SetUpGoogleServiceAccountKey.js} +3 -3
  41. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -0
  42. package/build/credentials/credentialsJson/update.js +5 -4
  43. package/build/credentials/errors.d.ts +4 -0
  44. package/build/credentials/errors.js +8 -1
  45. package/build/credentials/ios/IosCredentialsProvider.js +4 -4
  46. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +17 -1
  47. package/build/credentials/ios/actions/AscApiKeyUtils.js +156 -23
  48. package/build/credentials/ios/actions/AssignAscApiKey.d.ts +9 -0
  49. package/build/credentials/ios/actions/AssignAscApiKey.js +29 -0
  50. package/build/credentials/ios/actions/CreateAscApiKey.d.ts +9 -0
  51. package/build/credentials/ios/actions/CreateAscApiKey.js +21 -0
  52. package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
  53. package/build/credentials/ios/actions/CreatePushKey.js +1 -1
  54. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +1 -1
  55. package/build/credentials/ios/actions/DistributionCertificateUtils.js +6 -8
  56. package/build/credentials/ios/actions/PushKeyUtils.d.ts +1 -1
  57. package/build/credentials/ios/actions/PushKeyUtils.js +6 -6
  58. package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +14 -0
  59. package/build/credentials/ios/actions/RemoveAscApiKey.js +55 -0
  60. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.d.ts → SetUpAdhocProvisioningProfile.d.ts} +1 -1
  61. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.js → SetUpAdhocProvisioningProfile.js} +5 -5
  62. package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +21 -0
  63. package/build/credentials/ios/actions/SetUpAscApiKey.js +114 -0
  64. package/build/credentials/ios/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  65. package/build/credentials/ios/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +5 -5
  66. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  67. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +5 -5
  68. package/build/credentials/ios/actions/{SetupDistributionCertificate.d.ts → SetUpDistributionCertificate.d.ts} +1 -1
  69. package/build/credentials/ios/actions/{SetupDistributionCertificate.js → SetUpDistributionCertificate.js} +3 -3
  70. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.d.ts → SetUpInternalProvisioningProfile.d.ts} +1 -1
  71. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.js → SetUpInternalProvisioningProfile.js} +7 -7
  72. package/build/credentials/ios/actions/{SetupProvisioningProfile.d.ts → SetUpProvisioningProfile.d.ts} +1 -1
  73. package/build/credentials/ios/actions/{SetupProvisioningProfile.js → SetUpProvisioningProfile.js} +5 -5
  74. package/build/credentials/ios/actions/{SetupPushKey.d.ts → SetUpPushKey.d.ts} +1 -1
  75. package/build/credentials/ios/actions/{SetupPushKey.js → SetUpPushKey.js} +3 -3
  76. package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +10 -0
  77. package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +53 -0
  78. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.d.ts → SetUpTargetBuildCredentials.d.ts} +1 -1
  79. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.js → SetUpTargetBuildCredentials.js} +10 -10
  80. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.d.ts → SetUpTargetBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  81. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.js → SetUpTargetBuildCredentialsFromCredentialsJson.js} +3 -3
  82. package/build/credentials/ios/api/GraphqlClient.d.ts +8 -2
  83. package/build/credentials/ios/api/GraphqlClient.js +74 -2
  84. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.d.ts +5 -0
  85. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.js +54 -0
  86. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.d.ts +1 -0
  87. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.js +25 -0
  88. package/build/credentials/ios/api/graphql/queries/AppQuery.js +3 -1
  89. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +4 -0
  90. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +33 -0
  91. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -2
  92. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +7 -1
  93. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +5 -1
  94. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -0
  95. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +5 -1
  96. package/build/credentials/ios/appstore/AppStoreApi.d.ts +1 -1
  97. package/build/credentials/ios/appstore/Credentials.types.d.ts +1 -0
  98. package/build/credentials/ios/appstore/ascApiKey.d.ts +1 -1
  99. package/build/credentials/ios/appstore/ascApiKey.js +22 -12
  100. package/build/credentials/ios/credentials.d.ts +2 -1
  101. package/build/credentials/ios/credentials.js +8 -3
  102. package/build/credentials/ios/utils/printCredentials.js +30 -1
  103. package/build/credentials/ios/validators/validateAscApiKey.d.ts +5 -0
  104. package/build/credentials/ios/validators/validateAscApiKey.js +21 -0
  105. package/build/credentials/manager/Actions.d.ts +52 -0
  106. package/build/credentials/manager/Actions.js +53 -0
  107. package/build/credentials/manager/AndroidActions.d.ts +6 -0
  108. package/build/credentials/manager/AndroidActions.js +114 -0
  109. package/build/credentials/manager/IosActions.d.ts +7 -0
  110. package/build/credentials/manager/IosActions.js +145 -0
  111. package/build/credentials/manager/ManageAndroid.d.ts +1 -29
  112. package/build/credentials/manager/ManageAndroid.js +30 -163
  113. package/build/credentials/manager/ManageIos.d.ts +1 -29
  114. package/build/credentials/manager/ManageIos.js +78 -166
  115. package/build/credentials/utils/promptForCredentials.d.ts +2 -1
  116. package/build/credentials/utils/promptForCredentials.js +3 -2
  117. package/build/graphql/client.d.ts +8 -2
  118. package/build/graphql/client.js +1 -1
  119. package/build/graphql/generated.d.ts +170 -33
  120. package/build/graphql/generated.js +23 -1
  121. package/build/graphql/queries/BuildQuery.js +4 -1
  122. package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -2
  123. package/build/graphql/queries/ProjectQuery.js +3 -1
  124. package/build/graphql/queries/PublishQuery.js +4 -1
  125. package/build/graphql/queries/SubmissionQuery.js +5 -2
  126. package/build/graphql/queries/UserQuery.js +4 -1
  127. package/build/graphql/queries/WebhookQuery.js +6 -2
  128. package/build/graphql/types/Build.js +1 -6
  129. package/build/graphql/types/credentials/AppStoreConnectApiKey.d.ts +1 -0
  130. package/build/graphql/types/credentials/AppStoreConnectApiKey.js +23 -0
  131. package/build/graphql/types/credentials/IosAppCredentials.js +6 -0
  132. package/build/log.d.ts +0 -2
  133. package/build/log.js +2 -12
  134. package/build/project/projectUtils.js +1 -1
  135. package/build/project/publish.js +2 -2
  136. package/build/project/workflow.js +2 -2
  137. package/build/submit/ArchiveSource.js +6 -5
  138. package/build/submit/android/ServiceAccountSource.js +2 -2
  139. package/build/submit/ios/AppSpecificPasswordSource.d.ts +2 -6
  140. package/build/submit/ios/AppSpecificPasswordSource.js +0 -18
  141. package/build/submit/ios/AscApiKeySource.d.ts +9 -3
  142. package/build/submit/ios/AscApiKeySource.js +10 -10
  143. package/build/submit/ios/CredentialsServiceSource.d.ts +14 -0
  144. package/build/submit/ios/CredentialsServiceSource.js +46 -0
  145. package/build/submit/ios/IosSubmitCommand.js +22 -14
  146. package/build/submit/ios/IosSubmitter.d.ts +3 -0
  147. package/build/submit/ios/IosSubmitter.js +30 -20
  148. package/build/submit/utils/errors.js +2 -0
  149. package/build/user/User.js +1 -0
  150. package/build/utils/easCli.d.ts +1 -0
  151. package/build/utils/easCli.js +5 -0
  152. package/build/utils/{expoCommand.d.ts → expoCli.d.ts} +0 -0
  153. package/build/utils/{expoCommand.js → expoCli.js} +0 -0
  154. package/build/utils/profiles.js +9 -2
  155. package/build/vcs/clients/git.d.ts +26 -0
  156. package/build/vcs/clients/git.js +184 -0
  157. package/build/vcs/clients/gitNoCommit.d.ts +7 -0
  158. package/build/vcs/clients/gitNoCommit.js +27 -0
  159. package/build/vcs/clients/noVcs.d.ts +6 -0
  160. package/build/vcs/clients/noVcs.js +19 -0
  161. package/build/vcs/git.d.ts +10 -17
  162. package/build/vcs/git.js +7 -175
  163. package/build/vcs/index.d.ts +2 -2
  164. package/build/vcs/index.js +15 -6
  165. package/build/vcs/local.d.ts +18 -5
  166. package/build/vcs/local.js +61 -32
  167. package/build/vcs/vcs.d.ts +2 -1
  168. package/build/vcs/vcs.js +8 -4
  169. package/oclif.manifest.json +1 -1
  170. package/package.json +10 -10
@@ -33,7 +33,7 @@ async function viewUpdateAsync({ groupId, }) {
33
33
  }
34
34
  `, {
35
35
  groupId,
36
- })
36
+ }, { additionalTypenames: ['Update'] })
37
37
  .toPromise());
38
38
  if (data.updatesByGroup.length === 0) {
39
39
  throw new Error(`Could not find any updates with group ID: "${groupId}"`);
@@ -5,7 +5,7 @@ const eas_build_job_1 = require("@expo/eas-build-job");
5
5
  const eas_json_1 = require("@expo/eas-json");
6
6
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
7
7
  const credentialsJsonReader = (0, tslib_1.__importStar)(require("../credentialsJson/read"));
8
- const SetupBuildCredentials_1 = require("./actions/SetupBuildCredentials");
8
+ const SetUpBuildCredentials_1 = require("./actions/SetUpBuildCredentials");
9
9
  class AndroidCredentialsProvider {
10
10
  constructor(ctx, options) {
11
11
  this.ctx = ctx;
@@ -21,7 +21,7 @@ class AndroidCredentialsProvider {
21
21
  }
22
22
  }
23
23
  async getRemoteAsync() {
24
- const setupBuildCredentialsAction = new SetupBuildCredentials_1.SetupBuildCredentials({ app: this.options.app });
24
+ const setupBuildCredentialsAction = new SetUpBuildCredentials_1.SetUpBuildCredentials({ app: this.options.app });
25
25
  const buildCredentials = await setupBuildCredentialsAction.runAsync(this.ctx);
26
26
  return this.toAndroidCredentials(buildCredentials);
27
27
  }
@@ -9,7 +9,7 @@ interface Options {
9
9
  * Sets up Build Credentials for Android
10
10
  * @name: sets up build credentials for the specified configuration. If no name is specified, the default configuration is setup
11
11
  */
12
- export declare class SetupBuildCredentials {
12
+ export declare class SetUpBuildCredentials {
13
13
  private options;
14
14
  constructor(options: Options);
15
15
  runAsync(ctx: CredentialsContext): Promise<AndroidAppBuildCredentialsFragment>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetupBuildCredentials = void 0;
3
+ exports.SetUpBuildCredentials = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
@@ -12,7 +12,7 @@ const CreateKeystore_1 = require("./CreateKeystore");
12
12
  * Sets up Build Credentials for Android
13
13
  * @name: sets up build credentials for the specified configuration. If no name is specified, the default configuration is setup
14
14
  */
15
- class SetupBuildCredentials {
15
+ class SetUpBuildCredentials {
16
16
  constructor(options) {
17
17
  this.options = options;
18
18
  }
@@ -74,4 +74,4 @@ class SetupBuildCredentials {
74
74
  return null;
75
75
  }
76
76
  }
77
- exports.SetupBuildCredentials = SetupBuildCredentials;
77
+ exports.SetUpBuildCredentials = SetUpBuildCredentials;
@@ -1,7 +1,7 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare class SetupBuildCredentialsFromCredentialsJson {
4
+ export declare class SetUpBuildCredentialsFromCredentialsJson {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
7
  runAsync(ctx: CredentialsContext): Promise<AndroidAppBuildCredentialsFragment | null>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetupBuildCredentialsFromCredentialsJson = void 0;
3
+ exports.SetUpBuildCredentialsFromCredentialsJson = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const generated_1 = require("../../../graphql/generated");
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
@@ -9,7 +9,7 @@ const read_1 = require("../../credentialsJson/read");
9
9
  const SelectAndroidBuildCredentials_1 = require("../../manager/SelectAndroidBuildCredentials");
10
10
  const keystoreNew_1 = require("../utils/keystoreNew");
11
11
  const DownloadKeystore_1 = require("./DownloadKeystore");
12
- class SetupBuildCredentialsFromCredentialsJson {
12
+ class SetUpBuildCredentialsFromCredentialsJson {
13
13
  constructor(app) {
14
14
  this.app = app;
15
15
  }
@@ -65,4 +65,4 @@ class SetupBuildCredentialsFromCredentialsJson {
65
65
  return buildCredentials;
66
66
  }
67
67
  }
68
- exports.SetupBuildCredentialsFromCredentialsJson = SetupBuildCredentialsFromCredentialsJson;
68
+ exports.SetUpBuildCredentialsFromCredentialsJson = SetUpBuildCredentialsFromCredentialsJson;
@@ -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 SetUpGoogleServiceAccountKey {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
7
  runAsync(ctx: CredentialsContext): Promise<CommonAndroidAppCredentialsFragment>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetupGoogleServiceAccountKey = void 0;
3
+ exports.SetUpGoogleServiceAccountKey = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
@@ -9,7 +9,7 @@ const errors_1 = require("../../errors");
9
9
  const AssignGoogleServiceAccountKey_1 = require("./AssignGoogleServiceAccountKey");
10
10
  const CreateGoogleServiceAccountKey_1 = require("./CreateGoogleServiceAccountKey");
11
11
  const UseExistingGoogleServiceAccountKey_1 = require("./UseExistingGoogleServiceAccountKey");
12
- class SetupGoogleServiceAccountKey {
12
+ class SetUpGoogleServiceAccountKey {
13
13
  constructor(app) {
14
14
  this.app = app;
15
15
  }
@@ -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.SetUpGoogleServiceAccountKey = SetUpGoogleServiceAccountKey;
@@ -24,6 +24,8 @@ exports.GoogleServiceAccountKeyQuery = {
24
24
  ${(0, graphql_1.print)(GoogleServiceAccountKey_1.GoogleServiceAccountKeyFragmentNode)}
25
25
  `, {
26
26
  accountName,
27
+ }, {
28
+ additionalTypenames: ['GoogleServiceAccountKey'],
27
29
  })
28
30
  .toPromise());
29
31
  return data.account.byName.googleServiceAccountKeys;
@@ -8,8 +8,8 @@ const path_1 = (0, tslib_1.__importDefault)(require("path"));
8
8
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
9
9
  const target_1 = require("../../project/ios/target");
10
10
  const zipObject_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/zipObject"));
11
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
12
- const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/git"));
11
+ const vcs_1 = require("../../vcs");
12
+ const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
13
13
  const read_1 = require("./read");
14
14
  const utils_1 = require("./utils");
15
15
  /**
@@ -197,8 +197,9 @@ async function updateFileAsync(projectDir, filePath, base64Data) {
197
197
  }
198
198
  }
199
199
  async function isFileUntrackedAsync(path) {
200
- if (vcs_1.default instanceof git_1.default) {
201
- return await vcs_1.default.isFileUntrackedAsync(path);
200
+ const vcsClient = (0, vcs_1.getVcsClient)();
201
+ if (vcsClient instanceof git_1.default) {
202
+ return await vcsClient.isFileUntrackedAsync(path);
202
203
  }
203
204
  return false;
204
205
  }
@@ -4,3 +4,7 @@ export declare class MissingCredentialsNonInteractiveError extends Error {
4
4
  export declare class MissingCredentialsError extends Error {
5
5
  constructor(message?: string);
6
6
  }
7
+ export declare class UnsupportedCredentialsChoiceError extends Error {
8
+ choice: string;
9
+ constructor(message: string, choice: string);
10
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MissingCredentialsError = exports.MissingCredentialsNonInteractiveError = void 0;
3
+ exports.UnsupportedCredentialsChoiceError = exports.MissingCredentialsError = exports.MissingCredentialsNonInteractiveError = void 0;
4
4
  class MissingCredentialsNonInteractiveError extends Error {
5
5
  constructor(message) {
6
6
  super(message !== null && message !== void 0 ? message : 'Credentials are not set up. Please run this command again in interactive mode.');
@@ -13,3 +13,10 @@ class MissingCredentialsError extends Error {
13
13
  }
14
14
  }
15
15
  exports.MissingCredentialsError = MissingCredentialsError;
16
+ class UnsupportedCredentialsChoiceError extends Error {
17
+ constructor(message, choice) {
18
+ super(message);
19
+ this.choice = choice;
20
+ }
21
+ }
22
+ exports.UnsupportedCredentialsChoiceError = UnsupportedCredentialsChoiceError;
@@ -9,8 +9,8 @@ const prompts_1 = require("../../prompts");
9
9
  const credentialsJsonReader = (0, tslib_1.__importStar)(require("../credentialsJson/read"));
10
10
  const utils_1 = require("../credentialsJson/utils");
11
11
  const BuildCredentialsUtils_1 = require("./actions/BuildCredentialsUtils");
12
- const SetupBuildCredentials_1 = require("./actions/SetupBuildCredentials");
13
- const SetupPushKey_1 = require("./actions/SetupPushKey");
12
+ const SetUpBuildCredentials_1 = require("./actions/SetUpBuildCredentials");
13
+ const SetUpPushKey_1 = require("./actions/SetUpPushKey");
14
14
  const provisioningProfile_1 = require("./utils/provisioningProfile");
15
15
  class IosCredentialsProvider {
16
16
  constructor(ctx, options) {
@@ -39,7 +39,7 @@ class IosCredentialsProvider {
39
39
  return iosCredentials;
40
40
  }
41
41
  async getRemoteAsync() {
42
- return await new SetupBuildCredentials_1.SetupBuildCredentials({
42
+ return await new SetUpBuildCredentials_1.SetUpBuildCredentials({
43
43
  app: this.options.app,
44
44
  targets: this.options.targets,
45
45
  distribution: this.options.distribution,
@@ -58,7 +58,7 @@ class IosCredentialsProvider {
58
58
  bundleIdentifier: applicationTarget.bundleIdentifier,
59
59
  parentBundleIdentifier: applicationTarget.parentBundleIdentifier,
60
60
  };
61
- const setupPushKeyAction = new SetupPushKey_1.SetupPushKey(appLookupParams);
61
+ const setupPushKeyAction = new SetUpPushKey_1.SetUpPushKey(appLookupParams);
62
62
  const isPushKeySetup = await setupPushKeyAction.isPushKeySetupAsync(ctx);
63
63
  if (isPushKeySetup) {
64
64
  log_1.default.succeed(`Push Notifications setup for ${app.projectName}: ${applicationTarget.bundleIdentifier}`);
@@ -1,5 +1,21 @@
1
+ import { AppStoreConnectApiKeyFragment } from '../../../graphql/generated';
2
+ import { Account } from '../../../user/Account';
3
+ import { CredentialsContext } from '../../context';
1
4
  import { AscApiKey } from '../appstore/Credentials.types';
2
5
  import { AscApiKeyPath, MinimalAscApiKey } from '../credentials';
3
- export declare function promptForAscApiKeyAsync(): Promise<AscApiKeyPath>;
6
+ export declare enum AppStoreApiKeyPurpose {
7
+ SUBMISSION_SERVICE = "EAS Submit"
8
+ }
9
+ export declare function promptForAscApiKeyPathAsync(ctx: CredentialsContext): Promise<AscApiKeyPath>;
4
10
  export declare function promptForIssuerIdAsync(): Promise<string>;
5
11
  export declare function getMinimalAscApiKeyAsync(ascApiKey: AscApiKey): Promise<MinimalAscApiKey>;
12
+ export declare function provideOrGenerateAscApiKeyAsync(ctx: CredentialsContext, purpose: AppStoreApiKeyPurpose): Promise<MinimalAscApiKey>;
13
+ export declare function getAscApiKeyName(purpose: AppStoreApiKeyPurpose): string;
14
+ export declare function getAscApiKeysFromAccountAsync(ctx: CredentialsContext, account: Account, { filterDifferentAppleTeam }?: {
15
+ filterDifferentAppleTeam?: boolean;
16
+ }): Promise<AppStoreConnectApiKeyFragment[]>;
17
+ export declare function selectAscApiKeysFromAccountAsync(ctx: CredentialsContext, account: Account, { filterDifferentAppleTeam }?: {
18
+ filterDifferentAppleTeam?: boolean;
19
+ }): Promise<AppStoreConnectApiKeyFragment | null>;
20
+ export declare function sortAscApiKeysByUpdatedAtDesc(keys: AppStoreConnectApiKeyFragment[]): AppStoreConnectApiKeyFragment[];
21
+ export declare function formatAscApiKey(ascApiKey: AppStoreConnectApiKeyFragment): string;
@@ -1,16 +1,96 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMinimalAscApiKeyAsync = exports.promptForIssuerIdAsync = exports.promptForAscApiKeyAsync = void 0;
3
+ exports.formatAscApiKey = exports.sortAscApiKeysByUpdatedAtDesc = exports.selectAscApiKeysFromAccountAsync = exports.getAscApiKeysFromAccountAsync = exports.getAscApiKeyName = exports.provideOrGenerateAscApiKeyAsync = exports.getMinimalAscApiKeyAsync = exports.promptForIssuerIdAsync = exports.promptForAscApiKeyPathAsync = exports.AppStoreApiKeyPurpose = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
6
6
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
7
+ const nanoid_1 = require("nanoid");
7
8
  const path_1 = (0, tslib_1.__importDefault)(require("path"));
8
- const uuid = (0, tslib_1.__importStar)(require("uuid"));
9
9
  const log_1 = (0, tslib_1.__importStar)(require("../../../log"));
10
10
  const prompts_1 = require("../../../prompts");
11
+ const date_1 = require("../../../utils/date");
11
12
  const promptForCredentials_1 = require("../../utils/promptForCredentials");
12
13
  const credentials_1 = require("../credentials");
13
- async function promptForAscApiKeyAsync() {
14
+ const validateAscApiKey_1 = require("../validators/validateAscApiKey");
15
+ const AppleTeamUtils_1 = require("./AppleTeamUtils");
16
+ var AppStoreApiKeyPurpose;
17
+ (function (AppStoreApiKeyPurpose) {
18
+ AppStoreApiKeyPurpose["SUBMISSION_SERVICE"] = "EAS Submit";
19
+ })(AppStoreApiKeyPurpose = exports.AppStoreApiKeyPurpose || (exports.AppStoreApiKeyPurpose = {}));
20
+ async function promptForAscApiKeyPathAsync(ctx) {
21
+ const { keyId, keyP8Path } = await promptForKeyP8AndIdAsync();
22
+ const bestEffortIssuerId = await getBestEffortIssuerIdAsync(ctx, keyId);
23
+ if (bestEffortIssuerId) {
24
+ log_1.default.log(`Detected Issuer ID: ${bestEffortIssuerId}`);
25
+ return { keyId, issuerId: bestEffortIssuerId, keyP8Path };
26
+ }
27
+ const issuerId = await promptForIssuerIdAsync();
28
+ return { keyId, issuerId, keyP8Path };
29
+ }
30
+ exports.promptForAscApiKeyPathAsync = promptForAscApiKeyPathAsync;
31
+ async function promptForIssuerIdAsync() {
32
+ log_1.default.log(chalk_1.default.bold('An App Store Connect Issuer ID is required'));
33
+ log_1.default.log(`If you're not sure what this is or how to find yours, ${(0, log_1.learnMore)('https://expo.fyi/asc-issuer-id')}`);
34
+ // Do not perform uuid validation - Apple's issuerIds are not RFC4122 compliant
35
+ const { issuerId } = await (0, promptForCredentials_1.getCredentialsFromUserAsync)(credentials_1.ascApiKeyIssuerIdSchema);
36
+ return issuerId;
37
+ }
38
+ exports.promptForIssuerIdAsync = promptForIssuerIdAsync;
39
+ async function getMinimalAscApiKeyAsync(ascApiKey) {
40
+ var _a;
41
+ return {
42
+ ...ascApiKey,
43
+ issuerId: (_a = ascApiKey.issuerId) !== null && _a !== void 0 ? _a : (await promptForIssuerIdAsync()),
44
+ };
45
+ }
46
+ exports.getMinimalAscApiKeyAsync = getMinimalAscApiKeyAsync;
47
+ async function provideOrGenerateAscApiKeyAsync(ctx, purpose) {
48
+ if (ctx.nonInteractive) {
49
+ return await generateAscApiKeyAsync(ctx, purpose);
50
+ }
51
+ const userProvided = await promptForAscApiKeyAsync(ctx);
52
+ if (!userProvided) {
53
+ return await generateAscApiKeyAsync(ctx, purpose);
54
+ }
55
+ if (!ctx.appStore.authCtx) {
56
+ log_1.default.warn('Unable to validate App Store Connect Api Key, you are not authenticated with Apple.');
57
+ return userProvided;
58
+ }
59
+ const isValidAndTracked = await (0, validateAscApiKey_1.isAscApiKeyValidAndTrackedAsync)(ctx, userProvided);
60
+ if (isValidAndTracked) {
61
+ return userProvided;
62
+ }
63
+ const useUserProvided = await (0, prompts_1.confirmAsync)({
64
+ message: `App Store Connect Api Key with ID ${userProvided.keyId} is not valid on Apple's servers. Proceed anyway?`,
65
+ });
66
+ if (useUserProvided) {
67
+ return userProvided;
68
+ }
69
+ return await provideOrGenerateAscApiKeyAsync(ctx, purpose);
70
+ }
71
+ exports.provideOrGenerateAscApiKeyAsync = provideOrGenerateAscApiKeyAsync;
72
+ async function generateAscApiKeyAsync(ctx, purpose) {
73
+ await ctx.appStore.ensureAuthenticatedAsync();
74
+ const ascApiKey = await ctx.appStore.createAscApiKeyAsync({
75
+ nickname: getAscApiKeyName(purpose),
76
+ });
77
+ return await getMinimalAscApiKeyAsync(ascApiKey);
78
+ }
79
+ function getAscApiKeyName(purpose) {
80
+ const nameParts = ['[Expo]', purpose, (0, nanoid_1.nanoid)(10)];
81
+ return nameParts.join(' ');
82
+ }
83
+ exports.getAscApiKeyName = getAscApiKeyName;
84
+ async function promptForAscApiKeyAsync(ctx) {
85
+ const shouldAutoGenerateCredentials = await (0, promptForCredentials_1.shouldAutoGenerateCredentialsAsync)(credentials_1.ascApiKeyIdSchema);
86
+ if (shouldAutoGenerateCredentials) {
87
+ return null;
88
+ }
89
+ const ascApiKeyPath = await promptForAscApiKeyPathAsync(ctx);
90
+ const { keyP8Path, keyId, issuerId } = ascApiKeyPath;
91
+ return { keyP8: await fs_extra_1.default.readFile(keyP8Path, 'utf-8'), keyId, issuerId };
92
+ }
93
+ async function promptForKeyP8AndIdAsync() {
14
94
  var _a, _b;
15
95
  log_1.default.log(chalk_1.default.bold('An App Store Connect Api key is required to upload your app to the Apple App Store'));
16
96
  log_1.default.log(`If you're not sure what this is or how to create one, ${(0, log_1.learnMore)('https://expo.fyi/creating-asc-api-key')}`);
@@ -35,29 +115,82 @@ async function promptForAscApiKeyAsync() {
35
115
  });
36
116
  const regex = /^AuthKey_(?<keyId>\w+)\.p8$/; // Common ASC Api file name downloaded from Apple
37
117
  const bestEffortKeyId = (_b = (_a = path_1.default.basename(keyP8Path).match(regex)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.keyId;
38
- const ascApiKeyMetadata = await (0, promptForCredentials_1.getCredentialsFromUserAsync)(credentials_1.ascApiKeyMetadataSchema, {
118
+ const { keyId } = await (0, promptForCredentials_1.getCredentialsFromUserAsync)(credentials_1.ascApiKeyIdSchema, {
39
119
  keyId: bestEffortKeyId,
40
120
  });
41
- return { ...ascApiKeyMetadata, keyP8Path };
121
+ return { keyId, keyP8Path };
42
122
  }
43
- exports.promptForAscApiKeyAsync = promptForAscApiKeyAsync;
44
- async function promptForIssuerIdAsync() {
45
- log_1.default.log(chalk_1.default.bold('An App Store Connect Issuer ID is required'));
46
- log_1.default.log(`If you're not sure what this is or how to find yours, ${(0, log_1.learnMore)('https://expo.fyi/asc-issuer-id')}`);
47
- const { issuerId } = await (0, prompts_1.promptAsync)({
48
- type: 'text',
49
- name: 'issuerId',
50
- message: 'App Store Connect Issuer ID:',
51
- validate: (input) => uuid.validate(input),
52
- });
53
- return issuerId;
123
+ async function getBestEffortIssuerIdAsync(ctx, ascApiKeyId) {
124
+ var _a;
125
+ if (!ctx.appStore.authCtx) {
126
+ return null;
127
+ }
128
+ const ascApiKeyInfo = await ctx.appStore.getAscApiKeyAsync(ascApiKeyId);
129
+ return (_a = ascApiKeyInfo === null || ascApiKeyInfo === void 0 ? void 0 : ascApiKeyInfo.issuerId) !== null && _a !== void 0 ? _a : null;
54
130
  }
55
- exports.promptForIssuerIdAsync = promptForIssuerIdAsync;
56
- async function getMinimalAscApiKeyAsync(ascApiKey) {
131
+ async function getAscApiKeysFromAccountAsync(ctx, account, { filterDifferentAppleTeam } = {}) {
132
+ const ascApiKeysForAccount = await ctx.ios.getAscApiKeysForAccountAsync(account);
133
+ if (!filterDifferentAppleTeam) {
134
+ return ascApiKeysForAccount;
135
+ }
136
+ else {
137
+ return filterKeysFromDifferentAppleTeam(ctx, ascApiKeysForAccount);
138
+ }
139
+ }
140
+ exports.getAscApiKeysFromAccountAsync = getAscApiKeysFromAccountAsync;
141
+ async function selectAscApiKeysFromAccountAsync(ctx, account, { filterDifferentAppleTeam } = {}) {
57
142
  var _a;
58
- return {
59
- ...ascApiKey,
60
- issuerId: (_a = ascApiKey.issuerId) !== null && _a !== void 0 ? _a : (await promptForIssuerIdAsync()),
61
- };
143
+ const ascApiKeysForAccount = await getAscApiKeysFromAccountAsync(ctx, account, {
144
+ filterDifferentAppleTeam,
145
+ });
146
+ if (ascApiKeysForAccount.length === 0) {
147
+ if (filterDifferentAppleTeam) {
148
+ const maybeAppleTeamId = (_a = ctx.appStore.authCtx) === null || _a === void 0 ? void 0 : _a.team.id;
149
+ log_1.default.warn(`There are no App Store Connect Api Keys in your EAS account${maybeAppleTeamId ? ` matching Apple Team ID: ${maybeAppleTeamId}.` : '.'}`);
150
+ }
151
+ else {
152
+ log_1.default.warn(`There are no App Store Connect Api Keys available in your EAS account.`);
153
+ }
154
+ return null;
155
+ }
156
+ return selectAscApiKeysAsync(ascApiKeysForAccount);
62
157
  }
63
- exports.getMinimalAscApiKeyAsync = getMinimalAscApiKeyAsync;
158
+ exports.selectAscApiKeysFromAccountAsync = selectAscApiKeysFromAccountAsync;
159
+ async function selectAscApiKeysAsync(ascApiKeys) {
160
+ const sortedAscApiKeys = sortAscApiKeysByUpdatedAtDesc(ascApiKeys);
161
+ const { chosenAscApiKey } = await (0, prompts_1.promptAsync)({
162
+ type: 'select',
163
+ name: 'chosenAscApiKey',
164
+ message: 'Select an Api Key from the list:',
165
+ choices: sortedAscApiKeys.map(ascApiKey => ({
166
+ title: formatAscApiKey(ascApiKey),
167
+ value: ascApiKey,
168
+ })),
169
+ });
170
+ return chosenAscApiKey;
171
+ }
172
+ function filterKeysFromDifferentAppleTeam(ctx, keys) {
173
+ if (!ctx.appStore.authCtx) {
174
+ return keys;
175
+ }
176
+ const teamId = ctx.appStore.authCtx.team.id;
177
+ return keys.filter(key => { var _a; return !key.appleTeam || ((_a = key.appleTeam) === null || _a === void 0 ? void 0 : _a.appleTeamIdentifier) === teamId; });
178
+ }
179
+ function sortAscApiKeysByUpdatedAtDesc(keys) {
180
+ return keys.sort((keyA, keyB) => new Date(keyB.updatedAt).getTime() - new Date(keyA.updatedAt).getTime());
181
+ }
182
+ exports.sortAscApiKeysByUpdatedAtDesc = sortAscApiKeysByUpdatedAtDesc;
183
+ function formatAscApiKey(ascApiKey) {
184
+ const { keyIdentifier, appleTeam, name, updatedAt } = ascApiKey;
185
+ let line = '';
186
+ line += `Key ID: ${keyIdentifier}`;
187
+ if (name) {
188
+ line += chalk_1.default.gray(`\n Name: ${name}`);
189
+ }
190
+ if (appleTeam) {
191
+ line += chalk_1.default.gray(`\n ${(0, AppleTeamUtils_1.formatAppleTeam)(appleTeam)}`);
192
+ }
193
+ line += chalk_1.default.gray(`\n Updated: ${(0, date_1.fromNow)(new Date(updatedAt))} ago`);
194
+ return line;
195
+ }
196
+ exports.formatAscApiKey = formatAscApiKey;
@@ -0,0 +1,9 @@
1
+ import { AppStoreConnectApiKeyFragment, CommonIosAppCredentialsFragment } from '../../../graphql/generated';
2
+ import { CredentialsContext } from '../../context';
3
+ import { AppLookupParams } from '../api/GraphqlClient';
4
+ import { AppStoreApiKeyPurpose } from './AscApiKeyUtils';
5
+ export declare class AssignAscApiKey {
6
+ private app;
7
+ constructor(app: AppLookupParams);
8
+ runAsync(ctx: CredentialsContext, ascApiKey: AppStoreConnectApiKeyFragment, purpose: AppStoreApiKeyPurpose): Promise<CommonIosAppCredentialsFragment>;
9
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssignAscApiKey = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
6
+ const AppleTeamUtils_1 = require("./AppleTeamUtils");
7
+ const AscApiKeyUtils_1 = require("./AscApiKeyUtils");
8
+ class AssignAscApiKey {
9
+ constructor(app) {
10
+ this.app = app;
11
+ }
12
+ async runAsync(ctx, ascApiKey, purpose) {
13
+ var _a, _b;
14
+ const appleTeam = (_b = (_a = (await (0, AppleTeamUtils_1.resolveAppleTeamIfAuthenticatedAsync)(ctx, this.app))) !== null && _a !== void 0 ? _a : ascApiKey.appleTeam) !== null && _b !== void 0 ? _b : null;
15
+ const appCredentials = await ctx.ios.createOrGetIosAppCredentialsWithCommonFieldsAsync(this.app, { appleTeam: appleTeam !== null && appleTeam !== void 0 ? appleTeam : undefined });
16
+ let updatedAppCredentials;
17
+ if (purpose === AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE) {
18
+ updatedAppCredentials = await ctx.ios.updateIosAppCredentialsAsync(appCredentials, {
19
+ ascApiKeyIdForSubmissions: ascApiKey.id,
20
+ });
21
+ }
22
+ else {
23
+ throw new Error(`${purpose} is not yet supported.`);
24
+ }
25
+ log_1.default.succeed(`App Store Connect Api Key assigned to ${this.app.projectName}: ${this.app.bundleIdentifier} for ${purpose}.`);
26
+ return updatedAppCredentials;
27
+ }
28
+ }
29
+ exports.AssignAscApiKey = AssignAscApiKey;
@@ -0,0 +1,9 @@
1
+ import { AppStoreConnectApiKeyFragment } from '../../../graphql/generated';
2
+ import { Account } from '../../../user/Account';
3
+ import { CredentialsContext } from '../../context';
4
+ import { AppStoreApiKeyPurpose } from './AscApiKeyUtils';
5
+ export declare class CreateAscApiKey {
6
+ private account;
7
+ constructor(account: Account);
8
+ runAsync(ctx: CredentialsContext, purpose: AppStoreApiKeyPurpose): Promise<AppStoreConnectApiKeyFragment>;
9
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateAscApiKey = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
6
+ const AscApiKeyUtils_1 = require("./AscApiKeyUtils");
7
+ class CreateAscApiKey {
8
+ constructor(account) {
9
+ this.account = account;
10
+ }
11
+ async runAsync(ctx, purpose) {
12
+ if (ctx.nonInteractive) {
13
+ throw new Error(`A new App Store Connect Api Key cannot be created in non-interactive mode.`);
14
+ }
15
+ const ascApiKey = await (0, AscApiKeyUtils_1.provideOrGenerateAscApiKeyAsync)(ctx, purpose);
16
+ const result = await ctx.ios.createAscApiKeyAsync(this.account, ascApiKey);
17
+ log_1.default.succeed('Created App Store Connect Api Key');
18
+ return result;
19
+ }
20
+ }
21
+ exports.CreateAscApiKey = CreateAscApiKey;
@@ -9,7 +9,7 @@ class CreateDistributionCertificate {
9
9
  this.account = account;
10
10
  }
11
11
  async runAsync(ctx) {
12
- const distCert = await (0, DistributionCertificateUtils_1.provideOrGenerateDistributionCertificateAsync)(ctx, this.account.name);
12
+ const distCert = await (0, DistributionCertificateUtils_1.provideOrGenerateDistributionCertificateAsync)(ctx);
13
13
  const result = await ctx.ios.createDistributionCertificateAsync(this.account, distCert);
14
14
  log_1.default.succeed('Created distribution certificate');
15
15
  return result;
@@ -12,7 +12,7 @@ class CreatePushKey {
12
12
  if (ctx.nonInteractive) {
13
13
  throw new Error(`A new push key cannot be created in non-interactive mode.`);
14
14
  }
15
- const pushKey = await (0, PushKeyUtils_1.provideOrGeneratePushKeyAsync)(ctx, this.account.name);
15
+ const pushKey = await (0, PushKeyUtils_1.provideOrGeneratePushKeyAsync)(ctx);
16
16
  const result = await ctx.ios.createPushKeyAsync(this.account, pushKey);
17
17
  log_1.default.succeed('Created push key');
18
18
  return result;
@@ -12,4 +12,4 @@ export declare function selectDistributionCertificateWithDependenciesAsync(ctx:
12
12
  * select a distribution certificate from a valid set (curated on a best effort basis)
13
13
  * */
14
14
  export declare function selectValidDistributionCertificateAsync(ctx: CredentialsContext, appLookupParams: AppLookupParams): Promise<AppleDistributionCertificateFragment | null>;
15
- export declare function provideOrGenerateDistributionCertificateAsync(ctx: CredentialsContext, accountName: string): Promise<DistributionCertificate>;
15
+ export declare function provideOrGenerateDistributionCertificateAsync(ctx: CredentialsContext): Promise<DistributionCertificate>;
@@ -99,12 +99,12 @@ You can have only ${chalk_1.default.underline('three')} Apple Distribution Certi
99
99
  Please revoke the old ones or reuse existing from your other apps.
100
100
  Please remember that Apple Distribution Certificates are not application specific!
101
101
  `;
102
- async function provideOrGenerateDistributionCertificateAsync(ctx, accountName) {
102
+ async function provideOrGenerateDistributionCertificateAsync(ctx) {
103
103
  if (!ctx.nonInteractive) {
104
104
  const userProvided = await promptForDistCertAsync(ctx);
105
105
  if (userProvided) {
106
106
  if (!ctx.appStore.authCtx) {
107
- log_1.default.warn('Unable to validate distribution certificate due to insufficient Apple Credentials');
107
+ log_1.default.warn('Unable to validate distribution certificate, you are not authenticated with Apple.');
108
108
  return userProvided;
109
109
  }
110
110
  else {
@@ -112,13 +112,11 @@ async function provideOrGenerateDistributionCertificateAsync(ctx, accountName) {
112
112
  if (!isValid) {
113
113
  log_1.default.warn("Provided Distribution Certificate is no longer valid on Apple's server");
114
114
  }
115
- return isValid
116
- ? userProvided
117
- : await provideOrGenerateDistributionCertificateAsync(ctx, accountName);
115
+ return isValid ? userProvided : await provideOrGenerateDistributionCertificateAsync(ctx);
118
116
  }
119
117
  }
120
118
  }
121
- return await generateDistributionCertificateAsync(ctx, accountName);
119
+ return await generateDistributionCertificateAsync(ctx);
122
120
  }
123
121
  exports.provideOrGenerateDistributionCertificateAsync = provideOrGenerateDistributionCertificateAsync;
124
122
  async function promptForDistCertAsync(ctx) {
@@ -140,7 +138,7 @@ async function promptForDistCertAsync(ctx) {
140
138
  }
141
139
  return userProvided;
142
140
  }
143
- async function generateDistributionCertificateAsync(ctx, accountName) {
141
+ async function generateDistributionCertificateAsync(ctx) {
144
142
  await ctx.appStore.ensureAuthenticatedAsync();
145
143
  try {
146
144
  return await ctx.appStore.createDistributionCertificateAsync();
@@ -176,7 +174,7 @@ async function generateDistributionCertificateAsync(ctx, accountName) {
176
174
  throw e;
177
175
  }
178
176
  }
179
- return await generateDistributionCertificateAsync(ctx, accountName);
177
+ return await generateDistributionCertificateAsync(ctx);
180
178
  }
181
179
  function formatDistributionCertificateFromApple(appleInfo) {
182
180
  const { name, status, id, expires, created, ownerName, serialNumber } = appleInfo;
@@ -2,7 +2,7 @@ import { ApplePushKeyFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
3
  import { CredentialsContext } from '../../context';
4
4
  import { PushKey } from '../appstore/Credentials.types';
5
- export declare function provideOrGeneratePushKeyAsync(ctx: CredentialsContext, accountName: string): Promise<PushKey>;
5
+ export declare function provideOrGeneratePushKeyAsync(ctx: CredentialsContext): Promise<PushKey>;
6
6
  /**
7
7
  * select a push key from an account (validity status shown on a best effort basis)
8
8
  * */