@voltro/cms 0.86.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 +5321 -0
- package/README.md +138 -0
- package/THIRD-PARTY-NOTICES.md +860 -221
- package/dist/RichDocumentView.js +81 -36
- package/dist/aiCandidates.js +3 -3
- 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/availability.js +19 -16
- package/dist/blueprint.js +75 -75
- 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 +71 -70
- package/dist/changes.js +279 -62
- package/dist/consent.js +5 -5
- 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 +117 -100
- package/dist/contentValues.js +18 -0
- package/dist/copies.js +3 -3
- package/dist/domainHost.js +7 -0
- package/dist/domains.js +81 -87
- package/dist/draftTexts.js +37 -37
- package/dist/duplicates.js +23 -23
- package/dist/environmentAliases.js +138 -0
- package/dist/environments.js +107 -69
- package/dist/errors.js +54 -14
- package/dist/experiments.js +7 -7
- package/dist/frontendBindings.js +99 -0
- package/dist/frontendMedia.js +18 -0
- package/dist/index.d.ts +760 -47
- package/dist/index.js +89 -73
- package/dist/initializePublicRoutes.js +28 -0
- package/dist/liveContentRouteView.js +76 -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/privateCmsTransport.js +76 -0
- package/dist/privateNativeRouteReservation.js +10 -0
- package/dist/promotion.js +68 -59
- 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 +8 -8
- package/dist/reconfigurePublicRoutes.js +41 -0
- package/dist/redirects.js +104 -73
- package/dist/referenceGraph.js +15 -14
- package/dist/references.js +2 -2
- package/dist/release.js +177 -141
- package/dist/renderReadAuthority.js +43 -0
- package/dist/renderReadGrant.js +137 -0
- package/dist/review.js +28 -28
- package/dist/richDocument.js +54 -24
- 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 +36 -36
- package/dist/seo.js +1 -1
- package/dist/series.js +11 -11
- package/dist/share.js +13 -13
- 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/tree.js +9 -9
- package/dist/validation.js +53 -53
- package/dist/web.d.ts +709 -7
- package/dist/web.js +50 -33
- package/dist/workflow.js +8 -8
- package/dist/write.js +250 -225
- package/package.json +20 -6
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { cmsCredential as e, privateCmsHttpRoutes as t, privateCmsOperation as n } from "./privateCmsTransport.js";
|
|
2
|
+
import { CmsBuildSnapshotUnavailable as r } from "./buildSnapshotService.js";
|
|
3
|
+
import { Effect as i, Schema as a } from "effect";
|
|
4
|
+
import { strictInput as o } from "@voltro/protocol";
|
|
5
|
+
//#region src/snapshotDocumentAssemblyRest.ts
|
|
6
|
+
var s = {
|
|
7
|
+
namespace: "cms.documentAssembly",
|
|
8
|
+
path: "/v1/cms/document-assemblies",
|
|
9
|
+
operationPrefix: "cmsDocumentAssembly",
|
|
10
|
+
tags: ["CMS document assemblies"],
|
|
11
|
+
error: r,
|
|
12
|
+
errorStatus: { CmsBuildSnapshotUnavailable: 409 },
|
|
13
|
+
credentialError: "CmsBuildSnapshotUnavailable"
|
|
14
|
+
}, c = a.Struct({
|
|
15
|
+
snapshot: a.Struct({
|
|
16
|
+
id: a.String,
|
|
17
|
+
digest: a.String
|
|
18
|
+
}),
|
|
19
|
+
consumerId: a.String,
|
|
20
|
+
buildId: a.String,
|
|
21
|
+
host: a.String,
|
|
22
|
+
pathSets: a.Array(a.Struct({
|
|
23
|
+
id: a.String,
|
|
24
|
+
digest: a.String
|
|
25
|
+
}))
|
|
26
|
+
}), l = {
|
|
27
|
+
headerId: a.String,
|
|
28
|
+
tipId: a.String
|
|
29
|
+
}, u = a.Struct({
|
|
30
|
+
...l,
|
|
31
|
+
count: a.Int,
|
|
32
|
+
bytes: a.Int
|
|
33
|
+
}), d = a.Struct({
|
|
34
|
+
url: a.String,
|
|
35
|
+
path: a.String,
|
|
36
|
+
routeId: a.String,
|
|
37
|
+
artifactId: a.String,
|
|
38
|
+
presentation: a.Struct({
|
|
39
|
+
version: a.Literal(1),
|
|
40
|
+
decided: a.Boolean,
|
|
41
|
+
granted: a.Array(a.Struct({
|
|
42
|
+
id: a.String,
|
|
43
|
+
version: a.Int
|
|
44
|
+
}))
|
|
45
|
+
})
|
|
46
|
+
}), f = (t, a, c, l, u, d) => n(s, t, a, c, o(l, s.namespace + "." + t, !0), u, (t, n) => {
|
|
47
|
+
let a = e(n, s.credentialError);
|
|
48
|
+
return i.tryPromise({
|
|
49
|
+
try: () => d(t, a),
|
|
50
|
+
catch: () => new r({ reason: "render" })
|
|
51
|
+
});
|
|
52
|
+
}), p = (e) => {
|
|
53
|
+
let n = [
|
|
54
|
+
f("begin", "Begin a private captured document assembly", "Render-read bearer. The server freshly verifies the same snapshot, scope, app, consumer, build, host and stored signed path sets. Creates immutable private metadata only; no credentials are persisted. A journal ID grants no activation or serving authority.", c, u, (t, n) => e.begin({
|
|
55
|
+
...t,
|
|
56
|
+
token: n
|
|
57
|
+
})),
|
|
58
|
+
f("append", "Append one bounded immutable group of rendered document pins", "Render-read bearer. At most 8 KiB of document pins per part and 100000 documents/64 MiB metadata per branch. Original route identities and captured consent classes must match current admitted signed paths. Repeating the same append is idempotent; immutable branches are independent. No provider path or credential in the body.", a.Struct({
|
|
59
|
+
...c.fields,
|
|
60
|
+
...l,
|
|
61
|
+
documents: a.Array(d)
|
|
62
|
+
}), u, (t, n) => e.append({
|
|
63
|
+
...t,
|
|
64
|
+
token: n
|
|
65
|
+
})),
|
|
66
|
+
f("seal", "Compose complete captured documents from actual private renderer output", "Render-read bearer. Reopens the complete immutable chain, verifies actual renderer receipts and all document bytes through EOF in server-selected custody, requires complete signed route and public consent-class coverage, and rechecks current rights and authority after I/O. Partial, mismatched or expired branches refuse. Returned private artifact IDs grant no activation or serving permission.", a.Struct({
|
|
67
|
+
...c.fields,
|
|
68
|
+
...l
|
|
69
|
+
}), a.Struct({
|
|
70
|
+
artifactId: a.String,
|
|
71
|
+
documents: a.Int,
|
|
72
|
+
bytes: a.Int
|
|
73
|
+
}), (t, n) => e.seal({
|
|
74
|
+
...t,
|
|
75
|
+
token: n
|
|
76
|
+
}))
|
|
77
|
+
];
|
|
78
|
+
return {
|
|
79
|
+
routes: n,
|
|
80
|
+
httpRoutes: t(n)
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { p as cmsDocumentAssemblyRest };
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { richDocumentProblems as e } from "./richDocument.js";
|
|
2
|
+
import { documentHasChanges as t } from "./trackChanges.js";
|
|
3
|
+
import { readCapturedPublication as n } from "./publicationState.js";
|
|
4
|
+
import { readVerifiedSnapshotResource as r } from "./buildSnapshot.js";
|
|
5
|
+
import { admitSnapshotPresentation as i, copySnapshotPresentationValue as a } from "./snapshotPresentation.js";
|
|
6
|
+
import { projectContentValues as o } from "./contentProjection.js";
|
|
7
|
+
import { readCapturedSnapshotConsentPurposes as s } from "./snapshotPresentationPolicy.js";
|
|
8
|
+
import { SnapshotRouteReadUnavailable as c } from "./snapshotRouteAdmission.js";
|
|
9
|
+
import { createHash as l } from "node:crypto";
|
|
10
|
+
import { canonicalJson as u } from "@voltro/runtime";
|
|
11
|
+
//#region src/snapshotDocumentProjection.ts
|
|
12
|
+
var d = (e) => {
|
|
13
|
+
throw new c({ reason: e });
|
|
14
|
+
}, f = (e) => l("sha256").update(u(e)).digest("hex"), p = (e) => typeof e != "object" || !e || Array.isArray(e) ? d("definition") : e, m = (e) => typeof e == "string" && e.length > 0, h = (e, t) => Object.fromEntries(t.filter((t) => Object.hasOwn(e, t)).map((t) => [t, e[t]])), g = {
|
|
15
|
+
paragraph: [
|
|
16
|
+
"id",
|
|
17
|
+
"type",
|
|
18
|
+
"style"
|
|
19
|
+
],
|
|
20
|
+
heading: [
|
|
21
|
+
"id",
|
|
22
|
+
"type",
|
|
23
|
+
"style",
|
|
24
|
+
"level"
|
|
25
|
+
],
|
|
26
|
+
list: [
|
|
27
|
+
"id",
|
|
28
|
+
"type",
|
|
29
|
+
"style",
|
|
30
|
+
"ordered",
|
|
31
|
+
"levels",
|
|
32
|
+
"sublists"
|
|
33
|
+
],
|
|
34
|
+
table: [
|
|
35
|
+
"id",
|
|
36
|
+
"type",
|
|
37
|
+
"header"
|
|
38
|
+
],
|
|
39
|
+
image: [
|
|
40
|
+
"id",
|
|
41
|
+
"type",
|
|
42
|
+
"asset",
|
|
43
|
+
"caption"
|
|
44
|
+
],
|
|
45
|
+
file: [
|
|
46
|
+
"id",
|
|
47
|
+
"type",
|
|
48
|
+
"asset",
|
|
49
|
+
"label"
|
|
50
|
+
],
|
|
51
|
+
component: [
|
|
52
|
+
"id",
|
|
53
|
+
"type",
|
|
54
|
+
"componentId",
|
|
55
|
+
"fingerprint"
|
|
56
|
+
]
|
|
57
|
+
}, _ = async (c, l, _, v, y, b, x, S) => {
|
|
58
|
+
let C = a(S), w = i(await s(c, l, _, b.app), C), T = (await r(c, l, _, "projection", `type:${String(v)}`)).value;
|
|
59
|
+
if (T.version !== 1 || T.contentType !== v || T.schemaDigest !== f(b) || u(T.app) !== u(b.app)) return d("binding");
|
|
60
|
+
if (T.definition === null) return d("projection");
|
|
61
|
+
let E = await n(c, l, _.manifest.publication.id, String(v), y.locale, y.variantId, x);
|
|
62
|
+
if (E === null || E.status !== "published" || E.revisionId !== y.revisionId) return d("publication");
|
|
63
|
+
let D = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new Map(), A = (e, t, n) => (O.set(e, {
|
|
64
|
+
id: t,
|
|
65
|
+
digest: n
|
|
66
|
+
}), e), j = 0, M = (e) => {
|
|
67
|
+
if (++j > 1e5 || e > 64) return d("bounds");
|
|
68
|
+
}, N = async (e, t, n) => {
|
|
69
|
+
M(n);
|
|
70
|
+
let r = p(t), i = {};
|
|
71
|
+
for (let [t, a] of Object.entries(p(e))) Object.hasOwn(r, t) && Object.defineProperty(i, t, {
|
|
72
|
+
value: await F(p(a), r[t], n + 1),
|
|
73
|
+
enumerable: !0
|
|
74
|
+
});
|
|
75
|
+
return i;
|
|
76
|
+
}, P = async (e, t, n) => {
|
|
77
|
+
M(n);
|
|
78
|
+
let i = p(t);
|
|
79
|
+
if (!Array.isArray(e) || !m(i.componentId)) return d("definition");
|
|
80
|
+
let a = e.map(p).find((e) => e.id === i.componentId);
|
|
81
|
+
if (a === void 0 || !m(a.digest)) return d("definition");
|
|
82
|
+
let o = D.get(String(a.id));
|
|
83
|
+
if (o === void 0) {
|
|
84
|
+
let e = (await r(c, l, _, "components", `component:${String(a.id)}`)).value;
|
|
85
|
+
if (f(e) !== a.digest || u(e.app) !== u(b.app)) return d("binding");
|
|
86
|
+
o = {
|
|
87
|
+
definition: p(e.definition),
|
|
88
|
+
digest: f(e)
|
|
89
|
+
}, D.set(String(a.id), o);
|
|
90
|
+
}
|
|
91
|
+
let s = o.definition;
|
|
92
|
+
if (o.digest !== a.digest || s.id !== i.componentId || s.fingerprint !== i.fingerprint) return d("binding");
|
|
93
|
+
if (s.consent !== void 0) {
|
|
94
|
+
if (!m(s.consent)) return d("definition");
|
|
95
|
+
if (!w.granted.some((e) => e.id === s.consent)) return A({
|
|
96
|
+
...i.type === "component" ? {
|
|
97
|
+
type: "component",
|
|
98
|
+
id: i.id
|
|
99
|
+
} : { instanceId: i.instanceId },
|
|
100
|
+
componentId: i.componentId,
|
|
101
|
+
fingerprint: i.fingerprint,
|
|
102
|
+
consentRequired: s.consent,
|
|
103
|
+
props: {}
|
|
104
|
+
}, String(a.id), o.digest);
|
|
105
|
+
}
|
|
106
|
+
return A({
|
|
107
|
+
...h(i, i.type === "component" ? g.component : [
|
|
108
|
+
"instanceId",
|
|
109
|
+
"componentId",
|
|
110
|
+
"fingerprint"
|
|
111
|
+
]),
|
|
112
|
+
props: await N(s.props, i.props, n + 1)
|
|
113
|
+
}, String(a.id), o.digest);
|
|
114
|
+
}, F = async (n, r, i) => {
|
|
115
|
+
if (M(i), r == null) return r;
|
|
116
|
+
switch (n.kind) {
|
|
117
|
+
case "array": {
|
|
118
|
+
if (!Array.isArray(r)) return d("publication");
|
|
119
|
+
let e = [];
|
|
120
|
+
for (let t of r) e.push(await F(p(n.element), t, i + 1));
|
|
121
|
+
return e;
|
|
122
|
+
}
|
|
123
|
+
case "struct": return N(n.struct, r, i + 1);
|
|
124
|
+
case "components": {
|
|
125
|
+
if (!Array.isArray(r)) return d("publication");
|
|
126
|
+
let e = [];
|
|
127
|
+
for (let t of r) e.push(await P(n.components, t, i + 1));
|
|
128
|
+
return e;
|
|
129
|
+
}
|
|
130
|
+
case "richText": {
|
|
131
|
+
let a = p(r);
|
|
132
|
+
if (a.type !== "doc" || !Array.isArray(a.blocks)) return d("publication");
|
|
133
|
+
let o = n.richText === void 0 ? {} : p(n.richText), s = o.profile === void 0 ? {} : p(o.profile);
|
|
134
|
+
if (s.id !== void 0 && a.profile !== s.id) return d("binding");
|
|
135
|
+
if (e("", a, o).length > 0 || t(a)) return d("publication");
|
|
136
|
+
let c = (e) => Array.isArray(e) ? e.map((e) => {
|
|
137
|
+
M(i + 1);
|
|
138
|
+
let t = p(e);
|
|
139
|
+
if (t.type === "text") return h(t, [
|
|
140
|
+
"type",
|
|
141
|
+
"text",
|
|
142
|
+
"marks",
|
|
143
|
+
"style"
|
|
144
|
+
]);
|
|
145
|
+
if (t.type === "link") return h(t, [
|
|
146
|
+
"type",
|
|
147
|
+
"text",
|
|
148
|
+
"target"
|
|
149
|
+
]);
|
|
150
|
+
if (t.type !== "contact") return d("publication");
|
|
151
|
+
let n = p(t.contact);
|
|
152
|
+
return {
|
|
153
|
+
...h(t, ["type", "text"]),
|
|
154
|
+
contact: h(n, Object.hasOwn(n, "target") ? ["target"] : ["channel", "value"])
|
|
155
|
+
};
|
|
156
|
+
}) : d("publication"), l = [];
|
|
157
|
+
for (let e of a.blocks) {
|
|
158
|
+
M(i + 1);
|
|
159
|
+
let t = p(e), n = t.type;
|
|
160
|
+
if (!Object.hasOwn(g, n)) return d("publication");
|
|
161
|
+
if (n === "component") {
|
|
162
|
+
l.push(await P(s.components, t, i + 1));
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
let r = h(t, g[n]);
|
|
166
|
+
if ((n === "paragraph" || n === "heading") && (r.content = c(t.content)), n === "list") {
|
|
167
|
+
if (!Array.isArray(t.items)) return d("publication");
|
|
168
|
+
r.items = t.items.map(c);
|
|
169
|
+
}
|
|
170
|
+
if (n === "table") {
|
|
171
|
+
if (!Array.isArray(t.rows)) return d("publication");
|
|
172
|
+
r.rows = t.rows.map((e) => Array.isArray(e) ? e.map(c) : d("publication"));
|
|
173
|
+
}
|
|
174
|
+
l.push(r);
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
...h(a, ["type", "profile"]),
|
|
178
|
+
blocks: l
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
case "string":
|
|
182
|
+
case "number":
|
|
183
|
+
case "boolean":
|
|
184
|
+
case "date":
|
|
185
|
+
case "datetime":
|
|
186
|
+
case "literal":
|
|
187
|
+
case "reference":
|
|
188
|
+
case "media": return r;
|
|
189
|
+
default: return d("definition");
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
return {
|
|
193
|
+
values: o(T.definition, await N(p(b.definition).fields, E, 0), (e) => {
|
|
194
|
+
let t = O.get(e);
|
|
195
|
+
t !== void 0 && k.set(t.id, t);
|
|
196
|
+
}),
|
|
197
|
+
components: [...k.values()].sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)),
|
|
198
|
+
presentation: w
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
//#endregion
|
|
202
|
+
export { _ as projectSnapshotDocument };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SnapshotSeoReadUnavailable as e } from "./snapshotSeoRead.js";
|
|
2
|
+
import { copySnapshotSeoDocumentsSelection as t } from "./snapshotSeoPathSets.js";
|
|
3
|
+
import { readSnapshotSeoDocuments as n } from "./snapshotSeoDocuments.js";
|
|
4
|
+
import { createSnapshotOutputTransfer as r } from "./snapshotOutputTransfer.js";
|
|
5
|
+
import { canonicalJson as i } from "@voltro/protocol";
|
|
6
|
+
//#region src/snapshotDocumentTransfer.ts
|
|
7
|
+
var a = () => {
|
|
8
|
+
throw new e({ reason: "binding" });
|
|
9
|
+
}, o = (e) => {
|
|
10
|
+
let { store: o, provider: s } = e, c = { ...e.scope }, l = { ...e.use }, u = e.keys.map((e) => ({
|
|
11
|
+
id: e.id,
|
|
12
|
+
material: new Uint8Array(e.material)
|
|
13
|
+
})), d = e.now ?? Date.now, f = s.read?.bind(s);
|
|
14
|
+
return r(s, async (e, r) => {
|
|
15
|
+
let p = {
|
|
16
|
+
snapshot: { ...e.snapshot },
|
|
17
|
+
token: e.token,
|
|
18
|
+
consumerId: e.consumerId,
|
|
19
|
+
buildId: e.buildId,
|
|
20
|
+
host: e.host
|
|
21
|
+
}, m = t(e.documents), h = e.id;
|
|
22
|
+
if (h !== m.artifactId || f === void 0) return a();
|
|
23
|
+
let g = () => o.transactional((e) => n(e, c, p, m, {
|
|
24
|
+
provider: s,
|
|
25
|
+
use: l,
|
|
26
|
+
keys: u,
|
|
27
|
+
now: d
|
|
28
|
+
})), _ = await g(), v = await f(h);
|
|
29
|
+
if (v.id !== h) return a();
|
|
30
|
+
let y = await r(structuredClone(v)), b = await g();
|
|
31
|
+
return i(b.inventory) !== i(_.inventory) || i(b.paths.selection) !== i(_.paths.selection) || i(b.paths.admission.context) !== i(_.paths.admission.context) ? a() : y;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { o as createSnapshotDocumentTransfer };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { cmsCredential as e, privateCmsHttpRoutes as t, privateCmsOperation as n } from "./privateCmsTransport.js";
|
|
2
|
+
import { CmsBuildSnapshotUnavailable as r } from "./buildSnapshotService.js";
|
|
3
|
+
import { Effect as i, Schema as a } from "effect";
|
|
4
|
+
import { strictInput as o } from "@voltro/protocol";
|
|
5
|
+
//#region src/snapshotDocumentTransferRest.ts
|
|
6
|
+
var s = (s) => {
|
|
7
|
+
let c = {
|
|
8
|
+
namespace: "cms.documentTransfer",
|
|
9
|
+
path: "/v1/cms/document-transfer",
|
|
10
|
+
operationPrefix: "cmsDocumentTransfer",
|
|
11
|
+
tags: ["CMS private document transfer"],
|
|
12
|
+
error: r,
|
|
13
|
+
errorStatus: { CmsBuildSnapshotUnavailable: 409 },
|
|
14
|
+
credentialError: "CmsBuildSnapshotUnavailable"
|
|
15
|
+
}, l = a.Struct({
|
|
16
|
+
path: a.String,
|
|
17
|
+
digest: a.String,
|
|
18
|
+
size: a.Int,
|
|
19
|
+
contentType: a.String
|
|
20
|
+
}), u = a.Struct({
|
|
21
|
+
offset: a.Int,
|
|
22
|
+
size: a.Int,
|
|
23
|
+
digest: a.String
|
|
24
|
+
}), d = a.Struct({
|
|
25
|
+
snapshot: a.Struct({
|
|
26
|
+
id: a.String,
|
|
27
|
+
digest: a.String
|
|
28
|
+
}),
|
|
29
|
+
consumerId: a.String,
|
|
30
|
+
buildId: a.String,
|
|
31
|
+
host: a.String,
|
|
32
|
+
id: a.String,
|
|
33
|
+
documents: a.Struct({
|
|
34
|
+
artifactId: a.String,
|
|
35
|
+
pathSets: a.Array(a.Struct({
|
|
36
|
+
id: a.String,
|
|
37
|
+
digest: a.String
|
|
38
|
+
}))
|
|
39
|
+
})
|
|
40
|
+
}), f = "Render-read bearer; complete signed paths, original document receipts, current media rights and grant are admitted before and after every provider read. Only the exact selected document role is available. Metadata and bytes are private; they grant no activation or serving authority. No hidden renewal or retry.", p = (e) => i.tryPromise({
|
|
41
|
+
try: e,
|
|
42
|
+
catch: () => new r({ reason: "render" })
|
|
43
|
+
}), m = [
|
|
44
|
+
n(c, "manifest", "Read private admitted document manifest", f, o(d, c.namespace + ".manifest", !0), a.Struct({
|
|
45
|
+
id: a.String,
|
|
46
|
+
manifest: a.Struct({
|
|
47
|
+
version: a.Literal(1),
|
|
48
|
+
subject: a.Record(a.String, a.Unknown),
|
|
49
|
+
files: a.Array(l)
|
|
50
|
+
})
|
|
51
|
+
}), (t, n) => p(() => s.read({
|
|
52
|
+
...t,
|
|
53
|
+
token: e(n, c.credentialError)
|
|
54
|
+
}))),
|
|
55
|
+
n(c, "file", "Plan bounded private document file chunks", f, o(a.Struct({
|
|
56
|
+
...d.fields,
|
|
57
|
+
path: a.String
|
|
58
|
+
}), c.namespace + ".file", !0), a.Struct({
|
|
59
|
+
file: l,
|
|
60
|
+
chunks: a.Array(u)
|
|
61
|
+
}), (t, n) => p(() => s.planFile({
|
|
62
|
+
...t,
|
|
63
|
+
token: e(n, c.credentialError)
|
|
64
|
+
}))),
|
|
65
|
+
n(c, "chunk", "Read a verified private document file chunk", f, o(a.Struct({
|
|
66
|
+
...d.fields,
|
|
67
|
+
file: l,
|
|
68
|
+
chunk: u
|
|
69
|
+
}), c.namespace + ".chunk", !0), a.Struct({ base64: a.String }), (t, n) => p(async () => ({ base64: Buffer.from(await s.readChunk({
|
|
70
|
+
...t,
|
|
71
|
+
token: e(n, c.credentialError)
|
|
72
|
+
})).toString("base64") })))
|
|
73
|
+
];
|
|
74
|
+
return {
|
|
75
|
+
routes: m,
|
|
76
|
+
httpRoutes: t(m)
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { s as cmsSnapshotDocumentTransferRest };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { SiteStateUnavailable as e } from "./errors.js";
|
|
2
|
+
import { copySiteScope as t, lockSiteState as n, siteStatePredicate as r } from "./siteState.js";
|
|
3
|
+
import { normalizeHost as i } from "./domainHost.js";
|
|
4
|
+
import { verifyPublicationState as a } from "./publicationState.js";
|
|
5
|
+
import { copySnapshotResource as o } from "./buildSnapshot.js";
|
|
6
|
+
import { CMS_SITE_DOMAINS_TABLE as s } from "./domains.js";
|
|
7
|
+
import { and as c, eq as l, gt as u } from "@voltro/database";
|
|
8
|
+
//#region src/snapshotDomains.ts
|
|
9
|
+
var d = async (d, f, p = Date.now()) => {
|
|
10
|
+
let m = {
|
|
11
|
+
...t(f),
|
|
12
|
+
environment: f.environment
|
|
13
|
+
};
|
|
14
|
+
return await n(d, m), {
|
|
15
|
+
format: "voltro.cms.domains/v1",
|
|
16
|
+
entries: async function* (t) {
|
|
17
|
+
await a(d, m, t, p);
|
|
18
|
+
let n, f = !1;
|
|
19
|
+
for (;;) {
|
|
20
|
+
let t = await d.query({
|
|
21
|
+
table: s,
|
|
22
|
+
predicate: c(r(m), l("status", "verified"), ...n === void 0 ? [] : [u("id", n)]),
|
|
23
|
+
lock: "update",
|
|
24
|
+
order: [{
|
|
25
|
+
column: "id",
|
|
26
|
+
direction: "asc"
|
|
27
|
+
}],
|
|
28
|
+
take: 500,
|
|
29
|
+
skip: void 0,
|
|
30
|
+
projection: [
|
|
31
|
+
"id",
|
|
32
|
+
"host",
|
|
33
|
+
"isPrimary"
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
if (t.length === 0) break;
|
|
37
|
+
for (let n of t) {
|
|
38
|
+
if (typeof n.id != "string" || n.id === "" || typeof n.host != "string" || i(n.host) !== n.host || typeof n.isPrimary != "boolean" || f && n.isPrimary) throw new e({ reason: "state" });
|
|
39
|
+
f ||= n.isPrimary, yield o({
|
|
40
|
+
key: n.host,
|
|
41
|
+
value: {
|
|
42
|
+
version: 1,
|
|
43
|
+
tenantId: m.tenantId,
|
|
44
|
+
site: m.site,
|
|
45
|
+
host: n.host,
|
|
46
|
+
primary: n.isPrimary
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
n = String(t[t.length - 1].id);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { d as snapshotDomainSource };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { verifyPublicationState as e } from "./publicationState.js";
|
|
2
|
+
import { copySnapshotResource as t } from "./buildSnapshot.js";
|
|
3
|
+
import { lockEnvironmentAlias as n } from "./environmentAliases.js";
|
|
4
|
+
//#region src/snapshotEnvironment.ts
|
|
5
|
+
var r = async (r, i, a, o, s = Date.now()) => {
|
|
6
|
+
let c = {
|
|
7
|
+
tenantId: i.tenantId,
|
|
8
|
+
site: i.site
|
|
9
|
+
}, l = await n(r, c, a, o), u = {
|
|
10
|
+
...c,
|
|
11
|
+
environment: l.environment
|
|
12
|
+
}, d = t({
|
|
13
|
+
key: "environment",
|
|
14
|
+
value: {
|
|
15
|
+
version: 1,
|
|
16
|
+
alias: { ...l },
|
|
17
|
+
target: { ...u }
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
scope: { ...u },
|
|
22
|
+
source: {
|
|
23
|
+
format: "voltro.cms.environment/v1",
|
|
24
|
+
entries: async function* (t) {
|
|
25
|
+
await e(r, u, t, s), yield d;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { r as snapshotEnvironmentSource };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { readCapturedPublication as e } from "./publicationState.js";
|
|
2
|
+
import { pageSnapshotResources as t, readVerifiedSnapshotResource as n } from "./buildSnapshot.js";
|
|
3
|
+
import { copySnapshotRenditionRequirements as r } from "./snapshotRenditions.js";
|
|
4
|
+
import { SnapshotMediaUnavailable as i, compileSnapshotMediaFields as a } from "./snapshotMediaFields.js";
|
|
5
|
+
import { canonicalJson as o } from "@voltro/runtime";
|
|
6
|
+
//#region src/snapshotFieldPlan.ts
|
|
7
|
+
var s = (e) => {
|
|
8
|
+
throw new i({ reason: e });
|
|
9
|
+
}, c = async (i, c, l, u) => {
|
|
10
|
+
let { snapshot: d, document: f, output: p } = l, m = async (e) => {
|
|
11
|
+
let n = [], r;
|
|
12
|
+
for (;;) {
|
|
13
|
+
let a = await t(i, c, d.id, e, {
|
|
14
|
+
now: u,
|
|
15
|
+
limit: 200,
|
|
16
|
+
...r === void 0 ? {} : { after: r }
|
|
17
|
+
});
|
|
18
|
+
if (n.push(...a.items), n.length > 8192) return s("bounds");
|
|
19
|
+
if (a.next === null) return n;
|
|
20
|
+
r = a.next;
|
|
21
|
+
}
|
|
22
|
+
}, h = a(await m("schema"), await m("components")), g = h.find((e) => e.name === p.contentType), _ = await e(i, c, d.manifest.publication.id, p.contentType, p.sourceLocale, String(f.variantId), u);
|
|
23
|
+
if (g === void 0 || _ === null || _.documentId !== f.documentId || _.revisionId !== f.revisionId || _.revision !== f.revision) return s("publication");
|
|
24
|
+
let v = (await n(i, c, d, "assets", "configuration")).value, y = r(v.renditionRequirements), b = [], x = [], S = (e) => {
|
|
25
|
+
let t = p.values;
|
|
26
|
+
for (let n of e) {
|
|
27
|
+
if (typeof t != "object" || !t || !Object.hasOwn(t, n) || (Array.isArray(t) ? typeof n != "number" : typeof n != "string")) {
|
|
28
|
+
t = void 0;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
t = t[n];
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}, C = [];
|
|
35
|
+
for (let e of g.dependencies(_)) {
|
|
36
|
+
let t = S(e.path);
|
|
37
|
+
if (t !== void 0) {
|
|
38
|
+
if (e.kind === "component") {
|
|
39
|
+
if (typeof t != "object" || !t || Array.isArray(t)) return s("publication");
|
|
40
|
+
if (t.componentId !== e.componentId) continue;
|
|
41
|
+
} else if (e.kind === "token" && t !== e.name) return s("publication");
|
|
42
|
+
if (C.push(e), C.length > 8192) return s("bounds");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (let e of g.uses(_)) {
|
|
46
|
+
let t = S(e.path);
|
|
47
|
+
if (t === void 0) continue;
|
|
48
|
+
if (t !== ("mediaKey" in e ? e.mediaKey : e.targetDocumentId)) return s("publication");
|
|
49
|
+
if ("targetType" in e && (x.push(e), x.length > 8192)) return s("bounds");
|
|
50
|
+
let n = "targetType" in e ? h.find((t) => t.name === e.targetType) : e.path.length === 1 && g.definition.asset?.file === e.path[0] ? g : void 0;
|
|
51
|
+
if (!("targetType" in e && n?.definition.asset === void 0)) {
|
|
52
|
+
if (b.push({
|
|
53
|
+
fieldPath: [...e.path],
|
|
54
|
+
output: { kind: "original" }
|
|
55
|
+
}), n !== void 0) for (let t of y.filter((e) => e.contentType === n.name)) b.push({
|
|
56
|
+
fieldPath: [...e.path],
|
|
57
|
+
output: {
|
|
58
|
+
kind: "rendition",
|
|
59
|
+
slot: t.slot
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
if (b.length > 1024) return s("bounds");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
let w = (e) => e.map((e) => ({
|
|
66
|
+
value: e,
|
|
67
|
+
key: o(e)
|
|
68
|
+
})).sort((e, t) => e.key < t.key ? -1 : +(e.key > t.key)).map((e) => e.value);
|
|
69
|
+
return {
|
|
70
|
+
references: w(x),
|
|
71
|
+
media: w(b),
|
|
72
|
+
dependencies: w(C),
|
|
73
|
+
content: {
|
|
74
|
+
contentType: p.contentType,
|
|
75
|
+
documentId: String(f.documentId),
|
|
76
|
+
variantId: String(f.variantId),
|
|
77
|
+
revisionId: String(f.revisionId),
|
|
78
|
+
revision: Number(f.revision),
|
|
79
|
+
sourceLocale: p.sourceLocale,
|
|
80
|
+
definitionDigest: g.digest
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { c as readAdmittedSnapshotFieldPlan };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { copySnapshotResource as e, readVerifiedSnapshotResource as t } from "./buildSnapshot.js";
|
|
2
|
+
import { snapshotComponentDefinition as n, snapshotDefinitionSources as r } from "./snapshotDefinitions.js";
|
|
3
|
+
import { FrontendBindingUnavailable as i, copyFrontendContexts as a, copyFrontendOutputSelection as o, defineFrontendBindings as s, frontendRendererId as c, supportsFrontendContext as l } from "./frontendBindings.js";
|
|
4
|
+
import { createHash as u } from "node:crypto";
|
|
5
|
+
import { canonicalJson as d } from "@voltro/runtime";
|
|
6
|
+
//#region src/snapshotFrontend.ts
|
|
7
|
+
var f = (e) => u("sha256").update(d(e)).digest("hex"), p = (e, t, n) => ({
|
|
8
|
+
kind: "app-implementation",
|
|
9
|
+
app: e,
|
|
10
|
+
path: [
|
|
11
|
+
"frontend",
|
|
12
|
+
t,
|
|
13
|
+
n
|
|
14
|
+
]
|
|
15
|
+
}), m = (e, t) => ({
|
|
16
|
+
empty: p(e, t, "empty"),
|
|
17
|
+
loading: p(e, t, "loading"),
|
|
18
|
+
error: p(e, t, "error")
|
|
19
|
+
}), h = (e, t, a, c) => {
|
|
20
|
+
let l = s(t), u = new Map([...r(e, a).components.entries()].map((e) => [e.key, e.value]));
|
|
21
|
+
return {
|
|
22
|
+
version: 2,
|
|
23
|
+
output: o(c),
|
|
24
|
+
components: Object.entries(l).map(([e, t]) => {
|
|
25
|
+
let r = u.get(`component:${e}`);
|
|
26
|
+
if (r === void 0 || d(n(t.schema, a).value) !== d(r)) throw new i({ reason: "schema" });
|
|
27
|
+
return {
|
|
28
|
+
id: e,
|
|
29
|
+
digest: f(r),
|
|
30
|
+
renderer: t.renderer,
|
|
31
|
+
contexts: t.contexts,
|
|
32
|
+
...m(a, e),
|
|
33
|
+
render: p(a, e, "render"),
|
|
34
|
+
restricted: t.restricted === void 0 ? null : p(a, e, "restricted")
|
|
35
|
+
};
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
}, g = () => {
|
|
39
|
+
throw new i({ reason: "definition" });
|
|
40
|
+
}, _ = (t) => {
|
|
41
|
+
if (typeof t != "object" || !t || Array.isArray(t)) return g();
|
|
42
|
+
let n = e({
|
|
43
|
+
key: "frontend",
|
|
44
|
+
value: t
|
|
45
|
+
}).value;
|
|
46
|
+
return n.version !== 2 || !Array.isArray(n.components) || n.components.length > 4096 ? g() : n;
|
|
47
|
+
}, v = (e, t, n) => {
|
|
48
|
+
let r = o(e.output), i = [], s = /* @__PURE__ */ new Set();
|
|
49
|
+
for (let r of e.components) {
|
|
50
|
+
if (typeof r != "object" || !r || Array.isArray(r)) return g();
|
|
51
|
+
let e = r;
|
|
52
|
+
if (typeof e.id != "string" || !/^[a-z][a-zA-Z0-9]*$/.test(e.id) || s.has(e.id) || !c(e.renderer)) return g();
|
|
53
|
+
s.add(e.id);
|
|
54
|
+
let o = n.get(e.id);
|
|
55
|
+
if (o === void 0) return g();
|
|
56
|
+
let l = o.definition;
|
|
57
|
+
if (l.id !== e.id || d(o.app) !== d(t) || l.consent !== void 0 && e.restricted === null) return g();
|
|
58
|
+
let u = a(e.contexts);
|
|
59
|
+
i.push({
|
|
60
|
+
id: e.id,
|
|
61
|
+
digest: f(o),
|
|
62
|
+
renderer: e.renderer,
|
|
63
|
+
contexts: u,
|
|
64
|
+
...m(t, e.id),
|
|
65
|
+
render: p(t, e.id, "render"),
|
|
66
|
+
restricted: e.restricted === null ? null : p(t, e.id, "restricted")
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
i.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id));
|
|
70
|
+
let l = {
|
|
71
|
+
version: 2,
|
|
72
|
+
output: r,
|
|
73
|
+
components: i
|
|
74
|
+
};
|
|
75
|
+
return d(e) === d(l) ? l : g();
|
|
76
|
+
}, y = (e, t, n, i) => {
|
|
77
|
+
let a = new Map([...r(e, n).components.entries()].filter((e) => e.key.startsWith("component:")).map((e) => [e.key.slice(10), e.value])), s = v(_(t), n, a);
|
|
78
|
+
return d(s.output) === d(o(i)) ? s : g();
|
|
79
|
+
}, b = async (e, n, r, i, a) => {
|
|
80
|
+
let o;
|
|
81
|
+
try {
|
|
82
|
+
o = _(i);
|
|
83
|
+
} catch {
|
|
84
|
+
return !1;
|
|
85
|
+
}
|
|
86
|
+
let s = /* @__PURE__ */ new Map();
|
|
87
|
+
for (let i of o.components) {
|
|
88
|
+
if (typeof i != "object" || !i || Array.isArray(i)) return !1;
|
|
89
|
+
let a = i.id;
|
|
90
|
+
if (typeof a != "string" || !/^[a-z][a-zA-Z0-9]*$/.test(a) || s.has(a)) return !1;
|
|
91
|
+
s.set(a, (await t(e, n, r, "components", `component:${a}`)).value);
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
return v(o, a, s), !0;
|
|
95
|
+
} catch {
|
|
96
|
+
return !1;
|
|
97
|
+
}
|
|
98
|
+
}, x = (e, t, n) => {
|
|
99
|
+
let r = e;
|
|
100
|
+
return t.every((e) => r.components.some((t) => t.id === e.id && t.digest === e.digest && (n === void 0 || l(t.contexts, n))));
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { x as coversSnapshotComponents, b as matchesSnapshotFrontend, y as snapshotFrontendFromManifest, h as snapshotFrontendManifest };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/snapshotLink.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
let n = Object.getOwnPropertyDescriptor(e, Symbol.for("voltro.cms.snapshot.link/v1"));
|
|
4
|
+
if (n === void 0 || n.enumerable || n.writable || typeof n.value != "function") throw Error("Snapshot link unavailable");
|
|
5
|
+
return n.value(t);
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as snapshotLink };
|