eas-cli 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/README.md +8 -1034
  2. package/build/branch/queries.d.ts +10 -2
  3. package/build/branch/queries.js +27 -24
  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/graphql.js +2 -1
  8. package/build/build/android/prepareJob.js +4 -3
  9. package/build/build/android/syncProjectConfiguration.d.ts +2 -1
  10. package/build/build/android/syncProjectConfiguration.js +2 -2
  11. package/build/build/build.js +15 -4
  12. package/build/build/configure.js +2 -2
  13. package/build/build/createContext.d.ts +5 -1
  14. package/build/build/createContext.js +8 -14
  15. package/build/build/ios/build.js +2 -1
  16. package/build/build/ios/credentials.js +1 -1
  17. package/build/build/ios/graphql.js +2 -1
  18. package/build/build/ios/prepareJob.js +4 -3
  19. package/build/build/ios/syncProjectConfiguration.d.ts +2 -1
  20. package/build/build/ios/syncProjectConfiguration.js +2 -2
  21. package/build/build/local.js +1 -1
  22. package/build/build/metadata.js +1 -2
  23. package/build/build/queries.d.ts +9 -0
  24. package/build/build/queries.js +51 -0
  25. package/build/build/runBuildAndSubmit.d.ts +3 -1
  26. package/build/build/runBuildAndSubmit.js +15 -7
  27. package/build/build/utils/repository.js +5 -1
  28. package/build/channel/queries.d.ts +17 -0
  29. package/build/channel/queries.js +137 -0
  30. package/build/channel/utils.d.ts +22 -0
  31. package/build/channel/utils.js +87 -0
  32. package/build/commandUtils/EasCommand.d.ts +68 -7
  33. package/build/commandUtils/EasCommand.js +60 -79
  34. package/build/commandUtils/context/ActorContextField.d.ts +5 -0
  35. package/build/commandUtils/context/ActorContextField.js +11 -0
  36. package/build/commandUtils/context/ContextField.d.ts +6 -0
  37. package/build/commandUtils/context/ContextField.js +5 -0
  38. package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +11 -0
  39. package/build/commandUtils/context/DynamicProjectConfigContextField.js +27 -0
  40. package/build/commandUtils/context/OptionalProjectConfigContextField.d.ts +13 -0
  41. package/build/commandUtils/context/OptionalProjectConfigContextField.js +37 -0
  42. package/build/commandUtils/context/ProjectConfigContextField.d.ts +13 -0
  43. package/build/commandUtils/context/ProjectConfigContextField.js +23 -0
  44. package/build/commandUtils/context/ProjectDirContextField.d.ts +4 -0
  45. package/build/commandUtils/context/ProjectDirContextField.js +11 -0
  46. package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.d.ts +21 -0
  47. package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.js +75 -0
  48. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.d.ts +17 -0
  49. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +102 -0
  50. package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +24 -0
  51. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +108 -0
  52. package/build/commandUtils/flags.d.ts +10 -0
  53. package/build/commandUtils/flags.js +23 -0
  54. package/build/commandUtils/pagination.d.ts +7 -4
  55. package/build/commandUtils/pagination.js +11 -15
  56. package/build/commands/account/login.d.ts +0 -2
  57. package/build/commands/account/login.js +2 -7
  58. package/build/commands/account/logout.d.ts +0 -2
  59. package/build/commands/account/logout.js +0 -5
  60. package/build/commands/account/view.d.ts +0 -2
  61. package/build/commands/account/view.js +0 -5
  62. package/build/commands/analytics.d.ts +0 -1
  63. package/build/commands/analytics.js +0 -4
  64. package/build/commands/branch/create.d.ts +4 -0
  65. package/build/commands/branch/create.js +18 -18
  66. package/build/commands/branch/delete.d.ts +4 -0
  67. package/build/commands/branch/delete.js +29 -26
  68. package/build/commands/branch/list.d.ts +5 -2
  69. package/build/commands/branch/list.js +13 -8
  70. package/build/commands/branch/rename.d.ts +5 -1
  71. package/build/commands/branch/rename.js +15 -13
  72. package/build/commands/branch/view.d.ts +5 -2
  73. package/build/commands/branch/view.js +31 -13
  74. package/build/commands/build/cancel.d.ts +7 -0
  75. package/build/commands/build/cancel.js +50 -23
  76. package/build/commands/build/configure.d.ts +3 -0
  77. package/build/commands/build/configure.js +12 -7
  78. package/build/commands/build/index.d.ts +7 -2
  79. package/build/commands/build/index.js +77 -15
  80. package/build/commands/build/inspect.d.ts +5 -0
  81. package/build/commands/build/inspect.js +12 -3
  82. package/build/commands/build/list.d.ts +7 -2
  83. package/build/commands/build/list.js +36 -59
  84. package/build/commands/build/version/set.d.ts +5 -0
  85. package/build/commands/build/version/set.js +22 -14
  86. package/build/commands/build/version/sync.d.ts +5 -0
  87. package/build/commands/build/version/sync.js +22 -13
  88. package/build/commands/build/view.d.ts +3 -0
  89. package/build/commands/build/view.js +20 -14
  90. package/build/commands/channel/create.d.ts +4 -0
  91. package/build/commands/channel/create.js +32 -25
  92. package/build/commands/channel/delete.d.ts +3 -0
  93. package/build/commands/channel/delete.js +36 -59
  94. package/build/commands/channel/edit.d.ts +7 -7
  95. package/build/commands/channel/edit.js +39 -72
  96. package/build/commands/channel/list.d.ts +6 -0
  97. package/build/commands/channel/list.js +20 -76
  98. package/build/commands/channel/rollout.d.ts +5 -1
  99. package/build/commands/channel/rollout.js +34 -35
  100. package/build/commands/channel/view.d.ts +6 -33
  101. package/build/commands/channel/view.js +31 -132
  102. package/build/commands/config.d.ts +6 -2
  103. package/build/commands/config.js +22 -13
  104. package/build/commands/credentials.d.ts +4 -0
  105. package/build/commands/credentials.js +10 -1
  106. package/build/commands/device/create.d.ts +4 -0
  107. package/build/commands/device/create.js +15 -3
  108. package/build/commands/device/delete.d.ts +13 -8
  109. package/build/commands/device/delete.js +81 -129
  110. package/build/commands/device/list.d.ts +7 -0
  111. package/build/commands/device/list.js +42 -63
  112. package/build/commands/device/view.d.ts +3 -0
  113. package/build/commands/device/view.js +10 -5
  114. package/build/commands/diagnostics.d.ts +3 -1
  115. package/build/commands/diagnostics.js +10 -8
  116. package/build/commands/metadata/pull.d.ts +4 -0
  117. package/build/commands/metadata/pull.js +13 -8
  118. package/build/commands/metadata/push.d.ts +4 -0
  119. package/build/commands/metadata/push.js +13 -8
  120. package/build/commands/open.d.ts +8 -0
  121. package/build/commands/open.js +42 -0
  122. package/build/commands/project/info.d.ts +3 -0
  123. package/build/commands/project/info.js +9 -6
  124. package/build/commands/project/init.d.ts +12 -0
  125. package/build/commands/project/init.js +155 -8
  126. package/build/commands/secret/create.d.ts +6 -0
  127. package/build/commands/secret/create.js +87 -30
  128. package/build/commands/secret/delete.d.ts +4 -0
  129. package/build/commands/secret/delete.js +28 -19
  130. package/build/commands/secret/list.d.ts +3 -0
  131. package/build/commands/secret/list.js +19 -13
  132. package/build/commands/submit.d.ts +5 -0
  133. package/build/commands/submit.js +16 -7
  134. package/build/commands/update/configure.d.ts +3 -0
  135. package/build/commands/update/configure.js +24 -18
  136. package/build/commands/update/delete.d.ts +1 -0
  137. package/build/commands/update/delete.js +5 -8
  138. package/build/commands/update/index.d.ts +8 -12
  139. package/build/commands/update/index.js +90 -166
  140. package/build/commands/update/list.d.ts +8 -2
  141. package/build/commands/update/list.js +51 -81
  142. package/build/commands/update/view.d.ts +0 -4
  143. package/build/commands/update/view.js +14 -51
  144. package/build/commands/webhook/create.d.ts +4 -0
  145. package/build/commands/webhook/create.js +10 -5
  146. package/build/commands/webhook/delete.d.ts +6 -0
  147. package/build/commands/webhook/delete.js +26 -14
  148. package/build/commands/webhook/list.d.ts +3 -0
  149. package/build/commands/webhook/list.js +13 -9
  150. package/build/commands/webhook/update.d.ts +1 -0
  151. package/build/commands/webhook/update.js +3 -1
  152. package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -6
  153. package/build/credentials/android/actions/CreateFcm.d.ts +2 -3
  154. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +2 -3
  155. package/build/credentials/android/actions/CreateKeystore.d.ts +2 -3
  156. package/build/credentials/android/actions/CreateKeystore.js +1 -2
  157. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -3
  158. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +2 -3
  159. package/build/credentials/android/api/GraphqlClient.d.ts +6 -7
  160. package/build/credentials/context.d.ts +8 -4
  161. package/build/credentials/context.js +8 -23
  162. package/build/credentials/ios/IosCredentialsProvider.js +11 -6
  163. package/build/credentials/ios/actions/AppleTeamFormatting.d.ts +2 -0
  164. package/build/credentials/ios/actions/AppleTeamFormatting.js +7 -0
  165. package/build/credentials/ios/actions/AppleTeamUtils.d.ts +1 -2
  166. package/build/credentials/ios/actions/AppleTeamUtils.js +1 -5
  167. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +3 -4
  168. package/build/credentials/ios/actions/AscApiKeyUtils.js +2 -2
  169. package/build/credentials/ios/actions/AssignAscApiKey.d.ts +1 -1
  170. package/build/credentials/ios/actions/AssignPushKey.d.ts +1 -1
  171. package/build/credentials/ios/actions/BuildCredentialsUtils.d.ts +3 -3
  172. package/build/credentials/ios/actions/BuildCredentialsUtils.js +8 -12
  173. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +4 -2
  174. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +5 -2
  175. package/build/credentials/ios/actions/CreateAscApiKey.d.ts +2 -3
  176. package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +2 -2
  177. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +4 -2
  178. package/build/credentials/ios/actions/CreateProvisioningProfile.js +3 -2
  179. package/build/credentials/ios/actions/CreatePushKey.d.ts +2 -3
  180. package/build/credentials/ios/actions/DeviceUtils.d.ts +0 -1
  181. package/build/credentials/ios/actions/DeviceUtils.js +3 -19
  182. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +3 -4
  183. package/build/credentials/ios/actions/DistributionCertificateUtils.js +2 -2
  184. package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -1
  185. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +4 -2
  186. package/build/credentials/ios/actions/PushKeyUtils.d.ts +2 -3
  187. package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
  188. package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -3
  189. package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -4
  190. package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +1 -1
  191. package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -3
  192. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +9 -3
  193. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +30 -18
  194. package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +1 -1
  195. package/build/credentials/ios/actions/SetUpBuildCredentials.js +1 -0
  196. package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +1 -1
  197. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +9 -3
  198. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.js +6 -12
  199. package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +4 -2
  200. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +8 -5
  201. package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
  202. package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +1 -1
  203. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +3 -1
  204. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +5 -5
  205. package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +1 -1
  206. package/build/credentials/ios/api/GraphqlClient.d.ts +9 -15
  207. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +2 -3
  208. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +3 -1
  209. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +3 -3
  210. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +20 -6
  211. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +2 -2
  212. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +8 -7
  213. package/build/credentials/ios/api/graphql/types/AppLookupParams.d.ts +7 -0
  214. package/build/credentials/ios/api/graphql/types/AppLookupParams.js +2 -0
  215. package/build/credentials/ios/appstore/AppStoreApi.d.ts +7 -4
  216. package/build/credentials/ios/appstore/AppStoreApi.js +8 -8
  217. package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -14
  218. package/build/credentials/ios/appstore/Credentials.types.js +0 -6
  219. package/build/credentials/ios/appstore/constants.d.ts +1 -0
  220. package/build/credentials/ios/appstore/constants.js +6 -0
  221. package/build/credentials/ios/appstore/distributionCertificate.js +1 -1
  222. package/build/credentials/ios/appstore/provisioningProfile.d.ts +5 -3
  223. package/build/credentials/ios/appstore/provisioningProfile.js +30 -7
  224. package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +3 -1
  225. package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +10 -10
  226. package/build/credentials/ios/types.d.ts +2 -3
  227. package/build/credentials/ios/utils/printCredentials.d.ts +1 -1
  228. package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +3 -2
  229. package/build/credentials/ios/validators/validateProvisioningProfile.js +6 -4
  230. package/build/credentials/manager/HelperActions.d.ts +4 -1
  231. package/build/credentials/manager/ManageAndroid.js +4 -14
  232. package/build/credentials/manager/ManageIos.js +20 -20
  233. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +1 -1
  234. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -3
  235. package/build/credentials/manager/SelectPlatform.d.ts +5 -1
  236. package/build/credentials/manager/SelectPlatform.js +5 -3
  237. package/build/devices/actions/create/action.d.ts +2 -3
  238. package/build/devices/actions/create/developerPortalMethod.js +2 -2
  239. package/build/devices/context.d.ts +3 -5
  240. package/build/devices/context.js +2 -11
  241. package/build/devices/manager.d.ts +4 -5
  242. package/build/devices/manager.js +9 -16
  243. package/build/devices/queries.d.ts +21 -0
  244. package/build/devices/queries.js +121 -0
  245. package/build/devices/utils/errors.d.ts +3 -0
  246. package/build/devices/utils/errors.js +9 -0
  247. package/build/devices/utils/formatDevice.d.ts +3 -3
  248. package/build/devices/utils/formatDevice.js +8 -3
  249. package/build/graphql/generated.d.ts +1141 -192
  250. package/build/graphql/generated.js +13 -2
  251. package/build/graphql/mutations/EnvironmentSecretMutation.d.ts +3 -1
  252. package/build/graphql/queries/AppQuery.d.ts +1 -0
  253. package/build/graphql/queries/AppQuery.js +19 -0
  254. package/build/graphql/queries/BranchQuery.d.ts +5 -6
  255. package/build/graphql/queries/BranchQuery.js +44 -3
  256. package/build/graphql/queries/BuildQuery.d.ts +2 -20
  257. package/build/graphql/queries/BuildQuery.js +2 -2
  258. package/build/graphql/queries/ChannelQuery.d.ts +5 -2
  259. package/build/graphql/queries/ChannelQuery.js +45 -19
  260. package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +5 -3
  261. package/build/graphql/queries/EnvironmentSecretsQuery.js +14 -28
  262. package/build/graphql/queries/UpdateQuery.d.ts +4 -6
  263. package/build/graphql/queries/UpdateQuery.js +59 -50
  264. package/build/graphql/queries/UserQuery.js +8 -1
  265. package/build/graphql/types/Account.d.ts +1 -0
  266. package/build/graphql/types/Account.js +17 -0
  267. package/build/graphql/types/App.js +7 -0
  268. package/build/graphql/types/EnvironmentSecret.d.ts +7 -0
  269. package/build/graphql/types/EnvironmentSecret.js +16 -1
  270. package/build/graphql/types/Update.d.ts +1 -0
  271. package/build/graphql/types/Update.js +30 -0
  272. package/build/graphql/types/UpdateBranch.js +4 -15
  273. package/build/metadata/context.d.ts +1 -1
  274. package/build/metadata/context.js +7 -9
  275. package/build/project/android/applicationId.d.ts +2 -1
  276. package/build/project/android/applicationId.js +7 -7
  277. package/build/project/android/versions.js +1 -1
  278. package/build/project/applicationIdentifier.d.ts +2 -1
  279. package/build/project/applicationIdentifier.js +2 -2
  280. package/build/project/expoConfig.d.ts +3 -3
  281. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.d.ts +22 -0
  282. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +93 -0
  283. package/build/project/ios/bundleIdentifier.d.ts +2 -1
  284. package/build/project/ios/bundleIdentifier.js +7 -7
  285. package/build/project/ios/scheme.d.ts +1 -1
  286. package/build/project/ios/target.d.ts +7 -0
  287. package/build/project/ios/target.js +26 -1
  288. package/build/project/projectUtils.d.ts +4 -31
  289. package/build/project/projectUtils.js +13 -123
  290. package/build/project/remoteVersionSource.d.ts +2 -2
  291. package/build/project/remoteVersionSource.js +8 -7
  292. package/build/project/workflow.js +3 -1
  293. package/build/submit/android/ServiceAccountSource.js +1 -2
  294. package/build/submit/context.d.ts +3 -1
  295. package/build/submit/context.js +12 -14
  296. package/build/submit/ios/CredentialsServiceSource.js +1 -2
  297. package/build/submit/utils/builds.js +3 -1
  298. package/build/update/android/UpdatesModule.d.ts +1 -1
  299. package/build/update/android/UpdatesModule.js +2 -3
  300. package/build/update/ios/UpdatesModule.d.ts +1 -1
  301. package/build/update/ios/UpdatesModule.js +2 -3
  302. package/build/update/queries.d.ts +16 -1
  303. package/build/update/queries.js +96 -30
  304. package/build/update/utils.d.ts +21 -8
  305. package/build/update/utils.js +75 -14
  306. package/build/user/actions.d.ts +2 -8
  307. package/build/user/actions.js +4 -63
  308. package/build/utils/profiles.d.ts +3 -3
  309. package/build/utils/profiles.js +6 -5
  310. package/build/vcs/clients/git.d.ts +1 -1
  311. package/build/vcs/clients/git.js +5 -2
  312. package/build/vcs/clients/gitNoCommit.js +2 -1
  313. package/build/vcs/vcs.d.ts +1 -1
  314. package/build/webhooks/input.d.ts +2 -1
  315. package/build/webhooks/input.js +10 -1
  316. package/oclif.manifest.json +1 -1
  317. package/package.json +6 -5
  318. package/build/project/ensureProjectExists.d.ts +0 -21
  319. package/build/project/ensureProjectExists.js +0 -88
  320. package/build/user/Account.d.ts +0 -3
  321. package/build/user/Account.js +0 -7
