eas-cli 9.0.2 → 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.
Files changed (225) hide show
  1. package/README.md +59 -59
  2. package/build/analytics/AnalyticsManager.js +4 -5
  3. package/build/api.js +1 -2
  4. package/build/branch/actions/SelectBranch.js +2 -3
  5. package/build/branch/queries.js +3 -5
  6. package/build/branch/utils.js +1 -1
  7. package/build/build/android/build.js +3 -5
  8. package/build/build/android/graphql.js +1 -2
  9. package/build/build/android/prepareJob.js +1 -2
  10. package/build/build/android/syncProjectConfiguration.js +1 -1
  11. package/build/build/android/version.js +14 -16
  12. package/build/build/build.js +8 -10
  13. package/build/build/createContext.js +7 -8
  14. package/build/build/ios/build.js +2 -4
  15. package/build/build/ios/credentials.js +1 -2
  16. package/build/build/ios/graphql.js +4 -6
  17. package/build/build/ios/prepareJob.js +5 -6
  18. package/build/build/ios/syncProjectConfiguration.js +1 -1
  19. package/build/build/ios/version.js +17 -20
  20. package/build/build/local.js +2 -3
  21. package/build/build/metadata.js +9 -10
  22. package/build/build/queries.js +6 -9
  23. package/build/build/runBuildAndSubmit.d.ts +3 -1
  24. package/build/build/runBuildAndSubmit.js +19 -13
  25. package/build/build/utils/appJson.js +1 -2
  26. package/build/build/utils/formatBuild.js +5 -8
  27. package/build/build/utils/printBuildInfo.js +1 -2
  28. package/build/build/utils/resourceClass.js +3 -4
  29. package/build/build/utils/url.js +1 -2
  30. package/build/build/validate.js +8 -11
  31. package/build/channel/actions/SelectChannel.js +2 -3
  32. package/build/channel/errors.js +1 -1
  33. package/build/channel/queries.js +6 -10
  34. package/build/channel/utils.js +1 -1
  35. package/build/commandUtils/EasCommand.js +7 -6
  36. package/build/commandUtils/builds.js +3 -3
  37. package/build/commandUtils/context/DynamicProjectConfigContextField.js +2 -2
  38. package/build/commandUtils/context/LoggedInContextField.js +1 -2
  39. package/build/commandUtils/context/MaybeLoggedInContextField.js +2 -3
  40. package/build/commandUtils/context/VcsClientContextField.js +1 -1
  41. package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
  42. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +4 -6
  43. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +2 -4
  44. package/build/commandUtils/gating/FeatureGateEnvOverrides.js +1 -2
  45. package/build/commandUtils/pagination.js +3 -4
  46. package/build/commands/account/view.js +1 -2
  47. package/build/commands/branch/delete.js +1 -2
  48. package/build/commands/build/configure.js +1 -2
  49. package/build/commands/build/index.js +1 -2
  50. package/build/commands/build/internal.js +1 -2
  51. package/build/commands/build/resign.js +7 -7
  52. package/build/commands/build/run.js +2 -3
  53. package/build/commands/build/version/get.js +3 -4
  54. package/build/commands/build/version/set.js +5 -6
  55. package/build/commands/build/version/sync.js +5 -7
  56. package/build/commands/channel/rollout.js +1 -2
  57. package/build/commands/config.js +16 -14
  58. package/build/commands/credentials/configure-build.js +3 -3
  59. package/build/commands/credentials/index.js +1 -1
  60. package/build/commands/device/create.js +1 -1
  61. package/build/commands/device/rename.js +1 -1
  62. package/build/commands/diagnostics.js +6 -2
  63. package/build/commands/project/init.js +11 -9
  64. package/build/commands/project/onboarding.js +204 -32
  65. package/build/commands/secret/delete.js +5 -5
  66. package/build/commands/update/index.js +6 -7
  67. package/build/commands/update/republish.js +1 -2
  68. package/build/commands/update/roll-back-to-embedded.js +4 -5
  69. package/build/credentials/android/AndroidCredentialsProvider.js +4 -5
  70. package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -3
  71. package/build/credentials/android/actions/DownloadKeystore.js +2 -3
  72. package/build/credentials/android/actions/RemoveFcm.js +1 -1
  73. package/build/credentials/android/actions/SetUpBuildCredentials.js +3 -5
  74. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.js +3 -3
  75. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.js +3 -3
  76. package/build/credentials/android/api/GraphqlClient.js +4 -8
  77. package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.js +1 -2
  78. package/build/credentials/android/utils/printCredentials.js +4 -4
  79. package/build/credentials/context.js +2 -3
  80. package/build/credentials/credentialsJson/update.js +14 -16
  81. package/build/credentials/errors.js +7 -5
  82. package/build/credentials/ios/IosCredentialsProvider.js +3 -4
  83. package/build/credentials/ios/actions/AscApiKeyUtils.js +5 -9
  84. package/build/credentials/ios/actions/AssignAscApiKey.js +2 -3
  85. package/build/credentials/ios/actions/AssignPushKey.js +2 -3
  86. package/build/credentials/ios/actions/BuildCredentialsUtils.js +3 -5
  87. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
  88. package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -3
  89. package/build/credentials/ios/actions/DistributionCertificateUtils.js +3 -4
  90. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +2 -3
  91. package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
  92. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +3 -4
  93. package/build/credentials/ios/actions/SetUpAscApiKey.js +1 -1
  94. package/build/credentials/ios/actions/SetUpBuildCredentials.js +3 -4
  95. package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -2
  96. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +2 -3
  97. package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +2 -3
  98. package/build/credentials/ios/api/GraphqlClient.js +11 -15
  99. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +2 -2
  100. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +2 -2
  101. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +2 -4
  102. package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.js +1 -2
  103. package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.js +2 -4
  104. package/build/credentials/ios/appstore/AppStoreApi.js +1 -2
  105. package/build/credentials/ios/appstore/ascApiKey.js +6 -8
  106. package/build/credentials/ios/appstore/authenticate.js +2 -4
  107. package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
  108. package/build/credentials/ios/appstore/contractMessages.js +3 -5
  109. package/build/credentials/ios/appstore/distributionCertificate.js +2 -3
  110. package/build/credentials/ios/appstore/ensureAppExists.js +1 -2
  111. package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +5 -7
  112. package/build/credentials/ios/appstore/pushKey.js +2 -3
  113. package/build/credentials/ios/appstore/resolveCredentials.js +8 -9
  114. package/build/credentials/ios/errors.js +1 -1
  115. package/build/credentials/ios/utils/p12Certificate.js +1 -2
  116. package/build/credentials/ios/utils/provisioningProfile.js +1 -2
  117. package/build/credentials/ios/validators/validateProvisioningProfile.js +5 -7
  118. package/build/credentials/manager/ManageAndroid.js +2 -2
  119. package/build/credentials/manager/ManageIos.js +3 -4
  120. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -2
  121. package/build/credentials/manager/SetDefaultAndroidKeystore.js +1 -1
  122. package/build/credentials/manager/SetUpAndroidBuildCredentials.js +2 -2
  123. package/build/credentials/manager/SetUpIosBuildCredentials.js +2 -2
  124. package/build/credentials/utils/promptForCredentials.js +2 -3
  125. package/build/devices/actions/create/currentMachineMethod.js +4 -5
  126. package/build/devices/actions/create/developerPortalMethod.js +1 -2
  127. package/build/devices/actions/create/inputMethod.js +1 -1
  128. package/build/devices/context.js +1 -1
  129. package/build/devices/queries.js +3 -6
  130. package/build/devices/utils/errors.js +2 -2
  131. package/build/devices/utils/formatDevice.js +4 -6
  132. package/build/graphql/client.js +5 -8
  133. package/build/graphql/generated.d.ts +42 -0
  134. package/build/graphql/mutations/AppMutation.js +1 -2
  135. package/build/graphql/mutations/AppVersionMutation.js +1 -2
  136. package/build/graphql/mutations/BuildMutation.js +4 -8
  137. package/build/graphql/mutations/UserPreferencesMutation.js +2 -3
  138. package/build/graphql/queries/AppVersionQuery.js +1 -2
  139. package/build/graphql/queries/BranchQuery.js +1 -2
  140. package/build/graphql/queries/BuildQuery.js +1 -2
  141. package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -3
  142. package/build/graphql/queries/SubmissionQuery.js +1 -2
  143. package/build/graphql/queries/WebhookQuery.js +1 -2
  144. package/build/graphql/types/App.js +1 -0
  145. package/build/log.js +2 -2
  146. package/build/metadata/apple/config/reader.js +26 -32
  147. package/build/metadata/apple/config/writer.js +35 -39
  148. package/build/metadata/apple/rules/infoKeywordLength.js +2 -4
  149. package/build/metadata/apple/rules/infoRestrictedWords.js +2 -4
  150. package/build/metadata/apple/tasks/app-review-detail.js +1 -2
  151. package/build/metadata/apple/tasks/app-version.js +6 -8
  152. package/build/metadata/auth.js +1 -2
  153. package/build/metadata/config/resolve.js +2 -3
  154. package/build/metadata/config/validate.js +2 -4
  155. package/build/metadata/errors.js +3 -5
  156. package/build/metadata/upload.js +1 -2
  157. package/build/metadata/utils/retry.js +1 -2
  158. package/build/metadata/utils/telemetry.js +8 -11
  159. package/build/onboarding/runCommand.js +2 -2
  160. package/build/ora.js +18 -2
  161. package/build/project/android/applicationId.js +3 -4
  162. package/build/project/android/gradle.js +3 -4
  163. package/build/project/android/gradleUtils.js +4 -5
  164. package/build/project/expoConfig.js +3 -4
  165. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +3 -5
  166. package/build/project/ios/bundleIdentifier.js +7 -8
  167. package/build/project/ios/entitlements.js +1 -2
  168. package/build/project/ios/scheme.js +7 -6
  169. package/build/project/ios/target.js +17 -23
  170. package/build/project/metroConfig.js +1 -2
  171. package/build/project/projectUtils.js +5 -7
  172. package/build/project/publish.js +18 -27
  173. package/build/project/remoteVersionSource.js +6 -7
  174. package/build/project/resolveRuntimeVersionAsync.d.ts +2 -1
  175. package/build/project/resolveRuntimeVersionAsync.js +3 -4
  176. package/build/prompts.js +5 -7
  177. package/build/rollout/actions/CreateRollout.js +4 -5
  178. package/build/rollout/actions/EditRollout.js +1 -2
  179. package/build/rollout/actions/EndRollout.js +2 -4
  180. package/build/rollout/actions/ManageRollout.js +1 -2
  181. package/build/rollout/actions/NonInteractiveRollout.js +1 -2
  182. package/build/rollout/actions/SelectRuntime.js +2 -4
  183. package/build/rollout/utils.js +4 -5
  184. package/build/run/android/adb.js +4 -7
  185. package/build/run/ios/xcode.js +1 -2
  186. package/build/run/ios/xcrun.js +1 -2
  187. package/build/run/utils.js +2 -4
  188. package/build/submit/ArchiveSource.js +1 -1
  189. package/build/submit/android/AndroidSubmitCommand.js +3 -5
  190. package/build/submit/android/AndroidSubmitter.js +3 -3
  191. package/build/submit/android/ServiceAccountSource.js +1 -2
  192. package/build/submit/ios/AppProduce.js +5 -4
  193. package/build/submit/ios/AppSpecificPasswordSource.js +2 -2
  194. package/build/submit/ios/AscApiKeySource.js +5 -3
  195. package/build/submit/ios/IosSubmitCommand.js +2 -3
  196. package/build/submit/ios/IosSubmitter.js +1 -1
  197. package/build/submit/ios/utils/language.js +3 -4
  198. package/build/submit/submit.js +2 -3
  199. package/build/submit/utils/errors.js +1 -2
  200. package/build/submit/utils/wait.js +1 -1
  201. package/build/update/android/UpdatesModule.js +1 -2
  202. package/build/update/configure.js +11 -14
  203. package/build/update/ios/UpdatesModule.js +2 -4
  204. package/build/update/queries.js +6 -10
  205. package/build/update/republish.js +1 -1
  206. package/build/update/utils.js +28 -39
  207. package/build/user/SessionManager.js +5 -8
  208. package/build/user/User.js +2 -2
  209. package/build/user/expoSsoLauncher.js +1 -2
  210. package/build/utils/code-signing.js +4 -7
  211. package/build/utils/expoCli.js +1 -2
  212. package/build/utils/expoUpdatesCli.d.ts +1 -0
  213. package/build/utils/expoUpdatesCli.js +3 -2
  214. package/build/utils/profiles.js +3 -3
  215. package/build/utils/progress.js +2 -2
  216. package/build/utils/relay.js +10 -14
  217. package/build/utils/timer.js +1 -2
  218. package/build/vcs/clients/git.d.ts +1 -1
  219. package/build/vcs/clients/git.js +24 -20
  220. package/build/vcs/git.d.ts +1 -1
  221. package/build/vcs/git.js +4 -2
  222. package/build/vcs/local.js +1 -2
  223. package/build/webhooks/input.js +2 -2
  224. package/oclif.manifest.json +1 -1
  225. package/package.json +5 -5
