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
|
@@ -11,13 +11,14 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
11
11
|
const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
|
|
12
12
|
const prompts_1 = require("../../prompts");
|
|
13
13
|
async function ensureAppStoreConnectAppExistsAsync(ctx) {
|
|
14
|
-
var _a, _b, _c;
|
|
15
14
|
const { exp } = ctx;
|
|
16
15
|
const { appName, language } = ctx.profile;
|
|
17
16
|
const options = {
|
|
18
17
|
...ctx.profile,
|
|
19
|
-
bundleIdentifier:
|
|
20
|
-
|
|
18
|
+
bundleIdentifier: ctx.applicationIdentifierOverride ??
|
|
19
|
+
ctx.profile.bundleIdentifier ??
|
|
20
|
+
(await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, exp, ctx.vcsClient)),
|
|
21
|
+
appName: appName ?? exp.name ?? (await promptForAppNameAsync()),
|
|
21
22
|
language: (0, language_1.sanitizeLanguage)(language),
|
|
22
23
|
};
|
|
23
24
|
return await createAppStoreConnectAppAsync(ctx, options);
|
|
@@ -26,7 +27,7 @@ exports.ensureAppStoreConnectAppExistsAsync = ensureAppStoreConnectAppExistsAsyn
|
|
|
26
27
|
async function isProvisioningAvailableAsync(requestCtx) {
|
|
27
28
|
const session = apple_utils_1.Session.getAnySessionInfo();
|
|
28
29
|
// TODO: Investigate if username and email can be different
|
|
29
|
-
const username = session
|
|
30
|
+
const username = session?.user.emailAddress;
|
|
30
31
|
const [user] = await apple_utils_1.User.getAsync(requestCtx, { query: { filter: { username } } });
|
|
31
32
|
return user.attributes.provisioningAllowed;
|
|
32
33
|
}
|
|
@@ -19,7 +19,7 @@ async function getAppSpecificPasswordLocallyAsync(ctx, source) {
|
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
21
|
// exhaustive -- should never happen
|
|
22
|
-
throw new Error(`Unknown app specific password source type "${source
|
|
22
|
+
throw new Error(`Unknown app specific password source type "${source?.sourceType}"`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
exports.getAppSpecificPasswordLocallyAsync = getAppSpecificPasswordLocallyAsync;
|
|
@@ -50,7 +50,7 @@ async function getAppleIdUsernameAsync(ctx) {
|
|
|
50
50
|
name: 'appleId',
|
|
51
51
|
message: `Enter your Apple ID:`,
|
|
52
52
|
validate: (val) => !!val,
|
|
53
|
-
initial: lastAppleId
|
|
53
|
+
initial: lastAppleId ?? undefined,
|
|
54
54
|
});
|
|
55
55
|
return appleId;
|
|
56
56
|
}
|
|
@@ -47,8 +47,10 @@ async function promptForBundleIdentifierAsync() {
|
|
|
47
47
|
return bundleIdentifier;
|
|
48
48
|
}
|
|
49
49
|
async function getAscApiKeyFromCredentialsServiceAsync(ctx) {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const bundleIdentifier = ctx.applicationIdentifierOverride ??
|
|
51
|
+
ctx.profile.bundleIdentifier ??
|
|
52
|
+
(await maybeGetIosBundleIdentifierAsync(ctx)) ??
|
|
53
|
+
(await promptForBundleIdentifierAsync());
|
|
52
54
|
log_1.default.log(`Looking up credentials configuration for ${bundleIdentifier}...`);
|
|
53
55
|
const appLookupParams = {
|
|
54
56
|
account: (0, nullthrows_1.default)(ctx.user.accounts.find(a => a.name === ctx.accountName), `You do not have access to account: ${ctx.accountName}`),
|
|
@@ -67,7 +69,7 @@ async function getAscApiKeyFromCredentialsServiceAsync(ctx) {
|
|
|
67
69
|
summary: {
|
|
68
70
|
source: 'EAS servers',
|
|
69
71
|
keyId: keyIdentifier,
|
|
70
|
-
name: name
|
|
72
|
+
name: name ?? undefined,
|
|
71
73
|
},
|
|
72
74
|
};
|
|
73
75
|
}
|
|
@@ -19,11 +19,10 @@ class IosSubmitCommand {
|
|
|
19
19
|
this.ctx = ctx;
|
|
20
20
|
}
|
|
21
21
|
async runAsync() {
|
|
22
|
-
var _a;
|
|
23
22
|
log_1.default.addNewLineIfNone();
|
|
24
23
|
const archiveSource = this.resolveArchiveSource();
|
|
25
24
|
if (!archiveSource.ok) {
|
|
26
|
-
log_1.default.error(
|
|
25
|
+
log_1.default.error(archiveSource.reason?.message);
|
|
27
26
|
throw new Error('Submission failed');
|
|
28
27
|
}
|
|
29
28
|
const archiveSourceValue = archiveSource.enforceValue();
|
|
@@ -54,7 +53,7 @@ class IosSubmitCommand {
|
|
|
54
53
|
ascAppIdentifier,
|
|
55
54
|
].filter(r => !r.ok);
|
|
56
55
|
if (errored.length > 0) {
|
|
57
|
-
const message = errored.map(err =>
|
|
56
|
+
const message = errored.map(err => err.reason?.message).join('\n');
|
|
58
57
|
log_1.default.error(message);
|
|
59
58
|
throw new Error('Submission failed');
|
|
60
59
|
}
|
|
@@ -68,7 +68,7 @@ class IosSubmitter extends BaseSubmitter_1.default {
|
|
|
68
68
|
appleIdUsername,
|
|
69
69
|
isVerboseFastlaneEnabled,
|
|
70
70
|
...(appSpecificPassword ? this.formatAppSpecificPassword(appSpecificPassword) : null),
|
|
71
|
-
...(
|
|
71
|
+
...(ascApiKeyResult?.result ? this.formatAscApiKeyResult(ascApiKeyResult.result) : null),
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
formatAppSpecificPassword(appSpecificPassword) {
|
|
@@ -10,20 +10,19 @@ const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
|
10
10
|
* @throws Error if language is invalid.s
|
|
11
11
|
*/
|
|
12
12
|
function sanitizeLanguage(lang, { defaultLang = 'en-US' } = {}) {
|
|
13
|
-
var _a, _b;
|
|
14
13
|
if (!lang) {
|
|
15
14
|
const found = findLanguage(defaultLang);
|
|
16
15
|
if (!found) {
|
|
17
16
|
throw new Error('Invalid default language provided: ' + defaultLang);
|
|
18
17
|
}
|
|
19
|
-
return
|
|
18
|
+
return found.itcLocale ?? found.locale;
|
|
20
19
|
}
|
|
21
20
|
const foundLang = findLanguage(lang);
|
|
22
21
|
if (!foundLang) {
|
|
23
22
|
log_1.default.addNewLineIfNone();
|
|
24
23
|
throw new Error(`You must specify a supported language. Supported language codes are:\n${languageListToString()}`);
|
|
25
24
|
}
|
|
26
|
-
return
|
|
25
|
+
return foundLang.itcLocale ?? foundLang.locale;
|
|
27
26
|
}
|
|
28
27
|
exports.sanitizeLanguage = sanitizeLanguage;
|
|
29
28
|
/**
|
|
@@ -48,7 +47,7 @@ function findLanguage(query) {
|
|
|
48
47
|
lang.name === query ||
|
|
49
48
|
lang.locale === query ||
|
|
50
49
|
lang.itcLocale === query);
|
|
51
|
-
return foundLang
|
|
50
|
+
return foundLang ?? null;
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
54
53
|
* This is slightly modified list taken from fastlane: https://github.com/fastlane/fastlane/blob/master/spaceship/lib/assets/languageMapping.json
|
package/build/submit/submit.js
CHANGED
|
@@ -59,15 +59,14 @@ function printInstructionsForAndroidSubmission(submission) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function printInstructionsForIosSubmission(submission) {
|
|
62
|
-
var _a, _b;
|
|
63
62
|
if (submission.status === generated_1.SubmissionStatus.Finished) {
|
|
64
63
|
const logMsg = [
|
|
65
64
|
chalk_1.default.bold('Your binary has been successfully uploaded to App Store Connect!'),
|
|
66
65
|
'- It is now being processed by Apple - you will receive an email when the processing finishes.',
|
|
67
66
|
'- It usually takes about 5-10 minutes depending on how busy Apple servers are.',
|
|
68
67
|
// ascAppIdentifier should be always available for ios submissions but check it anyway
|
|
69
|
-
|
|
70
|
-
`- When it's done, you can see your build here: ${(0, log_1.link)(`https://appstoreconnect.apple.com/apps/${
|
|
68
|
+
submission.iosConfig?.ascAppIdentifier &&
|
|
69
|
+
`- When it's done, you can see your build here: ${(0, log_1.link)(`https://appstoreconnect.apple.com/apps/${submission.iosConfig?.ascAppIdentifier}/testflight/ios`)}`,
|
|
71
70
|
].join('\n');
|
|
72
71
|
log_1.default.addNewLineIfNone();
|
|
73
72
|
log_1.default.log(logMsg);
|
|
@@ -11,10 +11,9 @@ const UNKNOWN_ERROR_CODES = [
|
|
|
11
11
|
* Returns a boolean indicating whether the submission logs should be printed.
|
|
12
12
|
*/
|
|
13
13
|
function printSubmissionError(error) {
|
|
14
|
-
var _a;
|
|
15
14
|
log_1.default.addNewLineIfNone();
|
|
16
15
|
if (!error.message || (error.errorCode && UNKNOWN_ERROR_CODES.includes(error.errorCode))) {
|
|
17
|
-
log_1.default.error(
|
|
16
|
+
log_1.default.error(error.message ?? `We couldn't figure out what went wrong. See logs to learn more.`);
|
|
18
17
|
return true;
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
@@ -110,5 +110,5 @@ function getMultipleSpinnerText(submissions) {
|
|
|
110
110
|
return text;
|
|
111
111
|
}
|
|
112
112
|
function countWithStatus(submissions, status) {
|
|
113
|
-
return submissions.filter(submission =>
|
|
113
|
+
return submissions.filter(submission => submission?.status === status).length;
|
|
114
114
|
}
|
|
@@ -31,14 +31,13 @@ async function syncUpdatesConfigurationAsync({ projectDir, exp, workflow, env, }
|
|
|
31
31
|
}
|
|
32
32
|
exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
|
|
33
33
|
async function readChannelSafelyAsync(projectDir) {
|
|
34
|
-
var _a;
|
|
35
34
|
try {
|
|
36
35
|
const androidManifest = await getAndroidManifestAsync(projectDir);
|
|
37
36
|
const stringifiedRequestHeaders = config_plugins_1.AndroidConfig.Manifest.getMainApplicationMetaDataValue(androidManifest, config_plugins_1.AndroidConfig.Updates.Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY);
|
|
38
37
|
if (!stringifiedRequestHeaders) {
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
41
|
-
return
|
|
40
|
+
return JSON.parse(stringifiedRequestHeaders)['expo-channel-name'] ?? null;
|
|
42
41
|
}
|
|
43
42
|
catch {
|
|
44
43
|
return null;
|
|
@@ -57,9 +57,8 @@ function replaceUndefinedObjectValues(value, replacement) {
|
|
|
57
57
|
* This preserves and merges the nested update-related properties.
|
|
58
58
|
*/
|
|
59
59
|
function mergeExpoConfig(exp, modifyExp) {
|
|
60
|
-
var _a;
|
|
61
60
|
return {
|
|
62
|
-
runtimeVersion:
|
|
61
|
+
runtimeVersion: modifyExp.runtimeVersion ?? exp.runtimeVersion,
|
|
63
62
|
updates: { ...exp.updates, ...modifyExp.updates },
|
|
64
63
|
android: {
|
|
65
64
|
...exp.android,
|
|
@@ -79,19 +78,18 @@ function mergeExpoConfig(exp, modifyExp) {
|
|
|
79
78
|
* - Output the changes made, or the changes required to make manually
|
|
80
79
|
*/
|
|
81
80
|
async function ensureEASUpdatesIsConfiguredInExpoConfigAsync({ exp, projectId, projectDir, platform, workflows, }) {
|
|
82
|
-
var _a, _b, _c, _d, _e, _f;
|
|
83
81
|
const modifyConfig = {};
|
|
84
|
-
if (
|
|
82
|
+
if (exp.updates?.url !== (0, api_1.getEASUpdateURL)(projectId)) {
|
|
85
83
|
modifyConfig.updates = { url: (0, api_1.getEASUpdateURL)(projectId) };
|
|
86
84
|
}
|
|
87
|
-
let androidRuntimeVersion =
|
|
88
|
-
let iosRuntimeVersion =
|
|
85
|
+
let androidRuntimeVersion = exp.android?.runtimeVersion ?? exp.runtimeVersion;
|
|
86
|
+
let iosRuntimeVersion = exp.ios?.runtimeVersion ?? exp.runtimeVersion;
|
|
89
87
|
if ((['all', 'android'].includes(platform) && !androidRuntimeVersion) ||
|
|
90
88
|
(['all', 'ios'].includes(platform) && !iosRuntimeVersion)) {
|
|
91
89
|
androidRuntimeVersion =
|
|
92
|
-
androidRuntimeVersion
|
|
90
|
+
androidRuntimeVersion ?? getDefaultRuntimeVersion(workflows.android, exp.sdkVersion);
|
|
93
91
|
iosRuntimeVersion =
|
|
94
|
-
iosRuntimeVersion
|
|
92
|
+
iosRuntimeVersion ?? getDefaultRuntimeVersion(workflows.ios, exp.sdkVersion);
|
|
95
93
|
if (platform === 'all' && isRuntimeEqual(androidRuntimeVersion, iosRuntimeVersion)) {
|
|
96
94
|
modifyConfig.runtimeVersion = androidRuntimeVersion;
|
|
97
95
|
}
|
|
@@ -117,7 +115,7 @@ async function ensureEASUpdatesIsConfiguredInExpoConfigAsync({ exp, projectId, p
|
|
|
117
115
|
return {
|
|
118
116
|
projectChanged: true,
|
|
119
117
|
// TODO(cedric): fix return type of `modifyConfigAsync` to avoid `null` for type === success repsonses
|
|
120
|
-
exp:
|
|
118
|
+
exp: result.config?.expo,
|
|
121
119
|
};
|
|
122
120
|
case 'warn':
|
|
123
121
|
warnEASUpdatesManualConfig({ modifyConfig, workflows });
|
|
@@ -137,14 +135,13 @@ function serializeRuntimeVersionToString(runtimeVersion) {
|
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
function logEasUpdatesAutoConfig({ modifyConfig, exp, }) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
log_1.default.withTick(((_b = exp.updates) === null || _b === void 0 ? void 0 : _b.url)
|
|
138
|
+
if (modifyConfig.updates?.url) {
|
|
139
|
+
log_1.default.withTick(exp.updates?.url
|
|
143
140
|
? `Overwrote updates.url "${exp.updates.url}" with "${modifyConfig.updates.url}"`
|
|
144
141
|
: `Configured updates.url to "${modifyConfig.updates.url}"`);
|
|
145
142
|
}
|
|
146
|
-
const androidRuntime =
|
|
147
|
-
const iosRuntime =
|
|
143
|
+
const androidRuntime = modifyConfig.android?.runtimeVersion ?? modifyConfig.runtimeVersion;
|
|
144
|
+
const iosRuntime = modifyConfig.ios?.runtimeVersion ?? modifyConfig.runtimeVersion;
|
|
148
145
|
if (androidRuntime && iosRuntime && androidRuntime === iosRuntime) {
|
|
149
146
|
log_1.default.withTick(`Configured runtimeVersion for ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Android]} and ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Ios]} with "${serializeRuntimeVersionToString(androidRuntime)}"`);
|
|
150
147
|
}
|
|
@@ -20,9 +20,8 @@ async function syncUpdatesConfigurationAsync({ vcsClient, projectDir, exp, workf
|
|
|
20
20
|
}
|
|
21
21
|
exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
|
|
22
22
|
async function readExpoPlistAsync(projectDir) {
|
|
23
|
-
var _a;
|
|
24
23
|
const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
|
|
25
|
-
return ((
|
|
24
|
+
return ((await (0, plist_1.readPlistAsync)(expoPlistPath)) ?? {});
|
|
26
25
|
}
|
|
27
26
|
async function writeExpoPlistAsync(vcsClient, projectDir, expoPlist) {
|
|
28
27
|
const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
|
|
@@ -30,11 +29,10 @@ async function writeExpoPlistAsync(vcsClient, projectDir, expoPlist) {
|
|
|
30
29
|
await vcsClient.trackFileAsync(expoPlistPath);
|
|
31
30
|
}
|
|
32
31
|
async function readChannelSafelyAsync(projectDir) {
|
|
33
|
-
var _a;
|
|
34
32
|
try {
|
|
35
33
|
const expoPlist = await readExpoPlistAsync(projectDir);
|
|
36
34
|
const updatesRequestHeaders = expoPlist['EXUpdatesRequestHeaders'];
|
|
37
|
-
return
|
|
35
|
+
return updatesRequestHeaders?.['expo-channel-name'] ?? null;
|
|
38
36
|
}
|
|
39
37
|
catch {
|
|
40
38
|
return null;
|
package/build/update/queries.js
CHANGED
|
@@ -13,10 +13,9 @@ const queries_1 = require("../utils/queries");
|
|
|
13
13
|
exports.UPDATES_LIMIT = 50;
|
|
14
14
|
exports.UPDATE_GROUPS_LIMIT = 25;
|
|
15
15
|
async function listAndRenderUpdateGroupsOnAppAsync(graphqlClient, { projectId, paginatedQueryOptions, }) {
|
|
16
|
-
var _a, _b;
|
|
17
16
|
if (paginatedQueryOptions.nonInteractive) {
|
|
18
17
|
const updateGroups = await queryUpdateGroupsOnAppAsync(graphqlClient, {
|
|
19
|
-
limit:
|
|
18
|
+
limit: paginatedQueryOptions.limit ?? exports.UPDATE_GROUPS_LIMIT,
|
|
20
19
|
offset: paginatedQueryOptions.offset,
|
|
21
20
|
appId: projectId,
|
|
22
21
|
});
|
|
@@ -24,7 +23,7 @@ async function listAndRenderUpdateGroupsOnAppAsync(graphqlClient, { projectId, p
|
|
|
24
23
|
}
|
|
25
24
|
else {
|
|
26
25
|
await (0, queries_1.paginatedQueryWithConfirmPromptAsync)({
|
|
27
|
-
limit:
|
|
26
|
+
limit: paginatedQueryOptions.limit ?? exports.UPDATE_GROUPS_LIMIT,
|
|
28
27
|
offset: paginatedQueryOptions.offset,
|
|
29
28
|
queryToPerform: (limit, offset) => queryUpdateGroupsOnAppAsync(graphqlClient, { limit, offset, appId: projectId }),
|
|
30
29
|
promptOptions: {
|
|
@@ -36,10 +35,9 @@ async function listAndRenderUpdateGroupsOnAppAsync(graphqlClient, { projectId, p
|
|
|
36
35
|
}
|
|
37
36
|
exports.listAndRenderUpdateGroupsOnAppAsync = listAndRenderUpdateGroupsOnAppAsync;
|
|
38
37
|
async function listAndRenderUpdateGroupsOnBranchAsync(graphqlClient, { projectId, branchName, paginatedQueryOptions, }) {
|
|
39
|
-
var _a, _b;
|
|
40
38
|
if (paginatedQueryOptions.nonInteractive) {
|
|
41
39
|
const updateGroups = await queryUpdateGroupsOnBranchAsync(graphqlClient, {
|
|
42
|
-
limit:
|
|
40
|
+
limit: paginatedQueryOptions.limit ?? exports.UPDATE_GROUPS_LIMIT,
|
|
43
41
|
offset: paginatedQueryOptions.offset,
|
|
44
42
|
appId: projectId,
|
|
45
43
|
branchName,
|
|
@@ -48,7 +46,7 @@ async function listAndRenderUpdateGroupsOnBranchAsync(graphqlClient, { projectId
|
|
|
48
46
|
}
|
|
49
47
|
else {
|
|
50
48
|
await (0, queries_1.paginatedQueryWithConfirmPromptAsync)({
|
|
51
|
-
limit:
|
|
49
|
+
limit: paginatedQueryOptions.limit ?? exports.UPDATE_GROUPS_LIMIT,
|
|
52
50
|
offset: paginatedQueryOptions.offset,
|
|
53
51
|
queryToPerform: (limit, offset) => queryUpdateGroupsOnBranchAsync(graphqlClient, {
|
|
54
52
|
limit,
|
|
@@ -65,12 +63,11 @@ async function listAndRenderUpdateGroupsOnBranchAsync(graphqlClient, { projectId
|
|
|
65
63
|
}
|
|
66
64
|
exports.listAndRenderUpdateGroupsOnBranchAsync = listAndRenderUpdateGroupsOnBranchAsync;
|
|
67
65
|
async function selectUpdateGroupOnBranchAsync(graphqlClient, { projectId, branchName, paginatedQueryOptions, }) {
|
|
68
|
-
var _a;
|
|
69
66
|
if (paginatedQueryOptions.nonInteractive) {
|
|
70
67
|
throw new Error('Unable to select an update in non-interactive mode.');
|
|
71
68
|
}
|
|
72
69
|
const updateGroup = await (0, queries_1.paginatedQueryWithSelectPromptAsync)({
|
|
73
|
-
limit:
|
|
70
|
+
limit: paginatedQueryOptions.limit ?? exports.UPDATE_GROUPS_LIMIT,
|
|
74
71
|
offset: paginatedQueryOptions.offset,
|
|
75
72
|
queryToPerform: (limit, offset) => queryUpdateGroupsOnBranchAsync(graphqlClient, {
|
|
76
73
|
appId: projectId,
|
|
@@ -99,14 +96,13 @@ async function queryUpdateGroupsOnAppAsync(graphqlClient, args) {
|
|
|
99
96
|
return await UpdateQuery_1.UpdateQuery.viewUpdateGroupsOnAppAsync(graphqlClient, args);
|
|
100
97
|
}
|
|
101
98
|
function renderUpdateGroupsOnBranch({ branchName, updateGroups, paginatedQueryOptions: { json }, }) {
|
|
102
|
-
var _a, _b;
|
|
103
99
|
// Ensure all updates are from the same branch
|
|
104
100
|
const branchNames = updateGroups.flatMap(updateGroup => updateGroup.map(update => update.branch.name));
|
|
105
101
|
(0, assert_1.default)(branchNames.every(name => name === branchName), 'Each update must belong to the same branch.');
|
|
106
102
|
const updateGroupDescriptions = (0, utils_1.getUpdateGroupDescriptionsWithBranch)(updateGroups);
|
|
107
103
|
const branch = {
|
|
108
104
|
name: branchName,
|
|
109
|
-
id:
|
|
105
|
+
id: updateGroups[0]?.[0].branch.id ?? 'N/A',
|
|
110
106
|
};
|
|
111
107
|
if (json) {
|
|
112
108
|
return (0, json_1.printJsonOnlyOutput)({ ...branch, currentPage: updateGroupDescriptions });
|
package/build/update/utils.js
CHANGED
|
@@ -19,29 +19,27 @@ exports.UPDATE_COLUMNS = [
|
|
|
19
19
|
];
|
|
20
20
|
exports.UPDATE_COLUMNS_WITH_BRANCH = ['Branch', ...exports.UPDATE_COLUMNS];
|
|
21
21
|
function formatUpdateGroup(update) {
|
|
22
|
-
var _a;
|
|
23
22
|
return (0, formatFields_1.default)([
|
|
24
23
|
{ label: 'Platforms', value: update.platforms },
|
|
25
24
|
{ label: 'Runtime Version', value: update.runtimeVersion },
|
|
26
25
|
{ label: 'Message', value: update.message },
|
|
27
|
-
{ label: 'Code Signing Key', value:
|
|
26
|
+
{ label: 'Code Signing Key', value: update.codeSigningKey ?? 'N/A' },
|
|
28
27
|
{ label: 'Is Roll Back to Embedded', value: update.isRollBackToEmbedded ? 'Yes' : 'No' },
|
|
29
28
|
{ label: 'Group ID', value: update.group },
|
|
30
29
|
]);
|
|
31
30
|
}
|
|
32
31
|
exports.formatUpdateGroup = formatUpdateGroup;
|
|
33
32
|
function formatBranch({ branch, branchRolloutPercentage, update, }) {
|
|
34
|
-
var _a, _b, _c, _d;
|
|
35
33
|
const rolloutField = branchRolloutPercentage
|
|
36
34
|
? [{ label: 'Rollout', value: `${branchRolloutPercentage}%` }]
|
|
37
35
|
: [];
|
|
38
36
|
return (0, formatFields_1.default)([
|
|
39
37
|
{ label: 'Branch', value: branch },
|
|
40
38
|
...rolloutField,
|
|
41
|
-
{ label: 'Platforms', value:
|
|
42
|
-
{ label: 'Runtime Version', value:
|
|
43
|
-
{ label: 'Message', value:
|
|
44
|
-
{ label: 'Group ID', value:
|
|
39
|
+
{ label: 'Platforms', value: update?.platforms ?? 'N/A' },
|
|
40
|
+
{ label: 'Runtime Version', value: update?.runtimeVersion ?? 'N/A' },
|
|
41
|
+
{ label: 'Message', value: update?.message ?? 'N/A' },
|
|
42
|
+
{ label: 'Group ID', value: update?.group ?? 'N/A' },
|
|
45
43
|
]);
|
|
46
44
|
}
|
|
47
45
|
exports.formatBranch = formatBranch;
|
|
@@ -75,15 +73,14 @@ function formatUpdateMessage(update) {
|
|
|
75
73
|
}
|
|
76
74
|
exports.formatUpdateMessage = formatUpdateMessage;
|
|
77
75
|
function ensureValidVersions(exp, platform) {
|
|
78
|
-
var _a, _b;
|
|
79
76
|
const error = new Error(`Couldn't find either ${chalk_1.default.bold('runtimeVersion')} or ${chalk_1.default.bold('sdkVersion')} to configure ${chalk_1.default.bold('expo-updates')}. Specify at least one of these properties under the ${chalk_1.default.bold('expo')} key in ${chalk_1.default.bold('app.json')}. ${(0, log_1.learnMore)('https://docs.expo.dev/eas-update/runtime-versions/')}`);
|
|
80
77
|
if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform) &&
|
|
81
|
-
!(
|
|
78
|
+
!(exp.android?.runtimeVersion || exp.runtimeVersion) &&
|
|
82
79
|
!exp.sdkVersion) {
|
|
83
80
|
throw error;
|
|
84
81
|
}
|
|
85
82
|
if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform) &&
|
|
86
|
-
!(
|
|
83
|
+
!(exp.ios?.runtimeVersion || exp.runtimeVersion) &&
|
|
87
84
|
!exp.sdkVersion) {
|
|
88
85
|
throw error;
|
|
89
86
|
}
|
|
@@ -92,7 +89,7 @@ exports.ensureValidVersions = ensureValidVersions;
|
|
|
92
89
|
function formatUpdateTitle(update) {
|
|
93
90
|
const { message, createdAt, actor, runtimeVersion } = update;
|
|
94
91
|
let actorName;
|
|
95
|
-
switch (actor
|
|
92
|
+
switch (actor?.__typename) {
|
|
96
93
|
case 'User':
|
|
97
94
|
case 'SSOUser': {
|
|
98
95
|
actorName = actor.username;
|
|
@@ -100,7 +97,7 @@ function formatUpdateTitle(update) {
|
|
|
100
97
|
}
|
|
101
98
|
case 'Robot': {
|
|
102
99
|
const { firstName, id } = actor;
|
|
103
|
-
actorName = firstName
|
|
100
|
+
actorName = firstName ?? `robot: ${id.slice(0, 4)}...`;
|
|
104
101
|
break;
|
|
105
102
|
}
|
|
106
103
|
case undefined: {
|
|
@@ -126,36 +123,29 @@ function getUpdateJsonInfosForUpdates(updates) {
|
|
|
126
123
|
}
|
|
127
124
|
exports.getUpdateJsonInfosForUpdates = getUpdateJsonInfosForUpdates;
|
|
128
125
|
function getUpdateGroupDescriptions(updateGroups) {
|
|
129
|
-
return updateGroups.map(updateGroup => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
platforms: formatPlatformForUpdateGroup(updateGroup),
|
|
138
|
-
});
|
|
139
|
-
});
|
|
126
|
+
return updateGroups.map(updateGroup => ({
|
|
127
|
+
message: formatUpdateMessage(updateGroup[0]),
|
|
128
|
+
runtimeVersion: updateGroup[0].runtimeVersion,
|
|
129
|
+
isRollBackToEmbedded: updateGroup[0].isRollBackToEmbedded,
|
|
130
|
+
codeSigningKey: updateGroup[0].codeSigningInfo?.keyid,
|
|
131
|
+
group: updateGroup[0].group,
|
|
132
|
+
platforms: formatPlatformForUpdateGroup(updateGroup),
|
|
133
|
+
}));
|
|
140
134
|
}
|
|
141
135
|
exports.getUpdateGroupDescriptions = getUpdateGroupDescriptions;
|
|
142
136
|
function getUpdateGroupDescriptionsWithBranch(updateGroups) {
|
|
143
|
-
return updateGroups.map(updateGroup => {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
platforms: formatPlatformForUpdateGroup(updateGroup),
|
|
153
|
-
});
|
|
154
|
-
});
|
|
137
|
+
return updateGroups.map(updateGroup => ({
|
|
138
|
+
branch: updateGroup[0].branch.name,
|
|
139
|
+
message: formatUpdateMessage(updateGroup[0]),
|
|
140
|
+
runtimeVersion: updateGroup[0].runtimeVersion,
|
|
141
|
+
isRollBackToEmbedded: updateGroup[0].isRollBackToEmbedded,
|
|
142
|
+
codeSigningKey: updateGroup[0].codeSigningInfo?.keyid,
|
|
143
|
+
group: updateGroup[0].group,
|
|
144
|
+
platforms: formatPlatformForUpdateGroup(updateGroup),
|
|
145
|
+
}));
|
|
155
146
|
}
|
|
156
147
|
exports.getUpdateGroupDescriptionsWithBranch = getUpdateGroupDescriptionsWithBranch;
|
|
157
148
|
function getBranchDescription(branch) {
|
|
158
|
-
var _a;
|
|
159
149
|
if (branch.updates.length === 0) {
|
|
160
150
|
return { branch: branch.name };
|
|
161
151
|
}
|
|
@@ -166,7 +156,7 @@ function getBranchDescription(branch) {
|
|
|
166
156
|
message: formatUpdateMessage(latestUpdate),
|
|
167
157
|
runtimeVersion: latestUpdate.runtimeVersion,
|
|
168
158
|
isRollBackToEmbedded: latestUpdate.isRollBackToEmbedded,
|
|
169
|
-
codeSigningKey:
|
|
159
|
+
codeSigningKey: latestUpdate.codeSigningInfo?.keyid,
|
|
170
160
|
group: latestUpdate.group,
|
|
171
161
|
platforms: getPlatformsForGroup({
|
|
172
162
|
group: latestUpdate.group,
|
|
@@ -177,8 +167,7 @@ function getBranchDescription(branch) {
|
|
|
177
167
|
}
|
|
178
168
|
exports.getBranchDescription = getBranchDescription;
|
|
179
169
|
async function checkEASUpdateURLIsSetAsync(exp, projectId) {
|
|
180
|
-
|
|
181
|
-
const configuredURL = (_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url;
|
|
170
|
+
const configuredURL = exp.updates?.url;
|
|
182
171
|
const expectedURL = (0, api_1.getEASUpdateURL)(projectId);
|
|
183
172
|
return configuredURL === expectedURL;
|
|
184
173
|
}
|
|
@@ -26,17 +26,14 @@ class SessionManager {
|
|
|
26
26
|
this.analytics = analytics;
|
|
27
27
|
}
|
|
28
28
|
getAccessToken() {
|
|
29
|
-
|
|
30
|
-
return (_a = process.env.EXPO_TOKEN) !== null && _a !== void 0 ? _a : null;
|
|
29
|
+
return process.env.EXPO_TOKEN ?? null;
|
|
31
30
|
}
|
|
32
31
|
getSessionSecret() {
|
|
33
|
-
|
|
34
|
-
return (_b = (_a = this.getSession()) === null || _a === void 0 ? void 0 : _a.sessionSecret) !== null && _b !== void 0 ? _b : null;
|
|
32
|
+
return this.getSession()?.sessionSecret ?? null;
|
|
35
33
|
}
|
|
36
34
|
getSession() {
|
|
37
|
-
var _a, _b;
|
|
38
35
|
try {
|
|
39
|
-
return
|
|
36
|
+
return json_file_1.default.read((0, paths_1.getStateJsonPath)())?.auth ?? null;
|
|
40
37
|
}
|
|
41
38
|
catch (error) {
|
|
42
39
|
if (error.code === 'ENOENT') {
|
|
@@ -62,7 +59,7 @@ class SessionManager {
|
|
|
62
59
|
sessionSecret: this.getSessionSecret(),
|
|
63
60
|
};
|
|
64
61
|
const actor = await UserQuery_1.UserQuery.currentUserAsync((0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo));
|
|
65
|
-
this.currentActor = actor
|
|
62
|
+
this.currentActor = actor ?? undefined;
|
|
66
63
|
if (actor) {
|
|
67
64
|
this.analytics.setActor(actor);
|
|
68
65
|
}
|
|
@@ -248,7 +245,7 @@ class SessionManager {
|
|
|
248
245
|
log_1.default.log(`One-time password was sent to the phone number ending in ${primaryDevice.sms_phone_number}.`);
|
|
249
246
|
otp = await this.promptForOTPAsync('menu');
|
|
250
247
|
}
|
|
251
|
-
if (
|
|
248
|
+
if (primaryDevice?.method === UserSecondFactorDeviceMethod.AUTHENTICATOR) {
|
|
252
249
|
log_1.default.log('One-time password from authenticator required.');
|
|
253
250
|
otp = await this.promptForOTPAsync('menu');
|
|
254
251
|
}
|
package/build/user/User.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.getActorUsername = exports.getActorDisplayName = void 0;
|
|
|
7
7
|
* The display name CANNOT be used as project owner.
|
|
8
8
|
*/
|
|
9
9
|
function getActorDisplayName(actor) {
|
|
10
|
-
switch (actor
|
|
10
|
+
switch (actor?.__typename) {
|
|
11
11
|
case 'User':
|
|
12
12
|
return actor.username;
|
|
13
13
|
case 'Robot':
|
|
@@ -20,7 +20,7 @@ function getActorDisplayName(actor) {
|
|
|
20
20
|
}
|
|
21
21
|
exports.getActorDisplayName = getActorDisplayName;
|
|
22
22
|
function getActorUsername(actor) {
|
|
23
|
-
switch (actor
|
|
23
|
+
switch (actor?.__typename) {
|
|
24
24
|
case 'User':
|
|
25
25
|
case 'SSOUser':
|
|
26
26
|
return actor.username;
|
|
@@ -52,9 +52,8 @@ async function getSessionUsingBrowserAuthFlowAsync({ expoWebsiteUrl, }) {
|
|
|
52
52
|
return new Promise(async (resolve, reject) => {
|
|
53
53
|
const connections = new Set();
|
|
54
54
|
const server = http_1.default.createServer((request, response) => {
|
|
55
|
-
var _a;
|
|
56
55
|
try {
|
|
57
|
-
if (!(request.method === 'GET' &&
|
|
56
|
+
if (!(request.method === 'GET' && request.url?.includes('/auth/callback'))) {
|
|
58
57
|
throw new Error('Unexpected SSO login response.');
|
|
59
58
|
}
|
|
60
59
|
const url = new URL(request.url, `http:${request.headers.host}`);
|
|
@@ -9,15 +9,14 @@ const fs_1 = require("fs");
|
|
|
9
9
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
10
10
|
const areSetsEqual_1 = tslib_1.__importDefault(require("./expodash/areSetsEqual"));
|
|
11
11
|
async function getCodeSigningInfoAsync(config, privateKeyPath) {
|
|
12
|
-
|
|
13
|
-
const codeSigningCertificatePath = (_a = config.updates) === null || _a === void 0 ? void 0 : _a.codeSigningCertificate;
|
|
12
|
+
const codeSigningCertificatePath = config.updates?.codeSigningCertificate;
|
|
14
13
|
if (!codeSigningCertificatePath) {
|
|
15
14
|
return undefined;
|
|
16
15
|
}
|
|
17
16
|
if (!privateKeyPath) {
|
|
18
17
|
throw new Error('Must specify --private-key-path argument to sign update for code signing');
|
|
19
18
|
}
|
|
20
|
-
const codeSigningMetadata =
|
|
19
|
+
const codeSigningMetadata = config.updates?.codeSigningMetadata;
|
|
21
20
|
if (!codeSigningMetadata) {
|
|
22
21
|
throw new Error('Must specify codeSigningMetadata under the "updates" field of your app config file to use EAS code signing');
|
|
23
22
|
}
|
|
@@ -63,7 +62,6 @@ async function getKeyAndCertificateFromPathsAsync({ codeSigningCertificatePath,
|
|
|
63
62
|
}
|
|
64
63
|
exports.getKeyAndCertificateFromPathsAsync = getKeyAndCertificateFromPathsAsync;
|
|
65
64
|
async function getMultipartBodyPartAsync(res, partName) {
|
|
66
|
-
var _a;
|
|
67
65
|
const contentType = res.headers.get('content-type');
|
|
68
66
|
if (!contentType) {
|
|
69
67
|
throw new Error('The multipart manifest response is missing the content-type header');
|
|
@@ -71,7 +69,7 @@ async function getMultipartBodyPartAsync(res, partName) {
|
|
|
71
69
|
const bodyBuffer = await res.arrayBuffer();
|
|
72
70
|
const multipartParts = await (0, multipart_body_parser_1.parseMultipartMixedResponseAsync)(contentType, Buffer.from(bodyBuffer));
|
|
73
71
|
const manifestPart = multipartParts.find(part => (0, multipart_body_parser_1.isMultipartPartWithName)(part, partName));
|
|
74
|
-
return
|
|
72
|
+
return manifestPart?.body ?? null;
|
|
75
73
|
}
|
|
76
74
|
async function getManifestBodyAsync(res) {
|
|
77
75
|
return await getMultipartBodyPartAsync(res, 'manifest');
|
|
@@ -98,13 +96,12 @@ function assertAssetParity(manifestResponseBodyAssetJSON, partialManifestAsset)
|
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
function checkManifestBodyAgainstUpdateInfoGroup(manifestResponseBody, partialManifest) {
|
|
101
|
-
var _a, _b;
|
|
102
99
|
const manifestResponseBodyJSON = JSON.parse(manifestResponseBody);
|
|
103
100
|
// Assert expoClient config is equal. We do not want to sign the manifest if the
|
|
104
101
|
// server has compromised the integrity of the manifest.
|
|
105
102
|
// JSON stringify and unstringify to remove any undefined values and bring it as close
|
|
106
103
|
// to the server sanitized value as possible
|
|
107
|
-
const isExtraEqual = (0, fast_deep_equal_1.default)(JSON.parse(JSON.stringify(
|
|
104
|
+
const isExtraEqual = (0, fast_deep_equal_1.default)(JSON.parse(JSON.stringify(partialManifest.extra?.expoClient)), manifestResponseBodyJSON.extra?.expoClient);
|
|
108
105
|
if (!isExtraEqual) {
|
|
109
106
|
throw new Error(`Code signing manifest integrity error: The manifest being signed contains an extra.expoClient field that does not match the initially uploaded manifest's extra.expoClient field`);
|
|
110
107
|
}
|
package/build/utils/expoCli.js
CHANGED
|
@@ -66,11 +66,10 @@ exports.shouldUseVersionedExpoCLIWithExplicitPlatformsExpensive = shouldUseVersi
|
|
|
66
66
|
exports.shouldUseVersionedExpoCLI = (0, memoize_1.memoize)(shouldUseVersionedExpoCLIExpensive);
|
|
67
67
|
exports.shouldUseVersionedExpoCLIWithExplicitPlatforms = (0, memoize_1.memoize)(shouldUseVersionedExpoCLIWithExplicitPlatformsExpensive);
|
|
68
68
|
async function expoCommandAsync(projectDir, args, { silent = false } = {}) {
|
|
69
|
-
var _a;
|
|
70
69
|
let expoCliPath;
|
|
71
70
|
try {
|
|
72
71
|
expoCliPath =
|
|
73
|
-
(
|
|
72
|
+
(0, resolve_from_1.silent)(projectDir, 'expo/bin/cli') ?? (0, resolve_from_1.default)(projectDir, 'expo/bin/cli.js');
|
|
74
73
|
}
|
|
75
74
|
catch (e) {
|
|
76
75
|
if (e.code === 'MODULE_NOT_FOUND') {
|