eas-cli 0.33.1 → 0.36.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 (195) hide show
  1. package/README.md +27 -27
  2. package/build/analytics/common.d.ts +8 -0
  3. package/build/analytics/common.js +19 -0
  4. package/build/analytics/events.d.ts +43 -0
  5. package/build/analytics/events.js +51 -0
  6. package/build/{analytics.d.ts → analytics/rudderstackClient.d.ts} +0 -0
  7. package/build/{analytics.js → analytics/rudderstackClient.js} +4 -10
  8. package/build/api.js +3 -3
  9. package/build/build/android/configure.js +2 -2
  10. package/build/build/android/graphql.js +2 -4
  11. package/build/build/android/prepareJob.js +4 -3
  12. package/build/build/build.js +20 -29
  13. package/build/build/configure.js +14 -7
  14. package/build/build/context.d.ts +1 -1
  15. package/build/build/context.js +2 -2
  16. package/build/build/ios/UpdatesModule.js +2 -2
  17. package/build/build/ios/credentials.js +3 -3
  18. package/build/build/ios/graphql.js +2 -23
  19. package/build/build/ios/prepareJob.js +4 -6
  20. package/build/build/local.js +18 -27
  21. package/build/build/metadata.js +5 -10
  22. package/build/build/types.d.ts +0 -1
  23. package/build/build/utils/devClient.js +8 -5
  24. package/build/build/utils/formatBuild.js +1 -9
  25. package/build/build/utils/repository.js +10 -7
  26. package/build/build/utils/url.js +1 -1
  27. package/build/build/validate.js +4 -4
  28. package/build/commandUtils/EasCommand.d.ts +1 -0
  29. package/build/commandUtils/EasCommand.js +25 -4
  30. package/build/commands/branch/create.js +3 -2
  31. package/build/commands/branch/delete.js +1 -1
  32. package/build/commands/branch/list.js +1 -1
  33. package/build/commands/branch/publish.js +6 -5
  34. package/build/commands/branch/view.js +1 -1
  35. package/build/commands/build/index.js +44 -25
  36. package/build/commands/channel/edit.js +1 -1
  37. package/build/commands/channel/list.js +1 -1
  38. package/build/commands/channel/view.js +1 -1
  39. package/build/commands/diagnostics.js +2 -2
  40. package/build/commands/project/info.js +1 -1
  41. package/build/commands/secret/delete.js +1 -1
  42. package/build/commands/update/view.js +1 -1
  43. package/build/credentials/android/AndroidCredentialsProvider.js +2 -2
  44. package/build/credentials/android/actions/RemoveFcm.js +4 -4
  45. package/build/credentials/android/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  46. package/build/credentials/android/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +3 -3
  47. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  48. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +3 -3
  49. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.d.ts → SetUpGoogleServiceAccountKey.d.ts} +1 -1
  50. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.js → SetUpGoogleServiceAccountKey.js} +3 -3
  51. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -0
  52. package/build/credentials/android/utils/keystore.js +67 -32
  53. package/build/credentials/credentialsJson/update.js +5 -4
  54. package/build/credentials/errors.d.ts +4 -0
  55. package/build/credentials/errors.js +8 -1
  56. package/build/credentials/ios/IosCredentialsProvider.js +4 -4
  57. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +17 -1
  58. package/build/credentials/ios/actions/AscApiKeyUtils.js +158 -24
  59. package/build/credentials/ios/actions/AssignAscApiKey.d.ts +9 -0
  60. package/build/credentials/ios/actions/AssignAscApiKey.js +29 -0
  61. package/build/credentials/ios/actions/CreateAscApiKey.d.ts +9 -0
  62. package/build/credentials/ios/actions/CreateAscApiKey.js +21 -0
  63. package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
  64. package/build/credentials/ios/actions/CreatePushKey.js +1 -1
  65. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +1 -1
  66. package/build/credentials/ios/actions/DistributionCertificateUtils.js +6 -8
  67. package/build/credentials/ios/actions/PushKeyUtils.d.ts +1 -1
  68. package/build/credentials/ios/actions/PushKeyUtils.js +6 -6
  69. package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +14 -0
  70. package/build/credentials/ios/actions/RemoveAscApiKey.js +55 -0
  71. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.d.ts → SetUpAdhocProvisioningProfile.d.ts} +1 -1
  72. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.js → SetUpAdhocProvisioningProfile.js} +5 -5
  73. package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +21 -0
  74. package/build/credentials/ios/actions/SetUpAscApiKey.js +114 -0
  75. package/build/credentials/ios/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  76. package/build/credentials/ios/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +5 -5
  77. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  78. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +5 -5
  79. package/build/credentials/ios/actions/{SetupDistributionCertificate.d.ts → SetUpDistributionCertificate.d.ts} +1 -1
  80. package/build/credentials/ios/actions/{SetupDistributionCertificate.js → SetUpDistributionCertificate.js} +3 -3
  81. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.d.ts → SetUpInternalProvisioningProfile.d.ts} +1 -1
  82. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.js → SetUpInternalProvisioningProfile.js} +7 -7
  83. package/build/credentials/ios/actions/{SetupProvisioningProfile.d.ts → SetUpProvisioningProfile.d.ts} +1 -1
  84. package/build/credentials/ios/actions/{SetupProvisioningProfile.js → SetUpProvisioningProfile.js} +5 -5
  85. package/build/credentials/ios/actions/{SetupPushKey.d.ts → SetUpPushKey.d.ts} +1 -1
  86. package/build/credentials/ios/actions/{SetupPushKey.js → SetUpPushKey.js} +3 -3
  87. package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +10 -0
  88. package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +53 -0
  89. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.d.ts → SetUpTargetBuildCredentials.d.ts} +1 -1
  90. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.js → SetUpTargetBuildCredentials.js} +10 -10
  91. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.d.ts → SetUpTargetBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  92. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.js → SetUpTargetBuildCredentialsFromCredentialsJson.js} +3 -3
  93. package/build/credentials/ios/api/GraphqlClient.d.ts +8 -2
  94. package/build/credentials/ios/api/GraphqlClient.js +74 -2
  95. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.d.ts +5 -0
  96. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.js +54 -0
  97. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.d.ts +1 -0
  98. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.js +25 -0
  99. package/build/credentials/ios/api/graphql/queries/AppQuery.js +3 -1
  100. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +4 -0
  101. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +33 -0
  102. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -2
  103. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +7 -1
  104. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +5 -1
  105. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -0
  106. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +5 -1
  107. package/build/credentials/ios/appstore/AppStoreApi.d.ts +1 -1
  108. package/build/credentials/ios/appstore/Credentials.types.d.ts +1 -0
  109. package/build/credentials/ios/appstore/ascApiKey.d.ts +1 -1
  110. package/build/credentials/ios/appstore/ascApiKey.js +11 -1
  111. package/build/credentials/ios/appstore/entitlements.d.ts +2 -2
  112. package/build/credentials/ios/appstore/entitlements.js +20 -10
  113. package/build/credentials/ios/credentials.d.ts +2 -1
  114. package/build/credentials/ios/credentials.js +7 -2
  115. package/build/credentials/ios/utils/printCredentials.js +30 -1
  116. package/build/credentials/ios/validators/validateAscApiKey.d.ts +5 -0
  117. package/build/credentials/ios/validators/validateAscApiKey.js +21 -0
  118. package/build/credentials/manager/Actions.d.ts +52 -0
  119. package/build/credentials/manager/Actions.js +53 -0
  120. package/build/credentials/manager/AndroidActions.d.ts +6 -0
  121. package/build/credentials/manager/AndroidActions.js +114 -0
  122. package/build/credentials/manager/IosActions.d.ts +7 -0
  123. package/build/credentials/manager/IosActions.js +145 -0
  124. package/build/credentials/manager/ManageAndroid.d.ts +1 -29
  125. package/build/credentials/manager/ManageAndroid.js +30 -163
  126. package/build/credentials/manager/ManageIos.d.ts +1 -29
  127. package/build/credentials/manager/ManageIos.js +81 -169
  128. package/build/credentials/utils/promptForCredentials.d.ts +2 -1
  129. package/build/credentials/utils/promptForCredentials.js +3 -2
  130. package/build/graphql/client.d.ts +8 -2
  131. package/build/graphql/client.js +1 -1
  132. package/build/graphql/generated.d.ts +313 -85
  133. package/build/graphql/generated.js +23 -1
  134. package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +3 -0
  135. package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +23 -0
  136. package/build/graphql/queries/BuildQuery.js +4 -1
  137. package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -2
  138. package/build/graphql/queries/ProjectQuery.js +3 -1
  139. package/build/graphql/queries/PublishQuery.js +4 -1
  140. package/build/graphql/queries/SubmissionQuery.js +5 -2
  141. package/build/graphql/queries/UserQuery.js +4 -1
  142. package/build/graphql/queries/WebhookQuery.js +6 -2
  143. package/build/graphql/types/Build.js +1 -6
  144. package/build/graphql/types/credentials/AppStoreConnectApiKey.d.ts +1 -0
  145. package/build/graphql/types/credentials/AppStoreConnectApiKey.js +23 -0
  146. package/build/graphql/types/credentials/IosAppCredentials.js +6 -0
  147. package/build/log.d.ts +0 -2
  148. package/build/log.js +2 -12
  149. package/build/project/projectUtils.js +1 -1
  150. package/build/project/publish.js +2 -2
  151. package/build/project/workflow.js +2 -2
  152. package/build/submit/ArchiveSource.js +2 -1
  153. package/build/submit/BaseSubmitter.d.ts +20 -4
  154. package/build/submit/BaseSubmitter.js +34 -1
  155. package/build/submit/android/AndroidSubmitter.d.ts +12 -6
  156. package/build/submit/android/AndroidSubmitter.js +31 -20
  157. package/build/submit/android/ServiceAccountSource.js +2 -2
  158. package/build/submit/context.d.ts +2 -0
  159. package/build/submit/context.js +14 -0
  160. package/build/submit/ios/AppSpecificPasswordSource.d.ts +9 -6
  161. package/build/submit/ios/AppSpecificPasswordSource.js +42 -20
  162. package/build/submit/ios/AscApiKeySource.d.ts +9 -3
  163. package/build/submit/ios/AscApiKeySource.js +10 -10
  164. package/build/submit/ios/CredentialsServiceSource.d.ts +15 -0
  165. package/build/submit/ios/CredentialsServiceSource.js +52 -0
  166. package/build/submit/ios/IosSubmitCommand.d.ts +1 -2
  167. package/build/submit/ios/IosSubmitCommand.js +24 -53
  168. package/build/submit/ios/IosSubmitter.d.ts +20 -7
  169. package/build/submit/ios/IosSubmitter.js +79 -43
  170. package/build/submit/submit.js +13 -4
  171. package/build/submit/utils/errors.js +2 -0
  172. package/build/user/User.js +2 -1
  173. package/build/utils/easCli.d.ts +1 -0
  174. package/build/utils/easCli.js +5 -0
  175. package/build/utils/{expoCommand.d.ts → expoCli.d.ts} +0 -0
  176. package/build/utils/{expoCommand.js → expoCli.js} +0 -0
  177. package/build/utils/profiles.js +9 -2
  178. package/build/vcs/clients/git.d.ts +26 -0
  179. package/build/vcs/clients/git.js +184 -0
  180. package/build/vcs/clients/gitNoCommit.d.ts +7 -0
  181. package/build/vcs/clients/gitNoCommit.js +27 -0
  182. package/build/vcs/clients/noVcs.d.ts +6 -0
  183. package/build/vcs/clients/noVcs.js +19 -0
  184. package/build/vcs/git.d.ts +10 -17
  185. package/build/vcs/git.js +7 -175
  186. package/build/vcs/index.d.ts +2 -2
  187. package/build/vcs/index.js +15 -6
  188. package/build/vcs/local.d.ts +18 -5
  189. package/build/vcs/local.js +61 -32
  190. package/build/vcs/vcs.d.ts +2 -1
  191. package/build/vcs/vcs.js +8 -4
  192. package/oclif.manifest.json +1 -1
  193. package/package.json +7 -7
  194. package/build/build/utils/analytics.d.ts +0 -22
  195. package/build/build/utils/analytics.js +0 -28
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deletePushKeyAsync = exports.getPushKeyForAppAsync = exports.getPushKeysForAccountAsync = exports.createPushKeyAsync = exports.deleteDistributionCertificateAsync = exports.createDistributionCertificateAsync = exports.getDistributionCertificatesForAccountAsync = exports.getDistributionCertificateForAppAsync = exports.deleteProvisioningProfilesAsync = exports.updateProvisioningProfileAsync = exports.getProvisioningProfileAsync = exports.createProvisioningProfileAsync = exports.getDevicesForAppleTeamAsync = exports.createOrGetExistingAppleAppIdentifierAsync = exports.createOrGetExistingAppleTeamAsync = exports.updateIosAppCredentialsAsync = exports.createOrGetIosAppCredentialsWithCommonFieldsAsync = exports.getIosAppCredentialsWithCommonFieldsAsync = exports.getIosAppCredentialsWithBuildCredentialsAsync = exports.createOrUpdateIosAppBuildCredentialsAsync = void 0;
3
+ exports.deleteAscApiKeyAsync = exports.getAscApiKeyForAppSubmissionsAsync = exports.getAscApiKeysForAccountAsync = exports.createAscApiKeyAsync = exports.deletePushKeyAsync = exports.getPushKeyForAppAsync = exports.getPushKeysForAccountAsync = exports.createPushKeyAsync = exports.deleteDistributionCertificateAsync = exports.createDistributionCertificateAsync = exports.getDistributionCertificatesForAccountAsync = exports.getDistributionCertificateForAppAsync = exports.deleteProvisioningProfilesAsync = exports.updateProvisioningProfileAsync = exports.getProvisioningProfileAsync = exports.createProvisioningProfileAsync = exports.getDevicesForAppleTeamAsync = exports.createOrGetExistingAppleAppIdentifierAsync = exports.createOrGetExistingAppleTeamAsync = exports.updateIosAppCredentialsAsync = exports.createOrGetIosAppCredentialsWithCommonFieldsAsync = exports.getIosAppCredentialsWithCommonFieldsAsync = exports.getIosAppCredentialsWithBuildCredentialsAsync = exports.createOrUpdateIosAppBuildCredentialsAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const apple_utils_1 = require("@expo/apple-utils");
5
6
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
7
+ const generated_1 = require("../../../graphql/generated");
6
8
  const bundleIdentifier_1 = require("../../../project/ios/bundleIdentifier");
