eas-cli 16.27.0 → 16.30.0

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 (357) hide show
  1. package/README.md +97 -94
  2. package/build/analytics/AnalyticsManager.js +4 -4
  3. package/build/analytics/common.js +1 -2
  4. package/build/api.js +5 -5
  5. package/build/branch/delete.d.ts +5 -0
  6. package/build/branch/delete.js +23 -0
  7. package/build/branch/queries.js +5 -5
  8. package/build/branch/utils.js +2 -2
  9. package/build/build/android/build.js +3 -4
  10. package/build/build/android/graphql.js +1 -2
  11. package/build/build/android/prepareJob.js +1 -2
  12. package/build/build/android/syncProjectConfiguration.js +2 -3
  13. package/build/build/android/version.js +6 -6
  14. package/build/build/build.js +3 -4
  15. package/build/build/configure.js +4 -5
  16. package/build/build/context.d.ts +1 -0
  17. package/build/build/createContext.js +2 -2
  18. package/build/build/evaluateConfigWithEnvVarsAsync.js +1 -2
  19. package/build/build/graphql.js +7 -7
  20. package/build/build/ios/build.js +2 -3
  21. package/build/build/ios/credentials.js +2 -3
  22. package/build/build/ios/graphql.js +2 -3
  23. package/build/build/ios/prepareJob.js +2 -3
  24. package/build/build/ios/syncProjectConfiguration.js +1 -2
  25. package/build/build/ios/version.js +10 -10
  26. package/build/build/local.js +2 -2
  27. package/build/build/metadata.js +3 -4
  28. package/build/build/queries.js +4 -4
  29. package/build/build/runBuildAndSubmit.js +12 -3
  30. package/build/build/utils/appJson.js +2 -3
  31. package/build/build/utils/credentials.js +1 -2
  32. package/build/build/utils/devClient.js +1 -2
  33. package/build/build/utils/formatBuild.js +2 -3
  34. package/build/build/utils/printBuildInfo.js +4 -5
  35. package/build/build/utils/repository.js +8 -9
  36. package/build/build/utils/resourceClass.js +1 -2
  37. package/build/build/utils/url.js +8 -9
  38. package/build/build/utils/version.js +2 -3
  39. package/build/build/validate.js +3 -4
  40. package/build/channel/branch-mapping.js +24 -24
  41. package/build/channel/delete.d.ts +5 -0
  42. package/build/channel/delete.js +23 -0
  43. package/build/channel/print-utils.js +2 -3
  44. package/build/channel/queries.js +8 -8
  45. package/build/channel/utils.js +1 -2
  46. package/build/commandUtils/builds.js +3 -4
  47. package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -2
  48. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +2 -3
  49. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +3 -4
  50. package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.js +1 -2
  51. package/build/commandUtils/experienceParser.d.ts +6 -0
  52. package/build/commandUtils/experienceParser.js +42 -0
  53. package/build/commandUtils/new/commands.js +3 -4
  54. package/build/commandUtils/new/configs.js +11 -9
  55. package/build/commandUtils/new/projectFiles.js +6 -7
  56. package/build/commandUtils/new/utils.js +1 -2
  57. package/build/commandUtils/projectNameValidation.d.ts +8 -0
  58. package/build/commandUtils/projectNameValidation.js +30 -0
  59. package/build/commandUtils/workflow/buildProfileUtils.js +12 -13
  60. package/build/commandUtils/workflow/creation.js +5 -5
  61. package/build/commandUtils/workflow/fetchLogs.js +2 -3
  62. package/build/commandUtils/workflow/inputs.js +5 -5
  63. package/build/commandUtils/workflow/stateMachine.js +7 -7
  64. package/build/commandUtils/workflow/utils.js +12 -12
  65. package/build/commandUtils/workflow/validation.js +4 -5
  66. package/build/commands/branch/delete.js +6 -20
  67. package/build/commands/build/cancel.js +1 -2
  68. package/build/commands/build/delete.js +1 -2
  69. package/build/commands/build/index.js +1 -10
  70. package/build/commands/channel/delete.js +7 -23
  71. package/build/commands/channel/edit.js +1 -2
  72. package/build/commands/channel/pause.js +1 -2
  73. package/build/commands/channel/resume.js +1 -2
  74. package/build/commands/deploy/index.js +1 -1
  75. package/build/commands/project/init.js +3 -1
  76. package/build/commands/project/new.js +3 -4
  77. package/build/commands/update/index.d.ts +8 -0
  78. package/build/commands/update/index.js +39 -2
  79. package/build/commands/update/list.d.ts +3 -0
  80. package/build/commands/update/list.js +30 -1
  81. package/build/commands/update/revert-update-rollout.js +1 -2
  82. package/build/credentials/android/actions/BuildCredentialsUtils.js +6 -7
  83. package/build/credentials/android/api/GraphqlClient.js +21 -21
  84. package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.d.ts +2 -2
  85. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +5 -5
  86. package/build/credentials/android/utils/googleServiceAccountKey.js +4 -4
  87. package/build/credentials/android/utils/keystore.js +2 -3
  88. package/build/credentials/android/utils/keystoreNew.js +3 -4
  89. package/build/credentials/android/utils/printCredentials.js +3 -4
  90. package/build/credentials/credentialsJson/read.js +3 -4
  91. package/build/credentials/credentialsJson/update.js +2 -3
  92. package/build/credentials/credentialsJson/utils.js +2 -3
  93. package/build/credentials/ios/actions/AppleTeamFormatting.js +1 -2
  94. package/build/credentials/ios/actions/AppleTeamUtils.js +1 -2
  95. package/build/credentials/ios/actions/AscApiKeyUtils.js +10 -10
  96. package/build/credentials/ios/actions/BuildCredentialsUtils.js +7 -8
  97. package/build/credentials/ios/actions/DeviceUtils.js +2 -3
  98. package/build/credentials/ios/actions/DistributionCertificateUtils.js +4 -5
  99. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +2 -3
  100. package/build/credentials/ios/actions/PushKeyUtils.js +5 -6
  101. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +2 -2
  102. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +6 -2
  103. package/build/credentials/ios/api/GraphqlClient.js +24 -25
  104. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +5 -5
  105. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +8 -8
  106. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.d.ts +5 -5
  107. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.d.ts +5 -5
  108. package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.d.ts +1 -1
  109. package/build/credentials/ios/appstore/AppStoreApi.d.ts +0 -2
  110. package/build/credentials/ios/appstore/Credentials.js +4 -5
  111. package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -1
  112. package/build/credentials/ios/appstore/CredentialsUtils.js +6 -7
  113. package/build/credentials/ios/appstore/ascApiKey.d.ts +0 -1
  114. package/build/credentials/ios/appstore/ascApiKey.js +6 -7
  115. package/build/credentials/ios/appstore/authenticate.d.ts +0 -1
  116. package/build/credentials/ios/appstore/authenticate.js +4 -5
  117. package/build/credentials/ios/appstore/authenticateTypes.d.ts +0 -1
  118. package/build/credentials/ios/appstore/bundleId.d.ts +0 -1
  119. package/build/credentials/ios/appstore/bundleId.js +2 -3
  120. package/build/credentials/ios/appstore/bundleIdCapabilities.d.ts +0 -1
  121. package/build/credentials/ios/appstore/bundleIdCapabilities.js +3 -3
  122. package/build/credentials/ios/appstore/capabilityIdentifiers.d.ts +0 -1
  123. package/build/credentials/ios/appstore/capabilityIdentifiers.js +1 -2
  124. package/build/credentials/ios/appstore/capabilityList.d.ts +0 -1
  125. package/build/credentials/ios/appstore/contractMessages.d.ts +0 -1
  126. package/build/credentials/ios/appstore/contractMessages.js +2 -3
  127. package/build/credentials/ios/appstore/distributionCertificate.d.ts +0 -1
  128. package/build/credentials/ios/appstore/distributionCertificate.js +7 -7
  129. package/build/credentials/ios/appstore/ensureAppExists.d.ts +6 -1
  130. package/build/credentials/ios/appstore/ensureAppExists.js +55 -18
  131. package/build/credentials/ios/appstore/ensureTestFlightGroup.d.ts +0 -1
  132. package/build/credentials/ios/appstore/ensureTestFlightGroup.js +1 -2
  133. package/build/credentials/ios/appstore/keychain.js +4 -4
  134. package/build/credentials/ios/appstore/provisioningProfile.d.ts +0 -1
  135. package/build/credentials/ios/appstore/provisioningProfile.js +5 -5
  136. package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +0 -1
  137. package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +1 -2
  138. package/build/credentials/ios/appstore/pushKey.js +4 -4
  139. package/build/credentials/ios/appstore/resolveCredentials.d.ts +0 -1
  140. package/build/credentials/ios/appstore/resolveCredentials.js +6 -7
  141. package/build/credentials/ios/credentials.d.ts +0 -1
  142. package/build/credentials/ios/credentials.js +2 -2
  143. package/build/credentials/ios/utils/authType.d.ts +0 -1
  144. package/build/credentials/ios/utils/authType.js +1 -2
  145. package/build/credentials/ios/utils/convertHTMLToASCII.js +1 -2
  146. package/build/credentials/ios/utils/p12Certificate.d.ts +0 -1
  147. package/build/credentials/ios/utils/p12Certificate.js +3 -4
  148. package/build/credentials/ios/utils/printCredentials.js +3 -4
  149. package/build/credentials/ios/utils/provisioningProfile.js +5 -6
  150. package/build/credentials/ios/validators/validateAscApiKey.js +2 -3
  151. package/build/credentials/ios/validators/validateDistributionCertificate.js +1 -2
  152. package/build/credentials/ios/validators/validateProvisioningProfile.js +1 -2
  153. package/build/credentials/ios/validators/validatePushKey.js +1 -2
  154. package/build/credentials/manager/IosActions.js +4 -4
  155. package/build/credentials/manager/SelectPlatform.js +1 -1
  156. package/build/credentials/utils/promptForCredentials.js +3 -4
  157. package/build/devices/actions/create/currentMachineMethod.js +1 -2
  158. package/build/devices/actions/create/developerPortalMethod.d.ts +0 -1
  159. package/build/devices/actions/create/developerPortalMethod.js +2 -3
  160. package/build/devices/actions/create/inputMethod.js +1 -2
  161. package/build/devices/actions/create/registrationUrlMethod.js +1 -2
  162. package/build/devices/actions/create/utils.js +4 -5
  163. package/build/devices/context.js +1 -2
  164. package/build/devices/queries.js +4 -4
  165. package/build/devices/udids.js +2 -3
  166. package/build/devices/utils/formatDevice.js +2 -3
  167. package/build/fetch.d.ts +0 -1
  168. package/build/fetch.js +1 -1
  169. package/build/fingerprint/cli.js +3 -4
  170. package/build/fingerprint/diff.js +1 -2
  171. package/build/fingerprint/types.d.ts +0 -1
  172. package/build/fingerprint/utils.js +4 -5
  173. package/build/graphql/client.js +2 -2
  174. package/build/graphql/generated.d.ts +331 -103
  175. package/build/graphql/generated.js +45 -3
  176. package/build/graphql/mutations/PublishMutation.d.ts +2 -2
  177. package/build/graphql/queries/AccountUsageQuery.d.ts +1 -1
  178. package/build/graphql/queries/AppVersionQuery.d.ts +1 -1
  179. package/build/graphql/queries/BackgroundJobReceiptQuery.d.ts +1 -1
  180. package/build/graphql/queries/BranchQuery.d.ts +3 -3
  181. package/build/graphql/queries/BuildQuery.d.ts +3 -3
  182. package/build/graphql/queries/ChannelQuery.d.ts +2 -2
  183. package/build/graphql/queries/ChannelQuery.js +2 -2
  184. package/build/graphql/queries/EnvironmentVariablesQuery.d.ts +12 -12
  185. package/build/graphql/queries/FingerprintQuery.d.ts +6 -6
  186. package/build/graphql/queries/PublishQuery.d.ts +1 -1
  187. package/build/graphql/queries/SubmissionQuery.d.ts +1 -1
  188. package/build/graphql/queries/UserQuery.d.ts +1 -1
  189. package/build/graphql/queries/WorkflowJobQuery.d.ts +2 -2
  190. package/build/graphql/queries/WorkflowRunQuery.d.ts +4 -4
  191. package/build/graphql/types/AppPlatform.js +2 -3
  192. package/build/log.js +2 -3
  193. package/build/metadata/apple/config/reader.d.ts +0 -1
  194. package/build/metadata/apple/config/writer.d.ts +0 -1
  195. package/build/metadata/apple/data.d.ts +0 -1
  196. package/build/metadata/apple/tasks/age-rating.d.ts +0 -1
  197. package/build/metadata/apple/tasks/age-rating.js +0 -1
  198. package/build/metadata/apple/tasks/app-info.d.ts +0 -1
  199. package/build/metadata/apple/tasks/app-info.js +15 -4
  200. package/build/metadata/apple/tasks/app-review-detail.d.ts +0 -1
  201. package/build/metadata/apple/tasks/app-review-detail.js +0 -1
  202. package/build/metadata/apple/tasks/app-version.d.ts +0 -1
  203. package/build/metadata/apple/tasks/app-version.js +15 -3
  204. package/build/metadata/apple/tasks/index.js +1 -2
  205. package/build/metadata/apple/types.d.ts +0 -1
  206. package/build/metadata/auth.d.ts +0 -1
  207. package/build/metadata/auth.js +1 -2
  208. package/build/metadata/config/resolve.js +4 -5
  209. package/build/metadata/config/validate.js +1 -2
  210. package/build/metadata/download.js +1 -2
  211. package/build/metadata/errors.js +3 -3
  212. package/build/metadata/upload.js +1 -2
  213. package/build/metadata/utils/ajv.js +2 -3
  214. package/build/metadata/utils/asc.d.ts +0 -1
  215. package/build/metadata/utils/date.js +1 -2
  216. package/build/metadata/utils/log.js +1 -2
  217. package/build/metadata/utils/retry.js +2 -3
  218. package/build/metadata/utils/telemetry.d.ts +0 -1
  219. package/build/metadata/utils/telemetry.js +2 -3
  220. package/build/onboarding/git.js +3 -4
  221. package/build/onboarding/installDependencies.js +3 -3
  222. package/build/onboarding/runCommand.js +1 -2
  223. package/build/ora.js +1 -2
  224. package/build/platform.d.ts +1 -0
  225. package/build/platform.js +28 -10
  226. package/build/project/android/applicationId.js +6 -6
  227. package/build/project/android/gradle.js +1 -2
  228. package/build/project/android/gradleUtils.js +4 -4
  229. package/build/project/android/versions.js +3 -3
  230. package/build/project/applicationIdentifier.js +1 -2
  231. package/build/project/customBuildConfig.js +3 -4
  232. package/build/project/expoConfig.js +5 -6
  233. package/build/project/expoSdk.js +1 -2
  234. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +2 -3
  235. package/build/project/ios/bundleIdentifier.js +6 -6
  236. package/build/project/ios/entitlements.js +2 -3
  237. package/build/project/ios/exemptEncryption.js +1 -2
  238. package/build/project/ios/scheme.js +2 -3
  239. package/build/project/ios/target.d.ts +0 -1
  240. package/build/project/ios/target.js +8 -9
  241. package/build/project/ios/versions.js +3 -3
  242. package/build/project/maybeUploadAssetMapAsync.js +1 -2
  243. package/build/project/maybeUploadFingerprintAsync.js +1 -2
  244. package/build/project/metroConfig.js +1 -2
  245. package/build/project/projectUtils.js +15 -16
  246. package/build/project/publish.d.ts +15 -2
  247. package/build/project/publish.js +56 -29
  248. package/build/project/remoteVersionSource.js +6 -6
  249. package/build/project/resolveRuntimeVersionAsync.js +2 -3
  250. package/build/project/uploadAccountScopedFileAsync.js +1 -2
  251. package/build/project/uploadAccountScopedProjectSourceAsync.js +1 -2
  252. package/build/project/workflow.js +3 -4
  253. package/build/prompts.js +5 -6
  254. package/build/rollout/branch-mapping.js +14 -15
  255. package/build/rollout/utils.js +5 -6
  256. package/build/run/android/aapt.js +2 -3
  257. package/build/run/android/adb.js +8 -9
  258. package/build/run/android/emulator.js +6 -6
  259. package/build/run/android/run.js +1 -2
  260. package/build/run/android/sdk.d.ts +0 -1
  261. package/build/run/android/sdk.js +2 -2
  262. package/build/run/android/systemRequirements.js +1 -2
  263. package/build/run/ios/run.js +1 -2
  264. package/build/run/ios/simctl.js +1 -2
  265. package/build/run/ios/simulator.js +9 -10
  266. package/build/run/ios/systemRequirements.js +1 -2
  267. package/build/run/ios/xcode.js +5 -5
  268. package/build/run/ios/xcrun.js +3 -4
  269. package/build/run/run.js +2 -3
  270. package/build/run/utils.js +1 -2
  271. package/build/submit/ArchiveSource.js +3 -3
  272. package/build/submit/android/ServiceAccountSource.js +4 -4
  273. package/build/submit/commons.js +2 -3
  274. package/build/submit/context.js +1 -2
  275. package/build/submit/ios/AppProduce.js +1 -2
  276. package/build/submit/ios/AppSpecificPasswordSource.js +3 -3
  277. package/build/submit/ios/AscApiKeySource.js +4 -4
  278. package/build/submit/ios/utils/language.js +1 -2
  279. package/build/submit/submit.js +3 -4
  280. package/build/submit/utils/builds.js +1 -2
  281. package/build/submit/utils/errors.js +1 -2
  282. package/build/submit/utils/files.js +2 -3
  283. package/build/submit/utils/logs.js +1 -2
  284. package/build/submit/utils/summary.js +2 -3
  285. package/build/submit/utils/urls.js +2 -3
  286. package/build/submit/utils/wait.js +2 -3
  287. package/build/update/android/UpdatesModule.js +2 -3
  288. package/build/update/configure.js +4 -4
  289. package/build/update/delete.js +1 -2
  290. package/build/update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.js +1 -2
  291. package/build/update/ios/UpdatesModule.js +2 -3
  292. package/build/update/queries.d.ts +5 -3
  293. package/build/update/queries.js +12 -9
  294. package/build/update/republish.js +5 -6
  295. package/build/update/roll-back-to-embedded.js +1 -2
  296. package/build/update/utils.js +15 -15
  297. package/build/uploads.js +3 -4
  298. package/build/user/User.js +2 -3
  299. package/build/user/actions.js +1 -2
  300. package/build/user/expoSsoLauncher.js +1 -2
  301. package/build/user/fetchSessionSecretAndSsoUser.js +1 -2
  302. package/build/user/fetchSessionSecretAndUser.js +1 -2
  303. package/build/user/fetchUser.js +1 -2
  304. package/build/utils/code-signing.d.ts +0 -1
  305. package/build/utils/code-signing.js +7 -8
  306. package/build/utils/date.js +1 -2
  307. package/build/utils/download.js +2 -3
  308. package/build/utils/expoCli.js +4 -4
  309. package/build/utils/expoUpdatesCli.js +2 -2
  310. package/build/utils/expodash/areSetsEqual.js +1 -1
  311. package/build/utils/expodash/capitalize.js +1 -1
  312. package/build/utils/expodash/chunk.js +1 -1
  313. package/build/utils/expodash/differenceBy.js +1 -1
  314. package/build/utils/expodash/filter.js +1 -2
  315. package/build/utils/expodash/groupBy.js +1 -1
  316. package/build/utils/expodash/intersection.js +1 -1
  317. package/build/utils/expodash/mapMapAsync.js +1 -1
  318. package/build/utils/expodash/memoize.js +1 -2
  319. package/build/utils/expodash/pick.js +1 -1
  320. package/build/utils/expodash/sortBy.js +1 -1
  321. package/build/utils/expodash/uniq.js +1 -1
  322. package/build/utils/expodash/uniqBy.js +1 -1
  323. package/build/utils/expodash/zipObject.js +1 -1
  324. package/build/utils/files.js +2 -3
  325. package/build/utils/formatFields.js +1 -1
  326. package/build/utils/image.js +3 -3
  327. package/build/utils/json.js +2 -3
  328. package/build/utils/plist.d.ts +0 -1
  329. package/build/utils/plist.js +3 -4
  330. package/build/utils/pollForBackgroundJobReceiptAsync.js +2 -2
  331. package/build/utils/profiles.js +3 -4
  332. package/build/utils/progress.js +1 -2
  333. package/build/utils/promise.js +1 -2
  334. package/build/utils/prompts.js +8 -9
  335. package/build/utils/queries.js +2 -3
  336. package/build/utils/relay.js +4 -4
  337. package/build/utils/statuspageService.js +1 -2
  338. package/build/utils/timer.js +4 -5
  339. package/build/utils/usage/checkForOverages.js +4 -6
  340. package/build/utils/variableUtils.js +4 -5
  341. package/build/vcs/clients/git.js +1 -2
  342. package/build/vcs/git.js +5 -6
  343. package/build/vcs/index.js +1 -2
  344. package/build/vcs/local.js +2 -2
  345. package/build/webhooks/formatWebhook.js +1 -2
  346. package/build/webhooks/input.js +3 -4
  347. package/build/worker/assets.d.ts +0 -1
  348. package/build/worker/assets.js +6 -7
  349. package/build/worker/deployment.js +8 -9
  350. package/build/worker/mutations.d.ts +1 -1
  351. package/build/worker/queries.d.ts +4 -4
  352. package/build/worker/upload.d.ts +0 -2
  353. package/build/worker/upload.js +5 -6
  354. package/build/worker/utils/logs.js +5 -5
  355. package/build/worker/utils/multipart.js +3 -3
  356. package/oclif.manifest.json +35 -1
  357. package/package.json +13 -11
