eas-cli 0.35.0 → 0.38.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 +37 -37
- package/build/analytics/common.d.ts +8 -0
- package/build/analytics/common.js +19 -0
- package/build/analytics/events.d.ts +43 -0
- package/build/analytics/events.js +51 -0
- package/build/{analytics.d.ts → analytics/rudderstackClient.d.ts} +0 -0
- package/build/{analytics.js → analytics/rudderstackClient.js} +2 -2
- package/build/build/android/build.d.ts +2 -1
- package/build/build/android/build.js +11 -9
- package/build/build/build.d.ts +0 -2
- package/build/build/build.js +19 -29
- package/build/build/configure.js +0 -1
- package/build/build/context.d.ts +19 -11
- package/build/build/context.js +0 -96
- package/build/build/createContext.d.ts +13 -0
- package/build/build/createContext.js +114 -0
- package/build/build/ios/UpdatesModule.js +3 -2
- package/build/build/ios/build.d.ts +2 -1
- package/build/build/ios/build.js +24 -19
- package/build/build/ios/credentials.js +3 -3
- package/build/build/ios/version.js +7 -3
- package/build/build/local.js +28 -26
- package/build/build/metadata.d.ts +1 -12
- package/build/build/metadata.js +24 -19
- package/build/build/types.d.ts +0 -1
- package/build/build/utils/devClient.d.ts +1 -2
- package/build/build/utils/repository.js +1 -0
- package/build/build/validate.d.ts +3 -3
- package/build/commandUtils/EasCommand.js +4 -4
- package/build/commands/branch/publish.js +24 -2
- package/build/commands/build/configure.js +2 -0
- package/build/commands/build/index.js +12 -17
- package/build/commands/channel/create.d.ts +6 -0
- package/build/commands/channel/create.js +2 -0
- package/build/commands/secret/create.js +0 -6
- package/build/commands/secret/delete.js +0 -6
- package/build/commands/secret/list.js +0 -6
- package/build/commands/submit.js +2 -11
- package/build/commands/webhook/create.js +1 -2
- package/build/commands/webhook/list.js +1 -1
- package/build/commands/webhook/update.js +1 -2
- package/build/credentials/android/actions/RemoveFcm.js +4 -4
- package/build/credentials/android/utils/keystore.js +67 -32
- package/build/credentials/ios/actions/AscApiKeyUtils.js +8 -7
- package/build/credentials/ios/actions/AssignAscApiKey.js +1 -1
- package/build/credentials/ios/actions/CreateAscApiKey.js +2 -2
- package/build/credentials/ios/actions/RemoveAscApiKey.js +6 -6
- package/build/credentials/ios/actions/SetUpAscApiKey.js +8 -8
- package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +3 -3
- package/build/credentials/ios/appstore/ascApiKey.js +12 -12
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +11 -1
- package/build/credentials/ios/appstore/entitlements.d.ts +2 -2
- package/build/credentials/ios/appstore/entitlements.js +28 -21
- package/build/credentials/ios/credentials.js +2 -2
- package/build/credentials/ios/utils/printCredentials.js +1 -1
- package/build/credentials/manager/AndroidActions.js +3 -3
- package/build/credentials/manager/IosActions.js +5 -5
- package/build/credentials/manager/ManageIos.js +4 -4
- package/build/graphql/generated.d.ts +146 -54
- package/build/graphql/generated.js +1 -0
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +3 -0
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +23 -0
- package/build/project/android/applicationId.d.ts +6 -0
- package/build/project/android/applicationId.js +39 -29
- package/build/project/android/gradle.js +3 -2
- package/build/project/android/gradleUtils.d.ts +1 -0
- package/build/project/ios/bundleIdentifier.d.ts +6 -1
- package/build/project/ios/bundleIdentifier.js +29 -18
- package/build/submit/BaseSubmitter.d.ts +20 -4
- package/build/submit/BaseSubmitter.js +34 -1
- package/build/submit/android/AndroidSubmitCommand.d.ts +1 -2
- package/build/submit/android/AndroidSubmitCommand.js +23 -35
- package/build/submit/android/AndroidSubmitter.d.ts +12 -8
- package/build/submit/android/AndroidSubmitter.js +30 -21
- package/build/submit/android/ServiceAccountSource.d.ts +3 -2
- package/build/submit/android/ServiceAccountSource.js +16 -4
- package/build/submit/context.d.ts +4 -0
- package/build/submit/context.js +16 -1
- package/build/submit/ios/AppSpecificPasswordSource.d.ts +8 -1
- package/build/submit/ios/AppSpecificPasswordSource.js +44 -4
- package/build/submit/ios/CredentialsServiceSource.d.ts +9 -5
- package/build/submit/ios/CredentialsServiceSource.js +22 -5
- package/build/submit/ios/IosSubmitCommand.d.ts +2 -2
- package/build/submit/ios/IosSubmitCommand.js +46 -53
- package/build/submit/ios/IosSubmitter.d.ts +17 -7
- package/build/submit/ios/IosSubmitter.js +55 -29
- package/build/submit/submit.js +13 -4
- package/build/user/User.js +1 -1
- package/build/{build/ios → utils}/plist.d.ts +1 -1
- package/build/{build/ios → utils}/plist.js +8 -2
- package/build/utils/profiles.d.ts +9 -4
- package/build/utils/profiles.js +14 -7
- package/build/vcs/clients/git.d.ts +2 -1
- package/build/vcs/clients/git.js +87 -6
- package/build/vcs/vcs.d.ts +4 -3
- package/build/vcs/vcs.js +3 -3
- package/build/webhooks/input.d.ts +2 -2
- package/build/webhooks/input.js +19 -2
- package/oclif.manifest.json +1 -1
- package/package.json +10 -10
- package/build/build/utils/analytics.d.ts +0 -22
- package/build/build/utils/analytics.js +0 -28
- package/build/project/isEasEnabledForProject.d.ts +0 -8
- package/build/project/isEasEnabledForProject.js +0 -33
- package/build/submit/android/AndroidPackageSource.d.ts +0 -17
- package/build/submit/android/AndroidPackageSource.js +0 -27
|
@@ -13,7 +13,7 @@ class SelectAndRemoveAscApiKey {
|
|
|
13
13
|
const selected = await (0, AscApiKeyUtils_1.selectAscApiKeysFromAccountAsync)(ctx, this.account);
|
|
14
14
|
if (selected) {
|
|
15
15
|
await new RemoveAscApiKey(this.account, selected).runAsync(ctx);
|
|
16
|
-
log_1.default.succeed('Removed App Store Connect
|
|
16
|
+
log_1.default.succeed('Removed App Store Connect API Key');
|
|
17
17
|
log_1.default.newLine();
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -26,26 +26,26 @@ class RemoveAscApiKey {
|
|
|
26
26
|
}
|
|
27
27
|
async runAsync(ctx) {
|
|
28
28
|
if (ctx.nonInteractive) {
|
|
29
|
-
throw new Error(`Cannot remove App Store Connect
|
|
29
|
+
throw new Error(`Cannot remove App Store Connect API Keys in non-interactive mode.`);
|
|
30
30
|
}
|
|
31
31
|
// TODO(quin): add an extra edge on AppStoreConnectApiKey to find the apps using it
|
|
32
32
|
const confirm = await (0, prompts_1.confirmAsync)({
|
|
33
|
-
message: `Deleting this
|
|
33
|
+
message: `Deleting this API Key may affect your projects that rely on it. Do you want to continue?`,
|
|
34
34
|
});
|
|
35
35
|
if (!confirm) {
|
|
36
36
|
log_1.default.log('Aborting');
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
log_1.default.log('Removing
|
|
39
|
+
log_1.default.log('Removing API Key');
|
|
40
40
|
await ctx.ios.deleteAscApiKeyAsync(this.ascApiKey.id);
|
|
41
41
|
let shouldRevoke = false;
|
|
42
42
|
if (!ctx.nonInteractive) {
|
|
43
43
|
shouldRevoke = await (0, prompts_1.confirmAsync)({
|
|
44
|
-
message: `Do you also want to revoke this
|
|
44
|
+
message: `Do you also want to revoke this API Key on the Apple Developer Portal?`,
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
else if (ctx.nonInteractive) {
|
|
48
|
-
log_1.default.log('Skipping
|
|
48
|
+
log_1.default.log('Skipping API Key revocation on the Apple Developer Portal.');
|
|
49
49
|
}
|
|
50
50
|
if (shouldRevoke) {
|
|
51
51
|
await ctx.appStore.revokeAscApiKeyAsync(this.ascApiKey.keyIdentifier);
|
|
@@ -22,20 +22,20 @@ class SetUpAscApiKey {
|
|
|
22
22
|
this.purpose = purpose;
|
|
23
23
|
this.choices = [
|
|
24
24
|
{
|
|
25
|
-
title: '[Choose an existing ASC
|
|
25
|
+
title: '[Choose an existing ASC API Key]',
|
|
26
26
|
value: SetupAscApiKeyChoice.USE_EXISTING,
|
|
27
27
|
},
|
|
28
|
-
{ title: '[Add a new ASC
|
|
28
|
+
{ title: '[Add a new ASC API Key]', value: SetupAscApiKeyChoice.GENERATE },
|
|
29
29
|
];
|
|
30
30
|
}
|
|
31
31
|
async runAsync(ctx) {
|
|
32
32
|
const isKeySetup = await this.isAscApiKeySetupAsync(ctx, this.purpose);
|
|
33
33
|
if (isKeySetup) {
|
|
34
|
-
log_1.default.succeed('App Store Connect
|
|
35
|
-
return (0, nullthrows_1.default)(await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(this.app), 'iosAppCredentials cannot be null if App Store Connect
|
|
34
|
+
log_1.default.succeed('App Store Connect API Key already set up.');
|
|
35
|
+
return (0, nullthrows_1.default)(await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(this.app), 'iosAppCredentials cannot be null if App Store Connect API Key is already set up');
|
|
36
36
|
}
|
|
37
37
|
if (ctx.nonInteractive) {
|
|
38
|
-
throw new errors_1.MissingCredentialsNonInteractiveError('App Store Connect
|
|
38
|
+
throw new errors_1.MissingCredentialsNonInteractiveError('App Store Connect API Keys cannot be set up in --non-interactive mode.');
|
|
39
39
|
}
|
|
40
40
|
const keysForAccount = await (0, AscApiKeyUtils_1.getAscApiKeysFromAccountAsync)(ctx, this.app.account, {
|
|
41
41
|
filterDifferentAppleTeam: true,
|
|
@@ -64,10 +64,10 @@ class SetUpAscApiKey {
|
|
|
64
64
|
}
|
|
65
65
|
const [autoselectedKey] = (0, AscApiKeyUtils_1.sortAscApiKeysByUpdatedAtDesc)(validKeys);
|
|
66
66
|
const useAutoselected = await (0, prompts_1.confirmAsync)({
|
|
67
|
-
message: `Reuse this App Store Connect
|
|
67
|
+
message: `Reuse this App Store Connect API Key?\n${(0, AscApiKeyUtils_1.formatAscApiKey)(autoselectedKey)}`,
|
|
68
68
|
});
|
|
69
69
|
if (useAutoselected) {
|
|
70
|
-
log_1.default.log(`Using App Store Connect
|
|
70
|
+
log_1.default.log(`Using App Store Connect API Key with ID ${autoselectedKey.keyIdentifier}`);
|
|
71
71
|
return autoselectedKey;
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
@@ -77,7 +77,7 @@ class SetUpAscApiKey {
|
|
|
77
77
|
async isAscApiKeySetupAsync(ctx, purpose) {
|
|
78
78
|
const appCredentials = await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(this.app);
|
|
79
79
|
if (purpose !== AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE) {
|
|
80
|
-
throw new Error(`App Store Connect
|
|
80
|
+
throw new Error(`App Store Connect API Key setup is not yet supported for ${purpose}.`);
|
|
81
81
|
}
|
|
82
82
|
return !!(appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.appStoreConnectApiKeyForSubmissions);
|
|
83
83
|
}
|
|
@@ -14,7 +14,7 @@ exports.PROMPT_FOR_APP_SPECIFIC_PASSWORD = 'PROMPT_FOR_APP_SPECIFIC_PASSWORD';
|
|
|
14
14
|
class SetUpSubmissionCredentials {
|
|
15
15
|
constructor(app) {
|
|
16
16
|
this.setupAscApiKeyAction = new SetUpAscApiKey_1.SetUpAscApiKey(app, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE);
|
|
17
|
-
// Add this unrelated choice to ASC
|
|
17
|
+
// Add this unrelated choice to ASC API Key setup for legacy purposes -- we will deprecate it soon
|
|
18
18
|
this.setupAscApiKeyAction.choices = this.setupAscApiKeyAction.choices.concat({
|
|
19
19
|
title: '[Enter an App Specific Password]',
|
|
20
20
|
value: exports.PROMPT_FOR_APP_SPECIFIC_PASSWORD,
|
|
@@ -23,8 +23,8 @@ class SetUpSubmissionCredentials {
|
|
|
23
23
|
async runAsync(ctx) {
|
|
24
24
|
try {
|
|
25
25
|
const iosAppCredentials = await this.setupAscApiKeyAction.runAsync(ctx);
|
|
26
|
-
const { keyIdentifier, name } = (0, nullthrows_1.default)(iosAppCredentials.appStoreConnectApiKeyForSubmissions, 'ASC
|
|
27
|
-
log_1.default.log(`Using
|
|
26
|
+
const { keyIdentifier, name } = (0, nullthrows_1.default)(iosAppCredentials.appStoreConnectApiKeyForSubmissions, 'ASC API Key must be defined for EAS Submit');
|
|
27
|
+
log_1.default.log(`Using API Key ID: ${keyIdentifier}${name ? ` (${name})` : ''}`);
|
|
28
28
|
return iosAppCredentials;
|
|
29
29
|
}
|
|
30
30
|
catch (e) {
|
|
@@ -7,26 +7,26 @@ const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
|
|
|
7
7
|
const ora_1 = require("../../../ora");
|
|
8
8
|
const authenticate_1 = require("./authenticate");
|
|
9
9
|
async function listAscApiKeysAsync(authCtx) {
|
|
10
|
-
const spinner = (0, ora_1.ora)(`Fetching App Store Connect
|
|
10
|
+
const spinner = (0, ora_1.ora)(`Fetching App Store Connect API Keys.`).start();
|
|
11
11
|
try {
|
|
12
12
|
const context = (0, authenticate_1.getRequestContext)(authCtx);
|
|
13
13
|
const keys = await apple_utils_1.ApiKey.getAsync(context);
|
|
14
|
-
spinner.succeed(`Fetched App Store Connect
|
|
14
|
+
spinner.succeed(`Fetched App Store Connect API Keys.`);
|
|
15
15
|
return keys.map(key => getAscApiKeyInfo(key, authCtx));
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
|
-
spinner.fail(`Failed to fetch App Store Connect
|
|
18
|
+
spinner.fail(`Failed to fetch App Store Connect API Keys.`);
|
|
19
19
|
throw error;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.listAscApiKeysAsync = listAscApiKeysAsync;
|
|
23
23
|
async function getAscApiKeyAsync(authCtx, keyId) {
|
|
24
24
|
var _a;
|
|
25
|
-
const spinner = (0, ora_1.ora)(`Fetching App Store Connect
|
|
25
|
+
const spinner = (0, ora_1.ora)(`Fetching App Store Connect API Key.`).start();
|
|
26
26
|
try {
|
|
27
27
|
const context = (0, authenticate_1.getRequestContext)(authCtx);
|
|
28
28
|
const apiKey = await apple_utils_1.ApiKey.infoAsync(context, { id: keyId });
|
|
29
|
-
spinner.succeed(`Fetched App Store Connect
|
|
29
|
+
spinner.succeed(`Fetched App Store Connect API Key (ID: ${keyId}).`);
|
|
30
30
|
return getAscApiKeyInfo(apiKey, authCtx);
|
|
31
31
|
}
|
|
32
32
|
catch (error) {
|
|
@@ -36,13 +36,13 @@ async function getAscApiKeyAsync(authCtx, keyId) {
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
log_1.default.error(error);
|
|
39
|
-
spinner.fail(`Failed to fetch App Store Connect
|
|
39
|
+
spinner.fail(`Failed to fetch App Store Connect API Key.`);
|
|
40
40
|
throw error;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
exports.getAscApiKeyAsync = getAscApiKeyAsync;
|
|
44
44
|
async function createAscApiKeyAsync(authCtx, { nickname, allAppsVisible, roles, keyType, }) {
|
|
45
|
-
const spinner = (0, ora_1.ora)(`Creating App Store Connect
|
|
45
|
+
const spinner = (0, ora_1.ora)(`Creating App Store Connect API Key.`).start();
|
|
46
46
|
try {
|
|
47
47
|
const context = (0, authenticate_1.getRequestContext)(authCtx);
|
|
48
48
|
const key = await apple_utils_1.ApiKey.createAsync(context, {
|
|
@@ -66,30 +66,30 @@ async function createAscApiKeyAsync(authCtx, { nickname, allAppsVisible, roles,
|
|
|
66
66
|
}
|
|
67
67
|
// this object has more optional parameters populated
|
|
68
68
|
const fullKey = await apple_utils_1.ApiKey.infoAsync(context, { id: key.id });
|
|
69
|
-
spinner.succeed(`Created App Store Connect
|
|
69
|
+
spinner.succeed(`Created App Store Connect API Key.`);
|
|
70
70
|
return {
|
|
71
71
|
...getAscApiKeyInfo(fullKey, authCtx),
|
|
72
72
|
keyP8,
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
catch (err) {
|
|
76
|
-
spinner.fail('Failed to create App Store Connect
|
|
76
|
+
spinner.fail('Failed to create App Store Connect API Key.');
|
|
77
77
|
throw err;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.createAscApiKeyAsync = createAscApiKeyAsync;
|
|
81
81
|
async function revokeAscApiKeyAsync(authCtx, keyId) {
|
|
82
|
-
const spinner = (0, ora_1.ora)(`Revoking App Store Connect
|
|
82
|
+
const spinner = (0, ora_1.ora)(`Revoking App Store Connect API Key.`).start();
|
|
83
83
|
try {
|
|
84
84
|
const context = (0, authenticate_1.getRequestContext)(authCtx);
|
|
85
85
|
const apiKey = await apple_utils_1.ApiKey.infoAsync(context, { id: keyId });
|
|
86
86
|
const revokedKey = await apiKey.revokeAsync();
|
|
87
|
-
spinner.succeed(`Revoked App Store Connect
|
|
87
|
+
spinner.succeed(`Revoked App Store Connect API Key.`);
|
|
88
88
|
return getAscApiKeyInfo(revokedKey, authCtx);
|
|
89
89
|
}
|
|
90
90
|
catch (error) {
|
|
91
91
|
log_1.default.error(error);
|
|
92
|
-
spinner.fail(`Failed to revoke App Store Connect
|
|
92
|
+
spinner.fail(`Failed to revoke App Store Connect API Key.`);
|
|
93
93
|
throw error;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -4,6 +4,7 @@ exports.CapabilityMapping = exports.assertValidOptions = exports.syncCapabilitie
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const apple_utils_1 = require("@expo/apple-utils");
|
|
6
6
|
const getenv_1 = (0, tslib_1.__importDefault)(require("getenv"));
|
|
7
|
+
const util_1 = require("util");
|
|
7
8
|
const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
|
|
8
9
|
exports.EXPO_NO_CAPABILITY_SYNC = getenv_1.default.boolish('EXPO_NO_CAPABILITY_SYNC', false);
|
|
9
10
|
const validateBooleanOptions = (options) => {
|
|
@@ -56,7 +57,16 @@ async function syncCapabilitiesForEntitlementsAsync(bundleId, entitlements = {})
|
|
|
56
57
|
const { enabledCapabilityNames, request, remainingCapabilities } = getCapabilitiesToEnable(currentCapabilities, entitlements);
|
|
57
58
|
const { disabledCapabilityNames, request: modifiedRequest } = getCapabilitiesToDisable(bundleId, remainingCapabilities, request);
|
|
58
59
|
if (modifiedRequest.length) {
|
|
59
|
-
|
|
60
|
+
log_1.default.debug(`Patch Request:`, (0, util_1.inspect)(modifiedRequest, { depth: null, colors: true }));
|
|
61
|
+
try {
|
|
62
|
+
await bundleId.updateBundleIdCapabilityAsync(modifiedRequest);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error.message.match(/bundle '[\w\d]+' cannot be deleted. Delete all the Apps/)) {
|
|
66
|
+
log_1.default.error('Failed to patch capabilities:', (0, util_1.inspect)(modifiedRequest, { depth: null, colors: true }));
|
|
67
|
+
throw new Error(`Unexpected error occurred while attempting to update capabilities for app "${bundleId.attributes.identifier}".\nCapabilities can be modified manually in the Apple developer console at https://developer.apple.com/account/resources/identifiers/bundleId/edit/${bundleId.id}.\nAuto capability syncing can be disabled with the environment variable \`EXPO_NO_CAPABILITY_SYNC=1\`.\n${error.message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
}
|
|
61
71
|
return { enabled: enabledCapabilityNames, disabled: disabledCapabilityNames };
|
|
62
72
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Workflow } from '@expo/eas-build-job';
|
|
2
2
|
import { JSONObject } from '@expo/json-file';
|
|
3
|
-
export declare function getManagedEntitlementsJsonAsync(projectDir: string): Promise<JSONObject>;
|
|
4
|
-
export declare function resolveEntitlementsJsonAsync(projectDir: string, workflow: Workflow): Promise<JSONObject>;
|
|
3
|
+
export declare function getManagedEntitlementsJsonAsync(projectDir: string, env: Record<string, string>): Promise<JSONObject>;
|
|
4
|
+
export declare function resolveEntitlementsJsonAsync(projectDir: string, workflow: Workflow, env: Record<string, string>): Promise<JSONObject>;
|
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveEntitlementsJsonAsync = exports.getManagedEntitlementsJsonAsync = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
|
-
const plist_1 = (0, tslib_1.__importDefault)(require("@expo/plist"));
|
|
8
6
|
const prebuild_config_1 = require("@expo/prebuild-config");
|
|
9
|
-
const
|
|
10
|
-
async function getManagedEntitlementsJsonAsync(projectDir) {
|
|
7
|
+
const plist_1 = require("../../../utils/plist");
|
|
8
|
+
async function getManagedEntitlementsJsonAsync(projectDir, env) {
|
|
11
9
|
var _a;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const originalProcessEnv = process.env;
|
|
11
|
+
try {
|
|
12
|
+
process.env = {
|
|
13
|
+
...process.env,
|
|
14
|
+
...env,
|
|
15
|
+
};
|
|
16
|
+
const { exp } = (0, prebuild_config_1.getPrebuildConfig)(projectDir, { platforms: ['ios'] });
|
|
17
|
+
const expWithMods = await (0, config_plugins_1.compileModsAsync)(exp, {
|
|
18
|
+
projectRoot: projectDir,
|
|
19
|
+
platforms: ['ios'],
|
|
20
|
+
introspect: true,
|
|
21
|
+
});
|
|
22
|
+
return ((_a = expWithMods.ios) === null || _a === void 0 ? void 0 : _a.entitlements) || {};
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
process.env = originalProcessEnv;
|
|
26
|
+
}
|
|
19
27
|
}
|
|
20
28
|
exports.getManagedEntitlementsJsonAsync = getManagedEntitlementsJsonAsync;
|
|
21
|
-
async function resolveEntitlementsJsonAsync(projectDir, workflow) {
|
|
29
|
+
async function resolveEntitlementsJsonAsync(projectDir, workflow, env) {
|
|
22
30
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
23
31
|
return (await getEntitlementsJsonAsync(projectDir)) || {};
|
|
24
32
|
}
|
|
25
33
|
else if (workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
26
|
-
return await getManagedEntitlementsJsonAsync(projectDir);
|
|
34
|
+
return await getManagedEntitlementsJsonAsync(projectDir, env);
|
|
27
35
|
}
|
|
28
36
|
else {
|
|
29
37
|
throw new Error(`Unknown workflow: ${workflow}`);
|
|
@@ -31,13 +39,12 @@ async function resolveEntitlementsJsonAsync(projectDir, workflow) {
|
|
|
31
39
|
}
|
|
32
40
|
exports.resolveEntitlementsJsonAsync = resolveEntitlementsJsonAsync;
|
|
33
41
|
async function getEntitlementsJsonAsync(projectDir) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
const entitlementsPath = config_plugins_1.IOSConfig.Paths.getEntitlementsPath(projectDir);
|
|
43
|
+
if (entitlementsPath) {
|
|
44
|
+
const plist = await (0, plist_1.readPlistAsync)(entitlementsPath);
|
|
45
|
+
return plist ? plist : null;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return null;
|
|
40
49
|
}
|
|
41
|
-
catch { }
|
|
42
|
-
return null;
|
|
43
50
|
}
|
|
@@ -51,7 +51,7 @@ exports.distributionCertificateSchema = {
|
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
53
|
exports.ascApiKeyIdSchema = {
|
|
54
|
-
name: 'App Store Connect
|
|
54
|
+
name: 'App Store Connect API Key',
|
|
55
55
|
questions: [
|
|
56
56
|
{
|
|
57
57
|
field: 'keyId',
|
|
@@ -61,7 +61,7 @@ exports.ascApiKeyIdSchema = {
|
|
|
61
61
|
],
|
|
62
62
|
};
|
|
63
63
|
exports.ascApiKeyIssuerIdSchema = {
|
|
64
|
-
name: 'App Store Connect
|
|
64
|
+
name: 'App Store Connect API Key',
|
|
65
65
|
questions: [
|
|
66
66
|
{
|
|
67
67
|
field: 'issuerId',
|
|
@@ -198,7 +198,7 @@ function displayApplePushKey(maybePushKey, fields) {
|
|
|
198
198
|
fields.push({ label: '', value: '' });
|
|
199
199
|
}
|
|
200
200
|
function displayAscApiKey(maybeAscApiKey, fields) {
|
|
201
|
-
fields.push({ label: 'App Store Connect
|
|
201
|
+
fields.push({ label: 'App Store Connect API Key', value: '' });
|
|
202
202
|
if (maybeAscApiKey) {
|
|
203
203
|
const { keyIdentifier, issuerIdentifier, appleTeam, name, roles, updatedAt } = maybeAscApiKey;
|
|
204
204
|
fields.push({ label: 'Developer Portal ID', value: keyIdentifier });
|
|
@@ -10,7 +10,7 @@ exports.highLevelActions = [
|
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
value: Actions_1.AndroidActionType.ManageFcm,
|
|
13
|
-
title: 'Push Notifications: Manage your FCM
|
|
13
|
+
title: 'Push Notifications: Manage your FCM API Key',
|
|
14
14
|
scope: Actions_1.Scope.Manager,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -71,12 +71,12 @@ exports.buildCredentialsActions = [
|
|
|
71
71
|
exports.fcmActions = [
|
|
72
72
|
{
|
|
73
73
|
value: Actions_1.AndroidActionType.CreateFcm,
|
|
74
|
-
title: 'Upload an FCM
|
|
74
|
+
title: 'Upload an FCM API Key',
|
|
75
75
|
scope: Actions_1.Scope.Project,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
value: Actions_1.AndroidActionType.RemoveFcm,
|
|
79
|
-
title: 'Delete your FCM
|
|
79
|
+
title: 'Delete your FCM API Key',
|
|
80
80
|
scope: Actions_1.Scope.Project,
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -15,7 +15,7 @@ exports.highLevelActions = [
|
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
value: Actions_1.IosActionType.ManageAscApiKey,
|
|
18
|
-
title: 'App Store Connect: Manage your
|
|
18
|
+
title: 'App Store Connect: Manage your API Key',
|
|
19
19
|
scope: Actions_1.Scope.Manager,
|
|
20
20
|
},
|
|
21
21
|
{
|
|
@@ -80,22 +80,22 @@ function getAscApiKeyActions(ctx) {
|
|
|
80
80
|
return [
|
|
81
81
|
{
|
|
82
82
|
value: Actions_1.IosActionType.SetUpAscApiKeyForSubmissions,
|
|
83
|
-
title: 'Set up your project to use an
|
|
83
|
+
title: 'Set up your project to use an API Key for EAS Submit',
|
|
84
84
|
scope: Actions_1.Scope.Project,
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
value: Actions_1.IosActionType.UseExistingAscApiKeyForSubmissions,
|
|
88
|
-
title: 'Use an existing
|
|
88
|
+
title: 'Use an existing API Key for EAS Submit',
|
|
89
89
|
scope: Actions_1.Scope.Project,
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
value: Actions_1.IosActionType.CreateAscApiKeyForSubmissions,
|
|
93
|
-
title: 'Add a new
|
|
93
|
+
title: 'Add a new API Key For EAS Submit',
|
|
94
94
|
scope: ctx.hasProjectContext ? Actions_1.Scope.Project : Actions_1.Scope.Account,
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
value: Actions_1.IosActionType.RemoveAscApiKey,
|
|
98
|
-
title: 'Delete an
|
|
98
|
+
title: 'Delete an API Key',
|
|
99
99
|
scope: Actions_1.Scope.Account,
|
|
100
100
|
},
|
|
101
101
|
{
|
|
@@ -175,7 +175,7 @@ class ManageIos {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
async runProjectSpecificActionAsync(ctx, app, targets, buildProfile, action) {
|
|
178
|
-
var _a;
|
|
178
|
+
var _a, _b;
|
|
179
179
|
if (action === Actions_1.IosActionType.SetUpBuildCredentials) {
|
|
180
180
|
await new SetUpBuildCredentials_1.SetUpBuildCredentials({
|
|
181
181
|
app,
|
|
@@ -183,7 +183,7 @@ class ManageIos {
|
|
|
183
183
|
distribution: buildProfile.distribution,
|
|
184
184
|
enterpriseProvisioning: buildProfile.enterpriseProvisioning,
|
|
185
185
|
iosCapabilitiesOptions: {
|
|
186
|
-
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 : {}),
|
|
187
187
|
},
|
|
188
188
|
}).runAsync(ctx);
|
|
189
189
|
return;
|
|
@@ -220,7 +220,7 @@ class ManageIos {
|
|
|
220
220
|
}
|
|
221
221
|
case Actions_1.IosActionType.RemoveProvisioningProfile: {
|
|
222
222
|
const iosAppCredentials = await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(appLookupParams);
|
|
223
|
-
const 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;
|
|
224
224
|
if (!provisioningProfile) {
|
|
225
225
|
log_1.default.log(`No provisioning profile associated with the ${distributionType} configuration of ${appLookupParams.projectName}`);
|
|
226
226
|
return;
|
|
@@ -277,7 +277,7 @@ class ManageIos {
|
|
|
277
277
|
case Actions_1.IosActionType.CreateAscApiKeyForSubmissions: {
|
|
278
278
|
const ascApiKey = await new CreateAscApiKey_1.CreateAscApiKey(appLookupParams.account).runAsync(ctx, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE);
|
|
279
279
|
const confirm = await (0, prompts_1.confirmAsync)({
|
|
280
|
-
message: `Do you want ${appLookupParams.projectName} to use the new
|
|
280
|
+
message: `Do you want ${appLookupParams.projectName} to use the new API Key?`,
|
|
281
281
|
});
|
|
282
282
|
if (confirm) {
|
|
283
283
|
await new AssignAscApiKey_1.AssignAscApiKey(appLookupParams).runAsync(ctx, ascApiKey, AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE);
|