7
9
  const errors_1 = require("../errors");
10
+ const AppStoreConnectApiKeyMutation_1 = require("./graphql/mutations/AppStoreConnectApiKeyMutation");
8
11
  const AppleAppIdentifierMutation_1 = require("./graphql/mutations/AppleAppIdentifierMutation");
9
12
  const AppleDistributionCertificateMutation_1 = require("./graphql/mutations/AppleDistributionCertificateMutation");
10
13
  const AppleProvisioningProfileMutation_1 = require("./graphql/mutations/AppleProvisioningProfileMutation");
@@ -13,6 +16,7 @@ const AppleTeamMutation_1 = require("./graphql/mutations/AppleTeamMutation");
13
16
  const IosAppBuildCredentialsMutation_1 = require("./graphql/mutations/IosAppBuildCredentialsMutation");
14
17
  const IosAppCredentialsMutation_1 = require("./graphql/mutations/IosAppCredentialsMutation");
15
18
  const AppQuery_1 = require("./graphql/queries/AppQuery");
19
+ const AppStoreConnectApiKeyQuery_1 = require("./graphql/queries/AppStoreConnectApiKeyQuery");
16
20
  const AppleAppIdentifierQuery_1 = require("./graphql/queries/AppleAppIdentifierQuery");
17
21
  const AppleDeviceQuery_1 = require("./graphql/queries/AppleDeviceQuery");
