@voltro/cms 0.85.0 → 0.87.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 +5987 -0
- package/README.md +138 -0
- package/THIRD-PARTY-NOTICES.md +864 -253
- package/dist/ContentForm.js +282 -0
- package/dist/RichDocumentEditor.js +550 -0
- package/dist/RichDocumentView.js +177 -0
- package/dist/RichTextSurface.js +135 -0
- package/dist/aiCandidates.js +199 -0
- package/dist/aiOperations.js +152 -0
- package/dist/applicationBuildSnapshotService.js +101 -0
- package/dist/assetRenditions.js +102 -0
- package/dist/assetRevision.js +46 -0
- package/dist/assetUseRights.js +72 -0
- package/dist/audiences.js +31 -0
- package/dist/availability.js +124 -0
- package/dist/blueprint.js +166 -0
- package/dist/build.d.ts +3063 -0
- package/dist/build.js +37 -0
- package/dist/buildApplicationAdmission.js +16 -0
- package/dist/buildApplicationCatalog.js +136 -0
- package/dist/buildApplicationCatalogTable.js +24 -0
- package/dist/buildApplicationRest.js +99 -0
- package/dist/buildApplicationUpload.js +111 -0
- package/dist/buildSnapshot.js +401 -0
- package/dist/buildSnapshotApplicationPin.js +32 -0
- package/dist/buildSnapshotRest.js +210 -0
- package/dist/buildSnapshotService.js +265 -0
- package/dist/buildSnapshotTables.js +25 -0
- package/dist/bulk.js +282 -0
- package/dist/cacheIdentity.js +152 -0
- package/dist/changes.js +307 -0
- package/dist/cmsContext.js +229 -0
- package/dist/collections.js +224 -0
- package/dist/consent.js +29 -0
- package/dist/contentLocations.js +53 -0
- package/dist/contentProjection.js +83 -0
- package/dist/contentRouteIdentity.js +13 -0
- package/dist/contentRouteMaterializer.js +97 -0
- package/dist/contentRouteTypes.js +39 -0
- package/dist/contentSeo.js +189 -0
- package/dist/contentTreePath.js +60 -0
- package/dist/contentType.js +208 -0
- package/dist/contentValues.js +18 -0
- package/dist/contentfulImport.js +162 -0
- package/dist/copies.js +89 -0
- package/dist/cutover.js +202 -0
- package/dist/deliveryChecks.js +138 -0
- package/dist/domainHost.js +7 -0
- package/dist/domains.js +139 -0
- package/dist/draftTexts.js +164 -0
- package/dist/duplicates.js +78 -0
- package/dist/edgePurge.js +69 -0
- package/dist/editHistory.js +113 -0
- package/dist/effectForm.js +11 -0
- package/dist/environmentAliases.js +138 -0
- package/dist/environments.js +147 -0
- package/dist/errors.js +107 -0
- package/dist/experiments.js +528 -0
- package/dist/exposure.js +28 -0
- package/dist/extensionManifest.js +81 -0
- package/dist/extensions.js +314 -0
- package/dist/fieldSchema.js +199 -0
- package/dist/formStrings.js +74 -0
- package/dist/frontendBindings.js +99 -0
- package/dist/frontendMedia.js +18 -0
- package/dist/glossary.js +73 -0
- package/dist/history.js +54 -0
- package/dist/htmlImport.js +297 -0
- package/dist/index.d.ts +771 -54
- package/dist/index.js +89 -6082
- package/dist/initializePublicRoutes.js +28 -0
- package/dist/liveContentRouteView.js +76 -0
- package/dist/media.js +29 -0
- package/dist/metrics.js +46 -0
- package/dist/migration.js +193 -0
- package/dist/migrationStages.js +13 -0
- package/dist/nativeOutputDeploymentService.js +205 -0
- package/dist/outputActivation.js +234 -0
- package/dist/outputActivationOrigin.js +51 -0
- package/dist/outputActivationStore.js +411 -0
- package/dist/outputActivationTables.js +11 -0
- package/dist/outputActivationTarget.js +81 -0
- package/dist/outputActivationTargetTable.js +25 -0
- package/dist/outputDeployment.js +174 -0
- package/dist/outputDeploymentRest.js +168 -0
- package/dist/outputDeploymentService.js +241 -0
- package/dist/outputRouteGraph.js +177 -0
- package/dist/outputSafetyArtifact.js +147 -0
- package/dist/outputTargetRest.js +62 -0
- package/dist/pathSegmentEncoding.js +4 -0
- package/dist/presenceAnchors.js +68 -0
- package/dist/preview.js +31 -0
- package/dist/privateCmsTransport.js +76 -0
- package/dist/privateNativeRouteReservation.js +10 -0
- package/dist/promotion.js +116 -0
- package/dist/publicBuild.js +90 -0
- package/dist/publicBuildRest.js +98 -0
- package/dist/publicBuildService.js +63 -0
- package/dist/publicOutputHttp.js +129 -0
- package/dist/publicOutputService.js +287 -0
- package/dist/publicPresentation.js +17 -0
- package/dist/publicRouteDispositionAdmission.js +38 -0
- package/dist/publicRouteHistoryStore.js +12 -0
- package/dist/publicRouteHistoryView.js +34 -0
- package/dist/publicRouteIntegrity.js +5 -0
- package/dist/publicRouteMutation.js +6 -0
- package/dist/publicRouteNamespace.js +134 -0
- package/dist/publicRoutePublication.js +36 -0
- package/dist/publicRouteRegistry.js +17 -0
- package/dist/publicRouteRegistryBinding.js +194 -0
- package/dist/publicRouteRegistryDefinition.js +76 -0
- package/dist/publicRouteSitePublication.js +40 -0
- package/dist/publicRouteTables.js +13 -0
- package/dist/publicRouteUrl.js +18 -0
- package/dist/publicationSeo.js +52 -0
- package/dist/publicationState.js +296 -0
- package/dist/quality.js +188 -0
- package/dist/reconfigurePublicRoutes.js +41 -0
- package/dist/recurrence.js +78 -0
- package/dist/redirects.js +130 -0
- package/dist/referenceGraph.js +224 -0
- package/dist/references.js +173 -0
- package/dist/release.js +241 -0
- package/dist/renderReadAuthority.js +43 -0
- package/dist/renderReadGrant.js +137 -0
- package/dist/rest.js +52 -0
- package/dist/review.js +160 -0
- package/dist/richDocument.js +521 -0
- package/dist/richInline.js +100 -0
- package/dist/routeDispositionGraph.js +44 -0
- package/dist/routeDispositionRest.js +51 -0
- package/dist/routeDispositionService.js +73 -0
- package/dist/routeDispositionStore.js +289 -0
- package/dist/routeDispositionTables.js +5 -0
- package/dist/routeDispositions.js +91 -0
- package/dist/routeHistoryStorage.js +320 -0
- package/dist/routeHistoryStore.js +12 -0
- package/dist/schedule.js +80 -0
- package/dist/search.js +148 -0
- package/dist/selectionIntent.js +164 -0
- package/dist/seo.js +31 -0
- package/dist/series.js +105 -0
- package/dist/share.js +112 -0
- package/dist/siteBindings.js +159 -0
- package/dist/siteBuildCandidate.js +104 -0
- package/dist/siteDelivery.js +115 -0
- package/dist/siteState.js +47 -0
- package/dist/snapshotAddressGraph.js +55 -0
- package/dist/snapshotAddressRead.js +73 -0
- package/dist/snapshotAppConsumer.js +71 -0
- package/dist/snapshotAppExecution.js +102 -0
- package/dist/snapshotApplication.js +75 -0
- package/dist/snapshotApprovedRouteDispositions.js +44 -0
- package/dist/snapshotAssetAssembly.js +70 -0
- package/dist/snapshotAssetAssemblyRest.js +50 -0
- package/dist/snapshotBindingRead.js +61 -0
- package/dist/snapshotCodeSeo.js +29 -0
- package/dist/snapshotComponent.js +34 -0
- package/dist/snapshotComponentSource.js +24 -0
- package/dist/snapshotConsumer.js +87 -0
- package/dist/snapshotContentIdentity.js +10 -0
- package/dist/snapshotDefinitions.js +264 -0
- package/dist/snapshotDocumentAssembly.js +193 -0
- package/dist/snapshotDocumentAssemblyRest.js +84 -0
- package/dist/snapshotDocumentProjection.js +202 -0
- package/dist/snapshotDocumentTransfer.js +35 -0
- package/dist/snapshotDocumentTransferRest.js +80 -0
- package/dist/snapshotDomains.js +56 -0
- package/dist/snapshotEnvironment.js +31 -0
- package/dist/snapshotFieldPlan.js +85 -0
- package/dist/snapshotFrontend.js +103 -0
- package/dist/snapshotLink.js +8 -0
- package/dist/snapshotMedia.js +111 -0
- package/dist/snapshotMediaCapture.js +246 -0
- package/dist/snapshotMediaFields.js +225 -0
- package/dist/snapshotMediaRead.js +185 -0
- package/dist/snapshotMediaReader.js +13 -0
- package/dist/snapshotObservation.js +16 -0
- package/dist/snapshotObservedRouteHistory.js +34 -0
- package/dist/snapshotOutputTransfer.js +78 -0
- package/dist/snapshotPageLoader.js +7 -0
- package/dist/snapshotPageSeo.js +59 -0
- package/dist/snapshotPathLocale.js +15 -0
- package/dist/snapshotPresentation.js +86 -0
- package/dist/snapshotPresentationPolicy.js +12 -0
- package/dist/snapshotProjection.js +119 -0
- package/dist/snapshotPublicAccess.js +161 -0
- package/dist/snapshotPublicRouteHistory.js +40 -0
- package/dist/snapshotReadAdmission.js +38 -0
- package/dist/snapshotRedirectOutput.js +151 -0
- package/dist/snapshotRedirectTargets.js +24 -0
- package/dist/snapshotRedirects.js +132 -0
- package/dist/snapshotReference.js +8 -0
- package/dist/snapshotReferenceAddress.js +10 -0
- package/dist/snapshotReferenceGraph.js +79 -0
- package/dist/snapshotReferenceRead.js +65 -0
- package/dist/snapshotRelease.js +99 -0
- package/dist/snapshotRender.js +361 -0
- package/dist/snapshotRenderDependencies.js +178 -0
- package/dist/snapshotRenditions.js +88 -0
- package/dist/snapshotRichDocument.js +62 -0
- package/dist/snapshotRoleTransfer.js +106 -0
- package/dist/snapshotRoleTransferRest.js +99 -0
- package/dist/snapshotRouteAdmission.js +71 -0
- package/dist/snapshotRouteDispatch.js +111 -0
- package/dist/snapshotRouteDispositionPlan.js +73 -0
- package/dist/snapshotRouteRead.js +43 -0
- package/dist/snapshotRoutes.js +79 -0
- package/dist/snapshotRouting.js +113 -0
- package/dist/snapshotSeo.js +179 -0
- package/dist/snapshotSeoControls.js +101 -0
- package/dist/snapshotSeoDocumentInventory.js +115 -0
- package/dist/snapshotSeoDocuments.js +129 -0
- package/dist/snapshotSeoMerge.js +85 -0
- package/dist/snapshotSeoMetadata.js +137 -0
- package/dist/snapshotSeoOutput.js +173 -0
- package/dist/snapshotSeoPathSets.js +105 -0
- package/dist/snapshotSeoRead.js +88 -0
- package/dist/snapshotSite.js +128 -0
- package/dist/snapshotSitemapFiles.js +36 -0
- package/dist/snapshotTreeDependencies.js +58 -0
- package/dist/snapshotTreeLoader.js +10 -0
- package/dist/snapshotTreeRead.js +158 -0
- package/dist/staticPathSet.js +177 -0
- package/dist/staticPathSetRest.js +129 -0
- package/dist/staticPathSetService.js +249 -0
- package/dist/staticPathSetStore.js +338 -0
- package/dist/stewardship.js +146 -0
- package/dist/taxonomy.js +36 -0
- package/dist/team.js +103 -0
- package/dist/templates.js +106 -0
- package/dist/trackChanges.js +197 -0
- package/dist/translation.js +64 -0
- package/dist/tree.js +87 -0
- package/dist/usage.js +50 -0
- package/dist/validation.js +192 -0
- package/dist/visualEditing.js +60 -0
- package/dist/web.d.ts +709 -7
- package/dist/web.js +50 -2
- package/dist/workflow.js +322 -0
- package/dist/write.js +419 -0
- package/dist/xliff.js +325 -0
- package/package.json +20 -6
- package/dist/presenceAnchors-4iHAVQB3.js +0 -4367
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { outputActivationTables as e } from "./outputActivationStore.js";
|
|
2
|
+
import { outputDeploymentTables as t } from "./outputDeployment.js";
|
|
3
|
+
import { outputActivationTargetsTable as n } from "./outputActivationTargetTable.js";
|
|
4
|
+
//#region src/outputActivationTables.ts
|
|
5
|
+
var r = Object.freeze([
|
|
6
|
+
...e,
|
|
7
|
+
...t,
|
|
8
|
+
n
|
|
9
|
+
]);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { r as cmsOutputActivationTables };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { copyOutputActivationScope as e, copyOutputActivationSet as t, outputActivationFail as n } from "./outputActivation.js";
|
|
2
|
+
import { copySnapshotResource as r } from "./buildSnapshot.js";
|
|
3
|
+
import { readStaticPathSetEvidence as i } from "./staticPathSetStore.js";
|
|
4
|
+
import { OUTPUT_ACTIVATION_TARGETS as a } from "./outputActivationTargetTable.js";
|
|
5
|
+
import { and as o, eq as s } from "@voltro/database";
|
|
6
|
+
import { canonicalJson as c } from "@voltro/protocol";
|
|
7
|
+
//#region src/outputActivationTarget.ts
|
|
8
|
+
var l = (e, t) => typeof e != "object" || !e || Array.isArray(e) || Object.keys(e).sort().join(",") !== t ? n("input") : e, u = (e) => {
|
|
9
|
+
let i = l(r({
|
|
10
|
+
key: "output-target",
|
|
11
|
+
value: e
|
|
12
|
+
}).value, "outputs,pathSets,set"), a = t(i.set);
|
|
13
|
+
if (!Array.isArray(i.pathSets) || i.pathSets.length !== a.manifest.paths.length || !Array.isArray(i.outputs) || i.outputs.length !== a.manifest.regions.required.length) return n("input");
|
|
14
|
+
let o = i.pathSets.map((e) => {
|
|
15
|
+
let t = l(e, "host,jobId");
|
|
16
|
+
return typeof t.host != "string" || typeof t.jobId != "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(t.jobId) ? n("input") : {
|
|
17
|
+
host: t.host,
|
|
18
|
+
jobId: t.jobId
|
|
19
|
+
};
|
|
20
|
+
}).sort((e, t) => e.host < t.host ? -1 : +(e.host > t.host)), s = i.outputs.map((e) => {
|
|
21
|
+
let t = l(e, "outputId,region");
|
|
22
|
+
return typeof t.region != "string" || typeof t.outputId != "string" || !/^[a-f0-9]{64}$/.test(t.outputId) ? n("input") : {
|
|
23
|
+
region: t.region,
|
|
24
|
+
outputId: t.outputId
|
|
25
|
+
};
|
|
26
|
+
}).sort((e, t) => e.region < t.region ? -1 : +(e.region > t.region));
|
|
27
|
+
return o.some((e, t) => e.host !== a.manifest.paths[t].host) || s.some((e, t) => e.region !== a.manifest.regions.required[t]) ? n("changed") : {
|
|
28
|
+
set: a,
|
|
29
|
+
pathSets: o,
|
|
30
|
+
outputs: s
|
|
31
|
+
};
|
|
32
|
+
}, d = (e, t) => o(s("tenantId", e.tenantId), s("site", e.site), s("environment", e.environment), s("targetId", t)), f = async (t, r, i) => {
|
|
33
|
+
let o = e(r);
|
|
34
|
+
if (typeof i != "string" || !/^[a-f0-9]{64}$/.test(i)) return n("input");
|
|
35
|
+
let s = await t.query({
|
|
36
|
+
table: a,
|
|
37
|
+
predicate: d(o, i),
|
|
38
|
+
order: [],
|
|
39
|
+
take: 2,
|
|
40
|
+
skip: void 0,
|
|
41
|
+
projection: void 0
|
|
42
|
+
});
|
|
43
|
+
if (s.length === 0) return null;
|
|
44
|
+
if (s.length !== 1) return n("state");
|
|
45
|
+
let l = s[0], f = u({
|
|
46
|
+
set: {
|
|
47
|
+
id: i,
|
|
48
|
+
manifest: l.manifest
|
|
49
|
+
},
|
|
50
|
+
pathSets: l.pathSets,
|
|
51
|
+
outputs: l.outputs
|
|
52
|
+
});
|
|
53
|
+
return l.deploymentId !== f.set.manifest.app.deploymentId || c(f.set.manifest.scope) !== c(o) ? n("changed") : f;
|
|
54
|
+
}, p = async (t, r, o, s) => {
|
|
55
|
+
let l = e(r), d = u(o), p = d.set;
|
|
56
|
+
if (c(p.manifest.scope) !== c(l)) return n("changed");
|
|
57
|
+
for (let e of d.pathSets) {
|
|
58
|
+
let r = p.manifest.paths.find((t) => t.host === e.host), a = await i(t, l, {
|
|
59
|
+
id: e.jobId,
|
|
60
|
+
digest: r.setId
|
|
61
|
+
}, s), o = a.set.manifest.context;
|
|
62
|
+
if (o.host !== e.host || o.snapshotId !== p.manifest.snapshot.id || o.snapshotDigest !== p.manifest.snapshot.digest || o.releaseId !== p.manifest.snapshot.releaseId || o.inputsId !== p.manifest.app.inputsId || o.executionId !== p.manifest.app.executionId || o.policyDigest !== p.manifest.renderPolicyDigest || a.set.manifest.count !== r.count) return n("changed");
|
|
63
|
+
}
|
|
64
|
+
await t.insertIgnore(a, {
|
|
65
|
+
...l,
|
|
66
|
+
targetId: p.id,
|
|
67
|
+
deploymentId: p.manifest.app.deploymentId,
|
|
68
|
+
manifest: p.manifest,
|
|
69
|
+
pathSets: d.pathSets,
|
|
70
|
+
outputs: d.outputs
|
|
71
|
+
}, { conflictColumns: [
|
|
72
|
+
"tenantId",
|
|
73
|
+
"site",
|
|
74
|
+
"environment",
|
|
75
|
+
"targetId"
|
|
76
|
+
] });
|
|
77
|
+
let m = await f(t, l, p.id);
|
|
78
|
+
return c(m) === c(d) ? m : n("changed");
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { f as readOutputActivationTarget, p as retainOutputActivationTarget };
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
//#region src/outputActivationTargetTable.ts
|
|
4
|
+
var a = "_voltro_cms_output_targets", o = n("_voltro_cms_output_targets", {
|
|
5
|
+
id: e({ prefix: "coutt" }),
|
|
6
|
+
site: r().maxLength(64),
|
|
7
|
+
environment: r().maxLength(64),
|
|
8
|
+
targetId: r().maxLength(64),
|
|
9
|
+
deploymentId: r().maxLength(64),
|
|
10
|
+
manifest: t(),
|
|
11
|
+
pathSets: t(),
|
|
12
|
+
outputs: t()
|
|
13
|
+
}).with(i()).unique("cms_output_target_scope", [
|
|
14
|
+
"tenantId",
|
|
15
|
+
"site",
|
|
16
|
+
"environment",
|
|
17
|
+
"targetId"
|
|
18
|
+
]).unique("cms_output_target_deployment", [
|
|
19
|
+
"tenantId",
|
|
20
|
+
"site",
|
|
21
|
+
"environment",
|
|
22
|
+
"deploymentId"
|
|
23
|
+
]);
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as OUTPUT_ACTIVATION_TARGETS, o as outputActivationTargetsTable };
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { lockSiteState as e, lockSiteStateForRead as t } from "./siteState.js";
|
|
2
|
+
import { lockPublicationStream as n, readPublicationBoundary as r } from "./changes.js";
|
|
3
|
+
import { OutputActivationUnavailable as i, copyOutputActivationApp as a, copyOutputActivationScope as o, outputActivationContractDigest as s, outputActivationFail as c } from "./outputActivation.js";
|
|
4
|
+
import { StaticPathSetUnavailable as l } from "./staticPathSet.js";
|
|
5
|
+
import { lockOutputRouteHistoryCapture as u } from "./outputActivationStore.js";
|
|
6
|
+
import { AssetUseRightsUnavailable as d } from "./assetUseRights.js";
|
|
7
|
+
import { admitOutputRouteGraph as f } from "./outputRouteGraph.js";
|
|
8
|
+
import { and as p, eq as m, generateId as h, id as g, integer as _, json as v, table as y, text as b } from "@voltro/database";
|
|
9
|
+
import { tenant as x } from "@voltro/plugin-multitenancy/mixin";
|
|
10
|
+
import { canonicalJson as S } from "@voltro/runtime";
|
|
11
|
+
//#region src/outputDeployment.ts
|
|
12
|
+
var C = "_voltro_cms_output_deployments", w = "_voltro_cms_output_deployment_builds", T = y(C, {
|
|
13
|
+
id: g({ prefix: "coutdep" }),
|
|
14
|
+
site: b().maxLength(64),
|
|
15
|
+
environment: b().maxLength(64),
|
|
16
|
+
revision: _(),
|
|
17
|
+
app: v(),
|
|
18
|
+
renderPolicyDigest: b().maxLength(64)
|
|
19
|
+
}).with(x()).unique("cms_output_deployment_scope", [
|
|
20
|
+
"tenantId",
|
|
21
|
+
"site",
|
|
22
|
+
"environment"
|
|
23
|
+
]), E = y(w, {
|
|
24
|
+
id: g({ prefix: "coutapp" }),
|
|
25
|
+
site: b().maxLength(64),
|
|
26
|
+
environment: b().maxLength(64),
|
|
27
|
+
deploymentId: b().maxLength(64),
|
|
28
|
+
app: v()
|
|
29
|
+
}).with(x()).unique("cms_output_deployment_identity", [
|
|
30
|
+
"tenantId",
|
|
31
|
+
"site",
|
|
32
|
+
"environment",
|
|
33
|
+
"deploymentId"
|
|
34
|
+
]), D = Object.freeze([T, E]), O = (e) => p(m("tenantId", e.tenantId), m("site", e.site), m("environment", e.environment)), k = async (e, t, n = "update") => {
|
|
35
|
+
let [r] = await e.query({
|
|
36
|
+
table: C,
|
|
37
|
+
predicate: O(t),
|
|
38
|
+
lock: n,
|
|
39
|
+
order: [],
|
|
40
|
+
take: 1,
|
|
41
|
+
skip: void 0,
|
|
42
|
+
projection: void 0
|
|
43
|
+
});
|
|
44
|
+
return r === void 0 ? null : typeof r.id != "string" || !Number.isSafeInteger(r.revision) || Number(r.revision) < 1 || typeof r.renderPolicyDigest != "string" || !/^[a-f0-9]{64}$/.test(r.renderPolicyDigest) ? c("state") : {
|
|
45
|
+
id: r.id,
|
|
46
|
+
revision: Number(r.revision),
|
|
47
|
+
app: a(r.app),
|
|
48
|
+
renderPolicyDigest: r.renderPolicyDigest
|
|
49
|
+
};
|
|
50
|
+
}, A = async (e, t, n = "update") => await k(e, t, n) ?? c("state"), j = async (e, t, n = {}) => {
|
|
51
|
+
let r = await k(e, o(t), n.lock ?? "share");
|
|
52
|
+
return r === null ? null : {
|
|
53
|
+
revision: r.revision,
|
|
54
|
+
app: r.app,
|
|
55
|
+
renderPolicyDigest: r.renderPolicyDigest
|
|
56
|
+
};
|
|
57
|
+
}, M = async (e, t, n, r = "update") => {
|
|
58
|
+
let [i] = await e.query({
|
|
59
|
+
table: w,
|
|
60
|
+
predicate: p(O(t), m("deploymentId", n)),
|
|
61
|
+
lock: r,
|
|
62
|
+
order: [],
|
|
63
|
+
take: 1,
|
|
64
|
+
skip: void 0,
|
|
65
|
+
projection: void 0
|
|
66
|
+
});
|
|
67
|
+
if (i === void 0) return c("state");
|
|
68
|
+
let o = a(i.app);
|
|
69
|
+
return o.deploymentId === n ? o : c("integrity");
|
|
70
|
+
}, N = async (t, n, r) => {
|
|
71
|
+
let i = o(n), s = a(r.app);
|
|
72
|
+
if (!Number.isSafeInteger(r.expectedRevision) || r.expectedRevision < 0 || r.expectedRevision >= 2147483647 || !/^[a-f0-9]{64}$/.test(r.renderPolicyDigest)) return c("input");
|
|
73
|
+
await e(t, i);
|
|
74
|
+
let l = h({
|
|
75
|
+
kind: "typeid",
|
|
76
|
+
prefix: "coutapp"
|
|
77
|
+
}, w);
|
|
78
|
+
if (l === null) return c("state");
|
|
79
|
+
if (await t.insertIgnore(w, {
|
|
80
|
+
id: l,
|
|
81
|
+
...i,
|
|
82
|
+
deploymentId: s.deploymentId,
|
|
83
|
+
app: s
|
|
84
|
+
}, { conflictColumns: [
|
|
85
|
+
"tenantId",
|
|
86
|
+
"site",
|
|
87
|
+
"environment",
|
|
88
|
+
"deploymentId"
|
|
89
|
+
] }), S(await M(t, i, s.deploymentId)) !== S(s)) return c("changed");
|
|
90
|
+
if (r.expectedRevision === 0) {
|
|
91
|
+
let e = h({
|
|
92
|
+
kind: "typeid",
|
|
93
|
+
prefix: "coutdep"
|
|
94
|
+
}, C);
|
|
95
|
+
if (e === null) return c("state");
|
|
96
|
+
await t.insertIgnore(C, {
|
|
97
|
+
id: e,
|
|
98
|
+
...i,
|
|
99
|
+
revision: 1,
|
|
100
|
+
app: s,
|
|
101
|
+
renderPolicyDigest: r.renderPolicyDigest
|
|
102
|
+
}, { conflictColumns: [
|
|
103
|
+
"tenantId",
|
|
104
|
+
"site",
|
|
105
|
+
"environment"
|
|
106
|
+
] });
|
|
107
|
+
let n = await A(t, i);
|
|
108
|
+
return n.revision !== 1 || S(n.app) !== S(s) || n.renderPolicyDigest !== r.renderPolicyDigest ? c("changed") : {
|
|
109
|
+
revision: n.revision,
|
|
110
|
+
app: n.app,
|
|
111
|
+
renderPolicyDigest: n.renderPolicyDigest
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
let u = await A(t, i);
|
|
115
|
+
if (u.revision !== r.expectedRevision) return c("changed");
|
|
116
|
+
let d = u.revision + 1;
|
|
117
|
+
return await t.updateMany("_voltro_cms_output_deployments", {
|
|
118
|
+
revision: d,
|
|
119
|
+
app: s,
|
|
120
|
+
renderPolicyDigest: r.renderPolicyDigest
|
|
121
|
+
}, { where: p(O(i), m("id", u.id), m("revision", u.revision)) }) === 1 ? {
|
|
122
|
+
revision: d,
|
|
123
|
+
app: s,
|
|
124
|
+
renderPolicyDigest: r.renderPolicyDigest
|
|
125
|
+
} : c("changed");
|
|
126
|
+
}, P = (e, t) => {
|
|
127
|
+
if (s(e.app) !== s(t.manifest.app) || e.renderPolicyDigest !== t.manifest.renderPolicyDigest) return c("changed");
|
|
128
|
+
}, F = (t) => async (n, i) => {
|
|
129
|
+
let a = o(i.manifest.scope);
|
|
130
|
+
await e(n, a);
|
|
131
|
+
let l = await A(n, a), u = await r(n, a);
|
|
132
|
+
return S(await M(n, a, i.manifest.app.deploymentId)) === S(i.manifest.app) ? (P(l, i), await t(n, i), {
|
|
133
|
+
publicationGeneration: u.generation,
|
|
134
|
+
releaseId: u.releaseId,
|
|
135
|
+
deploymentId: l.app.deploymentId,
|
|
136
|
+
renderPolicyDigest: l.renderPolicyDigest,
|
|
137
|
+
contractDigest: s(l.app)
|
|
138
|
+
}) : c("changed");
|
|
139
|
+
}, I = (e) => {
|
|
140
|
+
if (typeof e != "object" || !e || !Array.isArray(e.pathKeys) || e.pathKeys.length < 1 || e.pathKeys.length > 64 || typeof e.verifyArtifacts != "function" || typeof e.use != "function" || e.now !== void 0 && typeof e.now != "function") return c("input");
|
|
141
|
+
let t = {
|
|
142
|
+
...e,
|
|
143
|
+
pathKeys: e.pathKeys.map((e) => ({
|
|
144
|
+
id: e.id,
|
|
145
|
+
material: new Uint8Array(e.material)
|
|
146
|
+
}))
|
|
147
|
+
};
|
|
148
|
+
return async (e, r, a) => {
|
|
149
|
+
try {
|
|
150
|
+
let i = await u(e, r.manifest.scope);
|
|
151
|
+
return await F(async (e, r) => {
|
|
152
|
+
await n(e, r.manifest.scope);
|
|
153
|
+
let a = await t.verifyArtifacts(e, r);
|
|
154
|
+
await f(e, r, a, {
|
|
155
|
+
observed: i,
|
|
156
|
+
keys: t.pathKeys,
|
|
157
|
+
use: t.use,
|
|
158
|
+
...t.now === void 0 ? {} : { now: t.now }
|
|
159
|
+
});
|
|
160
|
+
})(e, r, a);
|
|
161
|
+
} catch (e) {
|
|
162
|
+
if (e instanceof i) throw e;
|
|
163
|
+
return e instanceof l ? c("integrity") : e instanceof d ? c("denied") : c("changed");
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}, L = (e) => async (n, r, i, a) => {
|
|
167
|
+
let s = o(r.manifest.scope);
|
|
168
|
+
await t(n, s);
|
|
169
|
+
let l = await A(n, s, "share");
|
|
170
|
+
if (S(await M(n, s, r.manifest.app.deploymentId, "share")) !== S(r.manifest.app)) return c("changed");
|
|
171
|
+
P(l, r), await e(n, r, i, a);
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
export { C as OUTPUT_DEPLOYMENTS, w as OUTPUT_DEPLOYMENT_BUILDS, N as bindOutputDeployment, I as makeOutputActivationAdmission, F as makeOutputDeploymentAdmission, L as makeOutputServingAdmission, E as outputDeploymentBuildsTable, D as outputDeploymentTables, T as outputDeploymentsTable, j as readOutputDeployment };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { cmsCredential as e, privateCmsHttpRoutes as t, privateCmsOperation as n } from "./privateCmsTransport.js";
|
|
2
|
+
import { CmsOutputDeploymentUnavailable as r } from "./outputDeploymentService.js";
|
|
3
|
+
import { Schema as i } from "effect";
|
|
4
|
+
import { strictInput as a } from "@voltro/protocol";
|
|
5
|
+
//#region src/outputDeploymentRest.ts
|
|
6
|
+
var o = i.String.pipe(i.check(i.isPattern(/^[a-f0-9]{64}$/))), s = i.String.pipe(i.check(i.isPattern(/^[A-Za-z0-9_-]{1,64}$/))), c = i.String.pipe(i.check(i.isPattern(/^\d{20}$/))), l = i.Struct({
|
|
7
|
+
tenantId: s,
|
|
8
|
+
site: s,
|
|
9
|
+
environment: s
|
|
10
|
+
}), u = i.Struct({
|
|
11
|
+
deploymentId: s,
|
|
12
|
+
inputsId: o,
|
|
13
|
+
executionId: o,
|
|
14
|
+
contractVersion: i.Int,
|
|
15
|
+
bindingsDigest: o,
|
|
16
|
+
schemaDigest: o,
|
|
17
|
+
cacheKeyDigest: o
|
|
18
|
+
}), d = i.Struct({
|
|
19
|
+
publicationGeneration: c,
|
|
20
|
+
releaseId: i.NullOr(s),
|
|
21
|
+
deploymentId: s,
|
|
22
|
+
renderPolicyDigest: o,
|
|
23
|
+
contractDigest: o
|
|
24
|
+
}), f = i.Struct({
|
|
25
|
+
version: i.Literal(1),
|
|
26
|
+
id: o,
|
|
27
|
+
targetId: o,
|
|
28
|
+
scope: l,
|
|
29
|
+
expectedGeneration: i.Int,
|
|
30
|
+
mode: i.Literals(["forward", "rollback"]),
|
|
31
|
+
observation: d,
|
|
32
|
+
expiresAt: i.Int,
|
|
33
|
+
keyId: s,
|
|
34
|
+
signature: o
|
|
35
|
+
}), p = i.Struct({
|
|
36
|
+
version: i.Literal(1),
|
|
37
|
+
probeId: o,
|
|
38
|
+
targetId: o,
|
|
39
|
+
generation: i.Int,
|
|
40
|
+
region: s,
|
|
41
|
+
outputId: o,
|
|
42
|
+
keyId: s,
|
|
43
|
+
signature: o
|
|
44
|
+
}), m = i.Array(p).pipe(i.check(i.isMaxLength(64))), h = i.String.pipe(i.check(i.isMaxLength(253))), g = i.Struct({
|
|
45
|
+
version: i.Literal(2),
|
|
46
|
+
scope: l,
|
|
47
|
+
snapshot: i.Struct({
|
|
48
|
+
id: s,
|
|
49
|
+
digest: o,
|
|
50
|
+
releaseId: s,
|
|
51
|
+
publicationGeneration: c
|
|
52
|
+
}),
|
|
53
|
+
app: u,
|
|
54
|
+
renderPolicyDigest: o,
|
|
55
|
+
paths: i.Array(i.Struct({
|
|
56
|
+
host: h,
|
|
57
|
+
setId: o,
|
|
58
|
+
count: i.Int
|
|
59
|
+
})).pipe(i.check(i.isMaxLength(256))),
|
|
60
|
+
artifacts: i.Array(i.Struct({
|
|
61
|
+
host: h,
|
|
62
|
+
documents: o,
|
|
63
|
+
assets: o,
|
|
64
|
+
redirects: o,
|
|
65
|
+
sitemap: o,
|
|
66
|
+
robots: o,
|
|
67
|
+
deny: o
|
|
68
|
+
})).pipe(i.check(i.isMaxLength(256))),
|
|
69
|
+
cacheNamespace: o,
|
|
70
|
+
regions: i.Struct({
|
|
71
|
+
required: i.Array(s).pipe(i.check(i.isMaxLength(64))),
|
|
72
|
+
quorum: i.Int
|
|
73
|
+
})
|
|
74
|
+
}), _ = g, v = i.Struct({
|
|
75
|
+
id: s,
|
|
76
|
+
generation: i.Int,
|
|
77
|
+
set: i.Struct({
|
|
78
|
+
id: o,
|
|
79
|
+
manifest: _
|
|
80
|
+
}),
|
|
81
|
+
probe: f,
|
|
82
|
+
receipts: m,
|
|
83
|
+
activatedAt: i.Int
|
|
84
|
+
}), y = i.Struct({
|
|
85
|
+
targetId: o,
|
|
86
|
+
expectedRevision: i.Int,
|
|
87
|
+
expectedGeneration: i.Int,
|
|
88
|
+
mode: i.Literals(["forward", "rollback"]),
|
|
89
|
+
outputs: i.Array(i.Struct({
|
|
90
|
+
region: s,
|
|
91
|
+
outputId: o
|
|
92
|
+
})).pipe(i.check(i.isMaxLength(64)))
|
|
93
|
+
}), b = i.Struct({
|
|
94
|
+
deployment: i.Struct({
|
|
95
|
+
revision: i.Int,
|
|
96
|
+
app: u,
|
|
97
|
+
renderPolicyDigest: o
|
|
98
|
+
}),
|
|
99
|
+
activation: v
|
|
100
|
+
}), x = (t) => e(t, "CmsOutputDeploymentUnavailable"), S = (e, t, i, o, s, c) => ({
|
|
101
|
+
...n({
|
|
102
|
+
namespace: "cms.outputDeployment",
|
|
103
|
+
path: "/v1/cms/output-deployments",
|
|
104
|
+
operationPrefix: "cmsOutputDeployment",
|
|
105
|
+
tags: ["CMS output deployment"],
|
|
106
|
+
error: r,
|
|
107
|
+
credentialError: "CmsOutputDeploymentUnavailable",
|
|
108
|
+
errorStatus: { CmsOutputDeploymentUnavailable: 409 }
|
|
109
|
+
}, e, t, i, a(o, "cms.outputDeployment." + e, !0), s, c),
|
|
110
|
+
maxBodyBytes: 65536
|
|
111
|
+
}), C = (e) => {
|
|
112
|
+
let n = [
|
|
113
|
+
S("inspect", "Read current deployment and activation epochs", "Fresh scoped cms:deploy authority. Metadata only; no output, provider or serving authority. Retain these exact epochs with the original deployment intent.", i.Struct({}), i.Struct({
|
|
114
|
+
revision: i.Int,
|
|
115
|
+
generation: i.Int
|
|
116
|
+
}), (t, n) => e.inspect({ credential: x(n) })),
|
|
117
|
+
S("deploy", "Atomically bind and publish one complete output target", "Fresh scoped cms:deploy authority. Verify every required physical region before a single transaction binds the original app and policy, admits the current graph, signs regional custody and activates the complete set. Failure rolls back the binding and activation together. Exact current lost acknowledgements return the same epochs and result.", y, b, (t, n) => e.deploy({
|
|
118
|
+
...t,
|
|
119
|
+
credential: x(n)
|
|
120
|
+
})),
|
|
121
|
+
S("confirm", "Confirm one exact current native publication", "Fresh scoped cms:deploy authority. Acknowledge only the already committed original target, epochs, mode and complete regional output identity. This operation never stages, binds, probes, signs or activates a target. Missing, displaced or changed publications refuse; expired original private inputs do not prevent confirmation. The acknowledgement grants no public serving or Cloud readiness.", y, b, (t, n) => e.confirm({
|
|
122
|
+
...t,
|
|
123
|
+
credential: x(n)
|
|
124
|
+
})),
|
|
125
|
+
S("bind", "Bind one admitted output deployment", "Dedicated scoped cms:deploy credential. The server resolves the original deployment contract and policy; the request supplies only its ID and expected revision. No execution, provider allocation or app contract comes from HTTP.", i.Struct({
|
|
126
|
+
deploymentId: s,
|
|
127
|
+
expectedRevision: i.Int
|
|
128
|
+
}), i.Struct({
|
|
129
|
+
revision: i.Int,
|
|
130
|
+
app: u,
|
|
131
|
+
renderPolicyDigest: o
|
|
132
|
+
}), (t, n) => e.bind({
|
|
133
|
+
...t,
|
|
134
|
+
credential: x(n)
|
|
135
|
+
})),
|
|
136
|
+
S("probe", "Probe one complete output activation target", "Dedicated scoped deployment credential. The server resolves the immutable target, verifies current deployment/publication/graph/rights and signs a probe valid for at most 30 seconds. Target IDs grant no authority.", i.Struct({
|
|
137
|
+
targetId: o,
|
|
138
|
+
expectedGeneration: i.Int,
|
|
139
|
+
mode: i.Literals(["forward", "rollback"])
|
|
140
|
+
}), f, (t, n) => e.probe({
|
|
141
|
+
...t,
|
|
142
|
+
credential: x(n)
|
|
143
|
+
})),
|
|
144
|
+
S("observeRegion", "Verify physical regional custody and sign its original probe", "The server reads the exact target/output through its fixed regional adapter and rehashes every role/file. Current scoped credential and original unexpired probe are checked after physical IO. No filesystem paths, signer keys, replacement probe or serving authority is accepted.", i.Struct({
|
|
145
|
+
targetId: o,
|
|
146
|
+
probe: f,
|
|
147
|
+
region: s,
|
|
148
|
+
outputId: o
|
|
149
|
+
}), p, (t, n) => e.observeRegion({
|
|
150
|
+
...t,
|
|
151
|
+
credential: x(n)
|
|
152
|
+
})),
|
|
153
|
+
S("activate", "Atomically activate one fully admitted output set", "Fresh scoped deployment credential, current graph/rights and original probe/region policy guard the generation CAS. Exact recovery of an already committed current marker returns that same result without renewing its probe or advancing generation. It grants no public read permission; serving still enforces current denials and rights.", i.Struct({
|
|
154
|
+
targetId: o,
|
|
155
|
+
probe: f,
|
|
156
|
+
receipts: m
|
|
157
|
+
}), v, (t, n) => e.activate({
|
|
158
|
+
...t,
|
|
159
|
+
credential: x(n)
|
|
160
|
+
}))
|
|
161
|
+
];
|
|
162
|
+
return {
|
|
163
|
+
routes: n,
|
|
164
|
+
httpRoutes: t(n)
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
export { C as cmsOutputDeploymentRest, g as outputDeploymentManifestSchema };
|