@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.
Files changed (243) hide show
  1. package/CHANGELOG.md +5484 -0
  2. package/README.md +138 -0
  3. package/THIRD-PARTY-NOTICES.md +1511 -276
  4. package/dist/ContentForm.js +1 -2
  5. package/dist/RichDocumentEditor.js +1 -2
  6. package/dist/RichDocumentView.js +82 -38
  7. package/dist/RichTextSurface.js +1 -2
  8. package/dist/aiCandidates.js +4 -5
  9. package/dist/aiOperations.js +1 -2
  10. package/dist/applicationBuildSnapshotService.js +100 -0
  11. package/dist/assetRenditions.js +101 -0
  12. package/dist/assetRevision.js +45 -0
  13. package/dist/assetUseRights.js +71 -0
  14. package/dist/audiences.js +1 -2
  15. package/dist/availability.js +20 -18
  16. package/dist/blueprint.js +76 -77
  17. package/dist/build.d.ts +3063 -0
  18. package/dist/build.js +37 -0
  19. package/dist/buildApplicationAdmission.js +15 -0
  20. package/dist/buildApplicationCatalog.js +135 -0
  21. package/dist/buildApplicationCatalogTable.js +23 -0
  22. package/dist/buildApplicationRest.js +98 -0
  23. package/dist/buildApplicationUpload.js +110 -0
  24. package/dist/buildSnapshot.js +400 -0
  25. package/dist/buildSnapshotApplicationPin.js +31 -0
  26. package/dist/buildSnapshotRest.js +209 -0
  27. package/dist/buildSnapshotService.js +264 -0
  28. package/dist/buildSnapshotTables.js +24 -0
  29. package/dist/bulk.js +72 -72
  30. package/dist/cacheIdentity.js +1 -2
  31. package/dist/changes.js +280 -64
  32. package/dist/cmsContext.js +1 -2
  33. package/dist/collections.js +1 -2
  34. package/dist/consent.js +6 -7
  35. package/dist/contentLocations.js +52 -0
  36. package/dist/contentProjection.js +82 -0
  37. package/dist/contentRouteIdentity.js +12 -0
  38. package/dist/contentRouteMaterializer.js +96 -0
  39. package/dist/contentRouteTypes.js +38 -0
  40. package/dist/contentSeo.js +188 -0
  41. package/dist/contentTreePath.js +59 -0
  42. package/dist/contentType.js +121 -105
  43. package/dist/contentValues.js +17 -0
  44. package/dist/contentfulImport.js +1 -2
  45. package/dist/copies.js +4 -5
  46. package/dist/cutover.js +1 -2
  47. package/dist/deliveryChecks.js +1 -2
  48. package/dist/domainHost.js +6 -0
  49. package/dist/domains.js +82 -89
  50. package/dist/draftTexts.js +38 -39
  51. package/dist/duplicates.js +24 -25
  52. package/dist/edgePurge.js +1 -2
  53. package/dist/editHistory.js +1 -2
  54. package/dist/effectForm.js +1 -2
  55. package/dist/environmentAliases.js +137 -0
  56. package/dist/environments.js +108 -71
  57. package/dist/errors.js +55 -16
  58. package/dist/experiments.js +8 -9
  59. package/dist/exposure.js +1 -2
  60. package/dist/extensionManifest.js +2 -3
  61. package/dist/extensions.js +1 -2
  62. package/dist/fieldSchema.js +1 -2
  63. package/dist/formStrings.js +1 -2
  64. package/dist/frontendBindings.js +98 -0
  65. package/dist/frontendMedia.js +17 -0
  66. package/dist/glossary.js +1 -2
  67. package/dist/history.js +1 -2
  68. package/dist/htmlImport.js +1 -2
  69. package/dist/index.d.ts +760 -47
  70. package/dist/index.js +89 -73
  71. package/dist/initializePublicRoutes.js +27 -0
  72. package/dist/liveContentRouteView.js +75 -0
  73. package/dist/media.js +1 -2
  74. package/dist/metrics.js +1 -2
  75. package/dist/migration.js +1 -2
  76. package/dist/migrationStages.js +1 -2
  77. package/dist/nativeOutputDeploymentService.js +204 -0
  78. package/dist/outputActivation.js +233 -0
  79. package/dist/outputActivationOrigin.js +50 -0
  80. package/dist/outputActivationStore.js +410 -0
  81. package/dist/outputActivationTables.js +10 -0
  82. package/dist/outputActivationTarget.js +80 -0
  83. package/dist/outputActivationTargetTable.js +24 -0
  84. package/dist/outputDeployment.js +173 -0
  85. package/dist/outputDeploymentRest.js +167 -0
  86. package/dist/outputDeploymentService.js +240 -0
  87. package/dist/outputRouteGraph.js +176 -0
  88. package/dist/outputSafetyArtifact.js +146 -0
  89. package/dist/outputTargetRest.js +61 -0
  90. package/dist/pathSegmentEncoding.js +3 -0
  91. package/dist/presenceAnchors.js +1 -2
  92. package/dist/preview.js +1 -2
  93. package/dist/privateCmsTransport.js +75 -0
  94. package/dist/privateNativeRouteReservation.js +9 -0
  95. package/dist/promotion.js +69 -61
  96. package/dist/publicBuild.js +89 -0
  97. package/dist/publicBuildRest.js +97 -0
  98. package/dist/publicBuildService.js +62 -0
  99. package/dist/publicOutputHttp.js +128 -0
  100. package/dist/publicOutputService.js +286 -0
  101. package/dist/publicPresentation.js +16 -0
  102. package/dist/publicRouteDispositionAdmission.js +37 -0
  103. package/dist/publicRouteHistoryStore.js +11 -0
  104. package/dist/publicRouteHistoryView.js +33 -0
  105. package/dist/publicRouteIntegrity.js +4 -0
  106. package/dist/publicRouteMutation.js +5 -0
  107. package/dist/publicRouteNamespace.js +133 -0
  108. package/dist/publicRoutePublication.js +35 -0
  109. package/dist/publicRouteRegistry.js +16 -0
  110. package/dist/publicRouteRegistryBinding.js +193 -0
  111. package/dist/publicRouteRegistryDefinition.js +75 -0
  112. package/dist/publicRouteSitePublication.js +39 -0
  113. package/dist/publicRouteTables.js +12 -0
  114. package/dist/publicRouteUrl.js +17 -0
  115. package/dist/publicationSeo.js +51 -0
  116. package/dist/publicationState.js +295 -0
  117. package/dist/quality.js +9 -10
  118. package/dist/reconfigurePublicRoutes.js +40 -0
  119. package/dist/recurrence.js +1 -2
  120. package/dist/redirects.js +105 -75
  121. package/dist/referenceGraph.js +16 -16
  122. package/dist/references.js +3 -4
  123. package/dist/release.js +178 -143
  124. package/dist/renderReadAuthority.js +42 -0
  125. package/dist/renderReadGrant.js +136 -0
  126. package/dist/rest.js +1 -2
  127. package/dist/review.js +29 -30
  128. package/dist/richDocument.js +56 -27
  129. package/dist/richInline.js +1 -2
  130. package/dist/routeDispositionGraph.js +43 -0
  131. package/dist/routeDispositionRest.js +50 -0
  132. package/dist/routeDispositionService.js +72 -0
  133. package/dist/routeDispositionStore.js +288 -0
  134. package/dist/routeDispositionTables.js +4 -0
  135. package/dist/routeDispositions.js +90 -0
  136. package/dist/routeHistoryStorage.js +319 -0
  137. package/dist/routeHistoryStore.js +11 -0
  138. package/dist/schedule.js +37 -38
  139. package/dist/search.js +1 -2
  140. package/dist/selectionIntent.js +1 -2
  141. package/dist/seo.js +2 -3
  142. package/dist/series.js +12 -13
  143. package/dist/share.js +14 -15
  144. package/dist/siteBindings.js +158 -0
  145. package/dist/siteBuildCandidate.js +103 -0
  146. package/dist/siteDelivery.js +114 -0
  147. package/dist/siteState.js +46 -0
  148. package/dist/snapshotAddressGraph.js +54 -0
  149. package/dist/snapshotAddressRead.js +72 -0
  150. package/dist/snapshotAppConsumer.js +70 -0
  151. package/dist/snapshotAppExecution.js +101 -0
  152. package/dist/snapshotApplication.js +74 -0
  153. package/dist/snapshotApprovedRouteDispositions.js +43 -0
  154. package/dist/snapshotAssetAssembly.js +69 -0
  155. package/dist/snapshotAssetAssemblyRest.js +49 -0
  156. package/dist/snapshotBindingRead.js +60 -0
  157. package/dist/snapshotCodeSeo.js +28 -0
  158. package/dist/snapshotComponent.js +33 -0
  159. package/dist/snapshotComponentSource.js +23 -0
  160. package/dist/snapshotConsumer.js +86 -0
  161. package/dist/snapshotContentIdentity.js +9 -0
  162. package/dist/snapshotDefinitions.js +263 -0
  163. package/dist/snapshotDocumentAssembly.js +192 -0
  164. package/dist/snapshotDocumentAssemblyRest.js +83 -0
  165. package/dist/snapshotDocumentProjection.js +201 -0
  166. package/dist/snapshotDocumentTransfer.js +34 -0
  167. package/dist/snapshotDocumentTransferRest.js +79 -0
  168. package/dist/snapshotDomains.js +55 -0
  169. package/dist/snapshotEnvironment.js +30 -0
  170. package/dist/snapshotFieldPlan.js +84 -0
  171. package/dist/snapshotFrontend.js +102 -0
  172. package/dist/snapshotLink.js +7 -0
  173. package/dist/snapshotMedia.js +110 -0
  174. package/dist/snapshotMediaCapture.js +245 -0
  175. package/dist/snapshotMediaFields.js +224 -0
  176. package/dist/snapshotMediaRead.js +184 -0
  177. package/dist/snapshotMediaReader.js +12 -0
  178. package/dist/snapshotObservation.js +15 -0
  179. package/dist/snapshotObservedRouteHistory.js +33 -0
  180. package/dist/snapshotOutputTransfer.js +77 -0
  181. package/dist/snapshotPageLoader.js +6 -0
  182. package/dist/snapshotPageSeo.js +58 -0
  183. package/dist/snapshotPathLocale.js +14 -0
  184. package/dist/snapshotPresentation.js +85 -0
  185. package/dist/snapshotPresentationPolicy.js +11 -0
  186. package/dist/snapshotProjection.js +118 -0
  187. package/dist/snapshotPublicAccess.js +160 -0
  188. package/dist/snapshotPublicRouteHistory.js +39 -0
  189. package/dist/snapshotReadAdmission.js +37 -0
  190. package/dist/snapshotRedirectOutput.js +150 -0
  191. package/dist/snapshotRedirectTargets.js +23 -0
  192. package/dist/snapshotRedirects.js +131 -0
  193. package/dist/snapshotReference.js +7 -0
  194. package/dist/snapshotReferenceAddress.js +9 -0
  195. package/dist/snapshotReferenceGraph.js +78 -0
  196. package/dist/snapshotReferenceRead.js +64 -0
  197. package/dist/snapshotRelease.js +98 -0
  198. package/dist/snapshotRender.js +360 -0
  199. package/dist/snapshotRenderDependencies.js +177 -0
  200. package/dist/snapshotRenditions.js +87 -0
  201. package/dist/snapshotRichDocument.js +61 -0
  202. package/dist/snapshotRoleTransfer.js +105 -0
  203. package/dist/snapshotRoleTransferRest.js +98 -0
  204. package/dist/snapshotRouteAdmission.js +70 -0
  205. package/dist/snapshotRouteDispatch.js +110 -0
  206. package/dist/snapshotRouteDispositionPlan.js +72 -0
  207. package/dist/snapshotRouteRead.js +42 -0
  208. package/dist/snapshotRoutes.js +78 -0
  209. package/dist/snapshotRouting.js +112 -0
  210. package/dist/snapshotSeo.js +178 -0
  211. package/dist/snapshotSeoControls.js +100 -0
  212. package/dist/snapshotSeoDocumentInventory.js +114 -0
  213. package/dist/snapshotSeoDocuments.js +128 -0
  214. package/dist/snapshotSeoMerge.js +84 -0
  215. package/dist/snapshotSeoMetadata.js +136 -0
  216. package/dist/snapshotSeoOutput.js +172 -0
  217. package/dist/snapshotSeoPathSets.js +104 -0
  218. package/dist/snapshotSeoRead.js +87 -0
  219. package/dist/snapshotSite.js +127 -0
  220. package/dist/snapshotSitemapFiles.js +35 -0
  221. package/dist/snapshotTreeDependencies.js +57 -0
  222. package/dist/snapshotTreeLoader.js +9 -0
  223. package/dist/snapshotTreeRead.js +157 -0
  224. package/dist/staticPathSet.js +176 -0
  225. package/dist/staticPathSetRest.js +128 -0
  226. package/dist/staticPathSetService.js +248 -0
  227. package/dist/staticPathSetStore.js +337 -0
  228. package/dist/stewardship.js +2 -3
  229. package/dist/taxonomy.js +1 -2
  230. package/dist/team.js +1 -2
  231. package/dist/templates.js +2 -3
  232. package/dist/trackChanges.js +1 -2
  233. package/dist/translation.js +1 -2
  234. package/dist/tree.js +10 -11
  235. package/dist/usage.js +1 -2
  236. package/dist/validation.js +54 -55
  237. package/dist/visualEditing.js +1 -2
  238. package/dist/web.d.ts +709 -7
  239. package/dist/web.js +50 -33
  240. package/dist/workflow.js +9 -10
  241. package/dist/write.js +251 -227
  242. package/dist/xliff.js +1 -2
  243. package/package.json +21 -7
