@expo/build-tools 1.0.272 → 18.0.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 (313) hide show
  1. package/LICENSE +21 -100
  2. package/README.md +1 -1
  3. package/dist/android/credentials.js +2 -3
  4. package/dist/android/expoUpdates.js +5 -8
  5. package/dist/android/gradle.js +6 -8
  6. package/dist/android/gradleConfig.js +2 -3
  7. package/dist/buildErrors/buildErrorHandlers.js +4 -3
  8. package/dist/buildErrors/detectError.js +11 -11
  9. package/dist/buildErrors/errors.types.js +0 -1
  10. package/dist/buildErrors/userErrorHandlers.js +2 -3
  11. package/dist/builders/android.js +19 -24
  12. package/dist/builders/common.js +0 -1
  13. package/dist/builders/custom.js +9 -11
  14. package/dist/builders/index.js +0 -1
  15. package/dist/builders/ios.js +24 -29
  16. package/dist/common/eagerBundle.js +3 -4
  17. package/dist/common/easBuildInternal.js +5 -7
  18. package/dist/common/fastlane.js +0 -1
  19. package/dist/common/git.js +0 -1
  20. package/dist/common/installDependencies.d.ts +1 -1
  21. package/dist/common/installDependencies.js +1 -2
  22. package/dist/common/prebuild.js +3 -5
  23. package/dist/common/projectSources.js +12 -16
  24. package/dist/common/setup.js +28 -33
  25. package/dist/context.d.ts +1 -1
  26. package/dist/context.js +33 -25
  27. package/dist/customBuildContext.d.ts +1 -1
  28. package/dist/customBuildContext.js +32 -10
  29. package/dist/gcs/LoggerStream.d.ts +1 -1
  30. package/dist/gcs/LoggerStream.js +22 -14
  31. package/dist/gcs/__unit__/gcs.test.js +5 -8
  32. package/dist/gcs/client.d.ts +1 -1
  33. package/dist/gcs/client.js +28 -19
  34. package/dist/gcs/retry.js +4 -5
  35. package/dist/generic.d.ts +1 -1
  36. package/dist/generic.js +5 -7
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +19 -10
  39. package/dist/ios/configure.d.ts +1 -1
  40. package/dist/ios/configure.js +9 -11
  41. package/dist/ios/credentials/distributionCertificate.js +1 -3
  42. package/dist/ios/credentials/keychain.js +9 -8
  43. package/dist/ios/credentials/manager.d.ts +1 -1
  44. package/dist/ios/credentials/manager.js +24 -13
  45. package/dist/ios/credentials/provisioningProfile.js +12 -6
  46. package/dist/ios/expoUpdates.js +7 -11
  47. package/dist/ios/fastfile.d.ts +1 -1
  48. package/dist/ios/fastfile.js +0 -1
  49. package/dist/ios/fastlane.d.ts +1 -1
  50. package/dist/ios/fastlane.js +8 -9
  51. package/dist/ios/gymfile.d.ts +1 -1
  52. package/dist/ios/gymfile.js +1 -2
  53. package/dist/ios/pod.js +1 -2
  54. package/dist/ios/resign.js +3 -5
  55. package/dist/ios/resolve.js +1 -2
  56. package/dist/ios/tvos.js +1 -3
  57. package/dist/ios/xcodeBuildLogs.d.ts +1 -1
  58. package/dist/ios/xcodeBuildLogs.js +5 -7
  59. package/dist/ios/xcodeEnv.js +1 -2
  60. package/dist/ios/xcpretty.js +11 -7
  61. package/dist/steps/easFunctionGroups.js +0 -1
  62. package/dist/steps/easFunctions.js +26 -25
  63. package/dist/steps/functionGroups/build.d.ts +1 -1
  64. package/dist/steps/functionGroups/build.js +24 -26
  65. package/dist/steps/functionGroups/maestroTest.js +7 -9
  66. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +6 -9
  67. package/dist/steps/functions/ccacheStats.js +4 -6
  68. package/dist/steps/functions/checkout.js +0 -1
  69. package/dist/steps/functions/configureAndroidVersion.js +3 -5
  70. package/dist/steps/functions/configureEASUpdateIfInstalled.js +4 -6
  71. package/dist/steps/functions/configureIosCredentials.js +3 -4
  72. package/dist/steps/functions/configureIosVersion.js +4 -6
  73. package/dist/steps/functions/createSubmissionEntity.js +2 -4
  74. package/dist/steps/functions/downloadArtifact.d.ts +1 -1
  75. package/dist/steps/functions/downloadArtifact.js +7 -9
  76. package/dist/steps/functions/downloadBuild.d.ts +1 -1
  77. package/dist/steps/functions/downloadBuild.js +10 -12
  78. package/dist/steps/functions/eagerBundle.js +2 -4
  79. package/dist/steps/functions/findAndUploadBuildArtifacts.js +5 -8
  80. package/dist/steps/functions/generateGymfileFromTemplate.js +6 -8
  81. package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js +0 -1
  82. package/dist/steps/functions/injectAndroidCredentials.js +3 -4
  83. package/dist/steps/functions/installMaestro.js +3 -4
  84. package/dist/steps/functions/installNodeModules.d.ts +1 -1
  85. package/dist/steps/functions/installNodeModules.js +12 -12
  86. package/dist/steps/functions/installPods.js +0 -1
  87. package/dist/steps/functions/internalMaestroTest.js +16 -16
  88. package/dist/steps/functions/prebuild.js +3 -5
  89. package/dist/steps/functions/repack.d.ts +1 -1
  90. package/dist/steps/functions/repack.js +25 -19
  91. package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js +1 -2
  92. package/dist/steps/functions/resolveBuildConfig.js +0 -1
  93. package/dist/steps/functions/restoreBuildCache.d.ts +1 -1
  94. package/dist/steps/functions/restoreBuildCache.js +8 -10
  95. package/dist/steps/functions/restoreCache.d.ts +1 -1
  96. package/dist/steps/functions/restoreCache.js +34 -26
  97. package/dist/steps/functions/runFastlane.js +0 -1
  98. package/dist/steps/functions/runGradle.js +2 -3
  99. package/dist/steps/functions/saveBuildCache.d.ts +1 -1
  100. package/dist/steps/functions/saveBuildCache.js +6 -7
  101. package/dist/steps/functions/saveCache.d.ts +1 -1
  102. package/dist/steps/functions/saveCache.js +26 -18
  103. package/dist/steps/functions/sendSlackMessage.js +1 -3
  104. package/dist/steps/functions/startAndroidEmulator.js +5 -7
  105. package/dist/steps/functions/startCuttlefishDevice.js +32 -10
  106. package/dist/steps/functions/startIosSimulator.js +8 -11
  107. package/dist/steps/functions/uploadArtifact.js +4 -6
  108. package/dist/steps/functions/uploadToAsc.d.ts +2 -0
  109. package/dist/steps/functions/uploadToAsc.js +287 -0
  110. package/dist/steps/functions/useNpmToken.js +3 -4
  111. package/dist/steps/utils/android/expoUpdates.js +3 -5
  112. package/dist/steps/utils/android/gradle.d.ts +1 -1
  113. package/dist/steps/utils/android/gradle.js +6 -7
  114. package/dist/steps/utils/android/gradleConfig.js +4 -5
  115. package/dist/steps/utils/cache.js +0 -1
  116. package/dist/steps/utils/expoUpdates.d.ts +1 -1
  117. package/dist/steps/utils/expoUpdates.js +15 -18
  118. package/dist/steps/utils/ios/AscApiClient.d.ts +250 -0
  119. package/dist/steps/utils/ios/AscApiClient.js +299 -0
  120. package/dist/steps/utils/ios/configure.js +4 -5
  121. package/dist/steps/utils/ios/credentials/credentials.js +0 -1
  122. package/dist/steps/utils/ios/credentials/distributionCertificate.js +1 -3
  123. package/dist/steps/utils/ios/credentials/keychain.js +8 -8
  124. package/dist/steps/utils/ios/credentials/manager.js +24 -13
  125. package/dist/steps/utils/ios/credentials/provisioningProfile.js +11 -6
  126. package/dist/steps/utils/ios/expoUpdates.js +4 -7
  127. package/dist/steps/utils/ios/fastlane.d.ts +1 -1
  128. package/dist/steps/utils/ios/fastlane.js +3 -4
  129. package/dist/steps/utils/ios/resolve.js +1 -2
  130. package/dist/steps/utils/ios/tvos.js +1 -3
  131. package/dist/steps/utils/ios/xcpretty.js +11 -7
  132. package/dist/steps/utils/slackMessageDynamicFields.js +0 -1
  133. package/dist/templates/EasBuildConfigureVersionGradle.js +0 -1
  134. package/dist/templates/EasBuildGradle.js +0 -1
  135. package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js +0 -1
  136. package/dist/templates/FastfileResign.js +0 -1
  137. package/dist/templates/GymfileArchive.js +0 -1
  138. package/dist/templates/GymfileSimulator.js +0 -1
  139. package/dist/templates/npmrc.js +0 -1
  140. package/dist/utils/AndroidEmulatorUtils.js +20 -22
  141. package/dist/utils/IosSimulatorUtils.js +9 -11
  142. package/dist/utils/appConfig.js +1 -2
  143. package/dist/utils/artifacts.d.ts +1 -1
  144. package/dist/utils/artifacts.js +7 -8
  145. package/dist/utils/cacheKey.js +21 -12
  146. package/dist/utils/diffFingerprintsAsync.d.ts +1 -1
  147. package/dist/utils/diffFingerprintsAsync.js +0 -1
  148. package/dist/utils/environmentSecrets.js +3 -4
  149. package/dist/utils/expoFingerprintCli.js +5 -6
  150. package/dist/utils/expoUpdates.d.ts +1 -2
  151. package/dist/utils/expoUpdates.js +19 -33
  152. package/dist/utils/expoUpdatesCli.js +20 -11
  153. package/dist/utils/files.js +23 -15
  154. package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js +27 -21
  155. package/dist/utils/fingerprint.js +0 -1
  156. package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js +0 -1
  157. package/dist/utils/hooks.js +1 -3
  158. package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.d.ts +1 -0
  159. package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.js +14 -0
  160. package/dist/utils/npmrc.js +2 -3
  161. package/dist/utils/outputs.d.ts +1 -1
  162. package/dist/utils/outputs.js +2 -5
  163. package/dist/utils/packageManager.js +22 -14
  164. package/dist/utils/prepareBuildExecutable.js +1 -2
  165. package/dist/utils/processes.js +2 -3
  166. package/dist/utils/project.js +1 -2
  167. package/dist/utils/promiseRetryWithCondition.js +0 -1
  168. package/dist/utils/resolveRuntimeVersionAsync.d.ts +1 -1
  169. package/dist/utils/resolveRuntimeVersionAsync.js +4 -6
  170. package/dist/utils/retry.js +2 -3
  171. package/dist/utils/retryOnDNSFailure.js +0 -1
  172. package/dist/utils/stepMetrics.d.ts +1 -1
  173. package/dist/utils/stepMetrics.js +0 -1
  174. package/dist/utils/strings.js +1 -3
  175. package/dist/utils/turtleFetch.d.ts +1 -1
  176. package/dist/utils/turtleFetch.js +2 -2
  177. package/package.json +25 -22
  178. package/dist/android/credentials.js.map +0 -1
  179. package/dist/android/expoUpdates.js.map +0 -1
  180. package/dist/android/gradle.js.map +0 -1
  181. package/dist/android/gradleConfig.js.map +0 -1
  182. package/dist/buildErrors/buildErrorHandlers.js.map +0 -1
  183. package/dist/buildErrors/detectError.js.map +0 -1
  184. package/dist/buildErrors/errors.types.js.map +0 -1
  185. package/dist/buildErrors/userErrorHandlers.js.map +0 -1
  186. package/dist/builders/android.js.map +0 -1
  187. package/dist/builders/common.js.map +0 -1
  188. package/dist/builders/custom.js.map +0 -1
  189. package/dist/builders/index.js.map +0 -1
  190. package/dist/builders/ios.js.map +0 -1
  191. package/dist/common/eagerBundle.js.map +0 -1
  192. package/dist/common/easBuildInternal.js.map +0 -1
  193. package/dist/common/fastlane.js.map +0 -1
  194. package/dist/common/git.js.map +0 -1
  195. package/dist/common/installDependencies.js.map +0 -1
  196. package/dist/common/prebuild.js.map +0 -1
  197. package/dist/common/projectSources.js.map +0 -1
  198. package/dist/common/setup.js.map +0 -1
  199. package/dist/context.js.map +0 -1
  200. package/dist/customBuildContext.js.map +0 -1
  201. package/dist/gcs/LoggerStream.js.map +0 -1
  202. package/dist/gcs/__unit__/gcs.test.js.map +0 -1
  203. package/dist/gcs/client.js.map +0 -1
  204. package/dist/gcs/retry.js.map +0 -1
  205. package/dist/generic.js.map +0 -1
  206. package/dist/index.js.map +0 -1
  207. package/dist/ios/configure.js.map +0 -1
  208. package/dist/ios/credentials/distributionCertificate.js.map +0 -1
  209. package/dist/ios/credentials/keychain.js.map +0 -1
  210. package/dist/ios/credentials/manager.js.map +0 -1
  211. package/dist/ios/credentials/provisioningProfile.js.map +0 -1
  212. package/dist/ios/expoUpdates.js.map +0 -1
  213. package/dist/ios/fastfile.js.map +0 -1
  214. package/dist/ios/fastlane.js.map +0 -1
  215. package/dist/ios/gymfile.js.map +0 -1
  216. package/dist/ios/pod.js.map +0 -1
  217. package/dist/ios/resign.js.map +0 -1
  218. package/dist/ios/resolve.js.map +0 -1
  219. package/dist/ios/tvos.js.map +0 -1
  220. package/dist/ios/xcodeBuildLogs.js.map +0 -1
  221. package/dist/ios/xcodeEnv.js.map +0 -1
  222. package/dist/ios/xcpretty.js.map +0 -1
  223. package/dist/steps/easFunctionGroups.js.map +0 -1
  224. package/dist/steps/easFunctions.js.map +0 -1
  225. package/dist/steps/functionGroups/build.js.map +0 -1
  226. package/dist/steps/functionGroups/maestroTest.js.map +0 -1
  227. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +0 -1
  228. package/dist/steps/functions/ccacheStats.js.map +0 -1
  229. package/dist/steps/functions/checkout.js.map +0 -1
  230. package/dist/steps/functions/configureAndroidVersion.js.map +0 -1
  231. package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +0 -1
  232. package/dist/steps/functions/configureIosCredentials.js.map +0 -1
  233. package/dist/steps/functions/configureIosVersion.js.map +0 -1
  234. package/dist/steps/functions/createSubmissionEntity.js.map +0 -1
  235. package/dist/steps/functions/downloadArtifact.js.map +0 -1
  236. package/dist/steps/functions/downloadBuild.js.map +0 -1
  237. package/dist/steps/functions/eagerBundle.js.map +0 -1
  238. package/dist/steps/functions/findAndUploadBuildArtifacts.js.map +0 -1
  239. package/dist/steps/functions/generateGymfileFromTemplate.js.map +0 -1
  240. package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js.map +0 -1
  241. package/dist/steps/functions/injectAndroidCredentials.js.map +0 -1
  242. package/dist/steps/functions/installMaestro.js.map +0 -1
  243. package/dist/steps/functions/installNodeModules.js.map +0 -1
  244. package/dist/steps/functions/installPods.js.map +0 -1
  245. package/dist/steps/functions/internalMaestroTest.js.map +0 -1
  246. package/dist/steps/functions/prebuild.js.map +0 -1
  247. package/dist/steps/functions/repack.js.map +0 -1
  248. package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js.map +0 -1
  249. package/dist/steps/functions/resolveBuildConfig.js.map +0 -1
  250. package/dist/steps/functions/restoreBuildCache.js.map +0 -1
  251. package/dist/steps/functions/restoreCache.js.map +0 -1
  252. package/dist/steps/functions/runFastlane.js.map +0 -1
  253. package/dist/steps/functions/runGradle.js.map +0 -1
  254. package/dist/steps/functions/saveBuildCache.js.map +0 -1
  255. package/dist/steps/functions/saveCache.js.map +0 -1
  256. package/dist/steps/functions/sendSlackMessage.js.map +0 -1
  257. package/dist/steps/functions/startAndroidEmulator.js.map +0 -1
  258. package/dist/steps/functions/startCuttlefishDevice.js.map +0 -1
  259. package/dist/steps/functions/startIosSimulator.js.map +0 -1
  260. package/dist/steps/functions/uploadArtifact.js.map +0 -1
  261. package/dist/steps/functions/useNpmToken.js.map +0 -1
  262. package/dist/steps/utils/android/expoUpdates.js.map +0 -1
  263. package/dist/steps/utils/android/gradle.js.map +0 -1
  264. package/dist/steps/utils/android/gradleConfig.js.map +0 -1
  265. package/dist/steps/utils/cache.js.map +0 -1
  266. package/dist/steps/utils/expoUpdates.js.map +0 -1
  267. package/dist/steps/utils/ios/configure.js.map +0 -1
  268. package/dist/steps/utils/ios/credentials/credentials.js.map +0 -1
  269. package/dist/steps/utils/ios/credentials/distributionCertificate.js.map +0 -1
  270. package/dist/steps/utils/ios/credentials/keychain.js.map +0 -1
  271. package/dist/steps/utils/ios/credentials/manager.js.map +0 -1
  272. package/dist/steps/utils/ios/credentials/provisioningProfile.js.map +0 -1
  273. package/dist/steps/utils/ios/expoUpdates.js.map +0 -1
  274. package/dist/steps/utils/ios/fastlane.js.map +0 -1
  275. package/dist/steps/utils/ios/resolve.js.map +0 -1
  276. package/dist/steps/utils/ios/tvos.js.map +0 -1
  277. package/dist/steps/utils/ios/xcpretty.js.map +0 -1
  278. package/dist/steps/utils/slackMessageDynamicFields.js.map +0 -1
  279. package/dist/templates/EasBuildConfigureVersionGradle.js.map +0 -1
  280. package/dist/templates/EasBuildGradle.js.map +0 -1
  281. package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js.map +0 -1
  282. package/dist/templates/FastfileResign.js.map +0 -1
  283. package/dist/templates/GymfileArchive.js.map +0 -1
  284. package/dist/templates/GymfileSimulator.js.map +0 -1
  285. package/dist/templates/npmrc.js.map +0 -1
  286. package/dist/utils/AndroidEmulatorUtils.js.map +0 -1
  287. package/dist/utils/IosSimulatorUtils.js.map +0 -1
  288. package/dist/utils/appConfig.js.map +0 -1
  289. package/dist/utils/artifacts.js.map +0 -1
  290. package/dist/utils/cacheKey.js.map +0 -1
  291. package/dist/utils/diffFingerprintsAsync.js.map +0 -1
  292. package/dist/utils/environmentSecrets.js.map +0 -1
  293. package/dist/utils/expoFingerprintCli.js.map +0 -1
  294. package/dist/utils/expoUpdates.js.map +0 -1
  295. package/dist/utils/expoUpdatesCli.js.map +0 -1
  296. package/dist/utils/files.js.map +0 -1
  297. package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js.map +0 -1
  298. package/dist/utils/fingerprint.js.map +0 -1
  299. package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js.map +0 -1
  300. package/dist/utils/hooks.js.map +0 -1
  301. package/dist/utils/npmrc.js.map +0 -1
  302. package/dist/utils/outputs.js.map +0 -1
  303. package/dist/utils/packageManager.js.map +0 -1
  304. package/dist/utils/prepareBuildExecutable.js.map +0 -1
  305. package/dist/utils/processes.js.map +0 -1
  306. package/dist/utils/project.js.map +0 -1
  307. package/dist/utils/promiseRetryWithCondition.js.map +0 -1
  308. package/dist/utils/resolveRuntimeVersionAsync.js.map +0 -1
  309. package/dist/utils/retry.js.map +0 -1
  310. package/dist/utils/retryOnDNSFailure.js.map +0 -1
  311. package/dist/utils/stepMetrics.js.map +0 -1
  312. package/dist/utils/strings.js.map +0 -1
  313. package/dist/utils/turtleFetch.js.map +0 -1
