eas-cli 0.34.0 → 0.36.1
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/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/api.js +3 -3
- package/build/build/build.js +18 -27
- package/build/build/context.d.ts +1 -1
- package/build/build/context.js +2 -2
- package/build/build/ios/credentials.js +3 -3
- package/build/build/local.js +18 -27
- package/build/build/types.d.ts +0 -1
- package/build/build/utils/devClient.js +6 -3
- package/build/build/utils/formatBuild.js +1 -9
- package/build/build/utils/url.js +1 -1
- package/build/commandUtils/EasCommand.js +4 -4
- package/build/commands/build/index.js +14 -5
- package/build/commands/secret/delete.js +1 -1
- package/build/credentials/android/AndroidCredentialsProvider.js +2 -2
- package/build/credentials/android/actions/RemoveFcm.js +4 -4
- 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/utils/keystore.js +67 -32
- 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 +158 -24
- 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/DistributionCertificateUtils.js +1 -1
- package/build/credentials/ios/actions/PushKeyUtils.js +1 -1
- 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/AppStoreConnectApiKeyQuery.d.ts +4 -0
- package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +33 -0
- 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 +11 -1
- package/build/credentials/ios/appstore/entitlements.d.ts +2 -2
- package/build/credentials/ios/appstore/entitlements.js +20 -10
- package/build/credentials/ios/credentials.d.ts +2 -1
- package/build/credentials/ios/credentials.js +7 -2
- 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 +20 -15
- package/build/credentials/manager/Actions.js +20 -15
- package/build/credentials/manager/AndroidActions.js +6 -6
- package/build/credentials/manager/IosActions.d.ts +1 -0
- package/build/credentials/manager/IosActions.js +40 -5
- package/build/credentials/manager/ManageAndroid.js +6 -6
- package/build/credentials/manager/ManageIos.js +56 -17
- package/build/credentials/utils/promptForCredentials.d.ts +2 -1
- package/build/credentials/utils/promptForCredentials.js +3 -2
- package/build/graphql/client.js +1 -1
- package/build/graphql/generated.d.ts +233 -82
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +3 -0
- package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +23 -0
- 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/submit/ArchiveSource.js +2 -1
- package/build/submit/BaseSubmitter.d.ts +20 -4
- package/build/submit/BaseSubmitter.js +34 -1
- package/build/submit/android/AndroidSubmitter.d.ts +12 -6
- package/build/submit/android/AndroidSubmitter.js +31 -20
- package/build/submit/android/ServiceAccountSource.js +2 -2
- package/build/submit/context.d.ts +2 -0
- package/build/submit/context.js +14 -0
- package/build/submit/ios/AppSpecificPasswordSource.d.ts +9 -6
- package/build/submit/ios/AppSpecificPasswordSource.js +42 -20
- package/build/submit/ios/AscApiKeySource.d.ts +9 -3
- package/build/submit/ios/AscApiKeySource.js +10 -10
- package/build/submit/ios/CredentialsServiceSource.d.ts +15 -0
- package/build/submit/ios/CredentialsServiceSource.js +52 -0
- package/build/submit/ios/IosSubmitCommand.d.ts +1 -2
- package/build/submit/ios/IosSubmitCommand.js +24 -53
- package/build/submit/ios/IosSubmitter.d.ts +20 -7
- package/build/submit/ios/IosSubmitter.js +79 -43
- package/build/submit/submit.js +13 -4
- package/build/submit/utils/errors.js +2 -0
- package/build/user/User.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +6 -6
- package/build/build/utils/analytics.d.ts +0 -22
- package/build/build/utils/analytics.js +0 -28
|
@@ -3,7 +3,7 @@ import { ApiKey, ApiKeyProps } from '@expo/apple-utils';
|
|
|
3
3
|
import { AscApiKey, AscApiKeyInfo } from './Credentials.types';
|
|
4
4
|
import { AuthCtx } from './authenticate';
|
|
5
5
|
export declare function listAscApiKeysAsync(authCtx: AuthCtx): Promise<AscApiKeyInfo[]>;
|
|
6
|
-
export declare function getAscApiKeyAsync(authCtx: AuthCtx, keyId: string): Promise<AscApiKeyInfo>;
|
|
6
|
+
export declare function getAscApiKeyAsync(authCtx: AuthCtx, keyId: string): Promise<AscApiKeyInfo | null>;
|
|
7
7
|
export declare function createAscApiKeyAsync(authCtx: AuthCtx, { nickname, allAppsVisible, roles, keyType, }: Partial<Pick<ApiKeyProps, 'nickname' | 'roles' | 'allAppsVisible' | 'keyType'>>): Promise<AscApiKey>;
|
|
8
8
|
export declare function revokeAscApiKeyAsync(authCtx: AuthCtx, keyId: string): Promise<AscApiKeyInfo>;
|
|
9
9
|
export declare function getAscApiKeyInfo(apiKey: ApiKey, authCtx: AuthCtx): AscApiKeyInfo;
|
|
@@ -21,6 +21,7 @@ async function listAscApiKeysAsync(authCtx) {
|
|
|
21
21
|
}
|
|
22
22
|
exports.listAscApiKeysAsync = listAscApiKeysAsync;
|
|
23
23
|
async function getAscApiKeyAsync(authCtx, keyId) {
|
|
24
|
+
var _a;
|
|
24
25
|
const spinner = (0, ora_1.ora)(`Fetching App Store Connect API Key.`).start();
|
|
25
26
|
try {
|
|
26
27
|
const context = (0, authenticate_1.getRequestContext)(authCtx);
|
|
@@ -29,6 +30,11 @@ async function getAscApiKeyAsync(authCtx, keyId) {
|
|
|
29
30
|
return getAscApiKeyInfo(apiKey, authCtx);
|
|
30
31
|
}
|
|
31
32
|
catch (error) {
|
|
33
|
+
const message = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : '';
|
|
34
|
+
if (message.includes("There is no resource of type 'apiKeys' with id")) {
|
|
35
|
+
spinner.stop();
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
32
38
|
log_1.default.error(error);
|
|
33
39
|
spinner.fail(`Failed to fetch App Store Connect API Key.`);
|
|
34
40
|
throw error;
|
|
@@ -58,8 +64,11 @@ async function createAscApiKeyAsync(authCtx, { nickname, allAppsVisible, roles,
|
|
|
58
64
|
}
|
|
59
65
|
throw new Error(`Failed to download .p8 file of ${humanReadableKey}.`);
|
|
60
66
|
}
|
|
67
|
+
// this object has more optional parameters populated
|
|
68
|
+
const fullKey = await apple_utils_1.ApiKey.infoAsync(context, { id: key.id });
|
|
69
|
+
spinner.succeed(`Created App Store Connect API Key.`);
|
|
61
70
|
return {
|
|
62
|
-
...getAscApiKeyInfo(
|
|
71
|
+
...getAscApiKeyInfo(fullKey, authCtx),
|
|
63
72
|
keyP8,
|
|
64
73
|
};
|
|
65
74
|
}
|
|
@@ -94,6 +103,7 @@ function getAscApiKeyInfo(apiKey, authCtx) {
|
|
|
94
103
|
teamId: authCtx.team.id,
|
|
95
104
|
teamName: authCtx.team.name,
|
|
96
105
|
roles: apiKey.attributes.roles,
|
|
106
|
+
isRevoked: !!apiKey.attributes.revokingDate,
|
|
97
107
|
};
|
|
98
108
|
}
|
|
99
109
|
exports.getAscApiKeyInfo = getAscApiKeyInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Workflow } from '@expo/eas-build-job';
|
|
2
2
|
import { JSONObject } from '@expo/json-file';
|
|
3
|
-
export declare function getManagedEntitlementsJsonAsync(projectDir: string): Promise<JSONObject>;
|
|
4
|
-
export declare function resolveEntitlementsJsonAsync(projectDir: string, workflow: Workflow): Promise<JSONObject>;
|
|
3
|
+
export declare function getManagedEntitlementsJsonAsync(projectDir: string, env: Record<string, string>): Promise<JSONObject>;
|
|
4
|
+
export declare function resolveEntitlementsJsonAsync(projectDir: string, workflow: Workflow, env: Record<string, string>): Promise<JSONObject>;
|
|
@@ -7,23 +7,33 @@ const eas_build_job_1 = require("@expo/eas-build-job");
|
|
|
7
7
|
const plist_1 = (0, tslib_1.__importDefault)(require("@expo/plist"));
|
|
8
8
|
const prebuild_config_1 = require("@expo/prebuild-config");
|
|
9
9
|
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
10
|
-
async function getManagedEntitlementsJsonAsync(projectDir) {
|
|
10
|
+
async function getManagedEntitlementsJsonAsync(projectDir, env) {
|
|
11
11
|
var _a;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const originalProcessEnv = process.env;
|
|
13
|
+
try {
|
|
14
|
+
process.env = {
|
|
15
|
+
...process.env,
|
|
16
|
+
...env,
|
|
17
|
+
};
|
|
18
|
+
const { exp } = (0, prebuild_config_1.getPrebuildConfig)(projectDir, { platforms: ['ios'] });
|
|
19
|
+
const expWithMods = await (0, config_plugins_1.compileModsAsync)(exp, {
|
|
20
|
+
projectRoot: projectDir,
|
|
21
|
+
platforms: ['ios'],
|
|
22
|
+
introspect: true,
|
|
23
|
+
});
|
|
24
|
+
return ((_a = expWithMods.ios) === null || _a === void 0 ? void 0 : _a.entitlements) || {};
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
process.env = originalProcessEnv;
|
|
28
|
+
}
|
|
19
29
|
}
|
|
20
30
|
exports.getManagedEntitlementsJsonAsync = getManagedEntitlementsJsonAsync;
|
|
21
|
-
async function resolveEntitlementsJsonAsync(projectDir, workflow) {
|
|
31
|
+
async function resolveEntitlementsJsonAsync(projectDir, workflow, env) {
|
|
22
32
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
23
33
|
return (await getEntitlementsJsonAsync(projectDir)) || {};
|
|
24
34
|
}
|
|
25
35
|
else if (workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
26
|
-
return await getManagedEntitlementsJsonAsync(projectDir);
|
|
36
|
+
return await getManagedEntitlementsJsonAsync(projectDir, env);
|
|
27
37
|
}
|
|
28
38
|
else {
|
|
29
39
|
throw new Error(`Unknown workflow: ${workflow}`);
|
|
@@ -52,6 +52,7 @@ export interface AscApiKeyPath {
|
|
|
52
52
|
keyId: string;
|
|
53
53
|
issuerId: string;
|
|
54
54
|
}
|
|
55
|
-
export declare const
|
|
55
|
+
export declare const ascApiKeyIdSchema: CredentialSchema<Pick<MinimalAscApiKey, 'keyId'>>;
|
|
56
|
+
export declare const ascApiKeyIssuerIdSchema: CredentialSchema<Pick<MinimalAscApiKey, 'issuerId'>>;
|
|
56
57
|
export declare const pushKeySchema: CredentialSchema<PushKey>;
|
|
57
58
|
export declare const provisioningProfileSchema: CredentialSchema<ProvisioningProfile>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.provisioningProfileSchema = exports.pushKeySchema = exports.
|
|
3
|
+
exports.provisioningProfileSchema = exports.pushKeySchema = exports.ascApiKeyIssuerIdSchema = exports.ascApiKeyIdSchema = exports.distributionCertificateSchema = exports.getAppLookupParams = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
6
6
|
const p12Certificate_1 = require("./utils/p12Certificate");
|
|
@@ -50,7 +50,7 @@ exports.distributionCertificateSchema = {
|
|
|
50
50
|
return answers;
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
|
-
exports.
|
|
53
|
+
exports.ascApiKeyIdSchema = {
|
|
54
54
|
name: 'App Store Connect API Key',
|
|
55
55
|
questions: [
|
|
56
56
|
{
|
|
@@ -58,6 +58,11 @@ exports.ascApiKeyMetadataSchema = {
|
|
|
58
58
|
type: 'string',
|
|
59
59
|
question: 'Key ID:',
|
|
60
60
|
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
exports.ascApiKeyIssuerIdSchema = {
|
|
64
|
+
name: 'App Store Connect API Key',
|
|
65
|
+
questions: [
|
|
61
66
|
{
|
|
62
67
|
field: 'issuerId',
|
|
63
68
|
type: 'string',
|
|
@@ -71,7 +71,7 @@ function displayIosCredentials(app, appCredentialsMap, targets) {
|
|
|
71
71
|
fields.push({ label: '', value: '' });
|
|
72
72
|
continue;
|
|
73
73
|
}
|
|
74
|
-
const { appleTeam, pushKey } = targetAppCredentials;
|
|
74
|
+
const { appleTeam, pushKey, appStoreConnectApiKeyForSubmissions } = targetAppCredentials;
|
|
75
75
|
if (appleTeam) {
|
|
76
76
|
const { appleTeamIdentifier, appleTeamName } = appleTeam;
|
|
77
77
|
fields.push({
|
|
@@ -83,6 +83,9 @@ function displayIosCredentials(app, appCredentialsMap, targets) {
|
|
|
83
83
|
if (pushKey) {
|
|
84
84
|
displayApplePushKey(pushKey, fields);
|
|
85
85
|
}
|
|
86
|
+
if (appStoreConnectApiKeyForSubmissions) {
|
|
87
|
+
displayAscApiKey(appStoreConnectApiKeyForSubmissions, fields);
|
|
88
|
+
}
|
|
86
89
|
const sortedIosAppBuildCredentialsList = sortBuildCredentialsByDistributionType(targetAppCredentials.iosAppBuildCredentialsList);
|
|
87
90
|
for (const iosAppBuildCredentials of sortedIosAppBuildCredentialsList) {
|
|
88
91
|
displayIosAppBuildCredentials(iosAppBuildCredentials, fields);
|
|
@@ -194,6 +197,32 @@ function displayApplePushKey(maybePushKey, fields) {
|
|
|
194
197
|
}
|
|
195
198
|
fields.push({ label: '', value: '' });
|
|
196
199
|
}
|
|
200
|
+
function displayAscApiKey(maybeAscApiKey, fields) {
|
|
201
|
+
fields.push({ label: 'App Store Connect API Key', value: '' });
|
|
202
|
+
if (maybeAscApiKey) {
|
|
203
|
+
const { keyIdentifier, issuerIdentifier, appleTeam, name, roles, updatedAt } = maybeAscApiKey;
|
|
204
|
+
fields.push({ label: 'Developer Portal ID', value: keyIdentifier });
|
|
205
|
+
if (name) {
|
|
206
|
+
fields.push({ label: 'Name', value: name });
|
|
207
|
+
}
|
|
208
|
+
fields.push({ label: 'Issuer ID', value: issuerIdentifier });
|
|
209
|
+
if (roles) {
|
|
210
|
+
fields.push({ label: 'Roles', value: roles.join(',') });
|
|
211
|
+
}
|
|
212
|
+
if (appleTeam) {
|
|
213
|
+
const { appleTeamIdentifier, appleTeamName } = appleTeam;
|
|
214
|
+
fields.push({
|
|
215
|
+
label: 'Apple Team',
|
|
216
|
+
value: `${appleTeamIdentifier} ${appleTeamName ? `(${appleTeamName})` : ''}`,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
fields.push({ label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` });
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
fields.push({ label: '', value: 'None assigned yet' });
|
|
223
|
+
}
|
|
224
|
+
fields.push({ label: '', value: '' });
|
|
225
|
+
}
|
|
197
226
|
function formatAppleDevice(device) {
|
|
198
227
|
let deviceString = '';
|
|
199
228
|
if (device.name) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AppStoreConnectApiKeyFragment } from '../../../graphql/generated';
|
|
2
|
+
import { CredentialsContext } from '../../context';
|
|
3
|
+
import { MinimalAscApiKey } from '../credentials';
|
|
4
|
+
export declare function isAscApiKeyValidAndTrackedAsync(ctx: CredentialsContext, ascApiKey: MinimalAscApiKey): Promise<boolean>;
|
|
5
|
+
export declare function getValidAndTrackedAscApiKeysAsync(ctx: CredentialsContext, ascApiKeys: AppStoreConnectApiKeyFragment[]): Promise<AppStoreConnectApiKeyFragment[]>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValidAndTrackedAscApiKeysAsync = exports.isAscApiKeyValidAndTrackedAsync = void 0;
|
|
4
|
+
async function isAscApiKeyValidAndTrackedAsync(ctx, ascApiKey) {
|
|
5
|
+
const ascApiKeyInfo = await ctx.appStore.getAscApiKeyAsync(ascApiKey.keyId);
|
|
6
|
+
return isKeyValid(ascApiKeyInfo);
|
|
7
|
+
}
|
|
8
|
+
exports.isAscApiKeyValidAndTrackedAsync = isAscApiKeyValidAndTrackedAsync;
|
|
9
|
+
async function getValidAndTrackedAscApiKeysAsync(ctx, ascApiKeys) {
|
|
10
|
+
const ascApiKeysInfo = await ctx.appStore.listAscApiKeysAsync();
|
|
11
|
+
const validAscApiKeysInfo = ascApiKeysInfo.filter(keyInfo => isKeyValid(keyInfo));
|
|
12
|
+
const validKeyIdentifiers = new Set(validAscApiKeysInfo.map(keyInfo => keyInfo.keyId));
|
|
13
|
+
return ascApiKeys.filter(key => validKeyIdentifiers.has(key.keyIdentifier));
|
|
14
|
+
}
|
|
15
|
+
exports.getValidAndTrackedAscApiKeysAsync = getValidAndTrackedAscApiKeysAsync;
|
|
16
|
+
function isKeyValid(ascApiKeyInfo) {
|
|
17
|
+
if (!ascApiKeyInfo) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return !ascApiKeyInfo.isRevoked;
|
|
21
|
+
}
|
|
@@ -23,25 +23,30 @@ export declare enum AndroidActionType {
|
|
|
23
23
|
CreateGsaKey = 11,
|
|
24
24
|
UseExistingGsaKey = 12,
|
|
25
25
|
RemoveGsaKey = 13,
|
|
26
|
-
|
|
26
|
+
SetUpGsaKey = 14,
|
|
27
27
|
UpdateCredentialsJson = 15,
|
|
28
|
-
|
|
28
|
+
SetUpBuildCredentialsFromCredentialsJson = 16
|
|
29
29
|
}
|
|
30
30
|
export declare enum IosActionType {
|
|
31
31
|
ManageCredentialsJson = 0,
|
|
32
32
|
ManageBuildCredentials = 1,
|
|
33
33
|
ManagePushKey = 2,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
ManageAscApiKey = 3,
|
|
35
|
+
GoBackToCaller = 4,
|
|
36
|
+
GoBackToHighLevelActions = 5,
|
|
37
|
+
SetUpBuildCredentials = 6,
|
|
38
|
+
SetUpBuildCredentialsFromCredentialsJson = 7,
|
|
39
|
+
UpdateCredentialsJson = 8,
|
|
40
|
+
UseExistingDistributionCertificate = 9,
|
|
41
|
+
RemoveProvisioningProfile = 10,
|
|
42
|
+
CreateDistributionCertificate = 11,
|
|
43
|
+
RemoveDistributionCertificate = 12,
|
|
44
|
+
SetUpPushKey = 13,
|
|
45
|
+
CreatePushKey = 14,
|
|
46
|
+
UseExistingPushKey = 15,
|
|
47
|
+
RemovePushKey = 16,
|
|
48
|
+
SetUpAscApiKeyForSubmissions = 17,
|
|
49
|
+
UseExistingAscApiKeyForSubmissions = 18,
|
|
50
|
+
CreateAscApiKeyForSubmissions = 19,
|
|
51
|
+
RemoveAscApiKey = 20
|
|
47
52
|
}
|
|
@@ -23,26 +23,31 @@ var AndroidActionType;
|
|
|
23
23
|
AndroidActionType[AndroidActionType["CreateGsaKey"] = 11] = "CreateGsaKey";
|
|
24
24
|
AndroidActionType[AndroidActionType["UseExistingGsaKey"] = 12] = "UseExistingGsaKey";
|
|
25
25
|
AndroidActionType[AndroidActionType["RemoveGsaKey"] = 13] = "RemoveGsaKey";
|
|
26
|
-
AndroidActionType[AndroidActionType["
|
|
26
|
+
AndroidActionType[AndroidActionType["SetUpGsaKey"] = 14] = "SetUpGsaKey";
|
|
27
27
|
AndroidActionType[AndroidActionType["UpdateCredentialsJson"] = 15] = "UpdateCredentialsJson";
|
|
28
|
-
AndroidActionType[AndroidActionType["
|
|
28
|
+
AndroidActionType[AndroidActionType["SetUpBuildCredentialsFromCredentialsJson"] = 16] = "SetUpBuildCredentialsFromCredentialsJson";
|
|
29
29
|
})(AndroidActionType = exports.AndroidActionType || (exports.AndroidActionType = {}));
|
|
30
30
|
var IosActionType;
|
|
31
31
|
(function (IosActionType) {
|
|
32
32
|
IosActionType[IosActionType["ManageCredentialsJson"] = 0] = "ManageCredentialsJson";
|
|
33
33
|
IosActionType[IosActionType["ManageBuildCredentials"] = 1] = "ManageBuildCredentials";
|
|
34
34
|
IosActionType[IosActionType["ManagePushKey"] = 2] = "ManagePushKey";
|
|
35
|
-
IosActionType[IosActionType["
|
|
36
|
-
IosActionType[IosActionType["
|
|
37
|
-
IosActionType[IosActionType["
|
|
38
|
-
IosActionType[IosActionType["
|
|
39
|
-
IosActionType[IosActionType["
|
|
40
|
-
IosActionType[IosActionType["
|
|
41
|
-
IosActionType[IosActionType["
|
|
42
|
-
IosActionType[IosActionType["
|
|
43
|
-
IosActionType[IosActionType["
|
|
44
|
-
IosActionType[IosActionType["
|
|
45
|
-
IosActionType[IosActionType["
|
|
46
|
-
IosActionType[IosActionType["
|
|
47
|
-
IosActionType[IosActionType["
|
|
35
|
+
IosActionType[IosActionType["ManageAscApiKey"] = 3] = "ManageAscApiKey";
|
|
36
|
+
IosActionType[IosActionType["GoBackToCaller"] = 4] = "GoBackToCaller";
|
|
37
|
+
IosActionType[IosActionType["GoBackToHighLevelActions"] = 5] = "GoBackToHighLevelActions";
|
|
38
|
+
IosActionType[IosActionType["SetUpBuildCredentials"] = 6] = "SetUpBuildCredentials";
|
|
39
|
+
IosActionType[IosActionType["SetUpBuildCredentialsFromCredentialsJson"] = 7] = "SetUpBuildCredentialsFromCredentialsJson";
|
|
40
|
+
IosActionType[IosActionType["UpdateCredentialsJson"] = 8] = "UpdateCredentialsJson";
|
|
41
|
+
IosActionType[IosActionType["UseExistingDistributionCertificate"] = 9] = "UseExistingDistributionCertificate";
|
|
42
|
+
IosActionType[IosActionType["RemoveProvisioningProfile"] = 10] = "RemoveProvisioningProfile";
|
|
43
|
+
IosActionType[IosActionType["CreateDistributionCertificate"] = 11] = "CreateDistributionCertificate";
|
|
44
|
+
IosActionType[IosActionType["RemoveDistributionCertificate"] = 12] = "RemoveDistributionCertificate";
|
|
45
|
+
IosActionType[IosActionType["SetUpPushKey"] = 13] = "SetUpPushKey";
|
|
46
|
+
IosActionType[IosActionType["CreatePushKey"] = 14] = "CreatePushKey";
|
|
47
|
+
IosActionType[IosActionType["UseExistingPushKey"] = 15] = "UseExistingPushKey";
|
|
48
|
+
IosActionType[IosActionType["RemovePushKey"] = 16] = "RemovePushKey";
|
|
49
|
+
IosActionType[IosActionType["SetUpAscApiKeyForSubmissions"] = 17] = "SetUpAscApiKeyForSubmissions";
|
|
50
|
+
IosActionType[IosActionType["UseExistingAscApiKeyForSubmissions"] = 18] = "UseExistingAscApiKeyForSubmissions";
|
|
51
|
+
IosActionType[IosActionType["CreateAscApiKeyForSubmissions"] = 19] = "CreateAscApiKeyForSubmissions";
|
|
52
|
+
IosActionType[IosActionType["RemoveAscApiKey"] = 20] = "RemoveAscApiKey";
|
|
48
53
|
})(IosActionType = exports.IosActionType || (exports.IosActionType = {}));
|
|
@@ -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
|
{
|
|
@@ -36,7 +36,7 @@ exports.credentialsJsonActions = [
|
|
|
36
36
|
scope: Actions_1.Scope.Project,
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
value: Actions_1.AndroidActionType.
|
|
39
|
+
value: Actions_1.AndroidActionType.SetUpBuildCredentialsFromCredentialsJson,
|
|
40
40
|
title: 'Upload credentials from credentials.json to EAS',
|
|
41
41
|
scope: Actions_1.Scope.Project,
|
|
42
42
|
},
|
|
@@ -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
|
{
|
|
@@ -87,8 +87,8 @@ exports.fcmActions = [
|
|
|
87
87
|
];
|
|
88
88
|
exports.gsaKeyActions = [
|
|
89
89
|
{
|
|
90
|
-
value: Actions_1.AndroidActionType.
|
|
91
|
-
title: '
|
|
90
|
+
value: Actions_1.AndroidActionType.SetUpGsaKey,
|
|
91
|
+
title: 'Set up a Google Service Account Key',
|
|
92
92
|
scope: Actions_1.Scope.Project,
|
|
93
93
|
},
|
|
94
94
|
{
|
|
@@ -3,4 +3,5 @@ import { ActionInfo } from './Actions';
|
|
|
3
3
|
export declare const highLevelActions: ActionInfo[];
|
|
4
4
|
export declare const credentialsJsonActions: ActionInfo[];
|
|
5
5
|
export declare function getPushKeyActions(ctx: CredentialsContext): ActionInfo[];
|
|
6
|
+
export declare function getAscApiKeyActions(ctx: CredentialsContext): ActionInfo[];
|
|
6
7
|
export declare function getBuildCredentialsActions(ctx: CredentialsContext): ActionInfo[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBuildCredentialsActions = exports.getPushKeyActions = exports.credentialsJsonActions = exports.highLevelActions = void 0;
|
|
3
|
+
exports.getBuildCredentialsActions = exports.getAscApiKeyActions = exports.getPushKeyActions = exports.credentialsJsonActions = exports.highLevelActions = void 0;
|
|
4
4
|
const Actions_1 = require("./Actions");
|
|
5
5
|
exports.highLevelActions = [
|
|
6
6
|
{
|
|
@@ -13,6 +13,11 @@ exports.highLevelActions = [
|
|
|
13
13
|
title: 'Push Notifications: Manage your Apple Push Notifications Key',
|
|
14
14
|
scope: Actions_1.Scope.Manager,
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
value: Actions_1.IosActionType.ManageAscApiKey,
|
|
18
|
+
title: 'App Store Connect: Manage your API Key',
|
|
19
|
+
scope: Actions_1.Scope.Manager,
|
|
20
|
+
},
|
|
16
21
|
{
|
|
17
22
|
value: Actions_1.IosActionType.ManageCredentialsJson,
|
|
18
23
|
title: 'credentials.json: Upload/Download credentials between EAS servers and your local json ',
|
|
@@ -31,7 +36,7 @@ exports.credentialsJsonActions = [
|
|
|
31
36
|
scope: Actions_1.Scope.Project,
|
|
32
37
|
},
|
|
33
38
|
{
|
|
34
|
-
value: Actions_1.IosActionType.
|
|
39
|
+
value: Actions_1.IosActionType.SetUpBuildCredentialsFromCredentialsJson,
|
|
35
40
|
title: 'Upload credentials from credentials.json to EAS',
|
|
36
41
|
scope: Actions_1.Scope.Project,
|
|
37
42
|
},
|
|
@@ -44,8 +49,8 @@ exports.credentialsJsonActions = [
|
|
|
44
49
|
function getPushKeyActions(ctx) {
|
|
45
50
|
return [
|
|
46
51
|
{
|
|
47
|
-
value: Actions_1.IosActionType.
|
|
48
|
-
title: '
|
|
52
|
+
value: Actions_1.IosActionType.SetUpPushKey,
|
|
53
|
+
title: 'Set up your project to use Push Notifications',
|
|
49
54
|
scope: Actions_1.Scope.Project,
|
|
50
55
|
},
|
|
51
56
|
{
|
|
@@ -71,12 +76,42 @@ function getPushKeyActions(ctx) {
|
|
|
71
76
|
];
|
|
72
77
|
}
|
|
73
78
|
exports.getPushKeyActions = getPushKeyActions;
|
|
79
|
+
function getAscApiKeyActions(ctx) {
|
|
80
|
+
return [
|
|
81
|
+
{
|
|
82
|
+
value: Actions_1.IosActionType.SetUpAscApiKeyForSubmissions,
|
|
83
|
+
title: 'Set up your project to use an API Key for EAS Submit',
|
|
84
|
+
scope: Actions_1.Scope.Project,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: Actions_1.IosActionType.UseExistingAscApiKeyForSubmissions,
|
|
88
|
+
title: 'Use an existing API Key for EAS Submit',
|
|
89
|
+
scope: Actions_1.Scope.Project,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
value: Actions_1.IosActionType.CreateAscApiKeyForSubmissions,
|
|
93
|
+
title: 'Add a new API Key For EAS Submit',
|
|
94
|
+
scope: ctx.hasProjectContext ? Actions_1.Scope.Project : Actions_1.Scope.Account,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
value: Actions_1.IosActionType.RemoveAscApiKey,
|
|
98
|
+
title: 'Delete an API Key',
|
|
99
|
+
scope: Actions_1.Scope.Account,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
value: Actions_1.IosActionType.GoBackToHighLevelActions,
|
|
103
|
+
title: 'Go back',
|
|
104
|
+
scope: Actions_1.Scope.Manager,
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
exports.getAscApiKeyActions = getAscApiKeyActions;
|
|
74
109
|
function getBuildCredentialsActions(ctx) {
|
|
75
110
|
return [
|
|
76
111
|
{
|
|
77
112
|
// This command will be triggered during build to ensure all credentials are ready
|
|
78
113
|
// I'm leaving it here for now to simplify testing
|
|
79
|
-
value: Actions_1.IosActionType.
|
|
114
|
+
value: Actions_1.IosActionType.SetUpBuildCredentials,
|
|
80
115
|
title: 'All: Set up all the required credentials to build your project',
|
|
81
116
|
scope: Actions_1.Scope.Project,
|
|
82
117
|
},
|
|
@@ -20,8 +20,8 @@ const DownloadKeystore_1 = require("../android/actions/DownloadKeystore");
|
|
|
20
20
|
const RemoveFcm_1 = require("../android/actions/RemoveFcm");
|
|
21
21
|
const RemoveGoogleServiceAccountKey_1 = require("../android/actions/RemoveGoogleServiceAccountKey");
|
|
22
22
|
const RemoveKeystore_1 = require("../android/actions/RemoveKeystore");
|
|
23
|
-
const
|
|
24
|
-
const
|
|
23
|
+
const SetUpBuildCredentialsFromCredentialsJson_1 = require("../android/actions/SetUpBuildCredentialsFromCredentialsJson");
|
|
24
|
+
const SetUpGoogleServiceAccountKey_1 = require("../android/actions/SetUpGoogleServiceAccountKey");
|
|
25
25
|
const UpdateCredentialsJson_1 = require("../android/actions/UpdateCredentialsJson");
|
|
26
26
|
const UseExistingGoogleServiceAccountKey_1 = require("../android/actions/UseExistingGoogleServiceAccountKey");
|
|
27
27
|
const printCredentials_1 = require("../android/utils/printCredentials");
|
|
@@ -180,8 +180,8 @@ class ManageAndroid {
|
|
|
180
180
|
else if (action === Actions_1.AndroidActionType.RemoveGsaKey) {
|
|
181
181
|
await new RemoveGoogleServiceAccountKey_1.SelectAndRemoveGoogleServiceAccountKey(appLookupParams.account).runAsync(ctx);
|
|
182
182
|
}
|
|
183
|
-
else if (action === Actions_1.AndroidActionType.
|
|
184
|
-
await new
|
|
183
|
+
else if (action === Actions_1.AndroidActionType.SetUpGsaKey) {
|
|
184
|
+
await new SetUpGoogleServiceAccountKey_1.SetUpGoogleServiceAccountKey(appLookupParams).runAsync(ctx);
|
|
185
185
|
}
|
|
186
186
|
else if (action === Actions_1.AndroidActionType.UpdateCredentialsJson) {
|
|
187
187
|
const buildCredentials = await new SelectAndroidBuildCredentials_1.SelectExistingAndroidBuildCredentials(appLookupParams).runAsync(ctx);
|
|
@@ -189,8 +189,8 @@ class ManageAndroid {
|
|
|
189
189
|
await new UpdateCredentialsJson_1.UpdateCredentialsJson().runAsync(ctx, buildCredentials);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
else if (action === Actions_1.AndroidActionType.
|
|
193
|
-
await new
|
|
192
|
+
else if (action === Actions_1.AndroidActionType.SetUpBuildCredentialsFromCredentialsJson) {
|
|
193
|
+
await new SetUpBuildCredentialsFromCredentialsJson_1.SetUpBuildCredentialsFromCredentialsJson(appLookupParams).runAsync(ctx);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}
|