@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,129 @@
|
|
|
1
|
+
import { cmsCredential as e, privateCmsHttpRoutes as t, privateCmsOperation as n } from "./privateCmsTransport.js";
|
|
2
|
+
import { StaticPathSetConflict as r, StaticPathSetUnavailable as i } from "./staticPathSet.js";
|
|
3
|
+
import { Schema as a } from "effect";
|
|
4
|
+
//#region src/staticPathSetRest.ts
|
|
5
|
+
var o = a.Struct({
|
|
6
|
+
id: a.String,
|
|
7
|
+
digest: a.String
|
|
8
|
+
}), s = a.Struct({
|
|
9
|
+
snapshot: o,
|
|
10
|
+
consumerId: a.String,
|
|
11
|
+
buildId: a.String,
|
|
12
|
+
host: a.String,
|
|
13
|
+
localeIds: a.optional(a.Array(a.String)),
|
|
14
|
+
owners: a.optional(a.Array(a.Literals(["cms", "code"])))
|
|
15
|
+
}), c = a.Struct({
|
|
16
|
+
tenantId: a.String,
|
|
17
|
+
site: a.String,
|
|
18
|
+
environment: a.String,
|
|
19
|
+
snapshotId: a.String,
|
|
20
|
+
snapshotDigest: a.String,
|
|
21
|
+
releaseId: a.NullOr(a.String),
|
|
22
|
+
consumerId: a.String,
|
|
23
|
+
buildId: a.String,
|
|
24
|
+
inputsId: a.String,
|
|
25
|
+
executionId: a.String,
|
|
26
|
+
routesDigest: a.String,
|
|
27
|
+
domainsDigest: a.String,
|
|
28
|
+
localesDigest: a.String,
|
|
29
|
+
policyDigest: a.String,
|
|
30
|
+
projectionDigest: a.String,
|
|
31
|
+
host: a.String,
|
|
32
|
+
localeIds: a.Array(a.String),
|
|
33
|
+
owners: a.Array(a.Literals(["cms", "code"]))
|
|
34
|
+
}), l = a.Struct({
|
|
35
|
+
id: a.String,
|
|
36
|
+
keyId: a.String,
|
|
37
|
+
signature: a.String,
|
|
38
|
+
manifest: a.Struct({
|
|
39
|
+
version: a.Literal(1),
|
|
40
|
+
context: c,
|
|
41
|
+
sort: a.Literal("host-nfc-path/v1"),
|
|
42
|
+
pageSize: a.Literal(200),
|
|
43
|
+
count: a.Number,
|
|
44
|
+
sources: a.Struct({
|
|
45
|
+
count: a.Number,
|
|
46
|
+
digest: a.String
|
|
47
|
+
}),
|
|
48
|
+
pages: a.Array(a.Struct({
|
|
49
|
+
count: a.Number,
|
|
50
|
+
digest: a.String,
|
|
51
|
+
first: a.String,
|
|
52
|
+
last: a.String
|
|
53
|
+
}))
|
|
54
|
+
})
|
|
55
|
+
}), u = a.Struct({
|
|
56
|
+
id: a.String,
|
|
57
|
+
revision: a.Number,
|
|
58
|
+
phase: a.Literals([
|
|
59
|
+
"cms",
|
|
60
|
+
"code",
|
|
61
|
+
"seal",
|
|
62
|
+
"ready"
|
|
63
|
+
]),
|
|
64
|
+
enumerated: a.Number,
|
|
65
|
+
set: a.NullOr(l)
|
|
66
|
+
}), d = a.Struct({
|
|
67
|
+
host: a.String,
|
|
68
|
+
path: a.String,
|
|
69
|
+
localeId: a.String,
|
|
70
|
+
routeId: a.String,
|
|
71
|
+
owner: a.Literals(["cms", "code"]),
|
|
72
|
+
file: a.NullOr(a.String),
|
|
73
|
+
sourceDigest: a.NullOr(a.String),
|
|
74
|
+
parameters: a.Record(a.String, a.String)
|
|
75
|
+
}), f = {
|
|
76
|
+
namespace: "cms.staticPathSet",
|
|
77
|
+
path: "/v1/cms/static-path-sets",
|
|
78
|
+
operationPrefix: "cmsStaticPathSet",
|
|
79
|
+
tags: ["CMS static path sets"],
|
|
80
|
+
credentialError: "CmsBuildSnapshotUnavailable",
|
|
81
|
+
error: a.Union([i, r]),
|
|
82
|
+
errorStatus: {
|
|
83
|
+
StaticPathSetUnavailable: 409,
|
|
84
|
+
StaticPathSetConflict: 409
|
|
85
|
+
}
|
|
86
|
+
}, p = (t, n) => ({
|
|
87
|
+
snapshot: t.snapshot,
|
|
88
|
+
token: e(n, "CmsBuildSnapshotUnavailable"),
|
|
89
|
+
consumerId: t.consumerId,
|
|
90
|
+
buildId: t.buildId,
|
|
91
|
+
host: t.host,
|
|
92
|
+
...t.localeIds === void 0 ? {} : { localeIds: t.localeIds },
|
|
93
|
+
...t.owners === void 0 ? {} : { owners: t.owners }
|
|
94
|
+
}), m = (e) => {
|
|
95
|
+
let r = [
|
|
96
|
+
n(f, "begin", "Begin or resume a captured static path set", "Render-read bearer. Scope, snapshot, build, admitted host and exact locale selection identify the durable job. An id alone grants nothing.", s, u, (t, n) => e.begin(p(t, n))),
|
|
97
|
+
n(f, "advance", "Advance one bounded durable path enumeration step", "Render-read bearer for the same build. Captured CMS resources and retained native code are merged with captured ownership rules. Renew bounded grants through snapshot open when needed. URL conflicts include both admitted owners and a repair action.", a.Struct({
|
|
98
|
+
...s.fields,
|
|
99
|
+
id: a.String,
|
|
100
|
+
revision: a.Number
|
|
101
|
+
}), u, (t, n) => e.advance({
|
|
102
|
+
...p(t, n),
|
|
103
|
+
id: t.id,
|
|
104
|
+
revision: t.revision
|
|
105
|
+
})),
|
|
106
|
+
n(f, "page", "Read one authenticated immutable static path page", "Render-read bearer. The digest pins the complete signed set and its exact filter, count and ordered page digests. Index is interpreted only within this root. Repeating the same page is idempotent; there is no live fallback.", a.Struct({
|
|
107
|
+
...s.fields,
|
|
108
|
+
id: a.String,
|
|
109
|
+
digest: a.String,
|
|
110
|
+
index: a.Number
|
|
111
|
+
}), a.Struct({
|
|
112
|
+
set: l,
|
|
113
|
+
index: a.Number,
|
|
114
|
+
entries: a.Array(d),
|
|
115
|
+
next: a.NullOr(a.Number)
|
|
116
|
+
}), (t, n) => e.page({
|
|
117
|
+
...p(t, n),
|
|
118
|
+
id: t.id,
|
|
119
|
+
digest: t.digest,
|
|
120
|
+
index: t.index
|
|
121
|
+
}))
|
|
122
|
+
];
|
|
123
|
+
return {
|
|
124
|
+
routes: r,
|
|
125
|
+
httpRoutes: t(r)
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
//#endregion
|
|
129
|
+
export { m as cmsStaticPathSetRest };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { defineSiteDelivery as e } from "./siteDelivery.js";
|
|
2
|
+
import { normalizeHost as t } from "./domainHost.js";
|
|
3
|
+
import { verifyPublicationState as n } from "./publicationState.js";
|
|
4
|
+
import { findVerifiedSnapshotResources as r, pageSnapshotResources as i } from "./buildSnapshot.js";
|
|
5
|
+
import { nativeSnapshotRouteId as a, readSnapshotRouting as o, snapshotCmsPage as s, snapshotRouteDispatch as c, verifySnapshotRouteOwnership as l } from "./snapshotRouting.js";
|
|
6
|
+
import { StaticPathSetConflict as u, StaticPathSetUnavailable as d, copyStaticPathContext as f, copyStaticPathOwners as p, staticPathHash as m, staticPathUrl as h } from "./staticPathSet.js";
|
|
7
|
+
import { readSnapshotAppExecution as g, verifySnapshotAppExecution as _ } from "./snapshotAppExecution.js";
|
|
8
|
+
import { readSnapshotRouteAdmission as v, verifySnapshotContentRoute as y } from "./snapshotRouteAdmission.js";
|
|
9
|
+
import { readAdmittedSnapshotContentRoute as b } from "./snapshotRouteRead.js";
|
|
10
|
+
import { snapshotPathLocale as x } from "./snapshotPathLocale.js";
|
|
11
|
+
import { appendStaticPathStage as S, beginStaticPathSet as C, pageStaticPathSet as w, readStaticPathSet as T, sealStaticPathSet as E } from "./staticPathSetStore.js";
|
|
12
|
+
import { Effect as D } from "effect";
|
|
13
|
+
import { canonicalJson as O } from "@voltro/runtime";
|
|
14
|
+
//#region src/staticPathSetService.ts
|
|
15
|
+
var k = (e) => {
|
|
16
|
+
throw new d({ reason: e });
|
|
17
|
+
}, A = (e) => typeof e != "object" || !e || Array.isArray(e) ? k("integrity") : e, j = (e) => D.tryPromise({
|
|
18
|
+
try: e,
|
|
19
|
+
catch: (e) => e instanceof d || e instanceof u ? e : new d({ reason: "state" })
|
|
20
|
+
}), M = (e) => ({
|
|
21
|
+
id: e.id,
|
|
22
|
+
revision: e.progress.revision,
|
|
23
|
+
phase: e.progress.phase,
|
|
24
|
+
enumerated: e.progress.inputCount,
|
|
25
|
+
set: e.sealed
|
|
26
|
+
}), N = (e) => ({
|
|
27
|
+
snapshot: {
|
|
28
|
+
id: e.snapshot.id,
|
|
29
|
+
digest: e.snapshot.digest
|
|
30
|
+
},
|
|
31
|
+
token: e.token,
|
|
32
|
+
consumerId: e.consumerId,
|
|
33
|
+
buildId: e.buildId,
|
|
34
|
+
host: e.host,
|
|
35
|
+
...e.localeIds === void 0 ? {} : { localeIds: [...e.localeIds] },
|
|
36
|
+
...e.owners === void 0 ? {} : { owners: [...e.owners] }
|
|
37
|
+
}), P = async (r, i, a, s) => {
|
|
38
|
+
let c = await v(r, i, a.snapshot, {
|
|
39
|
+
...a,
|
|
40
|
+
path: "/"
|
|
41
|
+
}, {
|
|
42
|
+
keys: s.keys,
|
|
43
|
+
now: s.now
|
|
44
|
+
}), l = await n(r, i, c.snapshot.manifest.publication, c.now), u = await g(r, i, c.snapshot), d = o(c.configuration), m = e(c.configuration.site), h = m.locales.filter((e) => e.enabled).map((e) => e.id).sort(), _ = a.localeIds === void 0 ? h : [...a.localeIds].sort();
|
|
45
|
+
if (_.length === 0 || _.some((e, t) => !h.includes(e) || t > 0 && _[t - 1] === e)) return k("input");
|
|
46
|
+
let y = p(a.owners ?? ["cms", "code"]), b = t(a.host);
|
|
47
|
+
if (b === null) return k("input");
|
|
48
|
+
let x = (e) => c.snapshot.manifest.parts.find((t) => t.part === e)?.digest ?? k("integrity"), S = f({
|
|
49
|
+
...i,
|
|
50
|
+
snapshotId: c.snapshot.id,
|
|
51
|
+
snapshotDigest: c.snapshot.digest,
|
|
52
|
+
releaseId: c.snapshot.manifest.publication.releaseId,
|
|
53
|
+
consumerId: a.consumerId,
|
|
54
|
+
buildId: a.buildId,
|
|
55
|
+
inputsId: u.inputsId,
|
|
56
|
+
executionId: u.executionId,
|
|
57
|
+
routesDigest: x("routes"),
|
|
58
|
+
domainsDigest: x("domains"),
|
|
59
|
+
localesDigest: x("locales"),
|
|
60
|
+
policyDigest: x("policies"),
|
|
61
|
+
projectionDigest: x("projection"),
|
|
62
|
+
host: b,
|
|
63
|
+
localeIds: _,
|
|
64
|
+
owners: y
|
|
65
|
+
}), C = d.discovery === null ? [] : d.discovery.pages;
|
|
66
|
+
if (!Array.isArray(C)) return k("integrity");
|
|
67
|
+
let w = C.map(A).sort((e, t) => String(e.file) < String(t.file) ? -1 : +(String(e.file) > String(t.file)));
|
|
68
|
+
return {
|
|
69
|
+
admission: c,
|
|
70
|
+
partitions: l,
|
|
71
|
+
app: u,
|
|
72
|
+
routing: d,
|
|
73
|
+
site: m,
|
|
74
|
+
context: S,
|
|
75
|
+
nativePages: w,
|
|
76
|
+
codePages: y.includes("code") ? w.filter((e) => {
|
|
77
|
+
let t = d.definition?.claims[String(e.file)];
|
|
78
|
+
return t?.kind !== "cms" && (u.web === void 0 || t?.kind === "code" && t.public === !0);
|
|
79
|
+
}) : []
|
|
80
|
+
};
|
|
81
|
+
}, F = (e) => {
|
|
82
|
+
let { store: t, execution: n } = e, o = {
|
|
83
|
+
tenantId: e.scope.tenantId,
|
|
84
|
+
site: e.scope.site,
|
|
85
|
+
environment: e.scope.environment
|
|
86
|
+
}, u = e.now ?? Date.now, d = {
|
|
87
|
+
id: e.key.id,
|
|
88
|
+
material: new Uint8Array(e.key.material)
|
|
89
|
+
}, f = [d, ...(e.verificationKeys ?? []).map((e) => ({
|
|
90
|
+
id: e.id,
|
|
91
|
+
material: new Uint8Array(e.material)
|
|
92
|
+
}))], p = (e, t) => P(e, o, t, {
|
|
93
|
+
keys: f,
|
|
94
|
+
now: u()
|
|
95
|
+
}), g = (e, t, n) => {
|
|
96
|
+
if (t === null) return {};
|
|
97
|
+
let r = e.nativePages.find((e) => e.file === t);
|
|
98
|
+
if (r === void 0) return k("integrity");
|
|
99
|
+
let i = A(r.matcher), a = i.paramNames;
|
|
100
|
+
if (typeof i.source != "string" || i.flags !== "" || !Array.isArray(a) || a.some((e) => typeof e != "string") || new Set(a).size !== a.length) return k("integrity");
|
|
101
|
+
let o = new RegExp(i.source, "").exec(n);
|
|
102
|
+
if (o === null) return k("integrity");
|
|
103
|
+
try {
|
|
104
|
+
return Object.fromEntries(a.map((e, t) => [e, decodeURIComponent(o[t + 1] ?? "")]));
|
|
105
|
+
} catch {
|
|
106
|
+
return k("integrity");
|
|
107
|
+
}
|
|
108
|
+
}, v = (e, t) => {
|
|
109
|
+
if (O(e) !== O(t)) return k("changed");
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
begin: (e) => j(async () => {
|
|
113
|
+
let n = N(e);
|
|
114
|
+
return t.transactional(async (e) => {
|
|
115
|
+
let t = await p(e, n), r = await C(e, t.context, f);
|
|
116
|
+
return await p(e, n), M(r);
|
|
117
|
+
});
|
|
118
|
+
}),
|
|
119
|
+
advance: (e) => j(async () => {
|
|
120
|
+
let u = N(e), C = e.id, w = e.revision;
|
|
121
|
+
if (!Number.isSafeInteger(w) || w < 0) return k("input");
|
|
122
|
+
let D = await t.transactional(async (e) => {
|
|
123
|
+
let t = await p(e, u), n = await T(e, t.context, C, f);
|
|
124
|
+
return {
|
|
125
|
+
...t,
|
|
126
|
+
set: n
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
if (w > D.set.progress.revision) return k("changed");
|
|
130
|
+
if (w < D.set.progress.revision || D.set.sealed !== null) return M(D.set);
|
|
131
|
+
if (D.set.progress.phase === "cms") return t.transactional(async (e) => {
|
|
132
|
+
let t = await p(e, u);
|
|
133
|
+
v(t.context, D.context);
|
|
134
|
+
let n = await i(e, o, t.admission.snapshot.id, "routes", {
|
|
135
|
+
now: t.admission.now,
|
|
136
|
+
limit: 200,
|
|
137
|
+
...D.set.progress.after === null ? {} : { after: D.set.progress.after }
|
|
138
|
+
}), r = [];
|
|
139
|
+
for (let i of n.items) {
|
|
140
|
+
if (!i.key.startsWith("path:")) continue;
|
|
141
|
+
let n = i.value, a = n.path;
|
|
142
|
+
if (typeof a != "string" || i.key !== "path:" + m(a)) return k("integrity");
|
|
143
|
+
if (y(o, a, n), l(t.admission.configuration, n).owner !== "cms" || !t.context.owners.includes("cms") || !t.context.localeIds.includes(String(n.localeId))) continue;
|
|
144
|
+
let c = await b(e, {
|
|
145
|
+
...t.admission,
|
|
146
|
+
input: {
|
|
147
|
+
...t.admission.input,
|
|
148
|
+
path: a
|
|
149
|
+
},
|
|
150
|
+
route: n
|
|
151
|
+
}, t.partitions);
|
|
152
|
+
if (c === null) continue;
|
|
153
|
+
if (x(t.site, a).id !== c.output.localeId) return k("integrity");
|
|
154
|
+
let u = t.app.nativePages ? s(t.routing, a) : null;
|
|
155
|
+
r.push({
|
|
156
|
+
host: t.context.host,
|
|
157
|
+
path: a,
|
|
158
|
+
localeId: c.output.localeId,
|
|
159
|
+
routeId: c.output.routeId,
|
|
160
|
+
owner: "cms",
|
|
161
|
+
file: u?.file ?? null,
|
|
162
|
+
sourceDigest: u?.sourceDigest ?? null,
|
|
163
|
+
parameters: g(t, u?.file ?? null, a)
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
let a = await S(e, D.set, {
|
|
167
|
+
source: "cms:" + D.set.progress.revision,
|
|
168
|
+
receiptDigest: m({
|
|
169
|
+
routesDigest: t.context.routesDigest,
|
|
170
|
+
items: n.items
|
|
171
|
+
}),
|
|
172
|
+
entries: r,
|
|
173
|
+
next: {
|
|
174
|
+
phase: n.next === null ? t.codePages.length === 0 ? "seal" : "code" : "cms",
|
|
175
|
+
after: n.next,
|
|
176
|
+
codeIndex: 0
|
|
177
|
+
}
|
|
178
|
+
}, d, f);
|
|
179
|
+
return await p(e, u), M(a);
|
|
180
|
+
});
|
|
181
|
+
if (D.set.progress.phase === "code") {
|
|
182
|
+
let e = D.codePages[D.set.progress.codeIndex];
|
|
183
|
+
if (e === void 0 || typeof e.file != "string" || typeof e.pattern != "string" || !D.app.nativePages) return k("state");
|
|
184
|
+
let i = {
|
|
185
|
+
version: 1,
|
|
186
|
+
file: e.file
|
|
187
|
+
}, s = await n.run({
|
|
188
|
+
inputsId: D.app.inputsId,
|
|
189
|
+
executionId: D.app.executionId,
|
|
190
|
+
exportName: "__voltro_staticPaths",
|
|
191
|
+
inputJson: O(i)
|
|
192
|
+
});
|
|
193
|
+
_(D.app, "__voltro_staticPaths", i, s);
|
|
194
|
+
let b = A(s.value);
|
|
195
|
+
return Object.keys(b).sort().join(",") !== "file,paths,pattern,version" || b.version !== 1 || b.file !== e.file || b.pattern !== e.pattern || !Array.isArray(b.paths) || b.paths.length > 1e4 ? k("integrity") : t.transactional(async (t) => {
|
|
196
|
+
let n = await p(t, u);
|
|
197
|
+
v(n.context, D.context);
|
|
198
|
+
let i = [], _ = b.paths.map((e) => typeof e == "string" ? (h(n.context.host, e), e) : k("integrity"));
|
|
199
|
+
for (let s = 0; s < _.length; s += 200) {
|
|
200
|
+
let u = _.slice(s, s + 200), d = await r(t, o, n.admission.snapshot, "routes", u.map((e) => "path:" + m(e)));
|
|
201
|
+
for (let t of u) {
|
|
202
|
+
let r = d.get("path:" + m(t))?.value;
|
|
203
|
+
r !== void 0 && y(o, t, r);
|
|
204
|
+
let s = r === void 0 ? c(n.routing, t, !1) : l(n.admission.configuration, r);
|
|
205
|
+
if (s?.owner !== "code" || s.code === null || s.code.file !== e.file) continue;
|
|
206
|
+
let u = x(n.site, t);
|
|
207
|
+
n.context.localeIds.includes(u.id) && i.push({
|
|
208
|
+
host: n.context.host,
|
|
209
|
+
path: t,
|
|
210
|
+
localeId: u.id,
|
|
211
|
+
routeId: a(o, u.id, s.code.file, t),
|
|
212
|
+
owner: "code",
|
|
213
|
+
file: s.code.file,
|
|
214
|
+
sourceDigest: s.code.sourceDigest,
|
|
215
|
+
parameters: g(n, s.code.file, t)
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
let C = D.set.progress.codeIndex + 1, w = await S(t, D.set, {
|
|
220
|
+
source: "code:" + e.file,
|
|
221
|
+
receiptDigest: m(s),
|
|
222
|
+
entries: i,
|
|
223
|
+
next: {
|
|
224
|
+
phase: C === n.codePages.length ? "seal" : "code",
|
|
225
|
+
after: null,
|
|
226
|
+
codeIndex: C
|
|
227
|
+
}
|
|
228
|
+
}, d, f);
|
|
229
|
+
return await p(t, u), M(w);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
return t.transactional(async (e) => {
|
|
233
|
+
let t = await p(e, u);
|
|
234
|
+
v(t.context, D.context);
|
|
235
|
+
let n = await E(e, D.set, d, f);
|
|
236
|
+
return await p(e, u), M(n);
|
|
237
|
+
});
|
|
238
|
+
}),
|
|
239
|
+
page: (e) => j(async () => {
|
|
240
|
+
let n = N(e), r = e.id, i = e.index, a = e.digest;
|
|
241
|
+
return t.transactional(async (e) => {
|
|
242
|
+
let t = await p(e, n), o = await w(e, t.context, r, i, f);
|
|
243
|
+
return o.set.id === a ? (await p(e, n), o) : k("changed");
|
|
244
|
+
});
|
|
245
|
+
})
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
//#endregion
|
|
249
|
+
export { F as createCmsStaticPathSets, P as readSnapshotStaticPathAdmission };
|