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
|
@@ -29,13 +29,12 @@ async function getAppAsync(graphqlClient, appLookupParams) {
|
|
|
29
29
|
return await AppQuery_1.AppQuery.byFullNameAsync(graphqlClient, projectFullName);
|
|
30
30
|
}
|
|
31
31
|
async function createOrUpdateIosAppBuildCredentialsAsync(graphqlClient, appLookupParams, { appleTeam, appleAppIdentifierId, iosDistributionType, appleProvisioningProfileId, appleDistributionCertificateId, }) {
|
|
32
|
-
var _a;
|
|
33
32
|
const iosAppCredentials = await createOrGetExistingIosAppCredentialsWithBuildCredentialsAsync(graphqlClient, appLookupParams, {
|
|
34
33
|
appleTeam,
|
|
35
34
|
appleAppIdentifierId,
|
|
36
35
|
iosDistributionType,
|
|
37
36
|
});
|
|
38
|
-
const iosAppBuildCredentials =
|
|
37
|
+
const iosAppBuildCredentials = iosAppCredentials.iosAppBuildCredentialsList?.[0];
|
|
39
38
|
if (!iosAppBuildCredentials) {
|
|
40
39
|
return await IosAppBuildCredentialsMutation_1.IosAppBuildCredentialsMutation.createIosAppBuildCredentialsAsync(graphqlClient, {
|
|
41
40
|
iosDistributionType,
|
|
@@ -81,9 +80,9 @@ async function createOrGetIosAppCredentialsWithCommonFieldsAsync(graphqlClient,
|
|
|
81
80
|
}
|
|
82
81
|
const [app, appleAppIdentifier] = await Promise.all([
|
|
83
82
|
getAppAsync(graphqlClient, appLookupParams),
|
|
84
|
-
createOrGetExistingAppleAppIdentifierAsync(graphqlClient, appLookupParams, appleTeam
|
|
83
|
+
createOrGetExistingAppleAppIdentifierAsync(graphqlClient, appLookupParams, appleTeam ?? null),
|
|
85
84
|
]);
|
|
86
|
-
return await IosAppCredentialsMutation_1.IosAppCredentialsMutation.createIosAppCredentialsAsync(graphqlClient, { appleTeamId: appleTeam
|
|
85
|
+
return await IosAppCredentialsMutation_1.IosAppCredentialsMutation.createIosAppCredentialsAsync(graphqlClient, { appleTeamId: appleTeam?.id }, app.id, appleAppIdentifier.id);
|
|
87
86
|
}
|
|
88
87
|
exports.createOrGetIosAppCredentialsWithCommonFieldsAsync = createOrGetIosAppCredentialsWithCommonFieldsAsync;
|
|
89
88
|
async function updateIosAppCredentialsAsync(graphqlClient, appCredentials, { applePushKeyId, ascApiKeyIdForSubmissions, }) {
|
|
@@ -108,9 +107,9 @@ async function createOrGetExistingIosAppCredentialsWithBuildCredentialsAsync(gra
|
|
|
108
107
|
else {
|
|
109
108
|
const [app, appleAppIdentifier] = await Promise.all([
|
|
110
109
|
getAppAsync(graphqlClient, appLookupParams),
|
|
111
|
-
createOrGetExistingAppleAppIdentifierAsync(graphqlClient, appLookupParams, appleTeam
|
|
110
|
+
createOrGetExistingAppleAppIdentifierAsync(graphqlClient, appLookupParams, appleTeam ?? null),
|
|
112
111
|
]);
|
|
113
|
-
await IosAppCredentialsMutation_1.IosAppCredentialsMutation.createIosAppCredentialsAsync(graphqlClient, { appleTeamId: appleTeam
|
|
112
|
+
await IosAppCredentialsMutation_1.IosAppCredentialsMutation.createIosAppCredentialsAsync(graphqlClient, { appleTeamId: appleTeam?.id }, app.id, appleAppIdentifier.id);
|
|
114
113
|
const projectFullName = formatProjectFullName(appLookupParams);
|
|
115
114
|
return (0, nullthrows_1.default)(await IosAppCredentialsQuery_1.IosAppCredentialsQuery.withBuildCredentialsByAppIdentifierIdAsync(graphqlClient, projectFullName, {
|
|
116
115
|
appleAppIdentifierId,
|
|
@@ -142,8 +141,8 @@ async function createOrGetExistingAppleAppIdentifierAsync(graphqlClient, { accou
|
|
|
142
141
|
: null;
|
|
143
142
|
return await AppleAppIdentifierMutation_1.AppleAppIdentifierMutation.createAppleAppIdentifierAsync(graphqlClient, {
|
|
144
143
|
bundleIdentifier,
|
|
145
|
-
appleTeamId: appleTeam
|
|
146
|
-
parentAppleAppId: parentAppleAppIdentifier
|
|
144
|
+
appleTeamId: appleTeam?.id,
|
|
145
|
+
parentAppleAppId: parentAppleAppIdentifier?.id,
|
|
147
146
|
}, account.id);
|
|
148
147
|
}
|
|
149
148
|
}
|
|
@@ -223,9 +222,8 @@ async function getPushKeysForAccountAsync(graphqlClient, account) {
|
|
|
223
222
|
}
|
|
224
223
|
exports.getPushKeysForAccountAsync = getPushKeysForAccountAsync;
|
|
225
224
|
async function getPushKeyForAppAsync(graphqlClient, appLookupParams) {
|
|
226
|
-
var _a;
|
|
227
225
|
const maybeIosAppCredentials = await getIosAppCredentialsWithCommonFieldsAsync(graphqlClient, appLookupParams);
|
|
228
|
-
return
|
|
226
|
+
return maybeIosAppCredentials?.pushKey ?? null;
|
|
229
227
|
}
|
|
230
228
|
exports.getPushKeyForAppAsync = getPushKeyForAppAsync;
|
|
231
229
|
async function deletePushKeyAsync(graphqlClient, pushKeyId) {
|
|
@@ -233,7 +231,6 @@ async function deletePushKeyAsync(graphqlClient, pushKeyId) {
|
|
|
233
231
|
}
|
|
234
232
|
exports.deletePushKeyAsync = deletePushKeyAsync;
|
|
235
233
|
async function createAscApiKeyAsync(graphqlClient, account, ascApiKey) {
|
|
236
|
-
var _a, _b, _c;
|
|
237
234
|
const maybeAppleTeam = ascApiKey.teamId
|
|
238
235
|
? await createOrGetExistingAppleTeamAsync(graphqlClient, account, {
|
|
239
236
|
appleTeamIdentifier: ascApiKey.teamId,
|
|
@@ -244,8 +241,8 @@ async function createAscApiKeyAsync(graphqlClient, account, ascApiKey) {
|
|
|
244
241
|
issuerIdentifier: ascApiKey.issuerId,
|
|
245
242
|
keyIdentifier: ascApiKey.keyId,
|
|
246
243
|
keyP8: ascApiKey.keyP8,
|
|
247
|
-
name:
|
|
248
|
-
roles:
|
|
244
|
+
name: ascApiKey.name ?? null,
|
|
245
|
+
roles: ascApiKey.roles?.map(role => convertUserRoleToGraphqlType(role)) ?? null,
|
|
249
246
|
appleTeamId: maybeAppleTeam ? maybeAppleTeam.id : null,
|
|
250
247
|
}, account.id);
|
|
251
248
|
}
|
|
@@ -255,9 +252,8 @@ async function getAscApiKeysForAccountAsync(graphqlClient, account) {
|
|
|
255
252
|
}
|
|
256
253
|
exports.getAscApiKeysForAccountAsync = getAscApiKeysForAccountAsync;
|
|
257
254
|
async function getAscApiKeyForAppSubmissionsAsync(graphqlClient, appLookupParams) {
|
|
258
|
-
var _a;
|
|
259
255
|
const maybeIosAppCredentials = await getIosAppCredentialsWithCommonFieldsAsync(graphqlClient, appLookupParams);
|
|
260
|
-
return
|
|
256
|
+
return maybeIosAppCredentials?.appStoreConnectApiKeyForSubmissions ?? null;
|
|
261
257
|
}
|
|
262
258
|
exports.getAscApiKeyForAppSubmissionsAsync = getAscApiKeyForAppSubmissionsAsync;
|
|
263
259
|
async function deleteAscApiKeyAsync(graphqlClient, ascApiKeyId) {
|
|
@@ -11,7 +11,6 @@ const AppleTeam_1 = require("../../../../../graphql/types/credentials/AppleTeam"
|
|
|
11
11
|
const relay_1 = require("../../../../../utils/relay");
|
|
12
12
|
exports.AppleDistributionCertificateQuery = {
|
|
13
13
|
async getForAppAsync(graphqlClient, projectFullName, { appleAppIdentifierId, iosDistributionType, }) {
|
|
14
|
-
var _a, _b, _c;
|
|
15
14
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
16
15
|
.query((0, graphql_tag_1.default) `
|
|
17
16
|
query AppleDistributionCertificateByAppQuery(
|
|
@@ -56,7 +55,8 @@ exports.AppleDistributionCertificateQuery = {
|
|
|
56
55
|
})
|
|
57
56
|
.toPromise());
|
|
58
57
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
59
|
-
return (
|
|
58
|
+
return (data.app.byFullName.iosAppCredentials[0]?.iosAppBuildCredentialsList[0]
|
|
59
|
+
?.distributionCertificate ?? null);
|
|
60
60
|
},
|
|
61
61
|
async getAllForAccountAsync(graphqlClient, accountName) {
|
|
62
62
|
const paginatedGetterAsync = async (relayArgs) => {
|
|
@@ -12,7 +12,6 @@ const AppleProvisioningProfile_1 = require("../../../../../graphql/types/credent
|
|
|
12
12
|
const AppleTeam_1 = require("../../../../../graphql/types/credentials/AppleTeam");
|
|
13
13
|
exports.AppleProvisioningProfileQuery = {
|
|
14
14
|
async getForAppAsync(graphqlClient, projectFullName, { appleAppIdentifierId, iosDistributionType, }) {
|
|
15
|
-
var _a, _b, _c;
|
|
16
15
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
17
16
|
.query((0, graphql_tag_1.default) `
|
|
18
17
|
query AppleProvisioningProfilesByAppQuery(
|
|
@@ -67,6 +66,7 @@ exports.AppleProvisioningProfileQuery = {
|
|
|
67
66
|
})
|
|
68
67
|
.toPromise());
|
|
69
68
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
70
|
-
return (
|
|
69
|
+
return (data.app.byFullName.iosAppCredentials[0]?.iosAppBuildCredentialsList[0]
|
|
70
|
+
?.provisioningProfile ?? null);
|
|
71
71
|
},
|
|
72
72
|
};
|
|
@@ -8,7 +8,6 @@ const client_1 = require("../../../../../graphql/client");
|
|
|
8
8
|
const AppleTeam_1 = require("../../../../../graphql/types/credentials/AppleTeam");
|
|
9
9
|
exports.AppleTeamQuery = {
|
|
10
10
|
async getAllForAccountAsync(graphqlClient, { accountName, offset, limit }) {
|
|
11
|
-
var _a;
|
|
12
11
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
13
12
|
.query((0, graphql_tag_1.default) `
|
|
14
13
|
query AppleTeamsByAccountName($accountName: String!, $offset: Int, $limit: Int) {
|
|
@@ -27,10 +26,9 @@ exports.AppleTeamQuery = {
|
|
|
27
26
|
additionalTypenames: ['AppleTeam'],
|
|
28
27
|
})
|
|
29
28
|
.toPromise());
|
|
30
|
-
return
|
|
29
|
+
return data.account.byName.appleTeams ?? [];
|
|
31
30
|
},
|
|
32
31
|
async getByAppleTeamIdentifierAsync(graphqlClient, accountId, appleTeamIdentifier) {
|
|
33
|
-
var _a;
|
|
34
32
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
35
33
|
.query((0, graphql_tag_1.default) `
|
|
36
34
|
query AppleTeamByIdentifierQuery($accountId: ID!, $appleTeamIdentifier: String!) {
|
|
@@ -49,6 +47,6 @@ exports.AppleTeamQuery = {
|
|
|
49
47
|
additionalTypenames: ['AppleTeam'],
|
|
50
48
|
})
|
|
51
49
|
.toPromise());
|
|
52
|
-
return
|
|
50
|
+
return data.appleTeam.byAppleTeamIdentifier ?? null;
|
|
53
51
|
},
|
|
54
52
|
};
|
|
@@ -9,7 +9,6 @@ const client_1 = require("../../../../../graphql/client");
|
|
|
9
9
|
const IosAppBuildCredentials_1 = require("../../../../../graphql/types/credentials/IosAppBuildCredentials");
|
|
10
10
|
exports.IosAppBuildCredentialsQuery = {
|
|
11
11
|
async byAppIdentifierIdAndDistributionTypeAsync(graphqlClient, projectFullName, { appleAppIdentifierId, iosDistributionType, }) {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
14
13
|
.query((0, graphql_tag_1.default) `
|
|
15
14
|
query IosAppBuildCredentialsByAppleAppIdentiferAndDistributionQuery(
|
|
@@ -42,6 +41,6 @@ exports.IosAppBuildCredentialsQuery = {
|
|
|
42
41
|
})
|
|
43
42
|
.toPromise());
|
|
44
43
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
45
|
-
return
|
|
44
|
+
return data.app.byFullName.iosAppCredentials[0]?.iosAppBuildCredentialsList[0] ?? null;
|
|
46
45
|
},
|
|
47
46
|
};
|
|
@@ -10,7 +10,6 @@ const IosAppBuildCredentials_1 = require("../../../../../graphql/types/credentia
|
|
|
10
10
|
const IosAppCredentials_1 = require("../../../../../graphql/types/credentials/IosAppCredentials");
|
|
11
11
|
exports.IosAppCredentialsQuery = {
|
|
12
12
|
async withBuildCredentialsByAppIdentifierIdAsync(graphqlClient, projectFullName, { appleAppIdentifierId, iosDistributionType, }) {
|
|
13
|
-
var _a;
|
|
14
13
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
15
14
|
.query((0, graphql_tag_1.default) `
|
|
16
15
|
query IosAppCredentialsWithBuildCredentialsByAppIdentifierIdQuery(
|
|
@@ -45,10 +44,9 @@ exports.IosAppCredentialsQuery = {
|
|
|
45
44
|
})
|
|
46
45
|
.toPromise());
|
|
47
46
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
48
|
-
return
|
|
47
|
+
return data.app.byFullName.iosAppCredentials[0] ?? null;
|
|
49
48
|
},
|
|
50
49
|
async withCommonFieldsByAppIdentifierIdAsync(graphqlClient, projectFullName, { appleAppIdentifierId, }) {
|
|
51
|
-
var _a;
|
|
52
50
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
53
51
|
.query((0, graphql_tag_1.default) `
|
|
54
52
|
query CommonIosAppCredentialsWithBuildCredentialsByAppIdentifierIdQuery(
|
|
@@ -74,6 +72,6 @@ exports.IosAppCredentialsQuery = {
|
|
|
74
72
|
})
|
|
75
73
|
.toPromise());
|
|
76
74
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
77
|
-
return
|
|
75
|
+
return data.app.byFullName.iosAppCredentials[0] ?? null;
|
|
78
76
|
},
|
|
79
77
|
};
|
|
@@ -30,9 +30,8 @@ class AppStoreApi {
|
|
|
30
30
|
return (0, authenticate_1.assertUserAuthCtx)(updatedAuthCtx);
|
|
31
31
|
}
|
|
32
32
|
async ensureAuthenticatedAsync(options) {
|
|
33
|
-
var _a;
|
|
34
33
|
if (!this.authCtx) {
|
|
35
|
-
const mode =
|
|
34
|
+
const mode = options?.mode ?? this.defaultAuthenticationMode;
|
|
36
35
|
this.authCtx = await (0, authenticate_1.authenticateAsync)({ mode, ...options });
|
|
37
36
|
}
|
|
38
37
|
return this.authCtx;
|
|
@@ -31,7 +31,6 @@ exports.listAscApiKeysAsync = listAscApiKeysAsync;
|
|
|
31
31
|
* **Does not support App Store Connect API (CI).**
|
|
32
32
|
*/
|
|
33
33
|
async function getAscApiKeyAsync(userAuthCtx, keyId) {
|
|
34
|
-
var _a;
|
|
35
34
|
const spinner = (0, ora_1.ora)(`Fetching App Store Connect API Key.`).start();
|
|
36
35
|
try {
|
|
37
36
|
const context = (0, authenticate_1.getRequestContext)(userAuthCtx);
|
|
@@ -40,7 +39,7 @@ async function getAscApiKeyAsync(userAuthCtx, keyId) {
|
|
|
40
39
|
return getAscApiKeyInfo(apiKey, userAuthCtx);
|
|
41
40
|
}
|
|
42
41
|
catch (error) {
|
|
43
|
-
const message =
|
|
42
|
+
const message = error?.message ?? '';
|
|
44
43
|
if (message.includes("There is no resource of type 'apiKeys' with id")) {
|
|
45
44
|
spinner.stop();
|
|
46
45
|
return null;
|
|
@@ -108,10 +107,10 @@ async function createAscApiKeyAsync(analytics, userAuthCtx, { nickname, allAppsV
|
|
|
108
107
|
try {
|
|
109
108
|
const context = (0, authenticate_1.getRequestContext)(userAuthCtx);
|
|
110
109
|
const key = await apple_utils_1.ApiKey.createAsync(context, {
|
|
111
|
-
nickname: nickname
|
|
112
|
-
allAppsVisible: allAppsVisible
|
|
113
|
-
roles: roles
|
|
114
|
-
keyType: keyType
|
|
110
|
+
nickname: nickname ?? `[expo] ${new Date().getTime()}`,
|
|
111
|
+
allAppsVisible: allAppsVisible ?? true,
|
|
112
|
+
roles: roles ?? [apple_utils_1.UserRole.ADMIN],
|
|
113
|
+
keyType: keyType ?? apple_utils_1.ApiKeyType.PUBLIC_API,
|
|
115
114
|
});
|
|
116
115
|
const keyP8 = await downloadWithRetryAsync(analytics, key);
|
|
117
116
|
if (!keyP8) {
|
|
@@ -161,11 +160,10 @@ async function revokeAscApiKeyAsync(userAuthCtx, keyId) {
|
|
|
161
160
|
}
|
|
162
161
|
exports.revokeAscApiKeyAsync = revokeAscApiKeyAsync;
|
|
163
162
|
function getAscApiKeyInfo(apiKey, authCtx) {
|
|
164
|
-
var _a;
|
|
165
163
|
return {
|
|
166
164
|
name: apiKey.attributes.nickname,
|
|
167
165
|
keyId: apiKey.id,
|
|
168
|
-
issuerId:
|
|
166
|
+
issuerId: apiKey.attributes.provider?.id,
|
|
169
167
|
teamId: authCtx.team.id,
|
|
170
168
|
teamName: authCtx.team.name,
|
|
171
169
|
roles: apiKey.attributes.roles,
|
|
@@ -23,8 +23,7 @@ function assertUserAuthCtx(authCtx) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.assertUserAuthCtx = assertUserAuthCtx;
|
|
25
25
|
function getRequestContext(authCtx) {
|
|
26
|
-
|
|
27
|
-
(0, assert_1.default)((_a = authCtx.authState) === null || _a === void 0 ? void 0 : _a.context, 'Apple request context must be defined');
|
|
26
|
+
(0, assert_1.default)(authCtx.authState?.context, 'Apple request context must be defined');
|
|
28
27
|
return authCtx.authState.context;
|
|
29
28
|
}
|
|
30
29
|
exports.getRequestContext = getRequestContext;
|
|
@@ -124,13 +123,12 @@ async function authenticateWithApiKeyAsync(options = {}) {
|
|
|
124
123
|
};
|
|
125
124
|
}
|
|
126
125
|
async function authenticateAsUserAsync(options = {}) {
|
|
127
|
-
var _a;
|
|
128
126
|
// help keep apple login visually apart from the other operations.
|
|
129
127
|
log_1.default.addNewLineIfNone();
|
|
130
128
|
try {
|
|
131
129
|
const authState = await loginAsync({
|
|
132
130
|
cookies: options.cookies,
|
|
133
|
-
teamId:
|
|
131
|
+
teamId: options.teamId ?? process.env.EXPO_APPLE_TEAM_ID,
|
|
134
132
|
providerId: process.env.EXPO_APPLE_PROVIDER_ID
|
|
135
133
|
? (0, getenv_1.int)(process.env.EXPO_APPLE_PROVIDER_ID)
|
|
136
134
|
: undefined,
|
|
@@ -88,7 +88,7 @@ function getCapabilitiesToEnable(currentCapabilities, entitlements) {
|
|
|
88
88
|
// Only skip if the existing capability is a simple boolean value,
|
|
89
89
|
// if it has more complex settings then we should always update it.
|
|
90
90
|
// If the `existing.attributes.settings` object is defined, then we can determine that it has extra configuration.
|
|
91
|
-
if (existing &&
|
|
91
|
+
if (existing && existing?.attributes.settings == null) {
|
|
92
92
|
// Remove the item from the list of capabilities so we don't disable it.
|
|
93
93
|
remainingCapabilities.splice(existingIndex, 1);
|
|
94
94
|
if (log_1.default.isDebug) {
|
|
@@ -10,10 +10,9 @@ const convertHTMLToASCII_1 = require("../utils/convertHTMLToASCII");
|
|
|
10
10
|
* **Does not support App Store Connect API (CI).**
|
|
11
11
|
*/
|
|
12
12
|
async function getContractStatusAsync(context) {
|
|
13
|
-
var _a;
|
|
14
13
|
try {
|
|
15
14
|
const capabilities = await apple_utils_1.ITCAgreements.getCapabilitiesAsync(context);
|
|
16
|
-
return
|
|
15
|
+
return capabilities?.contractStatus ?? null;
|
|
17
16
|
}
|
|
18
17
|
catch (error) {
|
|
19
18
|
log_1.default.warn(`Failed to get iTunes contract status: ${error.message}`);
|
|
@@ -36,7 +35,6 @@ async function getContractMessagesAsync(context) {
|
|
|
36
35
|
* **Does not support App Store Connect API (CI).**
|
|
37
36
|
*/
|
|
38
37
|
async function getRequiredContractMessagesAsync(context) {
|
|
39
|
-
var _a, _b;
|
|
40
38
|
// This emulates the check that's performed on the ASC website's "apps"
|
|
41
39
|
// page before presenting the (+) create app button.
|
|
42
40
|
const status = await getContractStatusAsync(context);
|
|
@@ -50,7 +48,7 @@ async function getRequiredContractMessagesAsync(context) {
|
|
|
50
48
|
// The user cannot create an app until they've reviewed, and agreed to the updated agreements
|
|
51
49
|
// or renewed their membership on ASC.
|
|
52
50
|
// Get the exact messages from ASC to show the user a useful message.
|
|
53
|
-
return { messages: (
|
|
51
|
+
return { messages: (await getContractMessagesAsync(context)) ?? [], isFatal: true };
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
// The contract messages aren't documented so if a new one is present we cannot be sure if it's fatal or not.
|
|
@@ -61,7 +59,7 @@ async function getRequiredContractMessagesAsync(context) {
|
|
|
61
59
|
// TODO: Maybe a silent analytic would be better
|
|
62
60
|
log_1.default.error(`\nUnexpected Apple developer contract status "${status}". Open an issue on https://github.com/expo/eas-cli`);
|
|
63
61
|
log_1.default.newLine();
|
|
64
|
-
return { messages: (
|
|
62
|
+
return { messages: (await getContractMessagesAsync(context)) ?? [], isFatal: false };
|
|
65
63
|
}
|
|
66
64
|
const rootUrl = 'https://appstoreconnect.apple.com';
|
|
67
65
|
function formatContractMessage(message) {
|
|
@@ -16,7 +16,6 @@ async function getCertificateBySerialNumberAsync(context, serialNumber) {
|
|
|
16
16
|
}
|
|
17
17
|
exports.getCertificateBySerialNumberAsync = getCertificateBySerialNumberAsync;
|
|
18
18
|
async function getDistributionCertificateAsync(context, serialNumber) {
|
|
19
|
-
var _a;
|
|
20
19
|
// At most, this returns 2 values.
|
|
21
20
|
const certificates = await apple_utils_1.Certificate.getAsync(context, {
|
|
22
21
|
query: {
|
|
@@ -25,7 +24,7 @@ async function getDistributionCertificateAsync(context, serialNumber) {
|
|
|
25
24
|
},
|
|
26
25
|
},
|
|
27
26
|
});
|
|
28
|
-
return (
|
|
27
|
+
return (certificates.find(certificate => certificate.attributes.serialNumber === serialNumber) ?? null);
|
|
29
28
|
}
|
|
30
29
|
exports.getDistributionCertificateAsync = getDistributionCertificateAsync;
|
|
31
30
|
function transformCertificate(cert) {
|
|
@@ -97,7 +96,7 @@ async function createDistributionCertificateAsync(authCtx) {
|
|
|
97
96
|
}
|
|
98
97
|
exports.createDistributionCertificateAsync = createDistributionCertificateAsync;
|
|
99
98
|
async function revokeDistributionCertificateAsync(authCtx, ids) {
|
|
100
|
-
const name = `Apple distribution certificate${
|
|
99
|
+
const name = `Apple distribution certificate${ids?.length === 1 ? '' : 's'}`;
|
|
101
100
|
const spinner = (0, ora_1.ora)(`Revoking ${name}`).start();
|
|
102
101
|
try {
|
|
103
102
|
const context = (0, authenticate_1.getRequestContext)(authCtx);
|
|
@@ -101,7 +101,6 @@ async function syncCapabilityIdentifiersAsync(bundleId, { entitlements }) {
|
|
|
101
101
|
}
|
|
102
102
|
exports.syncCapabilityIdentifiersAsync = syncCapabilityIdentifiersAsync;
|
|
103
103
|
async function ensureAppExistsAsync(userAuthCtx, { name, language, companyName, bundleIdentifier, sku, }) {
|
|
104
|
-
var _a;
|
|
105
104
|
const context = (0, authenticate_1.getRequestContext)(userAuthCtx);
|
|
106
105
|
const spinner = (0, ora_1.ora)(`Linking to App Store Connect ${chalk_1.default.dim(bundleIdentifier)}`).start();
|
|
107
106
|
let app = await apple_utils_1.App.findAsync(context, { bundleId: bundleIdentifier });
|
|
@@ -123,7 +122,7 @@ async function ensureAppExistsAsync(userAuthCtx, { name, language, companyName,
|
|
|
123
122
|
}
|
|
124
123
|
catch (error) {
|
|
125
124
|
if (error.message.match(/An App ID with Identifier '(.*)' is not available/)) {
|
|
126
|
-
throw new Error(`\nThe bundle identifier "${bundleIdentifier}" is not available to provider "${
|
|
125
|
+
throw new Error(`\nThe bundle identifier "${bundleIdentifier}" is not available to provider "${userAuthCtx.authState?.session.provider.name}. Change it in your app config and try again.\n`);
|
|
127
126
|
}
|
|
128
127
|
spinner.fail(`Failed to create App Store app ${chalk_1.default.dim(name)}`);
|
|
129
128
|
error.message +=
|
|
@@ -74,13 +74,11 @@ function sortByExpiration(a, b) {
|
|
|
74
74
|
new Date(b.attributes.expirationDate).getTime());
|
|
75
75
|
}
|
|
76
76
|
async function findProfileByIdAsync(context, profileId, bundleId) {
|
|
77
|
-
var _a;
|
|
78
77
|
let profiles = await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleId);
|
|
79
78
|
profiles = profiles.filter(profile => profile.attributes.profileType === apple_utils_1.ProfileType.IOS_APP_ADHOC);
|
|
80
|
-
return
|
|
79
|
+
return profiles.find(profile => profile.id === profileId) ?? null;
|
|
81
80
|
}
|
|
82
81
|
async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNumber, profileId, profileType, }) {
|
|
83
|
-
var _a, _b, _c, _d, _e;
|
|
84
82
|
// We register all missing devices on the Apple Developer Portal. They are identified by UDIDs.
|
|
85
83
|
const devices = await registerMissingDevicesAsync(context, udids);
|
|
86
84
|
let existingProfile;
|
|
@@ -100,16 +98,16 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
|
|
|
100
98
|
}
|
|
101
99
|
if (existingProfile) {
|
|
102
100
|
// We need to verify whether the existing profile includes all user's devices.
|
|
103
|
-
let deviceUdidsInProfile =
|
|
101
|
+
let deviceUdidsInProfile = existingProfile?.attributes?.devices?.map?.(i => i.attributes.udid) ?? [];
|
|
104
102
|
deviceUdidsInProfile = uniqueItems(deviceUdidsInProfile.filter(Boolean));
|
|
105
103
|
const allDeviceUdids = uniqueItems(udids);
|
|
106
104
|
const hasEqualUdids = deviceUdidsInProfile.length === allDeviceUdids.length &&
|
|
107
105
|
deviceUdidsInProfile.every(udid => allDeviceUdids.includes(udid));
|
|
108
106
|
if (hasEqualUdids && existingProfile.isValid()) {
|
|
109
107
|
const result = {
|
|
110
|
-
profileName:
|
|
111
|
-
provisioningProfileId: existingProfile
|
|
112
|
-
provisioningProfile: existingProfile
|
|
108
|
+
profileName: existingProfile?.attributes?.name,
|
|
109
|
+
provisioningProfileId: existingProfile?.id,
|
|
110
|
+
provisioningProfile: existingProfile?.attributes.profileContent,
|
|
113
111
|
};
|
|
114
112
|
if (didUpdate) {
|
|
115
113
|
result.didUpdate = true;
|
|
@@ -37,7 +37,6 @@ exports.listPushKeysAsync = listPushKeysAsync;
|
|
|
37
37
|
* **Does not support App Store Connect API (CI).**
|
|
38
38
|
*/
|
|
39
39
|
async function createPushKeyAsync(userAuthCtx, name = `Expo Push Notifications Key ${(0, dateformat_1.default)('yyyymmddHHMMss')}`) {
|
|
40
|
-
var _a;
|
|
41
40
|
const spinner = (0, ora_1.ora)(`Creating Apple push key`).start();
|
|
42
41
|
try {
|
|
43
42
|
const context = (0, authenticate_1.getRequestContext)(userAuthCtx);
|
|
@@ -53,7 +52,7 @@ async function createPushKeyAsync(userAuthCtx, name = `Expo Push Notifications K
|
|
|
53
52
|
}
|
|
54
53
|
catch (err) {
|
|
55
54
|
spinner.fail('Failed to create Apple push key');
|
|
56
|
-
const resultString =
|
|
55
|
+
const resultString = err.rawDump?.resultString;
|
|
57
56
|
if (err instanceof MaxKeysCreatedError ||
|
|
58
57
|
(resultString && resultString.match(/maximum allowed number of Keys/))) {
|
|
59
58
|
throw new Error(exports.APPLE_KEYS_TOO_MANY_GENERATED_ERROR);
|
|
@@ -67,7 +66,7 @@ exports.createPushKeyAsync = createPushKeyAsync;
|
|
|
67
66
|
* **Does not support App Store Connect API (CI).**
|
|
68
67
|
*/
|
|
69
68
|
async function revokePushKeyAsync(userAuthCtx, ids) {
|
|
70
|
-
const name = `Apple push key${
|
|
69
|
+
const name = `Apple push key${ids?.length === 1 ? '' : 's'}`;
|
|
71
70
|
const spinner = (0, ora_1.ora)(`Revoking ${name}`).start();
|
|
72
71
|
try {
|
|
73
72
|
const context = (0, authenticate_1.getRequestContext)(userAuthCtx);
|
|
@@ -42,8 +42,8 @@ async function resolveAscApiKeyAsync(ascApiKey) {
|
|
|
42
42
|
}
|
|
43
43
|
exports.resolveAscApiKeyAsync = resolveAscApiKeyAsync;
|
|
44
44
|
async function getAscKeyP8FromEnvironmentOrOptionsAsync(ascApiKey) {
|
|
45
|
-
if (ascApiKey
|
|
46
|
-
return ascApiKey
|
|
45
|
+
if (ascApiKey?.keyP8) {
|
|
46
|
+
return ascApiKey?.keyP8;
|
|
47
47
|
}
|
|
48
48
|
else if (process.env.EXPO_ASC_API_KEY_PATH) {
|
|
49
49
|
return await fs.readFile(process.env.EXPO_ASC_API_KEY_PATH, 'utf-8');
|
|
@@ -57,8 +57,8 @@ async function getAscKeyP8FromEnvironmentOrOptionsAsync(ascApiKey) {
|
|
|
57
57
|
return await fs.readFile(ascApiKeyPath, 'utf-8');
|
|
58
58
|
}
|
|
59
59
|
async function getAscKeyIdFromEnvironmentOrOptionsAsync(ascApiKey) {
|
|
60
|
-
if (ascApiKey
|
|
61
|
-
return ascApiKey
|
|
60
|
+
if (ascApiKey?.keyId) {
|
|
61
|
+
return ascApiKey?.keyId;
|
|
62
62
|
}
|
|
63
63
|
else if (process.env.EXPO_ASC_KEY_ID) {
|
|
64
64
|
return process.env.EXPO_ASC_KEY_ID;
|
|
@@ -72,8 +72,8 @@ async function getAscKeyIdFromEnvironmentOrOptionsAsync(ascApiKey) {
|
|
|
72
72
|
return ascApiKeyId;
|
|
73
73
|
}
|
|
74
74
|
async function getAscIssuerIdFromEnvironmentOrOptionsAsync(ascApiKey) {
|
|
75
|
-
if (ascApiKey
|
|
76
|
-
return ascApiKey
|
|
75
|
+
if (ascApiKey?.issuerId) {
|
|
76
|
+
return ascApiKey?.issuerId;
|
|
77
77
|
}
|
|
78
78
|
else if (process.env.EXPO_ASC_ISSUER_ID) {
|
|
79
79
|
return process.env.EXPO_ASC_ISSUER_ID;
|
|
@@ -167,7 +167,7 @@ async function promptUsernameAsync() {
|
|
|
167
167
|
name: 'username',
|
|
168
168
|
message: `Apple ID:`,
|
|
169
169
|
validate: (val) => val !== '',
|
|
170
|
-
initial: lastAppleId
|
|
170
|
+
initial: lastAppleId ?? undefined,
|
|
171
171
|
});
|
|
172
172
|
if (username && username !== lastAppleId) {
|
|
173
173
|
await cacheUsernameAsync(username);
|
|
@@ -204,14 +204,13 @@ async function promptPasswordAsync({ username, }) {
|
|
|
204
204
|
}
|
|
205
205
|
exports.promptPasswordAsync = promptPasswordAsync;
|
|
206
206
|
async function getCachedUsernameAsync() {
|
|
207
|
-
var _a;
|
|
208
207
|
if (Keychain.EXPO_NO_KEYCHAIN) {
|
|
209
208
|
// Clear last used apple ID.
|
|
210
209
|
await fs.remove(apple_utils_1.JsonFileCache.usernameCachePath());
|
|
211
210
|
return null;
|
|
212
211
|
}
|
|
213
212
|
const cached = await apple_utils_1.JsonFileCache.getCacheAsync(apple_utils_1.JsonFileCache.usernameCachePath());
|
|
214
|
-
const lastAppleId =
|
|
213
|
+
const lastAppleId = cached?.username ?? null;
|
|
215
214
|
return typeof lastAppleId === 'string' ? lastAppleId : null;
|
|
216
215
|
}
|
|
217
216
|
/**
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AppleTeamMissingError = void 0;
|
|
4
4
|
class AppleTeamMissingError extends Error {
|
|
5
5
|
constructor(message) {
|
|
6
|
-
super(message
|
|
6
|
+
super(message ?? 'Apple Team is necessary to create Apple App Identifier');
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
exports.AppleTeamMissingError = AppleTeamMissingError;
|
|
@@ -24,7 +24,6 @@ function getCertData(p12Buffer, passwordRaw) {
|
|
|
24
24
|
}
|
|
25
25
|
exports.getCertData = getCertData;
|
|
26
26
|
function getRawCertData(p12Buffer, passwordRaw) {
|
|
27
|
-
var _a, _b, _c;
|
|
28
27
|
if (Buffer.isBuffer(p12Buffer)) {
|
|
29
28
|
p12Buffer = p12Buffer.toString('base64');
|
|
30
29
|
}
|
|
@@ -53,7 +52,7 @@ function getRawCertData(p12Buffer, passwordRaw) {
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
const certBagType = node_forge_1.default.pki.oids.certBag;
|
|
56
|
-
const certData =
|
|
55
|
+
const certData = p12.getBags({ bagType: certBagType })?.[certBagType]?.[0]?.cert;
|
|
57
56
|
if (!certData) {
|
|
58
57
|
throw new Error("getRawCertData: couldn't find cert bag");
|
|
59
58
|
}
|
|
@@ -4,9 +4,8 @@ exports.parse = exports.isEnterpriseUniversalProfile = exports.isAdHocProfile =
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const plist_1 = tslib_1.__importDefault(require("@expo/plist"));
|
|
6
6
|
function readAppleTeam(dataBase64) {
|
|
7
|
-
var _a;
|
|
8
7
|
const profilePlist = parse(dataBase64);
|
|
9
|
-
const teamId =
|
|
8
|
+
const teamId = profilePlist['TeamIdentifier']?.[0];
|
|
10
9
|
const teamName = profilePlist['TeamName'];
|
|
11
10
|
if (!teamId) {
|
|
12
11
|
throw new Error('Team identifier is missing from provisioning profile');
|
|
@@ -31,10 +31,10 @@ async function validateProvisioningProfileAsync(ctx, target, app, buildCredentia
|
|
|
31
31
|
exports.validateProvisioningProfileAsync = validateProvisioningProfileAsync;
|
|
32
32
|
function validateProvisioningProfileWithoutApple(app, { provisioningProfile, distributionCertificate }) {
|
|
33
33
|
try {
|
|
34
|
-
const profilePlist = (0, provisioningProfile_2.parse)((0, nullthrows_1.default)(provisioningProfile
|
|
34
|
+
const profilePlist = (0, provisioningProfile_2.parse)((0, nullthrows_1.default)(provisioningProfile?.provisioningProfile));
|
|
35
35
|
let distCertFingerprint;
|
|
36
36
|
try {
|
|
37
|
-
distCertFingerprint = (0, p12Certificate_1.getP12CertFingerprint)((0, nullthrows_1.default)(distributionCertificate
|
|
37
|
+
distCertFingerprint = (0, p12Certificate_1.getP12CertFingerprint)((0, nullthrows_1.default)(distributionCertificate?.certificateP12), (0, nullthrows_1.default)(distributionCertificate?.certificatePassword));
|
|
38
38
|
}
|
|
39
39
|
catch (e) {
|
|
40
40
|
log_1.default.warn(`Failed to calculate fingerprint for Distribution Certificate: ${e.toString()}`);
|
|
@@ -81,8 +81,7 @@ async function validateProvisioningProfileWithAppleAsync(ctx, target, app, build
|
|
|
81
81
|
return true;
|
|
82
82
|
}
|
|
83
83
|
function validateDeveloperCertificate(plistData, distCertFingerprint) {
|
|
84
|
-
|
|
85
|
-
const devCertBase64 = (_a = plistData === null || plistData === void 0 ? void 0 : plistData.DeveloperCertificates) === null || _a === void 0 ? void 0 : _a[0];
|
|
84
|
+
const devCertBase64 = plistData?.DeveloperCertificates?.[0];
|
|
86
85
|
if (!devCertBase64) {
|
|
87
86
|
log_1.default.warn('Missing certificate fingerprint in provisioning profile.');
|
|
88
87
|
return false;
|
|
@@ -100,13 +99,12 @@ function validateDeveloperCertificate(plistData, distCertFingerprint) {
|
|
|
100
99
|
return true;
|
|
101
100
|
}
|
|
102
101
|
function validateBundleIdentifier(plistData, expectedBundleIdentifier) {
|
|
103
|
-
|
|
104
|
-
const actualApplicationIdentifier = (_a = plistData.Entitlements) === null || _a === void 0 ? void 0 : _a['application-identifier'];
|
|
102
|
+
const actualApplicationIdentifier = plistData.Entitlements?.['application-identifier'];
|
|
105
103
|
if (!actualApplicationIdentifier) {
|
|
106
104
|
log_1.default.warn('Missing application-identifier in provisioning profile entitlements');
|
|
107
105
|
return false;
|
|
108
106
|
}
|
|
109
|
-
const actualBundleIdentifier =
|
|
107
|
+
const actualBundleIdentifier = /\.(.+)/.exec(actualApplicationIdentifier)?.[1];
|
|
110
108
|
if (!actualBundleIdentifier) {
|
|
111
109
|
log_1.default.warn('Malformed application-identifier field in provisioning profile');
|
|
112
110
|
return false;
|
|
@@ -46,7 +46,7 @@ class ManageAndroid {
|
|
|
46
46
|
let projectInfo = null;
|
|
47
47
|
if (hasProjectContext) {
|
|
48
48
|
const { exp, projectId } = await this.callingAction.getDynamicPrivateProjectConfigAsync({
|
|
49
|
-
env: buildProfile
|
|
49
|
+
env: buildProfile?.env,
|
|
50
50
|
});
|
|
51
51
|
projectInfo = { exp, projectId };
|
|
52
52
|
}
|
|
@@ -56,7 +56,7 @@ class ManageAndroid {
|
|
|
56
56
|
user: this.callingAction.actor,
|
|
57
57
|
graphqlClient: this.callingAction.graphqlClient,
|
|
58
58
|
analytics: this.callingAction.analytics,
|
|
59
|
-
env: buildProfile
|
|
59
|
+
env: buildProfile?.env,
|
|
60
60
|
nonInteractive: false,
|
|
61
61
|
vcsClient: this.callingAction.vcsClient,
|
|
62
62
|
});
|
|
@@ -51,7 +51,7 @@ class ManageIos {
|
|
|
51
51
|
let projectInfo = null;
|
|
52
52
|
if (this.callingAction.projectInfo) {
|
|
53
53
|
const { exp, projectId } = await this.callingAction.getDynamicPrivateProjectConfigAsync({
|
|
54
|
-
env: buildProfile
|
|
54
|
+
env: buildProfile?.env,
|
|
55
55
|
});
|
|
56
56
|
projectInfo = { exp, projectId };
|
|
57
57
|
}
|
|
@@ -61,7 +61,7 @@ class ManageIos {
|
|
|
61
61
|
user: this.callingAction.actor,
|
|
62
62
|
graphqlClient: this.callingAction.graphqlClient,
|
|
63
63
|
analytics: this.callingAction.analytics,
|
|
64
|
-
env: buildProfile
|
|
64
|
+
env: buildProfile?.env,
|
|
65
65
|
nonInteractive: false,
|
|
66
66
|
vcsClient: this.callingAction.vcsClient,
|
|
67
67
|
});
|
|
@@ -196,7 +196,6 @@ class ManageIos {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
async runProjectSpecificActionAsync(ctx, app, targets, buildProfile, action) {
|
|
199
|
-
var _a;
|
|
200
199
|
if (action === Actions_1.IosActionType.SetUpBuildCredentials) {
|
|
201
200
|
await new SetUpBuildCredentials_1.SetUpBuildCredentials({
|
|
202
201
|
app,
|
|
@@ -238,7 +237,7 @@ class ManageIos {
|
|
|
238
237
|
}
|
|
239
238
|
case Actions_1.IosActionType.RemoveProvisioningProfile: {
|
|
240
239
|
const iosAppCredentials = await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, appLookupParams);
|
|
241
|
-
const provisioningProfile =
|
|
240
|
+
const provisioningProfile = iosAppCredentials?.iosAppBuildCredentialsList.find(buildCredentials => buildCredentials.iosDistributionType === distributionType)?.provisioningProfile;
|
|
242
241
|
if (!provisioningProfile) {
|
|
243
242
|
log_1.default.log(`No provisioning profile associated with the ${distributionType} configuration of ${appLookupParams.projectName}`);
|
|
244
243
|
return;
|