@@ -0,0 +1,250 @@
1
+ import { bunyan } from '@expo/logger';
2
+ import { z } from 'zod';
3
+ declare const GetApi: {
4
+ '/v1/apps/:id': {
5
+ path: z.ZodObject<{
6
+ id: z.ZodString;
7
+ }, z.core.$strip>;
8
+ request: z.ZodObject<{
9
+ 'fields[apps]': z.ZodArray<z.ZodEnum<{
10
+ name: "name";
11
+ bundleId: "bundleId";
12
+ }>>;
13
+ }, z.core.$strip>;
14
+ response: z.ZodObject<{
15
+ data: z.ZodObject<{
16
+ type: z.ZodLiteral<"apps">;
17
+ id: z.ZodString;
18
+ attributes: z.ZodObject<{
19
+ bundleId: z.ZodString;
20
+ name: z.ZodString;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>;
24
+ };
25
+ '/v1/buildUploadFiles/:id': {
26
+ path: z.ZodObject<{
27
+ id: z.ZodString;
28
+ }, z.core.$strip>;
29
+ request: z.ZodObject<{
30
+ 'fields[buildUploadFiles]': z.ZodArray<z.ZodEnum<{
31
+ assetDeliveryState: "assetDeliveryState";
32
+ }>>;
33
+ }, z.core.$strip>;
34
+ response: z.ZodObject<{
35
+ data: z.ZodObject<{
36
+ type: z.ZodLiteral<"buildUploadFiles">;
37
+ id: z.ZodString;
38
+ attributes: z.ZodObject<{
39
+ assetDeliveryState: z.ZodObject<{
40
+ state: z.ZodEnum<{
41
+ AWAITING_UPLOAD: "AWAITING_UPLOAD";
42
+ UPLOAD_COMPLETE: "UPLOAD_COMPLETE";
43
+ COMPLETE: "COMPLETE";
44
+ FAILED: "FAILED";
45
+ }>;
46
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ code: z.ZodString;
48
+ description: z.ZodString;
49
+ }, z.core.$strip>>>;
50
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
51
+ code: z.ZodString;
52
+ description: z.ZodString;
53
+ }, z.core.$strip>>>;
54
+ }, z.core.$strip>;
55
+ }, z.core.$strip>;
56
+ }, z.core.$strip>;
57
+ }, z.core.$strip>;
58
+ };
59
+ '/v1/buildUploads/:id': {
60
+ path: z.ZodObject<{
61
+ id: z.ZodString;
62
+ }, z.core.$strip>;
63
+ request: z.ZodObject<{
64
+ 'fields[buildUploads]': z.ZodArray<z.ZodEnum<{
65
+ build: "build";
66
+ state: "state";
67
+ }>>;
68
+ include: z.ZodArray<z.ZodEnum<{
69
+ build: "build";
70
+ }>>;
71
+ }, z.core.$strip>;
72
+ response: z.ZodObject<{
73
+ data: z.ZodObject<{
74
+ type: z.ZodLiteral<"buildUploads">;
75
+ id: z.ZodString;
76
+ attributes: z.ZodObject<{
77
+ state: z.ZodObject<{
78
+ state: z.ZodEnum<{
79
+ AWAITING_UPLOAD: "AWAITING_UPLOAD";
80
+ COMPLETE: "COMPLETE";
81
+ FAILED: "FAILED";
82
+ PROCESSING: "PROCESSING";
83
+ }>;
84
+ infos: z.ZodOptional<z.ZodArray<z.ZodObject<{
85
+ code: z.ZodString;
86
+ description: z.ZodString;
87
+ }, z.core.$strip>>>;
88
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
+ code: z.ZodString;
90
+ description: z.ZodString;
91
+ }, z.core.$strip>>>;
92
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
93
+ code: z.ZodString;
94
+ description: z.ZodString;
95
+ }, z.core.$strip>>>;
96
+ }, z.core.$strip>;
97
+ }, z.core.$strip>;
98
+ }, z.core.$strip>;
99
+ }, z.core.$strip>;
100
+ };
101
+ };
102
+ declare const PostApi: {
103
+ '/v1/buildUploads': {
104
+ request: z.ZodObject<{
105
+ data: z.ZodObject<{
106
+ type: z.ZodLiteral<"buildUploads">;
107
+ attributes: z.ZodObject<{
108
+ cfBundleShortVersionString: z.ZodString;
109
+ cfBundleVersion: z.ZodString;
110
+ platform: z.ZodEnum<{
111
+ IOS: "IOS";
112
+ MAC_OS: "MAC_OS";
113
+ TV_OS: "TV_OS";
114
+ VISION_OS: "VISION_OS";
115
+ }>;
116
+ }, z.core.$strip>;
117
+ relationships: z.ZodObject<{
118
+ app: z.ZodObject<{
119
+ data: z.ZodObject<{
120
+ type: z.ZodLiteral<"apps">;
121
+ id: z.ZodString;
122
+ }, z.core.$strip>;
123
+ }, z.core.$strip>;
124
+ }, z.core.$strip>;
125
+ }, z.core.$strip>;
126
+ }, z.core.$strip>;
127
+ response: z.ZodObject<{
128
+ data: z.ZodObject<{
129
+ id: z.ZodString;
130
+ type: z.ZodLiteral<"buildUploads">;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>;
133
+ };
134
+ '/v1/buildUploadFiles': {
135
+ request: z.ZodObject<{
136
+ data: z.ZodObject<{
137
+ type: z.ZodLiteral<"buildUploadFiles">;
138
+ attributes: z.ZodObject<{
139
+ assetType: z.ZodEnum<{
140
+ ASSET: "ASSET";
141
+ ASSET_DESCRIPTION: "ASSET_DESCRIPTION";
142
+ ASSET_SPI: "ASSET_SPI";
143
+ }>;
144
+ fileName: z.ZodString;
145
+ fileSize: z.ZodNumber;
146
+ uti: z.ZodEnum<{
147
+ "com.apple.binary-property-list": "com.apple.binary-property-list";
148
+ "com.apple.ipa": "com.apple.ipa";
149
+ "com.apple.pkg": "com.apple.pkg";
150
+ "com.apple.xml-property-list": "com.apple.xml-property-list";
151
+ "com.pkware.zip-archive": "com.pkware.zip-archive";
152
+ }>;
153
+ }, z.core.$strip>;
154
+ relationships: z.ZodObject<{
155
+ buildUpload: z.ZodObject<{
156
+ data: z.ZodObject<{
157
+ type: z.ZodLiteral<"buildUploads">;
158
+ id: z.ZodString;
159
+ }, z.core.$strip>;
160
+ }, z.core.$strip>;
161
+ }, z.core.$strip>;
162
+ }, z.core.$strip>;
163
+ }, z.core.$strip>;
164
+ response: z.ZodObject<{
165
+ data: z.ZodObject<{
166
+ type: z.ZodLiteral<"buildUploadFiles">;
167
+ id: z.ZodString;
168
+ attributes: z.ZodObject<{
169
+ uploadOperations: z.ZodArray<z.ZodObject<{
170
+ length: z.ZodNumber;
171
+ method: z.ZodString;
172
+ offset: z.ZodNumber;
173
+ partNumber: z.ZodNumber;
174
+ requestHeaders: z.ZodArray<z.ZodObject<{
175
+ name: z.ZodString;
176
+ value: z.ZodString;
177
+ }, z.core.$strip>>;
178
+ url: z.ZodString;
179
+ }, z.core.$strip>>;
180
+ }, z.core.$strip>;
181
+ }, z.core.$strip>;
182
+ }, z.core.$strip>;
183
+ };
184
+ };
185
+ declare const PatchApi: {
186
+ '/v1/buildUploadFiles/:id': {
187
+ path: z.ZodObject<{
188
+ id: z.ZodString;
189
+ }, z.core.$strip>;
190
+ request: z.ZodObject<{
191
+ data: z.ZodObject<{
192
+ id: z.ZodString;
193
+ type: z.ZodLiteral<"buildUploadFiles">;
194
+ attributes: z.ZodObject<{
195
+ uploaded: z.ZodBoolean;
196
+ }, z.core.$strip>;
197
+ }, z.core.$strip>;
198
+ }, z.core.$strip>;
199
+ response: z.ZodObject<{
200
+ data: z.ZodObject<{
201
+ type: z.ZodLiteral<"buildUploadFiles">;
202
+ id: z.ZodString;
203
+ attributes: z.ZodObject<{
204
+ assetDeliveryState: z.ZodObject<{
205
+ state: z.ZodEnum<{
206
+ AWAITING_UPLOAD: "AWAITING_UPLOAD";
207
+ UPLOAD_COMPLETE: "UPLOAD_COMPLETE";
208
+ COMPLETE: "COMPLETE";
209
+ FAILED: "FAILED";
210
+ }>;
211
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
212
+ code: z.ZodString;
213
+ description: z.ZodString;
214
+ }, z.core.$strip>>>;
215
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
216
+ code: z.ZodString;
217
+ description: z.ZodString;
218
+ }, z.core.$strip>>>;
219
+ }, z.core.$strip>;
220
+ }, z.core.$strip>;
221
+ }, z.core.$strip>;
222
+ }, z.core.$strip>;
223
+ };
224
+ };
225
+ export type AscApiClientPostApi = {
226
+ [Path in keyof typeof PostApi]: {
227
+ request: z.input<(typeof PostApi)[Path]['request']>;
228
+ response: z.output<(typeof PostApi)[Path]['response']>;
229
+ };
230
+ };
231
+ export type AscApiClientPatchApi = {
232
+ [Path in keyof typeof PatchApi]: {
233
+ request: z.input<(typeof PatchApi)[Path]['request']>;
234
+ response: z.output<(typeof PatchApi)[Path]['response']>;
235
+ };
236
+ };
237
+ export declare class AscApiClient {
238
+ private readonly baseUrl;
239
+ private readonly token;
240
+ private readonly logger?;
241
+ constructor({ token, logger }: {
242
+ token: string;
243
+ logger?: bunyan;
244
+ });
245
+ getAsync<TPath extends keyof typeof GetApi>(path: TPath, body: z.input<(typeof GetApi)[TPath]['request']>, params?: z.input<(typeof GetApi)[TPath]['path']>): Promise<z.output<(typeof GetApi)[TPath]['response']>>;
246
+ postAsync<TPath extends keyof typeof PostApi>(path: TPath, body: z.input<(typeof PostApi)[TPath]['request']>): Promise<z.output<(typeof PostApi)[TPath]['response']>>;
247
+ patchAsync<TPath extends keyof typeof PatchApi>(path: TPath, body: z.input<(typeof PatchApi)[TPath]['request']>, params: z.input<(typeof PatchApi)[TPath]['path']>): Promise<z.output<(typeof PatchApi)[TPath]['response']>>;
248
+ private sendRequestAsync;
249
+ }
250
+ export {};
@@ -0,0 +1,299 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AscApiClient = void 0;
7
+ const results_1 = require("@expo/results");
8
+ const node_fetch_1 = __importDefault(require("node-fetch"));
9
+ const zod_1 = require("zod");
10
+ const GetApi = {
11
+ '/v1/apps/:id': {
12
+ path: zod_1.z.object({
13
+ id: zod_1.z.string(),
14
+ }),
15
+ request: zod_1.z.object({
16
+ 'fields[apps]': zod_1.z.array(zod_1.z.enum(['bundleId', 'name'])).refine(opts => {
17
+ // Let's say we currently require fetching these two and nothing else.
18
+ return opts.includes('bundleId') && opts.includes('name');
19
+ }),
20
+ }),
21
+ response: zod_1.z.object({
22
+ data: zod_1.z.object({
23
+ type: zod_1.z.literal('apps'),
24
+ id: zod_1.z.string(),
25
+ attributes: zod_1.z.object({
26
+ bundleId: zod_1.z.string(),
27
+ name: zod_1.z.string(),
28
+ }),
29
+ }),
30
+ }),
31
+ },
32
+ '/v1/buildUploadFiles/:id': {
33
+ path: zod_1.z.object({
34
+ id: zod_1.z.string(),
35
+ }),
36
+ request: zod_1.z.object({
37
+ 'fields[buildUploadFiles]': zod_1.z.array(zod_1.z.enum(['assetDeliveryState'])).refine(opts => {
38
+ return opts.includes('assetDeliveryState');
39
+ }),
40
+ }),
41
+ response: zod_1.z.object({
42
+ data: zod_1.z.object({
43
+ type: zod_1.z.literal('buildUploadFiles'),
44
+ id: zod_1.z.string(),
45
+ attributes: zod_1.z.object({
46
+ // https://developer.apple.com/documentation/appstoreconnectapi/appmediaassetstate
47
+ assetDeliveryState: zod_1.z.object({
48
+ state: zod_1.z.enum(['AWAITING_UPLOAD', 'UPLOAD_COMPLETE', 'COMPLETE', 'FAILED']),
49
+ errors: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
50
+ warnings: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
51
+ }),
52
+ }),
53
+ }),
54
+ }),
55
+ },
56
+ '/v1/buildUploads/:id': {
57
+ path: zod_1.z.object({
58
+ id: zod_1.z.string(),
59
+ }),
60
+ request: zod_1.z.object({
61
+ 'fields[buildUploads]': zod_1.z.array(zod_1.z.enum(['build', 'state'])).refine(opts => {
62
+ return opts.includes('build') && opts.includes('state');
63
+ }),
64
+ include: zod_1.z.array(zod_1.z.enum(['build'])).refine(opts => {
65
+ return opts.includes('build');
66
+ }),
67
+ }),
68
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadresponse
69
+ response: zod_1.z.object({
70
+ data: zod_1.z.object({
71
+ type: zod_1.z.literal('buildUploads'),
72
+ id: zod_1.z.string(),
73
+ attributes: zod_1.z.object({
74
+ // https://developer.apple.com/documentation/appstoreconnectapi/buildupload/attributes-data.dictionary/state-data.dictionary
75
+ state: zod_1.z.object({
76
+ state: zod_1.z.enum(['AWAITING_UPLOAD', 'PROCESSING', 'COMPLETE', 'FAILED']),
77
+ infos: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
78
+ errors: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
79
+ warnings: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
80
+ }),
81
+ }),
82
+ }),
83
+ }),
84
+ },
85
+ };
86
+ const PostApi = {
87
+ '/v1/buildUploads': {
88
+ request: zod_1.z.object({
89
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary
90
+ data: zod_1.z.object({
91
+ type: zod_1.z.literal('buildUploads'),
92
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/attributes-data.dictionary
93
+ attributes: zod_1.z.object({
94
+ cfBundleShortVersionString: zod_1.z.string(),
95
+ cfBundleVersion: zod_1.z.string(),
96
+ // https://developer.apple.com/documentation/appstoreconnectapi/platform
97
+ platform: zod_1.z.enum(['IOS', 'MAC_OS', 'TV_OS', 'VISION_OS']),
98
+ }),
99
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/relationships-data.dictionary
100
+ relationships: zod_1.z.object({
101
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/relationships-data.dictionary/app-data.dictionary
102
+ app: zod_1.z.object({
103
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/relationships-data.dictionary/app-data.dictionary/data-data.dictionary
104
+ data: zod_1.z.object({
105
+ type: zod_1.z.literal('apps'),
106
+ id: zod_1.z.string(),
107
+ }),
108
+ }),
109
+ }),
110
+ }),
111
+ }),
112
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadresponse
113
+ response: zod_1.z.object({
114
+ // https://developer.apple.com/documentation/appstoreconnectapi/buildupload
115
+ data: zod_1.z.object({
116
+ id: zod_1.z.string(),
117
+ type: zod_1.z.literal('buildUploads'),
118
+ }),
119
+ }),
120
+ },
121
+ '/v1/buildUploadFiles': {
122
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest
123
+ request: zod_1.z.object({
124
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary
125
+ data: zod_1.z.object({
126
+ type: zod_1.z.literal('buildUploadFiles'),
127
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/attributes-data.dictionary
128
+ attributes: zod_1.z.object({
129
+ assetType: zod_1.z.enum(['ASSET', 'ASSET_DESCRIPTION', 'ASSET_SPI']),
130
+ fileName: zod_1.z.string(),
131
+ fileSize: zod_1.z.number().min(1).max(9007199254740991),
132
+ uti: zod_1.z.enum([
133
+ 'com.apple.binary-property-list',
134
+ 'com.apple.ipa',
135
+ 'com.apple.pkg',
136
+ 'com.apple.xml-property-list',
137
+ 'com.pkware.zip-archive',
138
+ ]),
139
+ }),
140
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/relationships-data.dictionary
141
+ relationships: zod_1.z.object({
142
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/relationships-data.dictionary/buildupload-data.dictionary
143
+ buildUpload: zod_1.z.object({
144
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/relationships-data.dictionary/buildupload-data.dictionary/data-data.dictionary
145
+ data: zod_1.z.object({
146
+ type: zod_1.z.literal('buildUploads'),
147
+ id: zod_1.z.string(),
148
+ }),
149
+ }),
150
+ }),
151
+ }),
152
+ }),
153
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfileresponse
154
+ response: zod_1.z.object({
155
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile
156
+ data: zod_1.z.object({
157
+ type: zod_1.z.literal('buildUploadFiles'),
158
+ id: zod_1.z.string(),
159
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile/attributes-data.dictionary
160
+ attributes: zod_1.z.object({
161
+ // https://developer.apple.com/documentation/appstoreconnectapi/appmediaassetstate
162
+ uploadOperations: zod_1.z.array(
163
+ // https://developer.apple.com/documentation/appstoreconnectapi/deliveryfileuploadoperation
164
+ zod_1.z.object({
165
+ length: zod_1.z.number().min(1).max(9007199254740991),
166
+ method: zod_1.z.string(),
167
+ offset: zod_1.z.number().min(0).max(9007199254740991),
168
+ partNumber: zod_1.z.number().min(1).max(9007199254740991),
169
+ requestHeaders: zod_1.z.array(zod_1.z.object({
170
+ name: zod_1.z.string(),
171
+ value: zod_1.z.string(),
172
+ })),
173
+ url: zod_1.z.string(),
174
+ })),
175
+ }),
176
+ }),
177
+ }),
178
+ },
179
+ };
180
+ const PatchApi = {
181
+ // https://developer.apple.com/documentation/appstoreconnectapi/patch-v1-builduploadfiles-_id_
182
+ '/v1/buildUploadFiles/:id': {
183
+ path: zod_1.z.object({
184
+ id: zod_1.z.string(),
185
+ }),
186
+ request: zod_1.z.object({
187
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfileupdaterequest/data-data.dictionary
188
+ data: zod_1.z.object({
189
+ id: zod_1.z.string(),
190
+ type: zod_1.z.literal('buildUploadFiles'),
191
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfileupdaterequest/data-data.dictionary/attributes-data.dictionary
192
+ attributes: zod_1.z.object({
193
+ uploaded: zod_1.z.boolean(),
194
+ }),
195
+ }),
196
+ }),
197
+ response: zod_1.z.object({
198
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile
199
+ data: zod_1.z.object({
200
+ type: zod_1.z.literal('buildUploadFiles'),
201
+ id: zod_1.z.string(),
202
+ // https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile/attributes-data.dictionary
203
+ attributes: zod_1.z.object({
204
+ // https://developer.apple.com/documentation/appstoreconnectapi/appmediaassetstate
205
+ assetDeliveryState: zod_1.z.object({
206
+ state: zod_1.z.enum(['AWAITING_UPLOAD', 'UPLOAD_COMPLETE', 'COMPLETE', 'FAILED']),
207
+ errors: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
208
+ warnings: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
209
+ }),
210
+ }),
211
+ }),
212
+ }),
213
+ },
214
+ };
215
+ class AscApiClient {
216
+ baseUrl = 'https://api.appstoreconnect.apple.com';
217
+ token;
218
+ logger;
219
+ constructor({ token, logger }) {
220
+ this.token = token;
221
+ this.logger = logger;
222
+ }
223
+ async getAsync(path, body, params) {
224
+ const schema = GetApi[path];
225
+ let effectivePath = path;
226
+ for (const [key, value] of Object.entries(params ?? {})) {
227
+ effectivePath = effectivePath.replace(`:${key}`, String(value));
228
+ }
229
+ const searchParams = new URLSearchParams();
230
+ for (const [key, value] of Object.entries(body)) {
231
+ if (Array.isArray(value)) {
232
+ searchParams.set(key, value.join(','));
233
+ }
234
+ else {
235
+ searchParams.set(key, String(value));
236
+ }
237
+ }
238
+ return await this.sendRequestAsync({
239
+ method: 'GET',
240
+ path: `${effectivePath}?${searchParams.toString()}`,
241
+ body,
242
+ requestSchema: schema.request,
243
+ responseSchema: schema.response,
244
+ });
245
+ }
246
+ async postAsync(path, body) {
247
+ const schema = PostApi[path];
248
+ return await this.sendRequestAsync({
249
+ method: 'POST',
250
+ path,
251
+ body,
252
+ requestSchema: schema.request,
253
+ responseSchema: schema.response,
254
+ });
255
+ }
256
+ async patchAsync(path, body, params) {
257
+ const schema = PatchApi[path];
258
+ let effectivePath = path;
259
+ for (const [key, value] of Object.entries(params)) {
260
+ effectivePath = effectivePath.replace(`:${key}`, String(value));
261
+ }
262
+ return await this.sendRequestAsync({
263
+ method: 'PATCH',
264
+ path: effectivePath,
265
+ body,
266
+ requestSchema: schema.request,
267
+ responseSchema: schema.response,
268
+ });
269
+ }
270
+ async sendRequestAsync({ path, method, body, requestSchema, responseSchema, }) {
271
+ const url = new URL(path, this.baseUrl).toString();
272
+ const parsedBody = await (0, results_1.asyncResult)((async () => requestSchema.parse(body))());
273
+ if (!parsedBody.ok) {
274
+ throw new Error(`Malformed request to App Store Connect: ${zod_1.z.prettifyError(parsedBody.enforceError())}`);
275
+ }
276
+ const response = await (0, node_fetch_1.default)(url, {
277
+ method,
278
+ headers: {
279
+ 'Content-Type': 'application/json',
280
+ Authorization: `Bearer ${this.token}`,
281
+ },
282
+ body: method === 'GET' ? undefined : JSON.stringify(parsedBody.value),
283
+ });
284
+ if (!response.ok) {
285
+ const text = await response.text();
286
+ throw new Error(`Unexpected response (${response.status}) from App Store Connect: ${text}`, {
287
+ cause: response,
288
+ });
289
+ }
290
+ const json = await response.json();
291
+ this.logger?.debug(`Response from App Store Connect: ${JSON.stringify(json, null, 2)}`);
292
+ const parsedResponse = await (0, results_1.asyncResult)((async () => responseSchema.parse(json))());
293
+ if (!parsedResponse.ok) {
294
+ throw new Error(`Malformed response from App Store Connect: ${zod_1.z.prettifyError(parsedResponse.enforceError())}`);
295
+ }
296
+ return parsedResponse.value;
297
+ }
298
+ }
299
+ exports.AscApiClient = AscApiClient;
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.configureCredentialsAsync = configureCredentialsAsync;
7
7
  exports.updateVersionsAsync = updateVersionsAsync;
