@voltro/cms 0.86.0 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5484 -0
- package/README.md +138 -0
- package/THIRD-PARTY-NOTICES.md +1511 -276
- package/dist/ContentForm.js +1 -2
- package/dist/RichDocumentEditor.js +1 -2
- package/dist/RichDocumentView.js +82 -38
- package/dist/RichTextSurface.js +1 -2
- package/dist/aiCandidates.js +4 -5
- package/dist/aiOperations.js +1 -2
- package/dist/applicationBuildSnapshotService.js +100 -0
- package/dist/assetRenditions.js +101 -0
- package/dist/assetRevision.js +45 -0
- package/dist/assetUseRights.js +71 -0
- package/dist/audiences.js +1 -2
- package/dist/availability.js +20 -18
- package/dist/blueprint.js +76 -77
- package/dist/build.d.ts +3063 -0
- package/dist/build.js +37 -0
- package/dist/buildApplicationAdmission.js +15 -0
- package/dist/buildApplicationCatalog.js +135 -0
- package/dist/buildApplicationCatalogTable.js +23 -0
- package/dist/buildApplicationRest.js +98 -0
- package/dist/buildApplicationUpload.js +110 -0
- package/dist/buildSnapshot.js +400 -0
- package/dist/buildSnapshotApplicationPin.js +31 -0
- package/dist/buildSnapshotRest.js +209 -0
- package/dist/buildSnapshotService.js +264 -0
- package/dist/buildSnapshotTables.js +24 -0
- package/dist/bulk.js +72 -72
- package/dist/cacheIdentity.js +1 -2
- package/dist/changes.js +280 -64
- package/dist/cmsContext.js +1 -2
- package/dist/collections.js +1 -2
- package/dist/consent.js +6 -7
- package/dist/contentLocations.js +52 -0
- package/dist/contentProjection.js +82 -0
- package/dist/contentRouteIdentity.js +12 -0
- package/dist/contentRouteMaterializer.js +96 -0
- package/dist/contentRouteTypes.js +38 -0
- package/dist/contentSeo.js +188 -0
- package/dist/contentTreePath.js +59 -0
- package/dist/contentType.js +121 -105
- package/dist/contentValues.js +17 -0
- package/dist/contentfulImport.js +1 -2
- package/dist/copies.js +4 -5
- package/dist/cutover.js +1 -2
- package/dist/deliveryChecks.js +1 -2
- package/dist/domainHost.js +6 -0
- package/dist/domains.js +82 -89
- package/dist/draftTexts.js +38 -39
- package/dist/duplicates.js +24 -25
- package/dist/edgePurge.js +1 -2
- package/dist/editHistory.js +1 -2
- package/dist/effectForm.js +1 -2
- package/dist/environmentAliases.js +137 -0
- package/dist/environments.js +108 -71
- package/dist/errors.js +55 -16
- package/dist/experiments.js +8 -9
- package/dist/exposure.js +1 -2
- package/dist/extensionManifest.js +2 -3
- package/dist/extensions.js +1 -2
- package/dist/fieldSchema.js +1 -2
- package/dist/formStrings.js +1 -2
- package/dist/frontendBindings.js +98 -0
- package/dist/frontendMedia.js +17 -0
- package/dist/glossary.js +1 -2
- package/dist/history.js +1 -2
- package/dist/htmlImport.js +1 -2
- package/dist/index.d.ts +760 -47
- package/dist/index.js +89 -73
- package/dist/initializePublicRoutes.js +27 -0
- package/dist/liveContentRouteView.js +75 -0
- package/dist/media.js +1 -2
- package/dist/metrics.js +1 -2
- package/dist/migration.js +1 -2
- package/dist/migrationStages.js +1 -2
- package/dist/nativeOutputDeploymentService.js +204 -0
- package/dist/outputActivation.js +233 -0
- package/dist/outputActivationOrigin.js +50 -0
- package/dist/outputActivationStore.js +410 -0
- package/dist/outputActivationTables.js +10 -0
- package/dist/outputActivationTarget.js +80 -0
- package/dist/outputActivationTargetTable.js +24 -0
- package/dist/outputDeployment.js +173 -0
- package/dist/outputDeploymentRest.js +167 -0
- package/dist/outputDeploymentService.js +240 -0
- package/dist/outputRouteGraph.js +176 -0
- package/dist/outputSafetyArtifact.js +146 -0
- package/dist/outputTargetRest.js +61 -0
- package/dist/pathSegmentEncoding.js +3 -0
- package/dist/presenceAnchors.js +1 -2
- package/dist/preview.js +1 -2
- package/dist/privateCmsTransport.js +75 -0
- package/dist/privateNativeRouteReservation.js +9 -0
- package/dist/promotion.js +69 -61
- package/dist/publicBuild.js +89 -0
- package/dist/publicBuildRest.js +97 -0
- package/dist/publicBuildService.js +62 -0
- package/dist/publicOutputHttp.js +128 -0
- package/dist/publicOutputService.js +286 -0
- package/dist/publicPresentation.js +16 -0
- package/dist/publicRouteDispositionAdmission.js +37 -0
- package/dist/publicRouteHistoryStore.js +11 -0
- package/dist/publicRouteHistoryView.js +33 -0
- package/dist/publicRouteIntegrity.js +4 -0
- package/dist/publicRouteMutation.js +5 -0
- package/dist/publicRouteNamespace.js +133 -0
- package/dist/publicRoutePublication.js +35 -0
- package/dist/publicRouteRegistry.js +16 -0
- package/dist/publicRouteRegistryBinding.js +193 -0
- package/dist/publicRouteRegistryDefinition.js +75 -0
- package/dist/publicRouteSitePublication.js +39 -0
- package/dist/publicRouteTables.js +12 -0
- package/dist/publicRouteUrl.js +17 -0
- package/dist/publicationSeo.js +51 -0
- package/dist/publicationState.js +295 -0
- package/dist/quality.js +9 -10
- package/dist/reconfigurePublicRoutes.js +40 -0
- package/dist/recurrence.js +1 -2
- package/dist/redirects.js +105 -75
- package/dist/referenceGraph.js +16 -16
- package/dist/references.js +3 -4
- package/dist/release.js +178 -143
- package/dist/renderReadAuthority.js +42 -0
- package/dist/renderReadGrant.js +136 -0
- package/dist/rest.js +1 -2
- package/dist/review.js +29 -30
- package/dist/richDocument.js +56 -27
- package/dist/richInline.js +1 -2
- package/dist/routeDispositionGraph.js +43 -0
- package/dist/routeDispositionRest.js +50 -0
- package/dist/routeDispositionService.js +72 -0
- package/dist/routeDispositionStore.js +288 -0
- package/dist/routeDispositionTables.js +4 -0
- package/dist/routeDispositions.js +90 -0
- package/dist/routeHistoryStorage.js +319 -0
- package/dist/routeHistoryStore.js +11 -0
- package/dist/schedule.js +37 -38
- package/dist/search.js +1 -2
- package/dist/selectionIntent.js +1 -2
- package/dist/seo.js +2 -3
- package/dist/series.js +12 -13
- package/dist/share.js +14 -15
- package/dist/siteBindings.js +158 -0
- package/dist/siteBuildCandidate.js +103 -0
- package/dist/siteDelivery.js +114 -0
- package/dist/siteState.js +46 -0
- package/dist/snapshotAddressGraph.js +54 -0
- package/dist/snapshotAddressRead.js +72 -0
- package/dist/snapshotAppConsumer.js +70 -0
- package/dist/snapshotAppExecution.js +101 -0
- package/dist/snapshotApplication.js +74 -0
- package/dist/snapshotApprovedRouteDispositions.js +43 -0
- package/dist/snapshotAssetAssembly.js +69 -0
- package/dist/snapshotAssetAssemblyRest.js +49 -0
- package/dist/snapshotBindingRead.js +60 -0
- package/dist/snapshotCodeSeo.js +28 -0
- package/dist/snapshotComponent.js +33 -0
- package/dist/snapshotComponentSource.js +23 -0
- package/dist/snapshotConsumer.js +86 -0
- package/dist/snapshotContentIdentity.js +9 -0
- package/dist/snapshotDefinitions.js +263 -0
- package/dist/snapshotDocumentAssembly.js +192 -0
- package/dist/snapshotDocumentAssemblyRest.js +83 -0
- package/dist/snapshotDocumentProjection.js +201 -0
- package/dist/snapshotDocumentTransfer.js +34 -0
- package/dist/snapshotDocumentTransferRest.js +79 -0
- package/dist/snapshotDomains.js +55 -0
- package/dist/snapshotEnvironment.js +30 -0
- package/dist/snapshotFieldPlan.js +84 -0
- package/dist/snapshotFrontend.js +102 -0
- package/dist/snapshotLink.js +7 -0
- package/dist/snapshotMedia.js +110 -0
- package/dist/snapshotMediaCapture.js +245 -0
- package/dist/snapshotMediaFields.js +224 -0
- package/dist/snapshotMediaRead.js +184 -0
- package/dist/snapshotMediaReader.js +12 -0
- package/dist/snapshotObservation.js +15 -0
- package/dist/snapshotObservedRouteHistory.js +33 -0
- package/dist/snapshotOutputTransfer.js +77 -0
- package/dist/snapshotPageLoader.js +6 -0
- package/dist/snapshotPageSeo.js +58 -0
- package/dist/snapshotPathLocale.js +14 -0
- package/dist/snapshotPresentation.js +85 -0
- package/dist/snapshotPresentationPolicy.js +11 -0
- package/dist/snapshotProjection.js +118 -0
- package/dist/snapshotPublicAccess.js +160 -0
- package/dist/snapshotPublicRouteHistory.js +39 -0
- package/dist/snapshotReadAdmission.js +37 -0
- package/dist/snapshotRedirectOutput.js +150 -0
- package/dist/snapshotRedirectTargets.js +23 -0
- package/dist/snapshotRedirects.js +131 -0
- package/dist/snapshotReference.js +7 -0
- package/dist/snapshotReferenceAddress.js +9 -0
- package/dist/snapshotReferenceGraph.js +78 -0
- package/dist/snapshotReferenceRead.js +64 -0
- package/dist/snapshotRelease.js +98 -0
- package/dist/snapshotRender.js +360 -0
- package/dist/snapshotRenderDependencies.js +177 -0
- package/dist/snapshotRenditions.js +87 -0
- package/dist/snapshotRichDocument.js +61 -0
- package/dist/snapshotRoleTransfer.js +105 -0
- package/dist/snapshotRoleTransferRest.js +98 -0
- package/dist/snapshotRouteAdmission.js +70 -0
- package/dist/snapshotRouteDispatch.js +110 -0
- package/dist/snapshotRouteDispositionPlan.js +72 -0
- package/dist/snapshotRouteRead.js +42 -0
- package/dist/snapshotRoutes.js +78 -0
- package/dist/snapshotRouting.js +112 -0
- package/dist/snapshotSeo.js +178 -0
- package/dist/snapshotSeoControls.js +100 -0
- package/dist/snapshotSeoDocumentInventory.js +114 -0
- package/dist/snapshotSeoDocuments.js +128 -0
- package/dist/snapshotSeoMerge.js +84 -0
- package/dist/snapshotSeoMetadata.js +136 -0
- package/dist/snapshotSeoOutput.js +172 -0
- package/dist/snapshotSeoPathSets.js +104 -0
- package/dist/snapshotSeoRead.js +87 -0
- package/dist/snapshotSite.js +127 -0
- package/dist/snapshotSitemapFiles.js +35 -0
- package/dist/snapshotTreeDependencies.js +57 -0
- package/dist/snapshotTreeLoader.js +9 -0
- package/dist/snapshotTreeRead.js +157 -0
- package/dist/staticPathSet.js +176 -0
- package/dist/staticPathSetRest.js +128 -0
- package/dist/staticPathSetService.js +248 -0
- package/dist/staticPathSetStore.js +337 -0
- package/dist/stewardship.js +2 -3
- package/dist/taxonomy.js +1 -2
- package/dist/team.js +1 -2
- package/dist/templates.js +2 -3
- package/dist/trackChanges.js +1 -2
- package/dist/translation.js +1 -2
- package/dist/tree.js +10 -11
- package/dist/usage.js +1 -2
- package/dist/validation.js +54 -55
- package/dist/visualEditing.js +1 -2
- package/dist/web.d.ts +709 -7
- package/dist/web.js +50 -33
- package/dist/workflow.js +9 -10
- package/dist/write.js +251 -227
- package/dist/xliff.js +1 -2
- package/package.json +21 -7
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { copySnapshotResource as e } from "./buildSnapshot.js";
|
|
2
|
+
import { readRenderReadCredential as t } from "./renderReadAuthority.js";
|
|
3
|
+
import { copySnapshotPresentationValue as n } from "./snapshotPresentation.js";
|
|
4
|
+
import { copyFrontendOutputSelection as r } from "./frontendBindings.js";
|
|
5
|
+
import { snapshotApplicationConfigurationPins as i, snapshotApplicationPins as a } from "./snapshotApplication.js";
|
|
6
|
+
import { beginSnapshotMediaCapture as o, resumeSnapshotMediaCapture as s } from "./snapshotMediaCapture.js";
|
|
7
|
+
import { captureSiteBuildCandidate as c } from "./siteBuildCandidate.js";
|
|
8
|
+
import { issueSnapshotAppGrant as l } from "./snapshotAppConsumer.js";
|
|
9
|
+
import { readSnapshotRoute as u } from "./snapshotRouteRead.js";
|
|
10
|
+
import { readSnapshotBinding as d } from "./snapshotBindingRead.js";
|
|
11
|
+
import { readSnapshotTree as f } from "./snapshotTreeRead.js";
|
|
12
|
+
import { renderSnapshotRoute as p } from "./snapshotRender.js";
|
|
13
|
+
import { copySnapshotSeoDocumentsSelection as m } from "./snapshotSeoPathSets.js";
|
|
14
|
+
import { readSnapshotSeoDocuments as h, snapshotOutputSafetyBinding as g } from "./snapshotSeoDocuments.js";
|
|
15
|
+
import { captureOutputSafetyArtifact as _, copyOutputSafetySelection as v } from "./outputSafetyArtifact.js";
|
|
16
|
+
import { renderSnapshotSeoControls as y } from "./snapshotSeoOutput.js";
|
|
17
|
+
import { copySnapshotRedirectTargets as b } from "./snapshotRedirectTargets.js";
|
|
18
|
+
import { renderSnapshotRouteDispositions as x } from "./snapshotRedirectOutput.js";
|
|
19
|
+
import { Effect as S, Schema as C } from "effect";
|
|
20
|
+
import { createHash as w } from "node:crypto";
|
|
21
|
+
import { canonicalJson as T } from "@voltro/runtime";
|
|
22
|
+
// src/buildSnapshotService.ts
|
|
23
|
+
var E = class extends C.TaggedError()("CmsBuildSnapshotUnavailable", { reason: C.Literals([
|
|
24
|
+
"configuration",
|
|
25
|
+
"credential",
|
|
26
|
+
"capture",
|
|
27
|
+
"grant",
|
|
28
|
+
"read",
|
|
29
|
+
"render"
|
|
30
|
+
]) }) {}, D = (e) => w("sha256").update(T(e)).digest("hex"), O = (e) => {
|
|
31
|
+
throw new E({ reason: e });
|
|
32
|
+
}, k = (e, t) => S.tryPromise({
|
|
33
|
+
try: t,
|
|
34
|
+
catch: (t) => t instanceof E ? t : new E({ reason: e })
|
|
35
|
+
}), A = (C) => {
|
|
36
|
+
let { store: w, application: A, app: j, custody: M, execution: N, output: P } = C, F = {
|
|
37
|
+
tenantId: C.scope.tenantId,
|
|
38
|
+
site: C.scope.site,
|
|
39
|
+
environment: C.scope.environment
|
|
40
|
+
}, I = { ...C.code }, L = C.alias, R = C.requiredScope, z = C.snapshotTtlMs, B = C.maxMediaBytes, V = C.now ?? Date.now, H = {
|
|
41
|
+
id: C.key.id,
|
|
42
|
+
material: new Uint8Array(C.key.material)
|
|
43
|
+
}, U = [H, ...(C.verificationKeys ?? []).map((e) => ({
|
|
44
|
+
id: e.id,
|
|
45
|
+
material: new Uint8Array(e.material)
|
|
46
|
+
}))], W = JSON.parse(T(C.routeDiscovery));
|
|
47
|
+
if (!Number.isSafeInteger(z) || z <= 0 || !Number.isSafeInteger(B) || B < 0 || !/^[A-Za-z][A-Za-z0-9:_.-]{0,127}$/.test(R)) return O("configuration");
|
|
48
|
+
let G = D({
|
|
49
|
+
version: 1,
|
|
50
|
+
scope: F,
|
|
51
|
+
alias: L,
|
|
52
|
+
requiredScope: R,
|
|
53
|
+
ttl: z,
|
|
54
|
+
maxBytes: B,
|
|
55
|
+
application: A.frontend === void 0 ? {
|
|
56
|
+
...i(A, I),
|
|
57
|
+
frontend: {
|
|
58
|
+
source: "retained-application",
|
|
59
|
+
output: r(A.output)
|
|
60
|
+
}
|
|
61
|
+
} : a({
|
|
62
|
+
...A,
|
|
63
|
+
frontend: A.frontend
|
|
64
|
+
}, I),
|
|
65
|
+
discovery: W
|
|
66
|
+
}), K = async (e, n) => {
|
|
67
|
+
let r = await t(e, F, n, V());
|
|
68
|
+
return r === null || !r.scopes.includes(R) ? O("credential") : r;
|
|
69
|
+
}, q = (e) => ({
|
|
70
|
+
snapshot: {
|
|
71
|
+
id: e.snapshot.id,
|
|
72
|
+
digest: e.snapshot.digest
|
|
73
|
+
},
|
|
74
|
+
token: e.token,
|
|
75
|
+
consumerId: e.consumerId,
|
|
76
|
+
buildId: e.buildId,
|
|
77
|
+
host: e.host,
|
|
78
|
+
path: e.path,
|
|
79
|
+
presentation: n(e.presentation)
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
capture: (t) => S.gen(function* () {
|
|
83
|
+
let { apiKey: n, attemptId: r, releaseId: i } = t, a = t.expectedApplication === void 0 ? void 0 : {
|
|
84
|
+
inputsId: t.expectedApplication.inputsId,
|
|
85
|
+
executionId: t.expectedApplication.executionId,
|
|
86
|
+
code: {
|
|
87
|
+
commit: t.expectedApplication.code.commit,
|
|
88
|
+
artifactDigest: t.expectedApplication.code.artifactDigest,
|
|
89
|
+
configDigest: t.expectedApplication.code.configDigest
|
|
90
|
+
}
|
|
91
|
+
}, l = yield* k("credential", () => w.transactional((e) => K(e, n))), u = yield* k("capture", async () => {
|
|
92
|
+
for await (let t of j.entries()) {
|
|
93
|
+
if (t.key !== "configuration") return O("configuration");
|
|
94
|
+
let n = e(t).value, r = n.execution;
|
|
95
|
+
if (a !== void 0) {
|
|
96
|
+
let e = typeof r == "object" && r && !Array.isArray(r) ? r.id : void 0;
|
|
97
|
+
if (D(a) !== D({
|
|
98
|
+
inputsId: n.inputsId,
|
|
99
|
+
executionId: e,
|
|
100
|
+
code: n.app
|
|
101
|
+
})) return O("configuration");
|
|
102
|
+
}
|
|
103
|
+
let i = typeof r == "object" && r && !Array.isArray(r) ? r.definitions : void 0, o = typeof i == "object" && i && !Array.isArray(i) ? i.value : void 0, s = typeof o == "object" && o && !Array.isArray(o) ? o.frontend : void 0;
|
|
104
|
+
return {
|
|
105
|
+
digest: D(n),
|
|
106
|
+
frontend: s
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return O("configuration");
|
|
110
|
+
}), d = yield* k("capture", () => w.transactional(async (e) => {
|
|
111
|
+
let t = await K(e, n), a = V();
|
|
112
|
+
if (t.id !== l.id) return O("credential");
|
|
113
|
+
let s = D({
|
|
114
|
+
configuration: G,
|
|
115
|
+
retained: u.digest,
|
|
116
|
+
releaseId: i,
|
|
117
|
+
authority: t.id
|
|
118
|
+
});
|
|
119
|
+
return typeof i != "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(i) || typeof r != "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(r) || !Number.isSafeInteger(a + z) || !Number.isFinite(new Date(a + z).getTime()) ? O("capture") : o(e, M, F, {
|
|
120
|
+
id: r,
|
|
121
|
+
contextDigest: s
|
|
122
|
+
}, {
|
|
123
|
+
maxBytes: B,
|
|
124
|
+
now: a,
|
|
125
|
+
capture: (e) => c(e, {
|
|
126
|
+
...A,
|
|
127
|
+
scope: F,
|
|
128
|
+
code: I,
|
|
129
|
+
app: j,
|
|
130
|
+
custody: M,
|
|
131
|
+
routeDiscovery: W,
|
|
132
|
+
frontendManifest: u.frontend,
|
|
133
|
+
alias: L,
|
|
134
|
+
releaseId: i,
|
|
135
|
+
now: a,
|
|
136
|
+
expiresAt: a + z
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
})), f = yield* s(w, M, F, d, V).pipe(S.mapError(() => new E({ reason: "capture" })));
|
|
140
|
+
return yield* k("credential", () => w.transactional(async (e) => {
|
|
141
|
+
if ((await K(e, n)).id !== l.id) return O("credential");
|
|
142
|
+
})), {
|
|
143
|
+
id: f.id,
|
|
144
|
+
digest: f.digest,
|
|
145
|
+
expiresAt: f.expiresAt
|
|
146
|
+
};
|
|
147
|
+
}),
|
|
148
|
+
open: (e) => k("grant", () => l(w, F, e, {
|
|
149
|
+
execution: N,
|
|
150
|
+
key: H,
|
|
151
|
+
now: V,
|
|
152
|
+
verificationKeys: U.filter((e) => e.id !== H.id)
|
|
153
|
+
})),
|
|
154
|
+
read: (e) => k("read", () => {
|
|
155
|
+
let t = q(e);
|
|
156
|
+
return w.transactional((e) => u(e, F, t.snapshot, t, {
|
|
157
|
+
keys: U,
|
|
158
|
+
now: V()
|
|
159
|
+
}));
|
|
160
|
+
}),
|
|
161
|
+
readBinding: (e) => k("read", () => {
|
|
162
|
+
let t = {
|
|
163
|
+
...q(e),
|
|
164
|
+
binding: e.binding
|
|
165
|
+
};
|
|
166
|
+
return w.transactional((e) => d(e, F, t.snapshot, t, {
|
|
167
|
+
keys: U,
|
|
168
|
+
now: V()
|
|
169
|
+
}));
|
|
170
|
+
}),
|
|
171
|
+
readTree: (e) => k("read", () => {
|
|
172
|
+
let t = {
|
|
173
|
+
...q(e),
|
|
174
|
+
name: e.name
|
|
175
|
+
};
|
|
176
|
+
return w.transactional((e) => f(e, F, t.snapshot, t, {
|
|
177
|
+
keys: U,
|
|
178
|
+
now: V()
|
|
179
|
+
}));
|
|
180
|
+
}),
|
|
181
|
+
render: (e) => k("render", () => {
|
|
182
|
+
let t = q(e);
|
|
183
|
+
return p(w, F, t.snapshot, t, {
|
|
184
|
+
keys: U,
|
|
185
|
+
execution: N,
|
|
186
|
+
now: V,
|
|
187
|
+
...P === void 0 ? {} : { output: {
|
|
188
|
+
...P,
|
|
189
|
+
custody: M
|
|
190
|
+
} }
|
|
191
|
+
});
|
|
192
|
+
}).pipe(S.map((e) => e === null ? null : {
|
|
193
|
+
html: e.html,
|
|
194
|
+
head: e.head,
|
|
195
|
+
document: e.document,
|
|
196
|
+
artifactId: e.output?.id ?? null
|
|
197
|
+
})),
|
|
198
|
+
renderSafety: (e) => k("render", () => {
|
|
199
|
+
if (P === void 0) return O("configuration");
|
|
200
|
+
let t = q({
|
|
201
|
+
...e,
|
|
202
|
+
path: "/"
|
|
203
|
+
}), n = m(e.documents);
|
|
204
|
+
return _(w, F, {
|
|
205
|
+
provider: P.provider,
|
|
206
|
+
maxBytes: P.maxBytes,
|
|
207
|
+
admit: async (e) => {
|
|
208
|
+
let r = await h(e, F, t, n, {
|
|
209
|
+
keys: U,
|
|
210
|
+
provider: P.provider,
|
|
211
|
+
use: P.use,
|
|
212
|
+
now: V
|
|
213
|
+
});
|
|
214
|
+
return g(r);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}),
|
|
218
|
+
renderRedirects: (e) => k("render", () => {
|
|
219
|
+
if (P === void 0) return O("configuration");
|
|
220
|
+
let t = q({
|
|
221
|
+
...e,
|
|
222
|
+
path: "/"
|
|
223
|
+
}), n = m(e.documents), r = v(e.safety), i = b(e.targets, t.host);
|
|
224
|
+
return x(w, F, t.snapshot, {
|
|
225
|
+
...t,
|
|
226
|
+
documents: n,
|
|
227
|
+
safety: r,
|
|
228
|
+
targets: i
|
|
229
|
+
}, {
|
|
230
|
+
declaration: {
|
|
231
|
+
types: A.types,
|
|
232
|
+
site: A.site,
|
|
233
|
+
code: I,
|
|
234
|
+
routing: A.routing,
|
|
235
|
+
routeDiscovery: W
|
|
236
|
+
},
|
|
237
|
+
keys: U,
|
|
238
|
+
provider: P.provider,
|
|
239
|
+
use: P.use,
|
|
240
|
+
maxBytes: P.maxBytes,
|
|
241
|
+
now: V
|
|
242
|
+
});
|
|
243
|
+
}),
|
|
244
|
+
renderSeo: (e) => k("render", () => {
|
|
245
|
+
if (P === void 0) return O("configuration");
|
|
246
|
+
let t = q({
|
|
247
|
+
...e,
|
|
248
|
+
path: "/"
|
|
249
|
+
}), n = e.documents === void 0 ? void 0 : m(e.documents), r = e.safety === void 0 ? void 0 : v(e.safety);
|
|
250
|
+
return y(w, F, t.snapshot, {
|
|
251
|
+
...t,
|
|
252
|
+
...n === void 0 ? {} : { documents: n },
|
|
253
|
+
...r === void 0 ? {} : { safety: r }
|
|
254
|
+
}, {
|
|
255
|
+
keys: U,
|
|
256
|
+
provider: P.provider,
|
|
257
|
+
use: P.use,
|
|
258
|
+
maxBytes: P.maxBytes,
|
|
259
|
+
now: V
|
|
260
|
+
});
|
|
261
|
+
})
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
export { E as CmsBuildSnapshotUnavailable, A as createCmsBuildSnapshots };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { publicationStateEntriesTable as e, publicationStatesTable as t } from "./publicationState.js";
|
|
2
|
+
import { buildSnapshotsTable as n, snapshotResourcesTable as r } from "./buildSnapshot.js";
|
|
3
|
+
import { routeDispositionTables as i } from "./routeDispositionStore.js";
|
|
4
|
+
import { cmsPublicRouteTables as a } from "./publicRouteTables.js";
|
|
5
|
+
import { outputActivationTables as o } from "./outputActivationStore.js";
|
|
6
|
+
import { snapshotMediaCapturesTable as s } from "./snapshotMediaCapture.js";
|
|
7
|
+
import { renderReadGrantsTable as c } from "./renderReadGrant.js";
|
|
8
|
+
import { staticPathSetTables as l } from "./staticPathSetStore.js";
|
|
9
|
+
import { buildApplicationCatalogTable as u } from "./buildApplicationCatalogTable.js";
|
|
10
|
+
// src/buildSnapshotTables.ts
|
|
11
|
+
var d = Object.freeze([
|
|
12
|
+
t,
|
|
13
|
+
e,
|
|
14
|
+
n,
|
|
15
|
+
r,
|
|
16
|
+
s,
|
|
17
|
+
c,
|
|
18
|
+
u,
|
|
19
|
+
...l,
|
|
20
|
+
...o,
|
|
21
|
+
...i,
|
|
22
|
+
...a
|
|
23
|
+
]);
|
|
24
|
+
export { d as cmsBuildSnapshotTables };
|
package/dist/bulk.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ContentIdConflict as e, ContentNotFound as t, ContentValidationFailed as n, ReferenceUnavailable as r, ReviewRequired as i, RevisionMismatch as a } from "./errors.js";
|
|
2
|
+
import { asTyped as o } from "./effectForm.js";
|
|
3
3
|
import { applyDerivations as s, publishViolations as c, validateContent as l } from "./validation.js";
|
|
4
4
|
import { CMS_REVISIONS_TABLE as u } from "./contentType.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { pickDeclared as d } from "./contentValues.js";
|
|
6
|
+
import { assertApproved as f } from "./review.js";
|
|
7
|
+
import { assertReferencesAvailable as p } from "./availability.js";
|
|
8
|
+
import { setOwner as m, stewardshipOf as h } from "./stewardship.js";
|
|
9
|
+
import { publishRevision as g, revalidateContent as _, saveDraft as v, unpublish as y } from "./write.js";
|
|
9
10
|
import { addToRelease as b, releaseStatusOf as x } from "./release.js";
|
|
10
11
|
import { and as S, eq as C, id as w, json as T, table as E, text as D, timestamp as O } from "@voltro/database";
|
|
11
12
|
import { tenant as k } from "@voltro/plugin-multitenancy/mixin";
|
|
12
|
-
|
|
13
|
+
// src/bulk.ts
|
|
13
14
|
var A = async (e, t, n, r) => (await e.query({
|
|
14
15
|
table: t,
|
|
15
16
|
predicate: S(C("id", n), C("site", r.site), C("environment", r.environment), C("locale", r.locale)),
|
|
@@ -27,11 +28,11 @@ var A = async (e, t, n, r) => (await e.query({
|
|
|
27
28
|
if (typeof n == "string" && n !== "") return n;
|
|
28
29
|
}
|
|
29
30
|
return t;
|
|
30
|
-
}, M = (e) => e.targets.map((e) => `${e.path}: ${e.reason}`), N = async (e, t,
|
|
31
|
+
}, M = (e) => e.targets.map((e) => `${e.path}: ${e.reason}`), N = async (e, t, a, o, m) => {
|
|
31
32
|
let g = (e, t = {}) => ({
|
|
32
|
-
...
|
|
33
|
+
...m,
|
|
33
34
|
documentId: null,
|
|
34
|
-
title:
|
|
35
|
+
title: m.id,
|
|
35
36
|
revisionId: null,
|
|
36
37
|
disposition: "blocked",
|
|
37
38
|
reason: e,
|
|
@@ -40,52 +41,52 @@ var A = async (e, t, n, r) => (await e.query({
|
|
|
40
41
|
});
|
|
41
42
|
if (t === void 0) return g("unknownType");
|
|
42
43
|
let _ = {
|
|
43
|
-
...
|
|
44
|
-
locale:
|
|
45
|
-
}, v = await A(e, `${t.name}_drafts`,
|
|
44
|
+
...a,
|
|
45
|
+
locale: m.locale
|
|
46
|
+
}, v = await A(e, `${t.name}_drafts`, m.id, _);
|
|
46
47
|
if (v === void 0) return g("notFound");
|
|
47
48
|
let y = {
|
|
48
49
|
documentId: String(v.documentId),
|
|
49
|
-
title: j(v,
|
|
50
|
+
title: j(v, m.id)
|
|
50
51
|
}, b = (e, t = null) => ({
|
|
51
|
-
...
|
|
52
|
+
...m,
|
|
52
53
|
...y,
|
|
53
54
|
revisionId: t,
|
|
54
55
|
disposition: e,
|
|
55
56
|
reason: null,
|
|
56
57
|
detail: []
|
|
57
58
|
});
|
|
58
|
-
if (o.kind === "unpublish") return await A(e, `${t.name}_published`,
|
|
59
|
-
if (o.kind === "setOwner") return b((await
|
|
59
|
+
if (o.kind === "unpublish") return await A(e, `${t.name}_published`, m.id, _) === void 0 ? g("notPublished", y) : b("ready");
|
|
60
|
+
if (o.kind === "setOwner") return b((await h(e, t, y.documentId, a)).owner === o.owner ? "unchanged" : "ready");
|
|
60
61
|
if (o.kind === "setField") {
|
|
61
62
|
let e = t.fields[o.field];
|
|
62
63
|
if (e === void 0 || e.derived !== void 0 || e.kind === "richText" || e.kind === "components") return g("invalid", {
|
|
63
64
|
...y,
|
|
64
65
|
detail: [`${o.field}: not a field this can set`]
|
|
65
66
|
});
|
|
66
|
-
let
|
|
67
|
-
if (JSON.stringify(v[o.field] ?? null) === JSON.stringify(o.value ?? null)) return b("unchanged",
|
|
67
|
+
let r = String(v.revisionId);
|
|
68
|
+
if (JSON.stringify(v[o.field] ?? null) === JSON.stringify(o.value ?? null)) return b("unchanged", r);
|
|
68
69
|
try {
|
|
69
|
-
l(t, s(t,
|
|
70
|
+
l(t, s(t, d(t, {
|
|
70
71
|
...v,
|
|
71
72
|
[o.field]: o.value
|
|
72
73
|
})));
|
|
73
74
|
} catch (e) {
|
|
74
|
-
if (e instanceof
|
|
75
|
+
if (e instanceof n) return g("invalid", {
|
|
75
76
|
...y,
|
|
76
|
-
revisionId:
|
|
77
|
+
revisionId: r,
|
|
77
78
|
detail: e.violations.map((e) => `${e.field}: ${e.message}`)
|
|
78
79
|
});
|
|
79
80
|
throw e;
|
|
80
81
|
}
|
|
81
|
-
return b("ready",
|
|
82
|
+
return b("ready", r);
|
|
82
83
|
}
|
|
83
84
|
let S = String(v.revisionId);
|
|
84
85
|
if (o.kind === "addToRelease" && await x(e, o.releaseId) !== "draft") return g("releaseClosed", {
|
|
85
86
|
...y,
|
|
86
87
|
revisionId: S
|
|
87
88
|
});
|
|
88
|
-
if ((await A(e, `${t.name}_published`,
|
|
89
|
+
if ((await A(e, `${t.name}_published`, m.id, _))?.revisionId === S) return b("unchanged", S);
|
|
89
90
|
try {
|
|
90
91
|
let [n] = await e.query({
|
|
91
92
|
table: u,
|
|
@@ -100,13 +101,13 @@ var A = async (e, t, n, r) => (await e.query({
|
|
|
100
101
|
revisionId: S,
|
|
101
102
|
detail: i.map((e) => e.field)
|
|
102
103
|
});
|
|
103
|
-
await
|
|
104
|
+
await f(e, t, m.id, _, S), await p(e, t, m.id, r, _);
|
|
104
105
|
} catch (e) {
|
|
105
|
-
if (e instanceof
|
|
106
|
+
if (e instanceof i) return g("reviewRequired", {
|
|
106
107
|
...y,
|
|
107
108
|
revisionId: S
|
|
108
109
|
});
|
|
109
|
-
if (e instanceof
|
|
110
|
+
if (e instanceof r) return g("referenceUnavailable", {
|
|
110
111
|
...y,
|
|
111
112
|
revisionId: S,
|
|
112
113
|
detail: M(e)
|
|
@@ -118,82 +119,82 @@ var A = async (e, t, n, r) => (await e.query({
|
|
|
118
119
|
let a = new Map(t.map((e) => [e.name, e])), o = [];
|
|
119
120
|
for (let t of i) o.push(await N(e, a.get(t.type), n, r, t));
|
|
120
121
|
return o;
|
|
121
|
-
}, F = async (e,
|
|
122
|
-
let u = new Map(
|
|
123
|
-
for (let
|
|
122
|
+
}, F = async (e, o, s, c, l) => {
|
|
123
|
+
let u = new Map(o.map((e) => [e.name, e])), f = [], p = /* @__PURE__ */ new Set();
|
|
124
|
+
for (let o of l) {
|
|
124
125
|
let l = {
|
|
125
|
-
type:
|
|
126
|
-
id:
|
|
127
|
-
locale:
|
|
128
|
-
title:
|
|
126
|
+
type: o.type,
|
|
127
|
+
id: o.id,
|
|
128
|
+
locale: o.locale,
|
|
129
|
+
title: o.title
|
|
129
130
|
};
|
|
130
|
-
if (
|
|
131
|
-
|
|
131
|
+
if (o.disposition !== "ready") {
|
|
132
|
+
f.push({
|
|
132
133
|
...l,
|
|
133
|
-
outcome:
|
|
134
|
-
reason:
|
|
135
|
-
detail:
|
|
134
|
+
outcome: o.disposition === "unchanged" ? "unchanged" : "failed",
|
|
135
|
+
reason: o.reason,
|
|
136
|
+
detail: o.detail
|
|
136
137
|
});
|
|
137
138
|
continue;
|
|
138
139
|
}
|
|
139
|
-
let
|
|
140
|
+
let h = u.get(o.type), _ = {
|
|
140
141
|
...s,
|
|
141
|
-
locale:
|
|
142
|
+
locale: o.locale
|
|
142
143
|
};
|
|
143
144
|
try {
|
|
144
|
-
if (
|
|
145
|
-
contentType:
|
|
146
|
-
id:
|
|
145
|
+
if (h === void 0) throw new t({
|
|
146
|
+
contentType: o.type,
|
|
147
|
+
id: o.id,
|
|
147
148
|
stage: "draft"
|
|
148
149
|
});
|
|
149
|
-
if (c.kind === "publish") await e.transactional((e) => g(e,
|
|
150
|
+
if (c.kind === "publish") await e.transactional((e) => g(e, h, o.id, _, o.revisionId ?? "")), p.add(h);
|
|
150
151
|
else if (c.kind === "addToRelease") await e.transactional((e) => b(e, c.releaseId, {
|
|
151
|
-
type:
|
|
152
|
-
id:
|
|
153
|
-
locale:
|
|
152
|
+
type: h,
|
|
153
|
+
id: o.id,
|
|
154
|
+
locale: o.locale,
|
|
154
155
|
action: "publish",
|
|
155
|
-
revisionId:
|
|
156
|
+
revisionId: o.revisionId ?? ""
|
|
156
157
|
}));
|
|
157
|
-
else if (c.kind === "unpublish") await e.transactional((e) => y(e,
|
|
158
|
+
else if (c.kind === "unpublish") await e.transactional((e) => y(e, h, o.id, _)), p.add(h);
|
|
158
159
|
else if (c.kind === "setField") await e.transactional(async (e) => {
|
|
159
|
-
let
|
|
160
|
-
if (
|
|
161
|
-
contentType:
|
|
162
|
-
id:
|
|
160
|
+
let n = await A(e, `${h.name}_drafts`, o.id, _);
|
|
161
|
+
if (n === void 0) throw new t({
|
|
162
|
+
contentType: o.type,
|
|
163
|
+
id: o.id,
|
|
163
164
|
stage: "draft"
|
|
164
165
|
});
|
|
165
|
-
await v(e,
|
|
166
|
-
...h
|
|
167
|
-
id:
|
|
166
|
+
await v(e, h, {
|
|
167
|
+
...d(h, n),
|
|
168
|
+
id: o.id,
|
|
168
169
|
[c.field]: c.value
|
|
169
|
-
}, _,
|
|
170
|
+
}, _, o.revisionId === null ? {} : { expectedRevision: o.revisionId });
|
|
170
171
|
});
|
|
171
172
|
else {
|
|
172
|
-
if (
|
|
173
|
-
contentType:
|
|
174
|
-
id:
|
|
173
|
+
if (o.documentId === null) throw new t({
|
|
174
|
+
contentType: o.type,
|
|
175
|
+
id: o.id,
|
|
175
176
|
stage: "draft"
|
|
176
177
|
});
|
|
177
|
-
await
|
|
178
|
+
await m(e, h, o.documentId, s, c.owner);
|
|
178
179
|
}
|
|
179
|
-
|
|
180
|
+
f.push({
|
|
180
181
|
...l,
|
|
181
182
|
outcome: "done",
|
|
182
183
|
reason: null,
|
|
183
184
|
detail: []
|
|
184
185
|
});
|
|
185
186
|
} catch (e) {
|
|
186
|
-
let
|
|
187
|
-
|
|
187
|
+
let o = e instanceof i ? "reviewRequired" : e instanceof a ? "revisionMoved" : e instanceof n ? "incomplete" : e instanceof r ? "referenceUnavailable" : e instanceof t ? e.stage === "published" ? "notPublished" : "notFound" : "failed", s = e instanceof r ? M(e) : e instanceof n ? e.violations.map((e) => e.field) : o === "failed" ? [e instanceof Error ? e.message : String(e)] : [];
|
|
188
|
+
f.push({
|
|
188
189
|
...l,
|
|
189
190
|
outcome: "failed",
|
|
190
|
-
reason:
|
|
191
|
+
reason: o,
|
|
191
192
|
detail: s
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
|
-
for (let e of
|
|
196
|
-
return
|
|
196
|
+
for (let e of p) _(e);
|
|
197
|
+
return f;
|
|
197
198
|
}, I = "cms_bulk_runs", L = E(I, {
|
|
198
199
|
id: w({ prefix: "cbrn" }),
|
|
199
200
|
site: D().maxLength(64),
|
|
@@ -270,12 +271,11 @@ var A = async (e, t, n, r) => (await e.query({
|
|
|
270
271
|
skip: void 0,
|
|
271
272
|
projection: ["id"]
|
|
272
273
|
})).map((e) => String(e.id)), U = [
|
|
274
|
+
e,
|
|
273
275
|
t,
|
|
274
276
|
n,
|
|
275
277
|
r,
|
|
276
278
|
i,
|
|
277
|
-
a
|
|
278
|
-
|
|
279
|
-
], W = (...t) => e(() => P(...t), ...U), G = (...t) => e(() => F(...t), ...U), K = (...t) => e(() => z(...t)), q = (...t) => e(() => B(...t)), J = (...t) => e(() => V(...t)), Y = (...t) => e(() => H(...t));
|
|
280
|
-
//#endregion
|
|
279
|
+
a
|
|
280
|
+
], W = (...e) => o(() => P(...e), ...U), G = (...e) => o(() => F(...e), ...U), K = (...e) => o(() => z(...e)), q = (...e) => o(() => B(...e)), J = (...e) => o(() => V(...e)), Y = (...e) => o(() => H(...e));
|
|
281
281
|
export { I as CMS_BULK_RUNS_TABLE, V as bulkRunState, J as bulkRunStateEffect, L as cmsBulkRunsTable, B as continueBulkRun, q as continueBulkRunEffect, P as planBulk, W as planBulkEffect, F as runBulk, G as runBulkEffect, z as startBulkRun, K as startBulkRunEffect, H as unfinishedBulkRuns, Y as unfinishedBulkRunsEffect };
|
package/dist/cacheIdentity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/cacheIdentity.ts
|
|
2
2
|
var e = /^(utm_[a-z]+|fbclid|gclid|dclid|msclkid|mc_[a-z]+|_ga|_gl|ref)$/i, t = (e) => {
|
|
3
3
|
let t = 2166136261;
|
|
4
4
|
for (let n of e) t ^= n.codePointAt(0) ?? 0, t = Math.imul(t, 16777619) >>> 0;
|
|
@@ -148,5 +148,4 @@ var e = /^(utm_[a-z]+|fbclid|gclid|dclid|msclkid|mc_[a-z]+|_ga|_gl|ref)$/i, t =
|
|
|
148
148
|
...o
|
|
149
149
|
};
|
|
150
150
|
};
|
|
151
|
-
//#endregion
|
|
152
151
|
export { c as compileCacheIdentity, s as contractVariants, u as edgeHeaders, l as sharedCacheable };
|