@@ -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: (_b = (_a = ctx.applicationIdentifierOverride) !== null && _a !== void 0 ? _a : ctx.profile.bundleIdentifier) !== null && _b !== void 0 ? _b : (await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, exp, ctx.vcsClient)),
20
- appName: (_c = appName !== null && appName !== void 0 ? appName : exp.name) !== null && _c !== void 0 ? _c : (await promptForAppNameAsync()),
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 === null || session === void 0 ? void 0 : session.user.emailAddress;
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 === null || source === void 0 ? void 0 : source.sourceType}"`);
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 !== null && lastAppleId !== void 0 ? lastAppleId : undefined,
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
- var _a, _b, _c;
51
- const bundleIdentifier = (_c = (_b = (_a = ctx.applicationIdentifierOverride) !== null && _a !== void 0 ? _a : ctx.profile.bundleIdentifier) !== null && _b !== void 0 ? _b : (await maybeGetIosBundleIdentifierAsync(ctx))) !== null && _c !== void 0 ? _c : (await promptForBundleIdentifierAsync());
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 !== null && name !== void 0 ? name : undefined,
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((_a = archiveSource.reason) === null || _a === void 0 ? void 0 : _a.message);
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 => { var _a; return (_a = err.reason) === null || _a === void 0 ? void 0 : _a.message; }).join('\n');
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
- ...((ascApiKeyResult === null || ascApiKeyResult === void 0 ? void 0 : ascApiKeyResult.result) ? this.formatAscApiKeyResult(ascApiKeyResult.result) : null),
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 (_a = found.itcLocale) !== null && _a !== void 0 ? _a : found.locale;
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 (_b = foundLang.itcLocale) !== null && _b !== void 0 ? _b : foundLang.locale;
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 !== null && foundLang !== void 0 ? foundLang : null;
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
@@ -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
- ((_a = submission.iosConfig) === null || _a === void 0 ? void 0 : _a.ascAppIdentifier) &&
70
- `- When it's done, you can see your build here: ${(0, log_1.link)(`https://appstoreconnect.apple.com/apps/${(_b = submission.iosConfig) === null || _b === void 0 ? void 0 : _b.ascAppIdentifier}/testflight/ios`)}`,
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((_a = error.message) !== null && _a !== void 0 ? _a : `We couldn't figure out what went wrong. See logs to learn more.`);
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 => (submission === null || submission === void 0 ? void 0 : submission.status) === status).length;
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 (_a = JSON.parse(stringifiedRequestHeaders)['expo-channel-name']) !== null && _a !== void 0 ? _a : null;
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: (_a = modifyExp.runtimeVersion) !== null && _a !== void 0 ? _a : exp.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 (((_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url) !== (0, api_1.getEASUpdateURL)(projectId)) {
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 = (_c = (_b = exp.android) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== null && _c !== void 0 ? _c : exp.runtimeVersion;
88
- let iosRuntimeVersion = (_e = (_d = exp.ios) === null || _d === void 0 ? void 0 : _d.runtimeVersion) !== null && _e !== void 0 ? _e : exp.runtimeVersion;
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 !== null && androidRuntimeVersion !== void 0 ? androidRuntimeVersion : getDefaultRuntimeVersion(workflows.android, exp.sdkVersion);
90
+ androidRuntimeVersion ?? getDefaultRuntimeVersion(workflows.android, exp.sdkVersion);
93
91
  iosRuntimeVersion =
94
- iosRuntimeVersion !== null && iosRuntimeVersion !== void 0 ? iosRuntimeVersion : getDefaultRuntimeVersion(workflows.ios, exp.sdkVersion);
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: (_f = result.config) === null || _f === void 0 ? void 0 : _f.expo,
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
- var _a, _b, _c, _d, _e, _f;
141
- if ((_a = modifyConfig.updates) === null || _a === void 0 ? void 0 : _a.url) {
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 = (_d = (_c = modifyConfig.android) === null || _c === void 0 ? void 0 : _c.runtimeVersion) !== null && _d !== void 0 ? _d : modifyConfig.runtimeVersion;
147
- const iosRuntime = (_f = (_e = modifyConfig.ios) === null || _e === void 0 ? void 0 : _e.runtimeVersion) !== null && _f !== void 0 ? _f : modifyConfig.runtimeVersion;
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 ((_a = (await (0, plist_1.readPlistAsync)(expoPlistPath))) !== null && _a !== void 0 ? _a : {});
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 (_a = updatesRequestHeaders === null || updatesRequestHeaders === void 0 ? void 0 : updatesRequestHeaders['expo-channel-name']) !== null && _a !== void 0 ? _a : null;
35
+ return updatesRequestHeaders?.['expo-channel-name'] ?? null;
38
36
  }
39
37
  catch {
40
38
  return null;
@@ -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: (_a = paginatedQueryOptions.limit) !== null && _a !== void 0 ? _a : exports.UPDATE_GROUPS_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: (_b = paginatedQueryOptions.limit) !== null && _b !== void 0 ? _b : exports.UPDATE_GROUPS_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: (_a = paginatedQueryOptions.limit) !== null && _a !== void 0 ? _a : exports.UPDATE_GROUPS_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: (_b = paginatedQueryOptions.limit) !== null && _b !== void 0 ? _b : exports.UPDATE_GROUPS_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: (_a = paginatedQueryOptions.limit) !== null && _a !== void 0 ? _a : exports.UPDATE_GROUPS_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: (_b = (_a = updateGroups[0]) === null || _a === void 0 ? void 0 : _a[0].branch.id) !== null && _b !== void 0 ? _b : 'N/A',
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 });
@@ -117,7 +117,7 @@ async function republishAsync({ graphqlClient, app, updatesToPublish, targetBran
117
117
  ? [{ label: 'iOS update ID', value: updatesRepublishedByPlatform.ios.id }]
118
118
  : []),
119
119
  { label: 'Message', value: updateMessage },
120
- { label: 'Website link', value: (0, log_1.link)(updateGroupUrl, { dim: false }) },
120
+ { label: 'EAS Dashboard', value: (0, log_1.link)(updateGroupUrl, { dim: false }) },
121
121
  ]));
