@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,114 @@
1
+ import { SiteDeliveryUnavailable as e } from "./errors.js";
2
+ import { defineContentSeoDefaults as t } from "./contentSeo.js";
3
+ // src/siteDelivery.ts
4
+ var n = (t) => {
5
+ throw new e({ reason: t });
6
+ }, r = (e) => typeof e == "string" && e.length > 0 && e.length <= 64 && e.trim() === e, i = (e) => typeof e == "string" && /^[a-z][a-z0-9_-]{0,63}$/.test(e), a = (e, t) => {
7
+ if (typeof e != "object" || !e || Array.isArray(e) || ![Object.prototype, null].includes(Object.getPrototypeOf(e)) || Object.getOwnPropertySymbols(e).length !== 0) return n("definition");
8
+ let r = Object.getOwnPropertyDescriptors(e);
9
+ return Object.values(r).some((e) => !e.enumerable || !("value" in e)) || t !== void 0 && (Object.keys(r).length !== t.length || t.some((e) => !Object.hasOwn(r, e))) ? n("definition") : Object.fromEntries(Object.entries(r).map(([e, t]) => [e, t.value]));
10
+ }, o = (e, t) => {
11
+ if (!Array.isArray(e) || e.length > t || Object.getOwnPropertySymbols(e).length !== 0 || Object.keys(e).length !== e.length || Object.keys(e).some((e, t) => e !== String(t))) return n("definition");
12
+ let r = Object.getOwnPropertyDescriptors(e);
13
+ return Object.entries(r).some(([e, t]) => e !== "length" && (!t.enumerable || !("value" in t))) ? n("definition") : Array.from({ length: e.length }, (e, t) => r[String(t)].value);
14
+ }, s = (e, t, r) => {
15
+ let i = o(e, t);
16
+ return !i.every(r) || new Set(i).size !== i.length ? n("definition") : Object.freeze([...i]);
17
+ }, c = (e) => typeof e == "string" && e.length <= 256 && (e === "" || /^(?:\/[\p{L}\p{N}_~-]+)+$/u.test(e) && e.normalize("NFC") === e), l = (e) => {
18
+ let l = a(e), u = [
19
+ "id",
20
+ "version",
21
+ "environments",
22
+ "defaultEnvironment",
23
+ "locales",
24
+ "defaultLocale",
25
+ "sourceLocale",
26
+ "bindings"
27
+ ];
28
+ if (u.some((e) => !Object.hasOwn(l, e)) || Object.keys(l).some((e) => ![...u, "seo"].includes(e)) || !r(l.id) || !Number.isSafeInteger(l.version) || Number(l.version) < 1) return n("definition");
29
+ let d = s(l.environments, 128, i);
30
+ if (d.length === 0 || !i(l.defaultEnvironment) || !d.includes(l.defaultEnvironment)) return n("environment");
31
+ let f = o(l.locales, 128).map((e) => {
32
+ let t = a(e, [
33
+ "id",
34
+ "tag",
35
+ "contentLocale",
36
+ "direction",
37
+ "enabled",
38
+ "prefix",
39
+ "fallback"
40
+ ]);
41
+ return !i(t.id) || !r(t.contentLocale) || typeof t.tag != "string" || t.tag.length > 128 || !/^[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)*$/.test(t.tag) || t.direction !== "ltr" && t.direction !== "rtl" || typeof t.enabled != "boolean" ? n("locale") : c(t.prefix) ? Object.freeze({
42
+ id: t.id,
43
+ tag: t.tag,
44
+ contentLocale: t.contentLocale,
45
+ direction: t.direction,
46
+ enabled: t.enabled,
47
+ prefix: t.prefix,
48
+ fallback: s(t.fallback, 128, i)
49
+ }) : n("prefix");
50
+ });
51
+ for (let e of [
52
+ "id",
53
+ "contentLocale",
54
+ "tag",
55
+ "prefix"
56
+ ]) {
57
+ let t = f.map((t) => e === "tag" ? t.tag.toLowerCase() : t[e]);
58
+ if (new Set(t).size !== t.length) return n(e === "prefix" ? "prefix" : "locale");
59
+ }
60
+ let p = new Map(f.map((e) => [e.id, e]));
61
+ if (!i(l.defaultLocale) || !i(l.sourceLocale) || p.get(l.defaultLocale)?.enabled !== !0 || p.get(l.sourceLocale)?.enabled !== !0) return n("locale");
62
+ let m = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), g = (e) => {
63
+ if (m.has(e.id)) return n("fallback");
64
+ if (!h.has(e.id)) {
65
+ m.add(e.id);
66
+ for (let t of e.fallback) {
67
+ let r = p.get(t);
68
+ if (r === void 0 || e.enabled && !r.enabled) return n("fallback");
69
+ g(r);
70
+ }
71
+ m.delete(e.id), h.add(e.id);
72
+ }
73
+ };
74
+ for (let e of f) g(e);
75
+ let _ = a(l.bindings);
76
+ if (Object.keys(_).length > 64 || Object.entries(_).some(([e, t]) => !i(e) || !r(t))) return n("binding");
77
+ let v = l.seo === void 0 ? void 0 : a(l.seo);
78
+ if (v !== void 0 && (Object.keys(v).length > 128 || Object.keys(v).some((e) => !p.has(e)))) return n("locale");
79
+ let y = v === void 0 ? void 0 : Object.freeze(Object.fromEntries(Object.entries(v).map(([e, n]) => [e, t(n)])));
80
+ return Object.freeze({
81
+ ...y === void 0 ? {} : { seo: y },
82
+ id: l.id,
83
+ version: l.version,
84
+ environments: d,
85
+ defaultEnvironment: l.defaultEnvironment,
86
+ locales: Object.freeze(f),
87
+ defaultLocale: l.defaultLocale,
88
+ sourceLocale: l.sourceLocale,
89
+ bindings: Object.freeze(_)
90
+ });
91
+ }, u = (e) => {
92
+ let t = l(e), n = new Map(t.locales.map((e) => [e.id, e])), r = Object.fromEntries(t.locales.map((e) => {
93
+ let t = /* @__PURE__ */ new Set([e.id]), r = [], i = (e) => {
94
+ if (t.has(e)) return;
95
+ t.add(e);
96
+ let a = n.get(e);
97
+ r.push(a.contentLocale);
98
+ for (let e of a.fallback) i(e);
99
+ };
100
+ for (let t of e.fallback) i(t);
101
+ return [e.contentLocale, Object.freeze(r)];
102
+ })), i = (e) => Object.freeze(Object.fromEntries(t.locales.map((t) => [t.contentLocale, e(t)])));
103
+ return Object.freeze({
104
+ definition: t,
105
+ contentLocales: Object.freeze(t.locales.filter((e) => e.enabled).map((e) => e.contentLocale)),
106
+ defaultLocale: n.get(t.defaultLocale).contentLocale,
107
+ sourceLocale: n.get(t.sourceLocale).contentLocale,
108
+ fallback: Object.freeze(r),
109
+ prefixes: i((e) => e.prefix),
110
+ tags: i((e) => e.tag),
111
+ directions: i((e) => e.direction)
112
+ });
113
+ };
114
+ export { u as compileSiteDelivery, l as defineSiteDelivery };
@@ -0,0 +1,46 @@
1
+ import { SiteStateUnavailable as e } from "./errors.js";
2
+ import { and as t, eq as n, generateId as r, id as i, table as a, text as o } from "@voltro/database";
3
+ import { tenant as s } from "@voltro/plugin-multitenancy/mixin";
4
+ // src/siteState.ts
5
+ var c = "_voltro_cms_site_state_heads", l = a(c, {
6
+ id: i({ prefix: "cssh" }),
7
+ site: o().maxLength(64)
8
+ }).with(s()).unique("cms_site_state_scope", ["tenantId", "site"]), u = (t) => {
9
+ if (![t.tenantId, t.site].every((e) => typeof e == "string" && e.length > 0 && e.length <= 64 && e.trim() === e)) throw new e({ reason: "scope" });
10
+ return {
11
+ tenantId: t.tenantId,
12
+ site: t.site
13
+ };
14
+ }, d = (e) => t(n("tenantId", e.tenantId), n("site", e.site)), f = async (t, n) => {
15
+ let i = u(n), a = r({
16
+ kind: "typeid",
17
+ prefix: "cssh"
18
+ }, c);
19
+ if (a === null) throw new e({ reason: "state" });
20
+ await t.insertIgnore(c, {
21
+ id: String(a),
22
+ ...i
23
+ }, { conflictColumns: ["tenantId", "site"] });
24
+ let [o] = await t.query({
25
+ table: c,
26
+ predicate: d(i),
27
+ lock: "update",
28
+ order: [],
29
+ take: 1,
30
+ skip: void 0,
31
+ projection: ["id"]
32
+ });
33
+ if (o === void 0) throw new e({ reason: "state" });
34
+ }, p = async (t, n) => {
35
+ let r = u(n), [i] = await t.query({
36
+ table: c,
37
+ predicate: d(r),
38
+ lock: "share",
39
+ order: [],
40
+ take: 1,
41
+ skip: void 0,
42
+ projection: ["id"]
43
+ });
44
+ if (i === void 0) throw new e({ reason: "state" });
45
+ };
46
+ export { c as CMS_SITE_STATE_HEADS_TABLE, l as cmsSiteStateHeadsTable, u as copySiteScope, f as lockSiteState, p as lockSiteStateForRead, d as siteStatePredicate };
@@ -0,0 +1,54 @@
1
+ import { readVerifiedSnapshotResource as e } from "./buildSnapshot.js";
2
+ import { copySnapshotReferenceRoutes as t } from "./snapshotProjection.js";
3
+ import { SnapshotRouteReadUnavailable as n } from "./snapshotRouteAdmission.js";
4
+ import { readPlannedSnapshotReferenceAddress as r } from "./snapshotReferenceAddress.js";
5
+ import { canonicalJson as i } from "@voltro/runtime";
6
+ // src/snapshotAddressGraph.ts
7
+ var a = (e) => {
8
+ throw new n({ reason: e });
9
+ }, o = async (n, o, s, c, l) => {
10
+ if (s.length === 0 || s.length > 65 || s[0]?.source !== null || new Set(s.map((e) => e.source)).size !== s.length || Object.keys(c.nodes).length > 256) return a("bounds");
11
+ let u = s[0].context.snapshot;
12
+ if (s.some((e) => e.context.snapshot.id !== u.id || e.context.snapshot.digest !== u.digest || e.source?.startsWith("@ref:"))) return a("binding");
13
+ let d = (await e(n, o, u, "projection", "registry")).value;
14
+ if (!Array.isArray(d.types) || !d.types.every((e) => typeof e == "string")) return a("binding");
15
+ let f = t(d.referenceRoutes, d.types), p = [], m = /* @__PURE__ */ new Map();
16
+ if (Object.keys(f).length === 0) return p;
17
+ let h = [...s.map((e) => ({
18
+ source: e.source,
19
+ output: e.context.output,
20
+ fields: e.fields
21
+ })), ...Object.entries(c.nodes).map(([e, t]) => ({
22
+ source: e,
23
+ output: t.output,
24
+ fields: t.fields
25
+ }))];
26
+ for (let e of h) for (let t of e.fields.references) {
27
+ if (!Object.hasOwn(f, t.targetType)) continue;
28
+ if (p.length >= 8192) return a("bounds");
29
+ let s = f[t.targetType], c = i([
30
+ t.targetType,
31
+ t.targetDocumentId,
32
+ e.output.localeId,
33
+ s
34
+ ]);
35
+ if (!m.has(c)) {
36
+ if (m.size >= 256) return a("bounds");
37
+ m.set(c, await r(n, o, {
38
+ snapshot: u,
39
+ output: e.output
40
+ }, t, s, l));
41
+ }
42
+ p.push({
43
+ source: e.source,
44
+ fieldPath: [...t.path],
45
+ mappingId: s,
46
+ target: m.get(c) ?? null
47
+ });
48
+ }
49
+ return p.sort((e, t) => {
50
+ let n = i([e.source, e.fieldPath]), r = i([t.source, t.fieldPath]);
51
+ return n < r ? -1 : +(n > r);
52
+ }), p;
53
+ };
54
+ export { o as readAdmittedSnapshotAddressGraph };
@@ -0,0 +1,72 @@
1
+ import { compileSiteDelivery as e } from "./siteDelivery.js";
2
+ import { defineContentLocations as t, resolveContentLocation as n } from "./contentLocations.js";
3
+ import { readCapturedPublication as r } from "./publicationState.js";
4
+ import { findVerifiedSnapshotResource as i, readVerifiedSnapshotResource as a } from "./buildSnapshot.js";
5
+ import { verifySnapshotRouteOwnership as o } from "./snapshotRouting.js";
6
+ import { contentRouteId as s } from "./contentRouteIdentity.js";
7
+ import { admitSnapshotPublicDocument as c } from "./snapshotPublicAccess.js";
8
+ import { SnapshotRouteReadUnavailable as l } from "./snapshotRouteAdmission.js";
9
+ import { createHash as u } from "node:crypto";
10
+ import { canonicalJson as d } from "@voltro/runtime";
11
+ // src/snapshotAddressRead.ts
12
+ var f = (e) => {
13
+ throw new l({ reason: e });
14
+ }, p = (e) => u("sha256").update(d(e)).digest("hex"), m = (e, t) => d(e) === d(t), h = (e) => typeof e != "object" || !e || Array.isArray(e) ? f("binding") : e, g = async (e, t, n, r, i) => {
15
+ let a = { ...r }, o = { ...t };
16
+ if (n.manifest.parts.find((e) => e.part === "routes")?.format !== "voltro.cms.content-routes/v4") return f("binding");
17
+ if (typeof a.mappingId != "string" || !/^[A-Za-z][A-Za-z0-9_.-]{0,63}$/.test(a.mappingId)) return f("definition");
18
+ let s = await c(e, o, n, a.contentType, a.localeId, a.documentId, i);
19
+ return s === null ? null : _(e, o, n, a, s, i);
20
+ }, _ = async (c, l, u, d, g, _) => {
21
+ if (g.contentType !== d.contentType || g.chain[0]?.documentId !== d.documentId) return f("binding");
22
+ let v = g.chain[0], y = [...g.chain.slice(1)].reverse(), b = (await a(c, l, u, "schema", `type:${d.contentType}`)).value, x = h(b.definition), S = t(x.locations ?? []), C = S.find((e) => e.id === d.mappingId);
23
+ if (C === void 0) return f("definition");
24
+ let w = (await a(c, l, u, "routes", "configuration")).value, T = (await a(c, l, u, "site", "configuration")).value, E = e(w.site), D = E.definition.locales.find((e) => e.id === d.localeId && e.enabled), O = w.types;
25
+ if (w.version !== 1 || w.tenantId !== l.tenantId || w.environment !== l.environment || E.definition.id !== l.site || !E.definition.environments.includes(l.environment) || !m(w.app, b.app) || T.definitionDigest !== p(E.definition) || !Array.isArray(O) || w.definitionDigest !== p({
26
+ site: E.definition,
27
+ types: O,
28
+ routing: w.routing
29
+ }) || D === void 0 || D.contentLocale !== g.requestedLocale) return f("binding");
30
+ let k = O.map(h).filter((e) => e.name === d.contentType), A = x.tree === void 0 ? null : h(x.tree);
31
+ if (k.length !== 1 || !m(k[0].locations, S) || !m(k[0].tree, A === null ? null : {
32
+ parent: A.parent,
33
+ segment: A.segment
34
+ })) return f("binding");
35
+ let j = s(l, d.localeId, d.contentType, d.documentId, d.mappingId), M = await i(c, l, u, "routes", `identity:${j}`);
36
+ if (M === null) return null;
37
+ if (M.value.version !== 1 || M.value.kind !== "route-index" || typeof M.value.target != "string") return f("route");
38
+ let N = M.value.target, P = (await a(c, l, u, "routes", N)).value;
39
+ if (P.version !== 1 || P.routeId !== j || P.contentType !== d.contentType || P.documentId !== d.documentId || P.mappingId !== d.mappingId || P.localeId !== d.localeId || P.tenantId !== l.tenantId || P.site !== l.site || P.environment !== l.environment || P.definitionDigest !== w.definitionDigest || P.variantId !== v.variantId || P.revisionId !== v.revisionId || P.revision !== v.revision || P.sourceLocale !== v.locale || P.requestedLocale !== g.requestedLocale || P.fallback !== (v.locale !== g.requestedLocale)) return f("route");
40
+ if (P.state === "unroutable") return N !== `unroutable:${j}` || P.reason !== "orphan" ? f("route") : null;
41
+ if (P.state !== "resolved" || typeof P.path != "string" || N !== `path:${p(P.path)}` || !m(P.ancestors, y)) return f("route");
42
+ if (o(w, P).owner !== "cms") return null;
43
+ let F = [];
44
+ for (let e of [...y, v]) {
45
+ let t = await r(c, l, u.manifest.publication.id, d.contentType, e.locale, e.variantId, _);
46
+ if (t === null || t.documentId !== e.documentId || t.revisionId !== e.revisionId || t.revision !== e.revision) return f("publication");
47
+ F.push(t);
48
+ }
49
+ let I = A === null ? null : F.map((e) => typeof A.segment != "string" || typeof e[A.segment] != "string" ? f("definition") : (n({
50
+ id: "segment",
51
+ segments: [{ field: A.segment }]
52
+ }, e, { prefix: "" }), e[A.segment])), L = n(C, F.at(-1), {
53
+ prefix: D.prefix,
54
+ ...I === null ? {} : { treePath: I.join("/") }
55
+ });
56
+ return P.path === L ? {
57
+ output: {
58
+ routeId: j,
59
+ path: L,
60
+ mappingId: d.mappingId,
61
+ localeId: d.localeId,
62
+ requestedLocale: g.requestedLocale,
63
+ sourceLocale: v.locale,
64
+ fallback: v.locale !== g.requestedLocale
65
+ },
66
+ document: v,
67
+ ancestors: y,
68
+ schema: b,
69
+ route: P
70
+ } : f("route");
71
+ };
72
+ export { _ as readAdmittedCapturedAddress, g as readCapturedPublicAddress };
@@ -0,0 +1,70 @@
1
+ import { readRenderReadCredential as e } from "./renderReadAuthority.js";
2
+ import { copySnapshotConsentPurposes as t } from "./snapshotPresentation.js";
3
+ import { readAdmittedBuildSnapshot as n } from "./snapshotReadAdmission.js";
4
+ import { readSnapshotAppExecution as r, verifyRetainedSnapshotRoutes as i, verifySnapshotAppExecution as a } from "./snapshotAppExecution.js";
5
+ import { copySnapshotConsumer as o, issueSnapshotReadGrant as s } from "./snapshotConsumer.js";
6
+ import { Schema as c } from "effect";
7
+ import { canonicalJson as l } from "@voltro/runtime";
8
+ // src/snapshotAppConsumer.ts
9
+ var u = class extends c.TaggedError()("SnapshotAppConsumerUnavailable", { reason: c.Literals(["credential", "changed"]) }) {}, d = (e) => {
10
+ throw new u({ reason: e });
11
+ }, f = async (c, u, f, p) => {
12
+ let m = {
13
+ tenantId: u.tenantId,
14
+ site: u.site,
15
+ environment: u.environment
16
+ }, h = {
17
+ id: f.snapshot.id,
18
+ digest: f.snapshot.digest
19
+ }, g = f.apiKey, _ = f.resume === void 0 ? void 0 : {
20
+ token: f.resume.token,
21
+ buildId: f.resume.buildId
22
+ }, v = p.verificationKeys?.map((e) => ({
23
+ id: e.id,
24
+ material: new Uint8Array(e.material)
25
+ })), y = {
26
+ id: p.key.id,
27
+ material: new Uint8Array(p.key.material)
28
+ }, b = p.now ?? Date.now, x = p.execution.run.bind(p.execution);
29
+ if (typeof g != "string" || g.length === 0 || g.length > 512) return d("credential");
30
+ let S = await c.transactional(async (t) => {
31
+ let i = b();
32
+ if (!Number.isSafeInteger(i) || !Number.isFinite(new Date(i).getTime())) return d("credential");
33
+ let a = await e(t, m, g, i);
34
+ if (a === null || a.scopes.length === 0) return d("credential");
35
+ let s = await n(t, m, h, i), c = await r(t, m, s), l = o(c.declaration.value, i);
36
+ return a.scopes.includes(l.requiredScope) ? c : d("credential");
37
+ }), C = S.definitions.value;
38
+ if (typeof C != "object" || !C || Array.isArray(C) || !("consentPurposes" in C)) return d("changed");
39
+ let w = t(C.consentPurposes), T = await x({
40
+ inputsId: S.inputsId,
41
+ executionId: S.executionId,
42
+ exportName: "definitions",
43
+ inputJson: l({ app: S.app })
44
+ });
45
+ if (a(S, "definitions", { app: S.app }, T), l(T.value) !== l(S.definitions.value)) return d("changed");
46
+ await i(S, x);
47
+ let E = await x({
48
+ inputsId: S.inputsId,
49
+ executionId: S.executionId,
50
+ exportName: "describe",
51
+ inputJson: "null"
52
+ });
53
+ return a(S, "describe", null, E), l(E.value) === l(S.declaration.value) ? c.transactional(async (e) => {
54
+ let t = b(), i = o(S.declaration.value, t), a = await n(e, m, h, t), c = await r(e, m, a);
55
+ return l(c) === l(S) ? {
56
+ ...await s(e, m, {
57
+ apiKey: g,
58
+ snapshot: h,
59
+ ..._ === void 0 ? {} : { resume: _ }
60
+ }, {
61
+ key: y,
62
+ now: t,
63
+ consumer: i,
64
+ ...v === void 0 ? {} : { verificationKeys: v }
65
+ }),
66
+ consentPurposes: structuredClone(w)
67
+ } : d("changed");
68
+ }) : d("changed");
69
+ };
70
+ export { u as SnapshotAppConsumerUnavailable, f as issueSnapshotAppGrant };
@@ -0,0 +1,101 @@
1
+ import { readVerifiedSnapshotResource as e } from "./buildSnapshot.js";
2
+ import { copySnapshotAppCodePin as t } from "./snapshotDefinitions.js";
3
+ import { copyFrontendOutputContext as n } from "./frontendBindings.js";
4
+ import { coversSnapshotComponents as r } from "./snapshotFrontend.js";
5
+ import { matchesSnapshotApplication as i } from "./snapshotApplication.js";
6
+ import { Schema as a } from "effect";
7
+ import { createHash as o } from "node:crypto";
8
+ import { canonicalJson as s } from "@voltro/runtime";
9
+ // src/snapshotAppExecution.ts
10
+ var c = class extends a.TaggedError()("SnapshotAppUnavailable", { reason: a.Literals([
11
+ "app",
12
+ "receipt",
13
+ "declaration",
14
+ "definitions",
15
+ "renderer",
16
+ "routes"
17
+ ]) }) {}, l = (e) => {
18
+ throw new c({ reason: e });
19
+ }, u = (e) => typeof e == "string" && /^[a-f0-9]{64}$/.test(e), d = (e) => o("sha256").update(s(e)).digest("hex"), f = (e) => typeof e != "object" || !e || Array.isArray(e) ? l("app") : e, p = async (a, o, c, d, p = [], m) => {
20
+ if (c.manifest.parts.find((e) => e.part === "app")?.format !== "voltro.app.build-inputs/v1" || c.manifest.parts.find((e) => e.part === "schema")?.format !== "voltro.cms.schema/v1") return l("app");
21
+ let g = (await e(a, o, c, "app", "configuration")).value, _ = (await e(a, o, c, "schema", "registry")).value, v = f(g.execution), y = f(g.app), b = f(v.runtime);
22
+ if (g.version !== 1 || !u(g.inputsId) || v.version !== 1 || !u(v.id) || v.profile !== "voltro.node-bundle/v1" || !u(b.binaryDigest) || ![
23
+ "node",
24
+ "platform",
25
+ "arch"
26
+ ].every((e) => typeof b[e] == "string") || _.version !== 1 || s(y) !== s(_.app)) return l("app");
27
+ if (d !== void 0) {
28
+ let t = (await e(a, o, c, "schema", `type:${d}`)).value;
29
+ if (s(y) !== s(t.app)) return l("app");
30
+ }
31
+ let x = t({
32
+ commit: String(y.commit),
33
+ artifactDigest: String(y.artifactDigest),
34
+ configDigest: String(y.configDigest)
35
+ }), S = v.web === void 0 ? void 0 : f(v.web);
36
+ if (S !== void 0 && (Object.keys(S).sort().join(",") !== "id,namespace,version" || S.version !== 1 || !u(S.id) || !u(S.namespace) || v.nativePageEntry !== "pages.mjs")) return l("app");
37
+ let C = {
38
+ inputsId: g.inputsId,
39
+ executionId: v.id,
40
+ app: x,
41
+ runtime: b,
42
+ ...S === void 0 ? {} : { web: {
43
+ id: S.id,
44
+ namespace: S.namespace
45
+ } }
46
+ };
47
+ if (v.declaration === void 0) return l("declaration");
48
+ let w = f(v.declaration);
49
+ if (!Object.hasOwn(w, "value")) return l("app");
50
+ let T = {
51
+ value: w.value,
52
+ receipt: f(w.receipt)
53
+ };
54
+ if (h(C, "describe", null, T), v.definitions === void 0) return l("definitions");
55
+ let E = f(v.definitions);
56
+ if (!Object.hasOwn(E, "value")) return l("definitions");
57
+ let D = {
58
+ value: E.value,
59
+ receipt: f(E.receipt)
60
+ };
61
+ if (h(C, "definitions", { app: x }, D), v.routes === void 0) return l("routes");
62
+ let O = f(v.routes);
63
+ if (!Object.hasOwn(O, "value")) return l("routes");
64
+ let k = {
65
+ value: O.value,
66
+ receipt: f(O.receipt)
67
+ };
68
+ if (h(C, "__voltro_routes", null, k), !await i(a, o, c, D.value, x, k.value)) return l("definitions");
69
+ let A = D.value, j;
70
+ if (m !== void 0) {
71
+ let e = A.site.locales.find((e) => e.enabled && e.id === m.id && e.contentLocale === m.contentLocale);
72
+ if (e === void 0) return l("renderer");
73
+ j = n({
74
+ ...A.frontend.output,
75
+ localeId: e.id,
76
+ contentLocale: e.contentLocale,
77
+ languageTag: e.tag,
78
+ direction: e.direction
79
+ });
80
+ }
81
+ return r(A.frontend, p, j) ? {
82
+ ...C,
83
+ nativePages: v.nativePageEntry === "pages.mjs",
84
+ declaration: T,
85
+ definitions: D,
86
+ routes: k,
87
+ ...j === void 0 ? {} : { context: j }
88
+ } : l("renderer");
89
+ }, m = async (e, t) => {
90
+ let n = await t({
91
+ inputsId: e.inputsId,
92
+ executionId: e.executionId,
93
+ exportName: "__voltro_routes",
94
+ inputJson: "null"
95
+ });
96
+ if (h(e, "__voltro_routes", null, n), s(n.value) !== s(e.routes.value)) return l("routes");
97
+ }, h = (e, t, n, r) => {
98
+ let i = r.receipt;
99
+ return i.version !== 1 || i.profile !== "voltro.node-permission-json/v1" || i.inputsId !== e.inputsId || i.executionId !== e.executionId || i.exportName !== t || s(i.app) !== s(e.app) || s(i.runtime) !== s(e.runtime) || s(i.web ?? null) !== s(e.web ?? null) || i.inputDigest !== d(n) || i.resultDigest !== d(r.value) || !u(i.runnerDigest) ? l("receipt") : { runnerDigest: i.runnerDigest };
100
+ };
101
+ export { c as SnapshotAppUnavailable, p as readSnapshotAppExecution, m as verifyRetainedSnapshotRoutes, h as verifySnapshotAppExecution };
@@ -0,0 +1,74 @@
1
+ import { compileSiteDelivery as e } from "./siteDelivery.js";
2
+ import { readVerifiedSnapshotResource as t, snapshotStaticPartPin as n } from "./buildSnapshot.js";
3
+ import { compileSnapshotRouting as r, copySnapshotRoutingDefinition as i } from "./snapshotRouting.js";
4
+ import { copySnapshotAppCodePin as a, snapshotDefinitionSources as o } from "./snapshotDefinitions.js";
5
+ import { copySnapshotConsentPurposes as s } from "./snapshotPresentation.js";
6
+ import { snapshotPublicAccessSource as c } from "./snapshotPublicAccess.js";
7
+ import { snapshotProjectionSource as l } from "./snapshotProjection.js";
8
+ import { copySnapshotRenditionRequirements as u } from "./snapshotRenditions.js";
9
+ import { matchesSnapshotFrontend as d, snapshotFrontendFromManifest as f, snapshotFrontendManifest as p } from "./snapshotFrontend.js";
10
+ import { snapshotSiteConfiguration as m } from "./snapshotSite.js";
11
+ import { readCapturedSnapshotConsentPurposes as h } from "./snapshotPresentationPolicy.js";
12
+ import { canonicalJson as g } from "@voltro/runtime";
13
+ // src/snapshotApplication.ts
14
+ var _ = (t, r) => {
15
+ let d = a(r), { types: f } = t, p = {
16
+ ...o(f, d),
17
+ policies: c(f, d, t.access, t.consentPurposes),
18
+ projection: l(f, d, t.projection)
19
+ };
20
+ if (typeof t.xDefault != "boolean") throw TypeError("Snapshot xDefault must be a boolean");
21
+ return {
22
+ version: 2,
23
+ app: d,
24
+ parts: [
25
+ "schema",
26
+ "components",
27
+ "policies",
28
+ "projection"
29
+ ].map((e) => n(e, p[e])),
30
+ site: e(t.site).definition,
31
+ renditions: u(t.renditions),
32
+ xDefault: t.xDefault,
33
+ routing: i(t.routing),
34
+ consentPurposes: s(t.consentPurposes ?? [])
35
+ };
36
+ }, v = (e, t) => ({
37
+ ..._(e, t),
38
+ frontend: p(e.types, e.frontend, a(t), e.output)
39
+ }), y = (e, t, n) => ({
40
+ ..._(e, t),
41
+ frontend: e.frontend === void 0 ? f(e.types, n, a(t), e.output) : p(e.types, e.frontend, a(t), e.output)
42
+ }), b = async (e, n, i, a, o, c) => {
43
+ if (typeof a != "object" || !a || Array.isArray(a)) return !1;
44
+ let l = a, f, p, _;
45
+ try {
46
+ f = m(n, l.site, o), p = u(l.renditions), _ = s(l.consentPurposes);
47
+ } catch {
48
+ return !1;
49
+ }
50
+ if (typeof l.xDefault != "boolean" || g(a) !== g({
51
+ version: 2,
52
+ app: o,
53
+ parts: [
54
+ "schema",
55
+ "components",
56
+ "policies",
57
+ "projection"
58
+ ].map((e) => i.manifest.parts.find((t) => t.part === e)),
59
+ site: f.compiled.definition,
60
+ renditions: p,
61
+ xDefault: l.xDefault,
62
+ frontend: l.frontend,
63
+ routing: l.routing,
64
+ consentPurposes: _
65
+ }) || g(await h(e, n, i, o)) !== g(_) || !await d(e, n, i, l.frontend, o)) return !1;
66
+ let v = await t(e, n, i, "site", "configuration"), y = await t(e, n, i, "locales", "policy"), b = await t(e, n, i, "assets", "configuration"), x = await t(e, n, i, "seo", "configuration"), S = await t(e, n, i, "routes", "configuration");
67
+ try {
68
+ if (g(S.value.routing) !== g(r(l.routing, c, o))) return !1;
69
+ } catch {
70
+ return !1;
71
+ }
72
+ return g(v) === g(f.site) && g(y) === g(f.locales) && g(b.value.renditionRequirements) === g(p) && x.value.xDefault === l.xDefault;
73
+ };
74
+ export { b as matchesSnapshotApplication, _ as snapshotApplicationConfigurationPins, v as snapshotApplicationPins, y as snapshotCaptureApplicationPins };
@@ -0,0 +1,43 @@
1
+ import { copyOutputActivationScope as e, outputActivationHash as t } from "./outputActivation.js";
2
+ import { verifyPublicationState as n } from "./publicationState.js";
3
+ import { copySnapshotResource as r } from "./buildSnapshot.js";
4
+ import { routeDispositionFail as i } from "./routeDispositions.js";
5
+ import { iterateApprovedRouteDispositions as a, readApprovedRouteDispositionPage as o } from "./routeDispositionStore.js";
6
+ import { canonicalJson as s } from "@voltro/runtime";
7
+ import { Buffer as c } from "node:buffer";
8
+ // src/snapshotApprovedRouteDispositions.ts
9
+ var l = (l, u, d = Date.now()) => {
10
+ let f = e(u);
11
+ return {
12
+ format: "voltro.cms.approved-route-dispositions/v1",
13
+ entries: async function* (e) {
14
+ await n(l, f, e, d);
15
+ let u = await o(l, f, { take: 1 });
16
+ yield r({
17
+ key: "configuration",
18
+ value: {
19
+ version: 1,
20
+ ...f,
21
+ revision: u.revision,
22
+ count: u.count
23
+ }
24
+ });
25
+ let p = 0, m = 0;
26
+ for await (let e of a(l, f)) {
27
+ if (e.revision > u.revision || ++p > u.count) return i("state");
28
+ let n = r({
29
+ key: "url:" + t(e.definition.source.url),
30
+ value: {
31
+ version: 1,
32
+ ...f,
33
+ ...e
34
+ }
35
+ });
36
+ if (m += c.byteLength(s(n), "utf8"), m > 67108864) return i("bounds");
37
+ yield n;
38
+ }
39
+ if (p !== u.count) return i("state");
40
+ }
41
+ };
42
+ };
43
+ export { l as snapshotApprovedRouteDispositionsSource };
@@ -0,0 +1,69 @@
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 { createHash as r } from "node:crypto";
5
+ import { canonicalJson as i } from "@voltro/runtime";
6
+ // src/snapshotAssetAssembly.ts
7
+ var a = () => {
8
+ throw new e({ reason: "binding" });
9
+ }, o = (e) => r("sha256").update(i(e)).digest("hex"), s = (e) => typeof e == "string" && /^[a-f0-9]{64}$/.test(e), c = (e) => {
10
+ let { store: r, provider: c } = e, l = { ...e.use }, u = {
11
+ tenantId: e.scope.tenantId,
12
+ site: e.scope.site,
13
+ environment: e.scope.environment
14
+ }, d = e.keys.map((e) => ({
15
+ id: e.id,
16
+ material: new Uint8Array(e.material)
17
+ })), f = e.now ?? Date.now;
18
+ return { render: async (e) => {
19
+ let p = {
20
+ snapshot: {
21
+ id: e.snapshot.id,
22
+ digest: e.snapshot.digest
23
+ },
24
+ token: e.token,
25
+ consumerId: e.consumerId,
26
+ buildId: e.buildId,
27
+ host: e.host
28
+ }, m = t(e.documents), h = c.composeAssets?.bind(c), g = c.read?.bind(c);
29
+ if (h === void 0 || g === void 0) return a();
30
+ let _ = () => r.transactional((e) => n(e, u, p, m, {
31
+ provider: c,
32
+ use: l,
33
+ keys: d,
34
+ now: f
35
+ })), v = await _(), y = v.paths.admission.app, b = v.inventory;
36
+ if (y.web === void 0) return a();
37
+ let x = await h({
38
+ snapshotDigest: p.snapshot.digest,
39
+ inputsId: y.inputsId,
40
+ executionId: y.executionId,
41
+ web: { ...y.web },
42
+ consentPurposes: b.consentPurposes,
43
+ presentations: b.presentations,
44
+ documents: b.records.map((e) => ({
45
+ url: e.url,
46
+ path: e.path,
47
+ routeId: e.routeId,
48
+ artifactId: e.artifactId,
49
+ presentation: e.presentation
50
+ }))
51
+ });
52
+ if (!s(x.id) || !Number.isSafeInteger(x.files) || x.files < 0 || !Number.isSafeInteger(x.bytes) || x.bytes < 0) return a();
53
+ let S = await g(x.id), C = S.manifest.subject;
54
+ if (S.id !== x.id || S.manifest.version !== 1 || o(S.manifest) !== x.id || S.manifest.files.length !== x.files || S.manifest.files.reduce((e, t) => e + t.size, 0) !== x.bytes || C.version !== 2 || C.profile !== "voltro.cms-public-assets/v2" || i(C.build) !== i({
55
+ snapshotDigest: p.snapshot.digest,
56
+ inputsId: y.inputsId,
57
+ executionId: y.executionId
58
+ }) || i(C.consentPurposes) !== i(b.consentPurposes) || i(C.presentations) !== i(b.presentations) || !s(C.webAssetsId)) return a();
59
+ let w = await g(C.webAssetsId), T = w.manifest.subject;
60
+ if (w.id !== C.webAssetsId || o(w.manifest) !== w.id || T.version !== 1 || T.profile !== "voltro.cms-client-assets/v1" || T.snapshotContent !== !1 || i(T.web) !== i(y.web) || T.source === null || typeof T.source != "object" || Reflect.get(T.source, "id") !== y.inputsId) return a();
61
+ let E = await _();
62
+ return i(E.inventory) !== i(v.inventory) || i(E.paths.selection) !== i(v.paths.selection) || i(E.paths.admission.context) !== i(v.paths.admission.context) ? a() : {
63
+ artifactId: x.id,
64
+ files: x.files,
65
+ bytes: x.bytes
66
+ };
67
+ } };
68
+ };
69
+ export { c as createSnapshotAssetAssembly };