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,29 +1,33 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  const tslib_1 = require("tslib");
4
5
  const core_1 = require("@oclif/core");
6
+ const assert_1 = tslib_1.__importDefault(require("assert"));
5
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
9
+ const path_1 = tslib_1.__importDefault(require("path"));
6
10
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
11
+ const flags_1 = require("../../commandUtils/flags");
7
12
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
8
13
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
14
+ const EnvironmentSecret_1 = require("../../graphql/types/EnvironmentSecret");
9
15
  const log_1 = tslib_1.__importDefault(require("../../log"));
10
- const expoConfig_1 = require("../../project/expoConfig");
11
16
  const projectUtils_1 = require("../../project/projectUtils");
12
17
  const prompts_1 = require("../../prompts");
13
- const Account_1 = require("../../user/Account");
14
- const User_1 = require("../../user/User");
15
- const actions_1 = require("../../user/actions");
16
18
  class EnvironmentSecretCreate extends EasCommand_1.default {
17
19
  async runAsync() {
18
- const actor = await (0, actions_1.ensureLoggedInAsync)();
19
- let { flags: { name, value: secretValue, scope, force }, } = await this.parse(EnvironmentSecretCreate);
20
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
21
- const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
22
- const accountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
23
- const { slug } = exp;
24
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
20
+ let { flags: { name, value: secretValue, scope, force, type: secretType, 'non-interactive': nonInteractive, }, } = await this.parse(EnvironmentSecretCreate);
21
+ const { projectConfig: { projectId }, } = await this.getContextAsync(EnvironmentSecretCreate, {
22
+ nonInteractive,
23
+ });
24
+ const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
25
+ const ownerAccount = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
25
26
  if (!scope) {
26
27
  const validationMessage = 'Secret scope may not be empty.';
28
+ if (nonInteractive) {
29
+ throw new Error(validationMessage);
30
+ }
27
31
  ({ scope } = await (0, prompts_1.promptAsync)({
28
32
  type: 'select',
29
33
  name: 'scope',
@@ -36,13 +40,17 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
36
40
  }));
37
41
  }
38
42
  if (!name) {
43
+ const validationMessage = 'Secret name may not be empty.';
44
+ if (nonInteractive) {
45
+ throw new Error(validationMessage);
46
+ }
39
47
  ({ name } = await (0, prompts_1.promptAsync)({
40
48
  type: 'text',
41
49
  name: 'name',
42
50
  message: `Secret name:`,
43
51
  validate: value => {
44
52
  if (!value) {
45
- return 'Secret name may not be empty.';
53
+ return validationMessage;
46
54
  }
47
55
  // this validation regex here is just to shorten the feedback loop
48
56
  // the source of truth is in www's EnvironmentSecretValidator class
@@ -53,59 +61,101 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
53
61
  },
54
62
  }));
55
63
  if (!name) {
56
- throw new Error('Secret name may not be empty.');
64
+ throw new Error(validationMessage);
57
65
  }
58
66
  }
67
+ if (!secretType) {
68
+ if (nonInteractive) {
69
+ throw new Error('Secret type may not be empty in non-interactive mode');
70
+ }
71
+ secretType = await (0, prompts_1.selectAsync)('Select secret type', [
72
+ {
73
+ title: 'string',
74
+ value: EnvironmentSecret_1.SecretType.STRING,
75
+ },
76
+ {
77
+ title: 'file',
78
+ value: EnvironmentSecret_1.SecretType.FILE,
79
+ },
80
+ ]);
81
+ }
59
82
  if (!secretValue) {
60
83
  const validationMessage = 'Secret value may not be empty.';
84
+ if (nonInteractive) {
85
+ throw new Error(validationMessage);
86
+ }
61
87
  ({ secretValue } = await (0, prompts_1.promptAsync)({
62
88
  type: 'text',
63
89
  name: 'secretValue',
64
- message: 'Secret value:',
65
- validate: value => (value ? true : validationMessage),
90
+ message: secretType === EnvironmentSecret_1.SecretType.STRING ? 'Secret value:' : 'Local file path:',
91
+ // eslint-disable-next-line async-protect/async-suffix
92
+ validate: async (secretValue) => {
93
+ if (!secretValue) {
94
+ return 'Secret value may not be empty.';
95
+ }
96
+ if (secretType === EnvironmentSecret_1.SecretType.FILE) {
97
+ const secretFilePath = path_1.default.resolve(secretValue);
98
+ if (!(await fs_extra_1.default.pathExists(secretFilePath))) {
99
+ return `File "${secretValue}" does not exist.`;
100
+ }
101
+ }
102
+ return true;
103
+ },
66
104
  }));
67
- if (!secretValue) {
68
- throw new Error(validationMessage);
105
+ }
106
+ (0, assert_1.default)(secretValue);
107
+ let secretFilePath;
108
+ if (secretType === EnvironmentSecret_1.SecretType.FILE) {
109
+ secretFilePath = path_1.default.resolve(secretValue);
110
+ if (!(await fs_extra_1.default.pathExists(secretFilePath))) {
111
+ throw new Error(`File "${secretValue}" does not exist`);
69
112
  }
113
+ secretValue = await fs_extra_1.default.readFile(secretFilePath, 'base64');
70
114
  }
71
115
  if (scope === EnvironmentSecretsQuery_1.EnvironmentSecretScope.PROJECT) {
72
116
  if (force) {
73
- const existingSecrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.byAppIdAsync(projectId);
117
+ const { appSecrets: existingSecrets } = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.byAppIdAsync(projectId);
74
118
  const existingSecret = existingSecrets.find(secret => secret.name === name);
75
119
  if (existingSecret) {
76
120
  await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(existingSecret.id);
77
- log_1.default.withTick(`Deleting existing secret ${chalk_1.default.bold(name)} on project ${chalk_1.default.bold(`@${accountName}/${slug}`)}.`);
121
+ log_1.default.withTick(`Deleting existing secret ${chalk_1.default.bold(name)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
78
122
  }
79
123
  }
80
- const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAppAsync({ name, value: secretValue }, projectId);
124
+ const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAppAsync({ name, value: secretValue, type: EnvironmentSecret_1.SecretTypeToEnvironmentSecretType[secretType] }, projectId);
81
125
  if (!secret) {
82
126
  throw new Error(`Could not create secret with name ${name} on project with id ${projectId}`);
83
127
  }
84
- log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} on project ${chalk_1.default.bold(`@${accountName}/${slug}`)}.`);
128
+ if (secretType === EnvironmentSecret_1.SecretType.STRING) {
129
+ log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} with value ${chalk_1.default.bold(secretValue)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
130
+ }
131
+ else {
132
+ log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} from file ${chalk_1.default.bold(secretFilePath)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
133
+ }
85
134
  }
86
135
  else if (scope === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT) {
87
- const ownerAccount = (0, Account_1.findAccountByName)(actor.accounts, accountName);
88
- if (!ownerAccount) {
89
- log_1.default.warn(`Your account (${(0, User_1.getActorDisplayName)(actor)}) doesn't have access to the ${chalk_1.default.bold(accountName)} account`);
90
- return;
91
- }
92
136
  if (force) {
93
- const existingSecrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.byAccountNameAsync(ownerAccount.name);
137
+ const { accountSecrets: existingSecrets } = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.byAppIdAsync(projectId);
94
138
  const existingSecret = existingSecrets.find(secret => secret.name === name);
95
139
  if (existingSecret) {
96
140
  await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(existingSecret.id);
97
141
  log_1.default.withTick(`Deleting existing secret ${chalk_1.default.bold(name)} on account ${chalk_1.default.bold(ownerAccount.name)}.`);
98
142
  }
99
143
  }
100
- const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAccountAsync({ name, value: secretValue }, ownerAccount.id);
144
+ const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAccountAsync({ name, value: secretValue, type: EnvironmentSecret_1.SecretTypeToEnvironmentSecretType[secretType] }, ownerAccount.id);
101
145
  if (!secret) {
102
146
  throw new Error(`Could not create secret with name ${name} on account with id ${ownerAccount.id}`);
103
147
  }
104
- log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} on account ${chalk_1.default.bold(ownerAccount.name)}.`);
148
+ if (secretType === EnvironmentSecret_1.SecretType.STRING) {
149
+ log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} with value ${chalk_1.default.bold(secretValue)} on account ${chalk_1.default.bold(ownerAccount.name)}.`);
150
+ }
151
+ else {
152
+ log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} from file ${chalk_1.default.bold(secretFilePath)} on account ${chalk_1.default.bold(ownerAccount.name)}.`);
153
+ }
105
154
  }
106
155
  }
107
156
  }
108
157
  exports.default = EnvironmentSecretCreate;
158
+ _a = EnvironmentSecretCreate;
109
159
  EnvironmentSecretCreate.description = 'create an environment secret on the current project or owner account';
110
160
  EnvironmentSecretCreate.flags = {
111
161
  scope: core_1.Flags.enum({
@@ -117,10 +167,18 @@ EnvironmentSecretCreate.flags = {
117
167
  description: 'Name of the secret',
118
168
  }),
119
169
  value: core_1.Flags.string({
120
- description: 'Value of the secret',
170
+ description: 'Text value or path to a file to store in the secret',
171
+ }),
172
+ type: core_1.Flags.enum({
173
+ description: 'The type of secret',
174
+ options: [EnvironmentSecret_1.SecretType.STRING, EnvironmentSecret_1.SecretType.FILE],
121
175
  }),
122
176
  force: core_1.Flags.boolean({
123
177
  description: 'Delete and recreate existing secrets',
124
178
  default: false,
125
179
  }),
180
+ ...flags_1.EASNonInteractiveFlag,
181
+ };
182
+ EnvironmentSecretCreate.contextDefinition = {
183
+ ..._a.ContextOptions.ProjectConfig,
126
184
  };
@@ -2,7 +2,11 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class EnvironmentSecretDelete extends EasCommand {
3
3
  static description: string;
4
4
  static flags: {
5
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
5
6
  id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
6
7
  };
8
+ static contextDefinition: {
9
+ projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
10
+ };
7
11
  runAsync(): Promise<void>;
8
12
  }
@@ -1,25 +1,27 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  const tslib_1 = require("tslib");
4
5
  const core_1 = require("@oclif/core");
5
6
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
+ const flags_1 = require("../../commandUtils/flags");
6
8
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
7
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
8
10
  const log_1 = tslib_1.__importDefault(require("../../log"));
9
- const expoConfig_1 = require("../../project/expoConfig");
10
- const projectUtils_1 = require("../../project/projectUtils");
11
11
  const prompts_1 = require("../../prompts");
12
12
  class EnvironmentSecretDelete extends EasCommand_1.default {
13
13
  async runAsync() {
14
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
15
- const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
16
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
17
- const projectAccountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
18
- let { flags: { id }, } = await this.parse(EnvironmentSecretDelete);
14
+ let { flags: { id, 'non-interactive': nonInteractive }, } = await this.parse(EnvironmentSecretDelete);
15
+ const { projectConfig: { projectId }, } = await this.getContextAsync(EnvironmentSecretDelete, {
16
+ nonInteractive,
17
+ });
19
18
  let secret;
20
19
  if (!id) {
21
20
  const validationMessage = 'You must select which secret to delete.';
22
- const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(projectAccountName, projectId);
21
+ if (nonInteractive) {
22
+ throw new Error(validationMessage);
23
+ }
24
+ const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(projectId);
23
25
  ({ secret } = await (0, prompts_1.promptAsync)({
24
26
  type: 'autocomplete',
25
27
  name: 'secret',
@@ -34,26 +36,33 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
34
36
  throw new Error(validationMessage);
35
37
  }
36
38
  }
37
- log_1.default.addNewLineIfNone();
38
- log_1.default.warn(`You are about to permanently delete secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
39
- log_1.default.newLine();
40
- const confirmed = await (0, prompts_1.toggleConfirmAsync)({
41
- message: `Are you sure you wish to proceed?${(secret === null || secret === void 0 ? void 0 : secret.scope) === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT
42
- ? ' This secret is applied across your whole account and may affect multiple apps.'
43
- : ''}`,
44
- });
45
- if (!confirmed) {
46
- log_1.default.error(`Canceled deletion of secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".`);
47
- process.exit(1);
39
+ if (!nonInteractive) {
40
+ log_1.default.addNewLineIfNone();
41
+ log_1.default.warn(`You are about to permanently delete secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
42
+ log_1.default.newLine();
43
+ const confirmed = await (0, prompts_1.toggleConfirmAsync)({
44
+ message: `Are you sure you wish to proceed?${(secret === null || secret === void 0 ? void 0 : secret.scope) === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT
45
+ ? ' This secret is applied across your whole account and may affect multiple apps.'
46
+ : ''}`,
47
+ });
48
+ if (!confirmed) {
49
+ log_1.default.error(`Canceled deletion of secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".`);
50
+ process.exit(1);
51
+ }
48
52
  }
49
53
  await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(id);
50
54
  log_1.default.withTick(`️Deleted secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id "${id}".`);
51
55
  }
52
56
  }
53
57
  exports.default = EnvironmentSecretDelete;
58
+ _a = EnvironmentSecretDelete;
54
59
  EnvironmentSecretDelete.description = 'delete an environment secret by ID';
55
60
  EnvironmentSecretDelete.flags = {
56
61
  id: core_1.Flags.string({
57
62
  description: 'ID of the secret to delete',
58
63
  }),
64
+ ...flags_1.EASNonInteractiveFlag,
65
+ };
66
+ EnvironmentSecretDelete.contextDefinition = {
67
+ ..._a.ContextOptions.ProjectConfig,
59
68
  };
@@ -1,5 +1,8 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class EnvironmentSecretList extends EasCommand {
3
3
  static description: string;
4
+ static contextDefinition: {
5
+ projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
6
+ };
4
7
  runAsync(): Promise<void>;
5
8
  }
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  const tslib_1 = require("tslib");
4
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
@@ -6,30 +7,35 @@ const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
6
7
  const dateformat_1 = tslib_1.__importDefault(require("dateformat"));
7
8
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
8
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
10
+ const EnvironmentSecret_1 = require("../../graphql/types/EnvironmentSecret");
9
11
  const log_1 = tslib_1.__importDefault(require("../../log"));
10
- const expoConfig_1 = require("../../project/expoConfig");
11
- const projectUtils_1 = require("../../project/projectUtils");
12
12
  class EnvironmentSecretList extends EasCommand_1.default {
13
13
  async runAsync() {
14
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
15
- const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
16
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
17
- const projectAccountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
18
- if (!projectDir) {
19
- throw new Error("Run this command inside your project's directory");
20
- }
21
- const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(projectAccountName, projectId);
14
+ const { projectConfig: { projectId }, } = await this.getContextAsync(EnvironmentSecretList, {
15
+ nonInteractive: true,
16
+ });
17
+ const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(projectId);
22
18
  const table = new cli_table3_1.default({
23
- head: ['Name', 'Scope', 'ID', 'Updated at'],
19
+ head: ['Name', 'Type', 'Scope', 'ID', 'Updated at'],
24
20
  wordWrap: true,
25
21
  });
26
22
  for (const secret of secrets) {
27
- const { name, createdAt: updatedAt, scope, id } = secret;
28
- table.push([name, scope, id, (0, dateformat_1.default)(updatedAt, 'mmm dd HH:MM:ss')]);
23
+ const { name, createdAt: updatedAt, scope, id, type } = secret;
24
+ table.push([
25
+ name,
26
+ EnvironmentSecret_1.EnvironmentSecretTypeToSecretType[type],
27
+ scope,
28
+ id,
29
+ (0, dateformat_1.default)(updatedAt, 'mmm dd HH:MM:ss'),
30
+ ]);
29
31
  }
30
32
  log_1.default.log((0, chalk_1.default) `{bold Secrets for this account and project:}`);
31
33
  log_1.default.log(table.toString());
32
34
  }
33
35
  }
34
36
  exports.default = EnvironmentSecretList;
37
+ _a = EnvironmentSecretList;
35
38
  EnvironmentSecretList.description = 'list environment secrets available for your current app';
39
+ EnvironmentSecretList.contextDefinition = {
40
+ ..._a.ContextOptions.ProjectConfig,
41
+ };
@@ -13,6 +13,11 @@ export default class Submit extends EasCommand {
13
13
  wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
14
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  };
16
+ static contextDefinition: {
17
+ projectDir: import("../commandUtils/context/ProjectDirContextField").default;
18
+ projectConfig: import("../commandUtils/context/ProjectConfigContextField").default;
19
+ actor: import("../commandUtils/context/ActorContextField").default;
20
+ };
16
21
  runAsync(): Promise<void>;
17
22
  private sanitizeFlags;
18
23
  private ensurePlatformSelectedAsync;
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  const tslib_1 = require("tslib");
4
5
  const eas_json_1 = require("@expo/eas-json");
@@ -9,8 +10,6 @@ const generated_1 = require("../graphql/generated");
9
10
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
10
11
  const log_1 = tslib_1.__importDefault(require("../log"));
11
12
  const platform_1 = require("../platform");
12
- const expoConfig_1 = require("../project/expoConfig");
13
- const projectUtils_1 = require("../project/projectUtils");
14
13
  const context_1 = require("../submit/context");
15
14
  const submit_1 = require("../submit/submit");
16
15
  const urls_1 = require("../submit/utils/urls");
@@ -19,28 +18,31 @@ const statuspageService_1 = require("../utils/statuspageService");
19
18
  class Submit extends EasCommand_1.default {
20
19
  async runAsync() {
21
20
  const { flags: rawFlags } = await this.parse(Submit);
21
+ const { actor, projectConfig: { exp, projectId, projectDir }, } = await this.getContextAsync(Submit, {
22
+ nonInteractive: false,
23
+ });
22
24
  const flags = this.sanitizeFlags(rawFlags);
23
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
24
- const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
25
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
26
25
  await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)([generated_1.StatuspageServiceName.EasSubmit]);
27
26
  const flagsWithPlatform = await this.ensurePlatformSelectedAsync(flags);
28
27
  const platforms = (0, platform_1.toPlatforms)(flagsWithPlatform.requestedPlatform);
29
28
  const submissionProfiles = await (0, profiles_1.getProfilesAsync)({
30
29
  type: 'submit',
31
- easJsonReader: new eas_json_1.EasJsonReader(projectDir),
30
+ easJsonAccessor: new eas_json_1.EasJsonAccessor(projectDir),
32
31
  platforms,
33
32
  profileName: flagsWithPlatform.profile,
34
33
  });
35
34
  const submissions = [];
36
35
  for (const submissionProfile of submissionProfiles) {
36
+ // this command doesn't make use of env when getting the project config
37
37
  const ctx = await (0, context_1.createSubmissionContextAsync)({
38
38
  platform: submissionProfile.platform,
39
39
  projectDir,
40
- projectId,
41
40
  profile: submissionProfile.profile,
42
41
  archiveFlags: flagsWithPlatform.archiveFlags,
43
42
  nonInteractive: flagsWithPlatform.nonInteractive,
43
+ actor,
44
+ exp,
45
+ projectId,
44
46
  });
45
47
  if (submissionProfiles.length > 1) {
46
48
  log_1.default.newLine();
@@ -91,6 +93,7 @@ class Submit extends EasCommand_1.default {
91
93
  }
92
94
  }
93
95
  exports.default = Submit;
96
+ _a = Submit;
94
97
  Submit.description = 'submit app binary to App Store and/or Play Store';
95
98
  Submit.aliases = ['build:submit'];
96
99
  Submit.flags = {
@@ -99,6 +102,7 @@ Submit.flags = {
99
102
  options: ['android', 'ios', 'all'],
100
103
  }),
101
104
  profile: core_1.Flags.string({
105
+ char: 'e',
102
106
  description: 'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
103
107
  }),
104
108
  latest: core_1.Flags.boolean({
@@ -131,3 +135,8 @@ Submit.flags = {
131
135
  description: 'Run command in non-interactive mode',
132
136
  }),
133
137
  };
138
+ Submit.contextDefinition = {
139
+ ..._a.ContextOptions.LoggedIn,
140
+ ..._a.ContextOptions.ProjectConfig,
141
+ ..._a.ContextOptions.ProjectDir,
142
+ };
@@ -4,5 +4,8 @@ export default class UpdateConfigure extends EasCommand {
4
4
  static flags: {
5
5
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
6
  };
7
+ static contextDefinition: {
8
+ projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
9
+ };
7
10
  runAsync(): Promise<void>;
8
11
  }
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  const tslib_1 = require("tslib");
4
5
  const config_1 = require("@expo/config");
@@ -11,7 +12,6 @@ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasComm
11
12
  const generated_1 = require("../../graphql/generated");
12
13
  const log_1 = tslib_1.__importStar(require("../../log"));
13
14
  const platform_1 = require("../../platform");
14
- const expoConfig_1 = require("../../project/expoConfig");
15
15
  const projectUtils_1 = require("../../project/projectUtils");
16
16
  const workflow_1 = require("../../project/workflow");
17
17
  const UpdatesModule_1 = require("../../update/android/UpdatesModule");
@@ -22,9 +22,10 @@ class UpdateConfigure extends EasCommand_1.default {
22
22
  async runAsync() {
23
23
  log_1.default.log('💡 The following process will configure your project to run EAS Update. These changes only apply to your local project files and you can safely revert them at any time.');
24
24
  const { flags } = await this.parse(UpdateConfigure);
25
+ const { projectConfig: { projectId, exp, projectDir }, } = await this.getContextAsync(UpdateConfigure, {
26
+ nonInteractive: true,
27
+ });
25
28
  const platform = flags.platform;
26
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
27
- const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
28
29
  if (!(0, projectUtils_1.isExpoUpdatesInstalledOrAvailable)(projectDir, exp.sdkVersion)) {
29
30
  await (0, projectUtils_1.installExpoUpdatesAsync)(projectDir);
30
31
  }
@@ -40,17 +41,18 @@ class UpdateConfigure extends EasCommand_1.default {
40
41
  android: androidWorkflow,
41
42
  ios: iosWorkflow,
42
43
  },
44
+ projectId,
43
45
  });
44
46
  log_1.default.withTick(`Configured ${chalk_1.default.bold('app.json')} for EAS Update`);
45
47
  // configure native files for EAS Update
46
48
  if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform) &&
47
49
  androidWorkflow === eas_build_job_1.Workflow.GENERIC) {
48
- await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, updatedExp);
50
+ await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, updatedExp, projectId);
49
51
  log_1.default.withTick(`Configured ${chalk_1.default.bold('AndroidManifest.xml')} for EAS Update`);
50
52
  }