@@ -0,0 +1,192 @@
1
+ import { copySnapshotResource as e } from "./buildSnapshot.js";
2
+ import { admitSnapshotPresentation as t, snapshotPresentations as n } from "./snapshotPresentation.js";
3
+ import { readCapturedSnapshotConsentPurposes as r } from "./snapshotPresentationPolicy.js";
4
+ import { SnapshotSeoReadUnavailable as i } from "./snapshotSeoRead.js";
5
+ import { copySnapshotPathSetSelection as a, readSnapshotPathSets as o } from "./snapshotSeoPathSets.js";
6
+ import { readSnapshotSeoDocuments as s } from "./snapshotSeoDocuments.js";
7
+ import { createHash as c } from "node:crypto";
8
+ import { canonicalJson as l } from "@voltro/runtime";
9
+ // src/snapshotDocumentAssembly.ts
10
+ var u = () => {
11
+ throw new i({ reason: "binding" });
12
+ }, d = (e) => c("sha256").update(l(e)).digest("hex"), f = (e) => typeof e == "string" && /^[a-f0-9]{64}$/.test(e), p = (e, t) => typeof e != "object" || !e || Array.isArray(e) || Object.keys(e).sort().join(",") !== t ? u() : e, m = (e, t) => Number.isSafeInteger(e) && Number(e) >= 0 && Number(e) <= t, h = 1e5, g = 67108864, _ = 8192, v = "voltro.cms-document-assembly/v1", y = (i) => {
13
+ let { store: c, provider: y } = i, b = {
14
+ tenantId: i.scope.tenantId,
15
+ site: i.scope.site,
16
+ environment: i.scope.environment
17
+ }, x = { ...i.use }, S = i.keys.map((e) => ({
18
+ id: e.id,
19
+ material: new Uint8Array(e.material)
20
+ })), C = i.now ?? Date.now, w = (e) => ({
21
+ snapshot: {
22
+ id: e.snapshot.id,
23
+ digest: e.snapshot.digest
24
+ },
25
+ token: e.token,
26
+ consumerId: e.consumerId,
27
+ buildId: e.buildId,
28
+ host: e.host,
29
+ ...a({ pathSets: e.pathSets })
30
+ }), T = async (e) => c.transactional(async (t) => {
31
+ let i = await o(t, b, e, { pathSets: e.pathSets }, {
32
+ keys: S,
33
+ now: C
34
+ }), a = i.admission;
35
+ if (a.app.web === void 0) return u();
36
+ let s = await r(t, b, a.admission.snapshot, a.admission.configuration.app), c = [...n(s, 257)].sort((e, t) => d(e) < d(t) ? -1 : +(d(e) > d(t)));
37
+ return {
38
+ paths: i,
39
+ consentPurposes: s,
40
+ presentations: c,
41
+ binding: {
42
+ scope: b,
43
+ snapshot: e.snapshot,
44
+ consumerId: e.consumerId,
45
+ buildId: e.buildId,
46
+ host: e.host,
47
+ inputsId: a.app.inputsId,
48
+ executionId: a.app.executionId,
49
+ pathSets: [...i.selection.pathSets].sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)),
50
+ consentPurposes: s,
51
+ presentations: c
52
+ }
53
+ };
54
+ }), E = (e, t) => {
55
+ if (l(e.binding) !== l(t.binding) || l(e.paths.entries) !== l(t.paths.entries) || l(e.paths.contexts) !== l(t.paths.contexts)) return u();
56
+ }, D = async (e) => {
57
+ if (!f(e) || y.read === void 0) return u();
58
+ let t = await y.read(e);
59
+ return t.id !== e || d(t.manifest) !== e || t.manifest.version !== 1 || t.manifest.files.length !== 0 ? u() : t.manifest.subject;
60
+ }, O = async (e) => {
61
+ let t = await y.begin();
62
+ try {
63
+ let n = await t.seal(e);
64
+ return !f(n.id) || n.id !== d({
65
+ version: 1,
66
+ subject: e,
67
+ files: []
68
+ }) ? u() : n.id;
69
+ } catch (e) {
70
+ throw await t.abort(), e;
71
+ }
72
+ }, k = (e) => !f(e.headerId) || !f(e.tipId) ? u() : {
73
+ headerId: e.headerId,
74
+ tipId: e.tipId
75
+ }, A = async (e, t) => {
76
+ let n = p(await D(e.headerId), "binding,profile,version");
77
+ if (n.version !== 1 || n.profile !== v || l(n.binding) !== l(t.binding)) return u();
78
+ }, j = (n, r) => {
79
+ let i = e({
80
+ key: "document-assembly",
81
+ value: { documents: n }
82
+ }).value.documents;
83
+ if (!Array.isArray(i) || i.length === 0 || i.length > h || Buffer.byteLength(l(i)) > _) return u();
84
+ let a = new Map(r.paths.entries.map((e) => [e.path, e]));
85
+ return i.map((e) => {
86
+ let n = p(e, "artifactId,path,presentation,routeId,url"), i = a.get(String(n.path));
87
+ return !f(n.artifactId) || i === void 0 || n.routeId !== i.routeId || n.url !== "https://" + i.host + i.path ? u() : {
88
+ url: String(n.url),
89
+ path: i.path,
90
+ routeId: i.routeId,
91
+ artifactId: n.artifactId,
92
+ presentation: t(r.consentPurposes, n.presentation)
93
+ };
94
+ });
95
+ }, M = async (e, t, n) => {
96
+ if (e === t.headerId) return {
97
+ previousId: null,
98
+ count: 0,
99
+ bytes: 0,
100
+ documents: []
101
+ };
102
+ let r = p(await D(e), "bytes,count,documents,headerId,previousId,profile,version");
103
+ return r.version !== 1 || r.profile !== v || r.headerId !== t.headerId || !f(r.previousId) || !m(r.count, h) || !m(r.bytes, g) ? u() : {
104
+ previousId: r.previousId,
105
+ count: r.count,
106
+ bytes: r.bytes,
107
+ documents: j(r.documents, n)
108
+ };
109
+ };
110
+ return {
111
+ begin: async (e) => {
112
+ let t = w(e), n = await T(t), r = await O({
113
+ version: 1,
114
+ profile: v,
115
+ binding: n.binding
116
+ });
117
+ return E(n, await T(t)), {
118
+ headerId: r,
119
+ tipId: r,
120
+ count: 0,
121
+ bytes: 0
122
+ };
123
+ },
124
+ append: async (t) => {
125
+ let n = w(t), r = k(t), i = e({
126
+ key: "document-assembly",
127
+ value: { documents: t.documents }
128
+ }).value.documents, a = await T(n), o = j(i, a);
129
+ await A(r, a);
130
+ let s = await M(r.tipId, r, a), c = s.count + o.length, d = s.bytes + Buffer.byteLength(l(o));
131
+ if (c > h || d > g) return u();
132
+ let f = await O({
133
+ version: 1,
134
+ profile: v,
135
+ headerId: r.headerId,
136
+ previousId: r.tipId,
137
+ count: c,
138
+ bytes: d,
139
+ documents: o
140
+ });
141
+ return E(a, await T(n)), {
142
+ headerId: r.headerId,
143
+ tipId: f,
144
+ count: c,
145
+ bytes: d
146
+ };
147
+ },
148
+ seal: async (e) => {
149
+ let t = w(e), n = k(e), r = await T(t);
150
+ if (y.composeDocuments === void 0) return u();
151
+ await A(n, r);
152
+ let i = [], a = /* @__PURE__ */ new Set(), o = n.tipId, d, p = 0, _ = 0;
153
+ for (;;) {
154
+ if (a.has(o) || a.size > h) return u();
155
+ a.add(o);
156
+ let e = await M(o, n, r);
157
+ if (d !== void 0 && (e.count + d.documents.length !== d.count || e.bytes + Buffer.byteLength(l(d.documents)) !== d.bytes) || (p += e.documents.length, _ += e.documents.length === 0 ? 0 : Buffer.byteLength(l(e.documents)), p > h || _ > g)) return u();
158
+ if (e.previousId === null) break;
159
+ i.push(e.documents), d = e, o = e.previousId;
160
+ }
161
+ let v = i.reverse().flat(), D = r.paths.admission.app, O = await y.composeDocuments({
162
+ snapshotDigest: t.snapshot.digest,
163
+ inputsId: D.inputsId,
164
+ executionId: D.executionId,
165
+ selector: [
166
+ "1",
167
+ t.snapshot.digest,
168
+ D.inputsId,
169
+ D.executionId
170
+ ].join("."),
171
+ pathSetIds: r.paths.selection.pathSets.map((e) => e.digest).sort(),
172
+ consentPurposes: r.consentPurposes,
173
+ presentations: r.presentations,
174
+ documents: v
175
+ });
176
+ return !f(O.id) || O.documents !== p || !m(O.bytes, 1073741824) ? u() : (E(r, await T(t)), await c.transactional((e) => s(e, b, t, {
177
+ artifactId: O.id,
178
+ pathSets: t.pathSets
179
+ }, {
180
+ provider: y,
181
+ use: x,
182
+ keys: S,
183
+ now: C
184
+ })), E(r, await T(t)), {
185
+ artifactId: O.id,
186
+ documents: O.documents,
187
+ bytes: O.bytes
188
+ });
189
+ }
190
+ };
191
+ };
192
+ export { y as createSnapshotDocumentAssembly };
@@ -0,0 +1,83 @@
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
+ // 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
+ export { p as cmsDocumentAssemblyRest };
@@ -0,0 +1,201 @@
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
+ // 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
+ export { _ as projectSnapshotDocument };
@@ -0,0 +1,34 @@
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
+ // 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
+ export { o as createSnapshotDocumentTransfer };
@@ -0,0 +1,79 @@
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
+ // 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
+ export { s as cmsSnapshotDocumentTransferRest };
@@ -0,0 +1,55 @@
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
+ // 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
+ export { d as snapshotDomainSource };
@@ -0,0 +1,30 @@
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
+ // 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
+ export { r as snapshotEnvironmentSource };