eas-cli 2.1.0 → 2.2.1

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 (300) hide show
  1. package/README.md +179 -133
  2. package/build/branch/queries.d.ts +10 -2
  3. package/build/branch/queries.js +30 -30
  4. package/build/branch/utils.d.ts +4 -0
  5. package/build/branch/utils.js +15 -0
  6. package/build/build/android/build.js +3 -3
  7. package/build/build/android/prepareJob.js +1 -2
  8. package/build/build/android/syncProjectConfiguration.d.ts +2 -1
  9. package/build/build/android/syncProjectConfiguration.js +2 -2
  10. package/build/build/build.js +15 -4
  11. package/build/build/configure.js +2 -2
  12. package/build/build/createContext.d.ts +5 -1
  13. package/build/build/createContext.js +8 -14
  14. package/build/build/ios/build.js +2 -1
  15. package/build/build/ios/credentials.js +1 -1
  16. package/build/build/ios/prepareJob.js +1 -2
  17. package/build/build/ios/syncProjectConfiguration.d.ts +2 -1
  18. package/build/build/ios/syncProjectConfiguration.js +2 -2
  19. package/build/build/local.js +1 -1
  20. package/build/build/metadata.js +1 -2
  21. package/build/build/queries.d.ts +9 -0
  22. package/build/build/queries.js +51 -0
  23. package/build/build/runBuildAndSubmit.d.ts +3 -1
  24. package/build/build/runBuildAndSubmit.js +15 -7
  25. package/build/build/utils/repository.js +5 -1
  26. package/build/channel/queries.d.ts +17 -0
  27. package/build/channel/queries.js +137 -0
  28. package/build/channel/utils.d.ts +22 -0
  29. package/build/channel/utils.js +87 -0
  30. package/build/commandUtils/EasCommand.d.ts +68 -7
  31. package/build/commandUtils/EasCommand.js +60 -79
  32. package/build/commandUtils/context/ActorContextField.d.ts +5 -0
  33. package/build/commandUtils/context/ActorContextField.js +11 -0
  34. package/build/commandUtils/context/ContextField.d.ts +6 -0
  35. package/build/commandUtils/context/ContextField.js +5 -0
  36. package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +11 -0
  37. package/build/commandUtils/context/DynamicProjectConfigContextField.js +27 -0
  38. package/build/commandUtils/context/OptionalProjectConfigContextField.d.ts +13 -0
  39. package/build/commandUtils/context/OptionalProjectConfigContextField.js +37 -0
  40. package/build/commandUtils/context/ProjectConfigContextField.d.ts +13 -0
  41. package/build/commandUtils/context/ProjectConfigContextField.js +23 -0
  42. package/build/commandUtils/context/ProjectDirContextField.d.ts +4 -0
  43. package/build/commandUtils/context/ProjectDirContextField.js +11 -0
  44. package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.d.ts +21 -0
  45. package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.js +75 -0
  46. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.d.ts +17 -0
  47. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +102 -0
  48. package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +24 -0
  49. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +108 -0
  50. package/build/commandUtils/flags.d.ts +10 -0
  51. package/build/commandUtils/flags.js +23 -0
  52. package/build/commandUtils/pagination.d.ts +7 -4
  53. package/build/commandUtils/pagination.js +11 -15
  54. package/build/commands/account/login.d.ts +0 -2
  55. package/build/commands/account/login.js +2 -7
  56. package/build/commands/account/logout.d.ts +0 -2
  57. package/build/commands/account/logout.js +0 -5
  58. package/build/commands/account/view.d.ts +0 -2
  59. package/build/commands/account/view.js +0 -5
  60. package/build/commands/analytics.d.ts +0 -1
  61. package/build/commands/analytics.js +0 -4
  62. package/build/commands/branch/create.d.ts +4 -0
  63. package/build/commands/branch/create.js +18 -18
  64. package/build/commands/branch/delete.d.ts +4 -0
  65. package/build/commands/branch/delete.js +29 -26
  66. package/build/commands/branch/list.d.ts +5 -2
  67. package/build/commands/branch/list.js +13 -8
  68. package/build/commands/branch/rename.d.ts +5 -1
  69. package/build/commands/branch/rename.js +15 -13
  70. package/build/commands/branch/view.d.ts +5 -2
  71. package/build/commands/branch/view.js +31 -13
  72. package/build/commands/build/cancel.d.ts +7 -0
  73. package/build/commands/build/cancel.js +50 -23
  74. package/build/commands/build/configure.d.ts +3 -0
  75. package/build/commands/build/configure.js +12 -7
  76. package/build/commands/build/index.d.ts +7 -2
  77. package/build/commands/build/index.js +31 -23
  78. package/build/commands/build/inspect.d.ts +5 -0
  79. package/build/commands/build/inspect.js +12 -3
  80. package/build/commands/build/list.d.ts +7 -2
  81. package/build/commands/build/list.js +36 -59
  82. package/build/commands/build/version/set.d.ts +5 -0
  83. package/build/commands/build/version/set.js +22 -14
  84. package/build/commands/build/version/sync.d.ts +5 -0
  85. package/build/commands/build/version/sync.js +22 -13
  86. package/build/commands/build/view.d.ts +3 -0
  87. package/build/commands/build/view.js +20 -14
  88. package/build/commands/channel/create.d.ts +4 -0
  89. package/build/commands/channel/create.js +32 -25
  90. package/build/commands/channel/delete.d.ts +3 -0
  91. package/build/commands/channel/delete.js +36 -59
  92. package/build/commands/channel/edit.d.ts +7 -7
  93. package/build/commands/channel/edit.js +39 -72
  94. package/build/commands/channel/list.d.ts +6 -0
  95. package/build/commands/channel/list.js +20 -76
  96. package/build/commands/channel/rollout.d.ts +5 -1
  97. package/build/commands/channel/rollout.js +34 -35
  98. package/build/commands/channel/view.d.ts +6 -33
  99. package/build/commands/channel/view.js +31 -132
  100. package/build/commands/config.d.ts +6 -2
  101. package/build/commands/config.js +22 -13
  102. package/build/commands/credentials.d.ts +4 -0
  103. package/build/commands/credentials.js +10 -1
  104. package/build/commands/device/create.d.ts +4 -0
  105. package/build/commands/device/create.js +15 -3
  106. package/build/commands/device/delete.d.ts +13 -8
  107. package/build/commands/device/delete.js +81 -130
  108. package/build/commands/device/list.d.ts +7 -0
  109. package/build/commands/device/list.js +42 -63
  110. package/build/commands/device/view.d.ts +3 -0
  111. package/build/commands/device/view.js +10 -5
  112. package/build/commands/diagnostics.d.ts +3 -1
  113. package/build/commands/diagnostics.js +10 -8
  114. package/build/commands/metadata/pull.d.ts +4 -0
  115. package/build/commands/metadata/pull.js +13 -8
  116. package/build/commands/metadata/push.d.ts +4 -0
  117. package/build/commands/metadata/push.js +13 -8
  118. package/build/commands/open.d.ts +3 -0
  119. package/build/commands/open.js +11 -9
  120. package/build/commands/project/info.d.ts +3 -0
  121. package/build/commands/project/info.js +9 -6
  122. package/build/commands/project/init.d.ts +12 -0
  123. package/build/commands/project/init.js +155 -8
  124. package/build/commands/secret/create.d.ts +6 -0
  125. package/build/commands/secret/create.js +88 -30
  126. package/build/commands/secret/delete.d.ts +4 -0
  127. package/build/commands/secret/delete.js +28 -19
  128. package/build/commands/secret/list.d.ts +3 -0
  129. package/build/commands/secret/list.js +19 -13
  130. package/build/commands/submit.d.ts +5 -0
  131. package/build/commands/submit.js +16 -7
  132. package/build/commands/update/configure.d.ts +3 -0
  133. package/build/commands/update/configure.js +22 -16
  134. package/build/commands/update/delete.d.ts +1 -0
  135. package/build/commands/update/delete.js +4 -7
  136. package/build/commands/update/index.d.ts +8 -12
  137. package/build/commands/update/index.js +90 -166
  138. package/build/commands/update/list.d.ts +8 -2
  139. package/build/commands/update/list.js +51 -81
  140. package/build/commands/update/view.d.ts +0 -4
  141. package/build/commands/update/view.js +14 -51
  142. package/build/commands/webhook/create.d.ts +4 -0
  143. package/build/commands/webhook/create.js +10 -5
  144. package/build/commands/webhook/delete.d.ts +6 -0
  145. package/build/commands/webhook/delete.js +26 -14
  146. package/build/commands/webhook/list.d.ts +3 -0
  147. package/build/commands/webhook/list.js +13 -9
  148. package/build/commands/webhook/update.d.ts +1 -0
  149. package/build/commands/webhook/update.js +3 -1
  150. package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -6
  151. package/build/credentials/android/actions/CreateFcm.d.ts +2 -3
  152. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +2 -3
  153. package/build/credentials/android/actions/CreateKeystore.d.ts +2 -3
  154. package/build/credentials/android/actions/CreateKeystore.js +1 -2
  155. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -3
  156. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +2 -3
  157. package/build/credentials/android/api/GraphqlClient.d.ts +6 -7
  158. package/build/credentials/context.d.ts +8 -4
  159. package/build/credentials/context.js +8 -23
  160. package/build/credentials/ios/IosCredentialsProvider.js +11 -6
  161. package/build/credentials/ios/actions/AppleTeamFormatting.d.ts +2 -0
  162. package/build/credentials/ios/actions/AppleTeamFormatting.js +7 -0
  163. package/build/credentials/ios/actions/AppleTeamUtils.d.ts +1 -2
  164. package/build/credentials/ios/actions/AppleTeamUtils.js +1 -5
  165. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +3 -4
  166. package/build/credentials/ios/actions/AscApiKeyUtils.js +2 -2
  167. package/build/credentials/ios/actions/AssignAscApiKey.d.ts +1 -1
  168. package/build/credentials/ios/actions/AssignPushKey.d.ts +1 -1
  169. package/build/credentials/ios/actions/BuildCredentialsUtils.d.ts +3 -3
  170. package/build/credentials/ios/actions/BuildCredentialsUtils.js +8 -12
  171. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +1 -1
  172. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
  173. package/build/credentials/ios/actions/CreateAscApiKey.d.ts +2 -3
  174. package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +2 -2
  175. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +1 -1
  176. package/build/credentials/ios/actions/CreatePushKey.d.ts +2 -3
  177. package/build/credentials/ios/actions/DeviceUtils.d.ts +0 -1
  178. package/build/credentials/ios/actions/DeviceUtils.js +3 -19
  179. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +3 -4
  180. package/build/credentials/ios/actions/DistributionCertificateUtils.js +2 -2
  181. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +1 -1
  182. package/build/credentials/ios/actions/PushKeyUtils.d.ts +2 -3
  183. package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
  184. package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -3
  185. package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -4
  186. package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +1 -1
  187. package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -3
  188. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +1 -1
  189. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +1 -1
  190. package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +1 -1
  191. package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +1 -1
  192. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +1 -1
  193. package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +1 -1
  194. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +1 -1
  195. package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
  196. package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +1 -1
  197. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +1 -1
  198. package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +1 -1
  199. package/build/credentials/ios/api/GraphqlClient.d.ts +9 -15
  200. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +2 -3
  201. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +3 -1
  202. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +3 -3
  203. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +20 -6
  204. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +2 -2
  205. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +8 -7
  206. package/build/credentials/ios/api/graphql/types/AppLookupParams.d.ts +7 -0
  207. package/build/credentials/ios/api/graphql/types/AppLookupParams.js +2 -0
  208. package/build/credentials/ios/types.d.ts +2 -3
  209. package/build/credentials/ios/utils/printCredentials.d.ts +1 -1
  210. package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +1 -1
  211. package/build/credentials/ios/validators/validateProvisioningProfile.js +1 -1
  212. package/build/credentials/manager/HelperActions.d.ts +4 -1
  213. package/build/credentials/manager/ManageAndroid.js +4 -14
  214. package/build/credentials/manager/ManageIos.js +12 -15
  215. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +1 -1
  216. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -3
  217. package/build/credentials/manager/SelectPlatform.d.ts +5 -1
  218. package/build/credentials/manager/SelectPlatform.js +5 -3
  219. package/build/devices/actions/create/action.d.ts +2 -3
  220. package/build/devices/context.d.ts +3 -5
  221. package/build/devices/context.js +2 -11
  222. package/build/devices/manager.d.ts +4 -5
  223. package/build/devices/manager.js +9 -16
  224. package/build/devices/queries.d.ts +21 -0
  225. package/build/devices/queries.js +121 -0
  226. package/build/devices/utils/errors.d.ts +3 -0
  227. package/build/devices/utils/errors.js +9 -0
  228. package/build/devices/utils/formatDevice.d.ts +3 -3
  229. package/build/devices/utils/formatDevice.js +8 -3
  230. package/build/graphql/generated.d.ts +1101 -191
  231. package/build/graphql/generated.js +13 -2
  232. package/build/graphql/mutations/EnvironmentSecretMutation.d.ts +3 -1
  233. package/build/graphql/queries/AppQuery.d.ts +1 -0
  234. package/build/graphql/queries/AppQuery.js +19 -0
  235. package/build/graphql/queries/BranchQuery.d.ts +5 -6
  236. package/build/graphql/queries/BranchQuery.js +44 -3
  237. package/build/graphql/queries/BuildQuery.d.ts +2 -20
  238. package/build/graphql/queries/BuildQuery.js +2 -2
  239. package/build/graphql/queries/ChannelQuery.d.ts +5 -2
  240. package/build/graphql/queries/ChannelQuery.js +45 -19
  241. package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +5 -3
  242. package/build/graphql/queries/EnvironmentSecretsQuery.js +14 -28
  243. package/build/graphql/queries/UpdateQuery.d.ts +4 -6
  244. package/build/graphql/queries/UpdateQuery.js +59 -50
  245. package/build/graphql/queries/UserQuery.js +8 -1
  246. package/build/graphql/types/Account.d.ts +1 -0
  247. package/build/graphql/types/Account.js +17 -0
  248. package/build/graphql/types/App.js +7 -0
  249. package/build/graphql/types/EnvironmentSecret.d.ts +7 -0
  250. package/build/graphql/types/EnvironmentSecret.js +16 -1
  251. package/build/graphql/types/Update.d.ts +1 -0
  252. package/build/graphql/types/Update.js +30 -0
  253. package/build/graphql/types/UpdateBranch.js +4 -15
  254. package/build/metadata/context.d.ts +1 -1
  255. package/build/metadata/context.js +7 -9
  256. package/build/project/android/applicationId.d.ts +2 -1
  257. package/build/project/android/applicationId.js +7 -7
  258. package/build/project/android/versions.js +1 -1
  259. package/build/project/applicationIdentifier.d.ts +2 -1
  260. package/build/project/applicationIdentifier.js +2 -2
  261. package/build/project/expoConfig.d.ts +3 -3
  262. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.d.ts +22 -0
  263. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +93 -0
  264. package/build/project/ios/bundleIdentifier.d.ts +2 -1
  265. package/build/project/ios/bundleIdentifier.js +7 -7
  266. package/build/project/ios/scheme.d.ts +1 -1
  267. package/build/project/ios/target.d.ts +17 -2
  268. package/build/project/ios/target.js +51 -4
  269. package/build/project/projectUtils.d.ts +4 -31
  270. package/build/project/projectUtils.js +13 -123
  271. package/build/project/remoteVersionSource.d.ts +2 -2
  272. package/build/project/remoteVersionSource.js +8 -7
  273. package/build/submit/android/ServiceAccountSource.js +1 -2
  274. package/build/submit/context.d.ts +3 -1
  275. package/build/submit/context.js +12 -14
  276. package/build/submit/ios/CredentialsServiceSource.js +1 -2
  277. package/build/submit/utils/builds.js +3 -1
  278. package/build/update/android/UpdatesModule.d.ts +1 -1
  279. package/build/update/android/UpdatesModule.js +2 -3
  280. package/build/update/ios/UpdatesModule.d.ts +1 -1
  281. package/build/update/ios/UpdatesModule.js +2 -3
  282. package/build/update/queries.d.ts +16 -1
  283. package/build/update/queries.js +96 -30
  284. package/build/update/utils.d.ts +21 -8
  285. package/build/update/utils.js +75 -14
  286. package/build/user/actions.d.ts +2 -8
  287. package/build/user/actions.js +4 -63
  288. package/build/utils/profiles.d.ts +3 -3
  289. package/build/utils/profiles.js +6 -5
  290. package/build/vcs/clients/git.d.ts +1 -1
  291. package/build/vcs/clients/git.js +1 -1
  292. package/build/vcs/vcs.d.ts +1 -1
  293. package/build/webhooks/input.d.ts +2 -1
  294. package/build/webhooks/input.js +10 -1
  295. package/oclif.manifest.json +1 -1
  296. package/package.json +4 -4
  297. package/build/project/ensureProjectExists.d.ts +0 -21
  298. package/build/project/ensureProjectExists.js +0 -88
  299. package/build/user/Account.d.ts +0 -3
  300. package/build/user/Account.js +0 -7