@@ -1,6 +1,9 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
+ import { ProfileType } from '@expo/app-store';
1
3
  import { AscApiKey, AscApiKeyInfo, DistributionCertificate, DistributionCertificateStoreInfo, ProvisioningProfile, ProvisioningProfileStoreInfo, PushKey, PushKeyStoreInfo } from './Credentials.types';
2
4
  import { Options as AuthenticateOptions } from './authenticate';
3
5
  import { AuthCtx, AuthenticationMode, UserAuthCtx } from './authenticateTypes';
6
+ import { ApplePlatform } from './constants';
4
7
  import { AppLookupParams, IosCapabilitiesOptions } from './ensureAppExists';
5
8
  import { ProfileClass } from './provisioningProfile';
6
9
  export default class AppStoreApi {
@@ -17,10 +20,10 @@ export default class AppStoreApi {
17
20
  createPushKeyAsync(name?: string): Promise<PushKey>;
18
21
  revokePushKeyAsync(ids: string[]): Promise<void>;
19
22
  useExistingProvisioningProfileAsync(bundleIdentifier: string, provisioningProfile: ProvisioningProfile, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
20
- listProvisioningProfilesAsync(bundleIdentifier: string, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
21
- createProvisioningProfileAsync(bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
22
- revokeProvisioningProfileAsync(bundleIdentifier: string, profileClass?: ProfileClass): Promise<void>;
23
- createOrReuseAdhocProvisioningProfileAsync(udids: string[], bundleIdentifier: string, distCertSerialNumber: string): Promise<ProvisioningProfile>;
23
+ listProvisioningProfilesAsync(bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
24
+ createProvisioningProfileAsync(bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
25
+ revokeProvisioningProfileAsync(bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<void>;
26
+ createOrReuseAdhocProvisioningProfileAsync(udids: string[], bundleIdentifier: string, distCertSerialNumber: string, profileType: ProfileType): Promise<ProvisioningProfile>;
24
27
  listAscApiKeysAsync(): Promise<AscApiKeyInfo[]>;
25
28
  getAscApiKeyAsync(keyId: string): Promise<AscApiKeyInfo | null>;
26
29
  createAscApiKeyAsync({ nickname }: {
@@ -69,21 +69,21 @@ class AppStoreApi {
69
69
  const ctx = await this.ensureAuthenticatedAsync();
70
70
  return await (0, provisioningProfile_1.useExistingProvisioningProfileAsync)(ctx, bundleIdentifier, provisioningProfile, distCert);
71
71
  }
72
- async listProvisioningProfilesAsync(bundleIdentifier, profileClass) {
72
+ async listProvisioningProfilesAsync(bundleIdentifier, applePlatform, profileClass) {
73
73
  const ctx = await this.ensureAuthenticatedAsync();
74
- return await (0, provisioningProfile_1.listProvisioningProfilesAsync)(ctx, bundleIdentifier, profileClass);
74
+ return await (0, provisioningProfile_1.listProvisioningProfilesAsync)(ctx, bundleIdentifier, applePlatform, profileClass);
75
75
  }
76
- async createProvisioningProfileAsync(bundleIdentifier, distCert, profileName, profileClass) {
76
+ async createProvisioningProfileAsync(bundleIdentifier, distCert, profileName, applePlatform, profileClass) {
77
77
  const ctx = await this.ensureAuthenticatedAsync();
78
- return await (0, provisioningProfile_1.createProvisioningProfileAsync)(ctx, bundleIdentifier, distCert, profileName, profileClass);
78
+ return await (0, provisioningProfile_1.createProvisioningProfileAsync)(ctx, bundleIdentifier, distCert, profileName, applePlatform, profileClass);
79
79
  }
80
- async revokeProvisioningProfileAsync(bundleIdentifier, profileClass) {
80
+ async revokeProvisioningProfileAsync(bundleIdentifier, applePlatform, profileClass) {
81
81
  const ctx = await this.ensureAuthenticatedAsync();
82
- return await (0, provisioningProfile_1.revokeProvisioningProfileAsync)(ctx, bundleIdentifier, profileClass);
82
+ return await (0, provisioningProfile_1.revokeProvisioningProfileAsync)(ctx, bundleIdentifier, applePlatform, profileClass);
83
83
  }
84
- async createOrReuseAdhocProvisioningProfileAsync(udids, bundleIdentifier, distCertSerialNumber) {
84
+ async createOrReuseAdhocProvisioningProfileAsync(udids, bundleIdentifier, distCertSerialNumber, profileType) {
85
85
  const ctx = await this.ensureAuthenticatedAsync();
86
- return await (0, provisioningProfileAdhoc_1.createOrReuseAdhocProvisioningProfileAsync)(ctx, udids, bundleIdentifier, distCertSerialNumber);
86
+ return await (0, provisioningProfileAdhoc_1.createOrReuseAdhocProvisioningProfileAsync)(ctx, udids, bundleIdentifier, distCertSerialNumber, profileType);
87
87
  }
88
88
  async listAscApiKeysAsync() {
89
89
  const userCtx = await this.ensureUserAuthenticatedAsync();
@@ -1,19 +1,5 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
2
  import { UserRole } from '@expo/apple-utils';
3
- export interface Device {
4
- id: string;
5
- teamId: string;
6
- identifier: string;
7
- name?: string;
8
- model?: string;
9
- deviceClass?: DeviceClass;
10
- softwareVersion?: string;
11
- enabled: boolean;
12
- }
13
- export declare enum DeviceClass {
14
- IPHONE = "iphone",
15
- IPAD = "ipad"
16
- }
17
3
  export interface DistributionCertificateStoreInfo {
18
4
  id: string;
19
5
  name: string;
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceClass = void 0;
4
- var DeviceClass;
5
- (function (DeviceClass) {
6
- DeviceClass["IPHONE"] = "iphone";
7
- DeviceClass["IPAD"] = "ipad";
8
- })(DeviceClass = exports.DeviceClass || (exports.DeviceClass = {}));
@@ -0,0 +1 @@
1
+ export { Platform as ApplePlatform } from '@expo/apple-utils';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplePlatform = void 0;
4
+ // Renamed to avoid conflation with Android/iOS/Web Platform constants
5
+ var apple_utils_1 = require("@expo/apple-utils");
6
+ Object.defineProperty(exports, "ApplePlatform", { enumerable: true, get: function () { return apple_utils_1.Platform; } });
@@ -21,7 +21,7 @@ async function getDistributionCertificateAsync(context, serialNumber) {
21
21
  const certificates = await apple_utils_1.Certificate.getAsync(context, {
22
22
  query: {
23
23
  filter: {
24
- certificateType: apple_utils_1.CertificateType.IOS_DISTRIBUTION,
24
+ certificateType: [apple_utils_1.CertificateType.IOS_DISTRIBUTION, apple_utils_1.CertificateType.DISTRIBUTION],
25
25
  },
26
26
  },
27
27
  });
@@ -1,10 +1,12 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
1
2
  import { DistributionCertificate, ProvisioningProfile, ProvisioningProfileStoreInfo } from './Credentials.types';
2
3
  import { AuthCtx } from './authenticateTypes';
4
+ import { ApplePlatform } from './constants';
3
5
  export declare enum ProfileClass {
4
6
  Adhoc = "ad_hoc",
5
7
  General = "general"
6
8
  }
7
9
  export declare function useExistingProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, provisioningProfile: ProvisioningProfile, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
8
- export declare function listProvisioningProfilesAsync(authCtx: AuthCtx, bundleIdentifier: string, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
9
- export declare function createProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
10
- export declare function revokeProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, profileClass?: ProfileClass): Promise<void>;
10
+ export declare function listProvisioningProfilesAsync(authCtx: AuthCtx, bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
11
+ export declare function createProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
12
+ export declare function revokeProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<void>;
@@ -7,13 +7,36 @@ const authType_1 = require("../utils/authType");
7
7
  const p12Certificate_1 = require("../utils/p12Certificate");
8
8
  const authenticate_1 = require("./authenticate");
9
9
  const bundleId_1 = require("./bundleId");
10
+ const constants_1 = require("./constants");
10
11
  const distributionCertificate_1 = require("./distributionCertificate");
11
12
  var ProfileClass;
12
13
  (function (ProfileClass) {
13
14
  ProfileClass["Adhoc"] = "ad_hoc";
14
15
  ProfileClass["General"] = "general";
15
16
  })(ProfileClass = exports.ProfileClass || (exports.ProfileClass = {}));
16
- function resolveProfileType(profileClass, isEnterprise) {
17
+ function resolveProfileType(applePlatform, profileClass, isEnterprise) {
18
+ switch (applePlatform) {
19
+ case constants_1.ApplePlatform.IOS:
20
+ return resolveProfileTypeIos(profileClass, isEnterprise);
21
+ case constants_1.ApplePlatform.TV_OS:
22
+ return resolveProfileTypeAppleTv(profileClass, isEnterprise);
23
+ case constants_1.ApplePlatform.MAC_OS:
24
+ throw new Error(`${applePlatform} profiles are not supported`);
25
+ }
26
+ }
27
+ function resolveProfileTypeAppleTv(profileClass, isEnterprise) {
28
+ if (isEnterprise) {
29
+ return profileClass === ProfileClass.Adhoc
30
+ ? apple_utils_1.ProfileType.TVOS_APP_ADHOC
31
+ : apple_utils_1.ProfileType.TVOS_APP_INHOUSE;
32
+ }
33
+ else {
34
+ return profileClass === ProfileClass.Adhoc
35
+ ? apple_utils_1.ProfileType.TVOS_APP_ADHOC
36
+ : apple_utils_1.ProfileType.TVOS_APP_STORE;
37
+ }
38
+ }
39
+ function resolveProfileTypeIos(profileClass, isEnterprise) {
17
40
  if (isEnterprise) {
18
41
  return profileClass === ProfileClass.Adhoc
19
42
  ? apple_utils_1.ProfileType.IOS_APP_ADHOC
@@ -95,11 +118,11 @@ async function useExistingProvisioningProfileAsync(authCtx, bundleIdentifier, pr
95
118
  }
96
119
  }
97
120
  exports.useExistingProvisioningProfileAsync = useExistingProvisioningProfileAsync;
98
- async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, profileClass = ProfileClass.General) {
121
+ async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, applePlatform, profileClass = ProfileClass.General) {
99
122
  const spinner = (0, ora_1.ora)(`Fetching Apple provisioning profiles`).start();
100
123
  try {
101
124
  const context = (0, authenticate_1.getRequestContext)(authCtx);
102
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
125
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
103
126
  const profiles = (await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleIdentifier)).filter(profile => profile.attributes.profileType === profileType);
104
127
  const result = await Promise.all(profiles.map(profile => transformProfileAsync(profile, authCtx)));
105
128
  spinner.succeed(`Fetched Apple provisioning profiles`);
@@ -111,14 +134,14 @@ async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, profileC
111
134
  }
112
135
  }
113
136
  exports.listProvisioningProfilesAsync = listProvisioningProfilesAsync;
114
- async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCert, profileName, profileClass = ProfileClass.General) {
137
+ async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCert, profileName, applePlatform, profileClass = ProfileClass.General) {
115
138
  const spinner = (0, ora_1.ora)(`Creating Apple provisioning profile`).start();
116
139
  try {
117
140
  if (!distCert.distCertSerialNumber) {
118
141
  distCert.distCertSerialNumber = (0, p12Certificate_1.findP12CertSerialNumber)(distCert.certP12, distCert.certPassword);
119
142
  }
120
143
  const context = (0, authenticate_1.getRequestContext)(authCtx);
121
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
144
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
122
145
  const certificate = await (0, distributionCertificate_1.getCertificateBySerialNumberAsync)(context, distCert.distCertSerialNumber);
123
146
  const bundleIdItem = await (0, bundleId_1.getBundleIdForIdentifierAsync)(context, bundleIdentifier);
124
147
  const profile = await apple_utils_1.Profile.createAsync(context, {
@@ -138,12 +161,12 @@ async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCer
138
161
  }
139
162
  }
140
163
  exports.createProvisioningProfileAsync = createProvisioningProfileAsync;
141
- async function revokeProvisioningProfileAsync(authCtx, bundleIdentifier, profileClass = ProfileClass.General) {
164
+ async function revokeProvisioningProfileAsync(authCtx, bundleIdentifier, applePlatform, profileClass = ProfileClass.General) {
142
165
  const spinner = (0, ora_1.ora)(`Revoking Apple provisioning profile`).start();
143
166
  try {
144
167
  const context = (0, authenticate_1.getRequestContext)(authCtx);
145
168
  const profiles = await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleIdentifier);
146
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
169
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
147
170
  await Promise.all(profiles
148
171
  .filter(profile => profile.attributes.profileType === profileType)
149
172
  .map(profile => apple_utils_1.Profile.deleteAsync(context, { id: profile.id })));
@@ -1,3 +1,5 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
+ import { ProfileType } from '@expo/apple-utils';
1
3
  import { ProvisioningProfile } from './Credentials.types';
2
4
  import { AuthCtx } from './authenticateTypes';
3
- export declare function createOrReuseAdhocProvisioningProfileAsync(authCtx: AuthCtx, udids: string[], bundleIdentifier: string, distCertSerialNumber: string): Promise<ProvisioningProfile>;
5
+ export declare function createOrReuseAdhocProvisioningProfileAsync(authCtx: AuthCtx, udids: string[], bundleIdentifier: string, distCertSerialNumber: string, profileType: ProfileType): Promise<ProvisioningProfile>;
@@ -12,8 +12,8 @@ function uniqueItems(items) {
12
12
  return [...set];
13
13
  }
14
14
  async function registerMissingDevicesAsync(context, udids) {
15
- const allIosProfileDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync(context);
16
- const alreadyAdded = allIosProfileDevices.filter(device => udids.includes(device.attributes.udid));
15
+ const allDevices = await apple_utils_1.Device.getAsync(context);
16
+ const alreadyAdded = allDevices.filter(device => udids.includes(device.attributes.udid));
17
17
  const alreadyAddedUdids = alreadyAdded.map(i => i.attributes.udid);
18
18
  await Promise.all(udids.map(async (udid) => {
19
19
  if (!alreadyAddedUdids.includes(udid)) {
@@ -26,9 +26,9 @@ async function registerMissingDevicesAsync(context, udids) {
26
26
  }));
27
27
  return alreadyAdded;
28
28
  }
29
- async function findProfileByBundleIdAsync(context, bundleId, certSerialNumber) {
29
+ async function findProfileAsync(context, { bundleId, certSerialNumber, profileType, }) {
30
30
  const expoProfiles = (await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleId)).filter(profile => {
31
- return (profile.attributes.profileType === apple_utils_1.ProfileType.IOS_APP_ADHOC &&
31
+ return (profile.attributes.profileType === profileType &&
32
32
  profile.attributes.name.startsWith('*[expo]') &&
33
33
  profile.attributes.profileState !== apple_utils_1.ProfileState.EXPIRED);
34
34
  });
@@ -79,7 +79,7 @@ async function findProfileByIdAsync(context, profileId, bundleId) {
79
79
  profiles = profiles.filter(profile => profile.attributes.profileType === apple_utils_1.ProfileType.IOS_APP_ADHOC);
80
80
  return (_a = profiles.find(profile => profile.id === profileId)) !== null && _a !== void 0 ? _a : null;
81
81
  }
82
- async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNumber, profileId, }) {
82
+ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNumber, profileId, profileType, }) {
83
83
  var _a, _b, _c, _d, _e;
84
84
  // We register all missing devices on the Apple Developer Portal. They are identified by UDIDs.
85
85
  const devices = await registerMissingDevicesAsync(context, udids);
@@ -94,7 +94,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
94
94
  }
95
95
  else {
96
96
  // If no profile id is passed, try to find a suitable provisioning profile for the App ID.
97
- const results = await findProfileByBundleIdAsync(context, bundleId, certSerialNumber);
97
+ const results = await findProfileAsync(context, { bundleId, certSerialNumber, profileType });
98
98
  existingProfile = results.profile;
99
99
  didUpdate = results.didUpdate;
100
100
  }
@@ -126,8 +126,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
126
126
  // This method does not support App Store Connect API.
127
127
  await existingProfile.regenerateAsync();
128
128
  }
129
- const updatedProfile = (await findProfileByBundleIdAsync(context, bundleId, certSerialNumber))
130
- .profile;
129
+ const updatedProfile = (await findProfileAsync(context, { bundleId, certSerialNumber, profileType })).profile;
131
130
  if (!updatedProfile) {
132
131
  throw new Error(`Failed to locate updated profile for bundle identifier "${bundleId}" and serial number "${certSerialNumber}"`);
133
132
  }
@@ -153,7 +152,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
153
152
  name: `*[expo] ${bundleId} AdHoc ${Date.now()}`,
154
153
  certificates: [distributionCertificate.id],
155
154
  devices: devices.map(device => device.id),
156
- profileType: apple_utils_1.ProfileType.IOS_APP_ADHOC,
155
+ profileType,
157
156
  });
158
157
  return {
159
158
  didUpdate: true,
@@ -163,7 +162,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
163
162
  provisioningProfile: newProfile.attributes.profileContent,
164
163
  };
165
164
  }
166
- async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundleIdentifier, distCertSerialNumber) {
165
+ async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundleIdentifier, distCertSerialNumber, profileType) {
167
166
  const spinner = (0, ora_1.ora)(`Handling Apple ad hoc provisioning profiles`).start();
168
167
  try {
169
168
  const context = (0, authenticate_1.getRequestContext)(authCtx);
@@ -171,6 +170,7 @@ async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundle
171
170
  udids,
172
171
  bundleId: bundleIdentifier,
173
172
  certSerialNumber: distCertSerialNumber,
173
+ profileType,
174
174
  });
175
175
  if (didCreate) {
176
176
  spinner.succeed(`Created new profile: ${profileName}`);
@@ -1,9 +1,8 @@
1
1
  import { JSONObject } from '@expo/json-file';
2
2
  import type { XCBuildConfiguration } from 'xcode';
3
- import { CommonIosAppCredentialsFragment, IosAppBuildCredentialsFragment } from '../../graphql/generated';
4
- import { Account } from '../../user/Account';
3
+ import { AccountFragment, CommonIosAppCredentialsFragment, IosAppBuildCredentialsFragment } from '../../graphql/generated';
5
4
  export interface App {
6
- account: Account;
5
+ account: AccountFragment;
7
6
  projectName: string;
8
7
  }
9
8
  export interface Target {
@@ -1,4 +1,4 @@
1
- import { AppLookupParams } from '../api/GraphqlClient';
1
+ import { AppLookupParams } from '../api/graphql/types/AppLookupParams';
2
2
  import { App, IosAppBuildCredentialsMap, IosAppCredentialsMap, Target } from '../types';
3
3
  export declare function displayEmptyIosCredentials(appLookupParams: AppLookupParams): void;
4
4
  export declare function displayIosCredentials(app: App, appCredentialsMap: IosAppCredentialsMap, targets: Target[]): void;
@@ -1,4 +1,5 @@
1
1
  import { IosAppBuildCredentialsFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
- import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare function validateProvisioningProfileAsync(ctx: CredentialsContext, app: AppLookupParams, buildCredentials: Partial<IosAppBuildCredentialsFragment> | null): Promise<boolean>;
3
+ import { AppLookupParams } from '../api/graphql/types/AppLookupParams';
4
+ import { Target } from '../types';
5
+ export declare function validateProvisioningProfileAsync(ctx: CredentialsContext, target: Target, app: AppLookupParams, buildCredentials: Partial<IosAppBuildCredentialsFragment> | null): Promise<boolean>;
@@ -8,10 +8,11 @@ const minimatch_1 = tslib_1.__importDefault(require("minimatch"));
8
8
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
9
9
  const generated_1 = require("../../../graphql/generated");
10
10
  const log_1 = tslib_1.__importDefault(require("../../../log"));
11
+ const target_1 = require("../../../project/ios/target");
11
12
  const provisioningProfile_1 = require("../appstore/provisioningProfile");
12
13
  const p12Certificate_1 = require("../utils/p12Certificate");
13
14
  const provisioningProfile_2 = require("../utils/provisioningProfile");
14
- async function validateProvisioningProfileAsync(ctx, app, buildCredentials) {
15
+ async function validateProvisioningProfileAsync(ctx, target, app, buildCredentials) {
15
16
  if (!buildCredentials ||
16
17
  !buildCredentials.distributionCertificate ||
17
18
  !buildCredentials.provisioningProfile) {
@@ -25,7 +26,7 @@ async function validateProvisioningProfileAsync(ctx, app, buildCredentials) {
25
26
  log_1.default.warn("Skipping Provisioning Profile validation on Apple Servers because we aren't authenticated.");
26
27
  return true;
27
28
  }
28
- return await validateProvisioningProfileWithAppleAsync(ctx, app, buildCredentials);
29
+ return await validateProvisioningProfileWithAppleAsync(ctx, target, app, buildCredentials);
29
30
  }
30
31
  exports.validateProvisioningProfileAsync = validateProvisioningProfileAsync;
31
32
  function validateProvisioningProfileWithoutApple(app, { provisioningProfile, distributionCertificate }) {
@@ -59,10 +60,11 @@ function validateProvisioningProfileWithoutApple(app, { provisioningProfile, dis
59
60
  }
60
61
  return true;
61
62
  }
62
- async function validateProvisioningProfileWithAppleAsync(ctx, app, buildCredentials) {
63
+ async function validateProvisioningProfileWithAppleAsync(ctx, target, app, buildCredentials) {
63
64
  (0, assert_1.default)(buildCredentials.provisioningProfile, 'Provisioning Profile must be defined');
64
65
  const { developerPortalIdentifier, provisioningProfile } = buildCredentials.provisioningProfile;
65
- const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(app.bundleIdentifier, buildCredentials.iosDistributionType === generated_1.IosDistributionType.AdHoc
66
+ const applePlatform = await (0, target_1.getApplePlatformFromSdkRoot)(target);
67
+ const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(app.bundleIdentifier, applePlatform, buildCredentials.iosDistributionType === generated_1.IosDistributionType.AdHoc
66
68
  ? provisioningProfile_1.ProfileClass.Adhoc
67
69
  : provisioningProfile_1.ProfileClass.General);
68
70
  const configuredProfileFromApple = profilesFromApple.find(appleProfile => developerPortalIdentifier
@@ -1,5 +1,8 @@
1
- import { CredentialsContext } from '../context';
1
+ import { Actor } from '../../user/User';
2
+ import { CredentialsContext, CredentialsContextProjectInfo } from '../context';
2
3
  export interface Action<T = void> {
4
+ actor: Actor;
5
+ projectInfo: CredentialsContextProjectInfo | null;
3
6
  runAsync(ctx: CredentialsContext): Promise<T>;
4
7
  }
5
8
  export declare class PressAnyKeyToContinue {
@@ -6,10 +6,7 @@ const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const assert_1 = tslib_1.__importDefault(require("assert"));
7
7
  const log_1 = tslib_1.__importStar(require("../../log"));
8
8
  const gradle_1 = require("../../project/android/gradle");
9
- const projectUtils_1 = require("../../project/projectUtils");
10
9
  const prompts_1 = require("../../prompts");
11
- const Account_1 = require("../../user/Account");
12
- const actions_1 = require("../../user/actions");
13
10
  const AssignFcm_1 = require("../android/actions/AssignFcm");
14
11
  const AssignGoogleServiceAccountKey_1 = require("../android/actions/AssignGoogleServiceAccountKey");
15
12
  const BuildCredentialsUtils_1 = require("../android/actions/BuildCredentialsUtils");
@@ -37,22 +34,17 @@ class ManageAndroid {
37
34
  this.projectDir = projectDir;
38
35
  }
39
36
  async runAsync(currentActions = AndroidActions_1.highLevelActions) {
40
- const hasProjectContext = !!context_1.CredentialsContext.getExpoConfigInProject(this.projectDir);
37
+ const hasProjectContext = !!this.callingAction.projectInfo;
41
38
  const buildProfile = hasProjectContext
42
39
  ? await new SelectBuildProfileFromEasJson_1.SelectBuildProfileFromEasJson(this.projectDir, eas_build_job_1.Platform.ANDROID).runAsync()
43
40
  : null;
44
41
  const ctx = new context_1.CredentialsContext({
45
42
  projectDir: process.cwd(),
46
- user: await (0, actions_1.ensureLoggedInAsync)(),
43
+ projectInfo: this.callingAction.projectInfo,
44
+ user: this.callingAction.actor,
47
45
  env: buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.env,
46
+ nonInteractive: false,
48
47
  });
49
- const accountName = ctx.hasProjectContext
50
- ? (0, projectUtils_1.getProjectAccountName)(ctx.exp, ctx.user)
51
- : (0, actions_1.ensureActorHasUsername)(ctx.user);
52
- const account = (0, Account_1.findAccountByName)(ctx.user.accounts, accountName);
53
- if (!account) {
54
- throw new Error(`You do not have access to account: ${accountName}`);
55
- }
56
48
  let gradleContext;
57
49
  if (ctx.hasProjectContext) {
58
50
  (0, assert_1.default)(buildProfile, 'buildProfile must be defined in a project context');
@@ -127,8 +119,6 @@ class ManageAndroid {
127
119
  }
128
120
  async createProjectContextAsync(ctx, buildProfile) {
129
121
  (0, assert_1.default)(ctx.hasProjectContext, 'createProjectContextAsync: must have project context.');
130
- // ensure the project exists on the EAS server
131
- await (0, projectUtils_1.getProjectIdAsync)(ctx.exp);
132
122
  return await (0, gradle_1.resolveGradleBuildContextAsync)(ctx.projectDir, buildProfile);
133
123
  }
134
124
  async runProjectSpecificActionAsync(ctx, action, gradleContext) {
@@ -11,7 +11,6 @@ const scheme_1 = require("../../project/ios/scheme");
11
11
  const target_1 = require("../../project/ios/target");
12
12
  const projectUtils_1 = require("../../project/projectUtils");
13
13
  const prompts_1 = require("../../prompts");
14
- const Account_1 = require("../../user/Account");
15
14
  const actions_1 = require("../../user/actions");
16
15
  const context_1 = require("../context");
17
16
  const AscApiKeyUtils_1 = require("../ios/actions/AscApiKeyUtils");
@@ -46,26 +45,26 @@ class ManageIos {
46
45
  this.projectDir = projectDir;
47
46
  }
48
47
  async runAsync(currentActions = IosActions_1.highLevelActions) {
49
- const hasProjectContext = !!context_1.CredentialsContext.getExpoConfigInProject(this.projectDir);
50
- const buildProfile = hasProjectContext
48
+ const buildProfile = this.callingAction.projectInfo
51
49
  ? await new SelectBuildProfileFromEasJson_1.SelectBuildProfileFromEasJson(this.projectDir, eas_build_job_1.Platform.IOS).runAsync()
52
50
  : null;
53
51
  const ctx = new context_1.CredentialsContext({
54
52
  projectDir: process.cwd(),
55
- user: await (0, actions_1.ensureLoggedInAsync)(),
53
+ projectInfo: this.callingAction.projectInfo,
54
+ user: this.callingAction.actor,
56
55
  env: buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.env,
56
+ nonInteractive: false,
57
57
  });
58
58
  const buildCredentialsActions = (0, IosActions_1.getBuildCredentialsActions)(ctx);
59
59
  const pushKeyActions = (0, IosActions_1.getPushKeyActions)(ctx);
60
60
  const ascApiKeyActions = (0, IosActions_1.getAscApiKeyActions)(ctx);
61
61
  await ctx.bestEffortAppStoreAuthenticateAsync();
62
- const accountName = ctx.hasProjectContext
63
- ? (0, projectUtils_1.getProjectAccountName)(ctx.exp, ctx.user)
64
- : (0, actions_1.ensureActorHasUsername)(ctx.user);
65
- const account = (0, Account_1.findAccountByName)(ctx.user.accounts, accountName);
66
- if (!account) {
67
- throw new Error(`You do not have access to account: ${accountName}`);
68
- }
62
+ const getAccountForProjectAsync = async (projectId) => {
63
+ return await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
64
+ };
65
+ const account = ctx.hasProjectContext
66
+ ? await getAccountForProjectAsync(ctx.projectId)
67
+ : (0, actions_1.ensureActorHasPrimaryAccount)(ctx.user);
69
68
  let app = null;
70
69
  let targets = null;
71
70
  if (ctx.hasProjectContext) {
@@ -80,7 +79,7 @@ class ManageIos {
80
79
  (0, assert_1.default)(targets && app);
81
80
  const iosAppCredentialsMap = {};
82
81
  for (const target of targets) {
83
- const appLookupParams = (0, BuildCredentialsUtils_1.getAppLookupParamsFromContext)(ctx, target);
82
+ const appLookupParams = await (0, BuildCredentialsUtils_1.getAppLookupParamsFromContextAsync)(ctx, target);
84
83
  iosAppCredentialsMap[target.targetName] =
85
84
  await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(appLookupParams);
86
85
  }
@@ -147,8 +146,6 @@ class ManageIos {
147
146
  }
148
147
  async createProjectContextAsync(ctx, account, buildProfile) {
149
148
  (0, assert_1.default)(ctx.hasProjectContext, 'createProjectContextAsync: must have project context.');
150
- // ensure the project exists on the EAS server
151
- await (0, projectUtils_1.getProjectIdAsync)(ctx.exp);
152
149
  const app = { account, projectName: ctx.exp.slug };
153
150
  const xcodeBuildContext = await (0, scheme_1.resolveXcodeBuildContextAsync)({
154
151
  projectDir: ctx.projectDir,
@@ -207,14 +204,14 @@ class ManageIos {
207
204
  return;
208
205
  }
209
206
  const target = await this.selectTargetAsync(targets);
210
- const appLookupParams = (0, BuildCredentialsUtils_1.getAppLookupParamsFromContext)(ctx, target);
207
+ const appLookupParams = await (0, BuildCredentialsUtils_1.getAppLookupParamsFromContextAsync)(ctx, target);
211
208
  switch (action) {
212
209
  case Actions_1.IosActionType.UseExistingDistributionCertificate: {
213
210
  const distCert = await (0, DistributionCertificateUtils_1.selectValidDistributionCertificateAsync)(ctx, appLookupParams);
214
211
  if (!distCert) {
215
212
  return;
216
213
  }
217
- await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType);
214
+ await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType);
218
215
  return;
219
216
  }
220
217
  case Actions_1.IosActionType.CreateDistributionCertificate: {
@@ -223,7 +220,7 @@ class ManageIos {
223
220
  message: `Do you want ${appLookupParams.projectName} to use the new Distribution Certificate?`,
224
221
  });
225
222
  if (confirm) {
226
- await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType);
223
+ await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType);
227
224
  }
228
225
  return;
229
226
  }
@@ -297,14 +294,17 @@ class ManageIos {
297
294
  throw new Error('Unknown action selected');
298
295
  }
299
296
  }
300
- async setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType) {
297
+ async setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType) {
301
298
  log_1.default.log(`Setting up ${appLookupParams.projectName} to use Distribution Certificate`);
302
299
  log_1.default.log(`Creating provisioning profile...`);
303
300
  if (distributionType === generated_1.IosDistributionType.AdHoc) {
304
- return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile(appLookupParams).runWithDistributionCertificateAsync(ctx, distCert);
301
+ return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile({
302
+ app: appLookupParams,
303
+ target,
304
+ }).runWithDistributionCertificateAsync(ctx, distCert);
305
305
  }
306
306
  else {
307
- return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(appLookupParams, distributionType).createAndAssignProfileAsync(ctx, distCert);
307
+ return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(appLookupParams, target, distributionType).createAndAssignProfileAsync(ctx, distCert);
308
308
  }
309
309
  }
310
310
  async selectTargetAsync(targets) {
@@ -2,7 +2,7 @@ import { Platform } from '@expo/eas-build-job';
2
2
  import { BuildProfile } from '@expo/eas-json';
3
3
  export declare class SelectBuildProfileFromEasJson<T extends Platform> {
4
4
  private platform;
5
- private easJsonReader;
5
+ private easJsonAccessor;
6
6
  constructor(projectDir: string, platform: T);
7
7
  runAsync(): Promise<BuildProfile<T>>;
8
8
  getProfileNameFromEasConfigAsync(): Promise<string>;
@@ -8,16 +8,16 @@ const prompts_1 = require("../../prompts");
8
8
  class SelectBuildProfileFromEasJson {
9
9
  constructor(projectDir, platform) {
10
10
  this.platform = platform;
11
- this.easJsonReader = new eas_json_1.EasJsonReader(projectDir);
11
+ this.easJsonAccessor = new eas_json_1.EasJsonAccessor(projectDir);
12
12
  }
13
13
  async runAsync() {
14
14
  const profileName = await this.getProfileNameFromEasConfigAsync();
15
- const easConfig = await this.easJsonReader.getBuildProfileAsync(this.platform, profileName);
15
+ const easConfig = await eas_json_1.EasJsonUtils.getBuildProfileAsync(this.easJsonAccessor, this.platform, profileName);
16
16
  log_1.default.succeed(`Using build profile: ${profileName}`);
17
17
  return easConfig;
18
18
  }
19
19
  async getProfileNameFromEasConfigAsync() {
20
- const buildProfileNames = await this.easJsonReader.getBuildProfileNamesAsync();
20
+ const buildProfileNames = await eas_json_1.EasJsonUtils.getBuildProfileNamesAsync(this.easJsonAccessor);
21
21
  if (buildProfileNames.length === 0) {
22
22
  throw new Error('You need at least one iOS build profile declared in eas.json. Go to https://docs.expo.dev/build/eas-json/ for more details');
23
23
  }
@@ -1,5 +1,9 @@
1
+ import { Actor } from '../../user/User';
2
+ import { CredentialsContextProjectInfo } from '../context';
1
3
  export declare class SelectPlatform {
4
+ readonly actor: Actor;
5
+ readonly projectInfo: CredentialsContextProjectInfo | null;
2
6
  private readonly flagPlatform?;
3
- constructor(flagPlatform?: string | undefined);
7
+ constructor(actor: Actor, projectInfo: CredentialsContextProjectInfo | null, flagPlatform?: string | undefined);
4
8
  runAsync(): Promise<void>;
5
9
  }
@@ -5,15 +5,17 @@ const platform_1 = require("../../platform");
5
5
  const ManageAndroid_1 = require("./ManageAndroid");
6
6
  const ManageIos_1 = require("./ManageIos");
7
7
  class SelectPlatform {
8
- constructor(flagPlatform) {
8
+ constructor(actor, projectInfo, flagPlatform) {
9
+ this.actor = actor;
10
+ this.projectInfo = projectInfo;
9
11
  this.flagPlatform = flagPlatform;
10
12
  }
11
13
  async runAsync() {
12
14
  const platform = await (0, platform_1.selectPlatformAsync)(this.flagPlatform);
13
15
  if (platform === 'ios') {
14
- return await new ManageIos_1.ManageIos(new SelectPlatform(platform), process.cwd()).runAsync();
16
+ return await new ManageIos_1.ManageIos(this, process.cwd()).runAsync();
15
17
  }
16
- return await new ManageAndroid_1.ManageAndroid(new SelectPlatform(platform), process.cwd()).runAsync();
18
+ return await new ManageAndroid_1.ManageAndroid(this, process.cwd()).runAsync();
17
19
  }
18
20
  }
19
21
  exports.SelectPlatform = SelectPlatform;
@@ -1,6 +1,5 @@
1
1
  import AppStoreApi from '../../../credentials/ios/appstore/AppStoreApi';
2
- import { AppleTeam } from '../../../graphql/generated';
3
- import { Account } from '../../../user/Account';
2
+ import { AccountFragment, AppleTeam } from '../../../graphql/generated';
4
3
  export declare enum RegistrationMethod {
5
4
  WEBSITE = 0,
6
5
  INPUT = 1,
@@ -11,7 +10,7 @@ export default class DeviceCreateAction {
11
10
  private appStoreApi;
12
11
  private account;
13
12
  private appleTeam;
14
- constructor(appStoreApi: AppStoreApi, account: Account, appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName' | 'id'>);
13
+ constructor(appStoreApi: AppStoreApi, account: AccountFragment, appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName' | 'id'>);
15
14
  runAsync(): Promise<RegistrationMethod>;
16
15
  private askForRegistrationMethodAsync;
17
16
  }
@@ -59,9 +59,9 @@ async function findUnregisteredPortalDevicesAsync(appleAuthCtx, accountId, apple
59
59
  acc[device.identifier] = device;
60
60
  return acc;
61
61
  }, {});
62
- const portalDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync((0, authenticate_1.getRequestContext)(appleAuthCtx));
62
+ const portalDevices = await apple_utils_1.Device.getAsync((0, authenticate_1.getRequestContext)(appleAuthCtx));
63
63
  return portalDevices.filter(portalDevice => !(portalDevice.attributes.udid in expoRegisteredDevicesByUdid) &&
64
- [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE].includes(portalDevice.attributes.deviceClass));
64
+ [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE, apple_utils_1.DeviceClass.APPLE_TV].includes(portalDevice.attributes.deviceClass));
65
65
  }
66
66
  async function chooseDevicesToImportAsync(devices) {
67
67
  const { chosenDevices } = await (0, prompts_1.promptAsync)({