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.
- package/README.md +27 -27
- package/build/analytics.js +3 -9
- package/build/api.js +3 -3
- package/build/build/android/UpdatesModule.js +4 -15
- package/build/build/android/configure.js +2 -2
- package/build/build/android/graphql.js +2 -4
- package/build/build/android/prepareJob.js +4 -3
- package/build/build/build.js +2 -2
- package/build/build/configure.js +14 -7
- package/build/build/ios/UpdatesModule.js +6 -18
- package/build/build/ios/graphql.js +2 -23
- package/build/build/ios/prepareJob.js +4 -6
- package/build/build/metadata.js +5 -10
- package/build/build/utils/devClient.js +8 -5
- package/build/build/utils/formatBuild.js +1 -9
- package/build/build/utils/repository.js +10 -7
- package/build/build/utils/url.js +1 -1
- package/build/build/validate.js +4 -4
- package/build/commandUtils/EasCommand.d.ts +1 -0
- package/build/commandUtils/EasCommand.js +21 -0
- package/build/commands/branch/create.js +3 -2
- package/build/commands/branch/delete.js +1 -1
- package/build/commands/branch/list.js +1 -1
- package/build/commands/branch/publish.js +20 -48
- package/build/commands/branch/view.js +1 -1
- package/build/commands/build/index.js +43 -24
- package/build/commands/channel/edit.js +1 -1
- package/build/commands/channel/list.js +1 -1
- package/build/commands/channel/view.js +1 -1
- package/build/commands/diagnostics.js +2 -2
- package/build/commands/project/info.js +1 -1
- package/build/commands/secret/delete.js +1 -1
- package/build/commands/update/view.js +1 -1
- package/build/credentials/android/AndroidCredentialsProvider.js +2 -2
- package/build/credentials/android/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
- package/build/credentials/android/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +3 -3
- package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
- package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +3 -3
- package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.d.ts → SetUpGoogleServiceAccountKey.d.ts} +1 -1
- package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.js → SetUpGoogleServiceAccountKey.js} +3 -3
- package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -0
- package/build/credentials/credentialsJson/update.js +5 -4
- package/build/credentials/errors.d.ts +4 -0
- package/build/credentials/errors.js +8 -1
- package/build/credentials/ios/IosCredentialsProvider.js +4 -4
- package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +17 -1
- package/build/credentials/ios/actions/AscApiKeyUtils.js +156 -23
- package/build/credentials/ios/actions/AssignAscApiKey.d.ts +9 -0
- package/build/credentials/ios/actions/AssignAscApiKey.js +29 -0
- package/build/credentials/ios/actions/CreateAscApiKey.d.ts +9 -0
- package/build/credentials/ios/actions/CreateAscApiKey.js +21 -0
- package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
- package/build/credentials/ios/actions/CreatePushKey.js +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +6 -8
- package/build/credentials/ios/actions/PushKeyUtils.d.ts +1 -1
- package/build/credentials/ios/actions/PushKeyUtils.js +6 -6
- package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +14 -0
- package/build/credentials/ios/actions/RemoveAscApiKey.js +55 -0
- package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.d.ts → SetUpAdhocProvisioningProfile.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.js → SetUpAdhocProvisioningProfile.js} +5 -5
- package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +21 -0
- package/build/credentials/ios/actions/SetUpAscApiKey.js +114 -0
- package/build/credentials/ios/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +5 -5
- package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +5 -5
- package/build/credentials/ios/actions/{SetupDistributionCertificate.d.ts → SetUpDistributionCertificate.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupDistributionCertificate.js → SetUpDistributionCertificate.js} +3 -3
- package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.d.ts → SetUpInternalProvisioningProfile.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.js → SetUpInternalProvisioningProfile.js} +7 -7
- package/build/credentials/ios/actions/{SetupProvisioningProfile.d.ts → SetUpProvisioningProfile.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupProvisioningProfile.js → SetUpProvisioningProfile.js} +5 -5
- package/build/credentials/ios/actions/{SetupPushKey.d.ts → SetUpPushKey.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupPushKey.js → SetUpPushKey.js} +3 -3
- package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +10 -0
- package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +53 -0
- package/build/credentials/ios/actions/{SetupTargetBuildCredentials.d.ts → SetUpTargetBuildCredentials.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupTargetBuildCredentials.js → SetUpTargetBuildCredentials.js} +10 -10
- package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.d.ts → SetUpTargetBuildCredentialsFromCredentialsJson.d.ts} +1 -1
- package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.js → SetUpTargetBuildCredentialsFromCredentialsJson.js} +3 -3
- package/build/credentials/ios/api/GraphqlClient.d.ts +8 -2
- package/build/credentials/ios/api/GraphqlClient.js +74 -2
- package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.d.ts +5 -0
- package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.js +54 -0
- package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.d.ts +1 -0
- package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.js +25 -0
- package/build/credentials/ios/api/graphql/queries/AppQuery.js +3 -1
- package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +4 -0
- package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +33 -0
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -2
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +7 -1
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +5 -1
- package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -0
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +5 -1
- package/build/credentials/ios/appstore/AppStoreApi.d.ts +1 -1
- package/build/credentials/ios/appstore/Credentials.types.d.ts +1 -0
- package/build/credentials/ios/appstore/ascApiKey.d.ts +1 -1
- package/build/credentials/ios/appstore/ascApiKey.js +22 -12
- package/build/credentials/ios/credentials.d.ts +2 -1
- package/build/credentials/ios/credentials.js +8 -3
- package/build/credentials/ios/utils/printCredentials.js +30 -1
- package/build/credentials/ios/validators/validateAscApiKey.d.ts +5 -0
- package/build/credentials/ios/validators/validateAscApiKey.js +21 -0
- package/build/credentials/manager/Actions.d.ts +52 -0
- package/build/credentials/manager/Actions.js +53 -0
- package/build/credentials/manager/AndroidActions.d.ts +6 -0
- package/build/credentials/manager/AndroidActions.js +114 -0
- package/build/credentials/manager/IosActions.d.ts +7 -0
- package/build/credentials/manager/IosActions.js +145 -0
- package/build/credentials/manager/ManageAndroid.d.ts +1 -29
- package/build/credentials/manager/ManageAndroid.js +30 -163
- package/build/credentials/manager/ManageIos.d.ts +1 -29
- package/build/credentials/manager/ManageIos.js +78 -166
- package/build/credentials/utils/promptForCredentials.d.ts +2 -1
- package/build/credentials/utils/promptForCredentials.js +3 -2
- package/build/graphql/client.d.ts +8 -2
- package/build/graphql/client.js +1 -1
- package/build/graphql/generated.d.ts +170 -33
- package/build/graphql/generated.js +23 -1
- package/build/graphql/queries/BuildQuery.js +4 -1
- package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -2
- package/build/graphql/queries/ProjectQuery.js +3 -1
- package/build/graphql/queries/PublishQuery.js +4 -1
- package/build/graphql/queries/SubmissionQuery.js +5 -2
- package/build/graphql/queries/UserQuery.js +4 -1
- package/build/graphql/queries/WebhookQuery.js +6 -2
- package/build/graphql/types/Build.js +1 -6
- package/build/graphql/types/credentials/AppStoreConnectApiKey.d.ts +1 -0
- package/build/graphql/types/credentials/AppStoreConnectApiKey.js +23 -0
- package/build/graphql/types/credentials/IosAppCredentials.js +6 -0
- package/build/log.d.ts +0 -2
- package/build/log.js +2 -12
- package/build/project/projectUtils.js +1 -1
- package/build/project/publish.js +2 -2
- package/build/project/workflow.js +2 -2
- package/build/submit/ArchiveSource.js +6 -5
- package/build/submit/android/ServiceAccountSource.js +2 -2
- package/build/submit/ios/AppSpecificPasswordSource.d.ts +2 -6
- package/build/submit/ios/AppSpecificPasswordSource.js +0 -18
- package/build/submit/ios/AscApiKeySource.d.ts +9 -3
- package/build/submit/ios/AscApiKeySource.js +10 -10
- package/build/submit/ios/CredentialsServiceSource.d.ts +14 -0
- package/build/submit/ios/CredentialsServiceSource.js +46 -0
- package/build/submit/ios/IosSubmitCommand.js +22 -14
- package/build/submit/ios/IosSubmitter.d.ts +3 -0
- package/build/submit/ios/IosSubmitter.js +30 -20
- package/build/submit/utils/errors.js +2 -0
- package/build/user/User.js +1 -0
- package/build/utils/easCli.d.ts +1 -0
- package/build/utils/easCli.js +5 -0
- package/build/utils/{expoCommand.d.ts → expoCli.d.ts} +0 -0
- package/build/utils/{expoCommand.js → expoCli.js} +0 -0
- package/build/utils/profiles.js +9 -2
- package/build/vcs/clients/git.d.ts +26 -0
- package/build/vcs/clients/git.js +184 -0
- package/build/vcs/clients/gitNoCommit.d.ts +7 -0
- package/build/vcs/clients/gitNoCommit.js +27 -0
- package/build/vcs/clients/noVcs.d.ts +6 -0
- package/build/vcs/clients/noVcs.js +19 -0
- package/build/vcs/git.d.ts +10 -17
- package/build/vcs/git.js +7 -175
- package/build/vcs/index.d.ts +2 -2
- package/build/vcs/index.js +15 -6
- package/build/vcs/local.d.ts +18 -5
- package/build/vcs/local.js +61 -32
- package/build/vcs/vcs.d.ts +2 -1
- package/build/vcs/vcs.js +8 -4
- package/oclif.manifest.json +1 -1
- package/package.json +10 -10
|
@@ -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
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
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 ===
|
|
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 ===
|
|
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 ===
|
|
94
|
+
else if (chosenAction === Actions_1.IosActionType.ManagePushKey) {
|
|
216
95
|
currentActions = pushKeyActions;
|
|
217
96
|
continue;
|
|
218
97
|
}
|
|
219
|
-
else if (chosenAction ===
|
|
220
|
-
currentActions =
|
|
98
|
+
else if (chosenAction === Actions_1.IosActionType.ManageAscApiKey) {
|
|
99
|
+
currentActions = ascApiKeyActions;
|
|
221
100
|
continue;
|
|
222
101
|
}
|
|
223
|
-
else if (chosenAction ===
|
|
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,23 +155,29 @@ class ManageIos {
|
|
|
272
155
|
};
|
|
273
156
|
}
|
|
274
157
|
async runAccountSpecificActionAsync(ctx, account, action) {
|
|
275
|
-
if (action ===
|
|
158
|
+
if (action === Actions_1.IosActionType.RemoveDistributionCertificate) {
|
|
276
159
|
await new RemoveDistributionCertificate_1.SelectAndRemoveDistributionCertificate(account).runAsync(ctx);
|
|
277
160
|
}
|
|
278
|
-
else if (action ===
|
|
161
|
+
else if (action === Actions_1.IosActionType.CreateDistributionCertificate) {
|
|
279
162
|
await new CreateDistributionCertificate_1.CreateDistributionCertificate(account).runAsync(ctx);
|
|
280
163
|
}
|
|
281
|
-
else if (action ===
|
|
164
|
+
else if (action === Actions_1.IosActionType.CreatePushKey) {
|
|
282
165
|
await new CreatePushKey_1.CreatePushKey(account).runAsync(ctx);
|
|
283
166
|
}
|
|
284
|
-
else if (action ===
|
|
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
178
|
var _a;
|
|
290
|
-
if (action ===
|
|
291
|
-
await new
|
|
179
|
+
if (action === Actions_1.IosActionType.SetUpBuildCredentials) {
|
|
180
|
+
await new SetUpBuildCredentials_1.SetUpBuildCredentials({
|
|
292
181
|
app,
|
|
293
182
|
targets,
|
|
294
183
|
distribution: buildProfile.distribution,
|
|
@@ -300,18 +189,18 @@ class ManageIos {
|
|
|
300
189
|
return;
|
|
301
190
|
}
|
|
302
191
|
const distributionType = await new SelectIosDistributionTypeGraphqlFromBuildProfile_1.SelectIosDistributionTypeGraphqlFromBuildProfile(buildProfile).runAsync(ctx);
|
|
303
|
-
if (action ===
|
|
304
|
-
await new
|
|
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 ===
|
|
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
|
|
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
|
|
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,7 +218,7 @@ class ManageIos {
|
|
|
329
218
|
}
|
|
330
219
|
return;
|
|
331
220
|
}
|
|
332
|
-
case
|
|
221
|
+
case Actions_1.IosActionType.RemoveProvisioningProfile: {
|
|
333
222
|
const iosAppCredentials = await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(appLookupParams);
|
|
334
223
|
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;
|
|
335
224
|
if (!provisioningProfile) {
|
|
@@ -344,18 +233,18 @@ class ManageIos {
|
|
|
344
233
|
}
|
|
345
234
|
return;
|
|
346
235
|
}
|
|
347
|
-
case
|
|
348
|
-
const setupPushKeyAction = await new
|
|
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
|
|
243
|
+
await new SetUpPushKey_1.SetUpPushKey(appLookupParams).runAsync(ctx);
|
|
355
244
|
}
|
|
356
245
|
return;
|
|
357
246
|
}
|
|
358
|
-
case
|
|
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
|
|
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
|
|
295
|
+
return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile(appLookupParams).runWithDistributionCertificateAsync(ctx, distCert);
|
|
384
296
|
}
|
|
385
297
|
else {
|
|
386
|
-
return await new
|
|
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
|
|
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
|
-
|
|
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 };
|
package/build/graphql/client.js
CHANGED
|
@@ -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)() + '
|
|
16
|
+
url: (0, api_1.getExpoApiBaseUrl)() + '/graphql',
|
|
17
17
|
exchanges: [
|
|
18
18
|
core_1.dedupExchange,
|
|
19
19
|
core_1.cacheExchange,
|