@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,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 { asTyped as e } from "./effectForm.js";
2
- import { ContentIdConflict as t, ContentNotFound as n, ContentValidationFailed as r, ReferenceUnavailable as i, ReviewRequired as a, RevisionMismatch as o } from "./errors.js";
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 { assertApproved as d } from "./review.js";
6
- import { assertReferencesAvailable as f } from "./availability.js";
7
- import { setOwner as p, stewardshipOf as m } from "./stewardship.js";
8
- import { pickDeclared as h, publishRevision as g, revalidateContent as _, saveDraft as v, unpublish as y } from "./write.js";
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
- //#region src/bulk.ts
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, n, o, p) => {
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
- ...p,
33
+ ...m,
33
34
  documentId: null,
34
- title: p.id,
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
- ...n,
44
- locale: p.locale
45
- }, v = await A(e, `${t.name}_drafts`, p.id, _);
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, p.id)
50
+ title: j(v, m.id)
50
51
  }, b = (e, t = null) => ({
51
- ...p,
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`, p.id, _) === void 0 ? g("notPublished", y) : b("ready");
59
- if (o.kind === "setOwner") return b((await m(e, t, y.documentId, n)).owner === o.owner ? "unchanged" : "ready");
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 n = String(v.revisionId);
67
- if (JSON.stringify(v[o.field] ?? null) === JSON.stringify(o.value ?? null)) return b("unchanged", n);
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, h(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 r) return g("invalid", {
75
+ if (e instanceof n) return g("invalid", {
75
76
  ...y,
76
- revisionId: n,
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", n);
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`, p.id, _))?.revisionId === S) return b("unchanged", S);
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 d(e, t, p.id, _, S), await f(e, t, p.id, r, _);
104
+ await f(e, t, m.id, _, S), await p(e, t, m.id, r, _);
104
105
  } catch (e) {
105
- if (e instanceof a) return g("reviewRequired", {
106
+ if (e instanceof i) return g("reviewRequired", {
106
107
  ...y,
107
108
  revisionId: S
108
109
  });
109
- if (e instanceof i) return g("referenceUnavailable", {
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, t, s, c, l) => {
122
- let u = new Map(t.map((e) => [e.name, e])), d = [], f = /* @__PURE__ */ new Set();
123
- for (let t of l) {
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: t.type,
126
- id: t.id,
127
- locale: t.locale,
128
- title: t.title
126
+ type: o.type,
127
+ id: o.id,
128
+ locale: o.locale,
129
+ title: o.title
129
130
  };
130
- if (t.disposition !== "ready") {
131
- d.push({
131
+ if (o.disposition !== "ready") {
132
+ f.push({
132
133
  ...l,
133
- outcome: t.disposition === "unchanged" ? "unchanged" : "failed",
134
- reason: t.reason,
135
- detail: t.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 m = u.get(t.type), _ = {
140
+ let h = u.get(o.type), _ = {
140
141
  ...s,
141
- locale: t.locale
142
+ locale: o.locale
142
143
  };
143
144
  try {
144
- if (m === void 0) throw new n({
145
- contentType: t.type,
146
- id: t.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, m, t.id, _, t.revisionId ?? "")), f.add(m);
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: m,
152
- id: t.id,
153
- locale: t.locale,
152
+ type: h,
153
+ id: o.id,
154
+ locale: o.locale,
154
155
  action: "publish",
155
- revisionId: t.revisionId ?? ""
156
+ revisionId: o.revisionId ?? ""
156
157
  }));
157
- else if (c.kind === "unpublish") await e.transactional((e) => y(e, m, t.id, _)), f.add(m);
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 r = await A(e, `${m.name}_drafts`, t.id, _);
160
- if (r === void 0) throw new n({
161
- contentType: t.type,
162
- id: t.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, m, {
166
- ...h(m, r),
167
- id: t.id,
166
+ await v(e, h, {
167
+ ...d(h, n),
168
+ id: o.id,
168
169
  [c.field]: c.value
169
- }, _, t.revisionId === null ? {} : { expectedRevision: t.revisionId });
170
+ }, _, o.revisionId === null ? {} : { expectedRevision: o.revisionId });
170
171
  });
171
172
  else {
172
- if (t.documentId === null) throw new n({
173
- contentType: t.type,
174
- id: t.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 p(e, m, t.documentId, s, c.owner);
178
+ await m(e, h, o.documentId, s, c.owner);
178
179
  }
179
- d.push({
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 t = e instanceof a ? "reviewRequired" : e instanceof o ? "revisionMoved" : e instanceof r ? "incomplete" : e instanceof i ? "referenceUnavailable" : e instanceof n ? e.stage === "published" ? "notPublished" : "notFound" : "failed", s = e instanceof i ? M(e) : e instanceof r ? e.violations.map((e) => e.field) : t === "failed" ? [e instanceof Error ? e.message : String(e)] : [];
187
- d.push({
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: t,
191
+ reason: o,
191
192
  detail: s
192
193
  });
193
194
  }
194
195
  }
195
- for (let e of f) _(e);
196
- return d;
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
- o
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 };
@@ -1,4 +1,4 @@
1
- //#region src/cacheIdentity.ts
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 };