@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,401 @@
|
|
|
1
|
+
import { capturePublicationState as e, verifyPublicationState as t } from "./publicationState.js";
|
|
2
|
+
import { Schema as n } from "effect";
|
|
3
|
+
import { and as r, eq as i, gt as a, id as o, inSet as s, integer as c, json as l, or as u, table as d, text as f, timestamp as p } from "@voltro/database";
|
|
4
|
+
import { tenant as m } from "@voltro/plugin-multitenancy/mixin";
|
|
5
|
+
import { createHash as h } from "node:crypto";
|
|
6
|
+
import { canonicalJson as g } from "@voltro/runtime";
|
|
7
|
+
//#region src/buildSnapshot.ts
|
|
8
|
+
var _ = [
|
|
9
|
+
"release",
|
|
10
|
+
"environment",
|
|
11
|
+
"site",
|
|
12
|
+
"domains",
|
|
13
|
+
"locales",
|
|
14
|
+
"routes",
|
|
15
|
+
"schema",
|
|
16
|
+
"components",
|
|
17
|
+
"assets",
|
|
18
|
+
"redirects",
|
|
19
|
+
"seo",
|
|
20
|
+
"policies",
|
|
21
|
+
"projection",
|
|
22
|
+
"app"
|
|
23
|
+
], v = /* @__PURE__ */ new Set([
|
|
24
|
+
"release",
|
|
25
|
+
"environment",
|
|
26
|
+
"site",
|
|
27
|
+
"locales",
|
|
28
|
+
"schema",
|
|
29
|
+
"components",
|
|
30
|
+
"seo",
|
|
31
|
+
"policies",
|
|
32
|
+
"projection",
|
|
33
|
+
"app"
|
|
34
|
+
]), y = class extends n.TaggedError()("BuildSnapshotUnavailable", { reason: n.Literals([
|
|
35
|
+
"scope",
|
|
36
|
+
"parts",
|
|
37
|
+
"resource",
|
|
38
|
+
"duplicate",
|
|
39
|
+
"bounds",
|
|
40
|
+
"snapshot",
|
|
41
|
+
"expired",
|
|
42
|
+
"cursor"
|
|
43
|
+
]) }) {}, b = "_voltro_cms_build_snapshots", x = "_voltro_cms_snapshot_resources", S = d(b, {
|
|
44
|
+
id: o({ prefix: "bsnap" }),
|
|
45
|
+
site: f().maxLength(64),
|
|
46
|
+
environment: f().maxLength(64),
|
|
47
|
+
state: f().oneOf(["capturing", "sealed"]),
|
|
48
|
+
publicationStateId: f().maxLength(64),
|
|
49
|
+
manifest: l().nullable(),
|
|
50
|
+
digest: f().maxLength(64).nullable(),
|
|
51
|
+
capturedAt: p(),
|
|
52
|
+
expiresAt: p()
|
|
53
|
+
}).with(m()), C = d(x, {
|
|
54
|
+
id: o({ prefix: "bsres" }),
|
|
55
|
+
snapshotId: f().maxLength(64),
|
|
56
|
+
site: f().maxLength(64),
|
|
57
|
+
environment: f().maxLength(64),
|
|
58
|
+
part: f().maxLength(32),
|
|
59
|
+
ordinal: c(),
|
|
60
|
+
key: f().maxLength(256),
|
|
61
|
+
keyDigest: f().maxLength(64),
|
|
62
|
+
value: l(),
|
|
63
|
+
digest: f().maxLength(64)
|
|
64
|
+
}).with(m()).index("cms_snapshot_resources_page", [
|
|
65
|
+
"tenantId",
|
|
66
|
+
"snapshotId",
|
|
67
|
+
"part",
|
|
68
|
+
"ordinal"
|
|
69
|
+
]).unique("cms_snapshot_resources_key", [
|
|
70
|
+
"tenantId",
|
|
71
|
+
"snapshotId",
|
|
72
|
+
"part",
|
|
73
|
+
"keyDigest"
|
|
74
|
+
]), w = (e) => {
|
|
75
|
+
throw new y({ reason: e });
|
|
76
|
+
}, T = (e) => typeof e == "string" && e.trim().length > 0, E = (e) => h("sha256").update(g(e)).digest("hex"), D = (e, t, n) => E({
|
|
77
|
+
part: e,
|
|
78
|
+
ordinal: t,
|
|
79
|
+
...n
|
|
80
|
+
}), O = (e, t) => {
|
|
81
|
+
let n = h("sha256"), r = 0;
|
|
82
|
+
for (let i of t.entries()) n.update(D(e, ++r, M(i)) + "\n");
|
|
83
|
+
return {
|
|
84
|
+
part: e,
|
|
85
|
+
format: t.format,
|
|
86
|
+
entries: r,
|
|
87
|
+
digest: n.digest("hex")
|
|
88
|
+
};
|
|
89
|
+
}, k = (e) => typeof e == "string" && /^[0-9a-f]{64}$/.test(e), A = (e) => [
|
|
90
|
+
e.tenantId,
|
|
91
|
+
e.site,
|
|
92
|
+
e.environment
|
|
93
|
+
].every(T) ? r(i("tenantId", e.tenantId), i("site", e.site), i("environment", e.environment)) : w("scope"), j = (e) => e instanceof Date ? e.getTime() : typeof e == "string" ? Date.parse(e) : NaN, M = (e) => {
|
|
94
|
+
if (!T(e.key) || e.key.length > 256 || e.value === null || typeof e.value != "object" || Array.isArray(e.value)) return w("resource");
|
|
95
|
+
let t = /* @__PURE__ */ new Set(), n = (e, r) => {
|
|
96
|
+
if (r > 64) return w("bounds");
|
|
97
|
+
if (e !== null && typeof e != "string" && typeof e != "boolean" && !(typeof e == "number" && Number.isFinite(e))) {
|
|
98
|
+
if (typeof e != "object" || t.has(e) || Object.getOwnPropertySymbols(e).length > 0 || !Array.isArray(e) && Object.getPrototypeOf(e) !== Object.prototype && Object.getPrototypeOf(e) !== null || Array.isArray(e) && (Object.keys(e).length !== e.length || Object.keys(e).some((e, t) => e !== String(t)))) return w("resource");
|
|
99
|
+
t.add(e);
|
|
100
|
+
for (let [t, i] of Object.entries(Object.getOwnPropertyDescriptors(e))) if (!(Array.isArray(e) && t === "length")) {
|
|
101
|
+
if (!i.enumerable || !("value" in i)) return w("resource");
|
|
102
|
+
n(i.value, r + 1);
|
|
103
|
+
}
|
|
104
|
+
t.delete(e);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
n(e.value, 0);
|
|
108
|
+
let r = JSON.stringify(e.value);
|
|
109
|
+
return Buffer.byteLength(r, "utf8") > 524288 ? w("bounds") : {
|
|
110
|
+
key: e.key,
|
|
111
|
+
value: JSON.parse(r)
|
|
112
|
+
};
|
|
113
|
+
}, N = async (t, n, r, i) => {
|
|
114
|
+
if (A(r), Object.keys(i.sources).length !== _.length || _.some((e) => {
|
|
115
|
+
let t = i.sources[e];
|
|
116
|
+
return t === void 0 || !T(t.format) || t.format.length > 128 || typeof t.entries != "function";
|
|
117
|
+
})) return w("parts");
|
|
118
|
+
let a = {
|
|
119
|
+
tenantId: r.tenantId,
|
|
120
|
+
site: r.site,
|
|
121
|
+
environment: r.environment
|
|
122
|
+
}, o = Object.fromEntries(_.map((e) => [e, {
|
|
123
|
+
format: i.sources[e].format,
|
|
124
|
+
entries: i.sources[e].entries
|
|
125
|
+
}])), s = i.now ?? Date.now();
|
|
126
|
+
return P(t, a, await e(t, n, a, {
|
|
127
|
+
locales: i.locales,
|
|
128
|
+
expiresAt: i.expiresAt,
|
|
129
|
+
now: s
|
|
130
|
+
}), {
|
|
131
|
+
sources: o,
|
|
132
|
+
now: s,
|
|
133
|
+
expiresAt: i.expiresAt
|
|
134
|
+
});
|
|
135
|
+
}, P = async (e, t, n, a) => {
|
|
136
|
+
let { now: o, sources: c } = a, l = await e.insert(b, {
|
|
137
|
+
tenantId: t.tenantId,
|
|
138
|
+
site: t.site,
|
|
139
|
+
environment: t.environment,
|
|
140
|
+
state: "capturing",
|
|
141
|
+
publicationStateId: n.id,
|
|
142
|
+
manifest: null,
|
|
143
|
+
digest: null,
|
|
144
|
+
capturedAt: new Date(o),
|
|
145
|
+
expiresAt: new Date(a.expiresAt)
|
|
146
|
+
}), u = String(l.id), d = [];
|
|
147
|
+
for (let a of _) {
|
|
148
|
+
let o = c[a], l = h("sha256"), f = 0, p = [], m = 0, g = async () => {
|
|
149
|
+
if (p.length === 0) return;
|
|
150
|
+
let n = p.map((e) => String(e.keyDigest));
|
|
151
|
+
if (new Set(n).size !== n.length || (await e.query({
|
|
152
|
+
table: "_voltro_cms_snapshot_resources",
|
|
153
|
+
predicate: r(A(t), i("snapshotId", u), i("part", a), s("keyDigest", n)),
|
|
154
|
+
order: [],
|
|
155
|
+
take: 1,
|
|
156
|
+
skip: void 0,
|
|
157
|
+
projection: ["id"]
|
|
158
|
+
})).length > 0) return w("duplicate");
|
|
159
|
+
await e.insertMany(x, p, { returning: "none" }), p = [], m = 0;
|
|
160
|
+
};
|
|
161
|
+
for await (let e of o.entries(structuredClone(n))) {
|
|
162
|
+
let n = M(e), r = Buffer.byteLength(JSON.stringify(n.value), "utf8");
|
|
163
|
+
if ((p.length >= 64 || m + r > 2097152) && await g(), f === 2147483647) return w("bounds");
|
|
164
|
+
let i = ++f, o = D(a, i, n);
|
|
165
|
+
l.update(o + "\n"), p.push({
|
|
166
|
+
tenantId: t.tenantId,
|
|
167
|
+
site: t.site,
|
|
168
|
+
environment: t.environment,
|
|
169
|
+
snapshotId: u,
|
|
170
|
+
part: a,
|
|
171
|
+
ordinal: i,
|
|
172
|
+
key: n.key,
|
|
173
|
+
keyDigest: E(n.key),
|
|
174
|
+
value: n.value,
|
|
175
|
+
digest: o
|
|
176
|
+
}), m += r;
|
|
177
|
+
}
|
|
178
|
+
if (await g(), f === 0 && v.has(a)) return w("parts");
|
|
179
|
+
d.push({
|
|
180
|
+
part: a,
|
|
181
|
+
format: o.format,
|
|
182
|
+
entries: f,
|
|
183
|
+
digest: l.digest("hex")
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
let f = {
|
|
187
|
+
version: 1,
|
|
188
|
+
capturedAt: o,
|
|
189
|
+
expiresAt: a.expiresAt,
|
|
190
|
+
scope: {
|
|
191
|
+
tenantId: t.tenantId,
|
|
192
|
+
site: t.site,
|
|
193
|
+
environment: t.environment
|
|
194
|
+
},
|
|
195
|
+
publication: n,
|
|
196
|
+
parts: d
|
|
197
|
+
}, p = E(f);
|
|
198
|
+
return await e.update(b, u, {
|
|
199
|
+
state: "sealed",
|
|
200
|
+
manifest: f,
|
|
201
|
+
digest: p
|
|
202
|
+
}), {
|
|
203
|
+
id: u,
|
|
204
|
+
digest: p,
|
|
205
|
+
expiresAt: a.expiresAt,
|
|
206
|
+
manifest: structuredClone(f)
|
|
207
|
+
};
|
|
208
|
+
}, F = async (e, t, n, a = Date.now()) => {
|
|
209
|
+
let [o] = await e.query({
|
|
210
|
+
table: b,
|
|
211
|
+
predicate: r(A(t), i("id", n)),
|
|
212
|
+
order: [],
|
|
213
|
+
take: 1,
|
|
214
|
+
skip: void 0,
|
|
215
|
+
projection: void 0
|
|
216
|
+
});
|
|
217
|
+
if (o === void 0 || o.state !== "sealed" || !k(o.digest) || o.manifest === null || typeof o.manifest != "object") return w("snapshot");
|
|
218
|
+
let s = o.manifest;
|
|
219
|
+
if (s.version !== 1 || !Array.isArray(s.parts) || s.parts.length !== _.length || g(s.scope) !== g({
|
|
220
|
+
tenantId: t.tenantId,
|
|
221
|
+
site: t.site,
|
|
222
|
+
environment: t.environment
|
|
223
|
+
}) || s.publication?.id !== o.publicationStateId || !k(s.publication?.digest) || s.parts.some((e, t) => typeof e != "object" || !e || e.part !== _[t] || !T(e.format) || !Number.isSafeInteger(e.entries) || e.entries < 0 || !k(e.digest)) || E(s) !== o.digest) return w("snapshot");
|
|
224
|
+
let c = j(o.expiresAt);
|
|
225
|
+
return !Number.isSafeInteger(a) || !Number.isFinite(c) || !Number.isSafeInteger(s.capturedAt) || !Number.isSafeInteger(s.expiresAt) || s.expiresAt <= s.capturedAt || j(o.capturedAt) !== s.capturedAt || c !== s.expiresAt || a < s.capturedAt ? w("snapshot") : c <= a ? w("expired") : {
|
|
226
|
+
id: n,
|
|
227
|
+
digest: o.digest,
|
|
228
|
+
expiresAt: c,
|
|
229
|
+
manifest: structuredClone(s)
|
|
230
|
+
};
|
|
231
|
+
}, I = async (e, t, n, o, s = {}) => {
|
|
232
|
+
let c = (await F(e, t, n, s.now)).manifest.parts.find((e) => e.part === o), l = 0, u = s.limit ?? 64;
|
|
233
|
+
if (c === void 0) return w("parts");
|
|
234
|
+
if (s.after !== void 0) {
|
|
235
|
+
if (!T(s.after) || s.after.length > 64) return w("cursor");
|
|
236
|
+
let [a] = await e.query({
|
|
237
|
+
table: x,
|
|
238
|
+
predicate: r(A(t), i("snapshotId", n), i("part", o), i("id", s.after)),
|
|
239
|
+
order: [],
|
|
240
|
+
take: 1,
|
|
241
|
+
skip: void 0,
|
|
242
|
+
projection: void 0
|
|
243
|
+
});
|
|
244
|
+
if (a === void 0 || typeof a.ordinal != "number" || !Number.isSafeInteger(a.ordinal) || a.ordinal < 1 || a.ordinal > c.entries || a.keyDigest !== E(a.key) || a.digest !== E({
|
|
245
|
+
part: o,
|
|
246
|
+
ordinal: a.ordinal,
|
|
247
|
+
key: a.key,
|
|
248
|
+
value: a.value
|
|
249
|
+
})) return w("cursor");
|
|
250
|
+
l = a.ordinal;
|
|
251
|
+
}
|
|
252
|
+
if (!Number.isSafeInteger(u) || u < 1 || u > 200) return w("bounds");
|
|
253
|
+
let d = await e.query({
|
|
254
|
+
table: x,
|
|
255
|
+
predicate: r(A(t), i("snapshotId", n), i("part", o), a("ordinal", l)),
|
|
256
|
+
order: [{
|
|
257
|
+
column: "ordinal",
|
|
258
|
+
direction: "asc"
|
|
259
|
+
}],
|
|
260
|
+
take: Math.min(u, c.entries - l) + 1,
|
|
261
|
+
skip: void 0,
|
|
262
|
+
projection: void 0
|
|
263
|
+
}), f = Math.min(u + 1, c.entries - l);
|
|
264
|
+
return d.length === f ? {
|
|
265
|
+
items: d.map((e, t) => {
|
|
266
|
+
let n = l + t + 1;
|
|
267
|
+
return e.ordinal !== n || e.keyDigest !== E(e.key) || e.digest !== E({
|
|
268
|
+
part: o,
|
|
269
|
+
ordinal: n,
|
|
270
|
+
key: e.key,
|
|
271
|
+
value: e.value
|
|
272
|
+
}) ? w("resource") : M({
|
|
273
|
+
key: String(e.key),
|
|
274
|
+
value: e.value
|
|
275
|
+
});
|
|
276
|
+
}).slice(0, u),
|
|
277
|
+
next: l + u < c.entries ? String(d[u - 1].id) : null
|
|
278
|
+
} : w("resource");
|
|
279
|
+
}, L = async (e, t, n, r, i) => (await R(e, t, n, r, [i])).get(i) ?? null, R = async (e, t, n, a, o) => {
|
|
280
|
+
let c = n.manifest.parts.find((e) => e.part === a);
|
|
281
|
+
if (c === void 0 || o.some((e) => !T(e) || e.length > 256) || g(n.manifest.scope) !== g({
|
|
282
|
+
tenantId: t.tenantId,
|
|
283
|
+
site: t.site,
|
|
284
|
+
environment: t.environment
|
|
285
|
+
})) return w("scope");
|
|
286
|
+
if (o.length > 200) return w("bounds");
|
|
287
|
+
let l = new Set(o), u = /* @__PURE__ */ new Map();
|
|
288
|
+
if (l.size === 0) return u;
|
|
289
|
+
let d = await e.query({
|
|
290
|
+
table: x,
|
|
291
|
+
predicate: r(A(t), i("snapshotId", n.id), i("part", a), s("keyDigest", [...l].map(E))),
|
|
292
|
+
lock: "update",
|
|
293
|
+
order: [],
|
|
294
|
+
take: l.size,
|
|
295
|
+
skip: void 0,
|
|
296
|
+
projection: void 0
|
|
297
|
+
});
|
|
298
|
+
for (let e of d) {
|
|
299
|
+
let t = e.key;
|
|
300
|
+
if (typeof t != "string" || !l.has(t) || u.has(t) || e.keyDigest !== E(t) || !Number.isSafeInteger(e.ordinal) || Number(e.ordinal) < 1 || Number(e.ordinal) > c.entries || e.digest !== E({
|
|
301
|
+
part: a,
|
|
302
|
+
ordinal: e.ordinal,
|
|
303
|
+
key: t,
|
|
304
|
+
value: e.value
|
|
305
|
+
})) return w("resource");
|
|
306
|
+
u.set(t, M({
|
|
307
|
+
key: t,
|
|
308
|
+
value: e.value
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
return u;
|
|
312
|
+
}, z = async (e, t, n, r, i) => await L(e, t, n, r, i) ?? w("resource"), B = async (e, n, o, s = Date.now()) => {
|
|
313
|
+
let c = await F(e, n, o.id, s);
|
|
314
|
+
if (c.digest !== o.digest) return w("snapshot");
|
|
315
|
+
await t(e, c.manifest.scope, c.manifest.publication, s);
|
|
316
|
+
let l = new Map(c.manifest.parts.map((e) => [e.part, {
|
|
317
|
+
pin: e,
|
|
318
|
+
count: 0,
|
|
319
|
+
digest: h("sha256")
|
|
320
|
+
}])), d;
|
|
321
|
+
for (;;) {
|
|
322
|
+
let t = await e.query({
|
|
323
|
+
table: x,
|
|
324
|
+
predicate: r(A(n), i("snapshotId", c.id), ...d === void 0 ? [] : [u(a("part", d.part), r(i("part", d.part), a("ordinal", d.ordinal)))]),
|
|
325
|
+
order: [{
|
|
326
|
+
column: "part",
|
|
327
|
+
direction: "asc"
|
|
328
|
+
}, {
|
|
329
|
+
column: "ordinal",
|
|
330
|
+
direction: "asc"
|
|
331
|
+
}],
|
|
332
|
+
take: 64,
|
|
333
|
+
skip: void 0,
|
|
334
|
+
projection: void 0
|
|
335
|
+
});
|
|
336
|
+
for (let e of t) {
|
|
337
|
+
let t = l.get(e.part);
|
|
338
|
+
if (t === void 0 || e.ordinal !== ++t.count || t.count > t.pin.entries || e.keyDigest !== E(e.key) || e.digest !== E({
|
|
339
|
+
part: t.pin.part,
|
|
340
|
+
ordinal: t.count,
|
|
341
|
+
key: e.key,
|
|
342
|
+
value: e.value
|
|
343
|
+
})) return w("resource");
|
|
344
|
+
let n = M({
|
|
345
|
+
key: String(e.key),
|
|
346
|
+
value: e.value
|
|
347
|
+
});
|
|
348
|
+
t.digest.update(D(t.pin.part, t.count, n) + "\n"), d = {
|
|
349
|
+
part: t.pin.part,
|
|
350
|
+
ordinal: t.count
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
if (t.length < 64) break;
|
|
354
|
+
}
|
|
355
|
+
for (let { pin: e, count: t, digest: n } of l.values()) if (t !== e.entries || n.digest("hex") !== e.digest) return w("resource");
|
|
356
|
+
return c;
|
|
357
|
+
}, V = (e, t, n, r, i = Date.now()) => {
|
|
358
|
+
let a = structuredClone(n), o = {
|
|
359
|
+
tenantId: t.tenantId,
|
|
360
|
+
site: t.site,
|
|
361
|
+
environment: t.environment
|
|
362
|
+
}, s = a.manifest.parts.find((e) => e.part === r);
|
|
363
|
+
return s === void 0 ? w("parts") : {
|
|
364
|
+
format: s.format,
|
|
365
|
+
entries: async function* (t) {
|
|
366
|
+
if (g(t) !== g(a.manifest.publication)) return w("snapshot");
|
|
367
|
+
let n = h("sha256"), c, l = 0;
|
|
368
|
+
do {
|
|
369
|
+
let t = await I(e, o, a.id, r, {
|
|
370
|
+
now: i,
|
|
371
|
+
limit: 100,
|
|
372
|
+
...c === void 0 ? {} : { after: c }
|
|
373
|
+
});
|
|
374
|
+
for (let e of t.items) n.update(D(r, ++l, e) + "\n"), yield e;
|
|
375
|
+
c = t.next ?? void 0;
|
|
376
|
+
} while (c !== void 0);
|
|
377
|
+
if (l !== s.entries || n.digest("hex") !== s.digest) return w("resource");
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
}, H = async (e, t, n, r, i = Date.now()) => {
|
|
381
|
+
let a = {
|
|
382
|
+
tenantId: t.tenantId,
|
|
383
|
+
site: t.site,
|
|
384
|
+
environment: t.environment
|
|
385
|
+
}, o = {
|
|
386
|
+
id: n.id,
|
|
387
|
+
digest: n.digest
|
|
388
|
+
}, s = Object.entries(r);
|
|
389
|
+
if (s.some(([e, t]) => !_.includes(e) || t === void 0 || !T(t.format) || t.format.length > 128 || typeof t.entries != "function")) return w("parts");
|
|
390
|
+
let c = new Map(s.map(([e, t]) => [e, {
|
|
391
|
+
format: t.format,
|
|
392
|
+
entries: t.entries
|
|
393
|
+
}])), l = await B(e, a, o, i), u = Object.fromEntries(l.manifest.parts.map((t) => [t.part, c.get(t.part) ?? V(e, a, l, t.part, i)])), d = await P(e, a, l.manifest.publication, {
|
|
394
|
+
sources: u,
|
|
395
|
+
now: l.manifest.capturedAt,
|
|
396
|
+
expiresAt: l.expiresAt
|
|
397
|
+
});
|
|
398
|
+
return d.manifest.parts.some((e, t) => !c.has(e.part) && g(e) !== g(l.manifest.parts[t])) ? w("resource") : d;
|
|
399
|
+
};
|
|
400
|
+
//#endregion
|
|
401
|
+
export { b as BUILD_SNAPSHOTS_TABLE, y as BuildSnapshotUnavailable, _ as SNAPSHOT_PARTS, x as SNAPSHOT_RESOURCES_TABLE, S as buildSnapshotsTable, N as captureBuildSnapshot, M as copySnapshotResource, H as deriveBuildSnapshot, L as findVerifiedSnapshotResource, R as findVerifiedSnapshotResources, I as pageSnapshotResources, V as pinnedSnapshotPartSource, F as readBuildSnapshot, z as readVerifiedSnapshotResource, D as snapshotResourceDigest, C as snapshotResourcesTable, O as snapshotStaticPartPin, B as verifyBuildSnapshot };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { copySnapshotAppCodePin as e } from "./snapshotDefinitions.js";
|
|
2
|
+
//#region src/buildSnapshotApplicationPin.ts
|
|
3
|
+
var t = (e) => {
|
|
4
|
+
let t = () => {
|
|
5
|
+
throw TypeError("Invalid retained application identity");
|
|
6
|
+
};
|
|
7
|
+
if (typeof e != "object" || !e || Array.isArray(e) || Object.keys(e).sort().join(",") !== "executionId,inputsId") return t();
|
|
8
|
+
let { inputsId: n, executionId: r } = e;
|
|
9
|
+
return typeof n != "string" || !/^[a-f0-9]{64}$/.test(n) || typeof r != "string" || !/^[a-f0-9]{64}$/.test(r) ? t() : {
|
|
10
|
+
inputsId: n,
|
|
11
|
+
executionId: r
|
|
12
|
+
};
|
|
13
|
+
}, n = (t) => {
|
|
14
|
+
let n = () => {
|
|
15
|
+
throw TypeError("Invalid retained application pin");
|
|
16
|
+
};
|
|
17
|
+
if (typeof t != "object" || !t || Array.isArray(t) || Object.keys(t).sort().join(",") !== "code,executionId,inputsId") return n();
|
|
18
|
+
let { code: r, inputsId: i, executionId: a } = t;
|
|
19
|
+
if (typeof i != "string" || !/^[a-f0-9]{64}$/.test(i) || typeof a != "string" || !/^[a-f0-9]{64}$/.test(a) || typeof r != "object" || !r || Array.isArray(r) || Object.keys(r).sort().join(",") !== "artifactDigest,commit,configDigest") return n();
|
|
20
|
+
let o = r;
|
|
21
|
+
return typeof o.commit != "string" || typeof o.artifactDigest != "string" || typeof o.configDigest != "string" ? n() : {
|
|
22
|
+
inputsId: i,
|
|
23
|
+
executionId: a,
|
|
24
|
+
code: e({
|
|
25
|
+
commit: o.commit,
|
|
26
|
+
artifactDigest: o.artifactDigest,
|
|
27
|
+
configDigest: o.configDigest
|
|
28
|
+
})
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { t as copyBuildSnapshotApplicationIdentity, n as copyBuildSnapshotApplicationPin };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { cmsCredential as e, privateCmsHttpRoutes as t, privateCmsOperation as n } from "./privateCmsTransport.js";
|
|
2
|
+
import { CmsBuildSnapshotUnavailable as r } from "./buildSnapshotService.js";
|
|
3
|
+
import { Schema as i } from "effect";
|
|
4
|
+
//#region src/buildSnapshotRest.ts
|
|
5
|
+
var a = (t) => e(t, "CmsBuildSnapshotUnavailable"), o = i.Struct({
|
|
6
|
+
id: i.String,
|
|
7
|
+
digest: i.String
|
|
8
|
+
}), s = i.Struct({
|
|
9
|
+
artifactId: i.String,
|
|
10
|
+
pathSets: i.Array(i.Struct({
|
|
11
|
+
id: i.String,
|
|
12
|
+
digest: i.String
|
|
13
|
+
}))
|
|
14
|
+
}), c = i.Struct({
|
|
15
|
+
version: i.Literal(1),
|
|
16
|
+
decided: i.Boolean,
|
|
17
|
+
granted: i.Array(i.Struct({
|
|
18
|
+
id: i.String,
|
|
19
|
+
version: i.Number
|
|
20
|
+
}))
|
|
21
|
+
}), l = i.Struct({
|
|
22
|
+
snapshot: o,
|
|
23
|
+
consumerId: i.String,
|
|
24
|
+
buildId: i.String,
|
|
25
|
+
host: i.String,
|
|
26
|
+
path: i.String,
|
|
27
|
+
presentation: i.optional(c)
|
|
28
|
+
}), u = (e, t) => ({
|
|
29
|
+
snapshot: e.snapshot,
|
|
30
|
+
consumerId: e.consumerId,
|
|
31
|
+
buildId: e.buildId,
|
|
32
|
+
host: e.host,
|
|
33
|
+
path: e.path,
|
|
34
|
+
token: a(t),
|
|
35
|
+
...e.presentation === void 0 ? {} : { presentation: e.presentation }
|
|
36
|
+
}), d = i.Struct({
|
|
37
|
+
snapshotId: i.String,
|
|
38
|
+
snapshotDigest: i.String,
|
|
39
|
+
routeId: i.String,
|
|
40
|
+
path: i.String,
|
|
41
|
+
contentType: i.String,
|
|
42
|
+
localeId: i.String,
|
|
43
|
+
requestedLocale: i.String,
|
|
44
|
+
sourceLocale: i.String,
|
|
45
|
+
fallback: i.Boolean,
|
|
46
|
+
values: i.Record(i.String, i.Unknown),
|
|
47
|
+
presentation: c
|
|
48
|
+
}), f = i.Struct({
|
|
49
|
+
documentId: i.String,
|
|
50
|
+
parent: i.NullOr(i.String),
|
|
51
|
+
depth: i.Number,
|
|
52
|
+
path: i.String,
|
|
53
|
+
sourceLocale: i.String,
|
|
54
|
+
fallback: i.Boolean,
|
|
55
|
+
values: i.Record(i.String, i.Unknown)
|
|
56
|
+
}), p = (e, t, i, a, o, s) => n({
|
|
57
|
+
namespace: "cms.buildSnapshot",
|
|
58
|
+
path: "/v1/cms/build-snapshots",
|
|
59
|
+
operationPrefix: "cmsBuildSnapshot",
|
|
60
|
+
tags: ["CMS build snapshots"],
|
|
61
|
+
credentialError: "CmsBuildSnapshotUnavailable",
|
|
62
|
+
error: r,
|
|
63
|
+
errorStatus: { CmsBuildSnapshotUnavailable: 409 }
|
|
64
|
+
}, e, t, i, a, o, s), m = (e) => {
|
|
65
|
+
let n = [
|
|
66
|
+
p("capture", "Capture or resume one immutable build snapshot", "Organization API-key bearer. Scope, app inputs, expiry and storage are selected by the server. Optional expectedApplication compares the retained source, inputs and execution before any capture attempt; it selects no provider or path. Reuse attemptId only with the same authority, release and configuration.", i.Struct({
|
|
67
|
+
attemptId: i.String,
|
|
68
|
+
releaseId: i.String,
|
|
69
|
+
expectedApplication: i.optional(i.Struct({
|
|
70
|
+
inputsId: i.String,
|
|
71
|
+
executionId: i.String,
|
|
72
|
+
code: i.Struct({
|
|
73
|
+
commit: i.String,
|
|
74
|
+
artifactDigest: i.String,
|
|
75
|
+
configDigest: i.String
|
|
76
|
+
})
|
|
77
|
+
}))
|
|
78
|
+
}), i.Struct({
|
|
79
|
+
id: i.String,
|
|
80
|
+
digest: i.String,
|
|
81
|
+
expiresAt: i.Number
|
|
82
|
+
}), (t, n) => e.capture({
|
|
83
|
+
attemptId: t.attemptId,
|
|
84
|
+
releaseId: t.releaseId,
|
|
85
|
+
apiKey: a(n),
|
|
86
|
+
...t.expectedApplication === void 0 ? {} : { expectedApplication: t.expectedApplication }
|
|
87
|
+
})),
|
|
88
|
+
p("open", "Issue a short-lived read grant for the retained application", "Organization API-key bearer. Optional resume requires the original grant token and buildId plus the same parent credential, even after read expiry; revoked proof refuses. consentPurposes is the bounded catalog from this same independently verified retained application, not personal consent or additional rights. Coordinators can derive finite public presentation classes without executing application code. The response token is private and must never be persisted in a public artifact or a generic HTTP idempotency cache.", i.Struct({
|
|
89
|
+
snapshot: o,
|
|
90
|
+
resume: i.optional(i.Struct({
|
|
91
|
+
token: i.String,
|
|
92
|
+
buildId: i.String
|
|
93
|
+
}))
|
|
94
|
+
}), i.Struct({
|
|
95
|
+
id: i.String,
|
|
96
|
+
token: i.String,
|
|
97
|
+
expiresAt: i.Number,
|
|
98
|
+
consumerId: i.String,
|
|
99
|
+
buildId: i.String,
|
|
100
|
+
snapshotId: i.String,
|
|
101
|
+
snapshotDigest: i.String,
|
|
102
|
+
consentPurposes: i.Array(i.Struct({
|
|
103
|
+
id: i.String,
|
|
104
|
+
version: i.Int
|
|
105
|
+
})).check(i.isMaxLength(32))
|
|
106
|
+
}), (t, n) => e.open({
|
|
107
|
+
snapshot: t.snapshot,
|
|
108
|
+
apiKey: a(n),
|
|
109
|
+
...t.resume === void 0 ? {} : { resume: t.resume }
|
|
110
|
+
})),
|
|
111
|
+
p("read", "Read anonymous projected content at one snapshot route", "Render-read token bearer from open. All reads carry the same snapshot pin. Unknown routes return null only after fresh grant, host and snapshot admission; there is no live fallback.", l, i.NullOr(d), (t, n) => e.read(u(t, n))),
|
|
112
|
+
p("readBinding", "Read a captured site binding at an admitted CMS page", "Render-read token bearer. The server resolves only named site bindings captured in the same snapshot, using its locale fallback, anonymous access, consent and field projection. Nested references grant no media or document access.", i.Struct({
|
|
113
|
+
...l.fields,
|
|
114
|
+
binding: i.String
|
|
115
|
+
}), i.NullOr(i.Struct({
|
|
116
|
+
snapshotId: i.String,
|
|
117
|
+
snapshotDigest: i.String,
|
|
118
|
+
binding: i.String,
|
|
119
|
+
contentType: i.String,
|
|
120
|
+
localeId: i.String,
|
|
121
|
+
requestedLocale: i.String,
|
|
122
|
+
sourceLocale: i.String,
|
|
123
|
+
fallback: i.Boolean,
|
|
124
|
+
values: i.Record(i.String, i.Unknown),
|
|
125
|
+
presentation: c
|
|
126
|
+
})), (t, n) => e.readBinding({
|
|
127
|
+
...u(t, n),
|
|
128
|
+
binding: t.binding
|
|
129
|
+
})),
|
|
130
|
+
p("readTree", "Read a named public tree from the captured publication", "Render-read token bearer. Named scalar projections, tree ordering, ancestor policy and mapped addresses come from this snapshot. Breadcrumbs are independent of navigation inclusion. No live fallback or personal authority; unknown names fail after credential admission.", i.Struct({
|
|
131
|
+
...l.fields,
|
|
132
|
+
name: i.String
|
|
133
|
+
}), i.Struct({
|
|
134
|
+
version: i.Literals([1]),
|
|
135
|
+
contentType: i.String,
|
|
136
|
+
localeId: i.String,
|
|
137
|
+
requestedLocale: i.String,
|
|
138
|
+
currentDocumentId: i.NullOr(i.String),
|
|
139
|
+
nodes: i.Array(f),
|
|
140
|
+
ancestors: i.Array(f)
|
|
141
|
+
}), (t, n) => e.readTree({
|
|
142
|
+
...u(t, n),
|
|
143
|
+
name: t.name
|
|
144
|
+
})),
|
|
145
|
+
p("render", "Render a private candidate using the retained application", "Render-read token bearer from open. This does not activate output or grant permission to serve it. Media requires the server-configured custody/output provider.", l, i.NullOr(i.Struct({
|
|
146
|
+
html: i.String,
|
|
147
|
+
head: i.String,
|
|
148
|
+
document: i.NullOr(i.String),
|
|
149
|
+
artifactId: i.NullOr(i.String)
|
|
150
|
+
})), (t, n) => e.render(u(t, n))),
|
|
151
|
+
p("renderSafety", "Stage one complete current safety generation for captured output", "Render-read token bearer. Requires actual complete documents and stored signed path sets from the same snapshot, application and build. The server stages every current scoped URL/hash denial; a changed generation or withdrawn admission refuses before sealing. Returned private artifact IDs grant no activation or serving authority.", i.Struct({
|
|
152
|
+
snapshot: o,
|
|
153
|
+
consumerId: i.String,
|
|
154
|
+
buildId: i.String,
|
|
155
|
+
host: i.String,
|
|
156
|
+
documents: s
|
|
157
|
+
}), i.Struct({
|
|
158
|
+
artifactId: i.String,
|
|
159
|
+
generation: i.Int,
|
|
160
|
+
entryCount: i.Int
|
|
161
|
+
}), (t, n) => e.renderSafety({
|
|
162
|
+
...t,
|
|
163
|
+
token: a(n)
|
|
164
|
+
})),
|
|
165
|
+
p("renderRedirects", "Stage explicitly approved retired routes from captured source and output history", "Render-read token bearer. Requires actual document custody, complete signed path sets for every enabled locale and both owners on this host, current renderSafety output, and the captured server-admitted route declaration. The required sorted targets array supplies {host, documents} for every other selected host; use an empty array for one host. Each target inventory undergoes the same fresh grant, document, rights and complete signed EOF admission. Every retired observed URL needs explicit current intent; conflicting historical owners hold. Current owners suppress old rules, but only admitted public documents may be redirect targets. Intrinsic CMS redirects do not authorize output. Exact 301/302 method permission, 307/308 preservation, 404/410 and active intervals remain distinct. Rechecks authority and current metadata around writes. Returned private artifacts confer no activation or public serving authority.", i.Struct({
|
|
166
|
+
snapshot: o,
|
|
167
|
+
consumerId: i.String,
|
|
168
|
+
buildId: i.String,
|
|
169
|
+
host: i.String,
|
|
170
|
+
documents: s,
|
|
171
|
+
targets: i.Array(i.Struct({
|
|
172
|
+
host: i.String,
|
|
173
|
+
documents: s
|
|
174
|
+
})),
|
|
175
|
+
safety: i.Struct({ artifactId: i.String })
|
|
176
|
+
}), i.Struct({
|
|
177
|
+
artifactId: i.String,
|
|
178
|
+
count: i.Int
|
|
179
|
+
}), (t, n) => e.renderRedirects({
|
|
180
|
+
...t,
|
|
181
|
+
token: a(n)
|
|
182
|
+
})),
|
|
183
|
+
p("renderSeo", "Stage private sitemap and robots artifacts from captured public SEO", "Render-read token bearer. Anonymous own variants, editorial opt-out/index policy, canonical domain and alternates come from this snapshot. Production web controls require the actual document artifact, stored signed path-set IDs and digests, and the current renderSafety artifact; native metadata comes from matched render receipts. Withdrawn URLs and documents using denied media are excluded, including their alternates. Current safety and document admission are checked around output writes. Large sitemaps split by protocol limits. Returned private artifact IDs confer no activation or serving authority; an output provider is required.", i.Struct({
|
|
184
|
+
snapshot: o,
|
|
185
|
+
consumerId: i.String,
|
|
186
|
+
buildId: i.String,
|
|
187
|
+
host: i.String,
|
|
188
|
+
documents: i.optional(s),
|
|
189
|
+
safety: i.optional(i.Struct({ artifactId: i.String }))
|
|
190
|
+
}), i.Struct({
|
|
191
|
+
sitemapArtifactId: i.String,
|
|
192
|
+
robotsArtifactId: i.String,
|
|
193
|
+
urlCount: i.Number
|
|
194
|
+
}), (t, n) => e.renderSeo({
|
|
195
|
+
snapshot: t.snapshot,
|
|
196
|
+
consumerId: t.consumerId,
|
|
197
|
+
buildId: t.buildId,
|
|
198
|
+
host: t.host,
|
|
199
|
+
token: a(n),
|
|
200
|
+
...t.documents === void 0 ? {} : { documents: t.documents },
|
|
201
|
+
...t.safety === void 0 ? {} : { safety: t.safety }
|
|
202
|
+
}))
|
|
203
|
+
];
|
|
204
|
+
return {
|
|
205
|
+
routes: n,
|
|
206
|
+
httpRoutes: t(n)
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
//#endregion
|
|
210
|
+
export { m as cmsBuildSnapshotRest };
|