18
22
  const AppleDistributionCertificateQuery_1 = require("./graphql/queries/AppleDistributionCertificateQuery");
@@ -82,11 +86,15 @@ async function createOrGetIosAppCredentialsWithCommonFieldsAsync(appLookupParams
82
86
  return await IosAppCredentialsMutation_1.IosAppCredentialsMutation.createIosAppCredentialsAsync({ appleTeamId: appleTeam === null || appleTeam === void 0 ? void 0 : appleTeam.id }, app.id, appleAppIdentifier.id);
83
87
  }
84
88
  exports.createOrGetIosAppCredentialsWithCommonFieldsAsync = createOrGetIosAppCredentialsWithCommonFieldsAsync;
85
- async function updateIosAppCredentialsAsync(appCredentials, { applePushKeyId, }) {
89
+ async function updateIosAppCredentialsAsync(appCredentials, { applePushKeyId, ascApiKeyIdForSubmissions, }) {
86
90
  let updatedAppCredentials = appCredentials;
87
91
  if (applePushKeyId) {
88
92
  updatedAppCredentials = await IosAppCredentialsMutation_1.IosAppCredentialsMutation.setPushKeyAsync(updatedAppCredentials.id, applePushKeyId);
89
93
  }
94
+ if (ascApiKeyIdForSubmissions) {
95
+ updatedAppCredentials =
96
+ await IosAppCredentialsMutation_1.IosAppCredentialsMutation.setAppStoreConnectApiKeyForSubmissionsAsync(updatedAppCredentials.id, ascApiKeyIdForSubmissions);
97
+ }
90
98
  return updatedAppCredentials;
91
99
  }
92
100
  exports.updateIosAppCredentialsAsync = updateIosAppCredentialsAsync;
@@ -224,4 +232,68 @@ async function deletePushKeyAsync(pushKeyId) {
224
232
  return await ApplePushKeyMutation_1.ApplePushKeyMutation.deleteApplePushKeyAsync(pushKeyId);
225
233
  }
226
234
  exports.deletePushKeyAsync = deletePushKeyAsync;
235
+ async function createAscApiKeyAsync(account, ascApiKey) {
236
+ var _a, _b, _c;
237
+ const maybeAppleTeam = ascApiKey.teamId
238
+ ? await createOrGetExistingAppleTeamAsync(account, {
239
+ appleTeamIdentifier: ascApiKey.teamId,
240
+ appleTeamName: ascApiKey.teamName,
241
+ })
242
+ : null;
243
+ return await AppStoreConnectApiKeyMutation_1.AppStoreConnectApiKeyMutation.createAppStoreConnectApiKeyAsync({
244
+ issuerIdentifier: ascApiKey.issuerId,
245
+ keyIdentifier: ascApiKey.keyId,
246
+ keyP8: ascApiKey.keyP8,
247
+ name: (_a = ascApiKey.name) !== null && _a !== void 0 ? _a : null,
248
+ roles: (_c = (_b = ascApiKey.roles) === null || _b === void 0 ? void 0 : _b.map(role => convertUserRoleToGraphqlType(role))) !== null && _c !== void 0 ? _c : null,
249
+ appleTeamId: maybeAppleTeam ? maybeAppleTeam.id : null,
250
+ }, account.id);
251
+ }
252
+ exports.createAscApiKeyAsync = createAscApiKeyAsync;
253
+ async function getAscApiKeysForAccountAsync(account) {
254
+ return await AppStoreConnectApiKeyQuery_1.AppStoreConnectApiKeyQuery.getAllForAccountAsync(account.name);
255
+ }
256
+ exports.getAscApiKeysForAccountAsync = getAscApiKeysForAccountAsync;
257
+ async function getAscApiKeyForAppSubmissionsAsync(appLookupParams) {
258
+ var _a;
259
+ const maybeIosAppCredentials = await getIosAppCredentialsWithCommonFieldsAsync(appLookupParams);
260
+ return (_a = maybeIosAppCredentials === null || maybeIosAppCredentials === void 0 ? void 0 : maybeIosAppCredentials.appStoreConnectApiKeyForSubmissions) !== null && _a !== void 0 ? _a : null;
261
+ }
262
+ exports.getAscApiKeyForAppSubmissionsAsync = getAscApiKeyForAppSubmissionsAsync;
263
+ async function deleteAscApiKeyAsync(ascApiKeyId) {
264
+ return await AppStoreConnectApiKeyMutation_1.AppStoreConnectApiKeyMutation.deleteAppStoreConnectApiKeyAsync(ascApiKeyId);
265
+ }
266
+ exports.deleteAscApiKeyAsync = deleteAscApiKeyAsync;
267
+ function convertUserRoleToGraphqlType(userRole) {
268
+ switch (userRole) {
269
+ case apple_utils_1.UserRole.ADMIN:
270
+ return generated_1.AppStoreConnectUserRole.Admin;
271
+ case apple_utils_1.UserRole.ACCESS_TO_REPORTS:
272
+ return generated_1.AppStoreConnectUserRole.AccessToReports;
273
+ case apple_utils_1.UserRole.ACCOUNT_HOLDER:
274
+ return generated_1.AppStoreConnectUserRole.AccountHolder;
275
+ case apple_utils_1.UserRole.APP_MANAGER:
276
+ return generated_1.AppStoreConnectUserRole.AppManager;
277
+ case apple_utils_1.UserRole.CLOUD_MANAGED_APP_DISTRIBUTION:
278
+ return generated_1.AppStoreConnectUserRole.CloudManagedAppDistribution;
279
+ case apple_utils_1.UserRole.CLOUD_MANAGED_DEVELOPER_ID:
280
+ return generated_1.AppStoreConnectUserRole.CloudManagedDeveloperId;
281
+ case apple_utils_1.UserRole.CREATE_APPS:
282
+ return generated_1.AppStoreConnectUserRole.CreateApps;
283
+ case apple_utils_1.UserRole.CUSTOMER_SUPPORT:
284
+ return generated_1.AppStoreConnectUserRole.CustomerSupport;
285
+ case apple_utils_1.UserRole.DEVELOPER:
286
+ return generated_1.AppStoreConnectUserRole.Developer;
287
+ case apple_utils_1.UserRole.FINANCE:
288
+ return generated_1.AppStoreConnectUserRole.Finance;
289
+ case apple_utils_1.UserRole.MARKETING:
290
+ return generated_1.AppStoreConnectUserRole.Marketing;
291
+ case apple_utils_1.UserRole.READ_ONLY:
292
+ return generated_1.AppStoreConnectUserRole.ReadOnly;
293
+ case apple_utils_1.UserRole.SALES:
294
+ return generated_1.AppStoreConnectUserRole.Sales;
295
+ case apple_utils_1.UserRole.TECHNICAL:
296
+ return generated_1.AppStoreConnectUserRole.Technical;
297
+ }
298
+ }
227
299
  const formatProjectFullName = ({ account, projectName }) => `@${account.name}/${projectName}`;
@@ -0,0 +1,5 @@
1
+ import { AppStoreConnectApiKeyFragment, AppStoreConnectApiKeyInput } from '../../../../../graphql/generated';
2
+ export declare const AppStoreConnectApiKeyMutation: {
3
+ createAppStoreConnectApiKeyAsync(appStoreConnectApiKeyInput: AppStoreConnectApiKeyInput, accountId: string): Promise<AppStoreConnectApiKeyFragment>;
4
+ deleteAppStoreConnectApiKeyAsync(appStoreConnectApiKeyId: string): Promise<void>;
5
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppStoreConnectApiKeyMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
6
+ const graphql_1 = require("graphql");
7
+ const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
8
+ const client_1 = require("../../../../../graphql/client");
9
+ const AppStoreConnectApiKey_1 = require("../../../../../graphql/types/credentials/AppStoreConnectApiKey");
10
+ exports.AppStoreConnectApiKeyMutation = {
11
+ async createAppStoreConnectApiKeyAsync(appStoreConnectApiKeyInput, accountId) {
12
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
13
+ .mutation((0, graphql_tag_1.default) `
14
+ mutation CreateAppStoreConnectApiKeyMutation(
15
+ $appStoreConnectApiKeyInput: AppStoreConnectApiKeyInput!
16
+ $accountId: ID!
17
+ ) {
18
+ appStoreConnectApiKey {
19
+ createAppStoreConnectApiKey(
20
+ appStoreConnectApiKeyInput: $appStoreConnectApiKeyInput
21
+ accountId: $accountId
22
+ ) {
23
+ id
24
+ ...AppStoreConnectApiKeyFragment
25
+ }
26
+ }
27
+ }
28
+ ${(0, graphql_1.print)(AppStoreConnectApiKey_1.AppStoreConnectApiKeyFragmentNode)}
29
+ `, {
30
+ appStoreConnectApiKeyInput,
31
+ accountId,
32
+ })
33
+ .toPromise());
34
+ (0, assert_1.default)(data.appStoreConnectApiKey.createAppStoreConnectApiKey, 'GraphQL: `createAppStoreConnectApiKey` not defined in server response');
35
+ return data.appStoreConnectApiKey.createAppStoreConnectApiKey;
36
+ },
37
+ async deleteAppStoreConnectApiKeyAsync(appStoreConnectApiKeyId) {
38
+ await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
39
+ .mutation((0, graphql_tag_1.default) `
40
+ mutation DeleteAppStoreConnectApiKeyMutation($appStoreConnectApiKeyId: ID!) {
41
+ appStoreConnectApiKey {
42
+ deleteAppStoreConnectApiKey(id: $appStoreConnectApiKeyId) {
43
+ id
44
+ }
45
+ }
46
+ }
47
+ `, {
48
+ appStoreConnectApiKeyId,
49
+ }, {
50
+ additionalTypenames: ['AppStoreConnectApiKey', 'IosAppCredentials'],
51
+ })
52
+ .toPromise());
53
+ },
54
+ };
@@ -2,4 +2,5 @@ import { CommonIosAppCredentialsFragment, IosAppCredentialsInput } from '../../.
2
2
  export declare const IosAppCredentialsMutation: {
3
3
  createIosAppCredentialsAsync(iosAppCredentialsInput: IosAppCredentialsInput, appId: string, appleAppIdentifierId: string): Promise<CommonIosAppCredentialsFragment>;
4
4
  setPushKeyAsync(iosAppCredentialsId: string, pushKeyId: string): Promise<CommonIosAppCredentialsFragment>;
5
+ setAppStoreConnectApiKeyForSubmissionsAsync(iosAppCredentialsId: string, ascApiKeyId: string): Promise<CommonIosAppCredentialsFragment>;
5
6
  };