8
8
  exports.evaluateTemplateString = evaluateTemplateString;
9
- const path_1 = __importDefault(require("path"));
10
9
  const config_plugins_1 = require("@expo/config-plugins");
11
- const uniq_1 = __importDefault(require("lodash/uniq"));
12
- const fs_extra_1 = __importDefault(require("fs-extra"));
13
10
  const plist_1 = __importDefault(require("@expo/plist"));
11
+ const fs_extra_1 = __importDefault(require("fs-extra"));
12
+ const uniq_1 = __importDefault(require("lodash/uniq"));
13
+ const path_1 = __importDefault(require("path"));
14
14
  async function configureCredentialsAsync(logger, workingDir, { credentials, buildConfiguration, }) {
15
15
  const targetNames = Object.keys(credentials.targetProvisioningProfiles);
16
16
  for (const targetName of targetNames) {
@@ -59,7 +59,7 @@ async function updateVersionsAsync(logger, workingDir, { buildNumber, appVersion
59
59
  }
60
60
  }
61
61
  function trimQuotes(s) {
62
- return (s === null || s === void 0 ? void 0 : s.startsWith('"')) && s.endsWith('"') ? s.slice(1, -1) : s;
62
+ return s?.startsWith('"') && s.endsWith('"') ? s.slice(1, -1) : s;
63
63
  }
64
64
  function evaluateTemplateString(s, buildSettings) {
65
65
  // necessary because buildSettings might be XCBuildConfiguration['buildSettings'] which is not a plain object
@@ -74,4 +74,3 @@ function evaluateTemplateString(s, buildSettings) {
74
74
  }
75
75
  });
76
76
  }
