eas-cli 9.0.3 → 9.0.4
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 +59 -59
- package/build/analytics/AnalyticsManager.js +4 -5
- package/build/api.js +1 -2
- package/build/branch/actions/SelectBranch.js +2 -3
- package/build/branch/queries.js +3 -5
- package/build/branch/utils.js +1 -1
- package/build/build/android/build.js +3 -5
- package/build/build/android/graphql.js +1 -2
- package/build/build/android/prepareJob.js +1 -2
- package/build/build/android/syncProjectConfiguration.js +1 -1
- package/build/build/android/version.js +14 -16
- package/build/build/build.js +8 -10
- package/build/build/createContext.js +7 -8
- package/build/build/ios/build.js +2 -4
- package/build/build/ios/credentials.js +1 -2
- package/build/build/ios/graphql.js +4 -6
- package/build/build/ios/prepareJob.js +5 -6
- package/build/build/ios/syncProjectConfiguration.js +1 -1
- package/build/build/ios/version.js +17 -20
- package/build/build/local.js +2 -3
- package/build/build/metadata.js +9 -10
- package/build/build/queries.js +6 -9
- package/build/build/runBuildAndSubmit.d.ts +3 -1
- package/build/build/runBuildAndSubmit.js +19 -13
- package/build/build/utils/appJson.js +1 -2
- package/build/build/utils/formatBuild.js +5 -8
- package/build/build/utils/printBuildInfo.js +1 -2
- package/build/build/utils/resourceClass.js +3 -4
- package/build/build/utils/url.js +1 -2
- package/build/build/validate.js +8 -11
- package/build/channel/actions/SelectChannel.js +2 -3
- package/build/channel/errors.js +1 -1
- package/build/channel/queries.js +6 -10
- package/build/channel/utils.js +1 -1
- package/build/commandUtils/EasCommand.js +7 -6
- package/build/commandUtils/builds.js +3 -3
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +2 -2
- package/build/commandUtils/context/LoggedInContextField.js +1 -2
- package/build/commandUtils/context/MaybeLoggedInContextField.js +2 -3
- package/build/commandUtils/context/VcsClientContextField.js +1 -1
- package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +4 -6
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +2 -4
- package/build/commandUtils/gating/FeatureGateEnvOverrides.js +1 -2
- package/build/commandUtils/pagination.js +3 -4
- package/build/commands/account/view.js +1 -2
- package/build/commands/branch/delete.js +1 -2
- package/build/commands/build/configure.js +1 -2
- package/build/commands/build/index.js +1 -2
- package/build/commands/build/internal.js +1 -2
- package/build/commands/build/resign.js +7 -7
- package/build/commands/build/run.js +2 -3
- package/build/commands/build/version/get.js +3 -4
- package/build/commands/build/version/set.js +5 -6
- package/build/commands/build/version/sync.js +5 -7
- package/build/commands/channel/rollout.js +1 -2
- package/build/commands/config.js +16 -14
- package/build/commands/credentials/configure-build.js +3 -3
- package/build/commands/credentials/index.js +1 -1
- package/build/commands/device/create.js +1 -1
- package/build/commands/device/rename.js +1 -1
- package/build/commands/diagnostics.js +6 -2
- package/build/commands/project/init.js +11 -9
- package/build/commands/project/onboarding.js +192 -20
- package/build/commands/secret/delete.js +5 -5
- package/build/commands/update/index.js +5 -6
- package/build/commands/update/republish.js +1 -2
- package/build/commands/update/roll-back-to-embedded.js +3 -4
- package/build/credentials/android/AndroidCredentialsProvider.js +4 -5
- package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -3
- package/build/credentials/android/actions/DownloadKeystore.js +2 -3
- package/build/credentials/android/actions/RemoveFcm.js +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentials.js +3 -5
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.js +3 -3
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.js +3 -3
- package/build/credentials/android/api/GraphqlClient.js +4 -8
- package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.js +1 -2
- package/build/credentials/android/utils/printCredentials.js +4 -4
- package/build/credentials/context.js +2 -3
- package/build/credentials/credentialsJson/update.js +14 -16
- package/build/credentials/errors.js +7 -5
- package/build/credentials/ios/IosCredentialsProvider.js +3 -4
- package/build/credentials/ios/actions/AscApiKeyUtils.js +5 -9
- package/build/credentials/ios/actions/AssignAscApiKey.js +2 -3
- package/build/credentials/ios/actions/AssignPushKey.js +2 -3
- package/build/credentials/ios/actions/BuildCredentialsUtils.js +3 -5
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -3
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +3 -4
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +2 -3
- package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +3 -4
- package/build/credentials/ios/actions/SetUpAscApiKey.js +1 -1
- package/build/credentials/ios/actions/SetUpBuildCredentials.js +3 -4
- package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -2
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +2 -3
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +2 -3
- package/build/credentials/ios/api/GraphqlClient.js +11 -15
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +2 -4
- package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.js +1 -2
- package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.js +2 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +1 -2
- package/build/credentials/ios/appstore/ascApiKey.js +6 -8
- package/build/credentials/ios/appstore/authenticate.js +2 -4
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
- package/build/credentials/ios/appstore/contractMessages.js +3 -5
- package/build/credentials/ios/appstore/distributionCertificate.js +2 -3
- package/build/credentials/ios/appstore/ensureAppExists.js +1 -2
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +5 -7
- package/build/credentials/ios/appstore/pushKey.js +2 -3
- package/build/credentials/ios/appstore/resolveCredentials.js +8 -9
- package/build/credentials/ios/errors.js +1 -1
- package/build/credentials/ios/utils/p12Certificate.js +1 -2
- package/build/credentials/ios/utils/provisioningProfile.js +1 -2
- package/build/credentials/ios/validators/validateProvisioningProfile.js +5 -7
- package/build/credentials/manager/ManageAndroid.js +2 -2
- package/build/credentials/manager/ManageIos.js +3 -4
- package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -2
- package/build/credentials/manager/SetDefaultAndroidKeystore.js +1 -1
- package/build/credentials/manager/SetUpAndroidBuildCredentials.js +2 -2
- package/build/credentials/manager/SetUpIosBuildCredentials.js +2 -2
- package/build/credentials/utils/promptForCredentials.js +2 -3
- package/build/devices/actions/create/currentMachineMethod.js +4 -5
- package/build/devices/actions/create/developerPortalMethod.js +1 -2
- package/build/devices/actions/create/inputMethod.js +1 -1
- package/build/devices/context.js +1 -1
- package/build/devices/queries.js +3 -6
- package/build/devices/utils/errors.js +2 -2
- package/build/devices/utils/formatDevice.js +4 -6
- package/build/graphql/client.js +5 -8
- package/build/graphql/generated.d.ts +42 -0
- package/build/graphql/mutations/AppMutation.js +1 -2
- package/build/graphql/mutations/AppVersionMutation.js +1 -2
- package/build/graphql/mutations/BuildMutation.js +4 -8
- package/build/graphql/mutations/UserPreferencesMutation.js +2 -3
- package/build/graphql/queries/AppVersionQuery.js +1 -2
- package/build/graphql/queries/BranchQuery.js +1 -2
- package/build/graphql/queries/BuildQuery.js +1 -2
- package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -3
- package/build/graphql/queries/SubmissionQuery.js +1 -2
- package/build/graphql/queries/WebhookQuery.js +1 -2
- package/build/graphql/types/App.js +1 -0
- package/build/log.js +2 -2
- package/build/metadata/apple/config/reader.js +26 -32
- package/build/metadata/apple/config/writer.js +35 -39
- package/build/metadata/apple/rules/infoKeywordLength.js +2 -4
- package/build/metadata/apple/rules/infoRestrictedWords.js +2 -4
- package/build/metadata/apple/tasks/app-review-detail.js +1 -2
- package/build/metadata/apple/tasks/app-version.js +6 -8
- package/build/metadata/auth.js +1 -2
- package/build/metadata/config/resolve.js +2 -3
- package/build/metadata/config/validate.js +2 -4
- package/build/metadata/errors.js +3 -5
- package/build/metadata/upload.js +1 -2
- package/build/metadata/utils/retry.js +1 -2
- package/build/metadata/utils/telemetry.js +8 -11
- package/build/onboarding/runCommand.js +2 -2
- package/build/ora.js +1 -1
- package/build/project/android/applicationId.js +3 -4
- package/build/project/android/gradle.js +3 -4
- package/build/project/android/gradleUtils.js +4 -5
- package/build/project/expoConfig.js +3 -4
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +3 -5
- package/build/project/ios/bundleIdentifier.js +7 -8
- package/build/project/ios/entitlements.js +1 -2
- package/build/project/ios/scheme.js +7 -6
- package/build/project/ios/target.js +17 -23
- package/build/project/metroConfig.js +1 -2
- package/build/project/projectUtils.js +5 -7
- package/build/project/publish.js +18 -27
- package/build/project/remoteVersionSource.js +6 -7
- package/build/project/resolveRuntimeVersionAsync.d.ts +2 -1
- package/build/project/resolveRuntimeVersionAsync.js +3 -4
- package/build/prompts.js +5 -7
- package/build/rollout/actions/CreateRollout.js +4 -5
- package/build/rollout/actions/EditRollout.js +1 -2
- package/build/rollout/actions/EndRollout.js +2 -4
- package/build/rollout/actions/ManageRollout.js +1 -2
- package/build/rollout/actions/NonInteractiveRollout.js +1 -2
- package/build/rollout/actions/SelectRuntime.js +2 -4
- package/build/rollout/utils.js +4 -5
- package/build/run/android/adb.js +4 -7
- package/build/run/ios/xcode.js +1 -2
- package/build/run/ios/xcrun.js +1 -2
- package/build/run/utils.js +2 -4
- package/build/submit/ArchiveSource.js +1 -1
- package/build/submit/android/AndroidSubmitCommand.js +3 -5
- package/build/submit/android/AndroidSubmitter.js +3 -3
- package/build/submit/android/ServiceAccountSource.js +1 -2
- package/build/submit/ios/AppProduce.js +5 -4
- package/build/submit/ios/AppSpecificPasswordSource.js +2 -2
- package/build/submit/ios/AscApiKeySource.js +5 -3
- package/build/submit/ios/IosSubmitCommand.js +2 -3
- package/build/submit/ios/IosSubmitter.js +1 -1
- package/build/submit/ios/utils/language.js +3 -4
- package/build/submit/submit.js +2 -3
- package/build/submit/utils/errors.js +1 -2
- package/build/submit/utils/wait.js +1 -1
- package/build/update/android/UpdatesModule.js +1 -2
- package/build/update/configure.js +11 -14
- package/build/update/ios/UpdatesModule.js +2 -4
- package/build/update/queries.js +6 -10
- package/build/update/utils.js +28 -39
- package/build/user/SessionManager.js +5 -8
- package/build/user/User.js +2 -2
- package/build/user/expoSsoLauncher.js +1 -2
- package/build/utils/code-signing.js +4 -7
- package/build/utils/expoCli.js +1 -2
- package/build/utils/expoUpdatesCli.d.ts +1 -0
- package/build/utils/expoUpdatesCli.js +3 -2
- package/build/utils/profiles.js +3 -3
- package/build/utils/progress.js +2 -2
- package/build/utils/relay.js +10 -14
- package/build/utils/timer.js +1 -2
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/clients/git.js +24 -20
- package/build/vcs/git.d.ts +1 -1
- package/build/vcs/git.js +4 -2
- package/build/vcs/local.js +1 -2
- package/build/webhooks/input.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
|
@@ -19,9 +19,8 @@ async function getAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient, appL
|
|
|
19
19
|
}
|
|
20
20
|
exports.getAndroidAppCredentialsWithCommonFieldsAsync = getAndroidAppCredentialsWithCommonFieldsAsync;
|
|
21
21
|
async function getAndroidAppBuildCredentialsListAsync(graphqlClient, appLookupParams) {
|
|
22
|
-
var _a;
|
|
23
22
|
const appCredentials = await getAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient, appLookupParams);
|
|
24
|
-
return
|
|
23
|
+
return appCredentials?.androidAppBuildCredentialsList ?? [];
|
|
25
24
|
}
|
|
26
25
|
exports.getAndroidAppBuildCredentialsListAsync = getAndroidAppBuildCredentialsListAsync;
|
|
27
26
|
/* There is at most one set of legacy android app credentials associated with an Expo App */
|
|
@@ -34,9 +33,8 @@ async function getLegacyAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient
|
|
|
34
33
|
exports.getLegacyAndroidAppCredentialsWithCommonFieldsAsync = getLegacyAndroidAppCredentialsWithCommonFieldsAsync;
|
|
35
34
|
/* There is at most one set of legacy android app build credentials associated with an Expo App */
|
|
36
35
|
async function getLegacyAndroidAppBuildCredentialsAsync(graphqlClient, appLookupParams) {
|
|
37
|
-
var _a;
|
|
38
36
|
const legacyAppCredentials = await getLegacyAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient, appLookupParams);
|
|
39
|
-
return
|
|
37
|
+
return legacyAppCredentials?.androidAppBuildCredentialsList[0] ?? null;
|
|
40
38
|
}
|
|
41
39
|
exports.getLegacyAndroidAppBuildCredentialsAsync = getLegacyAndroidAppBuildCredentialsAsync;
|
|
42
40
|
async function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(graphqlClient, appLookupParams) {
|
|
@@ -84,15 +82,13 @@ async function createAndroidAppBuildCredentialsAsync(graphqlClient, appLookupPar
|
|
|
84
82
|
}
|
|
85
83
|
exports.createAndroidAppBuildCredentialsAsync = createAndroidAppBuildCredentialsAsync;
|
|
86
84
|
async function getDefaultAndroidAppBuildCredentialsAsync(graphqlClient, appLookupParams) {
|
|
87
|
-
var _a;
|
|
88
85
|
const buildCredentialsList = await getAndroidAppBuildCredentialsListAsync(graphqlClient, appLookupParams);
|
|
89
|
-
return
|
|
86
|
+
return buildCredentialsList.find(buildCredentials => buildCredentials.isDefault) ?? null;
|
|
90
87
|
}
|
|
91
88
|
exports.getDefaultAndroidAppBuildCredentialsAsync = getDefaultAndroidAppBuildCredentialsAsync;
|
|
92
89
|
async function getAndroidAppBuildCredentialsByNameAsync(graphqlClient, appLookupParams, name) {
|
|
93
|
-
var _a;
|
|
94
90
|
const buildCredentialsList = await getAndroidAppBuildCredentialsListAsync(graphqlClient, appLookupParams);
|
|
95
|
-
return
|
|
91
|
+
return buildCredentialsList.find(buildCredentials => buildCredentials.name === name) ?? null;
|
|
96
92
|
}
|
|
97
93
|
exports.getAndroidAppBuildCredentialsByNameAsync = getAndroidAppBuildCredentialsByNameAsync;
|
|
98
94
|
async function createOrUpdateAndroidAppBuildCredentialsByNameAsync(graphqlClient, appLookupParams, name, { androidKeystoreId, }) {
|
|
@@ -9,7 +9,6 @@ const client_1 = require("../../../../../graphql/client");
|
|
|
9
9
|
const AndroidAppCredentials_1 = require("../../../../../graphql/types/credentials/AndroidAppCredentials");
|
|
10
10
|
exports.AndroidAppCredentialsQuery = {
|
|
11
11
|
async withCommonFieldsByApplicationIdentifierAsync(graphqlClient, projectFullName, { androidApplicationIdentifier, legacyOnly, }) {
|
|
12
|
-
var _a;
|
|
13
12
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
14
13
|
.query((0, graphql_tag_1.default) `
|
|
15
14
|
query CommonAndroidAppCredentialsWithBuildCredentialsByApplicationIdentifierQuery(
|
|
@@ -47,6 +46,6 @@ exports.AndroidAppCredentialsQuery = {
|
|
|
47
46
|
})
|
|
48
47
|
.toPromise());
|
|
49
48
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
50
|
-
return
|
|
49
|
+
return data.app.byFullName.androidAppCredentials[0] ?? null;
|
|
51
50
|
},
|
|
52
51
|
};
|
|
@@ -40,7 +40,7 @@ function displayAndroidFcmCredentials(appCredentials) {
|
|
|
40
40
|
const { projectId, serviceAccountEmail, clientId, keyId } = snippet;
|
|
41
41
|
fields.push({ label: 'Project ID', value: projectId });
|
|
42
42
|
fields.push({ label: 'Client Email', value: serviceAccountEmail });
|
|
43
|
-
fields.push({ label: 'Client ID', value: clientId
|
|
43
|
+
fields.push({ label: 'Client ID', value: clientId ?? 'Unknown' });
|
|
44
44
|
fields.push({ label: 'Private Key ID', value: keyId });
|
|
45
45
|
}
|
|
46
46
|
fields.push({ label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` });
|
|
@@ -137,9 +137,9 @@ function displayAndroidKeystore(keystore) {
|
|
|
137
137
|
const fields = [
|
|
138
138
|
{ label: 'Type', value: type },
|
|
139
139
|
{ label: 'Key Alias', value: keyAlias },
|
|
140
|
-
{ label: 'MD5 Fingerprint', value: formatFingerprint(md5CertificateFingerprint
|
|
141
|
-
{ label: 'SHA1 Fingerprint', value: formatFingerprint(sha1CertificateFingerprint
|
|
142
|
-
{ label: 'SHA256 Fingerprint', value: formatFingerprint(sha256CertificateFingerprint
|
|
140
|
+
{ label: 'MD5 Fingerprint', value: formatFingerprint(md5CertificateFingerprint ?? null) },
|
|
141
|
+
{ label: 'SHA1 Fingerprint', value: formatFingerprint(sha1CertificateFingerprint ?? null) },
|
|
142
|
+
{ label: 'SHA256 Fingerprint', value: formatFingerprint(sha256CertificateFingerprint ?? null) },
|
|
143
143
|
{ label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` },
|
|
144
144
|
];
|
|
145
145
|
log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
|
|
@@ -12,7 +12,6 @@ const expoConfig_1 = require("../project/expoConfig");
|
|
|
12
12
|
const prompts_1 = require("../prompts");
|
|
13
13
|
class CredentialsContext {
|
|
14
14
|
constructor(options) {
|
|
15
|
-
var _a, _b;
|
|
16
15
|
this.options = options;
|
|
17
16
|
this.android = AndroidGraphqlClient;
|
|
18
17
|
this.appStore = new AppStoreApi_1.default();
|
|
@@ -25,9 +24,9 @@ class CredentialsContext {
|
|
|
25
24
|
this.graphqlClient = options.graphqlClient;
|
|
26
25
|
this.analytics = options.analytics;
|
|
27
26
|
this.vcsClient = options.vcsClient;
|
|
28
|
-
this.nonInteractive =
|
|
27
|
+
this.nonInteractive = options.nonInteractive ?? false;
|
|
29
28
|
this.projectInfo = options.projectInfo;
|
|
30
|
-
this.freezeCredentials =
|
|
29
|
+
this.freezeCredentials = options.freezeCredentials ?? false;
|
|
31
30
|
}
|
|
32
31
|
get hasProjectContext() {
|
|
33
32
|
return !!this.projectInfo;
|
|
@@ -16,13 +16,12 @@ const git_1 = tslib_1.__importDefault(require("../../vcs/clients/git"));
|
|
|
16
16
|
* is not validated
|
|
17
17
|
*/
|
|
18
18
|
async function updateAndroidCredentialsAsync(ctx, buildCredentials) {
|
|
19
|
-
|
|
20
|
-
const rawCredentialsJson = (_a = (await (0, read_1.readRawAsync)(ctx.projectDir, { throwIfMissing: false }))) !== null && _a !== void 0 ? _a : {};
|
|
19
|
+
const rawCredentialsJson = (await (0, read_1.readRawAsync)(ctx.projectDir, { throwIfMissing: false })) ?? {};
|
|
21
20
|
const keystore = buildCredentials.androidKeystore;
|
|
22
21
|
if (!keystore) {
|
|
23
22
|
throw new Error('There are no credentials configured for this project on EAS servers');
|
|
24
23
|
}
|
|
25
|
-
const keystorePath =
|
|
24
|
+
const keystorePath = rawCredentialsJson?.android?.keystore?.keystorePath ?? 'credentials/android/keystore.jks';
|
|
26
25
|
log_1.default.log(`Writing Keystore to ${keystorePath}`);
|
|
27
26
|
await updateFileAsync(ctx.projectDir, keystorePath, keystore.keystore);
|
|
28
27
|
const shouldWarnKeystore = await isFileUntrackedAsync(keystorePath, ctx.vcsClient);
|
|
@@ -31,7 +30,7 @@ async function updateAndroidCredentialsAsync(ctx, buildCredentials) {
|
|
|
31
30
|
keystorePath,
|
|
32
31
|
keystorePassword: keystore.keystorePassword,
|
|
33
32
|
keyAlias: keystore.keyAlias,
|
|
34
|
-
keyPassword:
|
|
33
|
+
keyPassword: keystore.keyPassword ?? undefined,
|
|
35
34
|
},
|
|
36
35
|
};
|
|
37
36
|
rawCredentialsJson.android = androidCredentials;
|
|
@@ -55,9 +54,8 @@ exports.updateAndroidCredentialsAsync = updateAndroidCredentialsAsync;
|
|
|
55
54
|
* credentials.json will be updated partially
|
|
56
55
|
*/
|
|
57
56
|
async function updateIosCredentialsAsync(ctx, app, targets, distributionType) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (typeof ((_b = rawCredentialsJson.ios) === null || _b === void 0 ? void 0 : _b.provisioningProfilePath) === 'string') {
|
|
57
|
+
const rawCredentialsJson = (await (0, read_1.readRawAsync)(ctx.projectDir, { throwIfMissing: false })) ?? {};
|
|
58
|
+
if (typeof rawCredentialsJson.ios?.provisioningProfilePath === 'string') {
|
|
61
59
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
62
60
|
rawCredentialsJson.ios = {
|
|
63
61
|
[applicationTarget.targetName]: rawCredentialsJson.ios,
|
|
@@ -114,16 +112,17 @@ async function updateIosCredentialsAsync(ctx, app, targets, distributionType) {
|
|
|
114
112
|
}
|
|
115
113
|
exports.updateIosCredentialsAsync = updateIosCredentialsAsync;
|
|
116
114
|
function createTargetCredentialsPathsMap(targets, rawCredentialsJsonMap) {
|
|
117
|
-
var _a, _b, _c;
|
|
118
115
|
const hasManyTargets = targets.length > 1;
|
|
119
116
|
const paths = {};
|
|
120
117
|
// 1. Create initial target credentials paths map
|
|
121
118
|
for (const target of targets) {
|
|
122
|
-
const rawTargetCredentialsJson = rawCredentialsJsonMap
|
|
119
|
+
const rawTargetCredentialsJson = rawCredentialsJsonMap?.[target.targetName];
|
|
123
120
|
const filePrefix = hasManyTargets ? `${target.targetName}-` : '';
|
|
124
121
|
paths[target.targetName] = {
|
|
125
|
-
provisioningProfilePath:
|
|
126
|
-
|
|
122
|
+
provisioningProfilePath: rawTargetCredentialsJson?.provisioningProfilePath ??
|
|
123
|
+
`credentials/ios/${filePrefix}profile.mobileprovision`,
|
|
124
|
+
distCertPath: rawTargetCredentialsJson?.distributionCertificate?.path ??
|
|
125
|
+
`credentials/ios/${filePrefix}dist-cert.p12`,
|
|
127
126
|
};
|
|
128
127
|
}
|
|
129
128
|
// 2. Look for duplicates and prefix them with target names
|
|
@@ -147,20 +146,19 @@ function createTargetCredentialsPathsMap(targets, rawCredentialsJsonMap) {
|
|
|
147
146
|
return deduplicatedPaths;
|
|
148
147
|
}
|
|
149
148
|
async function getTargetBuildCredentialsAsync(ctx, app, target, iosDistributionType) {
|
|
150
|
-
var _a, _b, _c, _d;
|
|
151
149
|
const appCredentials = await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, {
|
|
152
150
|
account: app.account,
|
|
153
151
|
projectName: app.projectName,
|
|
154
152
|
bundleIdentifier: target.bundleIdentifier,
|
|
155
153
|
parentBundleIdentifier: target.parentBundleIdentifier,
|
|
156
154
|
});
|
|
157
|
-
const appBuildCredentials =
|
|
155
|
+
const appBuildCredentials = appCredentials?.iosAppBuildCredentialsList.find(appBuildCredentials => appBuildCredentials.iosDistributionType === iosDistributionType) ?? null;
|
|
158
156
|
if (appBuildCredentials === null) {
|
|
159
157
|
return null;
|
|
160
158
|
}
|
|
161
|
-
if (!(
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
if (!(appBuildCredentials.provisioningProfile?.provisioningProfile !== undefined &&
|
|
160
|
+
appBuildCredentials.distributionCertificate?.certificateP12 !== undefined &&
|
|
161
|
+
appBuildCredentials.distributionCertificate?.certificatePassword !== undefined)) {
|
|
164
162
|
return null;
|
|
165
163
|
}
|
|
166
164
|
return {
|
|
@@ -4,25 +4,27 @@ exports.AndroidPackageNotDefinedError = exports.UnsupportedCredentialsChoiceErro
|
|
|
4
4
|
const log_1 = require("../log");
|
|
5
5
|
class MissingCredentialsNonInteractiveError extends Error {
|
|
6
6
|
constructor(message) {
|
|
7
|
-
super(message
|
|
7
|
+
super(message ?? 'Credentials are not set up. Run this command again in interactive mode.');
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.MissingCredentialsNonInteractiveError = MissingCredentialsNonInteractiveError;
|
|
11
11
|
class InsufficientAuthenticationNonInteractiveError extends Error {
|
|
12
12
|
constructor(message) {
|
|
13
|
-
super(message
|
|
13
|
+
super(message ??
|
|
14
|
+
`Authentication with an ASC API key is required in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/build/building-on-ci/#optional-provide-an-asc-api-token-for-your-apple-team')}`);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
exports.InsufficientAuthenticationNonInteractiveError = InsufficientAuthenticationNonInteractiveError;
|
|
17
18
|
class ForbidCredentialModificationError extends Error {
|
|
18
19
|
constructor(message) {
|
|
19
|
-
super(message
|
|
20
|
+
super(message ??
|
|
21
|
+
'Credentials cannot be modified. Run this command again without the --freeze-credentials flag.');
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
exports.ForbidCredentialModificationError = ForbidCredentialModificationError;
|
|
23
25
|
class MissingCredentialsError extends Error {
|
|
24
26
|
constructor(message) {
|
|
25
|
-
super(message
|
|
27
|
+
super(message ?? 'Credentials are not set up.');
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
exports.MissingCredentialsError = MissingCredentialsError;
|
|
@@ -35,7 +37,7 @@ class UnsupportedCredentialsChoiceError extends Error {
|
|
|
35
37
|
exports.UnsupportedCredentialsChoiceError = UnsupportedCredentialsChoiceError;
|
|
36
38
|
class AndroidPackageNotDefinedError extends Error {
|
|
37
39
|
constructor(message) {
|
|
38
|
-
super(message
|
|
40
|
+
super(message ?? 'android.package needs to be defined in your app.json/app.config.js file');
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
exports.AndroidPackageNotDefinedError = AndroidPackageNotDefinedError;
|
|
@@ -54,7 +54,6 @@ class IosCredentialsProvider {
|
|
|
54
54
|
}).runAsync(this.ctx);
|
|
55
55
|
}
|
|
56
56
|
async getPushKeyAsync(ctx, targets) {
|
|
57
|
-
var _a, _b;
|
|
58
57
|
if (ctx.nonInteractive) {
|
|
59
58
|
return null;
|
|
60
59
|
}
|
|
@@ -71,10 +70,10 @@ class IosCredentialsProvider {
|
|
|
71
70
|
log_1.default.succeed(`Push Notifications setup for ${app.projectName}: ${applicationTarget.bundleIdentifier}`);
|
|
72
71
|
return null;
|
|
73
72
|
}
|
|
74
|
-
if (
|
|
73
|
+
if (ctx.easJsonCliConfig?.promptToConfigurePushNotifications === false) {
|
|
75
74
|
return null;
|
|
76
75
|
}
|
|
77
|
-
else if (
|
|
76
|
+
else if (ctx.easJsonCliConfig?.promptToConfigurePushNotifications === undefined &&
|
|
78
77
|
!(await (0, projectUtils_1.isExpoNotificationsInstalled)(ctx.projectDir))) {
|
|
79
78
|
return null;
|
|
80
79
|
}
|
|
@@ -101,7 +100,7 @@ class IosCredentialsProvider {
|
|
|
101
100
|
await easJsonAccessor.readRawJsonAsync();
|
|
102
101
|
easJsonAccessor.patch(easJsonRawObject => {
|
|
103
102
|
easJsonRawObject.cli = {
|
|
104
|
-
...easJsonRawObject
|
|
103
|
+
...easJsonRawObject?.cli,
|
|
105
104
|
promptToConfigurePushNotifications: false,
|
|
106
105
|
};
|
|
107
106
|
return easJsonRawObject;
|
|
@@ -37,10 +37,9 @@ async function promptForIssuerIdAsync() {
|
|
|
37
37
|
}
|
|
38
38
|
exports.promptForIssuerIdAsync = promptForIssuerIdAsync;
|
|
39
39
|
async function getMinimalAscApiKeyAsync(ascApiKey) {
|
|
40
|
-
var _a;
|
|
41
40
|
return {
|
|
42
41
|
...ascApiKey,
|
|
43
|
-
issuerId:
|
|
42
|
+
issuerId: ascApiKey.issuerId ?? (await promptForIssuerIdAsync()),
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
exports.getMinimalAscApiKeyAsync = getMinimalAscApiKeyAsync;
|
|
@@ -91,7 +90,6 @@ async function promptForAscApiKeyAsync(ctx) {
|
|
|
91
90
|
return { keyP8: await fs_extra_1.default.readFile(keyP8Path, 'utf-8'), keyId, issuerId };
|
|
92
91
|
}
|
|
93
92
|
async function promptForKeyP8AndIdAsync() {
|
|
94
|
-
var _a, _b;
|
|
95
93
|
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 Connect'));
|
|
96
94
|
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')}`);
|
|
97
95
|
const { keyP8Path } = await (0, prompts_1.promptAsync)({
|
|
@@ -114,19 +112,18 @@ async function promptForKeyP8AndIdAsync() {
|
|
|
114
112
|
},
|
|
115
113
|
});
|
|
116
114
|
const regex = /^AuthKey_(?<keyId>\w+)\.p8$/; // Common ASC Api file name downloaded from Apple
|
|
117
|
-
const bestEffortKeyId =
|
|
115
|
+
const bestEffortKeyId = path_1.default.basename(keyP8Path).match(regex)?.groups?.keyId;
|
|
118
116
|
const { keyId } = await (0, promptForCredentials_1.getCredentialsFromUserAsync)(credentials_1.ascApiKeyIdSchema, {
|
|
119
117
|
keyId: bestEffortKeyId,
|
|
120
118
|
});
|
|
121
119
|
return { keyId, keyP8Path };
|
|
122
120
|
}
|
|
123
121
|
async function getBestEffortIssuerIdAsync(ctx, ascApiKeyId) {
|
|
124
|
-
var _a;
|
|
125
122
|
if (!ctx.appStore.authCtx) {
|
|
126
123
|
return null;
|
|
127
124
|
}
|
|
128
125
|
const ascApiKeyInfo = await ctx.appStore.getAscApiKeyAsync(ascApiKeyId);
|
|
129
|
-
return
|
|
126
|
+
return ascApiKeyInfo?.issuerId ?? null;
|
|
130
127
|
}
|
|
131
128
|
async function getAscApiKeysFromAccountAsync(ctx, account, { filterDifferentAppleTeam } = {}) {
|
|
132
129
|
const ascApiKeysForAccount = await ctx.ios.getAscApiKeysForAccountAsync(ctx.graphqlClient, account);
|
|
@@ -139,13 +136,12 @@ async function getAscApiKeysFromAccountAsync(ctx, account, { filterDifferentAppl
|
|
|
139
136
|
}
|
|
140
137
|
exports.getAscApiKeysFromAccountAsync = getAscApiKeysFromAccountAsync;
|
|
141
138
|
async function selectAscApiKeysFromAccountAsync(ctx, account, { filterDifferentAppleTeam } = {}) {
|
|
142
|
-
var _a;
|
|
143
139
|
const ascApiKeysForAccount = await getAscApiKeysFromAccountAsync(ctx, account, {
|
|
144
140
|
filterDifferentAppleTeam,
|
|
145
141
|
});
|
|
146
142
|
if (ascApiKeysForAccount.length === 0) {
|
|
147
143
|
if (filterDifferentAppleTeam) {
|
|
148
|
-
const maybeAppleTeamId =
|
|
144
|
+
const maybeAppleTeamId = ctx.appStore.authCtx?.team.id;
|
|
149
145
|
log_1.default.warn(`There are no App Store Connect API Keys in your EAS account${maybeAppleTeamId ? ` matching Apple Team ID: ${maybeAppleTeamId}.` : '.'}`);
|
|
150
146
|
}
|
|
151
147
|
else {
|
|
@@ -174,7 +170,7 @@ function filterKeysFromDifferentAppleTeam(ctx, keys) {
|
|
|
174
170
|
return keys;
|
|
175
171
|
}
|
|
176
172
|
const teamId = ctx.appStore.authCtx.team.id;
|
|
177
|
-
return keys.filter(key =>
|
|
173
|
+
return keys.filter(key => !key.appleTeam || key.appleTeam?.appleTeamIdentifier === teamId);
|
|
178
174
|
}
|
|
179
175
|
function sortAscApiKeysByUpdatedAtDesc(keys) {
|
|
180
176
|
return keys.sort((keyA, keyB) => new Date(keyB.updatedAt).getTime() - new Date(keyA.updatedAt).getTime());
|
|
@@ -10,9 +10,8 @@ class AssignAscApiKey {
|
|
|
10
10
|
this.app = app;
|
|
11
11
|
}
|
|
12
12
|
async runAsync(ctx, ascApiKey, purpose) {
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const appCredentials = await ctx.ios.createOrGetIosAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app, { appleTeam: appleTeam !== null && appleTeam !== void 0 ? appleTeam : undefined });
|
|
13
|
+
const appleTeam = (await (0, AppleTeamUtils_1.resolveAppleTeamIfAuthenticatedAsync)(ctx, this.app)) ?? ascApiKey.appleTeam ?? null;
|
|
14
|
+
const appCredentials = await ctx.ios.createOrGetIosAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app, { appleTeam: appleTeam ?? undefined });
|
|
16
15
|
let updatedAppCredentials;
|
|
17
16
|
if (purpose === AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE) {
|
|
18
17
|
updatedAppCredentials = await ctx.ios.updateIosAppCredentialsAsync(ctx.graphqlClient, appCredentials, {
|
|
@@ -9,9 +9,8 @@ class AssignPushKey {
|
|
|
9
9
|
this.app = app;
|
|
10
10
|
}
|
|
11
11
|
async runAsync(ctx, pushKey) {
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const appCredentials = await ctx.ios.createOrGetIosAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app, { appleTeam: appleTeam !== null && appleTeam !== void 0 ? appleTeam : undefined });
|
|
12
|
+
const appleTeam = (await (0, AppleTeamUtils_1.resolveAppleTeamIfAuthenticatedAsync)(ctx, this.app)) ?? pushKey.appleTeam ?? null;
|
|
13
|
+
const appCredentials = await ctx.ios.createOrGetIosAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app, { appleTeam: appleTeam ?? undefined });
|
|
15
14
|
const updatedAppCredentials = await ctx.ios.updateIosAppCredentialsAsync(ctx.graphqlClient, appCredentials, {
|
|
16
15
|
applePushKeyId: pushKey.id,
|
|
17
16
|
});
|
|
@@ -25,19 +25,17 @@ async function getBuildCredentialsAsync(ctx, app, iosDistributionType) {
|
|
|
25
25
|
}
|
|
26
26
|
exports.getBuildCredentialsAsync = getBuildCredentialsAsync;
|
|
27
27
|
async function getProvisioningProfileAsync(ctx, app, iosDistributionType) {
|
|
28
|
-
var _a;
|
|
29
28
|
const buildCredentials = await getBuildCredentialsAsync(ctx, app, iosDistributionType);
|
|
30
|
-
return
|
|
29
|
+
return buildCredentials?.provisioningProfile ?? null;
|
|
31
30
|
}
|
|
32
31
|
exports.getProvisioningProfileAsync = getProvisioningProfileAsync;
|
|
33
32
|
async function getDistributionCertificateAsync(ctx, app, iosDistributionType) {
|
|
34
|
-
var _a;
|
|
35
33
|
const buildCredentials = await getBuildCredentialsAsync(ctx, app, iosDistributionType);
|
|
36
|
-
return
|
|
34
|
+
return buildCredentials?.distributionCertificate ?? null;
|
|
37
35
|
}
|
|
38
36
|
exports.getDistributionCertificateAsync = getDistributionCertificateAsync;
|
|
39
37
|
async function assignBuildCredentialsAsync(ctx, app, iosDistributionType, distCert, provisioningProfile, appleTeam) {
|
|
40
|
-
const resolvedAppleTeam = (0, nullthrows_1.default)(appleTeam
|
|
38
|
+
const resolvedAppleTeam = (0, nullthrows_1.default)(appleTeam ?? (await (0, AppleTeamUtils_1.resolveAppleTeamIfAuthenticatedAsync)(ctx, app)));
|
|
41
39
|
const appleAppIdentifier = await ctx.ios.createOrGetExistingAppleAppIdentifierAsync(ctx.graphqlClient, app, resolvedAppleTeam);
|
|
42
40
|
return await ctx.ios.createOrUpdateIosAppBuildCredentialsAsync(ctx.graphqlClient, app, {
|
|
43
41
|
appleTeam: resolvedAppleTeam,
|
|
@@ -50,7 +50,7 @@ class ConfigureProvisioningProfile {
|
|
|
50
50
|
(0, assert_1.default)(certificateP12 && certificatePassword, 'Distribution Certificate P12 and Password is required');
|
|
51
51
|
// configure profile on Apple's Server to use our distCert
|
|
52
52
|
const updatedProfile = await ctx.appStore.useExistingProvisioningProfileAsync(app.bundleIdentifier, profileFromApple, {
|
|
53
|
-
certId: developerPortalIdentifier
|
|
53
|
+
certId: developerPortalIdentifier ?? undefined,
|
|
54
54
|
certP12: certificateP12,
|
|
55
55
|
certPassword: certificatePassword,
|
|
56
56
|
distCertSerialNumber: serialNumber,
|
|
@@ -49,7 +49,6 @@ class CreateProvisioningProfile {
|
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
51
|
async provideOrGenerateAsync(ctx, appleAuthCtx) {
|
|
52
|
-
var _a, _b, _c;
|
|
53
52
|
const maybeUserProvided = await this.maybeGetUserProvidedAsync(ctx);
|
|
54
53
|
if (maybeUserProvided) {
|
|
55
54
|
// userProvided profiles don't come with ProvisioningProfileId's (only accessible from Apple Portal API)
|
|
@@ -59,11 +58,11 @@ class CreateProvisioningProfile {
|
|
|
59
58
|
(0, assert_1.default)(this.distributionCertificate.certificateP12, 'Distribution Certificate must have p12 certificate');
|
|
60
59
|
(0, assert_1.default)(this.distributionCertificate.certificatePassword, 'Distribution Certificate must have certificate password');
|
|
61
60
|
return await (0, ProvisioningProfileUtils_1.generateProvisioningProfileAsync)(ctx, this.target, this.app.bundleIdentifier, {
|
|
62
|
-
certId:
|
|
61
|
+
certId: this.distributionCertificate.developerPortalIdentifier ?? undefined,
|
|
63
62
|
certP12: this.distributionCertificate.certificateP12,
|
|
64
63
|
certPassword: this.distributionCertificate.certificatePassword,
|
|
65
64
|
distCertSerialNumber: this.distributionCertificate.serialNumber,
|
|
66
|
-
teamId:
|
|
65
|
+
teamId: this.distributionCertificate.appleTeam?.appleTeamIdentifier ?? appleAuthCtx.team.id,
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
}
|
|
@@ -33,7 +33,7 @@ function formatDistributionCertificate(distributionCertificate, validSerialNumbe
|
|
|
33
33
|
const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
|
|
34
34
|
line += chalk_1.default.gray(`\n 📲 Used by: ${appFullNames}${andMaybeMore}`);
|
|
35
35
|
}
|
|
36
|
-
if (validSerialNumbers
|
|
36
|
+
if (validSerialNumbers?.includes(serialNumber)) {
|
|
37
37
|
line += chalk_1.default.gray("\n ✅ Currently valid on Apple's servers.");
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
@@ -43,7 +43,7 @@ function formatDistributionCertificate(distributionCertificate, validSerialNumbe
|
|
|
43
43
|
}
|
|
44
44
|
exports.formatDistributionCertificate = formatDistributionCertificate;
|
|
45
45
|
async function selectDistributionCertificateAsync(distCerts, validDistributionCertificates) {
|
|
46
|
-
const validDistCertSerialNumbers = validDistributionCertificates
|
|
46
|
+
const validDistCertSerialNumbers = validDistributionCertificates?.map(distCert => distCert.serialNumber);
|
|
47
47
|
const { chosenDistCert } = await (0, prompts_1.promptAsync)({
|
|
48
48
|
type: 'select',
|
|
49
49
|
name: 'chosenDistCert',
|
|
@@ -77,7 +77,6 @@ exports.selectDistributionCertificateWithDependenciesAsync = selectDistributionC
|
|
|
77
77
|
* select a distribution certificate from a valid set (curated on a best effort basis)
|
|
78
78
|
* */
|
|
79
79
|
async function selectValidDistributionCertificateAsync(ctx, appLookupParams) {
|
|
80
|
-
var _a;
|
|
81
80
|
const distCertsForAccount = await ctx.ios.getDistributionCertificatesForAccountAsync(ctx.graphqlClient, appLookupParams.account);
|
|
82
81
|
if (distCertsForAccount.length === 0) {
|
|
83
82
|
log_1.default.warn(`There are no Distribution Certificates available in your EAS account.`);
|
|
@@ -95,7 +94,7 @@ async function selectValidDistributionCertificateAsync(ctx, appLookupParams) {
|
|
|
95
94
|
// filter by valid certs on the developer portal
|
|
96
95
|
const certInfoFromApple = await ctx.appStore.listDistributionCertificatesAsync();
|
|
97
96
|
const validDistCerts = (0, CredentialsUtils_1.filterRevokedDistributionCertsFromEasServers)(distCertsForAppleTeam, certInfoFromApple);
|
|
98
|
-
log_1.default.log(`${validDistCerts.length}/${distCertsForAccount.length} Distribution Certificates are currently valid for Apple Team ${
|
|
97
|
+
log_1.default.log(`${validDistCerts.length}/${distCertsForAccount.length} Distribution Certificates are currently valid for Apple Team ${ctx.appStore.authCtx?.team.id}.`);
|
|
99
98
|
return selectDistributionCertificateAsync(validDistCerts);
|
|
100
99
|
}
|
|
101
100
|
exports.selectValidDistributionCertificateAsync = selectValidDistributionCertificateAsync;
|
|
@@ -5,10 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const target_1 = require("../../../project/ios/target");
|
|
7
7
|
function formatProvisioningProfileFromApple(appleInfo) {
|
|
8
|
-
var _a;
|
|
9
8
|
const { expires, provisioningProfileId } = appleInfo;
|
|
10
|
-
const id = provisioningProfileId
|
|
11
|
-
const name =
|
|
9
|
+
const id = provisioningProfileId ?? '-----';
|
|
10
|
+
const name = appleInfo.name ?? '-----';
|
|
12
11
|
const expiryString = expires ? new Date(expires * 1000).toDateString() : 'unknown';
|
|
13
12
|
const details = chalk_1.default.green(`\n Name: ${name}\n Expiry: ${expiryString}`);
|
|
14
13
|
return `Provisioning Profile - ID: ${id}${details}`;
|
|
@@ -123,7 +123,7 @@ async function getValidAndTrackedPushKeysOnEasServersAsync(ctx, pushKeysForAccou
|
|
|
123
123
|
}
|
|
124
124
|
exports.getValidAndTrackedPushKeysOnEasServersAsync = getValidAndTrackedPushKeysOnEasServersAsync;
|
|
125
125
|
async function selectPushKeysAsync(pushKeys, validPushKeys) {
|
|
126
|
-
const validPushKeyIdentifiers = validPushKeys
|
|
126
|
+
const validPushKeyIdentifiers = validPushKeys?.map(pushKey => pushKey.keyIdentifier);
|
|
127
127
|
const sortedPushKeys = sortPushKeys(pushKeys, validPushKeys);
|
|
128
128
|
const { chosenPushKey } = await (0, prompts_1.promptAsync)({
|
|
129
129
|
type: 'select',
|
|
@@ -137,12 +137,12 @@ async function selectPushKeysAsync(pushKeys, validPushKeys) {
|
|
|
137
137
|
return chosenPushKey;
|
|
138
138
|
}
|
|
139
139
|
function sortPushKeys(pushKeys, validPushKeys) {
|
|
140
|
-
const validPushKeyIdentifiers = validPushKeys
|
|
140
|
+
const validPushKeyIdentifiers = validPushKeys?.map(pushKey => pushKey.keyIdentifier);
|
|
141
141
|
return pushKeys.sort((pushKeyA, pushKeyB) => {
|
|
142
|
-
if (validPushKeyIdentifiers
|
|
142
|
+
if (validPushKeyIdentifiers?.includes(pushKeyA.keyIdentifier)) {
|
|
143
143
|
return -1;
|
|
144
144
|
}
|
|
145
|
-
else if (validPushKeyIdentifiers
|
|
145
|
+
else if (validPushKeyIdentifiers?.includes(pushKeyB.keyIdentifier)) {
|
|
146
146
|
return 1;
|
|
147
147
|
}
|
|
148
148
|
return 0;
|
|
@@ -165,7 +165,7 @@ function formatPushKey(pushKey, validPushKeyIdentifiers) {
|
|
|
165
165
|
const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
|
|
166
166
|
line += chalk_1.default.gray(`\n 📲 Used by: ${appFullNames}${andMaybeMore}`);
|
|
167
167
|
}
|
|
168
|
-
if (validPushKeyIdentifiers
|
|
168
|
+
if (validPushKeyIdentifiers?.includes(keyIdentifier)) {
|
|
169
169
|
line += chalk_1.default.gray("\n ✅ Currently valid on Apple's servers.");
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
@@ -52,11 +52,10 @@ class SetUpAdhocProvisioningProfile {
|
|
|
52
52
|
return await this.runWithDistributionCertificateAsync(ctx, distCert);
|
|
53
53
|
}
|
|
54
54
|
async runWithDistributionCertificateAsync(ctx, distCert) {
|
|
55
|
-
var _a, _b, _c, _d, _e;
|
|
56
55
|
const { app, target } = this.options;
|
|
57
56
|
const currentBuildCredentials = await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx, app, generated_1.IosDistributionType.AdHoc);
|
|
58
57
|
// 1. Resolve Apple Team
|
|
59
|
-
let appleTeam =
|
|
58
|
+
let appleTeam = distCert.appleTeam ?? currentBuildCredentials?.provisioningProfile?.appleTeam ?? null;
|
|
60
59
|
if (!appleTeam) {
|
|
61
60
|
await ctx.appStore.ensureAuthenticatedAsync();
|
|
62
61
|
appleTeam = await (0, AppleTeamUtils_1.resolveAppleTeamIfAuthenticatedAsync)(ctx, app);
|
|
@@ -77,7 +76,7 @@ class SetUpAdhocProvisioningProfile {
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
// 3. Choose devices for internal distribution
|
|
80
|
-
const provisionedDeviceIdentifiers = (
|
|
79
|
+
const provisionedDeviceIdentifiers = (currentBuildCredentials?.provisioningProfile?.appleDevices ?? []).map(i => i.identifier);
|
|
81
80
|
const chosenDevices = await (0, DeviceUtils_1.chooseDevicesAsync)(registeredAppleDevices, provisionedDeviceIdentifiers);
|
|
82
81
|
// 4. Reuse or create the profile on Apple Developer Portal
|
|
83
82
|
const applePlatform = await (0, target_1.getApplePlatformFromTarget)(target);
|
|
@@ -88,7 +87,7 @@ class SetUpAdhocProvisioningProfile {
|
|
|
88
87
|
// 5. Create or update the profile on servers
|
|
89
88
|
const appleAppIdentifier = await ctx.ios.createOrGetExistingAppleAppIdentifierAsync(ctx.graphqlClient, app, appleTeam);
|
|
90
89
|
let appleProvisioningProfile;
|
|
91
|
-
if (currentBuildCredentials
|
|
90
|
+
if (currentBuildCredentials?.provisioningProfile) {
|
|
92
91
|
appleProvisioningProfile = await this.reuseCurrentProvisioningProfileAsync(currentBuildCredentials.provisioningProfile, provisioningProfileStoreInfo, ctx, app, appleAppIdentifier);
|
|
93
92
|
}
|
|
94
93
|
else {
|
|
@@ -79,7 +79,7 @@ class SetUpAscApiKey {
|
|
|
79
79
|
if (purpose !== AscApiKeyUtils_1.AppStoreApiKeyPurpose.SUBMISSION_SERVICE) {
|
|
80
80
|
throw new Error(`App Store Connect API Key setup is not yet supported for ${purpose}.`);
|
|
81
81
|
}
|
|
82
|
-
return !!
|
|
82
|
+
return !!appCredentials?.appStoreConnectApiKeyForSubmissions;
|
|
83
83
|
}
|
|
84
84
|
async processChoicesAsync(ctx, purpose, choices) {
|
|
85
85
|
(0, assert_1.default)(choices.length > 0, 'SetupAscApiKey: There must be at least one choice');
|
|
@@ -59,13 +59,12 @@ class SetUpBuildCredentials {
|
|
|
59
59
|
exports.SetUpBuildCredentials = SetUpBuildCredentials;
|
|
60
60
|
function toIosCredentials(appBuildCredentialsMap) {
|
|
61
61
|
return Object.entries(appBuildCredentialsMap).reduce((acc, [targetName, appBuildCredentials]) => {
|
|
62
|
-
var _a, _b, _c;
|
|
63
62
|
acc[targetName] = {
|
|
64
63
|
distributionCertificate: {
|
|
65
|
-
certificateP12: (0, nullthrows_1.default)(
|
|
66
|
-
certificatePassword: (0, nullthrows_1.default)(
|
|
64
|
+
certificateP12: (0, nullthrows_1.default)(appBuildCredentials.distributionCertificate?.certificateP12),
|
|
65
|
+
certificatePassword: (0, nullthrows_1.default)(appBuildCredentials.distributionCertificate?.certificatePassword),
|
|
67
66
|
},
|
|
68
|
-
provisioningProfile: (0, nullthrows_1.default)(
|
|
67
|
+
provisioningProfile: (0, nullthrows_1.default)(appBuildCredentials.provisioningProfile?.provisioningProfile),
|
|
69
68
|
};
|
|
70
69
|
return acc;
|
|
71
70
|
}, {});
|
|
@@ -127,9 +127,8 @@ class SetUpDistributionCertificate {
|
|
|
127
127
|
const validDistCertSerialNumberSet = new Set(validDistCertSerialNumbers);
|
|
128
128
|
const distCertsForAccount = await ctx.ios.getDistributionCertificatesForAccountAsync(ctx.graphqlClient, this.app.account);
|
|
129
129
|
const distCertsForAppleTeam = distCertsForAccount.filter(distCert => {
|
|
130
|
-
var _a;
|
|
131
130
|
return (!distCert.appleTeam ||
|
|
132
|
-
distCert.appleTeam.appleTeamIdentifier ===
|
|
131
|
+
distCert.appleTeam.appleTeamIdentifier === ctx.appStore.authCtx?.team.id);
|
|
133
132
|
});
|
|
134
133
|
const validDistCerts = distCertsForAppleTeam.filter(distCert => {
|
|
135
134
|
return validDistCertSerialNumberSet.has(distCert.serialNumber);
|
|
@@ -91,10 +91,9 @@ class SetUpProvisioningProfile {
|
|
|
91
91
|
return updatedProfile;
|
|
92
92
|
}
|
|
93
93
|
getCurrentProfileStoreInfo(profiles, currentProfile) {
|
|
94
|
-
|
|
95
|
-
return ((_a = profiles.find(profile => currentProfile.developerPortalIdentifier
|
|
94
|
+
return (profiles.find(profile => currentProfile.developerPortalIdentifier
|
|
96
95
|
? currentProfile.developerPortalIdentifier === profile.provisioningProfileId
|
|
97
|
-
: currentProfile.provisioningProfile === profile.provisioningProfile)
|
|
96
|
+
: currentProfile.provisioningProfile === profile.provisioningProfile) ?? null);
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
exports.SetUpProvisioningProfile = SetUpProvisioningProfile;
|
|
@@ -59,14 +59,13 @@ class SetUpTargetBuildCredentialsFromCredentialsJson {
|
|
|
59
59
|
return newBuildCredentials;
|
|
60
60
|
}
|
|
61
61
|
async getDistributionCertificateToAssignAsync(ctx, appleTeam, currentDistributionCertificate) {
|
|
62
|
-
var _a, _b;
|
|
63
62
|
const { certificateP12, certificatePassword } = this.targetCredentials.distributionCertificate;
|
|
64
63
|
if (!currentDistributionCertificate) {
|
|
65
64
|
return await ctx.ios.createDistributionCertificateAsync(ctx.graphqlClient, this.app.account, {
|
|
66
65
|
certP12: certificateP12,
|
|
67
66
|
certPassword: certificatePassword,
|
|
68
67
|
teamId: appleTeam.appleTeamIdentifier,
|
|
69
|
-
teamName:
|
|
68
|
+
teamName: appleTeam.appleTeamName ?? undefined,
|
|
70
69
|
});
|
|
71
70
|
}
|
|
72
71
|
const isSameCertificate = currentDistributionCertificate.certificateP12 === certificateP12;
|
|
@@ -75,7 +74,7 @@ class SetUpTargetBuildCredentialsFromCredentialsJson {
|
|
|
75
74
|
certP12: certificateP12,
|
|
76
75
|
certPassword: certificatePassword,
|
|
77
76
|
teamId: appleTeam.appleTeamIdentifier,
|
|
78
|
-
teamName:
|
|
77
|
+
teamName: appleTeam.appleTeamName ?? undefined,
|
|
79
78
|
});
|
|
80
79
|
}
|
|
81
80
|
// If the configured Distribution Certificate is the same as the new one, just use the currently configured certificate
|