@ankhorage/deploy 0.5.0 → 0.6.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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/domain/IosDeploymentIntent.d.ts +5 -0
- package/dist/domain/IosDeploymentIntent.d.ts.map +1 -0
- package/dist/domain/IosDeploymentIntent.js +2 -0
- package/dist/domain/IosDeploymentIntent.js.map +1 -0
- package/dist/domain/IosDeploymentPublication.d.ts +10 -0
- package/dist/domain/IosDeploymentPublication.d.ts.map +1 -0
- package/dist/domain/IosDeploymentPublication.js +2 -0
- package/dist/domain/IosDeploymentPublication.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/project/index.d.ts +6 -0
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +3 -0
- package/dist/project/index.js.map +1 -1
- package/dist/project/ios/ProjectIosDeploymentAccess.d.ts +7 -0
- package/dist/project/ios/ProjectIosDeploymentAccess.d.ts.map +1 -0
- package/dist/project/ios/ProjectIosDeploymentAccess.js +2 -0
- package/dist/project/ios/ProjectIosDeploymentAccess.js.map +1 -0
- package/dist/project/ios/ProjectIosDeploymentExecution.d.ts +12 -0
- package/dist/project/ios/ProjectIosDeploymentExecution.d.ts.map +1 -0
- package/dist/project/ios/ProjectIosDeploymentExecution.js +2 -0
- package/dist/project/ios/ProjectIosDeploymentExecution.js.map +1 -0
- package/dist/project/ios/ProjectIosDeploymentInspection.d.ts +21 -0
- package/dist/project/ios/ProjectIosDeploymentInspection.d.ts.map +1 -0
- package/dist/project/ios/ProjectIosDeploymentInspection.js +2 -0
- package/dist/project/ios/ProjectIosDeploymentInspection.js.map +1 -0
- package/dist/project/ios/ProjectIosDeploymentRuntime.d.ts +19 -0
- package/dist/project/ios/ProjectIosDeploymentRuntime.d.ts.map +1 -0
- package/dist/project/ios/ProjectIosDeploymentRuntime.js +22 -0
- package/dist/project/ios/ProjectIosDeploymentRuntime.js.map +1 -0
- package/dist/project/ios/ProjectIosExecutionState.d.ts +12 -0
- package/dist/project/ios/ProjectIosExecutionState.d.ts.map +1 -0
- package/dist/project/ios/ProjectIosExecutionState.js +2 -0
- package/dist/project/ios/ProjectIosExecutionState.js.map +1 -0
- package/dist/project/ios/createProjectIosDeploymentPlan.d.ts +4 -0
- package/dist/project/ios/createProjectIosDeploymentPlan.d.ts.map +1 -0
- package/dist/project/ios/createProjectIosDeploymentPlan.js +13 -0
- package/dist/project/ios/createProjectIosDeploymentPlan.js.map +1 -0
- package/dist/project/ios/executeProjectIosDeployment.d.ts +12 -0
- package/dist/project/ios/executeProjectIosDeployment.d.ts.map +1 -0
- package/dist/project/ios/executeProjectIosDeployment.js +160 -0
- package/dist/project/ios/executeProjectIosDeployment.js.map +1 -0
- package/dist/project/ios/executeProjectIosStep.d.ts +15 -0
- package/dist/project/ios/executeProjectIosStep.d.ts.map +1 -0
- package/dist/project/ios/executeProjectIosStep.js +171 -0
- package/dist/project/ios/executeProjectIosStep.js.map +1 -0
- package/dist/project/ios/inspectProjectIosAppStoreConnect.d.ts +15 -0
- package/dist/project/ios/inspectProjectIosAppStoreConnect.d.ts.map +1 -0
- package/dist/project/ios/inspectProjectIosAppStoreConnect.js +55 -0
- package/dist/project/ios/inspectProjectIosAppStoreConnect.js.map +1 -0
- package/dist/project/ios/inspectProjectIosDeployment.d.ts +11 -0
- package/dist/project/ios/inspectProjectIosDeployment.d.ts.map +1 -0
- package/dist/project/ios/inspectProjectIosDeployment.js +96 -0
- package/dist/project/ios/inspectProjectIosDeployment.js.map +1 -0
- package/dist/project/ios/inspectProjectIosEasSetup.d.ts +5 -0
- package/dist/project/ios/inspectProjectIosEasSetup.d.ts.map +1 -0
- package/dist/project/ios/inspectProjectIosEasSetup.js +18 -0
- package/dist/project/ios/inspectProjectIosEasSetup.js.map +1 -0
- package/dist/project/ios/normalizeProjectIosDesired.d.ts +13 -0
- package/dist/project/ios/normalizeProjectIosDesired.d.ts.map +1 -0
- package/dist/project/ios/normalizeProjectIosDesired.js +25 -0
- package/dist/project/ios/normalizeProjectIosDesired.js.map +1 -0
- package/dist/project/ios/readCurrentProjectIosDeployment.d.ts +8 -0
- package/dist/project/ios/readCurrentProjectIosDeployment.d.ts.map +1 -0
- package/dist/project/ios/readCurrentProjectIosDeployment.js +52 -0
- package/dist/project/ios/readCurrentProjectIosDeployment.js.map +1 -0
- package/dist/project/ios/recordProjectIosDeployment.d.ts +21 -0
- package/dist/project/ios/recordProjectIosDeployment.d.ts.map +1 -0
- package/dist/project/ios/recordProjectIosDeployment.js +36 -0
- package/dist/project/ios/recordProjectIosDeployment.js.map +1 -0
- package/dist/project/ios/resolveProjectIosDeploymentAccess.d.ts +9 -0
- package/dist/project/ios/resolveProjectIosDeploymentAccess.d.ts.map +1 -0
- package/dist/project/ios/resolveProjectIosDeploymentAccess.js +7 -0
- package/dist/project/ios/resolveProjectIosDeploymentAccess.js.map +1 -0
- package/dist/project/ios/scopeProjectIosDeploymentAccess.d.ts +3 -0
- package/dist/project/ios/scopeProjectIosDeploymentAccess.d.ts.map +1 -0
- package/dist/project/ios/scopeProjectIosDeploymentAccess.js +7 -0
- package/dist/project/ios/scopeProjectIosDeploymentAccess.js.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectIosState.d.ts +17 -0
- package/dist/providers/appStoreConnect/AppStoreConnectIosState.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectIosState.js +2 -0
- package/dist/providers/appStoreConnect/AppStoreConnectIosState.js.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectPublicationResult.d.ts +19 -0
- package/dist/providers/appStoreConnect/AppStoreConnectPublicationResult.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectPublicationResult.js +2 -0
- package/dist/providers/appStoreConnect/AppStoreConnectPublicationResult.js.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectRequestTracker.d.ts +9 -0
- package/dist/providers/appStoreConnect/AppStoreConnectRequestTracker.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectRequestTracker.js +13 -0
- package/dist/providers/appStoreConnect/AppStoreConnectRequestTracker.js.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTokenFactory.d.ts +8 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTokenFactory.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTokenFactory.js +21 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTokenFactory.js.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTransport.d.ts +13 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTransport.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTransport.js +15 -0
- package/dist/providers/appStoreConnect/AppStoreConnectTransport.js.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreUploadTransport.d.ts +17 -0
- package/dist/providers/appStoreConnect/AppStoreUploadTransport.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/AppStoreUploadTransport.js +12 -0
- package/dist/providers/appStoreConnect/AppStoreUploadTransport.js.map +1 -0
- package/dist/providers/appStoreConnect/BuildUploadOperation.d.ts +13 -0
- package/dist/providers/appStoreConnect/BuildUploadOperation.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/BuildUploadOperation.js +2 -0
- package/dist/providers/appStoreConnect/BuildUploadOperation.js.map +1 -0
- package/dist/providers/appStoreConnect/appStoreConnectUrls.d.ts +10 -0
- package/dist/providers/appStoreConnect/appStoreConnectUrls.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/appStoreConnectUrls.js +42 -0
- package/dist/providers/appStoreConnect/appStoreConnectUrls.js.map +1 -0
- package/dist/providers/appStoreConnect/attachAppStoreVersionBuild.d.ts +8 -0
- package/dist/providers/appStoreConnect/attachAppStoreVersionBuild.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/attachAppStoreVersionBuild.js +12 -0
- package/dist/providers/appStoreConnect/attachAppStoreVersionBuild.js.map +1 -0
- package/dist/providers/appStoreConnect/commitAppStoreBuildUploadFile.d.ts +7 -0
- package/dist/providers/appStoreConnect/commitAppStoreBuildUploadFile.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/commitAppStoreBuildUploadFile.js +18 -0
- package/dist/providers/appStoreConnect/commitAppStoreBuildUploadFile.js.map +1 -0
- package/dist/providers/appStoreConnect/createAppStoreBuildUpload.d.ts +9 -0
- package/dist/providers/appStoreConnect/createAppStoreBuildUpload.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/createAppStoreBuildUpload.js +41 -0
- package/dist/providers/appStoreConnect/createAppStoreBuildUpload.js.map +1 -0
- package/dist/providers/appStoreConnect/createAppStoreConnectSetupAdapter.d.ts +7 -0
- package/dist/providers/appStoreConnect/createAppStoreConnectSetupAdapter.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/createAppStoreConnectSetupAdapter.js +33 -0
- package/dist/providers/appStoreConnect/createAppStoreConnectSetupAdapter.js.map +1 -0
- package/dist/providers/appStoreConnect/downloadIosArchive.d.ts +9 -0
- package/dist/providers/appStoreConnect/downloadIosArchive.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/downloadIosArchive.js +28 -0
- package/dist/providers/appStoreConnect/downloadIosArchive.js.map +1 -0
- package/dist/providers/appStoreConnect/executeBuildUploadOperations.d.ts +8 -0
- package/dist/providers/appStoreConnect/executeBuildUploadOperations.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/executeBuildUploadOperations.js +15 -0
- package/dist/providers/appStoreConnect/executeBuildUploadOperations.js.map +1 -0
- package/dist/providers/appStoreConnect/inspectAppStoreConnectIos.d.ts +27 -0
- package/dist/providers/appStoreConnect/inspectAppStoreConnectIos.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/inspectAppStoreConnectIos.js +177 -0
- package/dist/providers/appStoreConnect/inspectAppStoreConnectIos.js.map +1 -0
- package/dist/providers/appStoreConnect/parseBuildUploadFileReservation.d.ts +3 -0
- package/dist/providers/appStoreConnect/parseBuildUploadFileReservation.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/parseBuildUploadFileReservation.js +81 -0
- package/dist/providers/appStoreConnect/parseBuildUploadFileReservation.js.map +1 -0
- package/dist/providers/appStoreConnect/prepareAppStoreVersion.d.ts +8 -0
- package/dist/providers/appStoreConnect/prepareAppStoreVersion.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/prepareAppStoreVersion.js +66 -0
- package/dist/providers/appStoreConnect/prepareAppStoreVersion.js.map +1 -0
- package/dist/providers/appStoreConnect/publishIosToAppStoreConnect.d.ts +21 -0
- package/dist/providers/appStoreConnect/publishIosToAppStoreConnect.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/publishIosToAppStoreConnect.js +124 -0
- package/dist/providers/appStoreConnect/publishIosToAppStoreConnect.js.map +1 -0
- package/dist/providers/appStoreConnect/reserveAppStoreBuildUploadFile.d.ts +9 -0
- package/dist/providers/appStoreConnect/reserveAppStoreBuildUploadFile.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/reserveAppStoreBuildUploadFile.js +32 -0
- package/dist/providers/appStoreConnect/reserveAppStoreBuildUploadFile.js.map +1 -0
- package/dist/providers/appStoreConnect/resolveAppStoreConnectToken.d.ts +18 -0
- package/dist/providers/appStoreConnect/resolveAppStoreConnectToken.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/resolveAppStoreConnectToken.js +64 -0
- package/dist/providers/appStoreConnect/resolveAppStoreConnectToken.js.map +1 -0
- package/dist/providers/appStoreConnect/verifyAppStoreConnectPublication.d.ts +23 -0
- package/dist/providers/appStoreConnect/verifyAppStoreConnectPublication.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/verifyAppStoreConnectPublication.js +60 -0
- package/dist/providers/appStoreConnect/verifyAppStoreConnectPublication.js.map +1 -0
- package/dist/providers/appStoreConnect/verifyAppStoreVersionBuild.d.ts +9 -0
- package/dist/providers/appStoreConnect/verifyAppStoreVersionBuild.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/verifyAppStoreVersionBuild.js +26 -0
- package/dist/providers/appStoreConnect/verifyAppStoreVersionBuild.js.map +1 -0
- package/dist/providers/appStoreConnect/waitForAppStoreBuildUpload.d.ts +14 -0
- package/dist/providers/appStoreConnect/waitForAppStoreBuildUpload.d.ts.map +1 -0
- package/dist/providers/appStoreConnect/waitForAppStoreBuildUpload.js +69 -0
- package/dist/providers/appStoreConnect/waitForAppStoreBuildUpload.js.map +1 -0
- package/dist/providers/eas/ios/EasIosBuildArtifact.d.ts +9 -0
- package/dist/providers/eas/ios/EasIosBuildArtifact.d.ts.map +1 -0
- package/dist/providers/eas/ios/EasIosBuildArtifact.js +2 -0
- package/dist/providers/eas/ios/EasIosBuildArtifact.js.map +1 -0
- package/dist/providers/eas/ios/buildIosWithEas.d.ts +26 -0
- package/dist/providers/eas/ios/buildIosWithEas.d.ts.map +1 -0
- package/dist/providers/eas/ios/buildIosWithEas.js +60 -0
- package/dist/providers/eas/ios/buildIosWithEas.js.map +1 -0
- package/dist/providers/eas/ios/generateLocalIosFingerprint.d.ts +15 -0
- package/dist/providers/eas/ios/generateLocalIosFingerprint.d.ts.map +1 -0
- package/dist/providers/eas/ios/generateLocalIosFingerprint.js +48 -0
- package/dist/providers/eas/ios/generateLocalIosFingerprint.js.map +1 -0
- package/dist/providers/eas/ios/inspectEasIosConfig.d.ts +28 -0
- package/dist/providers/eas/ios/inspectEasIosConfig.d.ts.map +1 -0
- package/dist/providers/eas/ios/inspectEasIosConfig.js +40 -0
- package/dist/providers/eas/ios/inspectEasIosConfig.js.map +1 -0
- package/dist/providers/eas/ios/parseEasIosBuild.d.ts +3 -0
- package/dist/providers/eas/ios/parseEasIosBuild.d.ts.map +1 -0
- package/dist/providers/eas/ios/parseEasIosBuild.js +41 -0
- package/dist/providers/eas/ios/parseEasIosBuild.js.map +1 -0
- package/dist/providers/eas/ios/parseEasIosConfig.d.ts +3 -0
- package/dist/providers/eas/ios/parseEasIosConfig.d.ts.map +1 -0
- package/dist/providers/eas/ios/parseEasIosConfig.js +56 -0
- package/dist/providers/eas/ios/parseEasIosConfig.js.map +1 -0
- package/dist/targets/ios/createIosDeploymentRevision.d.ts +3 -0
- package/dist/targets/ios/createIosDeploymentRevision.d.ts.map +1 -0
- package/dist/targets/ios/createIosDeploymentRevision.js +10 -0
- package/dist/targets/ios/createIosDeploymentRevision.js.map +1 -0
- package/dist/targets/ios/createIosTargetPlanContributor.d.ts +3 -0
- package/dist/targets/ios/createIosTargetPlanContributor.d.ts.map +1 -0
- package/dist/targets/ios/createIosTargetPlanContributor.js +26 -0
- package/dist/targets/ios/createIosTargetPlanContributor.js.map +1 -0
- package/dist/targets/ios/isIosDeploymentIntentValid.d.ts +3 -0
- package/dist/targets/ios/isIosDeploymentIntentValid.d.ts.map +1 -0
- package/dist/targets/ios/isIosDeploymentIntentValid.js +4 -0
- package/dist/targets/ios/isIosDeploymentIntentValid.js.map +1 -0
- package/dist/targets/ios/normalizeIosProviders.d.ts +16 -0
- package/dist/targets/ios/normalizeIosProviders.d.ts.map +1 -0
- package/dist/targets/ios/normalizeIosProviders.js +16 -0
- package/dist/targets/ios/normalizeIosProviders.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { inspectAppStoreConnectIos } from '../../providers/appStoreConnect/inspectAppStoreConnectIos';
|
|
2
|
+
import { publishIosToAppStoreConnect } from '../../providers/appStoreConnect/publishIosToAppStoreConnect';
|
|
3
|
+
import { verifyAppStoreConnectPublication } from '../../providers/appStoreConnect/verifyAppStoreConnectPublication';
|
|
4
|
+
import { buildIosWithEas } from '../../providers/eas/ios/buildIosWithEas';
|
|
5
|
+
import { generateLocalIosFingerprint } from '../../providers/eas/ios/generateLocalIosFingerprint';
|
|
6
|
+
import { inspectEasIosConfig } from '../../providers/eas/ios/inspectEasIosConfig';
|
|
7
|
+
import { createIosDeploymentRevision } from '../../targets/ios/createIosDeploymentRevision';
|
|
8
|
+
import { scopeProjectIosDeploymentAccess } from './scopeProjectIosDeploymentAccess';
|
|
9
|
+
export async function executeProjectIosStep(options) {
|
|
10
|
+
switch (options.step.id) {
|
|
11
|
+
case 'ios:prepare':
|
|
12
|
+
return prepareStep(options);
|
|
13
|
+
case 'ios:build':
|
|
14
|
+
return buildStep(options);
|
|
15
|
+
case 'ios:publish':
|
|
16
|
+
return publishStep(options);
|
|
17
|
+
case 'ios:verify':
|
|
18
|
+
return verifyStep(options);
|
|
19
|
+
case 'ios:remove':
|
|
20
|
+
return removeStep();
|
|
21
|
+
default:
|
|
22
|
+
return failed('IOS_STEP_UNSUPPORTED', 'Unsupported iOS deployment step.');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function prepareStep(options) {
|
|
26
|
+
const expected = options.inspection.desiredRevision;
|
|
27
|
+
if (expected === undefined)
|
|
28
|
+
return failed('IOS_REVISION_MISSING', 'Planned iOS revision is missing.');
|
|
29
|
+
const config = await inspectEasIosConfig({
|
|
30
|
+
projectRoot: options.inspection.projectRoot,
|
|
31
|
+
bundleIdentifier: options.bundleIdentifier,
|
|
32
|
+
buildProfile: options.inspection.intent.buildProfile,
|
|
33
|
+
...options.access,
|
|
34
|
+
runProcess: options.runtime.runProcess,
|
|
35
|
+
});
|
|
36
|
+
if (config.status === 'action-required')
|
|
37
|
+
return { status: 'action-required', action: config.action };
|
|
38
|
+
if (config.status === 'failed')
|
|
39
|
+
return { status: 'failed', error: config.failure };
|
|
40
|
+
const fingerprint = await generateLocalIosFingerprint({
|
|
41
|
+
projectRoot: options.inspection.projectRoot,
|
|
42
|
+
profileEnvironment: config.config.profileEnvironment,
|
|
43
|
+
runProcess: options.runtime.runProcess,
|
|
44
|
+
});
|
|
45
|
+
if (fingerprint.status === 'failed')
|
|
46
|
+
return { status: 'failed', error: fingerprint.failure };
|
|
47
|
+
const revision = createIosDeploymentRevision(fingerprint.fingerprint, options.inspection.intent);
|
|
48
|
+
if (revision !== expected) {
|
|
49
|
+
return failed('IOS_SOURCE_CHANGED_AFTER_PLAN', 'iOS source changed after the deployment plan was created.');
|
|
50
|
+
}
|
|
51
|
+
options.state.fingerprint = fingerprint.fingerprint;
|
|
52
|
+
return { status: 'completed' };
|
|
53
|
+
}
|
|
54
|
+
async function buildStep(options) {
|
|
55
|
+
if (options.state.fingerprint === null) {
|
|
56
|
+
return failed('IOS_FINGERPRINT_MISSING', 'Prepared iOS fingerprint is missing.');
|
|
57
|
+
}
|
|
58
|
+
const result = await buildIosWithEas({
|
|
59
|
+
projectRoot: options.inspection.projectRoot,
|
|
60
|
+
buildProfile: options.inspection.intent.buildProfile,
|
|
61
|
+
expectedFingerprint: options.state.fingerprint,
|
|
62
|
+
expectedVersion: options.inspection.intent.version,
|
|
63
|
+
...options.access,
|
|
64
|
+
runProcess: options.runtime.runProcess,
|
|
65
|
+
});
|
|
66
|
+
if (result.status === 'action-required')
|
|
67
|
+
return { status: 'action-required', action: result.action };
|
|
68
|
+
if (result.status === 'failed')
|
|
69
|
+
return { status: 'failed', error: result.failure };
|
|
70
|
+
options.state.build = result.artifact;
|
|
71
|
+
return { status: 'completed' };
|
|
72
|
+
}
|
|
73
|
+
async function publishStep(options) {
|
|
74
|
+
const build = options.state.build;
|
|
75
|
+
const revision = options.inspection.desiredRevision;
|
|
76
|
+
if (build === null || revision === undefined) {
|
|
77
|
+
return failed('IOS_BUILD_MISSING', 'Completed iOS build is missing.');
|
|
78
|
+
}
|
|
79
|
+
const access = scopeProjectIosDeploymentAccess(options.access, 'app-store-connect');
|
|
80
|
+
const app = await inspectAppStoreConnectIos({
|
|
81
|
+
bundleIdentifier: options.bundleIdentifier,
|
|
82
|
+
version: options.inspection.intent.version,
|
|
83
|
+
...access,
|
|
84
|
+
createToken: options.runtime.createAppStoreConnectToken,
|
|
85
|
+
request: options.runtime.requestAppStoreConnect,
|
|
86
|
+
now: options.runtime.now(),
|
|
87
|
+
});
|
|
88
|
+
if (app.status === 'action-required')
|
|
89
|
+
return { status: 'action-required', action: app.action };
|
|
90
|
+
if (app.status === 'failed')
|
|
91
|
+
return { status: 'failed', error: app.failure };
|
|
92
|
+
const archive = await options.runtime.downloadArchive(build.archiveUrl);
|
|
93
|
+
if (archive === null)
|
|
94
|
+
return failed('IOS_ARCHIVE_DOWNLOAD_FAILED', 'iOS archive could not be downloaded.');
|
|
95
|
+
try {
|
|
96
|
+
const result = await publishIosToAppStoreConnect({
|
|
97
|
+
appId: app.state.appId,
|
|
98
|
+
version: build.version,
|
|
99
|
+
buildNumber: build.buildNumber,
|
|
100
|
+
file: await options.runtime.readArchive(archive.filePath),
|
|
101
|
+
...access,
|
|
102
|
+
createToken: options.runtime.createAppStoreConnectToken,
|
|
103
|
+
request: options.runtime.requestAppStoreConnect,
|
|
104
|
+
upload: options.runtime.uploadAppStore,
|
|
105
|
+
wait: options.runtime.waitForAppStoreProcessing,
|
|
106
|
+
maxAttempts: options.runtime.maxAppStoreProcessingAttempts,
|
|
107
|
+
now: options.runtime.now(),
|
|
108
|
+
});
|
|
109
|
+
if (result.status === 'action-required')
|
|
110
|
+
return { status: 'action-required', action: result.action };
|
|
111
|
+
if (result.status === 'failed')
|
|
112
|
+
return { status: 'failed', error: result.failure };
|
|
113
|
+
options.state.appStorePublication = result.publication;
|
|
114
|
+
options.state.publication = {
|
|
115
|
+
target: 'ios',
|
|
116
|
+
revision,
|
|
117
|
+
buildProvider: 'eas',
|
|
118
|
+
publishProvider: 'app-store-connect',
|
|
119
|
+
buildId: build.buildId,
|
|
120
|
+
version: build.version,
|
|
121
|
+
buildNumber: build.buildNumber,
|
|
122
|
+
};
|
|
123
|
+
return { status: 'completed' };
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
await safeCleanup(options.runtime, archive.directory);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function verifyStep(options) {
|
|
130
|
+
if (options.state.appStorePublication === null) {
|
|
131
|
+
return failed('IOS_PUBLICATION_MISSING', 'iOS publication result is missing.');
|
|
132
|
+
}
|
|
133
|
+
const access = scopeProjectIosDeploymentAccess(options.access, 'app-store-connect');
|
|
134
|
+
const result = await verifyAppStoreConnectPublication({
|
|
135
|
+
publication: options.state.appStorePublication,
|
|
136
|
+
...access,
|
|
137
|
+
createToken: options.runtime.createAppStoreConnectToken,
|
|
138
|
+
request: options.runtime.requestAppStoreConnect,
|
|
139
|
+
now: options.runtime.now(),
|
|
140
|
+
});
|
|
141
|
+
if (result.status === 'action-required')
|
|
142
|
+
return { status: 'action-required', action: result.action };
|
|
143
|
+
options.state.verification = result.verification;
|
|
144
|
+
return result.verification.ok
|
|
145
|
+
? { status: 'completed' }
|
|
146
|
+
: failed('IOS_VERIFICATION_FAILED', 'Published iOS deployment verification failed.');
|
|
147
|
+
}
|
|
148
|
+
async function safeCleanup(runtime, directory) {
|
|
149
|
+
try {
|
|
150
|
+
await runtime.cleanupArchive(directory);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Cleanup failure must not expose or retain provider output.
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function removeStep() {
|
|
157
|
+
return {
|
|
158
|
+
status: 'action-required',
|
|
159
|
+
action: {
|
|
160
|
+
type: 'manual-action',
|
|
161
|
+
target: 'ios',
|
|
162
|
+
provider: 'app-store-connect',
|
|
163
|
+
code: 'IOS_REMOVAL_REQUIRES_MANUAL_ACTION',
|
|
164
|
+
message: 'Review App Store Connect state before removing the iOS deployment target.',
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function failed(code, message) {
|
|
169
|
+
return { status: 'failed', error: { code, message, target: 'ios' } };
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=executeProjectIosStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeProjectIosStep.js","sourceRoot":"","sources":["../../../src/project/ios/executeProjectIosStep.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC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AA0B;QACvD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,sBAAsB;QAC/C,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE;KAC3B,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,MAAM,KAAK,iBAAiB;QACrC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IACjD,OAAO,MAAM,CAAC,YAAY,CAAC,EAAE;QAC3B,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE;QACzB,CAAC,CAAC,MAAM,CAAC,yBAAyB,EAAE,+CAA+C,CAAC,CAAC;AACzF,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,OAAoC,EAAE,SAAiB;IAChF,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,6DAA6D;IAC/D,CAAC;AACH,CAAC;AAED,SAAS,UAAU;IACjB,OAAO;QACL,MAAM,EAAE,iBAAiB;QACzB,MAAM,EAAE;YACN,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,oCAAoC;YAC1C,OAAO,EAAE,2EAA2E;SACrF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,OAAe;IAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;AACvE,CAAC","sourcesContent":["import type { DeploymentPlanStep } from '../../domain/DeploymentPlanStep';\nimport type { DeploymentStepOutcome } from '../../domain/DeploymentStepOutcome';\nimport { inspectAppStoreConnectIos } from '../../providers/appStoreConnect/inspectAppStoreConnectIos';\nimport { publishIosToAppStoreConnect } from '../../providers/appStoreConnect/publishIosToAppStoreConnect';\nimport { verifyAppStoreConnectPublication } from '../../providers/appStoreConnect/verifyAppStoreConnectPublication';\nimport { buildIosWithEas } from '../../providers/eas/ios/buildIosWithEas';\nimport { generateLocalIosFingerprint } from '../../providers/eas/ios/generateLocalIosFingerprint';\nimport { inspectEasIosConfig } from '../../providers/eas/ios/inspectEasIosConfig';\nimport { createIosDeploymentRevision } from '../../targets/ios/createIosDeploymentRevision';\nimport type { ProjectIosDeploymentInspection } from './ProjectIosDeploymentInspection';\nimport type { ProjectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';\nimport type { ProjectIosExecutionState } from './ProjectIosExecutionState';\nimport type { ResolvedProjectIosDeploymentAccess } from './resolveProjectIosDeploymentAccess';\nimport { scopeProjectIosDeploymentAccess } from './scopeProjectIosDeploymentAccess';\n\nexport async function executeProjectIosStep(options: {\n readonly step: DeploymentPlanStep;\n readonly inspection: ProjectIosDeploymentInspection;\n readonly bundleIdentifier: string;\n readonly access: ResolvedProjectIosDeploymentAccess;\n readonly runtime: ProjectIosDeploymentRuntime;\n readonly state: ProjectIosExecutionState;\n}): Promise<DeploymentStepOutcome> {\n switch (options.step.id) {\n case 'ios:prepare':\n return prepareStep(options);\n case 'ios:build':\n return buildStep(options);\n case 'ios:publish':\n return publishStep(options);\n case 'ios:verify':\n return verifyStep(options);\n case 'ios:remove':\n return removeStep();\n default:\n return failed('IOS_STEP_UNSUPPORTED', 'Unsupported iOS deployment step.');\n }\n}\n\nasync function prepareStep(\n options: Parameters<typeof executeProjectIosStep>[0],\n): Promise<DeploymentStepOutcome> {\n const expected = options.inspection.desiredRevision;\n if (expected === undefined)\n return failed('IOS_REVISION_MISSING', 'Planned iOS revision is missing.');\n const config = await inspectEasIosConfig({\n projectRoot: options.inspection.projectRoot,\n bundleIdentifier: options.bundleIdentifier,\n buildProfile: options.inspection.intent.buildProfile,\n ...options.access,\n runProcess: options.runtime.runProcess,\n });\n if (config.status === 'action-required')\n return { status: 'action-required', action: config.action };\n if (config.status === 'failed') return { status: 'failed', error: config.failure };\n const fingerprint = await generateLocalIosFingerprint({\n projectRoot: options.inspection.projectRoot,\n profileEnvironment: config.config.profileEnvironment,\n runProcess: options.runtime.runProcess,\n });\n if (fingerprint.status === 'failed') return { status: 'failed', error: fingerprint.failure };\n const revision = createIosDeploymentRevision(fingerprint.fingerprint, options.inspection.intent);\n if (revision !== expected) {\n return failed(\n 'IOS_SOURCE_CHANGED_AFTER_PLAN',\n 'iOS source changed after the deployment plan was created.',\n );\n }\n options.state.fingerprint = fingerprint.fingerprint;\n return { status: 'completed' };\n}\n\nasync function buildStep(\n options: Parameters<typeof executeProjectIosStep>[0],\n): Promise<DeploymentStepOutcome> {\n if (options.state.fingerprint === null) {\n return failed('IOS_FINGERPRINT_MISSING', 'Prepared iOS fingerprint is missing.');\n }\n const result = await buildIosWithEas({\n projectRoot: options.inspection.projectRoot,\n buildProfile: options.inspection.intent.buildProfile,\n expectedFingerprint: options.state.fingerprint,\n expectedVersion: options.inspection.intent.version,\n ...options.access,\n runProcess: options.runtime.runProcess,\n });\n if (result.status === 'action-required')\n return { status: 'action-required', action: result.action };\n if (result.status === 'failed') return { status: 'failed', error: result.failure };\n options.state.build = result.artifact;\n return { status: 'completed' };\n}\n\nasync function publishStep(\n options: Parameters<typeof executeProjectIosStep>[0],\n): Promise<DeploymentStepOutcome> {\n const build = options.state.build;\n const revision = options.inspection.desiredRevision;\n if (build === null || revision === undefined) {\n return failed('IOS_BUILD_MISSING', 'Completed iOS build is missing.');\n }\n const access = scopeProjectIosDeploymentAccess(options.access, 'app-store-connect');\n const app = await inspectAppStoreConnectIos({\n bundleIdentifier: options.bundleIdentifier,\n version: options.inspection.intent.version,\n ...access,\n createToken: options.runtime.createAppStoreConnectToken,\n request: options.runtime.requestAppStoreConnect,\n now: options.runtime.now(),\n });\n if (app.status === 'action-required') return { status: 'action-required', action: app.action };\n if (app.status === 'failed') return { status: 'failed', error: app.failure };\n const archive = await options.runtime.downloadArchive(build.archiveUrl);\n if (archive === null)\n return failed('IOS_ARCHIVE_DOWNLOAD_FAILED', 'iOS archive could not be downloaded.');\n try {\n const result = await publishIosToAppStoreConnect({\n appId: app.state.appId,\n version: build.version,\n buildNumber: build.buildNumber,\n file: await options.runtime.readArchive(archive.filePath),\n ...access,\n createToken: options.runtime.createAppStoreConnectToken,\n request: options.runtime.requestAppStoreConnect,\n upload: options.runtime.uploadAppStore,\n wait: options.runtime.waitForAppStoreProcessing,\n maxAttempts: options.runtime.maxAppStoreProcessingAttempts,\n now: options.runtime.now(),\n });\n if (result.status === 'action-required')\n return { status: 'action-required', action: result.action };\n if (result.status === 'failed') return { status: 'failed', error: result.failure };\n options.state.appStorePublication = result.publication;\n options.state.publication = {\n target: 'ios',\n revision,\n buildProvider: 'eas',\n publishProvider: 'app-store-connect',\n buildId: build.buildId,\n version: build.version,\n buildNumber: build.buildNumber,\n };\n return { status: 'completed' };\n } finally {\n await safeCleanup(options.runtime, archive.directory);\n }\n}\n\nasync function verifyStep(\n options: Parameters<typeof executeProjectIosStep>[0],\n): Promise<DeploymentStepOutcome> {\n if (options.state.appStorePublication === null) {\n return failed('IOS_PUBLICATION_MISSING', 'iOS publication result is missing.');\n }\n const access = scopeProjectIosDeploymentAccess(options.access, 'app-store-connect');\n const result = await verifyAppStoreConnectPublication({\n publication: options.state.appStorePublication,\n ...access,\n createToken: options.runtime.createAppStoreConnectToken,\n request: options.runtime.requestAppStoreConnect,\n now: options.runtime.now(),\n });\n if (result.status === 'action-required')\n return { status: 'action-required', action: result.action };\n options.state.verification = result.verification;\n return result.verification.ok\n ? { status: 'completed' }\n : failed('IOS_VERIFICATION_FAILED', 'Published iOS deployment verification failed.');\n}\n\nasync function safeCleanup(runtime: ProjectIosDeploymentRuntime, directory: string): Promise<void> {\n try {\n await runtime.cleanupArchive(directory);\n } catch {\n // Cleanup failure must not expose or retain provider output.\n }\n}\n\nfunction removeStep(): DeploymentStepOutcome {\n return {\n status: 'action-required',\n action: {\n type: 'manual-action',\n target: 'ios',\n provider: 'app-store-connect',\n code: 'IOS_REMOVAL_REQUIRES_MANUAL_ACTION',\n message: 'Review App Store Connect state before removing the iOS deployment target.',\n },\n };\n}\n\nfunction failed(code: string, message: string): DeploymentStepOutcome {\n return { status: 'failed', error: { code, message, target: 'ios' } };\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DeploymentProviderSetupInspectionResult } from '../../domain/DeploymentProviderSetupInspectionResult';
|
|
2
|
+
import type { AppStoreConnectIosState } from '../../providers/appStoreConnect/AppStoreConnectIosState';
|
|
3
|
+
import type { ProjectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';
|
|
4
|
+
import type { ResolvedProjectIosDeploymentAccess } from './resolveProjectIosDeploymentAccess';
|
|
5
|
+
export interface ProjectIosAppStoreConnectInspection {
|
|
6
|
+
readonly setup: DeploymentProviderSetupInspectionResult;
|
|
7
|
+
readonly state: AppStoreConnectIosState | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function inspectProjectIosAppStoreConnect(options: {
|
|
10
|
+
readonly bundleIdentifier: string;
|
|
11
|
+
readonly version: string;
|
|
12
|
+
readonly access: ResolvedProjectIosDeploymentAccess;
|
|
13
|
+
readonly runtime: ProjectIosDeploymentRuntime;
|
|
14
|
+
}): Promise<ProjectIosAppStoreConnectInspection>;
|
|
15
|
+
//# sourceMappingURL=inspectProjectIosAppStoreConnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectProjectIosAppStoreConnect.d.ts","sourceRoot":"","sources":["../../../src/project/ios/inspectProjectIosAppStoreConnect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,sDAAsD,CAAC;AAGpH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAGvG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAG9F,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,KAAK,EAAE,uCAAuC,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAChD;AAED,wBAAsB,gCAAgC,CAAC,OAAO,EAAE;IAC9D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,kCAAkC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;CAC/C,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAsB/C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { inspectDeploymentProviderSetup } from '../../engine/inspectDeploymentProviderSetup';
|
|
2
|
+
import { createAppStoreConnectSetupAdapter } from '../../providers/appStoreConnect/createAppStoreConnectSetupAdapter';
|
|
3
|
+
import { inspectAppStoreConnectIos } from '../../providers/appStoreConnect/inspectAppStoreConnectIos';
|
|
4
|
+
import { scopeProjectIosDeploymentAccess } from './scopeProjectIosDeploymentAccess';
|
|
5
|
+
export async function inspectProjectIosAppStoreConnect(options) {
|
|
6
|
+
const access = scopeProjectIosDeploymentAccess(options.access, 'app-store-connect');
|
|
7
|
+
const setup = await inspectDeploymentProviderSetup({
|
|
8
|
+
adapter: createAppStoreConnectSetupAdapter({
|
|
9
|
+
createToken: options.runtime.createAppStoreConnectToken,
|
|
10
|
+
now: options.runtime.now,
|
|
11
|
+
}),
|
|
12
|
+
context: { target: 'ios', ...access },
|
|
13
|
+
});
|
|
14
|
+
if (!isReady(setup))
|
|
15
|
+
return { setup, state: null };
|
|
16
|
+
const inspected = await inspectAppStoreConnectIos({
|
|
17
|
+
bundleIdentifier: options.bundleIdentifier,
|
|
18
|
+
version: options.version,
|
|
19
|
+
...access,
|
|
20
|
+
createToken: options.runtime.createAppStoreConnectToken,
|
|
21
|
+
request: options.runtime.requestAppStoreConnect,
|
|
22
|
+
now: options.runtime.now(),
|
|
23
|
+
});
|
|
24
|
+
if (inspected.status === 'completed')
|
|
25
|
+
return { setup, state: inspected.state };
|
|
26
|
+
if (inspected.status === 'failed')
|
|
27
|
+
return { setup: { ok: false, failure: inspected.failure }, state: null };
|
|
28
|
+
return { setup: actionSetup(inspected.action), state: null };
|
|
29
|
+
}
|
|
30
|
+
function isReady(result) {
|
|
31
|
+
return (result.ok &&
|
|
32
|
+
result.inspection.authentication.status === 'authenticated' &&
|
|
33
|
+
result.inspection.provisioning.length === 0 &&
|
|
34
|
+
result.inspection.capabilities.some((capability) => capability.capability === 'publish' && capability.status === 'available'));
|
|
35
|
+
}
|
|
36
|
+
function actionSetup(action) {
|
|
37
|
+
const authentication = action.type === 'authentication'
|
|
38
|
+
? { status: 'required', action }
|
|
39
|
+
: { status: 'authenticated' };
|
|
40
|
+
const provisioning = action.type === 'authentication'
|
|
41
|
+
? [{ type: 'authentication', action }]
|
|
42
|
+
: [{ type: 'manual-action', action }];
|
|
43
|
+
return {
|
|
44
|
+
ok: true,
|
|
45
|
+
inspection: {
|
|
46
|
+
provider: 'app-store-connect',
|
|
47
|
+
authentication,
|
|
48
|
+
capabilities: [
|
|
49
|
+
{ capability: 'publish', status: 'unavailable', reason: 'Provider setup is incomplete.' },
|
|
50
|
+
],
|
|
51
|
+
provisioning,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=inspectProjectIosAppStoreConnect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectProjectIosAppStoreConnect.js","sourceRoot":"","sources":["../../../src/project/ios/inspectProjectIosAppStoreConnect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EAAE,iCAAiC,EAAE,MAAM,m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;IAC3E,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,OAAO,CAAC,MAA+C;IAC9D,OAAO,CACL,MAAM,CAAC,EAAE;QACT,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,eAAe;QAC3D,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC3C,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACjC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,MAAM,KAAK,WAAW,CACzF,CACF,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,MAAgC;IACnD,MAAM,cAAc,GAClB,MAAM,CAAC,IAAI,KAAK,gBAAgB;QAC9B,CAAC,CAAC,EAAE,MAAM,EAAE,UAAmB,EAAE,MAAM,EAAE;QACzC,CAAC,CAAC,EAAE,MAAM,EAAE,eAAwB,EAAE,CAAC;IAC3C,MAAM,YAAY,GAChB,MAAM,CAAC,IAAI,KAAK,gBAAgB;QAC9B,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAyB,EAAE,MAAM,EAAE,CAAC;QAC/C,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,eAAwB,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,UAAU,EAAE;YACV,QAAQ,EAAE,mBAAmB;YAC7B,cAAc;YACd,YAAY,EAAE;gBACZ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,+BAA+B,EAAE;aAC1F;YACD,YAAY;SACb;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { DeploymentProviderSetupInspectionResult } from '../../domain/DeploymentProviderSetupInspectionResult';\nimport type { DeploymentRequiredAction } from '../../domain/DeploymentRequiredAction';\nimport { inspectDeploymentProviderSetup } from '../../engine/inspectDeploymentProviderSetup';\nimport type { AppStoreConnectIosState } from '../../providers/appStoreConnect/AppStoreConnectIosState';\nimport { createAppStoreConnectSetupAdapter } from '../../providers/appStoreConnect/createAppStoreConnectSetupAdapter';\nimport { inspectAppStoreConnectIos } from '../../providers/appStoreConnect/inspectAppStoreConnectIos';\nimport type { ProjectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';\nimport type { ResolvedProjectIosDeploymentAccess } from './resolveProjectIosDeploymentAccess';\nimport { scopeProjectIosDeploymentAccess } from './scopeProjectIosDeploymentAccess';\n\nexport interface ProjectIosAppStoreConnectInspection {\n readonly setup: DeploymentProviderSetupInspectionResult;\n readonly state: AppStoreConnectIosState | null;\n}\n\nexport async function inspectProjectIosAppStoreConnect(options: {\n readonly bundleIdentifier: string;\n readonly version: string;\n readonly access: ResolvedProjectIosDeploymentAccess;\n readonly runtime: ProjectIosDeploymentRuntime;\n}): Promise<ProjectIosAppStoreConnectInspection> {\n const access = scopeProjectIosDeploymentAccess(options.access, 'app-store-connect');\n const setup = await inspectDeploymentProviderSetup({\n adapter: createAppStoreConnectSetupAdapter({\n createToken: options.runtime.createAppStoreConnectToken,\n now: options.runtime.now,\n }),\n context: { target: 'ios', ...access },\n });\n if (!isReady(setup)) return { setup, state: null };\n const inspected = await inspectAppStoreConnectIos({\n bundleIdentifier: options.bundleIdentifier,\n version: options.version,\n ...access,\n createToken: options.runtime.createAppStoreConnectToken,\n request: options.runtime.requestAppStoreConnect,\n now: options.runtime.now(),\n });\n if (inspected.status === 'completed') return { setup, state: inspected.state };\n if (inspected.status === 'failed')\n return { setup: { ok: false, failure: inspected.failure }, state: null };\n return { setup: actionSetup(inspected.action), state: null };\n}\n\nfunction isReady(result: DeploymentProviderSetupInspectionResult): boolean {\n return (\n result.ok &&\n result.inspection.authentication.status === 'authenticated' &&\n result.inspection.provisioning.length === 0 &&\n result.inspection.capabilities.some(\n (capability) => capability.capability === 'publish' && capability.status === 'available',\n )\n );\n}\n\nfunction actionSetup(action: DeploymentRequiredAction): DeploymentProviderSetupInspectionResult {\n const authentication =\n action.type === 'authentication'\n ? { status: 'required' as const, action }\n : { status: 'authenticated' as const };\n const provisioning =\n action.type === 'authentication'\n ? [{ type: 'authentication' as const, action }]\n : [{ type: 'manual-action' as const, action }];\n return {\n ok: true,\n inspection: {\n provider: 'app-store-connect',\n authentication,\n capabilities: [\n { capability: 'publish', status: 'unavailable', reason: 'Provider setup is incomplete.' },\n ],\n provisioning,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IosDeploymentIntent } from '../../domain/IosDeploymentIntent';
|
|
2
|
+
import type { ProjectIosDeploymentAccess } from './ProjectIosDeploymentAccess';
|
|
3
|
+
import type { ProjectIosDeploymentInspectionResult } from './ProjectIosDeploymentInspection';
|
|
4
|
+
import type { ProjectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';
|
|
5
|
+
export interface InspectProjectIosDeploymentOptions extends ProjectIosDeploymentAccess {
|
|
6
|
+
readonly projectRoot: string;
|
|
7
|
+
readonly intent: IosDeploymentIntent;
|
|
8
|
+
}
|
|
9
|
+
export declare function inspectProjectIosDeployment(options: InspectProjectIosDeploymentOptions): Promise<ProjectIosDeploymentInspectionResult>;
|
|
10
|
+
export declare function inspectProjectIosDeploymentWithRuntime(options: InspectProjectIosDeploymentOptions, runtime: ProjectIosDeploymentRuntime): Promise<ProjectIosDeploymentInspectionResult>;
|
|
11
|
+
//# sourceMappingURL=inspectProjectIosDeployment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectProjectIosDeployment.d.ts","sourceRoot":"","sources":["../../../src/project/ios/inspectProjectIosDeployment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAS5E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAKjF,MAAM,WAAW,kCAAmC,SAAQ,0BAA0B;IACpF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACtC;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,oCAAoC,CAAC,CAE/C;AAED,wBAAsB,sCAAsC,CAC1D,OAAO,EAAE,kCAAkC,EAC3C,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,oCAAoC,CAAC,CA2B/C"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { generateLocalIosFingerprint } from '../../providers/eas/ios/generateLocalIosFingerprint';
|
|
2
|
+
import { inspectEasIosConfig } from '../../providers/eas/ios/inspectEasIosConfig';
|
|
3
|
+
import { createIosDeploymentRevision } from '../../targets/ios/createIosDeploymentRevision';
|
|
4
|
+
import { isIosDeploymentIntentValid } from '../../targets/ios/isIosDeploymentIntentValid';
|
|
5
|
+
import { resolveDeployProject } from '../resolveDeployProject';
|
|
6
|
+
import { inspectProjectIosAppStoreConnect } from './inspectProjectIosAppStoreConnect';
|
|
7
|
+
import { inspectProjectIosEasSetup } from './inspectProjectIosEasSetup';
|
|
8
|
+
import { normalizeProjectIosDesired } from './normalizeProjectIosDesired';
|
|
9
|
+
import { projectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';
|
|
10
|
+
import { readCurrentProjectIosDeployment } from './readCurrentProjectIosDeployment';
|
|
11
|
+
import { resolveProjectIosDeploymentAccess } from './resolveProjectIosDeploymentAccess';
|
|
12
|
+
export function inspectProjectIosDeployment(options) {
|
|
13
|
+
return inspectProjectIosDeploymentWithRuntime(options, projectIosDeploymentRuntime);
|
|
14
|
+
}
|
|
15
|
+
export async function inspectProjectIosDeploymentWithRuntime(options, runtime) {
|
|
16
|
+
try {
|
|
17
|
+
if (!isIosDeploymentIntentValid(options.intent))
|
|
18
|
+
return invalidIntent();
|
|
19
|
+
const project = await resolveDeployProject({ projectRoot: options.projectRoot });
|
|
20
|
+
const normalized = normalizeProjectIosDesired(project.deploy);
|
|
21
|
+
if (!normalized.ok)
|
|
22
|
+
return normalized;
|
|
23
|
+
if (!normalized.enabled || normalized.bundleIdentifier === undefined) {
|
|
24
|
+
const current = await readCurrentProjectIosDeployment({ projectRoot: project.projectRoot });
|
|
25
|
+
return success(project.projectRoot, normalized.desired, current, options.intent, undefined, []);
|
|
26
|
+
}
|
|
27
|
+
return inspectEnabledProject(project.projectRoot, normalized.desired, normalized.bundleIdentifier, options, runtime);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return failure('IOS_PROJECT_INSPECTION_FAILED', 'iOS deployment project inspection failed.');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function inspectEnabledProject(projectRoot, desired, bundleIdentifier, options, runtime) {
|
|
34
|
+
const access = resolveProjectIosDeploymentAccess(options);
|
|
35
|
+
const config = await inspectEasIosConfig({
|
|
36
|
+
projectRoot,
|
|
37
|
+
bundleIdentifier,
|
|
38
|
+
buildProfile: options.intent.buildProfile,
|
|
39
|
+
...access,
|
|
40
|
+
runProcess: runtime.runProcess,
|
|
41
|
+
});
|
|
42
|
+
const [easSetup, appStore] = await Promise.all([
|
|
43
|
+
inspectProjectIosEasSetup(projectRoot, access, runtime),
|
|
44
|
+
inspectProjectIosAppStoreConnect({
|
|
45
|
+
bundleIdentifier,
|
|
46
|
+
version: options.intent.version,
|
|
47
|
+
access,
|
|
48
|
+
runtime,
|
|
49
|
+
}),
|
|
50
|
+
]);
|
|
51
|
+
const current = await readCurrentProjectIosDeployment({
|
|
52
|
+
projectRoot,
|
|
53
|
+
bundleIdentifier,
|
|
54
|
+
appStoreState: appStore.state,
|
|
55
|
+
});
|
|
56
|
+
if (config.status === 'failed')
|
|
57
|
+
return { ok: false, failure: config.failure };
|
|
58
|
+
if (config.status === 'action-required') {
|
|
59
|
+
return success(projectRoot, desired, current, options.intent, undefined, [
|
|
60
|
+
easSetup,
|
|
61
|
+
appStore.setup,
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
const fingerprint = await generateLocalIosFingerprint({
|
|
65
|
+
projectRoot,
|
|
66
|
+
profileEnvironment: config.config.profileEnvironment,
|
|
67
|
+
runProcess: runtime.runProcess,
|
|
68
|
+
});
|
|
69
|
+
if (fingerprint.status === 'failed')
|
|
70
|
+
return { ok: false, failure: fingerprint.failure };
|
|
71
|
+
const revision = createIosDeploymentRevision(fingerprint.fingerprint, options.intent);
|
|
72
|
+
return success(projectRoot, desired, current, options.intent, revision, [
|
|
73
|
+
easSetup,
|
|
74
|
+
appStore.setup,
|
|
75
|
+
]);
|
|
76
|
+
}
|
|
77
|
+
function success(projectRoot, desired, current, intent, desiredRevision, setups) {
|
|
78
|
+
return {
|
|
79
|
+
ok: true,
|
|
80
|
+
inspection: {
|
|
81
|
+
projectRoot,
|
|
82
|
+
desired,
|
|
83
|
+
current,
|
|
84
|
+
intent,
|
|
85
|
+
...(desiredRevision === undefined ? {} : { desiredRevision }),
|
|
86
|
+
setups,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function invalidIntent() {
|
|
91
|
+
return failure('INVALID_IOS_DEPLOYMENT_INTENT', 'iOS deployment intent is invalid.');
|
|
92
|
+
}
|
|
93
|
+
function failure(code, message) {
|
|
94
|
+
return { ok: false, failure: { code, message, target: 'ios' } };
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=inspectProjectIosDeployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectProjectIosDeployment.js","sourceRoot":"","sources":["../../../src/project/ios/inspectProjectIosDeployment.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,2BAA2B,E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F,CAAC;AAED,SAAS,OAAO,CAAC,IAAY,EAAE,OAAe;IAC5C,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;AAClE,CAAC","sourcesContent":["import type { AppDeployManifest } from '@ankhorage/contracts/deploy';\n\nimport type { DeploymentCurrentState } from '../../domain/DeploymentCurrentState';\nimport type { DeploymentProviderSetupInspectionResult } from '../../domain/DeploymentProviderSetupInspectionResult';\nimport type { IosDeploymentIntent } from '../../domain/IosDeploymentIntent';\nimport { generateLocalIosFingerprint } from '../../providers/eas/ios/generateLocalIosFingerprint';\nimport { inspectEasIosConfig } from '../../providers/eas/ios/inspectEasIosConfig';\nimport { createIosDeploymentRevision } from '../../targets/ios/createIosDeploymentRevision';\nimport { isIosDeploymentIntentValid } from '../../targets/ios/isIosDeploymentIntentValid';\nimport { resolveDeployProject } from '../resolveDeployProject';\nimport { inspectProjectIosAppStoreConnect } from './inspectProjectIosAppStoreConnect';\nimport { inspectProjectIosEasSetup } from './inspectProjectIosEasSetup';\nimport { normalizeProjectIosDesired } from './normalizeProjectIosDesired';\nimport type { ProjectIosDeploymentAccess } from './ProjectIosDeploymentAccess';\nimport type { ProjectIosDeploymentInspectionResult } from './ProjectIosDeploymentInspection';\nimport type { ProjectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';\nimport { projectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';\nimport { readCurrentProjectIosDeployment } from './readCurrentProjectIosDeployment';\nimport { resolveProjectIosDeploymentAccess } from './resolveProjectIosDeploymentAccess';\n\nexport interface InspectProjectIosDeploymentOptions extends ProjectIosDeploymentAccess {\n readonly projectRoot: string;\n readonly intent: IosDeploymentIntent;\n}\n\nexport function inspectProjectIosDeployment(\n options: InspectProjectIosDeploymentOptions,\n): Promise<ProjectIosDeploymentInspectionResult> {\n return inspectProjectIosDeploymentWithRuntime(options, projectIosDeploymentRuntime);\n}\n\nexport async function inspectProjectIosDeploymentWithRuntime(\n options: InspectProjectIosDeploymentOptions,\n runtime: ProjectIosDeploymentRuntime,\n): Promise<ProjectIosDeploymentInspectionResult> {\n try {\n if (!isIosDeploymentIntentValid(options.intent)) return invalidIntent();\n const project = await resolveDeployProject({ projectRoot: options.projectRoot });\n const normalized = normalizeProjectIosDesired(project.deploy);\n if (!normalized.ok) return normalized;\n if (!normalized.enabled || normalized.bundleIdentifier === undefined) {\n const current = await readCurrentProjectIosDeployment({ projectRoot: project.projectRoot });\n return success(\n project.projectRoot,\n normalized.desired,\n current,\n options.intent,\n undefined,\n [],\n );\n }\n return inspectEnabledProject(\n project.projectRoot,\n normalized.desired,\n normalized.bundleIdentifier,\n options,\n runtime,\n );\n } catch {\n return failure('IOS_PROJECT_INSPECTION_FAILED', 'iOS deployment project inspection failed.');\n }\n}\n\nasync function inspectEnabledProject(\n projectRoot: string,\n desired: AppDeployManifest,\n bundleIdentifier: string,\n options: InspectProjectIosDeploymentOptions,\n runtime: ProjectIosDeploymentRuntime,\n): Promise<ProjectIosDeploymentInspectionResult> {\n const access = resolveProjectIosDeploymentAccess(options);\n const config = await inspectEasIosConfig({\n projectRoot,\n bundleIdentifier,\n buildProfile: options.intent.buildProfile,\n ...access,\n runProcess: runtime.runProcess,\n });\n const [easSetup, appStore] = await Promise.all([\n inspectProjectIosEasSetup(projectRoot, access, runtime),\n inspectProjectIosAppStoreConnect({\n bundleIdentifier,\n version: options.intent.version,\n access,\n runtime,\n }),\n ]);\n const current = await readCurrentProjectIosDeployment({\n projectRoot,\n bundleIdentifier,\n appStoreState: appStore.state,\n });\n if (config.status === 'failed') return { ok: false, failure: config.failure };\n if (config.status === 'action-required') {\n return success(projectRoot, desired, current, options.intent, undefined, [\n easSetup,\n appStore.setup,\n ]);\n }\n const fingerprint = await generateLocalIosFingerprint({\n projectRoot,\n profileEnvironment: config.config.profileEnvironment,\n runProcess: runtime.runProcess,\n });\n if (fingerprint.status === 'failed') return { ok: false, failure: fingerprint.failure };\n const revision = createIosDeploymentRevision(fingerprint.fingerprint, options.intent);\n return success(projectRoot, desired, current, options.intent, revision, [\n easSetup,\n appStore.setup,\n ]);\n}\n\nfunction success(\n projectRoot: string,\n desired: AppDeployManifest,\n current: DeploymentCurrentState,\n intent: IosDeploymentIntent,\n desiredRevision: string | undefined,\n setups: readonly DeploymentProviderSetupInspectionResult[],\n): ProjectIosDeploymentInspectionResult {\n return {\n ok: true,\n inspection: {\n projectRoot,\n desired,\n current,\n intent,\n ...(desiredRevision === undefined ? {} : { desiredRevision }),\n setups,\n },\n };\n}\n\nfunction invalidIntent(): ProjectIosDeploymentInspectionResult {\n return failure('INVALID_IOS_DEPLOYMENT_INTENT', 'iOS deployment intent is invalid.');\n}\n\nfunction failure(code: string, message: string): ProjectIosDeploymentInspectionResult {\n return { ok: false, failure: { code, message, target: 'ios' } };\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DeploymentProviderSetupInspectionResult } from '../../domain/DeploymentProviderSetupInspectionResult';
|
|
2
|
+
import type { ProjectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';
|
|
3
|
+
import type { ResolvedProjectIosDeploymentAccess } from './resolveProjectIosDeploymentAccess';
|
|
4
|
+
export declare function inspectProjectIosEasSetup(projectRoot: string, access: ResolvedProjectIosDeploymentAccess, runtime: ProjectIosDeploymentRuntime): Promise<DeploymentProviderSetupInspectionResult>;
|
|
5
|
+
//# sourceMappingURL=inspectProjectIosEasSetup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectProjectIosEasSetup.d.ts","sourceRoot":"","sources":["../../../src/project/ios/inspectProjectIosEasSetup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,sDAAsD,CAAC;AAGpH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAG9F,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kCAAkC,EAC1C,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,uCAAuC,CAAC,CAalD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { inspectDeploymentProviderSetup } from '../../engine/inspectDeploymentProviderSetup';
|
|
2
|
+
import { createEasSetupAdapter } from '../../providers/eas/createEasSetupAdapter';
|
|
3
|
+
import { scopeProjectIosDeploymentAccess } from './scopeProjectIosDeploymentAccess';
|
|
4
|
+
export function inspectProjectIosEasSetup(projectRoot, access, runtime) {
|
|
5
|
+
return inspectDeploymentProviderSetup({
|
|
6
|
+
adapter: createEasSetupAdapter({
|
|
7
|
+
projectRoot,
|
|
8
|
+
runProcess: runtime.runProcess,
|
|
9
|
+
target: 'ios',
|
|
10
|
+
capability: 'build',
|
|
11
|
+
}),
|
|
12
|
+
context: {
|
|
13
|
+
target: 'ios',
|
|
14
|
+
...scopeProjectIosDeploymentAccess(access, 'eas'),
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=inspectProjectIosEasSetup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectProjectIosEasSetup.js","sourceRoot":"","sources":["../../../src/project/ios/inspectProjectIosEasSetup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAGlF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,MAAM,UAAU,yBAAyB,CACvC,WAAmB,EACnB,MAA0C,EAC1C,OAAoC;IAEpC,OAAO,8BAA8B,CAAC;QACpC,OAAO,EAAE,qBAAqB,CAAC;YAC7B,WAAW;YACX,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,OAAO;SACpB,CAAC;QACF,OAAO,EAAE;YACP,MAAM,EAAE,KAAK;YACb,GAAG,+BAA+B,CAAC,MAAM,EAAE,KAAK,CAAC;SAClD;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { DeploymentProviderSetupInspectionResult } from '../../domain/DeploymentProviderSetupInspectionResult';\nimport { inspectDeploymentProviderSetup } from '../../engine/inspectDeploymentProviderSetup';\nimport { createEasSetupAdapter } from '../../providers/eas/createEasSetupAdapter';\nimport type { ProjectIosDeploymentRuntime } from './ProjectIosDeploymentRuntime';\nimport type { ResolvedProjectIosDeploymentAccess } from './resolveProjectIosDeploymentAccess';\nimport { scopeProjectIosDeploymentAccess } from './scopeProjectIosDeploymentAccess';\n\nexport function inspectProjectIosEasSetup(\n projectRoot: string,\n access: ResolvedProjectIosDeploymentAccess,\n runtime: ProjectIosDeploymentRuntime,\n): Promise<DeploymentProviderSetupInspectionResult> {\n return inspectDeploymentProviderSetup({\n adapter: createEasSetupAdapter({\n projectRoot,\n runProcess: runtime.runProcess,\n target: 'ios',\n capability: 'build',\n }),\n context: {\n target: 'ios',\n ...scopeProjectIosDeploymentAccess(access, 'eas'),\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AppDeployManifest } from '@ankhorage/contracts/deploy';
|
|
2
|
+
import type { DeploymentFailure } from '../../domain/DeploymentFailure';
|
|
3
|
+
export type NormalizeProjectIosDesiredResult = {
|
|
4
|
+
readonly ok: true;
|
|
5
|
+
readonly desired: AppDeployManifest;
|
|
6
|
+
readonly enabled: boolean;
|
|
7
|
+
readonly bundleIdentifier?: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly ok: false;
|
|
10
|
+
readonly failure: DeploymentFailure;
|
|
11
|
+
};
|
|
12
|
+
export declare function normalizeProjectIosDesired(deploy: AppDeployManifest | null): NormalizeProjectIosDesiredResult;
|
|
13
|
+
//# sourceMappingURL=normalizeProjectIosDesired.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeProjectIosDesired.d.ts","sourceRoot":"","sources":["../../../src/project/ios/normalizeProjectIosDesired.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,MAAM,MAAM,gCAAgC,GACxC;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAEhE,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAC/B,gCAAgC,CAqBlC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { normalizeIosProviders } from '../../targets/ios/normalizeIosProviders';
|
|
2
|
+
export function normalizeProjectIosDesired(deploy) {
|
|
3
|
+
const ios = deploy?.targets.ios;
|
|
4
|
+
if (ios?.enabled !== true) {
|
|
5
|
+
return { ok: true, desired: { targets: {} }, enabled: false };
|
|
6
|
+
}
|
|
7
|
+
const normalized = normalizeIosProviders(ios.providers);
|
|
8
|
+
if (!normalized.ok)
|
|
9
|
+
return normalized;
|
|
10
|
+
return {
|
|
11
|
+
ok: true,
|
|
12
|
+
enabled: true,
|
|
13
|
+
bundleIdentifier: ios.bundleIdentifier,
|
|
14
|
+
desired: {
|
|
15
|
+
targets: {
|
|
16
|
+
ios: {
|
|
17
|
+
enabled: true,
|
|
18
|
+
bundleIdentifier: ios.bundleIdentifier,
|
|
19
|
+
providers: normalized.providers,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=normalizeProjectIosDesired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeProjectIosDesired.js","sourceRoot":"","sources":["../../../src/project/ios/normalizeProjectIosDesired.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAWhF,MAAM,UAAU,0BAA0B,CACxC,MAAgC;IAEhC,MAAM,GAAG,GAAG,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC;IAChC,IAAI,GAAG,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAChE,CAAC;IACD,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC,UAAU,CAAC,EAAE;QAAE,OAAO,UAAU,CAAC;IACtC,OAAO;QACL,EAAE,EAAE,IAAI;QACR,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;QACtC,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,GAAG,EAAE;oBACH,OAAO,EAAE,IAAI;oBACb,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;oBACtC,SAAS,EAAE,UAAU,CAAC,SAAS;iBAChC;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AppDeployManifest } from '@ankhorage/contracts/deploy';\n\nimport type { DeploymentFailure } from '../../domain/DeploymentFailure';\nimport { normalizeIosProviders } from '../../targets/ios/normalizeIosProviders';\n\nexport type NormalizeProjectIosDesiredResult =\n | {\n readonly ok: true;\n readonly desired: AppDeployManifest;\n readonly enabled: boolean;\n readonly bundleIdentifier?: string;\n }\n | { readonly ok: false; readonly failure: DeploymentFailure };\n\nexport function normalizeProjectIosDesired(\n deploy: AppDeployManifest | null,\n): NormalizeProjectIosDesiredResult {\n const ios = deploy?.targets.ios;\n if (ios?.enabled !== true) {\n return { ok: true, desired: { targets: {} }, enabled: false };\n }\n const normalized = normalizeIosProviders(ios.providers);\n if (!normalized.ok) return normalized;\n return {\n ok: true,\n enabled: true,\n bundleIdentifier: ios.bundleIdentifier,\n desired: {\n targets: {\n ios: {\n enabled: true,\n bundleIdentifier: ios.bundleIdentifier,\n providers: normalized.providers,\n },\n },\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DeploymentCurrentState } from '../../domain/DeploymentCurrentState';
|
|
2
|
+
import type { AppStoreConnectIosState } from '../../providers/appStoreConnect/AppStoreConnectIosState';
|
|
3
|
+
export declare function readCurrentProjectIosDeployment(options: {
|
|
4
|
+
readonly projectRoot: string;
|
|
5
|
+
readonly bundleIdentifier?: string;
|
|
6
|
+
readonly appStoreState?: AppStoreConnectIosState | null;
|
|
7
|
+
}): Promise<DeploymentCurrentState>;
|
|
8
|
+
//# sourceMappingURL=readCurrentProjectIosDeployment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readCurrentProjectIosDeployment.d.ts","sourceRoot":"","sources":["../../../src/project/ios/readCurrentProjectIosDeployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAWvG,wBAAsB,+BAA+B,CAAC,OAAO,EAAE;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACzD,GAAG,OAAO,CAAC,sBAAsB,CAAC,CASlC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { listProjectDeploymentHistory } from '../history/listProjectDeploymentHistory';
|
|
2
|
+
export async function readCurrentProjectIosDeployment(options) {
|
|
3
|
+
const history = await listProjectDeploymentHistory({ projectRoot: options.projectRoot });
|
|
4
|
+
const evidence = history
|
|
5
|
+
.map(parseEvidence)
|
|
6
|
+
.filter((item) => item !== null)
|
|
7
|
+
.filter((item) => matchesRequestedBundle(item, options.bundleIdentifier))
|
|
8
|
+
.filter((item) => matchesRemoteBuild(item, options.appStoreState))
|
|
9
|
+
.sort((left, right) => right.recordedAt.localeCompare(left.recordedAt))[0];
|
|
10
|
+
return evidence === undefined ? { targets: {} } : { targets: { ios: observed(evidence) } };
|
|
11
|
+
}
|
|
12
|
+
function parseEvidence(record) {
|
|
13
|
+
if (record.execution.status !== 'completed' || record.verification?.ok !== true)
|
|
14
|
+
return null;
|
|
15
|
+
const match = /^ios-(.+)-([a-f\d]{64})$/i.exec(record.deploymentId);
|
|
16
|
+
if (match === null)
|
|
17
|
+
return null;
|
|
18
|
+
const buildNumber = match[1];
|
|
19
|
+
const revision = match[2];
|
|
20
|
+
if (buildNumber === undefined || buildNumber.length === 0 || revision === undefined)
|
|
21
|
+
return null;
|
|
22
|
+
const desired = record.plan.changes.find((change) => change.target === 'ios')?.desired;
|
|
23
|
+
if (desired?.target !== 'ios')
|
|
24
|
+
return null;
|
|
25
|
+
return {
|
|
26
|
+
revision,
|
|
27
|
+
buildNumber,
|
|
28
|
+
bundleIdentifier: desired.bundleIdentifier,
|
|
29
|
+
recordedAt: record.recordedAt,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function matchesRequestedBundle(item, bundleIdentifier) {
|
|
33
|
+
return bundleIdentifier === undefined || item.bundleIdentifier === bundleIdentifier;
|
|
34
|
+
}
|
|
35
|
+
function matchesRemoteBuild(item, state) {
|
|
36
|
+
if (state === undefined)
|
|
37
|
+
return true;
|
|
38
|
+
if (state === null || state.bundleIdentifier !== item.bundleIdentifier)
|
|
39
|
+
return false;
|
|
40
|
+
const build = state.version?.build;
|
|
41
|
+
if (build === null || build === undefined || build.buildNumber !== item.buildNumber)
|
|
42
|
+
return false;
|
|
43
|
+
return build.processingState === undefined || build.processingState === 'VALID';
|
|
44
|
+
}
|
|
45
|
+
function observed(item) {
|
|
46
|
+
return {
|
|
47
|
+
bundleIdentifier: item.bundleIdentifier,
|
|
48
|
+
providers: { build: 'eas', publish: 'app-store-connect' },
|
|
49
|
+
revision: item.revision,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=readCurrentProjectIosDeployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readCurrentProjectIosDeployment.js","sourceRoot":"","sources":["../../../src/project/ios/readCurrentProjectIosDeployment.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AASvF,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,OAIrD;IACC,MAAM,OAAO,GAAG,MAAM,4BAA4B,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACzF,MAAM,QAAQ,GAAG,OAAO;SACrB,GAAG,CAAC,aAAa,CAAC;SAClB,MAAM,CAAC,CAAC,IAAI,EAA8B,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC;SAC3D,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;SACxE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;SACjE,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,C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ACtF,CAAC;AAED,SAAS,kBAAkB,CACzB,IAAwB,EACxB,KAAiD;IAEjD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,gBAAgB,KAAK,IAAI,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAC;IACrF,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC;IACnC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW;QAAE,OAAO,KAAK,CAAC;IAClG,OAAO,KAAK,CAAC,eAAe,KAAK,SAAS,IAAI,KAAK,CAAC,eAAe,KAAK,OAAO,CAAC;AAClF,CAAC;AAED,SAAS,QAAQ,CAAC,IAAwB;IACxC,OAAO;QACL,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE;QACzD,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import type {\n DeploymentCurrentState,\n DeploymentObservedIosTarget,\n} from '../../domain/DeploymentCurrentState';\nimport type { AppStoreConnectIosState } from '../../providers/appStoreConnect/AppStoreConnectIosState';\nimport type { ProjectDeploymentHistoryRecord } from '../history/ProjectDeploymentHistoryRecord';\nimport { listProjectDeploymentHistory } from '../history/listProjectDeploymentHistory';\n\ninterface IosHistoryEvidence {\n readonly revision: string;\n readonly buildNumber: string;\n readonly bundleIdentifier: string;\n readonly recordedAt: string;\n}\n\nexport async function readCurrentProjectIosDeployment(options: {\n readonly projectRoot: string;\n readonly bundleIdentifier?: string;\n readonly appStoreState?: AppStoreConnectIosState | null;\n}): Promise<DeploymentCurrentState> {\n const history = await listProjectDeploymentHistory({ projectRoot: options.projectRoot });\n const evidence = history\n .map(parseEvidence)\n .filter((item): item is IosHistoryEvidence => item !== null)\n .filter((item) => matchesRequestedBundle(item, options.bundleIdentifier))\n .filter((item) => matchesRemoteBuild(item, options.appStoreState))\n .sort((left, right) => right.recordedAt.localeCompare(left.recordedAt))[0];\n return evidence === undefined ? { targets: {} } : { targets: { ios: observed(evidence) } };\n}\n\nfunction parseEvidence(record: ProjectDeploymentHistoryRecord): IosHistoryEvidence | null {\n if (record.execution.status !== 'completed' || record.verification?.ok !== true) return null;\n const match = /^ios-(.+)-([a-f\\d]{64})$/i.exec(record.deploymentId);\n if (match === null) return null;\n const buildNumber = match[1];\n const revision = match[2];\n if (buildNumber === undefined || buildNumber.length === 0 || revision === undefined) return null;\n const desired = record.plan.changes.find((change) => change.target === 'ios')?.desired;\n if (desired?.target !== 'ios') return null;\n return {\n revision,\n buildNumber,\n bundleIdentifier: desired.bundleIdentifier,\n recordedAt: record.recordedAt,\n };\n}\n\nfunction matchesRequestedBundle(item: IosHistoryEvidence, bundleIdentifier: string | undefined) {\n return bundleIdentifier === undefined || item.bundleIdentifier === bundleIdentifier;\n}\n\nfunction matchesRemoteBuild(\n item: IosHistoryEvidence,\n state: AppStoreConnectIosState | null | undefined,\n) {\n if (state === undefined) return true;\n if (state === null || state.bundleIdentifier !== item.bundleIdentifier) return false;\n const build = state.version?.build;\n if (build === null || build === undefined || build.buildNumber !== item.buildNumber) return false;\n return build.processingState === undefined || build.processingState === 'VALID';\n}\n\nfunction observed(item: IosHistoryEvidence): DeploymentObservedIosTarget {\n return {\n bundleIdentifier: item.bundleIdentifier,\n providers: { build: 'eas', publish: 'app-store-connect' },\n revision: item.revision,\n };\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DeploymentExecutionResult } from '../../domain/DeploymentExecutionResult';
|
|
2
|
+
import type { DeploymentFailure } from '../../domain/DeploymentFailure';
|
|
3
|
+
import type { DeploymentPlan } from '../../domain/DeploymentPlan';
|
|
4
|
+
import type { DeploymentVerificationResult } from '../../domain/DeploymentVerificationResult';
|
|
5
|
+
import type { IosDeploymentPublication } from '../../domain/IosDeploymentPublication';
|
|
6
|
+
import type { ProjectIosDeploymentInspection } from './ProjectIosDeploymentInspection';
|
|
7
|
+
export type RecordProjectIosHistoryResult = {
|
|
8
|
+
readonly recorded: true;
|
|
9
|
+
} | {
|
|
10
|
+
readonly recorded: false;
|
|
11
|
+
readonly failure: DeploymentFailure;
|
|
12
|
+
};
|
|
13
|
+
export declare function recordProjectIosDeployment(options: {
|
|
14
|
+
readonly inspection: ProjectIosDeploymentInspection;
|
|
15
|
+
readonly publication: IosDeploymentPublication;
|
|
16
|
+
readonly plan: DeploymentPlan;
|
|
17
|
+
readonly execution: DeploymentExecutionResult;
|
|
18
|
+
readonly verification: DeploymentVerificationResult;
|
|
19
|
+
readonly recordedAt: string;
|
|
20
|
+
}): Promise<RecordProjectIosHistoryResult>;
|
|
21
|
+
//# sourceMappingURL=recordProjectIosDeployment.d.ts.map
|