@@ -56,4 +56,29 @@ exports.IosAppCredentialsMutation = {
56
56
  .toPromise());
57
57
  return data.iosAppCredentials.setPushKey;
58
58
  },
59
+ async setAppStoreConnectApiKeyForSubmissionsAsync(iosAppCredentialsId, ascApiKeyId) {
60
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
61
+ .mutation((0, graphql_tag_1.default) `
62
+ mutation SetAppStoreConnectApiKeyForSubmissionsMutation(
63
+ $iosAppCredentialsId: ID!
64
+ $ascApiKeyId: ID!
65
+ ) {
66
+ iosAppCredentials {
67
+ setAppStoreConnectApiKeyForSubmissions(
68
+ id: $iosAppCredentialsId
69
+ ascApiKeyId: $ascApiKeyId
70
+ ) {
71
+ id
72
+ ...CommonIosAppCredentialsFragment
73
+ }
74
+ }
75
+ }
76
+ ${(0, graphql_1.print)(IosAppCredentials_1.CommonIosAppCredentialsFragmentNode)}
77
+ `, {
78
+ iosAppCredentialsId,
79
+ ascApiKeyId,
80
+ })
81
+ .toPromise());
82
+ return data.iosAppCredentials.setAppStoreConnectApiKeyForSubmissions;
83
+ },
59
84
  };