122
122
  }
123
123
  exports.republishAsync = republishAsync;
@@ -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: (_a = update.codeSigningKey) !== null && _a !== void 0 ? _a : 'N/A' },
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: (_a = update === null || update === void 0 ? void 0 : update.platforms) !== null && _a !== void 0 ? _a : 'N/A' },
42
- { label: 'Runtime Version', value: (_b = update === null || update === void 0 ? void 0 : update.runtimeVersion) !== null && _b !== void 0 ? _b : 'N/A' },
43
- { label: 'Message', value: (_c = update === null || update === void 0 ? void 0 : update.message) !== null && _c !== void 0 ? _c : 'N/A' },
44
- { label: 'Group ID', value: (_d = update === null || update === void 0 ? void 0 : update.group) !== null && _d !== void 0 ? _d : 'N/A' },
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
- !(((_a = exp.android) === null || _a === void 0 ? void 0 : _a.runtimeVersion) || exp.runtimeVersion) &&
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
- !(((_b = exp.ios) === null || _b === void 0 ? void 0 : _b.runtimeVersion) || exp.runtimeVersion) &&
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 === null || actor === void 0 ? void 0 : actor.__typename) {
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 !== null && firstName !== void 0 ? firstName : `robot: ${id.slice(0, 4)}...`;
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
- var _a;
131
- return ({
132
- message: formatUpdateMessage(updateGroup[0]),
133
- runtimeVersion: updateGroup[0].runtimeVersion,
134
- isRollBackToEmbedded: updateGroup[0].isRollBackToEmbedded,
135
- codeSigningKey: (_a = updateGroup[0].codeSigningInfo) === null || _a === void 0 ? void 0 : _a.keyid,
136
- group: updateGroup[0].group,
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
- var _a;
145
- return ({
146
- branch: updateGroup[0].branch.name,
147
- message: formatUpdateMessage(updateGroup[0]),
148
- runtimeVersion: updateGroup[0].runtimeVersion,
149
- isRollBackToEmbedded: updateGroup[0].isRollBackToEmbedded,
150
- codeSigningKey: (_a = updateGroup[0].codeSigningInfo) === null || _a === void 0 ? void 0 : _a.keyid,
151
- group: updateGroup[0].group,
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: (_a = latestUpdate.codeSigningInfo) === null || _a === void 0 ? void 0 : _a.keyid,
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
- var _a;
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
- var _a;
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
- var _a, _b;
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 (_b = (_a = json_file_1.default.read((0, paths_1.getStateJsonPath)())) === null || _a === void 0 ? void 0 : _a.auth) !== null && _b !== void 0 ? _b : null;
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 !== null && actor !== void 0 ? actor : undefined;
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 ((primaryDevice === null || primaryDevice === void 0 ? void 0 : primaryDevice.method) === UserSecondFactorDeviceMethod.AUTHENTICATOR) {
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
  }
@@ -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 === null || actor === void 0 ? void 0 : actor.__typename) {
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 === null || actor === void 0 ? void 0 : actor.__typename) {
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' && ((_a = request.url) === null || _a === void 0 ? void 0 : _a.includes('/auth/callback')))) {
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
- var _a, _b;
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 = (_b = config.updates) === null || _b === void 0 ? void 0 : _b.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 (_a = manifestPart === null || manifestPart === void 0 ? void 0 : manifestPart.body) !== null && _a !== void 0 ? _a : null;
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((_a = partialManifest.extra) === null || _a === void 0 ? void 0 : _a.expoClient)), (_b = manifestResponseBodyJSON.extra) === null || _b === void 0 ? void 0 : _b.expoClient);
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
  }