77
- //# sourceMappingURL=configure.js.map
@@ -13,4 +13,3 @@ exports.TargetCredentialsSchema = joi_1.default.object().keys({
13
13
  }).required(),
14
14
  });
15
15
  exports.IosBuildCredentialsSchema = joi_1.default.object().pattern(joi_1.default.string().required(), exports.TargetCredentialsSchema);
16
- //# sourceMappingURL=credentials.js.map
@@ -20,7 +20,6 @@ function getCommonName({ dataBase64, password }) {
20
20
  return Buffer.from(commonNameAttribute.value, 'ascii').toString();
21
21
  }
22
22
  function getCertData(certificateBase64, password) {
23
- var _a, _b, _c;
24
23
  const p12Der = node_forge_1.default.util.decode64(certificateBase64);
25
24
  const p12Asn1 = node_forge_1.default.asn1.fromDer(p12Der);
26
25
  let p12;
@@ -42,10 +41,9 @@ function getCertData(certificateBase64, password) {
42
41
  }
43
42
  }
44
43
  const certBagType = node_forge_1.default.pki.oids.certBag;
45
- const certData = (_c = (_b = (_a = p12.getBags({ bagType: certBagType })) === null || _a === void 0 ? void 0 : _a[certBagType]) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.cert;
44
+ const certData = p12.getBags({ bagType: certBagType })?.[certBagType]?.[0]?.cert;
46
45
  if (!certData) {
47
46
  throw new Error("getCertData: couldn't find cert bag");
48
47
  }
49
48
  return certData;
50
49
  }