@@ -1,33 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installExpoUpdatesAsync = exports.validateAppVersionRuntimePolicySupportAsync = exports.isExpoUpdatesInstalledOrAvailable = exports.isExpoUpdatesInstalled = exports.getProjectConfigDescription = exports.getProjectFullNameAsync = exports.getProjectIdAsync = exports.fetchProjectIdFromServerAsync = exports.saveProjectIdToAppConfigAsync = exports.findProjectRootAsync = exports.getProjectAccountNameAsync = exports.getUsername = exports.getProjectAccountName = void 0;
3
+ exports.getDisplayNameForProjectIdAsync = exports.getOwnerAccountForProjectIdAsync = exports.installExpoUpdatesAsync = exports.validateAppVersionRuntimePolicySupportAsync = exports.isExpoUpdatesInstalledOrAvailable = exports.isExpoUpdatesInstalled = exports.getProjectConfigDescription = exports.toAppPrivacy = exports.getUsername = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
8
8
  const path_1 = tslib_1.__importDefault(require("path"));
9
- const pkg_dir_1 = tslib_1.__importDefault(require("pkg-dir"));
10
9
  const resolve_from_1 = tslib_1.__importDefault(require("resolve-from"));
11
10
  const semver_1 = tslib_1.__importDefault(require("semver"));
