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,33 +1,6 @@
1
1
  import { CredentialsContext } from '../context';
2
+ import { ActionInfo } from './Actions';
2
3
  import { Action } from './HelperActions';
3
- declare enum ActionType {
4
- ManageCredentialsJson = 0,
5
- ManageBuildCredentials = 1,
6
- ManagePushKey = 2,
7
- GoBackToCaller = 3,
8
- GoBackToHighLevelActions = 4,
9
- SetupBuildCredentials = 5,
10
- SetupBuildCredentialsFromCredentialsJson = 6,
11
- UpdateCredentialsJson = 7,
12
- UseExistingDistributionCertificate = 8,
13
- RemoveProvisioningProfile = 9,
14
- CreateDistributionCertificate = 10,
15
- RemoveDistributionCertificate = 11,
16
- SetupPushKey = 12,
17
- CreatePushKey = 13,
18
- UseExistingPushKey = 14,
19
- RemovePushKey = 15
20
- }
21
- declare enum Scope {
22
- Project = 0,
23
- Account = 1,
24
- Manager = 2
25
- }
26
- declare type ActionInfo = {
27
- value: ActionType;
28
- title: string;
29
- scope: Scope;
30
- };
31
4
  export declare class ManageIos {
32
5
  private callingAction;
33
6
  constructor(callingAction: Action);
@@ -38,4 +11,3 @@ export declare class ManageIos {
38
11
  private setupProvisioningProfileWithSpecificDistCertAsync;
39
12
  private selectTargetAsync;
40
13
  }
41
- export {};
@@ -13,162 +13,41 @@ const projectUtils_1 = require("../../project/projectUtils");
13
13
  const prompts_1 = require("../../prompts");
14
14
  const Account_1 = require("../../user/Account");
15
15
  const actions_1 = require("../../user/actions");
16
+ const AscApiKeyUtils_1 = require("../ios/actions/AscApiKeyUtils");
17
+ const AssignAscApiKey_1 = require("../ios/actions/AssignAscApiKey");
16
18
  const AssignPushKey_1 = require("../ios/actions/AssignPushKey");
17
19
  const BuildCredentialsUtils_1 = require("../ios/actions/BuildCredentialsUtils");
20
+ const CreateAscApiKey_1 = require("../ios/actions/CreateAscApiKey");
18
21
  const CreateDistributionCertificate_1 = require("../ios/actions/CreateDistributionCertificate");
19
22
  const CreatePushKey_1 = require("../ios/actions/CreatePushKey");
20
23
  const DistributionCertificateUtils_1 = require("../ios/actions/DistributionCertificateUtils");
21
24
  const PushKeyUtils_1 = require("../ios/actions/PushKeyUtils");
25
+ const RemoveAscApiKey_1 = require("../ios/actions/RemoveAscApiKey");
22
26
  const RemoveDistributionCertificate_1 = require("../ios/actions/RemoveDistributionCertificate");
23
27
  const RemoveProvisioningProfile_1 = require("../ios/actions/RemoveProvisioningProfile");
24
28
  const RemovePushKey_1 = require("../ios/actions/RemovePushKey");
25
- const SetupAdhocProvisioningProfile_1 = require("../ios/actions/SetupAdhocProvisioningProfile");
26
- const SetupBuildCredentials_1 = require("../ios/actions/SetupBuildCredentials");
27
- const SetupBuildCredentialsFromCredentialsJson_1 = require("../ios/actions/SetupBuildCredentialsFromCredentialsJson");
28
- const SetupProvisioningProfile_1 = require("../ios/actions/SetupProvisioningProfile");
29
- const SetupPushKey_1 = require("../ios/actions/SetupPushKey");
29
+ const SetUpAdhocProvisioningProfile_1 = require("../ios/actions/SetUpAdhocProvisioningProfile");
30
+ const SetUpAscApiKey_1 = require("../ios/actions/SetUpAscApiKey");
31
+ const SetUpBuildCredentials_1 = require("../ios/actions/SetUpBuildCredentials");
32
+ const SetUpBuildCredentialsFromCredentialsJson_1 = require("../ios/actions/SetUpBuildCredentialsFromCredentialsJson");
33
+ const SetUpProvisioningProfile_1 = require("../ios/actions/SetUpProvisioningProfile");
34
+ const SetUpPushKey_1 = require("../ios/actions/SetUpPushKey");
30
35
  const UpdateCredentialsJson_1 = require("../ios/actions/UpdateCredentialsJson");
31
36
  const entitlements_1 = require("../ios/appstore/entitlements");
32
37
  const printCredentials_1 = require("../ios/utils/printCredentials");
38
+ const Actions_1 = require("./Actions");
33
39
  const HelperActions_1 = require("./HelperActions");
40
+ const IosActions_1 = require("./IosActions");
34
41
  const SelectBuildProfileFromEasJson_1 = require("./SelectBuildProfileFromEasJson");
35
42
  const SelectIosDistributionTypeGraphqlFromBuildProfile_1 = require("./SelectIosDistributionTypeGraphqlFromBuildProfile");
36
- var ActionType;
37
- (function (ActionType) {
38
- ActionType[ActionType["ManageCredentialsJson"] = 0] = "ManageCredentialsJson";
39
- ActionType[ActionType["ManageBuildCredentials"] = 1] = "ManageBuildCredentials";
40
- ActionType[ActionType["ManagePushKey"] = 2] = "ManagePushKey";
41
- ActionType[ActionType["GoBackToCaller"] = 3] = "GoBackToCaller";
42
- ActionType[ActionType["GoBackToHighLevelActions"] = 4] = "GoBackToHighLevelActions";
43
- ActionType[ActionType["SetupBuildCredentials"] = 5] = "SetupBuildCredentials";
44
- ActionType[ActionType["SetupBuildCredentialsFromCredentialsJson"] = 6] = "SetupBuildCredentialsFromCredentialsJson";
45
- ActionType[ActionType["UpdateCredentialsJson"] = 7] = "UpdateCredentialsJson";
46
- ActionType[ActionType["UseExistingDistributionCertificate"] = 8] = "UseExistingDistributionCertificate";
47
- ActionType[ActionType["RemoveProvisioningProfile"] = 9] = "RemoveProvisioningProfile";
48
- ActionType[ActionType["CreateDistributionCertificate"] = 10] = "CreateDistributionCertificate";
49
- ActionType[ActionType["RemoveDistributionCertificate"] = 11] = "RemoveDistributionCertificate";
50
- ActionType[ActionType["SetupPushKey"] = 12] = "SetupPushKey";
51
- ActionType[ActionType["CreatePushKey"] = 13] = "CreatePushKey";
52
- ActionType[ActionType["UseExistingPushKey"] = 14] = "UseExistingPushKey";
53
- ActionType[ActionType["RemovePushKey"] = 15] = "RemovePushKey";
54
- })(ActionType || (ActionType = {}));
55
- var Scope;
56
- (function (Scope) {
57
- Scope[Scope["Project"] = 0] = "Project";
58
- Scope[Scope["Account"] = 1] = "Account";
59
- Scope[Scope["Manager"] = 2] = "Manager";
60
- })(Scope || (Scope = {}));
61
- const highLevelActions = [
62
- {
63
- value: ActionType.ManageBuildCredentials,
64
- title: 'Build Credentials: Manage everything needed to build your project',
65
- scope: Scope.Manager,
66
- },
67
- {
68
- value: ActionType.ManagePushKey,
69
- title: 'Push Notifications: Manage your Apple Push Notifications Key',
70
- scope: Scope.Manager,
71
- },
72
- {
73
- value: ActionType.ManageCredentialsJson,
74
- title: 'credentials.json: Upload/Download credentials between EAS servers and your local json ',
75
- scope: Scope.Manager,
76
- },
77
- {
78
- value: ActionType.GoBackToCaller,
79
- title: 'Go back',
80
- scope: Scope.Manager,
81
- },
82
- ];
83
- const credentialsJsonActions = [
84
- {
85
- value: ActionType.UpdateCredentialsJson,
86
- title: 'Download credentials from EAS to credentials.json',
87
- scope: Scope.Project,
88
- },
89
- {
90
- value: ActionType.SetupBuildCredentialsFromCredentialsJson,
91
- title: 'Upload credentials from credentials.json to EAS',
92
- scope: Scope.Project,
93
- },
94
- {
95
- value: ActionType.GoBackToHighLevelActions,
96
- title: 'Go back',
97
- scope: Scope.Manager,
98
- },
99
- ];
100
- function getPushKeyActions(ctx) {
101
- return [
102
- {
103
- value: ActionType.SetupPushKey,
104
- title: 'Setup your project to use Push Notifications',
105
- scope: Scope.Project,
106
- },
107
- {
108
- value: ActionType.CreatePushKey,
109
- title: 'Add a new push key',
110
- scope: ctx.hasProjectContext ? Scope.Project : Scope.Account,
111
- },
112
- {
113
- value: ActionType.UseExistingPushKey,
114
- title: 'Use an existing push key',
115
- scope: Scope.Project,
116
- },
117
- {
118
- value: ActionType.RemovePushKey,
119
- title: 'Remove a push key from your account',
120
- scope: Scope.Account,
121
- },
122
- {
123
- value: ActionType.GoBackToHighLevelActions,
124
- title: 'Go back',
125
- scope: Scope.Manager,
126
- },
127
- ];
128
- }
129
- function getBuildCredentialsActions(ctx) {
130
- return [
131
- {
132
- // This command will be triggered during build to ensure all credentials are ready
133
- // I'm leaving it here for now to simplify testing
134
- value: ActionType.SetupBuildCredentials,
135
- title: 'All: Set up all the required credentials to build your project',
136
- scope: Scope.Project,
137
- },
138
- {
139
- value: ActionType.UseExistingDistributionCertificate,
140
- title: 'Distribution Certificate: Use an existing one for your project',
141
- scope: Scope.Project,
142
- },
143
- {
144
- value: ActionType.CreateDistributionCertificate,
145
- title: `Distribution Certificate: Add a new one to your account`,
146
- scope: ctx.hasProjectContext ? Scope.Project : Scope.Account,
147
- },
148
- {
149
- value: ActionType.RemoveDistributionCertificate,
150
- title: 'Distribution Certificate: Delete one from your account',
151
- scope: Scope.Account,
152
- },
153
- {
154
- value: ActionType.RemoveProvisioningProfile,
155
- title: 'Provisioning Profile: Delete one from your project',
156
- scope: Scope.Project,
157
- },
158
- {
159
- value: ActionType.GoBackToHighLevelActions,
160
- title: 'Go back',
161
- scope: Scope.Manager,
162
- },
163
- ];
164
- }
165
43
  class ManageIos {
166
44
  constructor(callingAction) {
167
45
  this.callingAction = callingAction;
168
46
  }
169
- async runAsync(ctx, currentActions = highLevelActions) {
170
- const buildCredentialsActions = getBuildCredentialsActions(ctx);
171
- const pushKeyActions = getPushKeyActions(ctx);
47
+ async runAsync(ctx, currentActions = IosActions_1.highLevelActions) {
48
+ const buildCredentialsActions = (0, IosActions_1.getBuildCredentialsActions)(ctx);
49
+ const pushKeyActions = (0, IosActions_1.getPushKeyActions)(ctx);
50
+ const ascApiKeyActions = (0, IosActions_1.getAscApiKeyActions)(ctx);
172
51
  await ctx.bestEffortAppStoreAuthenticateAsync();
173
52
  const accountName = ctx.hasProjectContext
174
53
  ? (0, projectUtils_1.getProjectAccountName)(ctx.exp, ctx.user)
@@ -203,32 +82,36 @@ class ManageIos {
203
82
  if (!actionInfo) {
204
83
  throw new Error('Action not supported yet');
205
84
  }
206
- if (actionInfo.scope === Scope.Manager) {
207
- if (chosenAction === ActionType.ManageBuildCredentials) {
85
+ if (actionInfo.scope === Actions_1.Scope.Manager) {
86
+ if (chosenAction === Actions_1.IosActionType.ManageBuildCredentials) {
208
87
  currentActions = buildCredentialsActions;
209
88
  continue;
210
89
  }
211
- else if (chosenAction === ActionType.ManageCredentialsJson) {
212
- currentActions = credentialsJsonActions;
90
+ else if (chosenAction === Actions_1.IosActionType.ManageCredentialsJson) {
91
+ currentActions = IosActions_1.credentialsJsonActions;
213
92
  continue;
214
93
  }
215
- else if (chosenAction === ActionType.ManagePushKey) {
94
+ else if (chosenAction === Actions_1.IosActionType.ManagePushKey) {
216
95
  currentActions = pushKeyActions;
217
96
  continue;
218
97
  }
219
- else if (chosenAction === ActionType.GoBackToHighLevelActions) {
220
- currentActions = highLevelActions;
98
+ else if (chosenAction === Actions_1.IosActionType.ManageAscApiKey) {
99
+ currentActions = ascApiKeyActions;
221
100
  continue;
222
101
  }
223
- else if (chosenAction === ActionType.GoBackToCaller) {
102
+ else if (chosenAction === Actions_1.IosActionType.GoBackToHighLevelActions) {
103
+ currentActions = IosActions_1.highLevelActions;
104
+ continue;
105
+ }
106
+ else if (chosenAction === Actions_1.IosActionType.GoBackToCaller) {
224
107
  return await this.callingAction.runAsync(ctx);
225
108
  }
226
109
  }
227
- else if (actionInfo.scope === Scope.Project) {
110
+ else if (actionInfo.scope === Actions_1.Scope.Project) {
228
111
  (0, assert_1.default)(ctx.hasProjectContext, 'You must be in your project directory in order to perform this action');
229
112
  await this.runProjectSpecificActionAsync(ctx, (0, nullthrows_1.default)(app, 'app must be defined in project context'), (0, nullthrows_1.default)(targets, 'targets must be defined in project context'), (0, nullthrows_1.default)(buildProfile, 'buildProfile must be defined in project context'), chosenAction);
230
113
  }
231
- else if (actionInfo.scope === Scope.Account) {
114
+ else if (actionInfo.scope === Actions_1.Scope.Account) {
232
115
  await this.runAccountSpecificActionAsync(ctx, account, chosenAction);
233
116
  }
234
117
  else {
@@ -272,46 +155,52 @@ class ManageIos {
272
155
  };
273
156
  }
274
157
  async runAccountSpecificActionAsync(ctx, account, action) {
275
- if (action === ActionType.RemoveDistributionCertificate) {
158
+ if (action === Actions_1.IosActionType.RemoveDistributionCertificate) {
276
159
  await new RemoveDistributionCertificate_1.SelectAndRemoveDistributionCertificate(account).runAsync(ctx);
277
160
  }
278
- else if (action === ActionType.CreateDistributionCertificate) {
161
+ else if (action === Actions_1.IosActionType.CreateDistributionCertificate) {
279
162
  await new CreateDistributionCertificate_1.CreateDistributionCertificate(account).runAsync(ctx);
280
163
  }
281
- else if (action === ActionType.CreatePushKey) {
164
+ else if (action === Actions_1.IosActionType.CreatePushKey) {
282
165
  await new CreatePushKey_1.CreatePushKey(account).runAsync(ctx);
283
166
  }
284
- else if (action === ActionType.RemovePushKey) {
167
+ else if (action === Actions_1.IosActionType.CreateAscApiKeyForSubmissions) {
168
+ await new CreateAscApiKey_1.CreateAscApiKey(account).runAsync(ctx, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE);
169
+ }
170
+ else if (action === Actions_1.IosActionType.RemovePushKey) {
285
171
  await new RemovePushKey_1.SelectAndRemovePushKey(account).runAsync(ctx);
286
172
  }
173
+ else if (action === Actions_1.IosActionType.RemoveAscApiKey) {
174
+ await new RemoveAscApiKey_1.SelectAndRemoveAscApiKey(account).runAsync(ctx);
175
+ }
287
176
  }
288
177
  async runProjectSpecificActionAsync(ctx, app, targets, buildProfile, action) {
289
- var _a;
290
- if (action === ActionType.SetupBuildCredentials) {
291
- await new SetupBuildCredentials_1.SetupBuildCredentials({
178
+ var _a, _b;
179
+ if (action === Actions_1.IosActionType.SetUpBuildCredentials) {
180
+ await new SetUpBuildCredentials_1.SetUpBuildCredentials({
292
181
  app,
293
182
  targets,
294
183
  distribution: buildProfile.distribution,
295
184
  enterpriseProvisioning: buildProfile.enterpriseProvisioning,
296
185
  iosCapabilitiesOptions: {
297
- entitlements: await (0, entitlements_1.getManagedEntitlementsJsonAsync)(ctx.projectDir),
186
+ entitlements: await (0, entitlements_1.getManagedEntitlementsJsonAsync)(ctx.projectDir, (_a = buildProfile.env) !== null && _a !== void 0 ? _a : {}),
298
187
  },
299
188
  }).runAsync(ctx);
300
189
  return;
301
190
  }
302
191
  const distributionType = await new SelectIosDistributionTypeGraphqlFromBuildProfile_1.SelectIosDistributionTypeGraphqlFromBuildProfile(buildProfile).runAsync(ctx);
303
- if (action === ActionType.SetupBuildCredentialsFromCredentialsJson) {
304
- await new SetupBuildCredentialsFromCredentialsJson_1.SetupBuildCredentialsFromCredentialsJson(app, targets, distributionType).runAsync(ctx);
192
+ if (action === Actions_1.IosActionType.SetUpBuildCredentialsFromCredentialsJson) {
193
+ await new SetUpBuildCredentialsFromCredentialsJson_1.SetUpBuildCredentialsFromCredentialsJson(app, targets, distributionType).runAsync(ctx);
305
194
  return;
306
195
  }
307
- else if (action === ActionType.UpdateCredentialsJson) {
196
+ else if (action === Actions_1.IosActionType.UpdateCredentialsJson) {
308
197
  await new UpdateCredentialsJson_1.UpdateCredentialsJson(app, targets, distributionType).runAsync(ctx);
309
198
  return;
310
199
  }
311
200
  const target = await this.selectTargetAsync(targets);
312
201
  const appLookupParams = (0, BuildCredentialsUtils_1.getAppLookupParamsFromContext)(ctx, target);
313
202
  switch (action) {
314
- case ActionType.UseExistingDistributionCertificate: {
203
+ case Actions_1.IosActionType.UseExistingDistributionCertificate: {
315
204
  const distCert = await (0, DistributionCertificateUtils_1.selectValidDistributionCertificateAsync)(ctx, appLookupParams);
316
205
  if (!distCert) {
317
206
  return;
@@ -319,7 +208,7 @@ class ManageIos {
319
208
  await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType);
320
209
  return;
321
210
  }
322
- case ActionType.CreateDistributionCertificate: {
211
+ case Actions_1.IosActionType.CreateDistributionCertificate: {
323
212
  const distCert = await new CreateDistributionCertificate_1.CreateDistributionCertificate(appLookupParams.account).runAsync(ctx);
324
213
  const confirm = await (0, prompts_1.confirmAsync)({
325
214
  message: `Do you want ${appLookupParams.projectName} to use the new Distribution Certificate?`,
@@ -329,9 +218,9 @@ class ManageIos {
329
218
  }
330
219
  return;
331
220
  }
332
- case ActionType.RemoveProvisioningProfile: {
221
+ case Actions_1.IosActionType.RemoveProvisioningProfile: {
333
222
  const iosAppCredentials = await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(appLookupParams);
334
- const provisioningProfile = (_a = iosAppCredentials === null || iosAppCredentials === void 0 ? void 0 : iosAppCredentials.iosAppBuildCredentialsList.find(buildCredentials => buildCredentials.iosDistributionType === distributionType)) === null || _a === void 0 ? void 0 : _a.provisioningProfile;
223
+ const provisioningProfile = (_b = iosAppCredentials === null || iosAppCredentials === void 0 ? void 0 : iosAppCredentials.iosAppBuildCredentialsList.find(buildCredentials => buildCredentials.iosDistributionType === distributionType)) === null || _b === void 0 ? void 0 : _b.provisioningProfile;
335
224
  if (!provisioningProfile) {
336
225
  log_1.default.log(`No provisioning profile associated with the ${distributionType} configuration of ${appLookupParams.projectName}`);
337
226
  return;
@@ -344,18 +233,18 @@ class ManageIos {
344
233
  }
345
234
  return;
346
235
  }
347
- case ActionType.SetupPushKey: {
348
- const setupPushKeyAction = await new SetupPushKey_1.SetupPushKey(appLookupParams);
236
+ case Actions_1.IosActionType.SetUpPushKey: {
237
+ const setupPushKeyAction = await new SetUpPushKey_1.SetUpPushKey(appLookupParams);
349
238
  const isPushKeySetup = await setupPushKeyAction.isPushKeySetupAsync(ctx);
350
239
  if (isPushKeySetup) {
351
240
  log_1.default.log(`Push Key is already set up for ${appLookupParams.projectName} ${appLookupParams.bundleIdentifier}`);
352
241
  }
353
242
  else {
354
- await new SetupPushKey_1.SetupPushKey(appLookupParams).runAsync(ctx);
243
+ await new SetUpPushKey_1.SetUpPushKey(appLookupParams).runAsync(ctx);
355
244
  }
356
245
  return;
357
246
  }
358
- case ActionType.CreatePushKey: {
247
+ case Actions_1.IosActionType.CreatePushKey: {
359
248
  const pushKey = await new CreatePushKey_1.CreatePushKey(appLookupParams.account).runAsync(ctx);
360
249
  const confirm = await (0, prompts_1.confirmAsync)({
361
250
  message: `Do you want ${appLookupParams.projectName} to use the new Push Key?`,
@@ -365,13 +254,36 @@ class ManageIos {
365
254
  }
366
255
  return;
367
256
  }
368
- case ActionType.UseExistingPushKey: {
257
+ case Actions_1.IosActionType.UseExistingPushKey: {
369
258
  const selectedPushKey = await (0, PushKeyUtils_1.selectPushKeyAsync)(ctx, appLookupParams.account);
370
259
  if (selectedPushKey) {
371
260
  await new AssignPushKey_1.AssignPushKey(appLookupParams).runAsync(ctx, selectedPushKey);
372
261
  }
373
262
  return;
374
263
  }
264
+ case Actions_1.IosActionType.SetUpAscApiKeyForSubmissions: {
265
+ await new SetUpAscApiKey_1.SetUpAscApiKey(appLookupParams, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE).runAsync(ctx);
266
+ return;
267
+ }
268
+ case Actions_1.IosActionType.UseExistingAscApiKeyForSubmissions: {
269
+ const ascApiKey = await (0, AscApiKeyUtils_1.selectAscApiKeysFromAccountAsync)(ctx, appLookupParams.account, {
270
+ filterDifferentAppleTeam: true,
271
+ });
272
+ if (ascApiKey) {
273
+ await new AssignAscApiKey_1.AssignAscApiKey(appLookupParams).runAsync(ctx, ascApiKey, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE);
274
+ }
275
+ return;
276
+ }
277
+ case Actions_1.IosActionType.CreateAscApiKeyForSubmissions: {
278
+ const ascApiKey = await new CreateAscApiKey_1.CreateAscApiKey(appLookupParams.account).runAsync(ctx, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE);
279
+ const confirm = await (0, prompts_1.confirmAsync)({
280
+ message: `Do you want ${appLookupParams.projectName} to use the new API Key?`,
281
+ });
282
+ if (confirm) {
283
+ await new AssignAscApiKey_1.AssignAscApiKey(appLookupParams).runAsync(ctx, ascApiKey, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE);
284
+ }
285
+ return;
286
+ }
375
287
  default:
376
288
  throw new Error('Unknown action selected');
377
289
  }
@@ -380,10 +292,10 @@ class ManageIos {
380
292
  log_1.default.log(`Setting up ${appLookupParams.projectName} to use Distribution Certificate`);
381
293
  log_1.default.log(`Creating provisioning profile...`);
382
294
  if (distributionType === generated_1.IosDistributionType.AdHoc) {
383
- return await new SetupAdhocProvisioningProfile_1.SetupAdhocProvisioningProfile(appLookupParams).runWithDistributionCertificateAsync(ctx, distCert);
295
+ return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile(appLookupParams).runWithDistributionCertificateAsync(ctx, distCert);
384
296
  }
385
297
  else {
386
- return await new SetupProvisioningProfile_1.SetupProvisioningProfile(appLookupParams, distributionType).createAndAssignProfileAsync(ctx, distCert);
298
+ return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(appLookupParams, distributionType).createAndAssignProfileAsync(ctx, distCert);
387
299
  }
388
300
  }
389
301
  async selectTargetAsync(targets) {
@@ -13,4 +13,5 @@ export declare type CredentialSchema<T> = {
13
13
  transformResultAsync?: (answers: Partial<T>) => Promise<T>;
14
14
  };
15
15
  export declare function askForUserProvidedAsync<T>(schema: CredentialSchema<T>, initialValues?: Partial<T>): Promise<T | null>;
16
- export declare function getCredentialsFromUserAsync<T>(credentialsSchema: CredentialSchema<T>, initialValues: Partial<T>): Promise<T>;
16
+ export declare function getCredentialsFromUserAsync<T>(credentialsSchema: CredentialSchema<T>, initialValues?: Partial<T>): Promise<T>;
17
+ export declare function shouldAutoGenerateCredentialsAsync<T>(schema: CredentialSchema<T>): Promise<boolean>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCredentialsFromUserAsync = exports.askForUserProvidedAsync = void 0;
3
+ exports.shouldAutoGenerateCredentialsAsync = exports.getCredentialsFromUserAsync = exports.askForUserProvidedAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
6
6
  const path_1 = (0, tslib_1.__importDefault)(require("path"));
@@ -29,7 +29,7 @@ async function askForUserProvidedAsync(schema, initialValues = {}) {
29
29
  return await getCredentialsFromUserAsync(schema, initialValues);
30
30
  }
31
31
  exports.askForUserProvidedAsync = askForUserProvidedAsync;
32
- async function getCredentialsFromUserAsync(credentialsSchema, initialValues) {
32
+ async function getCredentialsFromUserAsync(credentialsSchema, initialValues = {}) {
33
33
  var _a;
34
34
  const results = {};
35
35
  for (const question of credentialsSchema.questions) {
@@ -48,6 +48,7 @@ async function shouldAutoGenerateCredentialsAsync(schema) {
48
48
  });
49
49
  return answer;
50
50
  }
51
+ exports.shouldAutoGenerateCredentialsAsync = shouldAutoGenerateCredentialsAsync;
51
52
  async function askQuestionAndProcessAnswerAsync(definition, initialValue) {
52
53
  const questionObject = buildQuestionObject(definition, initialValue);
53
54
  const { input } = await (0, prompts_1.promptAsync)(questionObject);
@@ -1,4 +1,10 @@
1
- import { CombinedError as GraphqlError, OperationResult } from '@urql/core';
2
- export declare const graphqlClient: import("@urql/core").Client;
1
+ import { Client, CombinedError as GraphqlError, OperationContext, OperationResult, PromisifiedSource, TypedDocumentNode } from '@urql/core';
2
+ import { DocumentNode } from 'graphql';
3
+ export declare const graphqlClient: StricterClient;
4
+ export interface StricterClient extends Client {
5
+ query<Data = any, Variables extends object = {}>(query: DocumentNode | TypedDocumentNode<Data, Variables> | string, variables: Variables | undefined, context: Partial<OperationContext> & {
6
+ additionalTypenames: string[];
7
+ }): PromisifiedSource<OperationResult<Data, Variables>>;
8
+ }
3
9
  export declare function withErrorHandlingAsync<T>(promise: Promise<OperationResult<T>>): Promise<T>;
4
10
  export { GraphqlError };
@@ -13,7 +13,7 @@ const api_1 = require("../api");
13
13
  const log_1 = (0, tslib_1.__importDefault)(require("../log"));
14
14
  const sessionStorage_1 = require("../user/sessionStorage");
15
15
  exports.graphqlClient = (0, core_1.createClient)({
16
- url: (0, api_1.getExpoApiBaseUrl)() + '/--/graphql',
16
+ url: (0, api_1.getExpoApiBaseUrl)() + '/graphql',
17
17
  exchanges: [
18
18
  core_1.dedupExchange,
19
19
  core_1.cacheExchange,