51
53
  if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform) &&
52
54
  iosWorkflow === eas_build_job_1.Workflow.GENERIC) {
53
- await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(projectDir, updatedExp);
55
+ await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(projectDir, updatedExp, projectId);
54
56
  log_1.default.withTick(`Configured ${chalk_1.default.bold('Expo.plist')} for EAS Update`);
55
57
  }
56
58
  log_1.default.addNewLineIfNone();
@@ -58,6 +60,7 @@ class UpdateConfigure extends EasCommand_1.default {
58
60
  }
59
61
  }
60
62
  exports.default = UpdateConfigure;
63
+ _a = UpdateConfigure;
61
64
  UpdateConfigure.description = 'configure the project to support EAS Update';
62
65
  UpdateConfigure.flags = {
63
66
  platform: core_1.Flags.enum({
@@ -67,9 +70,12 @@ UpdateConfigure.flags = {
67
70
  default: 'all',
68
71
  }),
69
72
  };
70
- async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, workflows, }) {
71
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
72
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
73
+ UpdateConfigure.contextDefinition = {
74
+ ..._a.ContextOptions.ProjectConfig,
75
+ };
76
+ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, workflows, projectId, }) {
77
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
78
+ // this command is non-interactive in the way it was designed
73
79
  const easUpdateURL = (0, api_1.getEASUpdateURL)(projectId);
74
80
  const updates = { ...exp.updates, url: easUpdateURL };
75
81
  const androidDefaultRuntimeVersion = workflows['android'] === eas_build_job_1.Workflow.GENERIC
@@ -78,8 +84,8 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
78
84
  const iosDefaultRuntimeVersion = workflows['ios'] === eas_build_job_1.Workflow.GENERIC
79
85
  ? DEFAULT_BARE_RUNTIME_VERSION
80
86
  : DEFAULT_MANAGED_RUNTIME_VERSION;
81
- const newAndroidRuntimeVersion = (_c = (_b = (_a = exp.android) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : exp.runtimeVersion) !== null && _c !== void 0 ? _c : androidDefaultRuntimeVersion;
82
- const newIosRuntimeVersion = (_f = (_e = (_d = exp.ios) === null || _d === void 0 ? void 0 : _d.runtimeVersion) !== null && _e !== void 0 ? _e : exp.runtimeVersion) !== null && _f !== void 0 ? _f : iosDefaultRuntimeVersion;
87
+ const newAndroidRuntimeVersion = (_d = (_c = (_b = exp.android) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== null && _c !== void 0 ? _c : exp.runtimeVersion) !== null && _d !== void 0 ? _d : androidDefaultRuntimeVersion;
88
+ const newIosRuntimeVersion = (_g = (_f = (_e = exp.ios) === null || _e === void 0 ? void 0 : _e.runtimeVersion) !== null && _f !== void 0 ? _f : exp.runtimeVersion) !== null && _g !== void 0 ? _g : iosDefaultRuntimeVersion;
83
89
  let newConfig;
84
90
  let newConfigOnlyAddedValues;
85
91
  switch (platform) {
@@ -188,13 +194,13 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
188
194
  }
189
195
  }
190
196
  const result = await (0, config_1.modifyConfigAsync)(projectDir, newConfig);
191
- const preexistingAndroidRuntimeVersion = (_h = (_g = exp.android) === null || _g === void 0 ? void 0 : _g.runtimeVersion) !== null && _h !== void 0 ? _h : exp.runtimeVersion;
192
- const preexistingIosRuntimeVersion = (_k = (_j = exp.ios) === null || _j === void 0 ? void 0 : _j.runtimeVersion) !== null && _k !== void 0 ? _k : exp.runtimeVersion;
197
+ const preexistingAndroidRuntimeVersion = (_j = (_h = exp.android) === null || _h === void 0 ? void 0 : _h.runtimeVersion) !== null && _j !== void 0 ? _j : exp.runtimeVersion;
198
+ const preexistingIosRuntimeVersion = (_l = (_k = exp.ios) === null || _k === void 0 ? void 0 : _k.runtimeVersion) !== null && _l !== void 0 ? _l : exp.runtimeVersion;
193
199
  switch (result.type) {
194
200
  case 'success':
195
- if ((_l = exp.updates) === null || _l === void 0 ? void 0 : _l.url) {
201
+ if ((_m = exp.updates) === null || _m === void 0 ? void 0 : _m.url) {
196
202
  if (exp.updates.url !== easUpdateURL) {
197
- log_1.default.withTick(`Overwrote "${(_m = exp.updates) === null || _m === void 0 ? void 0 : _m.url}" with "${easUpdateURL}" for the updates.url value in app.json`);
203
+ log_1.default.withTick(`Overwrote "${(_o = exp.updates) === null || _o === void 0 ? void 0 : _o.url}" with "${easUpdateURL}" for the updates.url value in app.json`);
198
204
  }
199
205
  }
200
206
  else {
@@ -202,11 +208,11 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
202
208
  }
203
209
  if (!preexistingAndroidRuntimeVersion &&
204
210
  [platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
205
- log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Android]} runtimeVersion to "${JSON.stringify((_p = (_o = newConfig.android) === null || _o === void 0 ? void 0 : _o.runtimeVersion) !== null && _p !== void 0 ? _p : newConfig.runtimeVersion)}" in app.json`);
211
+ log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Android]} runtimeVersion to "${JSON.stringify((_q = (_p = newConfig.android) === null || _p === void 0 ? void 0 : _p.runtimeVersion) !== null && _q !== void 0 ? _q : newConfig.runtimeVersion)}" in app.json`);
206
212
  }
207
213
  if (!preexistingIosRuntimeVersion &&
208
214
  [platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
209
- log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Ios]} runtimeVersion to "${JSON.stringify((_r = (_q = newConfig.ios) === null || _q === void 0 ? void 0 : _q.runtimeVersion) !== null && _r !== void 0 ? _r : newConfig.runtimeVersion)}" in app.json`);
215
+ log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Ios]} runtimeVersion to "${JSON.stringify((_s = (_r = newConfig.ios) === null || _r === void 0 ? void 0 : _r.runtimeVersion) !== null && _s !== void 0 ? _s : newConfig.runtimeVersion)}" in app.json`);
210
216
  }