@@ -20,7 +20,9 @@ exports.AppQuery = {
20
20
  }
21
21
  }
22
22
  ${(0, graphql_1.print)(App_1.AppFragmentNode)}
23
- `, { fullName })
23
+ `, { fullName }, {
24
+ additionalTypenames: ['App'],
25
+ })
24
26
  .toPromise());
25
27
  (0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
26
28
  return data.app.byFullName;
@@ -0,0 +1,4 @@
1
+ import { AppStoreConnectApiKeyFragment } from '../../../../../graphql/generated';
2
+ export declare const AppStoreConnectApiKeyQuery: {
3
+ getAllForAccountAsync(accountName: string): Promise<AppStoreConnectApiKeyFragment[]>;
4
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppStoreConnectApiKeyQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_1 = require("graphql");
6
+ const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
7
+ const client_1 = require("../../../../../graphql/client");
8
+ const AppStoreConnectApiKey_1 = require("../../../../../graphql/types/credentials/AppStoreConnectApiKey");
9
+ exports.AppStoreConnectApiKeyQuery = {
10
+ async getAllForAccountAsync(accountName) {
11
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
12
+ .query((0, graphql_tag_1.default) `
13
+ query AppStoreConnectApiKeyByAccountQuery($accountName: String!) {
14
+ account {
15
+ byName(accountName: $accountName) {
16
+ id
17
+ appStoreConnectApiKeys {
18
+ id
19
+ ...AppStoreConnectApiKeyFragment
20
+ }
21
+ }
22
+ }
23
+ }
24
+ ${(0, graphql_1.print)(AppStoreConnectApiKey_1.AppStoreConnectApiKeyFragmentNode)}
25
+ `, {
26
+ accountName,
27
+ }, {
28
+ additionalTypenames: ['AppStoreConnectApiKey'],
29
+ })
30
+ .toPromise());
31
+ return data.account.byName.appStoreConnectApiKeys;
32
+ },
33
+ };
@@ -68,7 +68,9 @@ exports.AppleDeviceQuery = {
68
68
  }
69
69
  }
70
70
  }
71
- `, { accountName, appleTeamIdentifier })
71
+ `, { accountName, appleTeamIdentifier }, {
72
+ additionalTypenames: ['AppleDevice', 'AppleTeam'],
73
+ })
72
74
  .toPromise());
73
75
  return data.account.byName.appleTeams[0];
74
76
  },
@@ -95,7 +97,9 @@ exports.AppleDeviceQuery = {
95
97
  }
96
98
  }
97
99
  }
98
- `, { accountName, identifier })
100
+ `, { accountName, identifier }, {
101
+ additionalTypenames: ['AppleDevice', 'AppleTeam'],
102
+ })
99
103
  .toPromise());
100
104
  return (_a = data.account.byName.appleDevices[0]) !== null && _a !== void 0 ? _a : null;
101
105
  },
@@ -47,7 +47,11 @@ exports.AppleDistributionCertificateQuery = {
47
47
  appleAppIdentifierId,
48
48
  iosDistributionType,
49
49
  }, {
50
- additionalTypenames: ['IosAppCredentials', 'IosAppBuildCredentials'],
50
+ additionalTypenames: [
51
+ 'AppleDistributionCertificate',
52
+ 'IosAppCredentials',
53
+ 'IosAppBuildCredentials',
54
+ ],
51
55
  })
52
56
  .toPromise());
