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