@voltro/cms 0.86.0 → 0.88.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 +5484 -0
- package/README.md +138 -0
- package/THIRD-PARTY-NOTICES.md +1511 -276
- package/dist/ContentForm.js +1 -2
- package/dist/RichDocumentEditor.js +1 -2
- package/dist/RichDocumentView.js +82 -38
- package/dist/RichTextSurface.js +1 -2
- package/dist/aiCandidates.js +4 -5
- package/dist/aiOperations.js +1 -2
- package/dist/applicationBuildSnapshotService.js +100 -0
- package/dist/assetRenditions.js +101 -0
- package/dist/assetRevision.js +45 -0
- package/dist/assetUseRights.js +71 -0
- package/dist/audiences.js +1 -2
- package/dist/availability.js +20 -18
- package/dist/blueprint.js +76 -77
- package/dist/build.d.ts +3063 -0
- package/dist/build.js +37 -0
- package/dist/buildApplicationAdmission.js +15 -0
- package/dist/buildApplicationCatalog.js +135 -0
- package/dist/buildApplicationCatalogTable.js +23 -0
- package/dist/buildApplicationRest.js +98 -0
- package/dist/buildApplicationUpload.js +110 -0
- package/dist/buildSnapshot.js +400 -0
- package/dist/buildSnapshotApplicationPin.js +31 -0
- package/dist/buildSnapshotRest.js +209 -0
- package/dist/buildSnapshotService.js +264 -0
- package/dist/buildSnapshotTables.js +24 -0
- package/dist/bulk.js +72 -72
- package/dist/cacheIdentity.js +1 -2
- package/dist/changes.js +280 -64
- package/dist/cmsContext.js +1 -2
- package/dist/collections.js +1 -2
- package/dist/consent.js +6 -7
- package/dist/contentLocations.js +52 -0
- package/dist/contentProjection.js +82 -0
- package/dist/contentRouteIdentity.js +12 -0
- package/dist/contentRouteMaterializer.js +96 -0
- package/dist/contentRouteTypes.js +38 -0
- package/dist/contentSeo.js +188 -0
- package/dist/contentTreePath.js +59 -0
- package/dist/contentType.js +121 -105
- package/dist/contentValues.js +17 -0
- package/dist/contentfulImport.js +1 -2
- package/dist/copies.js +4 -5
- package/dist/cutover.js +1 -2
- package/dist/deliveryChecks.js +1 -2
- package/dist/domainHost.js +6 -0
- package/dist/domains.js +82 -89
- package/dist/draftTexts.js +38 -39
- package/dist/duplicates.js +24 -25
- package/dist/edgePurge.js +1 -2
- package/dist/editHistory.js +1 -2
- package/dist/effectForm.js +1 -2
- package/dist/environmentAliases.js +137 -0
- package/dist/environments.js +108 -71
- package/dist/errors.js +55 -16
- package/dist/experiments.js +8 -9
- package/dist/exposure.js +1 -2
- package/dist/extensionManifest.js +2 -3
- package/dist/extensions.js +1 -2
- package/dist/fieldSchema.js +1 -2
- package/dist/formStrings.js +1 -2
- package/dist/frontendBindings.js +98 -0
- package/dist/frontendMedia.js +17 -0
- package/dist/glossary.js +1 -2
- package/dist/history.js +1 -2
- package/dist/htmlImport.js +1 -2
- package/dist/index.d.ts +760 -47
- package/dist/index.js +89 -73
- package/dist/initializePublicRoutes.js +27 -0
- package/dist/liveContentRouteView.js +75 -0
- package/dist/media.js +1 -2
- package/dist/metrics.js +1 -2
- package/dist/migration.js +1 -2
- package/dist/migrationStages.js +1 -2
- package/dist/nativeOutputDeploymentService.js +204 -0
- package/dist/outputActivation.js +233 -0
- package/dist/outputActivationOrigin.js +50 -0
- package/dist/outputActivationStore.js +410 -0
- package/dist/outputActivationTables.js +10 -0
- package/dist/outputActivationTarget.js +80 -0
- package/dist/outputActivationTargetTable.js +24 -0
- package/dist/outputDeployment.js +173 -0
- package/dist/outputDeploymentRest.js +167 -0
- package/dist/outputDeploymentService.js +240 -0
- package/dist/outputRouteGraph.js +176 -0
- package/dist/outputSafetyArtifact.js +146 -0
- package/dist/outputTargetRest.js +61 -0
- package/dist/pathSegmentEncoding.js +3 -0
- package/dist/presenceAnchors.js +1 -2
- package/dist/preview.js +1 -2
- package/dist/privateCmsTransport.js +75 -0
- package/dist/privateNativeRouteReservation.js +9 -0
- package/dist/promotion.js +69 -61
- package/dist/publicBuild.js +89 -0
- package/dist/publicBuildRest.js +97 -0
- package/dist/publicBuildService.js +62 -0
- package/dist/publicOutputHttp.js +128 -0
- package/dist/publicOutputService.js +286 -0
- package/dist/publicPresentation.js +16 -0
- package/dist/publicRouteDispositionAdmission.js +37 -0
- package/dist/publicRouteHistoryStore.js +11 -0
- package/dist/publicRouteHistoryView.js +33 -0
- package/dist/publicRouteIntegrity.js +4 -0
- package/dist/publicRouteMutation.js +5 -0
- package/dist/publicRouteNamespace.js +133 -0
- package/dist/publicRoutePublication.js +35 -0
- package/dist/publicRouteRegistry.js +16 -0
- package/dist/publicRouteRegistryBinding.js +193 -0
- package/dist/publicRouteRegistryDefinition.js +75 -0
- package/dist/publicRouteSitePublication.js +39 -0
- package/dist/publicRouteTables.js +12 -0
- package/dist/publicRouteUrl.js +17 -0
- package/dist/publicationSeo.js +51 -0
- package/dist/publicationState.js +295 -0
- package/dist/quality.js +9 -10
- package/dist/reconfigurePublicRoutes.js +40 -0
- package/dist/recurrence.js +1 -2
- package/dist/redirects.js +105 -75
- package/dist/referenceGraph.js +16 -16
- package/dist/references.js +3 -4
- package/dist/release.js +178 -143
- package/dist/renderReadAuthority.js +42 -0
- package/dist/renderReadGrant.js +136 -0
- package/dist/rest.js +1 -2
- package/dist/review.js +29 -30
- package/dist/richDocument.js +56 -27
- package/dist/richInline.js +1 -2
- package/dist/routeDispositionGraph.js +43 -0
- package/dist/routeDispositionRest.js +50 -0
- package/dist/routeDispositionService.js +72 -0
- package/dist/routeDispositionStore.js +288 -0
- package/dist/routeDispositionTables.js +4 -0
- package/dist/routeDispositions.js +90 -0
- package/dist/routeHistoryStorage.js +319 -0
- package/dist/routeHistoryStore.js +11 -0
- package/dist/schedule.js +37 -38
- package/dist/search.js +1 -2
- package/dist/selectionIntent.js +1 -2
- package/dist/seo.js +2 -3
- package/dist/series.js +12 -13
- package/dist/share.js +14 -15
- package/dist/siteBindings.js +158 -0
- package/dist/siteBuildCandidate.js +103 -0
- package/dist/siteDelivery.js +114 -0
- package/dist/siteState.js +46 -0
- package/dist/snapshotAddressGraph.js +54 -0
- package/dist/snapshotAddressRead.js +72 -0
- package/dist/snapshotAppConsumer.js +70 -0
- package/dist/snapshotAppExecution.js +101 -0
- package/dist/snapshotApplication.js +74 -0
- package/dist/snapshotApprovedRouteDispositions.js +43 -0
- package/dist/snapshotAssetAssembly.js +69 -0
- package/dist/snapshotAssetAssemblyRest.js +49 -0
- package/dist/snapshotBindingRead.js +60 -0
- package/dist/snapshotCodeSeo.js +28 -0
- package/dist/snapshotComponent.js +33 -0
- package/dist/snapshotComponentSource.js +23 -0
- package/dist/snapshotConsumer.js +86 -0
- package/dist/snapshotContentIdentity.js +9 -0
- package/dist/snapshotDefinitions.js +263 -0
- package/dist/snapshotDocumentAssembly.js +192 -0
- package/dist/snapshotDocumentAssemblyRest.js +83 -0
- package/dist/snapshotDocumentProjection.js +201 -0
- package/dist/snapshotDocumentTransfer.js +34 -0
- package/dist/snapshotDocumentTransferRest.js +79 -0
- package/dist/snapshotDomains.js +55 -0
- package/dist/snapshotEnvironment.js +30 -0
- package/dist/snapshotFieldPlan.js +84 -0
- package/dist/snapshotFrontend.js +102 -0
- package/dist/snapshotLink.js +7 -0
- package/dist/snapshotMedia.js +110 -0
- package/dist/snapshotMediaCapture.js +245 -0
- package/dist/snapshotMediaFields.js +224 -0
- package/dist/snapshotMediaRead.js +184 -0
- package/dist/snapshotMediaReader.js +12 -0
- package/dist/snapshotObservation.js +15 -0
- package/dist/snapshotObservedRouteHistory.js +33 -0
- package/dist/snapshotOutputTransfer.js +77 -0
- package/dist/snapshotPageLoader.js +6 -0
- package/dist/snapshotPageSeo.js +58 -0
- package/dist/snapshotPathLocale.js +14 -0
- package/dist/snapshotPresentation.js +85 -0
- package/dist/snapshotPresentationPolicy.js +11 -0
- package/dist/snapshotProjection.js +118 -0
- package/dist/snapshotPublicAccess.js +160 -0
- package/dist/snapshotPublicRouteHistory.js +39 -0
- package/dist/snapshotReadAdmission.js +37 -0
- package/dist/snapshotRedirectOutput.js +150 -0
- package/dist/snapshotRedirectTargets.js +23 -0
- package/dist/snapshotRedirects.js +131 -0
- package/dist/snapshotReference.js +7 -0
- package/dist/snapshotReferenceAddress.js +9 -0
- package/dist/snapshotReferenceGraph.js +78 -0
- package/dist/snapshotReferenceRead.js +64 -0
- package/dist/snapshotRelease.js +98 -0
- package/dist/snapshotRender.js +360 -0
- package/dist/snapshotRenderDependencies.js +177 -0
- package/dist/snapshotRenditions.js +87 -0
- package/dist/snapshotRichDocument.js +61 -0
- package/dist/snapshotRoleTransfer.js +105 -0
- package/dist/snapshotRoleTransferRest.js +98 -0
- package/dist/snapshotRouteAdmission.js +70 -0
- package/dist/snapshotRouteDispatch.js +110 -0
- package/dist/snapshotRouteDispositionPlan.js +72 -0
- package/dist/snapshotRouteRead.js +42 -0
- package/dist/snapshotRoutes.js +78 -0
- package/dist/snapshotRouting.js +112 -0
- package/dist/snapshotSeo.js +178 -0
- package/dist/snapshotSeoControls.js +100 -0
- package/dist/snapshotSeoDocumentInventory.js +114 -0
- package/dist/snapshotSeoDocuments.js +128 -0
- package/dist/snapshotSeoMerge.js +84 -0
- package/dist/snapshotSeoMetadata.js +136 -0
- package/dist/snapshotSeoOutput.js +172 -0
- package/dist/snapshotSeoPathSets.js +104 -0
- package/dist/snapshotSeoRead.js +87 -0
- package/dist/snapshotSite.js +127 -0
- package/dist/snapshotSitemapFiles.js +35 -0
- package/dist/snapshotTreeDependencies.js +57 -0
- package/dist/snapshotTreeLoader.js +9 -0
- package/dist/snapshotTreeRead.js +157 -0
- package/dist/staticPathSet.js +176 -0
- package/dist/staticPathSetRest.js +128 -0
- package/dist/staticPathSetService.js +248 -0
- package/dist/staticPathSetStore.js +337 -0
- package/dist/stewardship.js +2 -3
- package/dist/taxonomy.js +1 -2
- package/dist/team.js +1 -2
- package/dist/templates.js +2 -3
- package/dist/trackChanges.js +1 -2
- package/dist/translation.js +1 -2
- package/dist/tree.js +10 -11
- package/dist/usage.js +1 -2
- package/dist/validation.js +54 -55
- package/dist/visualEditing.js +1 -2
- package/dist/web.d.ts +709 -7
- package/dist/web.js +50 -33
- package/dist/workflow.js +9 -10
- package/dist/write.js +251 -227
- package/dist/xliff.js +1 -2
- package/package.json +21 -7
package/dist/build.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { OutputActivationUnavailable as e, createOutputActivationSet as t, makeOutputRegionReceipt as n } from "./outputActivation.js";
|
|
2
|
+
import { copyCmsPublicBuildIdentity as r, decodeCmsPublicBuildIdentity as i, encodeCmsPublicBuildIdentity as a } from "./publicBuild.js";
|
|
3
|
+
import { SnapshotPresentationUnavailable as o, admitSnapshotPresentation as s, copySnapshotConsentPurposes as c, copySnapshotPresentationValue as l, decodeSnapshotPresentation as u, encodeSnapshotPresentation as d, snapshotPresentationFromChoices as f, snapshotPresentations as p } from "./snapshotPresentation.js";
|
|
4
|
+
import { defineFrontendBindings as m } from "./frontendBindings.js";
|
|
5
|
+
import { snapshotApplicationPins as h } from "./snapshotApplication.js";
|
|
6
|
+
import { StaticPathSetConflict as g, StaticPathSetUnavailable as _, copyStaticPathManifest as v, staticPathHash as y, verifyStaticPathPage as b } from "./staticPathSet.js";
|
|
7
|
+
import { activateOutputSet as x, denyOutputTarget as S, initializeOutputRouteHistory as C, probeOutputActivation as w, readActiveOutput as T, readOutputActivationMarker as E } from "./outputActivationStore.js";
|
|
8
|
+
import { readStaticPathSetEvidence as D } from "./staticPathSetStore.js";
|
|
9
|
+
import { createCmsStaticPathSets as O } from "./staticPathSetService.js";
|
|
10
|
+
import { CmsBuildSnapshotUnavailable as k, createCmsBuildSnapshots as A } from "./buildSnapshotService.js";
|
|
11
|
+
import { cmsBuildSnapshotRest as j } from "./buildSnapshotRest.js";
|
|
12
|
+
import { cmsBuildSnapshotTables as M } from "./buildSnapshotTables.js";
|
|
13
|
+
import { createCmsApplicationBuildSnapshots as N } from "./applicationBuildSnapshotService.js";
|
|
14
|
+
import { bindOutputDeployment as P, makeOutputActivationAdmission as F, makeOutputDeploymentAdmission as I, makeOutputServingAdmission as L, readOutputDeployment as R } from "./outputDeployment.js";
|
|
15
|
+
import { CMS_OUTPUT_DEPLOY_SCOPE as z, CmsOutputDeploymentUnavailable as B, createCmsOutputDeployments as V } from "./outputDeploymentService.js";
|
|
16
|
+
import { createCmsBuildApplicationCatalog as H } from "./buildApplicationCatalog.js";
|
|
17
|
+
import { cmsBuildApplicationRest as U } from "./buildApplicationRest.js";
|
|
18
|
+
import { CmsBuildApplicationUploadUnavailable as W, uploadCmsBuildApplication as G } from "./buildApplicationUpload.js";
|
|
19
|
+
import { createSnapshotDocumentAssembly as K } from "./snapshotDocumentAssembly.js";
|
|
20
|
+
import { cmsDocumentAssemblyRest as q } from "./snapshotDocumentAssemblyRest.js";
|
|
21
|
+
import { cmsStaticPathSetRest as J } from "./staticPathSetRest.js";
|
|
22
|
+
import { cmsOutputDeploymentRest as Y } from "./outputDeploymentRest.js";
|
|
23
|
+
import { readOutputActivationTarget as X, retainOutputActivationTarget as Z } from "./outputActivationTarget.js";
|
|
24
|
+
import { cmsOutputActivationTables as Q } from "./outputActivationTables.js";
|
|
25
|
+
import { createCmsPublicBuilds as $ } from "./publicBuildService.js";
|
|
26
|
+
import { cmsPublicBuildRest as ee } from "./publicBuildRest.js";
|
|
27
|
+
import { createCmsPublicOutputs as te } from "./publicOutputService.js";
|
|
28
|
+
import { cmsPublicOutputHttp as ne } from "./publicOutputHttp.js";
|
|
29
|
+
import { createSnapshotAssetAssembly as re } from "./snapshotAssetAssembly.js";
|
|
30
|
+
import { cmsSnapshotAssetsRest as ie } from "./snapshotAssetAssemblyRest.js";
|
|
31
|
+
import { createSnapshotDocumentTransfer as ae } from "./snapshotDocumentTransfer.js";
|
|
32
|
+
import { cmsSnapshotDocumentTransferRest as oe } from "./snapshotDocumentTransferRest.js";
|
|
33
|
+
import { createSnapshotRoleTransfer as se } from "./snapshotRoleTransfer.js";
|
|
34
|
+
import { cmsSnapshotRoleTransferRest as ce } from "./snapshotRoleTransferRest.js";
|
|
35
|
+
import { createCmsNativeOutputDeployments as le } from "./nativeOutputDeploymentService.js";
|
|
36
|
+
import { cmsOutputTargetRest as ue } from "./outputTargetRest.js";
|
|
37
|
+
export { z as CMS_OUTPUT_DEPLOY_SCOPE, W as CmsBuildApplicationUploadUnavailable, k as CmsBuildSnapshotUnavailable, B as CmsOutputDeploymentUnavailable, e as OutputActivationUnavailable, o as SnapshotPresentationUnavailable, g as StaticPathSetConflict, _ as StaticPathSetUnavailable, x as activateOutputSet, s as admitSnapshotPresentation, P as bindOutputDeployment, U as cmsBuildApplicationRest, j as cmsBuildSnapshotRest, M as cmsBuildSnapshotTables, q as cmsDocumentAssemblyRest, Q as cmsOutputActivationTables, Y as cmsOutputDeploymentRest, ue as cmsOutputTargetRest, ee as cmsPublicBuildRest, ne as cmsPublicOutputHttp, ie as cmsSnapshotAssetsRest, oe as cmsSnapshotDocumentTransferRest, ce as cmsSnapshotRoleTransferRest, J as cmsStaticPathSetRest, r as copyCmsPublicBuildIdentity, c as copySnapshotConsentPurposes, l as copySnapshotPresentationValue, v as copyStaticPathManifest, N as createCmsApplicationBuildSnapshots, H as createCmsBuildApplicationCatalog, A as createCmsBuildSnapshots, le as createCmsNativeOutputDeployments, V as createCmsOutputDeployments, $ as createCmsPublicBuilds, te as createCmsPublicOutputs, O as createCmsStaticPathSets, t as createOutputActivationSet, re as createSnapshotAssetAssembly, K as createSnapshotDocumentAssembly, ae as createSnapshotDocumentTransfer, se as createSnapshotRoleTransfer, i as decodeCmsPublicBuildIdentity, u as decodeSnapshotPresentation, m as defineFrontendBindings, S as denyOutputTarget, a as encodeCmsPublicBuildIdentity, d as encodeSnapshotPresentation, C as initializeOutputRouteHistory, F as makeOutputActivationAdmission, I as makeOutputDeploymentAdmission, n as makeOutputRegionReceipt, L as makeOutputServingAdmission, w as probeOutputActivation, T as readActiveOutput, E as readOutputActivationMarker, X as readOutputActivationTarget, R as readOutputDeployment, D as readStaticPathSetEvidence, Z as retainOutputActivationTarget, h as snapshotApplicationPins, f as snapshotPresentationFromChoices, p as snapshotPresentations, y as staticPathHash, G as uploadCmsBuildApplication, b as verifyStaticPathPage };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { copyBuildSnapshotApplicationPin as e } from "./buildSnapshotApplicationPin.js";
|
|
2
|
+
// src/buildApplicationAdmission.ts
|
|
3
|
+
var t = "/v1/cms/build-applications/admit", n = "x-voltro-cms-application", r = (t) => {
|
|
4
|
+
let n = () => {
|
|
5
|
+
throw TypeError("Invalid application admission comparison");
|
|
6
|
+
};
|
|
7
|
+
if (typeof t != "object" || !t || Array.isArray(t) || Object.keys(t).sort().join(",") !== "application,archiveId,deploymentId") return n();
|
|
8
|
+
let r = t, i = r.deploymentId, a = r.archiveId;
|
|
9
|
+
return typeof i != "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(i) || typeof a != "string" || !/^[a-f0-9]{64}$/.test(a) ? n() : {
|
|
10
|
+
deploymentId: i,
|
|
11
|
+
archiveId: a,
|
|
12
|
+
application: e(r.application)
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export { t as CMS_BUILD_APPLICATION_ADMIT_PATH, n as CMS_BUILD_APPLICATION_HEADER, r as copyCmsBuildApplicationAdmission };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { copyOutputActivationScope as e } from "./outputActivation.js";
|
|
2
|
+
import { BUILD_APPLICATION_CATALOG as t } from "./buildApplicationCatalogTable.js";
|
|
3
|
+
import { copyBuildSnapshotApplicationIdentity as n, copyBuildSnapshotApplicationPin as r } from "./buildSnapshotApplicationPin.js";
|
|
4
|
+
import { CmsOutputDeploymentUnavailable as i, createCmsOutputDeploymentAuthority as a } from "./outputDeploymentService.js";
|
|
5
|
+
import { copyCmsBuildApplicationAdmission as o } from "./buildApplicationAdmission.js";
|
|
6
|
+
import { and as s, eq as c } from "@voltro/database";
|
|
7
|
+
import { createHash as l } from "node:crypto";
|
|
8
|
+
import { canonicalJson as u } from "@voltro/protocol";
|
|
9
|
+
// src/buildApplicationCatalog.ts
|
|
10
|
+
var d = (e) => {
|
|
11
|
+
throw new i({ reason: e });
|
|
12
|
+
}, f = (e) => l("sha256").update(u(e)).digest("hex"), p = (e) => f({
|
|
13
|
+
inputsId: e.inputsId,
|
|
14
|
+
executionId: e.executionId
|
|
15
|
+
}), m = (e, t) => u(e) === u(t), h = (e) => {
|
|
16
|
+
try {
|
|
17
|
+
return o({
|
|
18
|
+
deploymentId: e.deploymentId,
|
|
19
|
+
archiveId: e.archiveId,
|
|
20
|
+
application: e.application
|
|
21
|
+
});
|
|
22
|
+
} catch {
|
|
23
|
+
return d("input");
|
|
24
|
+
}
|
|
25
|
+
}, g = (e) => r({
|
|
26
|
+
code: e.code,
|
|
27
|
+
inputsId: e.inputsId,
|
|
28
|
+
executionId: e.executionId
|
|
29
|
+
}), _ = (i) => {
|
|
30
|
+
let o = i.store, l = e(i.scope), u = i.now ?? Date.now, f = i.receive.bind(i), _ = i.open.bind(i), v = i.verify.bind(i), { boundary: y, transaction: b } = a(o, l, u), x = (e, t) => s(c("tenantId", l.tenantId), c("site", l.site), c("environment", l.environment), c(e, t)), S = (e) => {
|
|
31
|
+
let t = h({
|
|
32
|
+
deploymentId: e.deploymentId,
|
|
33
|
+
archiveId: e.archiveId,
|
|
34
|
+
application: e.application
|
|
35
|
+
});
|
|
36
|
+
return e.applicationId === p(t.application) ? t : d("integrity");
|
|
37
|
+
}, C = async (e, n) => {
|
|
38
|
+
let r = await e.query({
|
|
39
|
+
table: t,
|
|
40
|
+
predicate: x("deploymentId", n),
|
|
41
|
+
order: [],
|
|
42
|
+
take: 2,
|
|
43
|
+
skip: void 0,
|
|
44
|
+
projection: void 0
|
|
45
|
+
});
|
|
46
|
+
return r.length > 1 ? d("state") : r.length === 0 ? null : S(r[0]);
|
|
47
|
+
}, w = async (e, n) => {
|
|
48
|
+
let r = await e.query({
|
|
49
|
+
table: t,
|
|
50
|
+
predicate: x("applicationId", p(n)),
|
|
51
|
+
order: [],
|
|
52
|
+
take: 2,
|
|
53
|
+
skip: void 0,
|
|
54
|
+
projection: void 0
|
|
55
|
+
});
|
|
56
|
+
if (r.length === 0) return null;
|
|
57
|
+
let i = S(r[0]);
|
|
58
|
+
return i.application.inputsId !== n.inputsId || i.application.executionId !== n.executionId || r.some((e) => {
|
|
59
|
+
let t = S(e);
|
|
60
|
+
return t.archiveId !== i.archiveId || !m(t.application, i.application);
|
|
61
|
+
}) ? d("integrity") : i;
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
inspect: (e) => y(async (t) => {
|
|
65
|
+
let { credential: n, deploymentId: i } = e;
|
|
66
|
+
if (typeof i != "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(i)) return d("input");
|
|
67
|
+
let a = await b(n, t, async (e, t) => {
|
|
68
|
+
let n = await C(e, i);
|
|
69
|
+
return n === null ? d("unadmitted") : {
|
|
70
|
+
admission: n,
|
|
71
|
+
parent: t
|
|
72
|
+
};
|
|
73
|
+
}), o = () => b(n, t, async (e, t) => {
|
|
74
|
+
if (t !== a.parent) return d("credential");
|
|
75
|
+
});
|
|
76
|
+
return await o(), await v({
|
|
77
|
+
archiveId: a.admission.archiveId,
|
|
78
|
+
application: r(a.admission.application)
|
|
79
|
+
}, o, t), await o(), b(n, t, async (e, t) => {
|
|
80
|
+
if (t !== a.parent) return d("credential");
|
|
81
|
+
let n = await C(e, i);
|
|
82
|
+
return n === null || !m(n, a.admission) ? d("changed") : n;
|
|
83
|
+
});
|
|
84
|
+
}),
|
|
85
|
+
admit: (e, n) => y(async (r) => {
|
|
86
|
+
let i = h(e), a = e.credential, o = await b(a, r, async (e, t) => {
|
|
87
|
+
let n = await C(e, i.deploymentId);
|
|
88
|
+
if (n !== null && !m(n, i)) return d("changed");
|
|
89
|
+
let r = await w(e, i.application);
|
|
90
|
+
return r !== null && (r.archiveId !== i.archiveId || !m(r.application, i.application)) ? d("changed") : t;
|
|
91
|
+
}), s = () => b(a, r, async (e, t) => {
|
|
92
|
+
if (t !== o) return d("credential");
|
|
93
|
+
});
|
|
94
|
+
return await s(), m(g(await f(h(i), n, s, r)), i.application) ? (await s(), b(a, r, async (e, n) => {
|
|
95
|
+
if (n !== o) return d("credential");
|
|
96
|
+
let r = await C(e, i.deploymentId);
|
|
97
|
+
if (r !== null && !m(r, i)) return d("changed");
|
|
98
|
+
let a = await w(e, i.application);
|
|
99
|
+
if (a !== null && (a.archiveId !== i.archiveId || !m(a.application, i.application))) return d("changed");
|
|
100
|
+
await e.insertIgnore(t, {
|
|
101
|
+
...l,
|
|
102
|
+
...i,
|
|
103
|
+
applicationId: p(i.application)
|
|
104
|
+
}, { conflictColumns: [
|
|
105
|
+
"tenantId",
|
|
106
|
+
"site",
|
|
107
|
+
"environment",
|
|
108
|
+
"deploymentId"
|
|
109
|
+
] });
|
|
110
|
+
let s = await C(e, i.deploymentId);
|
|
111
|
+
return m(s, i) ? s : d("changed");
|
|
112
|
+
})) : d("integrity");
|
|
113
|
+
}),
|
|
114
|
+
resolveApplication: async (e) => {
|
|
115
|
+
let t = r(e), n = await o.transactional((e) => w(e, t));
|
|
116
|
+
if (n === null) return d("state");
|
|
117
|
+
if (!m(n.application, t)) return d("changed");
|
|
118
|
+
let i = await _({
|
|
119
|
+
archiveId: n.archiveId,
|
|
120
|
+
application: r(t)
|
|
121
|
+
});
|
|
122
|
+
if (!m(g(i), t)) return d("integrity");
|
|
123
|
+
let a = await o.transactional((e) => w(e, t));
|
|
124
|
+
return a === null || a.archiveId !== n.archiveId || !m(a.application, n.application) ? d("changed") : i;
|
|
125
|
+
},
|
|
126
|
+
readApplication: async (e) => {
|
|
127
|
+
let t = n(e), i = await o.transactional((e) => w(e, t));
|
|
128
|
+
return i === null ? d("state") : {
|
|
129
|
+
archiveId: i.archiveId,
|
|
130
|
+
application: r(i.application)
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export { _ as createCmsBuildApplicationCatalog };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { id as e, json as t, table as n, text as r } from "@voltro/database";
|
|
2
|
+
import { tenant as i } from "@voltro/plugin-multitenancy/mixin";
|
|
3
|
+
// src/buildApplicationCatalogTable.ts
|
|
4
|
+
var a = "_voltro_cms_build_applications", o = n("_voltro_cms_build_applications", {
|
|
5
|
+
id: e({ prefix: "capp" }),
|
|
6
|
+
site: r().maxLength(64),
|
|
7
|
+
environment: r().maxLength(64),
|
|
8
|
+
deploymentId: r().maxLength(64),
|
|
9
|
+
applicationId: r().maxLength(64),
|
|
10
|
+
archiveId: r().maxLength(64),
|
|
11
|
+
application: t()
|
|
12
|
+
}).with(i()).unique("cms_app_deployment", [
|
|
13
|
+
"tenantId",
|
|
14
|
+
"site",
|
|
15
|
+
"environment",
|
|
16
|
+
"deploymentId"
|
|
17
|
+
]).index("cms_app_identity", [
|
|
18
|
+
"tenantId",
|
|
19
|
+
"site",
|
|
20
|
+
"environment",
|
|
21
|
+
"applicationId"
|
|
22
|
+
]);
|
|
23
|
+
export { a as BUILD_APPLICATION_CATALOG, o as buildApplicationCatalogTable };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { cmsCredential as e, privateCmsHeaders as t, privateCmsHttpRoutes as n, privateCmsOperation as r } from "./privateCmsTransport.js";
|
|
2
|
+
import { CmsOutputDeploymentUnavailable as i } from "./outputDeploymentService.js";
|
|
3
|
+
import { CMS_BUILD_APPLICATION_ADMIT_PATH as a, CMS_BUILD_APPLICATION_HEADER as o, copyCmsBuildApplicationAdmission as s } from "./buildApplicationAdmission.js";
|
|
4
|
+
import { Effect as c, Schema as l } from "effect";
|
|
5
|
+
import { strictInput as u } from "@voltro/protocol";
|
|
6
|
+
import { RestRouteError as d } from "@voltro/protocol/rest";
|
|
7
|
+
// src/buildApplicationRest.ts
|
|
8
|
+
var f = l.String.check(l.isPattern(/^[A-Za-z0-9_-]{1,64}$/)), p = l.String.check(l.isPattern(/^[a-f0-9]{64}$/)), m = u(l.Struct({
|
|
9
|
+
deploymentId: f,
|
|
10
|
+
archiveId: p,
|
|
11
|
+
application: l.Struct({
|
|
12
|
+
inputsId: p,
|
|
13
|
+
executionId: p,
|
|
14
|
+
code: l.Struct({
|
|
15
|
+
commit: l.String,
|
|
16
|
+
artifactDigest: p,
|
|
17
|
+
configDigest: p
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
}), "cms.buildApplication.admit", !0), h = (p, h) => {
|
|
21
|
+
let g = h.maxBodyBytes;
|
|
22
|
+
if (!Number.isSafeInteger(g) || g < 1) throw TypeError("A positive safe application upload byte limit is required");
|
|
23
|
+
let _ = (e, n, r = {}) => ({
|
|
24
|
+
status: e,
|
|
25
|
+
contentType: "application/json",
|
|
26
|
+
headers: {
|
|
27
|
+
...t,
|
|
28
|
+
...r
|
|
29
|
+
},
|
|
30
|
+
body: JSON.stringify(n)
|
|
31
|
+
}), v = (e, t) => _(e, {
|
|
32
|
+
error: "CmsOutputDeploymentUnavailable",
|
|
33
|
+
_tag: "CmsOutputDeploymentUnavailable",
|
|
34
|
+
reason: t
|
|
35
|
+
}, e === 401 ? { "www-authenticate": "Bearer" } : {}), y = async (t) => {
|
|
36
|
+
if (t.method !== "POST") return _(405, { error: "MethodNotAllowed" }, { allow: "POST" });
|
|
37
|
+
try {
|
|
38
|
+
let n = e(t, "CmsOutputDeploymentUnavailable");
|
|
39
|
+
if (t.headers["content-type"]?.toLowerCase() !== "application/octet-stream") return v(415, "input");
|
|
40
|
+
let r = t.headers[o];
|
|
41
|
+
if (r === void 0 || Buffer.byteLength(r, "utf8") > 2048) return v(409, "input");
|
|
42
|
+
let i;
|
|
43
|
+
try {
|
|
44
|
+
i = l.decodeUnknownSync(m)(JSON.parse(r)), s(i);
|
|
45
|
+
} catch {
|
|
46
|
+
return v(409, "input");
|
|
47
|
+
}
|
|
48
|
+
let a = await c.runPromise(c.result(p.admit({
|
|
49
|
+
...i,
|
|
50
|
+
credential: n
|
|
51
|
+
}, t.body)), { signal: t.signal });
|
|
52
|
+
return a._tag === "Success" ? _(201, a.success) : v(a.failure.reason === "credential" ? 401 : 409, a.failure.reason);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
return e instanceof d && e.status === 401 ? v(401, "credential") : v(409, "state");
|
|
55
|
+
}
|
|
56
|
+
}, b = {
|
|
57
|
+
workload: "rest",
|
|
58
|
+
credentials: "bearer",
|
|
59
|
+
method: "POST",
|
|
60
|
+
path: a,
|
|
61
|
+
match: "exact",
|
|
62
|
+
answersOtherMethods: !0,
|
|
63
|
+
maxBodyBytes: g,
|
|
64
|
+
handleStream: y,
|
|
65
|
+
handle: async (e) => {
|
|
66
|
+
if (e.rawBody.byteLength > g) return v(413, "input");
|
|
67
|
+
let t = new AbortController();
|
|
68
|
+
try {
|
|
69
|
+
let { rawBody: n, ...r } = e;
|
|
70
|
+
return await y({
|
|
71
|
+
...r,
|
|
72
|
+
signal: t.signal,
|
|
73
|
+
body: (async function* () {
|
|
74
|
+
yield n;
|
|
75
|
+
})()
|
|
76
|
+
});
|
|
77
|
+
} finally {
|
|
78
|
+
t.abort();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}, x = [r({
|
|
82
|
+
namespace: "cms.buildApplication",
|
|
83
|
+
path: "/v1/cms/build-applications",
|
|
84
|
+
operationPrefix: "cmsBuildApplication",
|
|
85
|
+
tags: ["CMS build applications"],
|
|
86
|
+
error: i,
|
|
87
|
+
credentialError: "CmsOutputDeploymentUnavailable",
|
|
88
|
+
errorStatus: { CmsOutputDeploymentUnavailable: 409 }
|
|
89
|
+
}, "inspect", "Inspect original private application custody", "Scoped cms:deploy bearer. Revalidates the original immutable deployment association and native private archive custody without loading or executing application code, renewing admission or publishing output. Binary admission uses its separate bounded upload channel.", u(l.Struct({ deploymentId: f }), "cms.buildApplication.inspect", !0), m, (t, n) => p.inspect({
|
|
90
|
+
...t,
|
|
91
|
+
credential: e(n, "CmsOutputDeploymentUnavailable")
|
|
92
|
+
}))];
|
|
93
|
+
return {
|
|
94
|
+
routes: x,
|
|
95
|
+
httpRoutes: [...n(x), b]
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export { h as cmsBuildApplicationRest };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { CMS_BUILD_APPLICATION_ADMIT_PATH as e, CMS_BUILD_APPLICATION_HEADER as t, copyCmsBuildApplicationAdmission as n } from "./buildApplicationAdmission.js";
|
|
2
|
+
import { Schema as r } from "effect";
|
|
3
|
+
import { canonicalJson as i } from "@voltro/protocol";
|
|
4
|
+
// src/buildApplicationUpload.ts
|
|
5
|
+
var a = class extends r.TaggedError()("CmsBuildApplicationUploadUnavailable", { reason: r.Literals([
|
|
6
|
+
"input",
|
|
7
|
+
"authority",
|
|
8
|
+
"transfer",
|
|
9
|
+
"response",
|
|
10
|
+
"aborted"
|
|
11
|
+
]) }) {}, o = async (r) => {
|
|
12
|
+
let o = (e) => {
|
|
13
|
+
throw new a({ reason: e });
|
|
14
|
+
}, { credential: s } = r, c = r.bytes.bind(r), l = r.authorize.bind(r), u = r.fetch ?? globalThis.fetch, d = new AbortController(), f = AbortSignal.any([r.signal, d.signal]), p, m;
|
|
15
|
+
try {
|
|
16
|
+
if (p = new URL(r.backendOrigin), p.origin !== r.backendOrigin || p.username !== "" || p.password !== "" || !(p.protocol === "https:" || p.protocol === "http:" && [
|
|
17
|
+
"127.0.0.1",
|
|
18
|
+
"[::1]",
|
|
19
|
+
"localhost"
|
|
20
|
+
].includes(p.hostname)) || typeof s != "string" || !/^[^\s]{1,512}$/.test(s)) return o("input");
|
|
21
|
+
m = n(r.admission);
|
|
22
|
+
} catch {
|
|
23
|
+
return o("input");
|
|
24
|
+
}
|
|
25
|
+
let h = async () => {
|
|
26
|
+
if (f.aborted) return o("aborted");
|
|
27
|
+
try {
|
|
28
|
+
await l();
|
|
29
|
+
} catch {
|
|
30
|
+
return o("authority");
|
|
31
|
+
}
|
|
32
|
+
if (f.aborted) return o("aborted");
|
|
33
|
+
};
|
|
34
|
+
await h();
|
|
35
|
+
let g;
|
|
36
|
+
try {
|
|
37
|
+
g = c(f)[Symbol.asyncIterator]();
|
|
38
|
+
} catch {
|
|
39
|
+
return o("input");
|
|
40
|
+
}
|
|
41
|
+
let _ = !1, v = !1, y, b = async () => {
|
|
42
|
+
_ || (_ = !0, await g.return?.());
|
|
43
|
+
}, x = new ReadableStream({
|
|
44
|
+
async pull(e) {
|
|
45
|
+
try {
|
|
46
|
+
await h();
|
|
47
|
+
let t = await g.next();
|
|
48
|
+
if (await h(), t.done) v = !0, e.close();
|
|
49
|
+
else if (t.value instanceof Uint8Array) e.enqueue(t.value);
|
|
50
|
+
else throw TypeError("Nonbinary native application input");
|
|
51
|
+
} catch (t) {
|
|
52
|
+
t instanceof a && (y = t), e.error(t);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
cancel: async () => {
|
|
56
|
+
d.abort(), await b();
|
|
57
|
+
}
|
|
58
|
+
}, { highWaterMark: 0 });
|
|
59
|
+
try {
|
|
60
|
+
let a = {
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers: {
|
|
63
|
+
authorization: "Bearer " + s,
|
|
64
|
+
"content-type": "application/octet-stream",
|
|
65
|
+
[t]: JSON.stringify(m)
|
|
66
|
+
},
|
|
67
|
+
body: x,
|
|
68
|
+
signal: f,
|
|
69
|
+
duplex: "half",
|
|
70
|
+
redirect: "error",
|
|
71
|
+
cache: "no-store"
|
|
72
|
+
}, c;
|
|
73
|
+
try {
|
|
74
|
+
c = await u(new URL(e, p), a);
|
|
75
|
+
} catch {
|
|
76
|
+
return o(r.signal.aborted ? "aborted" : y?.reason ?? "transfer");
|
|
77
|
+
}
|
|
78
|
+
if (c.status !== 201 || c.body === null) return await c.body?.cancel(), o("response");
|
|
79
|
+
let l = c.body.getReader(), d = [], g = 0;
|
|
80
|
+
try {
|
|
81
|
+
for (;;) {
|
|
82
|
+
let e = await l.read();
|
|
83
|
+
if (e.done) break;
|
|
84
|
+
if (g += e.value.byteLength, g > 2048) return await l.cancel(), o("response");
|
|
85
|
+
d.push(e.value);
|
|
86
|
+
}
|
|
87
|
+
} finally {
|
|
88
|
+
l.releaseLock();
|
|
89
|
+
}
|
|
90
|
+
let _;
|
|
91
|
+
try {
|
|
92
|
+
if (_ = n(JSON.parse(Buffer.concat(d).toString("utf8"))), i(_) !== i(m)) return o("response");
|
|
93
|
+
} catch {
|
|
94
|
+
return o("response");
|
|
95
|
+
}
|
|
96
|
+
if (!v) return o("response");
|
|
97
|
+
try {
|
|
98
|
+
await b();
|
|
99
|
+
} catch {
|
|
100
|
+
return o("transfer");
|
|
101
|
+
}
|
|
102
|
+
return await h(), _;
|
|
103
|
+
} finally {
|
|
104
|
+
d.abort();
|
|
105
|
+
try {
|
|
106
|
+
await b();
|
|
107
|
+
} catch {}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
export { a as CmsBuildApplicationUploadUnavailable, o as uploadCmsBuildApplication };
|