@@ -1,13 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BranchMappingValidationError = exports.assertString = exports.assertNumber = exports.assertNodeObject = exports.assertStatement = exports.assertVersion = exports.hashLtOperator = exports.equalsOperator = exports.alwaysTrue = exports.isAlwaysTrue = exports.andStatement = exports.isNodeObject = exports.isStatement = exports.isAndStatement = exports.getNodesFromStatement = exports.getBranchMapping = exports.getBranchIds = exports.isAlwaysTrueBranchMapping = exports.isEmptyBranchMapping = exports.getStandardBranchId = exports.hasStandardBranchMap = exports.hasEmptyBranchMap = exports.getAlwaysTrueBranchMapping = exports.getEmptyBranchMapping = void 0;
3
+ exports.BranchMappingValidationError = void 0;
4
+ exports.getEmptyBranchMapping = getEmptyBranchMapping;
5
+ exports.getAlwaysTrueBranchMapping = getAlwaysTrueBranchMapping;
6
+ exports.hasEmptyBranchMap = hasEmptyBranchMap;
7
+ exports.hasStandardBranchMap = hasStandardBranchMap;
8
+ exports.getStandardBranchId = getStandardBranchId;
9
+ exports.isEmptyBranchMapping = isEmptyBranchMapping;
10
+ exports.isAlwaysTrueBranchMapping = isAlwaysTrueBranchMapping;
11
+ exports.getBranchIds = getBranchIds;
12
+ exports.getBranchMapping = getBranchMapping;
13
+ exports.getNodesFromStatement = getNodesFromStatement;
14
+ exports.isAndStatement = isAndStatement;
15
+ exports.isStatement = isStatement;
16
+ exports.isNodeObject = isNodeObject;
17
+ exports.andStatement = andStatement;
18
+ exports.isAlwaysTrue = isAlwaysTrue;
19
+ exports.alwaysTrue = alwaysTrue;
20
+ exports.equalsOperator = equalsOperator;
21
+ exports.hashLtOperator = hashLtOperator;
22
+ exports.assertVersion = assertVersion;
23
+ exports.assertStatement = assertStatement;
24
+ exports.assertNodeObject = assertNodeObject;
25
+ exports.assertNumber = assertNumber;
26
+ exports.assertString = assertString;
4
27
  function getEmptyBranchMapping() {
5
28
  return {
6
29
  version: 0,
7
30
  data: [],
8
31
  };
9
32
  }