211
217
  break;
212
218
  case 'warn': {
@@ -8,6 +8,7 @@ export default class UpdateDelete extends EasCommand {
8
8
  }[];
9
9
  static flags: {
10
10
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
12
  };
12
13
  runAsync(): Promise<void>;
13
14
  }
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
4
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
5
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
6
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
+ const flags_1 = require("../../commandUtils/flags");
8
8
  const client_1 = require("../../graphql/client");
9
9
  const log_1 = tslib_1.__importDefault(require("../../log"));
10
10
  const prompts_1 = require("../../prompts");
@@ -24,11 +24,11 @@ async function deleteUpdateGroupAsync({ group, }) {
24
24
  }
25
25
  class UpdateDelete extends EasCommand_1.default {
26
26
  async runAsync() {
27
- const { args: { groupId: group }, flags: { json: jsonFlag }, } = await this.parse(UpdateDelete);
27
+ const { args: { groupId: group }, flags: { json: jsonFlag, 'non-interactive': nonInteractive }, } = await this.parse(UpdateDelete);
28
28
  if (jsonFlag) {
29
29
  (0, json_1.enableJsonOutput)();
30
30
  }
31
- else {
31
+ if (!nonInteractive) {
32
32
  const shouldAbort = await (0, prompts_1.confirmAsync)({
33
33
  message: `🚨${chalk_1.default.red('CAUTION')}🚨\n\n` +
34
34
  `${chalk_1.default.yellow(`This will delete all of the updates in group "${group}".`)} ${chalk_1.default.red('This is a permanent operation.')}\n\n` +
@@ -60,8 +60,5 @@ UpdateDelete.args = [
60
60
  },
61
61
  ];
62
62
  UpdateDelete.flags = {
63
- json: core_1.Flags.boolean({
64
- description: `Return a json with the group ID of the deleted updates.`,
65
- default: false,
66
- }),
63
+ ...flags_1.EasNonInteractiveAndJsonFlags,
67
64
  };