53
57
  (0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
@@ -70,6 +74,8 @@ exports.AppleDistributionCertificateQuery = {
70
74
  ${(0, graphql_1.print)(AppleDistributionCertificate_1.AppleDistributionCertificateFragmentNode)}
71
75
  `, {
72
76
  accountName,
77
+ }, {
78
+ additionalTypenames: ['AppleDistributionCertificate'],
73
79
  })
74
80
  .toPromise());
75
81
  return data.account.byName.appleDistributionCertificates;
@@ -59,7 +59,11 @@ exports.AppleProvisioningProfileQuery = {
59
59
  appleAppIdentifierId,
60
60
  iosDistributionType,
61
61
  }, {
62
- additionalTypenames: ['IosAppCredentials', 'IosAppBuildCredentials'],
62
+ additionalTypenames: [
63
+ 'AppleProvisioningProfile',
64
+ 'IosAppCredentials',
65
+ 'IosAppBuildCredentials',
66
+ ],
63
67
  })
64
68
  .toPromise());
65
69
  (0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
@@ -24,6 +24,8 @@ exports.ApplePushKeyQuery = {
24
24
  ${(0, graphql_1.print)(ApplePushKey_1.ApplePushKeyFragmentNode)}
25
25
  `, {
26
26
  accountName,
27
+ }, {
28
+ additionalTypenames: ['ApplePushKey'],
27
29
  })
28
30
  .toPromise());
29
31
  return data.account.byName.applePushKeys;
@@ -22,7 +22,9 @@ exports.AppleTeamQuery = {
22
22
  }
23
23
  }
24
24
  }
25
- `, { accountName })
25
+ `, { accountName }, {
26
+ additionalTypenames: ['AppleTeam'],
27
+ })
26
28
  .toPromise());
27
29
  return data.account.byName.appleTeams;
28
30
  },