10
- exports.getEmptyBranchMapping = getEmptyBranchMapping;
11
33
  function getAlwaysTrueBranchMapping(branchId) {
12
34
  return {
13
35
  version: 0,
@@ -19,27 +41,22 @@ function getAlwaysTrueBranchMapping(branchId) {
19
41
  ],
20
42
  };
21
43
  }
22
- exports.getAlwaysTrueBranchMapping = getAlwaysTrueBranchMapping;
23
44
  function hasEmptyBranchMap(channelInfo) {
24
45
  const branchMapping = getBranchMapping(channelInfo.branchMapping);
25
46
  return isEmptyBranchMapping(branchMapping);
26
47
  }
27
- exports.hasEmptyBranchMap = hasEmptyBranchMap;
28
48
  function hasStandardBranchMap(channelInfo) {
29
49
  const branchMapping = getBranchMapping(channelInfo.branchMapping);
30
50
  return isAlwaysTrueBranchMapping(branchMapping);
31
51
  }
32
- exports.hasStandardBranchMap = hasStandardBranchMap;
33
52
  function getStandardBranchId(channelInfo) {
34
53
  const branchMapping = getBranchMapping(channelInfo.branchMapping);
35
54
  assertAlwaysTrueBranchMapping(branchMapping);
36
55
  return getBranchIdFromStandardMapping(branchMapping);
37
56
  }
