eas-cli 2.3.0 → 2.4.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 (348) hide show
  1. package/README.md +47 -47
  2. package/build/ApiV2Error.d.ts +15 -0
  3. package/build/ApiV2Error.js +14 -0
  4. package/build/api.d.ts +10 -16
  5. package/build/api.js +52 -59
  6. package/build/branch/queries.d.ts +3 -2
  7. package/build/branch/queries.js +7 -7
  8. package/build/build/android/build.js +3 -3
  9. package/build/build/android/syncProjectConfiguration.d.ts +2 -1
  10. package/build/build/android/syncProjectConfiguration.js +2 -2
  11. package/build/build/android/version.d.ts +2 -1
  12. package/build/build/android/version.js +4 -4
  13. package/build/build/build.d.ts +2 -1
  14. package/build/build/build.js +5 -5
  15. package/build/build/context.d.ts +2 -0
  16. package/build/build/createContext.d.ts +3 -1
  17. package/build/build/createContext.js +4 -2
  18. package/build/build/ios/build.js +3 -3
  19. package/build/build/ios/syncProjectConfiguration.d.ts +2 -1
  20. package/build/build/ios/syncProjectConfiguration.js +2 -2
  21. package/build/build/ios/version.d.ts +2 -1
  22. package/build/build/ios/version.js +4 -4
  23. package/build/build/local.js +1 -1
  24. package/build/build/queries.d.ts +2 -1
  25. package/build/build/queries.js +3 -3
  26. package/build/build/runBuildAndSubmit.d.ts +2 -1
  27. package/build/build/runBuildAndSubmit.js +9 -6
  28. package/build/channel/queries.d.ts +4 -3
  29. package/build/channel/queries.js +13 -13
  30. package/build/commandUtils/EasCommand.d.ts +24 -3
  31. package/build/commandUtils/EasCommand.js +36 -6
  32. package/build/commandUtils/context/ContextField.d.ts +2 -0
  33. package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +1 -1
  34. package/build/commandUtils/context/DynamicProjectConfigContextField.js +2 -2
  35. package/build/commandUtils/context/LoggedInContextField.d.ts +12 -0
  36. package/build/commandUtils/context/LoggedInContextField.js +15 -0
  37. package/build/commandUtils/context/MaybeLoggedInContextField.d.ts +12 -0
  38. package/build/commandUtils/context/MaybeLoggedInContextField.js +17 -0
  39. package/build/commandUtils/context/OptionalProjectConfigContextField.d.ts +1 -1
  40. package/build/commandUtils/context/OptionalProjectConfigContextField.js +2 -2
  41. package/build/commandUtils/context/ProjectConfigContextField.d.ts +1 -1
  42. package/build/commandUtils/context/ProjectConfigContextField.js +2 -2
  43. package/build/commandUtils/context/SessionManagementContextField.d.ts +5 -0
  44. package/build/commandUtils/context/SessionManagementContextField.js +10 -0
  45. package/build/commandUtils/context/contextUtils/createGraphqlClient.d.ts +11 -0
  46. package/build/commandUtils/context/contextUtils/createGraphqlClient.js +43 -0
  47. package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +2 -1
  48. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +11 -7
  49. package/build/commands/account/login.d.ts +3 -0
  50. package/build/commands/account/login.js +7 -2
  51. package/build/commands/account/logout.d.ts +3 -0
  52. package/build/commands/account/logout.js +7 -2
  53. package/build/commands/account/view.d.ts +3 -0
  54. package/build/commands/account/view.js +8 -3
  55. package/build/commands/branch/create.d.ts +3 -1
  56. package/build/commands/branch/create.js +6 -5
  57. package/build/commands/branch/delete.d.ts +1 -0
  58. package/build/commands/branch/delete.js +10 -9
  59. package/build/commands/branch/list.d.ts +1 -0
  60. package/build/commands/branch/list.js +3 -2
  61. package/build/commands/branch/rename.d.ts +1 -0
  62. package/build/commands/branch/rename.js +6 -5
  63. package/build/commands/branch/view.d.ts +1 -0
  64. package/build/commands/branch/view.js +4 -3
  65. package/build/commands/build/cancel.d.ts +3 -1
  66. package/build/commands/build/cancel.js +14 -13
  67. package/build/commands/build/configure.d.ts +1 -0
  68. package/build/commands/build/configure.js +4 -3
  69. package/build/commands/build/index.d.ts +1 -1
  70. package/build/commands/build/index.js +3 -3
  71. package/build/commands/build/inspect.d.ts +1 -1
  72. package/build/commands/build/inspect.js +2 -2
  73. package/build/commands/build/list.d.ts +1 -0
  74. package/build/commands/build/list.js +4 -3
  75. package/build/commands/build/version/set.d.ts +1 -1
  76. package/build/commands/build/version/set.js +4 -4
  77. package/build/commands/build/version/sync.d.ts +1 -1
  78. package/build/commands/build/version/sync.js +2 -2
  79. package/build/commands/build/view.d.ts +1 -0
  80. package/build/commands/build/view.js +5 -4
  81. package/build/commands/channel/create.d.ts +3 -1
  82. package/build/commands/channel/create.js +8 -7
  83. package/build/commands/channel/delete.d.ts +1 -0
  84. package/build/commands/channel/delete.js +7 -6
  85. package/build/commands/channel/edit.d.ts +3 -1
  86. package/build/commands/channel/edit.js +12 -8
  87. package/build/commands/channel/list.d.ts +1 -0
  88. package/build/commands/channel/list.js +3 -2
  89. package/build/commands/channel/rollout.d.ts +1 -0
  90. package/build/commands/channel/rollout.js +15 -14
  91. package/build/commands/channel/view.d.ts +1 -0
  92. package/build/commands/channel/view.js +4 -3
  93. package/build/commands/credentials.d.ts +1 -1
  94. package/build/commands/credentials.js +2 -2
  95. package/build/commands/device/create.d.ts +1 -1
  96. package/build/commands/device/create.js +2 -1
  97. package/build/commands/device/delete.d.ts +3 -1
  98. package/build/commands/device/delete.js +9 -8
  99. package/build/commands/device/list.d.ts +1 -0
  100. package/build/commands/device/list.js +5 -4
  101. package/build/commands/device/view.d.ts +1 -0
  102. package/build/commands/device/view.js +4 -3
  103. package/build/commands/metadata/pull.d.ts +1 -1
  104. package/build/commands/metadata/pull.js +2 -1
  105. package/build/commands/metadata/push.d.ts +1 -1
  106. package/build/commands/metadata/push.js +2 -1
  107. package/build/commands/open.d.ts +1 -0
  108. package/build/commands/open.js +3 -2
  109. package/build/commands/project/info.d.ts +1 -0
  110. package/build/commands/project/info.js +5 -4
  111. package/build/commands/project/init.d.ts +1 -1
  112. package/build/commands/project/init.js +5 -5
  113. package/build/commands/secret/create.d.ts +1 -0
  114. package/build/commands/secret/create.js +10 -9
  115. package/build/commands/secret/delete.d.ts +1 -0
  116. package/build/commands/secret/delete.js +4 -3
  117. package/build/commands/secret/list.d.ts +1 -0
  118. package/build/commands/secret/list.js +3 -2
  119. package/build/commands/submit.d.ts +1 -1
  120. package/build/commands/submit.js +4 -3
  121. package/build/commands/update/configure.d.ts +1 -0
  122. package/build/commands/update/configure.js +4 -3
  123. package/build/commands/update/delete.d.ts +3 -0
  124. package/build/commands/update/delete.js +9 -3
  125. package/build/commands/update/index.d.ts +3 -1
  126. package/build/commands/update/index.js +23 -17
  127. package/build/commands/update/list.d.ts +1 -0
  128. package/build/commands/update/list.js +6 -5
  129. package/build/commands/update/view.d.ts +3 -0
  130. package/build/commands/update/view.js +7 -1
  131. package/build/commands/webhook/create.d.ts +1 -0
  132. package/build/commands/webhook/create.js +3 -2
  133. package/build/commands/webhook/delete.d.ts +1 -0
  134. package/build/commands/webhook/delete.js +7 -6
  135. package/build/commands/webhook/list.d.ts +1 -0
  136. package/build/commands/webhook/list.js +4 -3
  137. package/build/commands/webhook/update.d.ts +3 -0
  138. package/build/commands/webhook/update.js +8 -2
  139. package/build/commands/webhook/view.d.ts +3 -0
  140. package/build/commands/webhook/view.js +7 -1
  141. package/build/credentials/android/actions/AssignFcm.js +2 -2
  142. package/build/credentials/android/actions/AssignGoogleServiceAccountKey.js +2 -2
  143. package/build/credentials/android/actions/BuildCredentialsUtils.js +12 -12
  144. package/build/credentials/android/actions/CreateFcm.js +1 -1
  145. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.js +1 -1
  146. package/build/credentials/android/actions/CreateKeystore.js +4 -4
  147. package/build/credentials/android/actions/RemoveFcm.js +2 -2
  148. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.js +2 -2
  149. package/build/credentials/android/actions/RemoveKeystore.js +1 -1
  150. package/build/credentials/android/actions/SetUpBuildCredentials.js +3 -3
  151. package/build/credentials/android/actions/SetUpBuildCredentialsFromCredentialsJson.js +3 -3
  152. package/build/credentials/android/actions/SetUpGoogleServiceAccountKey.js +3 -3
  153. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.js +1 -1
  154. package/build/credentials/android/api/GraphqlClient.d.ts +19 -18
  155. package/build/credentials/android/api/GraphqlClient.js +45 -45
  156. package/build/credentials/android/api/graphql/mutations/AndroidAppBuildCredentialsMutation.d.ts +3 -2
  157. package/build/credentials/android/api/graphql/mutations/AndroidAppBuildCredentialsMutation.js +4 -4
  158. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.d.ts +4 -3
  159. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.js +6 -6
  160. package/build/credentials/android/api/graphql/mutations/AndroidFcmMutation.d.ts +3 -2
  161. package/build/credentials/android/api/graphql/mutations/AndroidFcmMutation.js +4 -4
  162. package/build/credentials/android/api/graphql/mutations/AndroidKeystoreMutation.d.ts +3 -2
  163. package/build/credentials/android/api/graphql/mutations/AndroidKeystoreMutation.js +4 -4
  164. package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.d.ts +3 -2
  165. package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.js +4 -4
  166. package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.d.ts +2 -1
  167. package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.js +2 -2
  168. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +2 -1
  169. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -2
  170. package/build/credentials/android/utils/keystore.d.ts +2 -1
  171. package/build/credentials/android/utils/keystore.js +6 -6
  172. package/build/credentials/context.d.ts +3 -0
  173. package/build/credentials/context.js +1 -0
  174. package/build/credentials/credentialsJson/update.js +1 -1
  175. package/build/credentials/ios/actions/AppleTeamUtils.js +1 -1
  176. package/build/credentials/ios/actions/AscApiKeyUtils.js +1 -1
  177. package/build/credentials/ios/actions/AssignAscApiKey.js +2 -2
  178. package/build/credentials/ios/actions/AssignPushKey.js +2 -2
  179. package/build/credentials/ios/actions/BuildCredentialsUtils.js +5 -5
  180. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
  181. package/build/credentials/ios/actions/CreateAscApiKey.js +1 -1
  182. package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
  183. package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -2
  184. package/build/credentials/ios/actions/CreatePushKey.js +1 -1
  185. package/build/credentials/ios/actions/DistributionCertificateUtils.js +2 -2
  186. package/build/credentials/ios/actions/PushKeyUtils.js +1 -1
  187. package/build/credentials/ios/actions/RemoveAscApiKey.js +1 -1
  188. package/build/credentials/ios/actions/RemoveDistributionCertificate.js +1 -1
  189. package/build/credentials/ios/actions/RemoveProvisioningProfile.js +1 -1
  190. package/build/credentials/ios/actions/RemovePushKey.js +1 -1
  191. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +8 -8
  192. package/build/credentials/ios/actions/SetUpAscApiKey.js +2 -2
  193. package/build/credentials/ios/actions/SetUpDistributionCertificate.js +2 -2
  194. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +1 -1
  195. package/build/credentials/ios/actions/SetUpPushKey.js +4 -4
  196. package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +5 -5
  197. package/build/credentials/ios/api/GraphqlClient.d.ts +25 -24
  198. package/build/credentials/ios/api/GraphqlClient.js +73 -73
  199. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.d.ts +3 -2
  200. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.js +4 -4
  201. package/build/credentials/ios/api/graphql/mutations/AppleAppIdentifierMutation.d.ts +2 -1
  202. package/build/credentials/ios/api/graphql/mutations/AppleAppIdentifierMutation.js +2 -2
  203. package/build/credentials/ios/api/graphql/mutations/AppleDeviceMutation.d.ts +3 -2
  204. package/build/credentials/ios/api/graphql/mutations/AppleDeviceMutation.js +4 -4
  205. package/build/credentials/ios/api/graphql/mutations/AppleDeviceRegistrationRequestMutation.d.ts +2 -1
  206. package/build/credentials/ios/api/graphql/mutations/AppleDeviceRegistrationRequestMutation.js +2 -2
  207. package/build/credentials/ios/api/graphql/mutations/AppleDistributionCertificateMutation.d.ts +3 -2
  208. package/build/credentials/ios/api/graphql/mutations/AppleDistributionCertificateMutation.js +4 -4
  209. package/build/credentials/ios/api/graphql/mutations/AppleProvisioningProfileMutation.d.ts +4 -3
  210. package/build/credentials/ios/api/graphql/mutations/AppleProvisioningProfileMutation.js +6 -6
  211. package/build/credentials/ios/api/graphql/mutations/ApplePushKeyMutation.d.ts +3 -2
  212. package/build/credentials/ios/api/graphql/mutations/ApplePushKeyMutation.js +4 -4
  213. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +2 -1
  214. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +2 -2
  215. package/build/credentials/ios/api/graphql/mutations/IosAppBuildCredentialsMutation.d.ts +4 -3
  216. package/build/credentials/ios/api/graphql/mutations/IosAppBuildCredentialsMutation.js +6 -6
  217. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.d.ts +4 -3
  218. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.js +6 -6
  219. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +2 -1
  220. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +2 -2
  221. package/build/credentials/ios/api/graphql/queries/AppleAppIdentifierQuery.d.ts +2 -1
  222. package/build/credentials/ios/api/graphql/queries/AppleAppIdentifierQuery.js +2 -2
  223. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +4 -3
  224. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -6
  225. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.d.ts +3 -2
  226. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +4 -4
  227. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.d.ts +2 -1
  228. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +2 -2
  229. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.d.ts +2 -1
  230. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -2
  231. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +3 -2
  232. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +4 -4
  233. package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.d.ts +2 -1
  234. package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.js +2 -2
  235. package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.d.ts +3 -2
  236. package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.js +4 -4
  237. package/build/credentials/manager/HelperActions.d.ts +2 -0
  238. package/build/credentials/manager/ManageAndroid.js +4 -3
  239. package/build/credentials/manager/ManageIos.js +4 -3
  240. package/build/credentials/manager/SelectAndroidBuildCredentials.js +2 -2
  241. package/build/credentials/manager/SelectPlatform.d.ts +3 -1
  242. package/build/credentials/manager/SelectPlatform.js +2 -1
  243. package/build/devices/actions/create/action.d.ts +3 -1
  244. package/build/devices/actions/create/action.js +5 -4
  245. package/build/devices/actions/create/developerPortalMethod.d.ts +2 -1
  246. package/build/devices/actions/create/developerPortalMethod.js +9 -9
  247. package/build/devices/actions/create/inputMethod.d.ts +2 -1
  248. package/build/devices/actions/create/inputMethod.js +4 -4
  249. package/build/devices/actions/create/registrationUrlMethod.d.ts +2 -1
  250. package/build/devices/actions/create/registrationUrlMethod.js +4 -4
  251. package/build/devices/context.d.ts +4 -1
  252. package/build/devices/context.js +2 -1
  253. package/build/devices/manager.d.ts +3 -1
  254. package/build/devices/manager.js +9 -8
  255. package/build/devices/queries.d.ts +4 -3
  256. package/build/devices/queries.js +7 -7
  257. package/build/graphql/client.d.ts +1 -8
  258. package/build/graphql/client.js +1 -39
  259. package/build/graphql/mutations/AppMutation.d.ts +2 -1
  260. package/build/graphql/mutations/AppMutation.js +2 -2
  261. package/build/graphql/mutations/AppVersionMutation.d.ts +2 -1
  262. package/build/graphql/mutations/AppVersionMutation.js +2 -2
  263. package/build/graphql/mutations/BuildMutation.d.ts +3 -2
  264. package/build/graphql/mutations/BuildMutation.js +4 -4
  265. package/build/graphql/mutations/EnvironmentSecretMutation.d.ts +4 -3
  266. package/build/graphql/mutations/EnvironmentSecretMutation.js +6 -6
  267. package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +2 -1
  268. package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +2 -2
  269. package/build/graphql/mutations/PublishMutation.d.ts +4 -3
  270. package/build/graphql/mutations/PublishMutation.js +6 -6
  271. package/build/graphql/mutations/SubmissionMutation.d.ts +3 -2
  272. package/build/graphql/mutations/SubmissionMutation.js +4 -4
  273. package/build/graphql/mutations/UploadSessionMutation.d.ts +2 -1
  274. package/build/graphql/mutations/UploadSessionMutation.js +2 -2
  275. package/build/graphql/mutations/WebhookMutation.d.ts +4 -3
  276. package/build/graphql/mutations/WebhookMutation.js +6 -6
  277. package/build/graphql/queries/AppQuery.d.ts +3 -2
  278. package/build/graphql/queries/AppQuery.js +4 -4
  279. package/build/graphql/queries/AppVersionQuery.d.ts +2 -1
  280. package/build/graphql/queries/AppVersionQuery.js +2 -2
  281. package/build/graphql/queries/BranchQuery.d.ts +4 -3
  282. package/build/graphql/queries/BranchQuery.js +6 -6
  283. package/build/graphql/queries/BuildQuery.d.ts +4 -3
  284. package/build/graphql/queries/BuildQuery.js +6 -6
  285. package/build/graphql/queries/ChannelQuery.d.ts +3 -2
  286. package/build/graphql/queries/ChannelQuery.js +4 -4
  287. package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +3 -2
  288. package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -4
  289. package/build/graphql/queries/PublishQuery.d.ts +3 -2
  290. package/build/graphql/queries/PublishQuery.js +4 -4
  291. package/build/graphql/queries/StatuspageServiceQuery.d.ts +2 -1
  292. package/build/graphql/queries/StatuspageServiceQuery.js +2 -2
  293. package/build/graphql/queries/SubmissionQuery.d.ts +3 -2
  294. package/build/graphql/queries/SubmissionQuery.js +4 -4
  295. package/build/graphql/queries/UpdateQuery.d.ts +4 -3
  296. package/build/graphql/queries/UpdateQuery.js +6 -6
  297. package/build/graphql/queries/UserQuery.d.ts +2 -1
  298. package/build/graphql/queries/UserQuery.js +2 -2
  299. package/build/graphql/queries/WebhookQuery.d.ts +3 -2
  300. package/build/graphql/queries/WebhookQuery.js +4 -4
  301. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.d.ts +3 -2
  302. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +5 -5
  303. package/build/project/projectUtils.d.ts +3 -2
  304. package/build/project/projectUtils.js +4 -4
  305. package/build/project/publish.d.ts +3 -2
  306. package/build/project/publish.js +7 -7
  307. package/build/submit/ArchiveSource.d.ts +2 -1
  308. package/build/submit/ArchiveSource.js +30 -30
  309. package/build/submit/android/AndroidSubmitter.js +2 -2
  310. package/build/submit/context.d.ts +3 -0
  311. package/build/submit/context.js +3 -2
  312. package/build/submit/ios/IosSubmitter.js +2 -2
  313. package/build/submit/submit.d.ts +2 -1
  314. package/build/submit/submit.js +2 -2
  315. package/build/submit/utils/builds.d.ts +2 -1
  316. package/build/submit/utils/builds.js +2 -2
  317. package/build/submit/utils/errors.d.ts +3 -0
  318. package/build/submit/utils/errors.js +15 -67
  319. package/build/submit/utils/files.d.ts +2 -1
  320. package/build/submit/utils/files.js +2 -2
  321. package/build/submit/utils/wait.d.ts +2 -1
  322. package/build/submit/utils/wait.js +2 -2
  323. package/build/update/android/UpdatesModule.d.ts +2 -1
  324. package/build/update/android/UpdatesModule.js +2 -2
  325. package/build/update/ios/UpdatesModule.d.ts +2 -1
  326. package/build/update/ios/UpdatesModule.js +2 -2
  327. package/build/update/queries.d.ts +4 -3
  328. package/build/update/queries.js +22 -12
  329. package/build/uploads.d.ts +2 -1
  330. package/build/uploads.js +2 -2
  331. package/build/user/SessionManager.d.ts +70 -0
  332. package/build/user/SessionManager.js +258 -0
  333. package/build/user/User.d.ts +0 -9
  334. package/build/user/User.js +1 -60
  335. package/build/user/fetchSessionSecretAndUser.d.ts +9 -0
  336. package/build/user/fetchSessionSecretAndUser.js +43 -0
  337. package/build/utils/statuspageService.d.ts +2 -1
  338. package/build/utils/statuspageService.js +4 -4
  339. package/oclif.manifest.json +1 -1
  340. package/package.json +2 -2
  341. package/build/commandUtils/context/ActorContextField.d.ts +0 -5
  342. package/build/commandUtils/context/ActorContextField.js +0 -11
  343. package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.d.ts +0 -21
  344. package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.js +0 -75
  345. package/build/user/otp.d.ts +0 -29
  346. package/build/user/otp.js +0 -119
  347. package/build/user/sessionStorage.d.ts +0 -11
  348. package/build/user/sessionStorage.js +0 -36