51
- //# sourceMappingURL=distributionCertificate.js.map
@@ -3,15 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
6
7
  const os_1 = __importDefault(require("os"));
7
8
  const path_1 = __importDefault(require("path"));
8
- const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
9
9
  const uuid_1 = require("uuid");
10
10
  const fastlane_1 = require("../fastlane");
11
11
  class Keychain {
12
+ keychainPath;
13
+ keychainPassword;
14
+ created = false;
15
+ destroyed = false;
12
16
  constructor() {
13
- this.created = false;
14
- this.destroyed = false;
15
17
  this.keychainPath = path_1.default.join(os_1.default.tmpdir(), `eas-build-${(0, uuid_1.v4)()}.keychain`);
16
18
  this.keychainPassword = (0, uuid_1.v4)();
17
19
  }
@@ -62,7 +64,7 @@ class Keychain {
62
64
  logger.warn('The keychain has been already destroyed');
63
65
  return;
64
66
  }
65
- const keychainToDeletePath = keychainPath !== null && keychainPath !== void 0 ? keychainPath : this.keychainPath;
67
+ const keychainToDeletePath = keychainPath ?? this.keychainPath;
66
68
  logger.info(`Destroying keychain - ${keychainToDeletePath}`);
67
69
  try {
68
70
  await (0, fastlane_1.runFastlane)(['run', 'delete_keychain', `keychain_path:${keychainToDeletePath}`]);
@@ -74,10 +76,9 @@ class Keychain {
74
76
  }
75
77
  }
76
78
  async cleanUpKeychains(logger) {
77
- var _a;
78
79
  const { stdout } = await (0, turtle_spawn_1.default)('security', ['list-keychains'], { stdio: 'pipe' });
79
- const keychainList = ((_a = /"(.*)"/g.exec(stdout)) !== null && _a !== void 0 ? _a : []).map((i) => i.slice(1, i.length - 1));
80
- const turtleKeychainList = keychainList.filter((keychain) => /eas-build-[\w-]+\.keychain$/.exec(keychain));
80
+ const keychainList = (/"(.*)"/g.exec(stdout) ?? []).map(i => i.slice(1, i.length - 1));
81
+ const turtleKeychainList = keychainList.filter(keychain => /eas-build-[\w-]+\.keychain$/.exec(keychain));
81
82
  for (const turtleKeychainPath of turtleKeychainList) {
82
83
  await this.destroy(logger, turtleKeychainPath);
83
84
  }
@@ -90,4 +91,3 @@ class Keychain {
90
91
  }
91
92
  }
92
93
  exports.default = Keychain;
93
- //# sourceMappingURL=keychain.js.map