38
- exports.getStandardBranchId = getStandardBranchId;
39
57
  function isEmptyBranchMapping(branchMapping) {
40
58
  return branchMapping.data.length === 0;
41
59
  }
42
- exports.isEmptyBranchMapping = isEmptyBranchMapping;
43
60
  function isAlwaysTrueBranchMapping(branchMapping) {
44
61
  const numBranches = branchMapping.data.length;
45
62
  if (numBranches !== 1) {
@@ -48,14 +65,12 @@ function isAlwaysTrueBranchMapping(branchMapping) {
48
65
  const branchMappingLogic = branchMapping.data[0].branchMappingLogic;
49
66
  return isAlwaysTrue(branchMappingLogic);
50
67
  }
51
- exports.isAlwaysTrueBranchMapping = isAlwaysTrueBranchMapping;
52
68
  function getBranchIdFromStandardMapping(branchMapping) {
53
69
  return branchMapping.data[0].branchId;
54
70
  }
55
71
  function getBranchIds(branchMapping) {
56
72
  return branchMapping.data.map(data => data.branchId);
57
73
  }
58
- exports.getBranchIds = getBranchIds;
59
74
  function getBranchMapping(branchMappingString) {
60
75
  try {
61
76
  return JSON.parse(branchMappingString);
@@ -64,43 +79,33 @@ function getBranchMapping(branchMappingString) {
64
79
  throw new Error(`Could not parse branchMapping string into a JSON: "${branchMappingString}"`);
65
80
  }
66
81
  }
67
- exports.getBranchMapping = getBranchMapping;
68
82
  function getNodesFromStatement(statement) {
69
83
  return statement.slice(1);
70
84
  }
71
- exports.getNodesFromStatement = getNodesFromStatement;
72
85
  function isAndStatement(statement) {
73
86
  return statement[0] === 'and';
74
87
  }
75
- exports.isAndStatement = isAndStatement;
76
88
  function isStatement(node) {
77
89
  return Array.isArray(node);
78
90
  }
79
- exports.isStatement = isStatement;
80
91
  function isNodeObject(node) {
81
92
  return typeof node === 'object' && !isStatement(node);
82
93
  }
83
- exports.isNodeObject = isNodeObject;
84
94
  function andStatement(nodes) {
85
95
  return ['and', ...nodes];
86
96
  }
87
- exports.andStatement = andStatement;
88
97
  function isAlwaysTrue(node) {
89
98
  return node === 'true';
90
99
  }
91
- exports.isAlwaysTrue = isAlwaysTrue;
92
100
  function alwaysTrue() {
93
101
  return 'true';
94
102
  }
95
- exports.alwaysTrue = alwaysTrue;
96
103
  function equalsOperator() {
97
104
  return '==';
98
105
  }
99
- exports.equalsOperator = equalsOperator;
100
106
  function hashLtOperator() {
101
107
  return 'hash_lt';
102
108
  }
103
- exports.hashLtOperator = hashLtOperator;
104
109
  function isVersion(branchMapping, version) {
105
110
  return branchMapping.version === version;
106
111
  }
@@ -110,31 +115,26 @@ function assertVersion(channelInfo, version) {
110
115
  throw new BranchMappingValidationError(`Expected branch mapping version ${version}. Received: ${JSON.stringify(branchMapping)}`);
111
116
  }
112
117
  }
113
- exports.assertVersion = assertVersion;
114
118
  function assertStatement(node) {
115
119
  if (!isStatement(node)) {
116
120
  throw new BranchMappingValidationError('Branch mapping node must be a statement. Received: ' + JSON.stringify(node));
117
121
  }
118
122
  }
119
- exports.assertStatement = assertStatement;
120
123
  function assertNodeObject(node) {
121
124
  if (!isNodeObject(node)) {
122
125
  throw new BranchMappingValidationError('Branch mapping node must be an object. Received: ' + JSON.stringify(node));
123
126
  }
124
127
  }
125
- exports.assertNodeObject = assertNodeObject;
126
128
  function assertNumber(operand) {
127
129
  if (typeof operand !== 'number') {
128
130
  throw new BranchMappingValidationError('Expected a number. Received: ' + JSON.stringify(operand));
129
131
  }
130
132
  }
131
- exports.assertNumber = assertNumber;
132
133
  function assertString(operand) {
133
134
  if (typeof operand !== 'string') {
134
135
  throw new BranchMappingValidationError('Expected a string. Received: ' + JSON.stringify(operand));
135
136
  }
136
137
  }
137
- exports.assertString = assertString;
138
138
  function assertAlwaysTrueBranchMapping(branchMapping) {
139
139
  if (!isAlwaysTrueBranchMapping(branchMapping)) {
140
140
  throw new BranchMappingValidationError('Expected standard branch mapping. Received: ' + JSON.stringify(branchMapping));
@@ -0,0 +1,5 @@
1
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
2
+ import { BackgroundJobReceiptDataFragment } from '../graphql/generated';
3
+ export declare function scheduleChannelDeletionAsync(graphqlClient: ExpoGraphqlClient, { channelId, }: {
4
+ channelId: string;
5
+ }): Promise<BackgroundJobReceiptDataFragment>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scheduleChannelDeletionAsync = scheduleChannelDeletionAsync;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
+ const client_1 = require("../graphql/client");
7
+ const BackgroundJobReceipt_1 = require("../graphql/types/BackgroundJobReceipt");
8
+ async function scheduleChannelDeletionAsync(graphqlClient, { channelId, }) {
9
+ const result = await (0, client_1.withErrorHandlingAsync)(graphqlClient
10
+ .mutation((0, graphql_tag_1.default) `
11
+ mutation ScheduleChannelDeletion($channelId: ID!) {
12
+ updateChannel {
13
+ scheduleUpdateChannelDeletion(channelId: $channelId) {
14
+ id
15
+ ...BackgroundJobReceiptData
16
+ }
17
+ }
18
+ }
19
+ ${BackgroundJobReceipt_1.BackgroundJobReceiptNode}
20
+ `, { channelId })
21
+ .toPromise());
22
+ return result.updateChannel.scheduleUpdateChannelDeletion;
23
+ }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDescriptionByBranchId = exports.logChannelDetails = void 0;
3
+ exports.logChannelDetails = logChannelDetails;
4
+ exports.getDescriptionByBranchId = getDescriptionByBranchId;
4
5
  const tslib_1 = require("tslib");
5
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
7
  const branch_mapping_1 = require("./branch-mapping");
@@ -28,7 +29,6 @@ function logChannelDetails(channel) {
28
29
  .join(`\n\n${chalk_1.default.dim('———')}\n\n`));
29
30
  }
30
31
  }
31
- exports.logChannelDetails = logChannelDetails;
32
32
  function getDescriptionByBranchId(channel) {
33
33
  return channel.updateBranches.reduce((acc, branch) => {
34
34
  const maybeRollout = (0, branch_mapping_2.isRollout)(channel) ? (0, branch_mapping_2.getRollout)(channel) : null;
@@ -55,4 +55,3 @@ function getDescriptionByBranchId(channel) {
55
55
  return acc;
56
56
  }, {});
57
57
  }
58
- exports.getDescriptionByBranchId = getDescriptionByBranchId;
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAndLinkChannelAsync = exports.doesChannelExistAsync = exports.ensureChannelExistsAsync = exports.createChannelOnAppAsync = exports.listAndRenderBranchesAndUpdatesOnChannelAsync = exports.listAndRenderChannelsOnAppAsync = exports.selectChannelOnAppAsync = exports.CHANNELS_LIMIT = void 0;
3
+ exports.CHANNELS_LIMIT = void 0;
4
+ exports.selectChannelOnAppAsync = selectChannelOnAppAsync;
5
+ exports.listAndRenderChannelsOnAppAsync = listAndRenderChannelsOnAppAsync;
6
+ exports.listAndRenderBranchesAndUpdatesOnChannelAsync = listAndRenderBranchesAndUpdatesOnChannelAsync;
7
+ exports.createChannelOnAppAsync = createChannelOnAppAsync;
8
+ exports.ensureChannelExistsAsync = ensureChannelExistsAsync;
9
+ exports.doesChannelExistAsync = doesChannelExistAsync;
10
+ exports.createAndLinkChannelAsync = createAndLinkChannelAsync;
4
11
  const tslib_1 = require("tslib");
5
12
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
13
  const graphql_1 = require("graphql");
@@ -38,7 +45,6 @@ async function selectChannelOnAppAsync(graphqlClient, { projectId, selectionProm
38
45
  }
39
46
  return updateChannel;
40
47
  }
41
- exports.selectChannelOnAppAsync = selectChannelOnAppAsync;
42
48
  async function listAndRenderChannelsOnAppAsync(graphqlClient, { projectId, paginatedQueryOptions, }) {
43
49
  if (paginatedQueryOptions.nonInteractive) {
44
50
  const channels = await queryChannelsOnAppAsync(graphqlClient, {
@@ -62,7 +68,6 @@ async function listAndRenderChannelsOnAppAsync(graphqlClient, { projectId, pagin
62
68
  });
63
69
  }
64
70
  }
65
- exports.listAndRenderChannelsOnAppAsync = listAndRenderChannelsOnAppAsync;
66
71
  async function listAndRenderBranchesAndUpdatesOnChannelAsync(graphqlClient, { projectId: appId, channelName, paginatedQueryOptions, }) {
67
72
  const channel = await ChannelQuery_1.ChannelQuery.viewUpdateChannelAsync(graphqlClient, { appId, channelName });
68
73
  renderChannelHeaderContent({
@@ -98,7 +103,6 @@ async function listAndRenderBranchesAndUpdatesOnChannelAsync(graphqlClient, { pr
98
103
  });
99
104
  }
100
105
  }
101
- exports.listAndRenderBranchesAndUpdatesOnChannelAsync = listAndRenderBranchesAndUpdatesOnChannelAsync;
102
106
  async function queryChannelsOnAppAsync(graphqlClient, { appId, offset, limit }) {
103
107
  return await ChannelQuery_1.ChannelQuery.viewUpdateChannelsOnAppAsync(graphqlClient, {
104
108
  appId,
@@ -174,7 +178,6 @@ async function createChannelOnAppAsync(graphqlClient, { appId, branchId, channel
174
178
  })
175
179
  .toPromise());
176
180
  }
177
- exports.createChannelOnAppAsync = createChannelOnAppAsync;
178
181
  async function ensureChannelExistsAsync(graphqlClient, { appId, branchId, channelName }) {
179
182
  try {
180
183
  await createChannelOnAppAsync(graphqlClient, {
@@ -191,7 +194,6 @@ async function ensureChannelExistsAsync(graphqlClient, { appId, branchId, channe
191
194
  }
192
195
  }
193
196
  }
194
- exports.ensureChannelExistsAsync = ensureChannelExistsAsync;
195
197
  async function doesChannelExistAsync(graphqlClient, { appId, channelName }) {
196
198
  try {
197
199
  await ChannelQuery_1.ChannelQuery.viewUpdateChannelBasicInfoAsync(graphqlClient, {
@@ -207,7 +209,6 @@ async function doesChannelExistAsync(graphqlClient, { appId, channelName }) {
207
209
  }
208
210
  return true;
209
211
  }
210
- exports.doesChannelExistAsync = doesChannelExistAsync;
211
212
  /**
212
213
  * Creates a channel and links it to a branch with the same name.
213
214
  *
@@ -262,4 +263,3 @@ async function createAndLinkChannelAsync(graphqlClient, { appId, channelName, sh
262
263
  }
263
264
  return newChannel;
264
265
  }
265
- exports.createAndLinkChannelAsync = createAndLinkChannelAsync;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUpdateBranch = void 0;
3
+ exports.getUpdateBranch = getUpdateBranch;
4
4
  function getUpdateBranchNullable(channel, branchId) {
5
5
  const updateBranches = channel.updateBranches;
6
6
  const updateBranch = updateBranches.find(branch => branch.id === branchId);
@@ -13,4 +13,3 @@ function getUpdateBranch(channel, branchId) {
13
13
  }
14
14
  return updateBranch;
15
15
  }
16
- exports.getUpdateBranch = getUpdateBranch;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatBuild = exports.fetchBuildsAsync = exports.ensureBuildExistsAsync = void 0;
3
+ exports.ensureBuildExistsAsync = ensureBuildExistsAsync;
4
+ exports.fetchBuildsAsync = fetchBuildsAsync;
5
+ exports.formatBuild = formatBuild;
4
6
  const tslib_1 = require("tslib");
5
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
8
  const generated_1 = require("../graphql/generated");
@@ -18,7 +20,6 @@ async function ensureBuildExistsAsync(graphqlClient, buildId) {
18
20
  throw new Error(`Couldn't find a build matching the id ${buildId}`);
19
21
  }
20
22
  }
21
- exports.ensureBuildExistsAsync = ensureBuildExistsAsync;
22
23
  async function fetchBuildsAsync({ graphqlClient, projectId, filters, }) {
23
24
  let builds;
24
25
  const queryFilters = {};
@@ -53,7 +54,6 @@ async function fetchBuildsAsync({ graphqlClient, projectId, filters, }) {
53
54
  builds.sort((buildA, buildB) => (buildA.createdAt > buildB.createdAt ? -1 : 1));
54
55
  return builds;
55
56
  }
56
- exports.fetchBuildsAsync = fetchBuildsAsync;
57
57
  function formatBuild(build) {
58
58
  const platform = platform_1.appPlatformEmojis[build.platform];
59
59
  const startTime = new Date(build.createdAt).toLocaleString();
@@ -82,4 +82,3 @@ function formatBuild(build) {
82
82
  const status = chalk_1.default.blue(statusText);
83
83
  return `${platform} Started at: ${startTime}, Status: ${status}, Id: ${build.id}`;
84
84
  }
85
- exports.formatBuild = formatBuild;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createGraphqlClient = void 0;
3
+ exports.createGraphqlClient = createGraphqlClient;
4
4
  const tslib_1 = require("tslib");
5
5
  const core_1 = require("@urql/core");
6
6
  const exchange_retry_1 = require("@urql/exchange-retry");
@@ -39,4 +39,3 @@ function createGraphqlClient(authInfo) {
39
39
  },
40
40
  });
41
41
  }
42
- exports.createGraphqlClient = createGraphqlClient;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findProjectDirAndVerifyProjectSetupAsync = exports.findProjectRootAsync = void 0;
3
+ exports.findProjectRootAsync = findProjectRootAsync;
4
+ exports.findProjectDirAndVerifyProjectSetupAsync = findProjectDirAndVerifyProjectSetupAsync;
4
5
  const tslib_1 = require("tslib");
5
6
  const eas_json_1 = require("@expo/eas-json");
6
7
  const PackageManagerUtils = tslib_1.__importStar(require("@expo/package-manager"));
@@ -83,7 +84,6 @@ async function findProjectRootAsync({ cwd, defaultToProcessCwd = false, } = {})
83
84
  return projectRootDir;
84
85
  }
85
86
  }
86
- exports.findProjectRootAsync = findProjectRootAsync;
87
87
  let ranEnsureEasCliIsNotInDependencies = false;
88
88
  /**
89
89
  * Determine the project root directory and ensure some constraints about the project setup
@@ -101,4 +101,3 @@ async function findProjectDirAndVerifyProjectSetupAsync({ cwd, } = {}) {
101
101
  }
102
102
  return projectDir;
103
103
  }
104
- exports.findProjectDirAndVerifyProjectSetupAsync = findProjectDirAndVerifyProjectSetupAsync;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateOrSetProjectIdAsync = exports.getProjectIdAsync = exports.saveProjectIdToAppConfigAsync = void 0;
3
+ exports.saveProjectIdToAppConfigAsync = saveProjectIdToAppConfigAsync;
4
+ exports.getProjectIdAsync = getProjectIdAsync;
5
+ exports.validateOrSetProjectIdAsync = validateOrSetProjectIdAsync;
4
6
  const tslib_1 = require("tslib");
5
7
  const config_1 = require("@expo/config");
6
8
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
@@ -45,7 +47,6 @@ async function saveProjectIdToAppConfigAsync(projectDir, projectId, options = {}
45
47
  throw new Error('Unexpected result type from modifyConfigAsync');
46
48
  }
47
49
  }
48
- exports.saveProjectIdToAppConfigAsync = saveProjectIdToAppConfigAsync;
49
50
  /**
50
51
  * Get the EAS project ID from the app config. If the project ID is not set in the config,
51
52
  * use the owner/slug to identify an EAS project on the server (asking for confirmation first),
@@ -67,7 +68,6 @@ async function getProjectIdAsync(sessionManager, exp, options) {
67
68
  const projectId = await validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options });
68
69
  return projectId;
69
70
  }
70
- exports.getProjectIdAsync = getProjectIdAsync;
71
71
  async function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options, cwd, }) {
72
72
  const localProjectId = exp.extra?.eas?.projectId;
73
73
  if (localProjectId) {
@@ -135,4 +135,3 @@ async function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options,
135
135
  }
136
136
  return projectId;
137
137
  }
138
- exports.validateOrSetProjectIdAsync = validateOrSetProjectIdAsync;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadServerSideEnvironmentVariablesAsync = void 0;
3
+ exports.loadServerSideEnvironmentVariablesAsync = loadServerSideEnvironmentVariablesAsync;
4
4
  const tslib_1 = require("tslib");
5
5
  const EnvironmentVariablesQuery_1 = require("../../../graphql/queries/EnvironmentVariablesQuery");
6
6
  const log_1 = tslib_1.__importDefault(require("../../../log"));
@@ -28,4 +28,3 @@ async function loadServerSideEnvironmentVariablesAsync({ environment, projectId,
28
28
  cachedServerSideEnvironmentVariables[environment] = serverEnvVars;
29
29
  return serverEnvVars;
30
30
  }
31
- exports.loadServerSideEnvironmentVariablesAsync = loadServerSideEnvironmentVariablesAsync;
@@ -0,0 +1,6 @@
1
+ export declare const isValidExperienceName: (experienceName: string) => boolean;
2
+ export declare const experienceToAccountName: (experienceName: string) => string;
3
+ export declare const fullNameToSlug: (fullName: string) => string | null;
4
+ export declare const isValidSlugStrict: (slug: string) => boolean;
5
+ export declare const FORBIDDEN_NAMES: string[];
6
+ export declare function isSlugForbidden(slug: string): boolean;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FORBIDDEN_NAMES = exports.isValidSlugStrict = exports.fullNameToSlug = exports.experienceToAccountName = exports.isValidExperienceName = void 0;
4
+ exports.isSlugForbidden = isSlugForbidden;
5
+ const tslib_1 = require("tslib");
6
+ /**
7
+ * TODO: Move to eas-build repo
8
+ */
9
+ const invariant_1 = tslib_1.__importDefault(require("invariant"));
10
+ const EXPERIENCE_NAME_REGEX = /^@(.*?)\/(.*)/; // @<captureGroup1>/<captureGroup2>
11
+ const SLUG_REGEX_STRICT = /^[a-zA-Z0-9_\\-]+$/; // from xdl-schemas slug
12
+ const isValidExperienceName = (experienceName) => {
13
+ const matches = experienceName.match(EXPERIENCE_NAME_REGEX);
14
+ return matches !== null && matches[1].length > 0 && matches[2].length > 0;
15
+ };
16
+ exports.isValidExperienceName = isValidExperienceName;
17
+ const experienceToAccountName = (experienceName) => {
18
+ const matches = experienceName.match(EXPERIENCE_NAME_REGEX);
19
+ const accountName = matches ? matches[1] : null;
20
+ (0, invariant_1.default)(accountName, `The experience name "${experienceName}" is malformed`);
21
+ return accountName;
22
+ };
23
+ exports.experienceToAccountName = experienceToAccountName;
24
+ const fullNameToSlug = (fullName) => {
25
+ const match = fullName.match(EXPERIENCE_NAME_REGEX);
26
+ return match ? match[2] : null;
27
+ };
28
+ exports.fullNameToSlug = fullNameToSlug;
29
+ const isValidSlugStrict = (slug) => SLUG_REGEX_STRICT.test(slug);
30
+ exports.isValidSlugStrict = isValidSlugStrict;
31
+ // keep this list in sync with our project creation CLI https://github.com/expo/expo/blob/main/packages/create-expo/src/Template.ts
32
+ exports.FORBIDDEN_NAMES = [
33
+ 'react-native',
34
+ 'react',
35
+ 'react-dom',
36
+ 'react-native-web',
37
+ 'expo',
38
+ 'expo-router',
39
+ ];
40
+ function isSlugForbidden(slug) {
41
+ return exports.FORBIDDEN_NAMES.includes(slug);
42
+ }
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initializeGitRepositoryAsync = exports.installProjectDependenciesAsync = exports.cloneTemplateAsync = void 0;
3
+ exports.cloneTemplateAsync = cloneTemplateAsync;
4
+ exports.installProjectDependenciesAsync = installProjectDependenciesAsync;
5
+ exports.initializeGitRepositoryAsync = initializeGitRepositoryAsync;
4
6
  const tslib_1 = require("tslib");
5
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
8
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
@@ -30,7 +32,6 @@ async function cloneTemplateAsync(targetProjectDir) {
30
32
  spinner.succeed(`Cloned the project to ${(0, utils_1.printDirectory)(finalTargetProjectDirectory)}`);
31
33
  return finalTargetProjectDirectory;
32
34
  }
33
- exports.cloneTemplateAsync = cloneTemplateAsync;
34
35
  async function installProjectDependenciesAsync(projectDir, packageManager) {
35
36
  const spinner = (0, ora_1.ora)(`${chalk_1.default.bold('Installing project dependencies')}`).start();
36
37
  await (0, installDependencies_1.installDependenciesAsync)({
@@ -51,7 +52,6 @@ async function installProjectDependenciesAsync(projectDir, packageManager) {
51
52
  }
52
53
  spinner.succeed(`Installed project dependencies`);
53
54
  }
54
- exports.installProjectDependenciesAsync = installProjectDependenciesAsync;
55
55
  async function initializeGitRepositoryAsync(projectDir) {
56
56
  const spinner = (0, ora_1.ora)(`${chalk_1.default.bold('Initializing Git repository')}`).start();
57
57
  await fs_extra_1.default.remove(path_1.default.join(projectDir, '.git'));
@@ -67,4 +67,3 @@ async function initializeGitRepositoryAsync(projectDir) {
67
67
  }
68
68
  spinner.succeed(`Initialized Git repository`);
69
69
  }
70
- exports.initializeGitRepositoryAsync = initializeGitRepositoryAsync;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findAvailableProjectNameAsync = exports.getAccountChoices = exports.promptForProjectAccountAsync = exports.generateProjectConfigAsync = void 0;
3
+ exports.generateProjectConfigAsync = generateProjectConfigAsync;
4
+ exports.promptForProjectAccountAsync = promptForProjectAccountAsync;
5
+ exports.getAccountChoices = getAccountChoices;
6
+ exports.findAvailableProjectNameAsync = findAvailableProjectNameAsync;
4
7
  const tslib_1 = require("tslib");
5
8
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
6
9
  const nanoid_1 = require("nanoid");
@@ -49,7 +52,6 @@ async function generateProjectConfigAsync(pathArg, options) {
49
52
  projectDirectory,
50
53
  };
51
54
  }
52
- exports.generateProjectConfigAsync = generateProjectConfigAsync;
53
55
  function getAccountPermissionsMap(actor) {
54
56
  const permissionsMap = new Map();
55
57
  for (const account of actor.accounts) {
@@ -76,15 +78,17 @@ async function promptForProjectAccountAsync(actor) {
76
78
  choices: getAccountChoices(actor, permissionsMap),
77
79
  })).account.name;
78
80
  }
79
- exports.promptForProjectAccountAsync = promptForProjectAccountAsync;
80
81
  function getAccountChoices(actor, permissionsMap) {
81
82
  const permissions = permissionsMap ?? getAccountPermissionsMap(actor);
82
- const sortedAccounts = [...actor.accounts].sort((a, _b) => actor.__typename === 'User' ? (a.name === actor.username ? -1 : 1) : 0);
83
+ const sortedAccounts = [...actor.accounts].sort((a, _b) => (a.ownerUserActor ? 1 : -1));
83
84
  return sortedAccounts.map(account => {
84
- const isPersonalAccount = actor.__typename === 'User' && account.name === actor.username;
85
+ const isPersonalAccount = !!account.ownerUserActor && account.ownerUserActor.id === actor.id;
86
+ const isTeamAccount = !!account.ownerUserActor && account.ownerUserActor.id !== actor.id;
85
87
  const accountDisplayName = isPersonalAccount
86
- ? `${account.name} (personal account)`
87
- : account.name;
88
+ ? `${account.name} (Limited - Personal Account)`
89
+ : isTeamAccount
90
+ ? `${account.name} (Limited - Team Account)`
91
+ : account.name;
88
92
  const disabled = !permissions.get(account.name);
89
93
  return {
90
94
  title: accountDisplayName,
@@ -96,7 +100,6 @@ function getAccountChoices(actor, permissionsMap) {
96
100
  };
97
101
  });
98
102
  }
99
- exports.getAccountChoices = getAccountChoices;
100
103
  async function verifyProjectDoesNotExistAsync(graphqlClient, accountName, projectName, { silent = false } = {}) {
101
104
  const existingProjectId = await (0, fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1.findProjectIdByAccountNameAndSlugNullableAsync)(graphqlClient, accountName, projectName);
102
105
  const doesNotExist = existingProjectId === null;
@@ -124,4 +127,3 @@ async function findAvailableProjectNameAsync(baseName, parentDirectory, { graphq
124
127
  projectDirectory,
125
128
  };
126
129
  }
127
- exports.findAvailableProjectNameAsync = findAvailableProjectNameAsync;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateReadmeAsync = exports.copyProjectTemplatesAsync = exports.updatePackageJsonAsync = exports.generateEasConfigAsync = exports.generateAppConfigAsync = exports.cleanAndPrefix = void 0;
3
+ exports.cleanAndPrefix = cleanAndPrefix;
4
+ exports.generateAppConfigAsync = generateAppConfigAsync;
5
+ exports.generateEasConfigAsync = generateEasConfigAsync;
6
+ exports.updatePackageJsonAsync = updatePackageJsonAsync;
7
+ exports.copyProjectTemplatesAsync = copyProjectTemplatesAsync;
8
+ exports.updateReadmeAsync = updateReadmeAsync;
4
9
  const tslib_1 = require("tslib");
5
10
  const eas_json_1 = require("@expo/eas-json");
6
11
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
@@ -21,7 +26,6 @@ function cleanAndPrefix(_string, type) {
21
26
  const cleaned = string.replaceAll(pattern, '');
22
27
  return prefix + cleaned;
23
28
  }
24
- exports.cleanAndPrefix = cleanAndPrefix;
25
29
  async function generateAppConfigAsync(projectDir, app) {
26
30
  const user = cleanAndPrefix(app.ownerAccount.name, 'user');
27
31
  const slug = cleanAndPrefix(app.slug, 'app');
@@ -56,7 +60,6 @@ async function generateAppConfigAsync(projectDir, app) {
56
60
  const appJsonPath = path_1.default.join(projectDir, 'app.json');
57
61
  await fs_extra_1.default.writeJson(appJsonPath, { expo: mergedConfig }, { spaces: 2 });
58
62
  }
59
- exports.generateAppConfigAsync = generateAppConfigAsync;
60
63
  async function generateEasConfigAsync(projectDir) {
61
64
  const easBuildGitHubConfig = {
62
65
  android: {
@@ -101,7 +104,6 @@ async function generateEasConfigAsync(projectDir) {
101
104
  const easJsonPath = path_1.default.join(projectDir, 'eas.json');
102
105
  await fs_extra_1.default.writeJson(easJsonPath, easJson, { spaces: 2 });
103
106
  }
104
- exports.generateEasConfigAsync = generateEasConfigAsync;
105
107
  async function updatePackageJsonAsync(projectDir) {
106
108
  const packageJsonPath = path_1.default.join(projectDir, 'package.json');
107
109
  const packageJson = await fs_extra_1.default.readJson(packageJsonPath);
@@ -114,7 +116,6 @@ async function updatePackageJsonAsync(projectDir) {
114
116
  packageJson.scripts.deploy = 'npx eas-cli@latest workflow:run deploy-to-production.yml';
115
117
  await fs_extra_1.default.writeJson(packageJsonPath, packageJson, { spaces: 2 });
116
118
  }
117
- exports.updatePackageJsonAsync = updatePackageJsonAsync;
118
119
  async function copyProjectTemplatesAsync(projectDir) {
119
120
  const templatesSourceDir = path_1.default.join(__dirname, 'templates');
120
121
  // Copy everything from templates to projectDir, skipping readme-additions.md
@@ -126,7 +127,6 @@ async function copyProjectTemplatesAsync(projectDir) {
126
127
  },
127
128
  });
128
129
  }
129
- exports.copyProjectTemplatesAsync = copyProjectTemplatesAsync;
130
130
  async function updateReadmeAsync(projectDir, packageManager) {
131
131
  const readmeTemplatePath = path_1.default.join(__dirname, 'templates', 'readme-additions.md');
132
132
  const projectReadmePath = path_1.default.join(projectDir, 'README.md');
@@ -155,4 +155,3 @@ async function updateReadmeAsync(projectDir, packageManager) {
155
155
  mergedReadme = mergedReadme.replaceAll('npm run', `${packageManager} run`);
156
156
  await fs_extra_1.default.writeFile(projectReadmePath, mergedReadme);
157
157
  }
158
- exports.updateReadmeAsync = updateReadmeAsync;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.printDirectory = void 0;
3
+ exports.printDirectory = printDirectory;
4
4
  const tslib_1 = require("tslib");
5
5
  const path_1 = tslib_1.__importDefault(require("path"));
6
6
  /**
@@ -18,4 +18,3 @@ function printDirectory(directory) {
18
18
  }
19
19
  return absoluteDir;
20
20
  }
21
- exports.printDirectory = printDirectory;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Perform the same validation as the server, to avoid GraphQL errors.
3
+ */
4
+ export declare function validateFullNameAndSlug(fullName: string, slug: string): void;
5
+ /**
6
+ * Attempt to derive a valid slug name from the one passed in
7
+ */
8
+ export declare function validSlugName(slug: string): string;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateFullNameAndSlug = validateFullNameAndSlug;
4
+ exports.validSlugName = validSlugName;
5
+ const experienceParser_1 = require("./experienceParser");
6
+ /**
7
+ * Perform the same validation as the server, to avoid GraphQL errors.
8
+ */
9
+ function validateFullNameAndSlug(fullName, slug) {
10
+ if (!(0, experienceParser_1.isValidExperienceName)(fullName)) {
11
+ throw new Error(`Invalid project name: ${fullName}`);
12
+ }
13
+ if (!(0, experienceParser_1.isValidSlugStrict)(slug)) {
14
+ throw new Error(`Invalid slug: ${slug}`);
15
+ }
16
+ if ((0, experienceParser_1.isSlugForbidden)(slug)) {
17
+ throw new Error(`Cannot create an app named "${slug}" because it would conflict with a dependency of the same name.`);
18
+ }
19
+ if (fullName.length > 255) {
20
+ throw new Error(`Project full name (${fullName}) can not be longer than 255 characters.`);
21
+ }
22
+ }
23
+ /**
24
+ * Attempt to derive a valid slug name from the one passed in
25
+ */
26
+ function validSlugName(slug) {
27
+ const chars = slug.split('');
28
+ const validChars = chars.filter(char => (0, experienceParser_1.isValidSlugStrict)(char));
29
+ return validChars.join('');
30
+ }