@@ -42,6 +44,8 @@ exports.AppleTeamQuery = {
42
44
  `, {
43
45
  accountId,
44
46
  appleTeamIdentifier,
47
+ }, {
48
+ additionalTypenames: ['AppleTeam'],
45
49
  })
46
50
  .toPromise());
47
51
  return (_a = data.appleTeam.byAppleTeamIdentifier) !== null && _a !== void 0 ? _a : null;
@@ -18,7 +18,7 @@ export default class AppStoreApi {
18
18
  revokeProvisioningProfileAsync(bundleIdentifier: string, profileClass?: ProfileClass): Promise<void>;
19
19
  createOrReuseAdhocProvisioningProfileAsync(udids: string[], bundleIdentifier: string, distCertSerialNumber: string): Promise<ProvisioningProfile>;
20
20
  listAscApiKeysAsync(): Promise<AscApiKeyInfo[]>;
21
- getAscApiKeyAsync(keyId: string): Promise<AscApiKeyInfo>;
21
+ getAscApiKeyAsync(keyId: string): Promise<AscApiKeyInfo | null>;
22
22
  createAscApiKeyAsync({ nickname }: {
23
23
  nickname: string;
24
24
  }): Promise<AscApiKey>;
@@ -68,6 +68,7 @@ export declare type AscApiKeyInfo = {
68
68
  name: string;
69
69
  teamName?: string;
70
70
  roles: UserRole[];
71
+ isRevoked: boolean;
71
72
  };
72
73
  export declare type AscApiKey = AscApiKeyInfo & {
73
74
  keyP8: string;
@@ -3,7 +3,7 @@ import { ApiKey, ApiKeyProps } from '@expo/apple-utils';
3
3
  import { AscApiKey, AscApiKeyInfo } from './Credentials.types';
4
4
  import { AuthCtx } from './authenticate';
5
5
  export declare function listAscApiKeysAsync(authCtx: AuthCtx): Promise<AscApiKeyInfo[]>;
6
- export declare function getAscApiKeyAsync(authCtx: AuthCtx, keyId: string): Promise<AscApiKeyInfo>;
6
+ export declare function getAscApiKeyAsync(authCtx: AuthCtx, keyId: string): Promise<AscApiKeyInfo | null>;
7
7
  export declare function createAscApiKeyAsync(authCtx: AuthCtx, { nickname, allAppsVisible, roles, keyType, }: Partial<Pick<ApiKeyProps, 'nickname' | 'roles' | 'allAppsVisible' | 'keyType'>>): Promise<AscApiKey>;
8
8
  export declare function revokeAscApiKeyAsync(authCtx: AuthCtx, keyId: string): Promise<AscApiKeyInfo>;
9
9
  export declare function getAscApiKeyInfo(apiKey: ApiKey, authCtx: AuthCtx): AscApiKeyInfo;
@@ -21,6 +21,7 @@ async function listAscApiKeysAsync(authCtx) {
21
21
  }
22
22
  exports.listAscApiKeysAsync = listAscApiKeysAsync;
23
23
  async function getAscApiKeyAsync(authCtx, keyId) {
24
+ var _a;
24
25
  const spinner = (0, ora_1.ora)(`Fetching App Store Connect API Key.`).start();
25
26
  try {
26
27
  const context = (0, authenticate_1.getRequestContext)(authCtx);
@@ -29,6 +30,11 @@ async function getAscApiKeyAsync(authCtx, keyId) {
29
30
  return getAscApiKeyInfo(apiKey, authCtx);
30
31
  }
31
32
  catch (error) {
33
+ const message = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : '';
34
+ if (message.includes("There is no resource of type 'apiKeys' with id")) {
35
+ spinner.stop();
36
+ return null;
37
+ }
32
38
  log_1.default.error(error);
33
39
  spinner.fail(`Failed to fetch App Store Connect API Key.`);
34
40
  throw error;
@@ -58,8 +64,11 @@ async function createAscApiKeyAsync(authCtx, { nickname, allAppsVisible, roles,
58
64
  }
59
65
  throw new Error(`Failed to download .p8 file of ${humanReadableKey}.`);
60
66
  }
67
+ // this object has more optional parameters populated
68
+ const fullKey = await apple_utils_1.ApiKey.infoAsync(context, { id: key.id });
69
+ spinner.succeed(`Created App Store Connect API Key.`);
61
70
  return {
62
- ...getAscApiKeyInfo(key, authCtx),
71
+ ...getAscApiKeyInfo(fullKey, authCtx),
63
72
  keyP8,
64
73
  };
65
74
  }
@@ -94,6 +103,7 @@ function getAscApiKeyInfo(apiKey, authCtx) {
94
103
  teamId: authCtx.team.id,
95
104
  teamName: authCtx.team.name,
96
105
  roles: apiKey.attributes.roles,
106
+ isRevoked: !!apiKey.attributes.revokingDate,
97
107
  };
98
108
  }
99
109
  exports.getAscApiKeyInfo = getAscApiKeyInfo;
@@ -1,4 +1,4 @@
1
1
  import { Workflow } from '@expo/eas-build-job';
2
2
  import { JSONObject } from '@expo/json-file';
3
- export declare function getManagedEntitlementsJsonAsync(projectDir: string): Promise<JSONObject>;
4
- export declare function resolveEntitlementsJsonAsync(projectDir: string, workflow: Workflow): Promise<JSONObject>;
3
+ export declare function getManagedEntitlementsJsonAsync(projectDir: string, env: Record<string, string>): Promise<JSONObject>;
4
+ export declare function resolveEntitlementsJsonAsync(projectDir: string, workflow: Workflow, env: Record<string, string>): Promise<JSONObject>;
@@ -7,23 +7,33 @@ const eas_build_job_1 = require("@expo/eas-build-job");
7
7
  const plist_1 = (0, tslib_1.__importDefault)(require("@expo/plist"));
8
8
  const prebuild_config_1 = require("@expo/prebuild-config");
9
9
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
10
- async function getManagedEntitlementsJsonAsync(projectDir) {
10
+ async function getManagedEntitlementsJsonAsync(projectDir, env) {
11
11
  var _a;
12
- let { exp } = (0, prebuild_config_1.getPrebuildConfig)(projectDir, { platforms: ['ios'] });
13
- exp = await (0, config_plugins_1.compileModsAsync)(exp, {
14
- projectRoot: projectDir,
15
- platforms: ['ios'],
16
- introspect: true,
17
- });
18
- return ((_a = exp.ios) === null || _a === void 0 ? void 0 : _a.entitlements) || {};
12
+ const originalProcessEnv = process.env;
13
+ try {
14
+ process.env = {
15
+ ...process.env,
16
+ ...env,
17
+ };
18
+ const { exp } = (0, prebuild_config_1.getPrebuildConfig)(projectDir, { platforms: ['ios'] });
19
+ const expWithMods = await (0, config_plugins_1.compileModsAsync)(exp, {
20
+ projectRoot: projectDir,
21
+ platforms: ['ios'],
22
+ introspect: true,
23
+ });
24
+ return ((_a = expWithMods.ios) === null || _a === void 0 ? void 0 : _a.entitlements) || {};
25
+ }
26
+ finally {
27
+ process.env = originalProcessEnv;
28
+ }
19
29
  }
20
30
  exports.getManagedEntitlementsJsonAsync = getManagedEntitlementsJsonAsync;
21
- async function resolveEntitlementsJsonAsync(projectDir, workflow) {
31
+ async function resolveEntitlementsJsonAsync(projectDir, workflow, env) {
22
32
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
23
33
  return (await getEntitlementsJsonAsync(projectDir)) || {};
24
34
  }
25
35
  else if (workflow === eas_build_job_1.Workflow.MANAGED) {
26
- return await getManagedEntitlementsJsonAsync(projectDir);
36
+ return await getManagedEntitlementsJsonAsync(projectDir, env);
27
37
  }
28
38
  else {
29
39
  throw new Error(`Unknown workflow: ${workflow}`);
@@ -52,6 +52,7 @@ export interface AscApiKeyPath {
52
52
  keyId: string;
53
53
  issuerId: string;
54
54
  }
55
- export declare const ascApiKeyMetadataSchema: CredentialSchema<Omit<MinimalAscApiKey, 'keyP8'>>;
55
+ export declare const ascApiKeyIdSchema: CredentialSchema<Pick<MinimalAscApiKey, 'keyId'>>;
56
+ export declare const ascApiKeyIssuerIdSchema: CredentialSchema<Pick<MinimalAscApiKey, 'issuerId'>>;
56
57
  export declare const pushKeySchema: CredentialSchema<PushKey>;
57
58
  export declare const provisioningProfileSchema: CredentialSchema<ProvisioningProfile>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.provisioningProfileSchema = exports.pushKeySchema = exports.ascApiKeyMetadataSchema = exports.distributionCertificateSchema = exports.getAppLookupParams = void 0;
3
+ exports.provisioningProfileSchema = exports.pushKeySchema = exports.ascApiKeyIssuerIdSchema = exports.ascApiKeyIdSchema = exports.distributionCertificateSchema = exports.getAppLookupParams = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
6
6
  const p12Certificate_1 = require("./utils/p12Certificate");
@@ -50,7 +50,7 @@ exports.distributionCertificateSchema = {
50
50
  return answers;
51
51
  },
52
52
  };
53
- exports.ascApiKeyMetadataSchema = {
53
+ exports.ascApiKeyIdSchema = {
54
54
  name: 'App Store Connect API Key',
55
55
  questions: [
56
56
  {
@@ -58,6 +58,11 @@ exports.ascApiKeyMetadataSchema = {
58
58
  type: 'string',
59
59
  question: 'Key ID:',
60
60
  },
61
+ ],
62
+ };
63
+ exports.ascApiKeyIssuerIdSchema = {
64
+ name: 'App Store Connect API Key',
65
+ questions: [
61
66
  {
62
67
  field: 'issuerId',
63
68
  type: 'string',
@@ -71,7 +71,7 @@ function displayIosCredentials(app, appCredentialsMap, targets) {
71
71
  fields.push({ label: '', value: '' });
72
72
  continue;
73
73
  }
74
- const { appleTeam, pushKey } = targetAppCredentials;
74
+ const { appleTeam, pushKey, appStoreConnectApiKeyForSubmissions } = targetAppCredentials;
75
75
  if (appleTeam) {
76
76
  const { appleTeamIdentifier, appleTeamName } = appleTeam;
77
77
  fields.push({
@@ -83,6 +83,9 @@ function displayIosCredentials(app, appCredentialsMap, targets) {
83
83
  if (pushKey) {
84
84
  displayApplePushKey(pushKey, fields);
85
85
  }
86
+ if (appStoreConnectApiKeyForSubmissions) {
87
+ displayAscApiKey(appStoreConnectApiKeyForSubmissions, fields);
88
+ }
86
89
  const sortedIosAppBuildCredentialsList = sortBuildCredentialsByDistributionType(targetAppCredentials.iosAppBuildCredentialsList);
87
90
  for (const iosAppBuildCredentials of sortedIosAppBuildCredentialsList) {
88
91
  displayIosAppBuildCredentials(iosAppBuildCredentials, fields);
@@ -194,6 +197,32 @@ function displayApplePushKey(maybePushKey, fields) {
194
197
  }
195
198
  fields.push({ label: '', value: '' });
196
199
  }
200
+ function displayAscApiKey(maybeAscApiKey, fields) {
201
+ fields.push({ label: 'App Store Connect API Key', value: '' });
202
+ if (maybeAscApiKey) {
203
+ const { keyIdentifier, issuerIdentifier, appleTeam, name, roles, updatedAt } = maybeAscApiKey;
204
+ fields.push({ label: 'Developer Portal ID', value: keyIdentifier });
205
+ if (name) {
206
+ fields.push({ label: 'Name', value: name });
207
+ }
208
+ fields.push({ label: 'Issuer ID', value: issuerIdentifier });
209
+ if (roles) {
210
+ fields.push({ label: 'Roles', value: roles.join(',') });
211
+ }
212
+ if (appleTeam) {
213
+ const { appleTeamIdentifier, appleTeamName } = appleTeam;
214
+ fields.push({
215
+ label: 'Apple Team',
216
+ value: `${appleTeamIdentifier} ${appleTeamName ? `(${appleTeamName})` : ''}`,
217
+ });
218
+ }
219
+ fields.push({ label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` });
220
+ }
221
+ else {
222
+ fields.push({ label: '', value: 'None assigned yet' });
223
+ }
224
+ fields.push({ label: '', value: '' });
225
+ }
197
226
  function formatAppleDevice(device) {
198
227
  let deviceString = '';
199
228
  if (device.name) {
@@ -0,0 +1,5 @@
1
+ import { AppStoreConnectApiKeyFragment } from '../../../graphql/generated';
2
+ import { CredentialsContext } from '../../context';
3
+ import { MinimalAscApiKey } from '../credentials';
4
+ export declare function isAscApiKeyValidAndTrackedAsync(ctx: CredentialsContext, ascApiKey: MinimalAscApiKey): Promise<boolean>;
5
+ export declare function getValidAndTrackedAscApiKeysAsync(ctx: CredentialsContext, ascApiKeys: AppStoreConnectApiKeyFragment[]): Promise<AppStoreConnectApiKeyFragment[]>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getValidAndTrackedAscApiKeysAsync = exports.isAscApiKeyValidAndTrackedAsync = void 0;
4
+ async function isAscApiKeyValidAndTrackedAsync(ctx, ascApiKey) {
5
+ const ascApiKeyInfo = await ctx.appStore.getAscApiKeyAsync(ascApiKey.keyId);
6
+ return isKeyValid(ascApiKeyInfo);
7
+ }
8
+ exports.isAscApiKeyValidAndTrackedAsync = isAscApiKeyValidAndTrackedAsync;
9
+ async function getValidAndTrackedAscApiKeysAsync(ctx, ascApiKeys) {
10
+ const ascApiKeysInfo = await ctx.appStore.listAscApiKeysAsync();
11
+ const validAscApiKeysInfo = ascApiKeysInfo.filter(keyInfo => isKeyValid(keyInfo));
12
+ const validKeyIdentifiers = new Set(validAscApiKeysInfo.map(keyInfo => keyInfo.keyId));
13
+ return ascApiKeys.filter(key => validKeyIdentifiers.has(key.keyIdentifier));
14
+ }
15
+ exports.getValidAndTrackedAscApiKeysAsync = getValidAndTrackedAscApiKeysAsync;
16
+ function isKeyValid(ascApiKeyInfo) {
17
+ if (!ascApiKeyInfo) {
18
+ return false;
19
+ }
20
+ return !ascApiKeyInfo.isRevoked;
21
+ }
@@ -0,0 +1,52 @@
1
+ export declare type ActionInfo = {
2
+ value: AndroidActionType | IosActionType;
3
+ title: string;
4
+ scope: Scope;
5
+ };
6
+ export declare enum Scope {
7
+ Project = 0,
8
+ Manager = 1,
9
+ Account = 2
10
+ }
11
+ export declare enum AndroidActionType {
12
+ ManageBuildCredentials = 0,
13
+ ManageFcm = 1,
14
+ ManageGoogleServiceAccountKey = 2,
15
+ ManageCredentialsJson = 3,
16
+ GoBackToCaller = 4,
17
+ GoBackToHighLevelActions = 5,
18
+ CreateKeystore = 6,
19
+ DownloadKeystore = 7,
20
+ RemoveKeystore = 8,
21
+ CreateFcm = 9,
22
+ RemoveFcm = 10,
23
+ CreateGsaKey = 11,
24
+ UseExistingGsaKey = 12,
25
+ RemoveGsaKey = 13,
26
+ SetUpGsaKey = 14,
27
+ UpdateCredentialsJson = 15,
28
+ SetUpBuildCredentialsFromCredentialsJson = 16
29
+ }
30
+ export declare enum IosActionType {
31
+ ManageCredentialsJson = 0,
32
+ ManageBuildCredentials = 1,
33
+ ManagePushKey = 2,
34
+ ManageAscApiKey = 3,
35
+ GoBackToCaller = 4,
36
+ GoBackToHighLevelActions = 5,
37
+ SetUpBuildCredentials = 6,
38
+ SetUpBuildCredentialsFromCredentialsJson = 7,
39
+ UpdateCredentialsJson = 8,
40
+ UseExistingDistributionCertificate = 9,
41
+ RemoveProvisioningProfile = 10,
42
+ CreateDistributionCertificate = 11,
43
+ RemoveDistributionCertificate = 12,
44
+ SetUpPushKey = 13,
45
+ CreatePushKey = 14,
46
+ UseExistingPushKey = 15,
47
+ RemovePushKey = 16,
48
+ SetUpAscApiKeyForSubmissions = 17,
49
+ UseExistingAscApiKeyForSubmissions = 18,
50
+ CreateAscApiKeyForSubmissions = 19,
51
+ RemoveAscApiKey = 20
52
+ }