@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.
- package/LICENSE +21 -100
- package/README.md +1 -1
- package/dist/android/credentials.js +2 -3
- package/dist/android/expoUpdates.js +5 -8
- package/dist/android/gradle.js +6 -8
- package/dist/android/gradleConfig.js +2 -3
- package/dist/buildErrors/buildErrorHandlers.js +4 -3
- package/dist/buildErrors/detectError.js +11 -11
- package/dist/buildErrors/errors.types.js +0 -1
- package/dist/buildErrors/userErrorHandlers.js +2 -3
- package/dist/builders/android.js +19 -24
- package/dist/builders/common.js +0 -1
- package/dist/builders/custom.js +9 -11
- package/dist/builders/index.js +0 -1
- package/dist/builders/ios.js +24 -29
- package/dist/common/eagerBundle.js +3 -4
- package/dist/common/easBuildInternal.js +5 -7
- package/dist/common/fastlane.js +0 -1
- package/dist/common/git.js +0 -1
- package/dist/common/installDependencies.d.ts +1 -1
- package/dist/common/installDependencies.js +1 -2
- package/dist/common/prebuild.js +3 -5
- package/dist/common/projectSources.js +12 -16
- package/dist/common/setup.js +28 -33
- package/dist/context.d.ts +1 -1
- package/dist/context.js +33 -25
- package/dist/customBuildContext.d.ts +1 -1
- package/dist/customBuildContext.js +32 -10
- package/dist/gcs/LoggerStream.d.ts +1 -1
- package/dist/gcs/LoggerStream.js +22 -14
- package/dist/gcs/__unit__/gcs.test.js +5 -8
- package/dist/gcs/client.d.ts +1 -1
- package/dist/gcs/client.js +28 -19
- package/dist/gcs/retry.js +4 -5
- package/dist/generic.d.ts +1 -1
- package/dist/generic.js +5 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -10
- package/dist/ios/configure.d.ts +1 -1
- package/dist/ios/configure.js +9 -11
- package/dist/ios/credentials/distributionCertificate.js +1 -3
- package/dist/ios/credentials/keychain.js +9 -8
- package/dist/ios/credentials/manager.d.ts +1 -1
- package/dist/ios/credentials/manager.js +24 -13
- package/dist/ios/credentials/provisioningProfile.js +12 -6
- package/dist/ios/expoUpdates.js +7 -11
- package/dist/ios/fastfile.d.ts +1 -1
- package/dist/ios/fastfile.js +0 -1
- package/dist/ios/fastlane.d.ts +1 -1
- package/dist/ios/fastlane.js +8 -9
- package/dist/ios/gymfile.d.ts +1 -1
- package/dist/ios/gymfile.js +1 -2
- package/dist/ios/pod.js +1 -2
- package/dist/ios/resign.js +3 -5
- package/dist/ios/resolve.js +1 -2
- package/dist/ios/tvos.js +1 -3
- package/dist/ios/xcodeBuildLogs.d.ts +1 -1
- package/dist/ios/xcodeBuildLogs.js +5 -7
- package/dist/ios/xcodeEnv.js +1 -2
- package/dist/ios/xcpretty.js +11 -7
- package/dist/steps/easFunctionGroups.js +0 -1
- package/dist/steps/easFunctions.js +26 -25
- package/dist/steps/functionGroups/build.d.ts +1 -1
- package/dist/steps/functionGroups/build.js +24 -26
- package/dist/steps/functionGroups/maestroTest.js +7 -9
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +6 -9
- package/dist/steps/functions/ccacheStats.js +4 -6
- package/dist/steps/functions/checkout.js +0 -1
- package/dist/steps/functions/configureAndroidVersion.js +3 -5
- package/dist/steps/functions/configureEASUpdateIfInstalled.js +4 -6
- package/dist/steps/functions/configureIosCredentials.js +3 -4
- package/dist/steps/functions/configureIosVersion.js +4 -6
- package/dist/steps/functions/createSubmissionEntity.js +2 -4
- package/dist/steps/functions/downloadArtifact.d.ts +1 -1
- package/dist/steps/functions/downloadArtifact.js +7 -9
- package/dist/steps/functions/downloadBuild.d.ts +1 -1
- package/dist/steps/functions/downloadBuild.js +10 -12
- package/dist/steps/functions/eagerBundle.js +2 -4
- package/dist/steps/functions/findAndUploadBuildArtifacts.js +5 -8
- package/dist/steps/functions/generateGymfileFromTemplate.js +6 -8
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js +0 -1
- package/dist/steps/functions/injectAndroidCredentials.js +3 -4
- package/dist/steps/functions/installMaestro.js +3 -4
- package/dist/steps/functions/installNodeModules.d.ts +1 -1
- package/dist/steps/functions/installNodeModules.js +12 -12
- package/dist/steps/functions/installPods.js +0 -1
- package/dist/steps/functions/internalMaestroTest.js +16 -16
- package/dist/steps/functions/prebuild.js +3 -5
- package/dist/steps/functions/repack.d.ts +1 -1
- package/dist/steps/functions/repack.js +25 -19
- package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js +1 -2
- package/dist/steps/functions/resolveBuildConfig.js +0 -1
- package/dist/steps/functions/restoreBuildCache.d.ts +1 -1
- package/dist/steps/functions/restoreBuildCache.js +8 -10
- package/dist/steps/functions/restoreCache.d.ts +1 -1
- package/dist/steps/functions/restoreCache.js +34 -26
- package/dist/steps/functions/runFastlane.js +0 -1
- package/dist/steps/functions/runGradle.js +2 -3
- package/dist/steps/functions/saveBuildCache.d.ts +1 -1
- package/dist/steps/functions/saveBuildCache.js +6 -7
- package/dist/steps/functions/saveCache.d.ts +1 -1
- package/dist/steps/functions/saveCache.js +26 -18
- package/dist/steps/functions/sendSlackMessage.js +1 -3
- package/dist/steps/functions/startAndroidEmulator.js +5 -7
- package/dist/steps/functions/startCuttlefishDevice.js +32 -10
- package/dist/steps/functions/startIosSimulator.js +8 -11
- package/dist/steps/functions/uploadArtifact.js +4 -6
- package/dist/steps/functions/uploadToAsc.d.ts +2 -0
- package/dist/steps/functions/uploadToAsc.js +287 -0
- package/dist/steps/functions/useNpmToken.js +3 -4
- package/dist/steps/utils/android/expoUpdates.js +3 -5
- package/dist/steps/utils/android/gradle.d.ts +1 -1
- package/dist/steps/utils/android/gradle.js +6 -7
- package/dist/steps/utils/android/gradleConfig.js +4 -5
- package/dist/steps/utils/cache.js +0 -1
- package/dist/steps/utils/expoUpdates.d.ts +1 -1
- package/dist/steps/utils/expoUpdates.js +15 -18
- package/dist/steps/utils/ios/AscApiClient.d.ts +250 -0
- package/dist/steps/utils/ios/AscApiClient.js +299 -0
- package/dist/steps/utils/ios/configure.js +4 -5
- package/dist/steps/utils/ios/credentials/credentials.js +0 -1
- package/dist/steps/utils/ios/credentials/distributionCertificate.js +1 -3
- package/dist/steps/utils/ios/credentials/keychain.js +8 -8
- package/dist/steps/utils/ios/credentials/manager.js +24 -13
- package/dist/steps/utils/ios/credentials/provisioningProfile.js +11 -6
- package/dist/steps/utils/ios/expoUpdates.js +4 -7
- package/dist/steps/utils/ios/fastlane.d.ts +1 -1
- package/dist/steps/utils/ios/fastlane.js +3 -4
- package/dist/steps/utils/ios/resolve.js +1 -2
- package/dist/steps/utils/ios/tvos.js +1 -3
- package/dist/steps/utils/ios/xcpretty.js +11 -7
- package/dist/steps/utils/slackMessageDynamicFields.js +0 -1
- package/dist/templates/EasBuildConfigureVersionGradle.js +0 -1
- package/dist/templates/EasBuildGradle.js +0 -1
- package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js +0 -1
- package/dist/templates/FastfileResign.js +0 -1
- package/dist/templates/GymfileArchive.js +0 -1
- package/dist/templates/GymfileSimulator.js +0 -1
- package/dist/templates/npmrc.js +0 -1
- package/dist/utils/AndroidEmulatorUtils.js +20 -22
- package/dist/utils/IosSimulatorUtils.js +9 -11
- package/dist/utils/appConfig.js +1 -2
- package/dist/utils/artifacts.d.ts +1 -1
- package/dist/utils/artifacts.js +7 -8
- package/dist/utils/cacheKey.js +21 -12
- package/dist/utils/diffFingerprintsAsync.d.ts +1 -1
- package/dist/utils/diffFingerprintsAsync.js +0 -1
- package/dist/utils/environmentSecrets.js +3 -4
- package/dist/utils/expoFingerprintCli.js +5 -6
- package/dist/utils/expoUpdates.d.ts +1 -2
- package/dist/utils/expoUpdates.js +19 -33
- package/dist/utils/expoUpdatesCli.js +20 -11
- package/dist/utils/files.js +23 -15
- package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js +27 -21
- package/dist/utils/fingerprint.js +0 -1
- package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js +0 -1
- package/dist/utils/hooks.js +1 -3
- package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.d.ts +1 -0
- package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.js +14 -0
- package/dist/utils/npmrc.js +2 -3
- package/dist/utils/outputs.d.ts +1 -1
- package/dist/utils/outputs.js +2 -5
- package/dist/utils/packageManager.js +22 -14
- package/dist/utils/prepareBuildExecutable.js +1 -2
- package/dist/utils/processes.js +2 -3
- package/dist/utils/project.js +1 -2
- package/dist/utils/promiseRetryWithCondition.js +0 -1
- package/dist/utils/resolveRuntimeVersionAsync.d.ts +1 -1
- package/dist/utils/resolveRuntimeVersionAsync.js +4 -6
- package/dist/utils/retry.js +2 -3
- package/dist/utils/retryOnDNSFailure.js +0 -1
- package/dist/utils/stepMetrics.d.ts +1 -1
- package/dist/utils/stepMetrics.js +0 -1
- package/dist/utils/strings.js +1 -3
- package/dist/utils/turtleFetch.d.ts +1 -1
- package/dist/utils/turtleFetch.js +2 -2
- package/package.json +25 -22
- package/dist/android/credentials.js.map +0 -1
- package/dist/android/expoUpdates.js.map +0 -1
- package/dist/android/gradle.js.map +0 -1
- package/dist/android/gradleConfig.js.map +0 -1
- package/dist/buildErrors/buildErrorHandlers.js.map +0 -1
- package/dist/buildErrors/detectError.js.map +0 -1
- package/dist/buildErrors/errors.types.js.map +0 -1
- package/dist/buildErrors/userErrorHandlers.js.map +0 -1
- package/dist/builders/android.js.map +0 -1
- package/dist/builders/common.js.map +0 -1
- package/dist/builders/custom.js.map +0 -1
- package/dist/builders/index.js.map +0 -1
- package/dist/builders/ios.js.map +0 -1
- package/dist/common/eagerBundle.js.map +0 -1
- package/dist/common/easBuildInternal.js.map +0 -1
- package/dist/common/fastlane.js.map +0 -1
- package/dist/common/git.js.map +0 -1
- package/dist/common/installDependencies.js.map +0 -1
- package/dist/common/prebuild.js.map +0 -1
- package/dist/common/projectSources.js.map +0 -1
- package/dist/common/setup.js.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/customBuildContext.js.map +0 -1
- package/dist/gcs/LoggerStream.js.map +0 -1
- package/dist/gcs/__unit__/gcs.test.js.map +0 -1
- package/dist/gcs/client.js.map +0 -1
- package/dist/gcs/retry.js.map +0 -1
- package/dist/generic.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/ios/configure.js.map +0 -1
- package/dist/ios/credentials/distributionCertificate.js.map +0 -1
- package/dist/ios/credentials/keychain.js.map +0 -1
- package/dist/ios/credentials/manager.js.map +0 -1
- package/dist/ios/credentials/provisioningProfile.js.map +0 -1
- package/dist/ios/expoUpdates.js.map +0 -1
- package/dist/ios/fastfile.js.map +0 -1
- package/dist/ios/fastlane.js.map +0 -1
- package/dist/ios/gymfile.js.map +0 -1
- package/dist/ios/pod.js.map +0 -1
- package/dist/ios/resign.js.map +0 -1
- package/dist/ios/resolve.js.map +0 -1
- package/dist/ios/tvos.js.map +0 -1
- package/dist/ios/xcodeBuildLogs.js.map +0 -1
- package/dist/ios/xcodeEnv.js.map +0 -1
- package/dist/ios/xcpretty.js.map +0 -1
- package/dist/steps/easFunctionGroups.js.map +0 -1
- package/dist/steps/easFunctions.js.map +0 -1
- package/dist/steps/functionGroups/build.js.map +0 -1
- package/dist/steps/functionGroups/maestroTest.js.map +0 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +0 -1
- package/dist/steps/functions/ccacheStats.js.map +0 -1
- package/dist/steps/functions/checkout.js.map +0 -1
- package/dist/steps/functions/configureAndroidVersion.js.map +0 -1
- package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +0 -1
- package/dist/steps/functions/configureIosCredentials.js.map +0 -1
- package/dist/steps/functions/configureIosVersion.js.map +0 -1
- package/dist/steps/functions/createSubmissionEntity.js.map +0 -1
- package/dist/steps/functions/downloadArtifact.js.map +0 -1
- package/dist/steps/functions/downloadBuild.js.map +0 -1
- package/dist/steps/functions/eagerBundle.js.map +0 -1
- package/dist/steps/functions/findAndUploadBuildArtifacts.js.map +0 -1
- package/dist/steps/functions/generateGymfileFromTemplate.js.map +0 -1
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js.map +0 -1
- package/dist/steps/functions/injectAndroidCredentials.js.map +0 -1
- package/dist/steps/functions/installMaestro.js.map +0 -1
- package/dist/steps/functions/installNodeModules.js.map +0 -1
- package/dist/steps/functions/installPods.js.map +0 -1
- package/dist/steps/functions/internalMaestroTest.js.map +0 -1
- package/dist/steps/functions/prebuild.js.map +0 -1
- package/dist/steps/functions/repack.js.map +0 -1
- package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js.map +0 -1
- package/dist/steps/functions/resolveBuildConfig.js.map +0 -1
- package/dist/steps/functions/restoreBuildCache.js.map +0 -1
- package/dist/steps/functions/restoreCache.js.map +0 -1
- package/dist/steps/functions/runFastlane.js.map +0 -1
- package/dist/steps/functions/runGradle.js.map +0 -1
- package/dist/steps/functions/saveBuildCache.js.map +0 -1
- package/dist/steps/functions/saveCache.js.map +0 -1
- package/dist/steps/functions/sendSlackMessage.js.map +0 -1
- package/dist/steps/functions/startAndroidEmulator.js.map +0 -1
- package/dist/steps/functions/startCuttlefishDevice.js.map +0 -1
- package/dist/steps/functions/startIosSimulator.js.map +0 -1
- package/dist/steps/functions/uploadArtifact.js.map +0 -1
- package/dist/steps/functions/useNpmToken.js.map +0 -1
- package/dist/steps/utils/android/expoUpdates.js.map +0 -1
- package/dist/steps/utils/android/gradle.js.map +0 -1
- package/dist/steps/utils/android/gradleConfig.js.map +0 -1
- package/dist/steps/utils/cache.js.map +0 -1
- package/dist/steps/utils/expoUpdates.js.map +0 -1
- package/dist/steps/utils/ios/configure.js.map +0 -1
- package/dist/steps/utils/ios/credentials/credentials.js.map +0 -1
- package/dist/steps/utils/ios/credentials/distributionCertificate.js.map +0 -1
- package/dist/steps/utils/ios/credentials/keychain.js.map +0 -1
- package/dist/steps/utils/ios/credentials/manager.js.map +0 -1
- package/dist/steps/utils/ios/credentials/provisioningProfile.js.map +0 -1
- package/dist/steps/utils/ios/expoUpdates.js.map +0 -1
- package/dist/steps/utils/ios/fastlane.js.map +0 -1
- package/dist/steps/utils/ios/resolve.js.map +0 -1
- package/dist/steps/utils/ios/tvos.js.map +0 -1
- package/dist/steps/utils/ios/xcpretty.js.map +0 -1
- package/dist/steps/utils/slackMessageDynamicFields.js.map +0 -1
- package/dist/templates/EasBuildConfigureVersionGradle.js.map +0 -1
- package/dist/templates/EasBuildGradle.js.map +0 -1
- package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js.map +0 -1
- package/dist/templates/FastfileResign.js.map +0 -1
- package/dist/templates/GymfileArchive.js.map +0 -1
- package/dist/templates/GymfileSimulator.js.map +0 -1
- package/dist/templates/npmrc.js.map +0 -1
- package/dist/utils/AndroidEmulatorUtils.js.map +0 -1
- package/dist/utils/IosSimulatorUtils.js.map +0 -1
- package/dist/utils/appConfig.js.map +0 -1
- package/dist/utils/artifacts.js.map +0 -1
- package/dist/utils/cacheKey.js.map +0 -1
- package/dist/utils/diffFingerprintsAsync.js.map +0 -1
- package/dist/utils/environmentSecrets.js.map +0 -1
- package/dist/utils/expoFingerprintCli.js.map +0 -1
- package/dist/utils/expoUpdates.js.map +0 -1
- package/dist/utils/expoUpdatesCli.js.map +0 -1
- package/dist/utils/files.js.map +0 -1
- package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js.map +0 -1
- package/dist/utils/fingerprint.js.map +0 -1
- package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js.map +0 -1
- package/dist/utils/hooks.js.map +0 -1
- package/dist/utils/npmrc.js.map +0 -1
- package/dist/utils/outputs.js.map +0 -1
- package/dist/utils/packageManager.js.map +0 -1
- package/dist/utils/prepareBuildExecutable.js.map +0 -1
- package/dist/utils/processes.js.map +0 -1
- package/dist/utils/project.js.map +0 -1
- package/dist/utils/promiseRetryWithCondition.js.map +0 -1
- package/dist/utils/resolveRuntimeVersionAsync.js.map +0 -1
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/retryOnDNSFailure.js.map +0 -1
- package/dist/utils/stepMetrics.js.map +0 -1
- package/dist/utils/strings.js.map +0 -1
- 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
|
|
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
|
|
@@ -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 =
|
|
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
|
|
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 = (
|
|
80
|
-
const turtleKeychainList = keychainList.filter(
|
|
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
|