@@ -12,13 +12,13 @@ const input_1 = require("../../webhooks/input");
12
12
  class WebhookCreate extends EasCommand_1.default {
13
13
  async runAsync() {
14
14
  const { flags } = await this.parse(WebhookCreate);
15
- const { projectConfig: { projectId }, } = await this.getContextAsync(WebhookCreate, {
15
+ const { projectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(WebhookCreate, {
16
16
  nonInteractive: flags['non-interactive'],
17
17
  });
18
18
  const webhookInputParams = await (0, input_1.prepareInputParamsAsync)(flags);
19
19
  const spinner = (0, ora_1.ora)('Creating a webhook').start();
20
20
  try {
21
- await WebhookMutation_1.WebhookMutation.createWebhookAsync(projectId, webhookInputParams);
21
+ await WebhookMutation_1.WebhookMutation.createWebhookAsync(graphqlClient, projectId, webhookInputParams);
22
22
  spinner.succeed('Successfully created a webhook');
23
23
  }
24
24
  catch (err) {
@@ -45,4 +45,5 @@ WebhookCreate.flags = {
45
45
  };
46
46
  WebhookCreate.contextDefinition = {
47
47
  ..._a.ContextOptions.ProjectConfig,
48
+ ..._a.ContextOptions.LoggedIn,
48
49
  };
@@ -10,6 +10,7 @@ export default class WebhookDelete extends EasCommand {
10
10
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  };
12
12
  static contextDefinition: {
13
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
13
14
  projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
14
15
  };
15
16
  runAsync(): Promise<void>;
@@ -16,12 +16,12 @@ const formatWebhook_1 = require("../../webhooks/formatWebhook");
16
16
  class WebhookDelete extends EasCommand_1.default {
17
17
  async runAsync() {
18
18
  let { args: { ID: webhookId }, flags: { 'non-interactive': nonInteractive }, } = await this.parse(WebhookDelete);
19
- const { projectConfig: { projectId }, } = await this.getContextAsync(WebhookDelete, {
19
+ const { projectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(WebhookDelete, {
20
20
  nonInteractive,
21
21
  });
22
- let webhook = webhookId && (await WebhookQuery_1.WebhookQuery.byIdAsync(webhookId));
22
+ let webhook = webhookId && (await WebhookQuery_1.WebhookQuery.byIdAsync(graphqlClient, webhookId));
23
23
  if (!webhookId) {
24
- const webhooks = await fetchWebhooksByAppIdAsync(projectId);
24
+ const webhooks = await fetchWebhooksByAppIdAsync(graphqlClient, projectId);
25
25
  if (webhooks.length === 0) {
26
26
  process.exit(1);
27
27
  }
@@ -56,7 +56,7 @@ class WebhookDelete extends EasCommand_1.default {
56
56
  }
57
57
  const spinner = (0, ora_1.ora)('Deleting the webhook').start();
58
58
  try {
59
- await WebhookMutation_1.WebhookMutation.deleteWebhookAsync(webhookId);
59
+ await WebhookMutation_1.WebhookMutation.deleteWebhookAsync(graphqlClient, webhookId);
60
60
  spinner.succeed('Successfully deleted the webhook');
61
61
  }
62
62
  catch (err) {
@@ -80,11 +80,12 @@ WebhookDelete.flags = {
80
80
  };
81
81
  WebhookDelete.contextDefinition = {
82
82
  ..._a.ContextOptions.ProjectConfig,
83
+ ..._a.ContextOptions.LoggedIn,
83
84
  };
84
- async function fetchWebhooksByAppIdAsync(appId) {
85
+ async function fetchWebhooksByAppIdAsync(graphqlClient, appId) {
85
86
  const spinner = (0, ora_1.ora)('Fetching webhooks').start();
86
87
  try {
87
- const webhooks = await WebhookQuery_1.WebhookQuery.byAppIdAsync(appId);
88
+ const webhooks = await WebhookQuery_1.WebhookQuery.byAppIdAsync(graphqlClient, appId);
88
89
  if (webhooks.length === 0) {
89
90
  spinner.fail('There are no webhooks on the project');
90
91
  return [];
@@ -6,6 +6,7 @@ export default class WebhookList extends EasCommand {
6
6
  event: import("@oclif/core/lib/interfaces").OptionFlag<WebhookType>;
7
7
  };
8
8
  static contextDefinition: {
9
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
9
10
  projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
10
11
  };
11
12
  runAsync(): Promise<void>;
@@ -14,13 +14,13 @@ const formatWebhook_1 = require("../../webhooks/formatWebhook");
14
14
  class WebhookList extends EasCommand_1.default {
15
15
  async runAsync() {
16
16
  const { flags: { event }, } = await this.parse(WebhookList);
17
- const { projectConfig: { projectId }, } = await this.getContextAsync(WebhookList, {
17
+ const { projectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(WebhookList, {
18
18
  nonInteractive: true,
19
19
  });
20
- const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
20
+ const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
21
21
  const spinner = (0, ora_1.ora)(`Fetching the list of webhook on project ${projectDisplayName}`).start();
22
22
  try {
23
- const webhooks = await WebhookQuery_1.WebhookQuery.byAppIdAsync(projectId, event && { event });
23
+ const webhooks = await WebhookQuery_1.WebhookQuery.byAppIdAsync(graphqlClient, projectId, event && { event });
24
24
  if (webhooks.length === 0) {
25
25
  spinner.fail(`There are no webhooks on project ${projectDisplayName}`);
26
26
  }
@@ -49,4 +49,5 @@ WebhookList.flags = {
49
49
  };
50
50
  WebhookList.contextDefinition = {
51
51
  ..._a.ContextOptions.ProjectConfig,
52
+ ..._a.ContextOptions.LoggedIn,
52
53
  };
@@ -9,5 +9,8 @@ export default class WebhookUpdate extends EasCommand {
9
9
  url: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
10
  secret: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
11
  };
12
+ static contextDefinition: {
13
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
14
+ };
12
15
  runAsync(): Promise<void>;
13
16
  }
@@ -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 core_1 = require("@oclif/core");
@@ -13,12 +14,13 @@ const input_1 = require("../../webhooks/input");
13
14
  class WebhookUpdate extends EasCommand_1.default {
14
15
  async runAsync() {
15
16
  const { flags } = await this.parse(WebhookUpdate);
17
+ const { loggedIn: { graphqlClient }, } = await this.getContextAsync(WebhookUpdate, { nonInteractive: flags['non-interactive'] });
16
18
  const webhookId = flags.id;
17
- const webhook = await WebhookQuery_1.WebhookQuery.byIdAsync(webhookId);
19
+ const webhook = await WebhookQuery_1.WebhookQuery.byIdAsync(graphqlClient, webhookId);
18
20
  const webhookInputParams = await (0, input_1.prepareInputParamsAsync)((0, pick_1.default)(flags, ['event', 'url', 'secret', 'non-interactive']), webhook);
19
21
  const spinner = (0, ora_1.ora)('Updating a webhook').start();
20
22
  try {
21
- await WebhookMutation_1.WebhookMutation.updateWebhookAsync(webhookId, webhookInputParams);
23
+ await WebhookMutation_1.WebhookMutation.updateWebhookAsync(graphqlClient, webhookId, webhookInputParams);
22
24
  spinner.succeed('Successfully updated a webhook');
23
25
  }
24
26
  catch (err) {
@@ -28,6 +30,7 @@ class WebhookUpdate extends EasCommand_1.default {
28
30
  }
29
31
  }
30
32
  exports.default = WebhookUpdate;
33
+ _a = WebhookUpdate;
31
34
  WebhookUpdate.description = 'update a webhook';
32
35
  WebhookUpdate.flags = {
33
36
  id: core_1.Flags.string({
@@ -46,3 +49,6 @@ WebhookUpdate.flags = {
46
49
  }),
47
50
  ...flags_1.EASNonInteractiveFlag,
48
51
  };
52
+ WebhookUpdate.contextDefinition = {
53
+ ..._a.ContextOptions.LoggedIn,
54
+ };
@@ -6,5 +6,8 @@ export default class WebhookView extends EasCommand {
6
6
  required: boolean;
7
7
  description: string;
8
8
  }[];
9
+ static contextDefinition: {
10
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
11
+ };
9
12
  runAsync(): Promise<void>;
10
13
  }
@@ -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 EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
@@ -9,9 +10,10 @@ const formatWebhook_1 = require("../../webhooks/formatWebhook");
9
10
  class WebhookView extends EasCommand_1.default {
10
11
  async runAsync() {
11
12
  const { args: { ID: webhookId }, } = await this.parse(WebhookView);
13
+ const { loggedIn: { graphqlClient }, } = await this.getContextAsync(WebhookView, { nonInteractive: true });
12
14
  const spinner = (0, ora_1.ora)(`Fetching the webhook details for ID ${webhookId}`).start();
13
15
  try {
14
- const webhook = await WebhookQuery_1.WebhookQuery.byIdAsync(webhookId);
16
+ const webhook = await WebhookQuery_1.WebhookQuery.byIdAsync(graphqlClient, webhookId);
15
17
  spinner.succeed(`Found the webhook details`);
16
18
  log_1.default.log(`\n${(0, formatWebhook_1.formatWebhook)(webhook)}`);
17
19
  }
@@ -22,6 +24,7 @@ class WebhookView extends EasCommand_1.default {
22
24
  }
23
25
  }
24
26
  exports.default = WebhookView;
27
+ _a = WebhookView;
25
28
  WebhookView.description = 'view a webhook';
26
29
  WebhookView.args = [
27
30
  {
@@ -30,3 +33,6 @@ WebhookView.args = [
30
33
  description: 'ID of the webhook to view',
31
34
  },
32
35
  ];
36
+ WebhookView.contextDefinition = {
37
+ ..._a.ContextOptions.LoggedIn,
38
+ };
@@ -8,8 +8,8 @@ class AssignFcm {
8
8
  this.app = app;
9
9
  }
10
10
  async runAsync(ctx, fcm) {
11
- const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(this.app);
12
- const updatedAppCredentials = await ctx.android.updateAndroidAppCredentialsAsync(appCredentials, {
11
+ const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(ctx.graphqlClient, this.app);
12
+ const updatedAppCredentials = await ctx.android.updateAndroidAppCredentialsAsync(ctx.graphqlClient, appCredentials, {
13
13
  androidFcmId: fcm.id,
14
14
  });
15
15
  log_1.default.succeed(`FCM API Key assigned to ${this.app.androidApplicationIdentifier}`);
@@ -8,8 +8,8 @@ class AssignGoogleServiceAccountKey {
8
8
  this.app = app;
9
9
  }
10
10
  async runAsync(ctx, googleServiceAccountKey) {
11
- const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(this.app);
12
- const updatedAppCredentials = await ctx.android.updateAndroidAppCredentialsAsync(appCredentials, {
11
+ const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(ctx.graphqlClient, this.app);
12
+ const updatedAppCredentials = await ctx.android.updateAndroidAppCredentialsAsync(ctx.graphqlClient, appCredentials, {
13
13
  googleServiceAccountKeyForSubmissionsId: googleServiceAccountKey.id,
14
14
  });
15
15
  log_1.default.succeed(`Google Service Account Key assigned to ${this.app.androidApplicationIdentifier} for submissions`);
@@ -13,11 +13,11 @@ const prompts_1 = require("../../../prompts");
13
13
  * EAS credentials set up yet
14
14
  */
15
15
  async function canCopyLegacyCredentialsAsync(ctx, app) {
16
- const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(app);
16
+ const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, app);
17
17
  if (appCredentials) {
18
18
  return false; // modern credentials already exist
19
19
  }
20
- const legacyAppCredentials = await ctx.android.getLegacyAndroidAppCredentialsWithCommonFieldsAsync(app);
20
+ const legacyAppCredentials = await ctx.android.getLegacyAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, app);
21
21
  return !!legacyAppCredentials; // user has some legacy credentials
22
22
  }
23
23
  exports.canCopyLegacyCredentialsAsync = canCopyLegacyCredentialsAsync;
@@ -26,22 +26,22 @@ async function promptUserAndCopyLegacyCredentialsAsync(ctx, app) {
26
26
  (0, assert_1.default)(await canCopyLegacyCredentialsAsync(ctx, app), 'User not eligible to copy classic build credentials to EAS');
27
27
  const spinner = (0, ora_1.ora)('Classic credentials detected, copying to EAS...').start();
28
28
  try {
29
- const legacyAppCredentials = await ctx.android.getLegacyAndroidAppCredentialsWithCommonFieldsAsync(app);
29
+ const legacyAppCredentials = await ctx.android.getLegacyAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, app);
30
30
  if (!legacyAppCredentials) {
31
31
  return;
32
32
  }
33
- const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(app);
33
+ const appCredentials = await ctx.android.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(ctx.graphqlClient, app);
34
34
  const legacyFcm = legacyAppCredentials.androidFcm;
35
35
  if (legacyFcm) {
36
- const clonedFcm = await ctx.android.createFcmAsync(app.account, legacyFcm.credential, legacyFcm.version);
37
- await ctx.android.updateAndroidAppCredentialsAsync(appCredentials, {
36
+ const clonedFcm = await ctx.android.createFcmAsync(ctx.graphqlClient, app.account, legacyFcm.credential, legacyFcm.version);
37
+ await ctx.android.updateAndroidAppCredentialsAsync(ctx.graphqlClient, appCredentials, {
38
38
  androidFcmId: clonedFcm.id,
39
39
  });
40
40
  }
41
- const legacyBuildCredentials = await ctx.android.getLegacyAndroidAppBuildCredentialsAsync(app);
41
+ const legacyBuildCredentials = await ctx.android.getLegacyAndroidAppBuildCredentialsAsync(ctx.graphqlClient, app);
42
42
  const legacyKeystore = (_a = legacyBuildCredentials === null || legacyBuildCredentials === void 0 ? void 0 : legacyBuildCredentials.androidKeystore) !== null && _a !== void 0 ? _a : null;
43
43
  if (legacyKeystore) {
44
- const clonedKeystore = await ctx.android.createKeystoreAsync(app.account, {
44
+ const clonedKeystore = await ctx.android.createKeystoreAsync(ctx.graphqlClient, app.account, {
45
45
  keystore: legacyKeystore.keystore,
46
46
  keystorePassword: legacyKeystore.keystorePassword,
47
47
  keyAlias: legacyKeystore.keyAlias,
@@ -64,7 +64,7 @@ async function getAppLookupParamsFromContextAsync(ctx, gradleContext) {
64
64
  ctx.ensureProjectContext();
65
65
  const projectName = ctx.exp.slug;
66
66
  const projectId = ctx.projectId;
67
- const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
67
+ const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(ctx.graphqlClient, projectId);
68
68
  const androidApplicationIdentifier = await (0, applicationId_1.getApplicationIdAsync)(ctx.projectDir, ctx.exp, gradleContext);
69
69
  if (!androidApplicationIdentifier) {
70
70
  throw new Error(`android.package needs to be defined in your ${(0, projectUtils_1.getProjectConfigDescription)(ctx.projectDir)} file`);
@@ -74,11 +74,11 @@ async function getAppLookupParamsFromContextAsync(ctx, gradleContext) {
74
74
  exports.getAppLookupParamsFromContextAsync = getAppLookupParamsFromContextAsync;
75
75
  async function createOrUpdateDefaultAndroidAppBuildCredentialsAsync(ctx, appLookupParams, { androidKeystoreId, }) {
76
76
  (0, assert_1.default)(!ctx.nonInteractive, 'createOrUpdateDefaultAndroidAppBuildCredentialsAsync must be run in interactive mode');
77
- const existingDefaultBuildCredentials = await ctx.android.getDefaultAndroidAppBuildCredentialsAsync(appLookupParams);
77
+ const existingDefaultBuildCredentials = await ctx.android.getDefaultAndroidAppBuildCredentialsAsync(ctx.graphqlClient, appLookupParams);
78
78
  if (existingDefaultBuildCredentials) {
79
- return await ctx.android.updateAndroidAppBuildCredentialsAsync(existingDefaultBuildCredentials, { androidKeystoreId });
79
+ return await ctx.android.updateAndroidAppBuildCredentialsAsync(ctx.graphqlClient, existingDefaultBuildCredentials, { androidKeystoreId });
80
80
  }
81
- return await ctx.android.createAndroidAppBuildCredentialsAsync(appLookupParams, {
81
+ return await ctx.android.createAndroidAppBuildCredentialsAsync(ctx.graphqlClient, appLookupParams, {
82
82
  name: generateRandomName(),
83
83
  isDefault: true,
84
84
  androidKeystoreId,
@@ -21,7 +21,7 @@ class CreateFcm {
21
21
  validate: (value) => value.length > 0 || "FCM API Key can't be empty",
22
22
  },
23
23
  ]);
24
- const fcmFragment = await ctx.android.createFcmAsync(this.account, fcmApiKey, generated_1.AndroidFcmVersion.Legacy);
24
+ const fcmFragment = await ctx.android.createFcmAsync(ctx.graphqlClient, this.account, fcmApiKey, generated_1.AndroidFcmVersion.Legacy);
25
25
  log_1.default.succeed('Uploaded FCM API Key');
26
26
  return fcmFragment;
27
27
  }
@@ -16,7 +16,7 @@ class CreateGoogleServiceAccountKey {
16
16
  throw new Error(`New Google Service Account Key cannot be created in non-interactive mode.`);
17
17
  }
18
18
  const jsonKeyObject = await this.provideAsync(ctx);
19
- const gsaKeyFragment = await ctx.android.createGoogleServiceAccountKeyAsync(this.account, jsonKeyObject);
19
+ const gsaKeyFragment = await ctx.android.createGoogleServiceAccountKeyAsync(ctx.graphqlClient, this.account, jsonKeyObject);
20
20
  log_1.default.succeed('Uploaded Google Service Account Key.');
21
21
  return gsaKeyFragment;
22
22
  }
@@ -16,19 +16,19 @@ class CreateKeystore {
16
16
  throw new Error(`New keystore cannot be created in non-interactive mode.`);
17
17
  }
18
18
  const projectId = ctx.projectId;
19
- const keystore = await this.provideOrGenerateAsync(projectId);
20
- const keystoreFragment = await ctx.android.createKeystoreAsync(this.account, keystore);
19
+ const keystore = await this.provideOrGenerateAsync(ctx.graphqlClient, projectId);
20
+ const keystoreFragment = await ctx.android.createKeystoreAsync(ctx.graphqlClient, this.account, keystore);
21
21
  log_1.default.succeed('Created keystore');
22
22
  return keystoreFragment;
23
23
  }
24
- async provideOrGenerateAsync(projectId) {
24
+ async provideOrGenerateAsync(graphqlClient, projectId) {
25
25
  const providedKeystore = await (0, promptForCredentials_1.askForUserProvidedAsync)(credentials_1.keystoreSchema);
26
26
  if (providedKeystore) {
27
27
  const providedKeystoreWithType = (0, keystoreNew_1.getKeystoreWithType)(providedKeystore);
28
28
  (0, keystoreNew_1.validateKeystore)(providedKeystoreWithType);
29
29
  return providedKeystoreWithType;
30
30
  }
31
- return await (0, keystore_1.generateRandomKeystoreAsync)(projectId);
31
+ return await (0, keystore_1.generateRandomKeystoreAsync)(graphqlClient, projectId);
32
32
  }
33
33
  }
34
34
  exports.CreateKeystore = CreateKeystore;
@@ -13,7 +13,7 @@ class RemoveFcm {
13
13
  if (ctx.nonInteractive) {
14
14
  throw new Error("Deleting an FCM API Key is a destructive operation. Start the CLI without the '--non-interactive' flag to delete the credentials.");
15
15
  }
16
- const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(this.app);
16
+ const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
17
17
  const fcm = appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.androidFcm;
18
18
  if (!fcm) {
19
19
  log_1.default.warn(`There is no valid FCM API Key defined for ${(0, GraphqlClient_1.formatProjectFullName)(this.app)}, ${this.app.androidApplicationIdentifier}`);
@@ -26,7 +26,7 @@ class RemoveFcm {
26
26
  if (!confirm) {
27
27
  return;
28
28
  }
29
- await ctx.android.deleteFcmAsync(fcm);
29
+ await ctx.android.deleteFcmAsync(ctx.graphqlClient, fcm);
30
30
  log_1.default.succeed('FCM API Key removed');
31
31
  }
32
32
  }
@@ -13,7 +13,7 @@ class SelectAndRemoveGoogleServiceAccountKey {
13
13
  if (ctx.nonInteractive) {
14
14
  throw new Error(`Cannot select and remove Google Service Account Keys in non-interactive mode.`);
15
15
  }
16
- const gsaKeyFragments = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(this.account);
16
+ const gsaKeyFragments = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(ctx.graphqlClient, this.account);
17
17
  if (gsaKeyFragments.length === 0) {
18
18
  log_1.default.warn("There aren't any Google Service Account Keys associated with your account.");
19
19
  return;
@@ -42,7 +42,7 @@ class RemoveGoogleServiceAccountKey {
42
42
  return;
43
43
  }
44
44
  log_1.default.log('Removing Google Service Account Key.');
45
- await ctx.android.deleteGoogleServiceAccountKeyAsync(this.googleServiceAccountKey);
45
+ await ctx.android.deleteGoogleServiceAccountKeyAsync(ctx.graphqlClient, this.googleServiceAccountKey);
46
46
  }
47
47
  }
48
48
  exports.RemoveGoogleServiceAccountKey = RemoveGoogleServiceAccountKey;
@@ -28,7 +28,7 @@ class RemoveKeystore {
28
28
  return;
29
29
  }
30
30
  await new DownloadKeystore_1.BackupKeystore(this.app).runAsync(ctx, buildCredentials);
31
- await ctx.android.deleteKeystoreAsync(keystore);
31
+ await ctx.android.deleteKeystoreAsync(ctx.graphqlClient, keystore);
32
32
  log_1.default.succeed('Keystore removed');
33
33
  }
34
34
  displayWarning() {
@@ -40,7 +40,7 @@ class SetUpBuildCredentials {
40
40
  }
41
41
  async assignBuildCredentialsAsync({ ctx, app, name, keystore, }) {
42
42
  if (name) {
43
- return await ctx.android.createOrUpdateAndroidAppBuildCredentialsByNameAsync(app, name, {
43
+ return await ctx.android.createOrUpdateAndroidAppBuildCredentialsByNameAsync(ctx.graphqlClient, app, name, {
44
44
  androidKeystoreId: keystore.id,
45
45
  });
46
46
  }
@@ -53,7 +53,7 @@ class SetUpBuildCredentials {
53
53
  if (name) {
54
54
  return await this.getFullySetupBuildCredentialsByNameAsync({ ctx, app, name });
55
55
  }
56
- const defaultBuildCredentials = await ctx.android.getDefaultAndroidAppBuildCredentialsAsync(app);
56
+ const defaultBuildCredentials = await ctx.android.getDefaultAndroidAppBuildCredentialsAsync(ctx.graphqlClient, app);
57
57
  const defaultKeystore = (_a = defaultBuildCredentials === null || defaultBuildCredentials === void 0 ? void 0 : defaultBuildCredentials.androidKeystore) !== null && _a !== void 0 ? _a : null;
58
58
  if (defaultKeystore) {
59
59
  (0, ora_1.ora)(`Using Keystore from configuration: ${(0, nullthrows_1.default)(defaultBuildCredentials).name} (default)`).succeed();
@@ -63,7 +63,7 @@ class SetUpBuildCredentials {
63
63
  }
64
64
  async getFullySetupBuildCredentialsByNameAsync({ ctx, app, name, }) {
65
65
  var _a;
66
- const maybeBuildCredentials = await ctx.android.getAndroidAppBuildCredentialsByNameAsync(app, name);
66
+ const maybeBuildCredentials = await ctx.android.getAndroidAppBuildCredentialsByNameAsync(ctx.graphqlClient, app, name);
67
67
  const keystore = (_a = maybeBuildCredentials === null || maybeBuildCredentials === void 0 ? void 0 : maybeBuildCredentials.androidKeystore) !== null && _a !== void 0 ? _a : null;
68
68
  if (keystore) {
69
69
  const buildCredentials = (0, nullthrows_1.default)(maybeBuildCredentials);
@@ -47,17 +47,17 @@ class SetUpBuildCredentialsFromCredentialsJson {
47
47
  return null;
48
48
  }
49
49
  }
50
- const keystoreFragment = await ctx.android.createKeystoreAsync(this.app.account, providedKeystoreWithType);
50
+ const keystoreFragment = await ctx.android.createKeystoreAsync(ctx.graphqlClient, this.app.account, providedKeystoreWithType);
51
51
  let buildCredentials;
52
52
  if (selectBuildCredentialsResult.resultType ===
53
53
  SelectAndroidBuildCredentials_1.SelectAndroidBuildCredentialsResultType.CREATE_REQUEST) {
54
- buildCredentials = await ctx.android.createAndroidAppBuildCredentialsAsync(this.app, {
54
+ buildCredentials = await ctx.android.createAndroidAppBuildCredentialsAsync(ctx.graphqlClient, this.app, {
55
55
  ...selectBuildCredentialsResult.result,
56
56
  androidKeystoreId: keystoreFragment.id,
57
57
  });
58
58
  }
59
59
  else {
60
- buildCredentials = await ctx.android.updateAndroidAppBuildCredentialsAsync(selectBuildCredentialsResult.result, {
60
+ buildCredentials = await ctx.android.updateAndroidAppBuildCredentialsAsync(ctx.graphqlClient, selectBuildCredentialsResult.result, {
61
61
  androidKeystoreId: keystoreFragment.id,
62
62
  });
63
63
  }
@@ -17,12 +17,12 @@ class SetUpGoogleServiceAccountKey {
17
17
  const isKeySetup = await this.isGoogleServiceAccountKeySetupAsync(ctx);
18
18
  if (isKeySetup) {
19
19
  log_1.default.succeed('Google Service Account Key already set up.');
20
- return (0, nullthrows_1.default)(await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(this.app), 'androidAppCredentials cannot be null if google service account key is already set up');
20
+ return (0, nullthrows_1.default)(await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app), 'androidAppCredentials cannot be null if google service account key is already set up');
21
21
  }
22
22
  if (ctx.nonInteractive) {
23
23
  throw new errors_1.MissingCredentialsNonInteractiveError('Google Service Account Keys cannot be set up in --non-interactive mode.');
24
24
  }
25
- const keysForAccount = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(this.app.account);
25
+ const keysForAccount = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(ctx.graphqlClient, this.app.account);
26
26
  let googleServiceAccountKey = null;
27
27
  if (keysForAccount.length === 0) {
28
28
  googleServiceAccountKey = await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(this.app.account).runAsync(ctx);
@@ -33,7 +33,7 @@ class SetUpGoogleServiceAccountKey {
33
33
  return await new AssignGoogleServiceAccountKey_1.AssignGoogleServiceAccountKey(this.app).runAsync(ctx, googleServiceAccountKey);
34
34
  }
35
35
  async isGoogleServiceAccountKeySetupAsync(ctx) {
36
- const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(this.app);
36
+ const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
37
37
  return !!(appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.googleServiceAccountKeyForSubmissions);
38
38
  }
39
39
  async createOrUseExistingKeyAsync(ctx) {
@@ -12,7 +12,7 @@ class UseExistingGoogleServiceAccountKey {
12
12
  if (ctx.nonInteractive) {
13
13
  throw new Error(`Existing Google Service Account Key cannot be chosen in non-interactive mode.`);
14
14
  }
15
- const gsaKeyFragments = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(this.account);
15
+ const gsaKeyFragments = await ctx.android.getGoogleServiceAccountKeysForAccountAsync(ctx.graphqlClient, this.account);
16
16
  if (gsaKeyFragments.length === 0) {
17
17
  log_1.default.error("There aren't any Google Service Account Keys associated with your account.");
18
18
  return null;
@@ -1,3 +1,4 @@
1
+ import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
1
2
  import { AccountFragment, AndroidAppBuildCredentialsFragment, AndroidFcmFragment, AndroidFcmVersion, AndroidKeystoreFragment, CommonAndroidAppCredentialsFragment, GoogleServiceAccountKeyFragment } from '../../../graphql/generated';
2
3
  import { GoogleServiceAccountKey, KeystoreWithType } from '../credentials';
3
4
  export interface AppLookupParams {
@@ -5,34 +6,34 @@ export interface AppLookupParams {
5
6
  projectName: string;
6
7
  androidApplicationIdentifier: string;
7
8
  }
8
- export declare function getAndroidAppCredentialsWithCommonFieldsAsync(appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment | null>;
9
- export declare function getAndroidAppBuildCredentialsListAsync(appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment[]>;
10
- export declare function getLegacyAndroidAppCredentialsWithCommonFieldsAsync(appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment | null>;
11
- export declare function getLegacyAndroidAppBuildCredentialsAsync(appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment | null>;
12
- export declare function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment>;
13
- export declare function updateAndroidAppCredentialsAsync(appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }: {
9
+ export declare function getAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment | null>;
10
+ export declare function getAndroidAppBuildCredentialsListAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment[]>;
11
+ export declare function getLegacyAndroidAppCredentialsWithCommonFieldsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment | null>;
12
+ export declare function getLegacyAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment | null>;
13
+ export declare function createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<CommonAndroidAppCredentialsFragment>;
14
+ export declare function updateAndroidAppCredentialsAsync(graphqlClient: ExpoGraphqlClient, appCredentials: CommonAndroidAppCredentialsFragment, { androidFcmId, googleServiceAccountKeyForSubmissionsId, }: {
14
15
  androidFcmId?: string;
15
16
  googleServiceAccountKeyForSubmissionsId?: string;
16
17
  }): Promise<CommonAndroidAppCredentialsFragment>;
17
- export declare function updateAndroidAppBuildCredentialsAsync(buildCredentials: AndroidAppBuildCredentialsFragment, { androidKeystoreId, }: {
18
+ export declare function updateAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, buildCredentials: AndroidAppBuildCredentialsFragment, { androidKeystoreId, }: {
18
19
  androidKeystoreId: string;
19
20
  }): Promise<AndroidAppBuildCredentialsFragment>;
20
- export declare function createAndroidAppBuildCredentialsAsync(appLookupParams: AppLookupParams, { name, isDefault, androidKeystoreId, }: {
21
+ export declare function createAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams, { name, isDefault, androidKeystoreId, }: {
21
22
  name: string;
22
23
  isDefault: boolean;
23
24
  androidKeystoreId: string;
24
25
  }): Promise<AndroidAppBuildCredentialsFragment>;
25
- export declare function getDefaultAndroidAppBuildCredentialsAsync(appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment | null>;
26
- export declare function getAndroidAppBuildCredentialsByNameAsync(appLookupParams: AppLookupParams, name: string): Promise<AndroidAppBuildCredentialsFragment | null>;
27
- export declare function createOrUpdateAndroidAppBuildCredentialsByNameAsync(appLookupParams: AppLookupParams, name: string, { androidKeystoreId, }: {
26
+ export declare function getDefaultAndroidAppBuildCredentialsAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams): Promise<AndroidAppBuildCredentialsFragment | null>;
27
+ export declare function getAndroidAppBuildCredentialsByNameAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams, name: string): Promise<AndroidAppBuildCredentialsFragment | null>;
28
+ export declare function createOrUpdateAndroidAppBuildCredentialsByNameAsync(graphqlClient: ExpoGraphqlClient, appLookupParams: AppLookupParams, name: string, { androidKeystoreId, }: {
28
29
  androidKeystoreId: string;
29
30
  }): Promise<AndroidAppBuildCredentialsFragment>;
30
31
  export declare function createOrUpdateDefaultIosAppBuildCredentialsAsync(): Promise<void>;
31
- export declare function createKeystoreAsync(account: AccountFragment, keystore: KeystoreWithType): Promise<AndroidKeystoreFragment>;
32
- export declare function deleteKeystoreAsync(keystore: AndroidKeystoreFragment): Promise<void>;
33
- export declare function createFcmAsync(account: AccountFragment, fcmApiKey: string, version: AndroidFcmVersion): Promise<AndroidFcmFragment>;
34
- export declare function deleteFcmAsync(fcm: AndroidFcmFragment): Promise<void>;
35
- export declare function createGoogleServiceAccountKeyAsync(account: AccountFragment, jsonKey: GoogleServiceAccountKey): Promise<GoogleServiceAccountKeyFragment>;
36
- export declare function deleteGoogleServiceAccountKeyAsync(googleServiceAccountKey: GoogleServiceAccountKeyFragment): Promise<void>;
37
- export declare function getGoogleServiceAccountKeysForAccountAsync(account: AccountFragment): Promise<GoogleServiceAccountKeyFragment[]>;
32
+ export declare function createKeystoreAsync(graphqlClient: ExpoGraphqlClient, account: AccountFragment, keystore: KeystoreWithType): Promise<AndroidKeystoreFragment>;
33
+ export declare function deleteKeystoreAsync(graphqlClient: ExpoGraphqlClient, keystore: AndroidKeystoreFragment): Promise<void>;
34
+ export declare function createFcmAsync(graphqlClient: ExpoGraphqlClient, account: AccountFragment, fcmApiKey: string, version: AndroidFcmVersion): Promise<AndroidFcmFragment>;
35
+ export declare function deleteFcmAsync(graphqlClient: ExpoGraphqlClient, fcm: AndroidFcmFragment): Promise<void>;
36
+ export declare function createGoogleServiceAccountKeyAsync(graphqlClient: ExpoGraphqlClient, account: AccountFragment, jsonKey: GoogleServiceAccountKey): Promise<GoogleServiceAccountKeyFragment>;
37
+ export declare function deleteGoogleServiceAccountKeyAsync(graphqlClient: ExpoGraphqlClient, googleServiceAccountKey: GoogleServiceAccountKeyFragment): Promise<void>;
38
+ export declare function getGoogleServiceAccountKeysForAccountAsync(graphqlClient: ExpoGraphqlClient, account: AccountFragment): Promise<GoogleServiceAccountKeyFragment[]>;
38
39
  export declare const formatProjectFullName: ({ account, projectName }: AppLookupParams) => string;