12
11
  const generated_1 = require("../graphql/generated");
12
+ const AppQuery_1 = require("../graphql/queries/AppQuery");
13
13
  const log_1 = tslib_1.__importDefault(require("../log"));
14
- const actions_1 = require("../user/actions");
15
14
  const expoCli_1 = require("../utils/expoCli");
16
- const vcs_1 = require("../vcs");
17
- const ensureProjectExists_1 = require("./ensureProjectExists");
18
- const expoConfig_1 = require("./expoConfig");
19
- function getProjectAccountName(exp, user) {
20
- switch (user.__typename) {
21
- case 'User':
22
- return exp.owner || user.username;
23
- case 'Robot':
24
- if (!exp.owner) {
25
- throw new Error('The "owner" manifest property is required when using robot users. See: https://docs.expo.dev/versions/latest/config/app/#owner');
26
- }
27
- return exp.owner;
28
- }
29
- }
30
- exports.getProjectAccountName = getProjectAccountName;
31
15
  function getUsername(exp, user) {
32
16
  switch (user.__typename) {
33
17
  case 'User':
@@ -42,106 +26,6 @@ function getUsername(exp, user) {
42
26
  }
43
27
  }
44
28
  exports.getUsername = getUsername;
45
- async function getProjectAccountNameAsync(exp) {
46
- const user = await (0, actions_1.ensureLoggedInAsync)();
47
- return getProjectAccountName(exp, user);
48
- }
49
- exports.getProjectAccountNameAsync = getProjectAccountNameAsync;
50
- async function findProjectRootAsync({ cwd, defaultToProcessCwd = false, } = {}) {
51
- const projectRootDir = await (0, pkg_dir_1.default)(cwd);
52
- if (!projectRootDir) {
53
- if (!defaultToProcessCwd) {
54
- throw new Error('Run this command inside a project directory.');
55
- }
56
- else {
57
- return process.cwd();
58
- }
59
- }
60
- else {
61
- let vcsRoot;
62
- try {
63
- vcsRoot = path_1.default.normalize(await (0, vcs_1.getVcsClient)().getRootPathAsync());
64
- }
65
- catch { }
66
- if (vcsRoot && vcsRoot.startsWith(projectRootDir) && vcsRoot !== projectRootDir) {
67
- throw new Error(`package.json is outside of the current git repository (project root: ${projectRootDir}, git root: ${vcsRoot}.`);
68
- }
69
- return projectRootDir;
70
- }
71
- }
72
- exports.findProjectRootAsync = findProjectRootAsync;
73
- /**
74
- * Save an EAS project ID to the appropriate field in the app config.
75
- */
76
- async function saveProjectIdToAppConfigAsync(projectDir, projectId, options = {}) {
77
- var _a;
78
- const exp = (0, expoConfig_1.getExpoConfig)(projectDir, options);
79
- const result = await (0, config_1.modifyConfigAsync)(projectDir, {
80
- extra: { ...exp.extra, eas: { ...(_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas, projectId } },
81
- });
82
- switch (result.type) {
83
- case 'success':
84
- break;
85
- case 'warn': {
86
- log_1.default.warn();
87
- log_1.default.warn(`Warning: Your project uses dynamic app configuration, and the EAS project ID can't automatically be added to it.`);
88
- log_1.default.warn(chalk_1.default.dim('https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs'));
89
- log_1.default.warn();
90
- log_1.default.warn(`To complete the setup process, set the ${chalk_1.default.bold('extra.eas.projectId')} in your ${chalk_1.default.bold(getProjectConfigDescription(projectDir))}:`);
91
- log_1.default.warn();
92
- log_1.default.warn(chalk_1.default.bold(JSON.stringify({ expo: { extra: { eas: { projectId } } } }, null, 2)));
93
- log_1.default.warn();
94
- throw new Error(result.message);
95
- }
96
- case 'fail':
97
- throw new Error(result.message);
98
- default:
99
- throw new Error('Unexpected result type from modifyConfigAsync');
100
- }
101
- }
102
- exports.saveProjectIdToAppConfigAsync = saveProjectIdToAppConfigAsync;
103
- /**
104
- * Use the owner/slug to identify an EAS project on the server.
105
- *
106
- * @returns the EAS project ID from the server
107
- */
108
- async function fetchProjectIdFromServerAsync(exp) {
109
- const privacy = toAppPrivacy(exp.privacy);
110
- return await (0, ensureProjectExists_1.ensureProjectExistsAsync)({
111
- accountName: getProjectAccountName(exp, await (0, actions_1.ensureLoggedInAsync)()),
112
- projectName: exp.slug,
113
- privacy,
114
- });
115
- }
116
- exports.fetchProjectIdFromServerAsync = fetchProjectIdFromServerAsync;
117
- /**
118
- * Get the EAS project ID from the app config. If the project ID is not set in the config.
119
- * use the owner/slug to identify an EAS project on the server, and attempt to save the
120
- * EAS project ID to the appropriate field in the app config.
121
- */
122
- async function getProjectIdAsync(exp, options = {}, findProjectRootOptions = {}) {
123
- var _a, _b;
124
- const localProjectId = (_b = (_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas) === null || _b === void 0 ? void 0 : _b.projectId;
125
- if (localProjectId) {
126
- return localProjectId;
127
- }
128
- const projectDir = await findProjectRootAsync(findProjectRootOptions);
129
- if (!projectDir) {
130
- throw new Error('Run this command inside a project directory.');
131
- }
132
- const projectId = await fetchProjectIdFromServerAsync(exp);
133
- try {
134
- await saveProjectIdToAppConfigAsync(projectDir, projectId, options);
135
- }
136
- catch (e) {
137
- // saveProjectIdToAppConfigAsync already printed out a set of detailed errors and
138
- // instructions on how to fix it. To mimic throwing the error but not halting
139
- // execution, just warn here with the error message.
140
- log_1.default.warn(e.message);
141
- }
142
- return projectId;
143
- }
144
- exports.getProjectIdAsync = getProjectIdAsync;
145
29
  const toAppPrivacy = (privacy) => {
146
30
  if (privacy === 'public') {
147
31
  return generated_1.AppPrivacy.Public;
@@ -153,11 +37,7 @@ const toAppPrivacy = (privacy) => {
153
37
  return generated_1.AppPrivacy.Unlisted;
154
38
  }
155
39
  };
156
- async function getProjectFullNameAsync(exp) {
157
- const accountName = await getProjectAccountNameAsync(exp);
158
- return `@${accountName}/${exp.slug}`;
159
- }
160
- exports.getProjectFullNameAsync = getProjectFullNameAsync;
40
+ exports.toAppPrivacy = toAppPrivacy;
161
41
  /**
162
42
  * Return a useful name describing the project config.
163
43
  * - dynamic: app.config.js
@@ -216,3 +96,13 @@ async function installExpoUpdatesAsync(projectDir) {
216
96
  log_1.default.newLine();
217
97
  }
218
98
  exports.installExpoUpdatesAsync = installExpoUpdatesAsync;
99
+ async function getOwnerAccountForProjectIdAsync(projectId) {
100
+ const app = await AppQuery_1.AppQuery.byIdAsync(projectId);
101
+ return app.ownerAccount;
102
+ }
103
+ exports.getOwnerAccountForProjectIdAsync = getOwnerAccountForProjectIdAsync;
104
+ async function getDisplayNameForProjectIdAsync(projectId) {
105
+ const app = await AppQuery_1.AppQuery.byIdAsync(projectId);
106
+ return app.fullName;
107
+ }
108
+ exports.getDisplayNameForProjectIdAsync = getDisplayNameForProjectIdAsync;
@@ -1,8 +1,8 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Platform } from '@expo/eas-build-job';
3
- import { EasJson, EasJsonReader } from '@expo/eas-json';
3
+ import { EasJson, EasJsonAccessor } from '@expo/eas-json';
4
4
  import { ProfileData } from '../utils/profiles';
5
- export declare function ensureVersionSourceIsRemoteAsync(projectDir: string, easJsonReader: EasJsonReader): Promise<void>;
5
+ export declare function ensureVersionSourceIsRemoteAsync(easJsonAccessor: EasJsonAccessor): Promise<void>;
6
6
  export declare function validateBuildProfileVersionSettings(profileInfo: ProfileData<'build'>, cliConfig: EasJson['cli']): void;
7
7
  export declare function validateAppConfigForRemoteVersionSource(exp: ExpoConfig, platform: Platform): void;
8
8
  export declare function getBuildVersionName(platform: Platform): string;
@@ -5,11 +5,10 @@ const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const eas_json_1 = require("@expo/eas-json");
7
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
9
8
  const log_1 = tslib_1.__importDefault(require("../log"));
10
9
  const prompts_1 = require("../prompts");
11
- async function ensureVersionSourceIsRemoteAsync(projectDir, easJsonReader) {
12
- const easJsonCliConfig = await easJsonReader.getCliConfigAsync();
10
+ async function ensureVersionSourceIsRemoteAsync(easJsonAccessor) {
11
+ const easJsonCliConfig = await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor);
13
12
  if ((easJsonCliConfig === null || easJsonCliConfig === void 0 ? void 0 : easJsonCliConfig.appVersionSource) === eas_json_1.AppVersionSource.REMOTE) {
14
13
  return;
15
14
  }
@@ -21,10 +20,12 @@ async function ensureVersionSourceIsRemoteAsync(projectDir, easJsonReader) {
21
20
  if (!confirm) {
22
21
  throw new Error('Aborting...');
23
22
  }
24
- const easJsonPath = eas_json_1.EasJsonReader.formatEasJsonPath(projectDir);
25
- const easJson = await fs_extra_1.default.readJSON(easJsonPath);
26
- easJson.cli = { ...easJson === null || easJson === void 0 ? void 0 : easJson.cli, appVersionSource: eas_json_1.AppVersionSource.REMOTE };
27
- await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
23
+ await easJsonAccessor.readRawJsonAsync();
24
+ easJsonAccessor.patch(easJsonRawObject => {
25
+ easJsonRawObject.cli = { ...easJsonRawObject === null || easJsonRawObject === void 0 ? void 0 : easJsonRawObject.cli, appVersionSource: eas_json_1.AppVersionSource.REMOTE };
26
+ return easJsonRawObject;
27
+ });
28
+ await easJsonAccessor.writeAsync();
28
29
  log_1.default.withTick('Updated eas.json');
29
30
  }
30
31
  exports.ensureVersionSourceIsRemoteAsync = ensureVersionSourceIsRemoteAsync;
@@ -10,7 +10,6 @@ const googleServiceAccountKey_1 = require("../../credentials/android/utils/googl
10
10
  const log_1 = tslib_1.__importStar(require("../../log"));
11
11
  const applicationId_1 = require("../../project/android/applicationId");
12
12
  const prompts_1 = require("../../prompts");
13
- const Account_1 = require("../../user/Account");
14
13
  const files_1 = require("../utils/files");
15
14
  var ServiceAccountSourceType;
16
15
  (function (ServiceAccountSourceType) {
@@ -63,7 +62,7 @@ async function promptForApplicationIdAsync() {
63
62
  async function getServiceAccountFromCredentialsServiceAsync(ctx, source) {
64
63
  var _a;
65
64
  const appLookupParams = {
66
- account: (0, nullthrows_1.default)((0, Account_1.findAccountByName)(ctx.user.accounts, ctx.accountName), `You do not have access to account: ${ctx.accountName}`),
65
+ account: (0, nullthrows_1.default)(ctx.user.accounts.find(a => a.name === ctx.accountName), `You do not have access to account: ${ctx.accountName}`),
67
66
  projectName: ctx.projectName,
68
67
  androidApplicationIdentifier: (_a = source.androidApplicationIdentifier) !== null && _a !== void 0 ? _a : (await promptForApplicationIdAsync()),
69
68
  };
@@ -33,6 +33,8 @@ export declare function createSubmissionContextAsync<T extends Platform>(params:
33
33
  platform: T;
34
34
  profile: SubmitProfile<T>;
35
35
  projectDir: string;
36
- projectId: string;
37
36
  applicationIdentifier?: string;
37
+ actor: Actor;
38
+ exp: ExpoConfig;
39
+ projectId: string;
38
40
  }): Promise<SubmissionContext<T>>;
@@ -4,37 +4,35 @@ exports.createSubmissionContextAsync = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  const events_1 = require("../analytics/events");
6
6
  const context_1 = require("../credentials/context");
7
- const expoConfig_1 = require("../project/expoConfig");
8
7
  const projectUtils_1 = require("../project/projectUtils");
9
- const Account_1 = require("../user/Account");
10
- const actions_1 = require("../user/actions");
11
8
  async function createSubmissionContextAsync(params) {
12
- var _a;
13
- const { applicationIdentifier, projectDir, nonInteractive } = params;
14
- const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: params.env });
9
+ const { applicationIdentifier, projectDir, nonInteractive, actor, exp, projectId } = params;
15
10
  const { env, ...rest } = params;
16
- const user = await (0, actions_1.ensureLoggedInAsync)();
17
11
  const projectName = exp.slug;
18
- const accountName = (0, projectUtils_1.getProjectAccountName)(exp, user);
19
- const accountId = (_a = (0, Account_1.findAccountByName)(user.accounts, accountName)) === null || _a === void 0 ? void 0 : _a.id;
12
+ const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
13
+ const accountId = account.id;
20
14
  let credentialsCtx = params.credentialsCtx;
21
15
  if (!credentialsCtx) {
22
- credentialsCtx = new context_1.CredentialsContext({ projectDir, user, exp, nonInteractive });
16
+ credentialsCtx = new context_1.CredentialsContext({
17
+ projectDir,
18
+ user: actor,
19
+ projectInfo: { exp, projectId },
20
+ nonInteractive,
21
+ });
23
22
  }
24
23
  const trackingCtx = {
25
24
  tracking_id: (0, uuid_1.v4)(),
26
25
  platform: params.platform,
27
26
  ...(accountId && { account_id: accountId }),
28
- project_id: params.projectId,
27
+ project_id: projectId,
29
28
  };
30
29
  events_1.Analytics.logEvent(events_1.SubmissionEvent.SUBMIT_COMMAND, trackingCtx);
31
30
  return {
32
31
  ...rest,
33
- accountName,
32
+ accountName: account.name,
34
33
  credentialsCtx,
35
- exp,
36
34
  projectName,
37
- user,
35
+ user: actor,
38
36
  trackingCtx,
39
37
  applicationIdentifierOverride: applicationIdentifier,
40
38
  };
@@ -7,7 +7,6 @@ const SetUpSubmissionCredentials_1 = require("../../credentials/ios/actions/SetU
7
7
  const log_1 = tslib_1.__importDefault(require("../../log"));
8
8
  const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
9
9
  const prompts_1 = require("../../prompts");
10
- const Account_1 = require("../../user/Account");
11
10
  const AppSpecificPasswordSource_1 = require("./AppSpecificPasswordSource");
12
11
  /**
13
12
  * The Credentials Service will either return an ASC API Key or an App Specific Password
@@ -28,7 +27,7 @@ async function getFromCredentialsServiceAsync(ctx, source) {
28
27
  const bundleIdentifier = (_a = source.bundleIdentifier) !== null && _a !== void 0 ? _a : (await promptForBundleIdentifierAsync());
29
28
  log_1.default.log(`Looking up credentials configuration for ${bundleIdentifier}...`);
30
29
  const appLookupParams = {
31
- account: (0, nullthrows_1.default)((0, Account_1.findAccountByName)(ctx.user.accounts, ctx.accountName), `You do not have access to account: ${ctx.accountName}`),
30
+ account: (0, nullthrows_1.default)(ctx.user.accounts.find(a => a.name === ctx.accountName), `You do not have access to account: ${ctx.accountName}`),
32
31
  projectName: ctx.projectName,
33
32
  bundleIdentifier,
34
33
  };
@@ -4,8 +4,10 @@ exports.getRecentBuildsForSubmissionAsync = void 0;
4
4
  const generated_1 = require("../../graphql/generated");
5
5
  const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
6
6
  async function getRecentBuildsForSubmissionAsync(platform, appId, { limit = 1 } = {}) {
7
- return await BuildQuery_1.BuildQuery.allForAppAsync(appId, {
7
+ return await BuildQuery_1.BuildQuery.viewBuildsOnAppAsync({
8
+ appId,
8
9
  limit,
10
+ offset: 0,
9
11
  filter: {
10
12
  platform,
11
13
  distribution: generated_1.DistributionType.Store,
@@ -1,4 +1,4 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- export declare function syncUpdatesConfigurationAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
2
+ export declare function syncUpdatesConfigurationAsync(projectDir: string, exp: ExpoConfig, projectId: string): Promise<void>;
3
3
  export declare function readReleaseChannelSafelyAsync(projectDir: string): Promise<string | null>;
4
4
  export declare function readChannelSafelyAsync(projectDir: string): Promise<string | null>;
@@ -4,11 +4,10 @@ exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports
4
4
  const config_plugins_1 = require("@expo/config-plugins");
5
5
  const platform_1 = require("../../platform");
6
6
  const projectUtils_1 = require("../../project/projectUtils");
7
- const actions_1 = require("../../user/actions");
8
7
  const utils_1 = require("../utils");
9
- async function syncUpdatesConfigurationAsync(projectDir, exp) {
8
+ async function syncUpdatesConfigurationAsync(projectDir, exp, projectId) {
10
9
  (0, utils_1.ensureValidVersions)(exp, platform_1.RequestedPlatform.Android);
11
- const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
10
+ const accountName = (await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId)).name;
12
11
  const androidManifestPath = await config_plugins_1.AndroidConfig.Paths.getAndroidManifestAsync(projectDir);
13
12
  const androidManifest = await getAndroidManifestAsync(projectDir);
14
13
  const updatedAndroidManifest = config_plugins_1.AndroidConfig.Updates.setUpdatesConfig(projectDir, exp, androidManifest, accountName);
@@ -1,4 +1,4 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- export declare function syncUpdatesConfigurationAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
2
+ export declare function syncUpdatesConfigurationAsync(projectDir: string, exp: ExpoConfig, projectId: string): Promise<void>;
3
3
  export declare function readReleaseChannelSafelyAsync(projectDir: string): Promise<string | null>;
4
4
  export declare function readChannelSafelyAsync(projectDir: string): Promise<string | null>;
@@ -4,13 +4,12 @@ exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports
4
4
  const config_plugins_1 = require("@expo/config-plugins");
5
5
  const platform_1 = require("../../platform");
6
6
  const projectUtils_1 = require("../../project/projectUtils");
7
- const actions_1 = require("../../user/actions");
8
7
  const plist_1 = require("../../utils/plist");
9
8
  const vcs_1 = require("../../vcs");
10
9
  const utils_1 = require("../utils");
11
- async function syncUpdatesConfigurationAsync(projectDir, exp) {
10
+ async function syncUpdatesConfigurationAsync(projectDir, exp, projectId) {
12
11
  (0, utils_1.ensureValidVersions)(exp, platform_1.RequestedPlatform.Ios);
13
- const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
12
+ const accountName = (await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId)).name;
14
13
  const expoPlist = await readExpoPlistAsync(projectDir);
15
14
  const updatedExpoPlist = config_plugins_1.IOSConfig.Updates.setUpdatesConfig(projectDir, exp, expoPlist, accountName);
16
15
  await writeExpoPlistAsync(projectDir, updatedExpoPlist);
@@ -1,3 +1,18 @@
1
1
  import { PaginatedQueryOptions } from '../commandUtils/pagination';
2
+ import { UpdateFragment } from '../graphql/generated';
2
3
  export declare const UPDATES_LIMIT = 50;
3
- export declare function listAndRenderUpdatesOnBranchByNameAsync(projectId: string, branchName: string, options: PaginatedQueryOptions): Promise<void>;
4
+ export declare const UPDATE_GROUPS_LIMIT = 25;
5
+ export declare function listAndRenderUpdateGroupsOnAppAsync({ projectId, paginatedQueryOptions, }: {
6
+ projectId: string;
7
+ paginatedQueryOptions: PaginatedQueryOptions;
8
+ }): Promise<void>;
9
+ export declare function listAndRenderUpdateGroupsOnBranchAsync({ projectId, branchName, paginatedQueryOptions, }: {
10
+ projectId: string;
11
+ branchName: string;
12
+ paginatedQueryOptions: PaginatedQueryOptions;
13
+ }): Promise<void>;
14
+ export declare function selectUpdateGroupOnBranchAsync({ projectId, branchName, paginatedQueryOptions, }: {
15
+ projectId: string;
16
+ branchName: string;
17
+ paginatedQueryOptions: PaginatedQueryOptions;
18
+ }): Promise<UpdateFragment[]>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listAndRenderUpdatesOnBranchByNameAsync = exports.UPDATES_LIMIT = void 0;
3
+ exports.selectUpdateGroupOnBranchAsync = exports.listAndRenderUpdateGroupsOnBranchAsync = exports.listAndRenderUpdateGroupsOnAppAsync = exports.UPDATE_GROUPS_LIMIT = exports.UPDATES_LIMIT = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const assert_1 = tslib_1.__importDefault(require("assert"));
5
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
7
  const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
7
8
  const UpdateQuery_1 = require("../graphql/queries/UpdateQuery");
@@ -11,55 +12,101 @@ const json_1 = require("../utils/json");
11
12
  const queries_1 = require("../utils/queries");
12
13
  const utils_1 = require("./utils");
13
14
  exports.UPDATES_LIMIT = 50;
14
- async function listAndRenderUpdatesOnBranchByNameAsync(projectId, branchName, options) {
15
+ exports.UPDATE_GROUPS_LIMIT = 25;
16
+ async function listAndRenderUpdateGroupsOnAppAsync({ projectId, paginatedQueryOptions, }) {
15
17
  var _a, _b;
16
- if (options.nonInteractive) {
17
- const updates = await queryUpdateGroupsForBranchAsync((_a = options.limit) !== null && _a !== void 0 ? _a : exports.UPDATES_LIMIT, options.offset, projectId, branchName);
18
- renderUpdateGroups(updates, options, branchName);
18
+ if (paginatedQueryOptions.nonInteractive) {
19
+ const updateGroups = await queryUpdateGroupsOnAppAsync({
20
+ limit: (_a = paginatedQueryOptions.limit) !== null && _a !== void 0 ? _a : exports.UPDATE_GROUPS_LIMIT,
21
+ offset: paginatedQueryOptions.offset,
22
+ appId: projectId,
23
+ });
24
+ renderUpdateGroupsOnAppAsTable(updateGroups, paginatedQueryOptions);
19
25
  }
20
26
  else {
21
27
  await (0, queries_1.paginatedQueryWithConfirmPromptAsync)({
22
- limit: (_b = options.limit) !== null && _b !== void 0 ? _b : exports.UPDATES_LIMIT,
23
- offset: options.offset,
24
- queryToPerform: (limit, offset) => queryUpdateGroupsForBranchAsync(limit, offset, projectId, branchName),
28
+ limit: (_b = paginatedQueryOptions.limit) !== null && _b !== void 0 ? _b : exports.UPDATE_GROUPS_LIMIT,
29
+ offset: paginatedQueryOptions.offset,
30
+ queryToPerform: (limit, offset) => queryUpdateGroupsOnAppAsync({ limit, offset, appId: projectId }),
25
31
  promptOptions: {
26
- title: 'Load more branches?',
27
- renderListItems: updates => renderUpdateGroups(updates, options, branchName),
32
+ title: 'Load more update groups?',
33
+ renderListItems: updateGroups => renderUpdateGroupsOnAppAsTable(updateGroups, paginatedQueryOptions),
28
34
  },
29
35
  });
30
36
  }
31
37
  }
32
- exports.listAndRenderUpdatesOnBranchByNameAsync = listAndRenderUpdatesOnBranchByNameAsync;
33
- async function queryUpdateGroupsForBranchAsync(limit, offset, projectId, branchName) {
34
- const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
35
- appId: projectId,
36
- name: branchName,
37
- limit,
38
- offset,
38
+ exports.listAndRenderUpdateGroupsOnAppAsync = listAndRenderUpdateGroupsOnAppAsync;
39
+ async function listAndRenderUpdateGroupsOnBranchAsync({ projectId, branchName, paginatedQueryOptions, }) {
40
+ var _a, _b;
41
+ if (paginatedQueryOptions.nonInteractive) {
42
+ const updateGroups = await queryUpdateGroupsOnBranchAsync({
43
+ limit: (_a = paginatedQueryOptions.limit) !== null && _a !== void 0 ? _a : exports.UPDATE_GROUPS_LIMIT,
44
+ offset: paginatedQueryOptions.offset,
45
+ appId: projectId,
46
+ branchName,
47
+ });
48
+ renderUpdateGroupsOnBranchAsTable({ updateGroups, branchName, paginatedQueryOptions });
49
+ }
50
+ else {
51
+ await (0, queries_1.paginatedQueryWithConfirmPromptAsync)({
52
+ limit: (_b = paginatedQueryOptions.limit) !== null && _b !== void 0 ? _b : exports.UPDATE_GROUPS_LIMIT,
53
+ offset: paginatedQueryOptions.offset,
54
+ queryToPerform: (limit, offset) => queryUpdateGroupsOnBranchAsync({ limit, offset, appId: projectId, branchName }),
55
+ promptOptions: {
56
+ title: 'Load more update groups?',
57
+ renderListItems: updateGroups => renderUpdateGroupsOnBranchAsTable({ updateGroups, branchName, paginatedQueryOptions }),
58
+ },
59
+ });
60
+ }
61
+ }
62
+ exports.listAndRenderUpdateGroupsOnBranchAsync = listAndRenderUpdateGroupsOnBranchAsync;
63
+ async function selectUpdateGroupOnBranchAsync({ projectId, branchName, paginatedQueryOptions, }) {
64
+ var _a;
65
+ if (paginatedQueryOptions.nonInteractive) {
66
+ throw new Error('Unable to select an update in non-interactive mode.');
67
+ }
68
+ const updateGroup = await (0, queries_1.paginatedQueryWithSelectPromptAsync)({
69
+ limit: (_a = paginatedQueryOptions.limit) !== null && _a !== void 0 ? _a : exports.UPDATE_GROUPS_LIMIT,
70
+ offset: paginatedQueryOptions.offset,
71
+ queryToPerform: (limit, offset) => queryUpdateGroupsOnBranchAsync({ appId: projectId, branchName, limit, offset }),
72
+ promptOptions: {
73
+ title: 'Load more update groups?',
74
+ createDisplayTextForSelectionPromptListItem: updateGroup => (0, utils_1.formatUpdateTitle)(updateGroup[0]),
75
+ getIdentifierForQueryItem: updateGroup => updateGroup[0].group,
76
+ },
39
77
  });
40
- const updateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
41
- if (!updateBranch) {
42
- throw new Error(`Could not find branch "${branchName}"`);
78
+ if (!updateGroup || updateGroup.length === 0) {
79
+ throw new Error(`Could not find any branches for project "${projectId}"`);
43
80
  }
44
- return updateBranch.updates;
81
+ return updateGroup;
82
+ }
83
+ exports.selectUpdateGroupOnBranchAsync = selectUpdateGroupOnBranchAsync;
84
+ async function queryUpdateGroupsOnBranchAsync(args) {
85
+ return await UpdateQuery_1.UpdateQuery.viewUpdateGroupsOnBranchAsync(args);
86
+ }
87
+ async function queryUpdateGroupsOnAppAsync(args) {
88
+ return await UpdateQuery_1.UpdateQuery.viewUpdateGroupsOnAppAsync(args);
45
89
  }
46
- function renderUpdateGroups(updates, { json }, branchName) {
90
+ function renderUpdateGroupsOnBranchAsTable({ updateGroups, branchName, paginatedQueryOptions: { json }, }) {
47
91
  var _a, _b;
48
- const branch = { name: branchName, id: (_b = (_a = updates[0]) === null || _a === void 0 ? void 0 : _a.branch.id) !== null && _b !== void 0 ? _b : 'N/A' };
92
+ const branchNames = updateGroups.flatMap(updateGroup => updateGroup.map(update => update.branch.name));
93
+ (0, assert_1.default)(branchNames.every(name => name === branchName), 'Each update must belong to the same branch.');
94
+ const branch = {
95
+ name: branchName,
96
+ id: (_b = (_a = updateGroups[0]) === null || _a === void 0 ? void 0 : _a[0].branch.id) !== null && _b !== void 0 ? _b : 'N/A',
97
+ };
98
+ const updateGroupDescriptions = (0, utils_1.getUpdateGroupDescriptions)(updateGroups);
49
99
  if (json) {
50
- (0, json_1.printJsonOnlyOutput)({ ...branch, currentPage: updates });
100
+ (0, json_1.printJsonOnlyOutput)({ ...branch, currentPage: updateGroupDescriptions });
51
101
  }
52
102
  else {
53
103
  const updateGroupsTable = new cli_table3_1.default({
54
104
  head: utils_1.UPDATE_COLUMNS,
55
105
  wordWrap: true,
56
106
  });
57
- updateGroupsTable.push(...(0, utils_1.getUpdateGroupsWithPlatforms)(updates).map(update => [
58
- (0, utils_1.formatUpdate)(update),
59
- update.runtimeVersion,
60
- update.group,
61
- update.platforms,
62
- ]));
107
+ updateGroupDescriptions.forEach(({ message, runtimeVersion, group, platforms }) => {
108
+ updateGroupsTable.push([message, runtimeVersion, group, platforms]);
109
+ });
63
110
  log_1.default.addNewLineIfNone();
64
111
  log_1.default.log(chalk_1.default.bold('Branch:'));
65
112
  log_1.default.log((0, formatFields_1.default)([
@@ -70,3 +117,22 @@ function renderUpdateGroups(updates, { json }, branchName) {
70
117
  log_1.default.log(updateGroupsTable.toString());
71
118
  }
72
119
  }
120
+ function renderUpdateGroupsOnAppAsTable(updateGroups, { json }) {
121
+ const updateGroupDescriptions = (0, utils_1.getUpdateGroupDescriptionsWithBranch)(updateGroups);
122
+ if (json) {
123
+ (0, json_1.printJsonOnlyOutput)({ currentPage: updateGroupDescriptions });
124
+ }
125
+ else {
126
+ const updateGroupsTable = new cli_table3_1.default({
127
+ head: utils_1.UPDATE_COLUMNS_WITH_BRANCH,
128
+ wordWrap: true,
129
+ });
130
+ updateGroupDescriptions.forEach(({ branch, message, runtimeVersion, group, platforms }) => {
131
+ updateGroupsTable.push([branch, message, runtimeVersion, group, platforms]);
132
+ });
133
+ log_1.default.addNewLineIfNone();
134
+ log_1.default.log(chalk_1.default.bold('Recent update groups:'));
135
+ log_1.default.addNewLineIfNone();
136
+ log_1.default.log(updateGroupsTable.toString());
137
+ }
138
+ }
@@ -1,6 +1,7 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- import { Maybe, Robot, Update, User } from '../graphql/generated';
2
+ import { Maybe, Robot, Update, UpdateFragment, User } from '../graphql/generated';
3
3
  import { RequestedPlatform } from '../platform';
4
+ import { ProfileData } from '../utils/profiles';
4
5
  export declare type FormatUpdateParameter = Pick<Update, 'id' | 'createdAt' | 'message'> & {
5
6
  actor?: Maybe<Pick<User, 'username' | 'id'> | Pick<Robot, 'firstName' | 'id'>>;
6
7
  };
@@ -10,21 +11,33 @@ export declare type UpdateGroupDescription = FormatUpdateParameter & {
10
11
  platforms: string;
11
12
  runtimeVersion: string;
12
13
  };
13
- export declare const UPDATE_COLUMNS: string[];
14
- export declare function getUpdateGroupsWithPlatforms<UpdateFragment extends Pick<Update, 'platform' | 'group'>>(updates: UpdateFragment[]): (UpdateFragment & {
14
+ export declare type FormattedUpdateGroupDescription = {
15
+ message: string;
16
+ group: string;
15
17
  platforms: string;
16
- })[];
18
+ runtimeVersion: string;
19
+ };
20
+ export declare type FormattedUpdateGroupDescriptionWithBranch = FormattedUpdateGroupDescription & {
21
+ branch: string;
22
+ };
23
+ export declare const UPDATE_COLUMNS: string[];
24
+ export declare const UPDATE_COLUMNS_WITH_BRANCH: string[];
17
25
  export declare function getPlatformsForGroup({ group, updates, }: {
18
- group: string;
26
+ group: string | undefined;
19
27
  updates: {
20
28
  group: string;
21
29
  platform: string;
22
- }[];
30
+ }[] | undefined;
23
31
  }): string;
24
32
  export declare function formatPlatformForUpdateGroup(updateGroup: {
25
33
  group: string;
26
34
  platform: string;
27
- }[]): string;
35
+ }[] | undefined): string;
28
36
  export declare function truncateString(originalMessage: string, length?: number): string;
29
- export declare function formatUpdate(update: FormatUpdateParameter): string;
37
+ export declare function formatUpdateMessage(update: FormatUpdateParameter): string;
30
38
  export declare function ensureValidVersions(exp: ExpoConfig, platform: RequestedPlatform): void;
39
+ export declare function formatUpdateTitle(update: UpdateFragment): string;
40
+ export declare function getUpdateGroupDescriptions(updateGroups: UpdateFragment[][]): FormattedUpdateGroupDescription[];
41
+ export declare function getUpdateGroupDescriptionsWithBranch(updateGroups: UpdateFragment[][]): FormattedUpdateGroupDescriptionWithBranch[];
42
+ export declare function checkEASUpdateURLIsSetAsync(exp: ExpoConfig, projectId: string): Promise<boolean>;
43
+ export declare function validateBuildProfileConfigMatchesProjectConfigAsync(exp: ExpoConfig, buildProfile: ProfileData<'build'>, projectId: string, nonInteractive: boolean): Promise<void>;