@voltro/cms 0.86.0 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +5321 -0
  2. package/README.md +138 -0
  3. package/THIRD-PARTY-NOTICES.md +860 -221
  4. package/dist/RichDocumentView.js +81 -36
  5. package/dist/aiCandidates.js +3 -3
  6. package/dist/applicationBuildSnapshotService.js +101 -0
  7. package/dist/assetRenditions.js +102 -0
  8. package/dist/assetRevision.js +46 -0
  9. package/dist/assetUseRights.js +72 -0
  10. package/dist/availability.js +19 -16
  11. package/dist/blueprint.js +75 -75
  12. package/dist/build.d.ts +3063 -0
  13. package/dist/build.js +37 -0
  14. package/dist/buildApplicationAdmission.js +16 -0
  15. package/dist/buildApplicationCatalog.js +136 -0
  16. package/dist/buildApplicationCatalogTable.js +24 -0
  17. package/dist/buildApplicationRest.js +99 -0
  18. package/dist/buildApplicationUpload.js +111 -0
  19. package/dist/buildSnapshot.js +401 -0
  20. package/dist/buildSnapshotApplicationPin.js +32 -0
  21. package/dist/buildSnapshotRest.js +210 -0
  22. package/dist/buildSnapshotService.js +265 -0
  23. package/dist/buildSnapshotTables.js +25 -0
  24. package/dist/bulk.js +71 -70
  25. package/dist/changes.js +279 -62
  26. package/dist/consent.js +5 -5
  27. package/dist/contentLocations.js +53 -0
  28. package/dist/contentProjection.js +83 -0
  29. package/dist/contentRouteIdentity.js +13 -0
  30. package/dist/contentRouteMaterializer.js +97 -0
  31. package/dist/contentRouteTypes.js +39 -0
  32. package/dist/contentSeo.js +189 -0
  33. package/dist/contentTreePath.js +60 -0
  34. package/dist/contentType.js +117 -100
  35. package/dist/contentValues.js +18 -0
  36. package/dist/copies.js +3 -3
  37. package/dist/domainHost.js +7 -0
  38. package/dist/domains.js +81 -87
  39. package/dist/draftTexts.js +37 -37
  40. package/dist/duplicates.js +23 -23
  41. package/dist/environmentAliases.js +138 -0
  42. package/dist/environments.js +107 -69
  43. package/dist/errors.js +54 -14
  44. package/dist/experiments.js +7 -7
  45. package/dist/frontendBindings.js +99 -0
  46. package/dist/frontendMedia.js +18 -0
  47. package/dist/index.d.ts +760 -47
  48. package/dist/index.js +89 -73
  49. package/dist/initializePublicRoutes.js +28 -0
  50. package/dist/liveContentRouteView.js +76 -0
  51. package/dist/nativeOutputDeploymentService.js +205 -0
  52. package/dist/outputActivation.js +234 -0
  53. package/dist/outputActivationOrigin.js +51 -0
  54. package/dist/outputActivationStore.js +411 -0
  55. package/dist/outputActivationTables.js +11 -0
  56. package/dist/outputActivationTarget.js +81 -0
  57. package/dist/outputActivationTargetTable.js +25 -0
  58. package/dist/outputDeployment.js +174 -0
  59. package/dist/outputDeploymentRest.js +168 -0
  60. package/dist/outputDeploymentService.js +241 -0
  61. package/dist/outputRouteGraph.js +177 -0
  62. package/dist/outputSafetyArtifact.js +147 -0
  63. package/dist/outputTargetRest.js +62 -0
  64. package/dist/pathSegmentEncoding.js +4 -0
  65. package/dist/privateCmsTransport.js +76 -0
  66. package/dist/privateNativeRouteReservation.js +10 -0
  67. package/dist/promotion.js +68 -59
  68. package/dist/publicBuild.js +90 -0
  69. package/dist/publicBuildRest.js +98 -0
  70. package/dist/publicBuildService.js +63 -0
  71. package/dist/publicOutputHttp.js +129 -0
  72. package/dist/publicOutputService.js +287 -0
  73. package/dist/publicPresentation.js +17 -0
  74. package/dist/publicRouteDispositionAdmission.js +38 -0
  75. package/dist/publicRouteHistoryStore.js +12 -0
  76. package/dist/publicRouteHistoryView.js +34 -0
  77. package/dist/publicRouteIntegrity.js +5 -0
  78. package/dist/publicRouteMutation.js +6 -0
  79. package/dist/publicRouteNamespace.js +134 -0
  80. package/dist/publicRoutePublication.js +36 -0
  81. package/dist/publicRouteRegistry.js +17 -0
  82. package/dist/publicRouteRegistryBinding.js +194 -0
  83. package/dist/publicRouteRegistryDefinition.js +76 -0
  84. package/dist/publicRouteSitePublication.js +40 -0
  85. package/dist/publicRouteTables.js +13 -0
  86. package/dist/publicRouteUrl.js +18 -0
  87. package/dist/publicationSeo.js +52 -0
  88. package/dist/publicationState.js +296 -0
  89. package/dist/quality.js +8 -8
  90. package/dist/reconfigurePublicRoutes.js +41 -0
  91. package/dist/redirects.js +104 -73
  92. package/dist/referenceGraph.js +15 -14
  93. package/dist/references.js +2 -2
  94. package/dist/release.js +177 -141
  95. package/dist/renderReadAuthority.js +43 -0
  96. package/dist/renderReadGrant.js +137 -0
  97. package/dist/review.js +28 -28
  98. package/dist/richDocument.js +54 -24
  99. package/dist/routeDispositionGraph.js +44 -0
  100. package/dist/routeDispositionRest.js +51 -0
  101. package/dist/routeDispositionService.js +73 -0
  102. package/dist/routeDispositionStore.js +289 -0
  103. package/dist/routeDispositionTables.js +5 -0
  104. package/dist/routeDispositions.js +91 -0
  105. package/dist/routeHistoryStorage.js +320 -0
  106. package/dist/routeHistoryStore.js +12 -0
  107. package/dist/schedule.js +36 -36
  108. package/dist/seo.js +1 -1
  109. package/dist/series.js +11 -11
  110. package/dist/share.js +13 -13
  111. package/dist/siteBindings.js +159 -0
  112. package/dist/siteBuildCandidate.js +104 -0
  113. package/dist/siteDelivery.js +115 -0
  114. package/dist/siteState.js +47 -0
  115. package/dist/snapshotAddressGraph.js +55 -0
  116. package/dist/snapshotAddressRead.js +73 -0
  117. package/dist/snapshotAppConsumer.js +71 -0
  118. package/dist/snapshotAppExecution.js +102 -0
  119. package/dist/snapshotApplication.js +75 -0
  120. package/dist/snapshotApprovedRouteDispositions.js +44 -0
  121. package/dist/snapshotAssetAssembly.js +70 -0
  122. package/dist/snapshotAssetAssemblyRest.js +50 -0
  123. package/dist/snapshotBindingRead.js +61 -0
  124. package/dist/snapshotCodeSeo.js +29 -0
  125. package/dist/snapshotComponent.js +34 -0
  126. package/dist/snapshotComponentSource.js +24 -0
  127. package/dist/snapshotConsumer.js +87 -0
  128. package/dist/snapshotContentIdentity.js +10 -0
  129. package/dist/snapshotDefinitions.js +264 -0
  130. package/dist/snapshotDocumentAssembly.js +193 -0
  131. package/dist/snapshotDocumentAssemblyRest.js +84 -0
  132. package/dist/snapshotDocumentProjection.js +202 -0
  133. package/dist/snapshotDocumentTransfer.js +35 -0
  134. package/dist/snapshotDocumentTransferRest.js +80 -0
  135. package/dist/snapshotDomains.js +56 -0
  136. package/dist/snapshotEnvironment.js +31 -0
  137. package/dist/snapshotFieldPlan.js +85 -0
  138. package/dist/snapshotFrontend.js +103 -0
  139. package/dist/snapshotLink.js +8 -0
  140. package/dist/snapshotMedia.js +111 -0
  141. package/dist/snapshotMediaCapture.js +246 -0
  142. package/dist/snapshotMediaFields.js +225 -0
  143. package/dist/snapshotMediaRead.js +185 -0
  144. package/dist/snapshotMediaReader.js +13 -0
  145. package/dist/snapshotObservation.js +16 -0
  146. package/dist/snapshotObservedRouteHistory.js +34 -0
  147. package/dist/snapshotOutputTransfer.js +78 -0
  148. package/dist/snapshotPageLoader.js +7 -0
  149. package/dist/snapshotPageSeo.js +59 -0
  150. package/dist/snapshotPathLocale.js +15 -0
  151. package/dist/snapshotPresentation.js +86 -0
  152. package/dist/snapshotPresentationPolicy.js +12 -0
  153. package/dist/snapshotProjection.js +119 -0
  154. package/dist/snapshotPublicAccess.js +161 -0
  155. package/dist/snapshotPublicRouteHistory.js +40 -0
  156. package/dist/snapshotReadAdmission.js +38 -0
  157. package/dist/snapshotRedirectOutput.js +151 -0
  158. package/dist/snapshotRedirectTargets.js +24 -0
  159. package/dist/snapshotRedirects.js +132 -0
  160. package/dist/snapshotReference.js +8 -0
  161. package/dist/snapshotReferenceAddress.js +10 -0
  162. package/dist/snapshotReferenceGraph.js +79 -0
  163. package/dist/snapshotReferenceRead.js +65 -0
  164. package/dist/snapshotRelease.js +99 -0
  165. package/dist/snapshotRender.js +361 -0
  166. package/dist/snapshotRenderDependencies.js +178 -0
  167. package/dist/snapshotRenditions.js +88 -0
  168. package/dist/snapshotRichDocument.js +62 -0
  169. package/dist/snapshotRoleTransfer.js +106 -0
  170. package/dist/snapshotRoleTransferRest.js +99 -0
  171. package/dist/snapshotRouteAdmission.js +71 -0
  172. package/dist/snapshotRouteDispatch.js +111 -0
  173. package/dist/snapshotRouteDispositionPlan.js +73 -0
  174. package/dist/snapshotRouteRead.js +43 -0
  175. package/dist/snapshotRoutes.js +79 -0
  176. package/dist/snapshotRouting.js +113 -0
  177. package/dist/snapshotSeo.js +179 -0
  178. package/dist/snapshotSeoControls.js +101 -0
  179. package/dist/snapshotSeoDocumentInventory.js +115 -0
  180. package/dist/snapshotSeoDocuments.js +129 -0
  181. package/dist/snapshotSeoMerge.js +85 -0
  182. package/dist/snapshotSeoMetadata.js +137 -0
  183. package/dist/snapshotSeoOutput.js +173 -0
  184. package/dist/snapshotSeoPathSets.js +105 -0
  185. package/dist/snapshotSeoRead.js +88 -0
  186. package/dist/snapshotSite.js +128 -0
  187. package/dist/snapshotSitemapFiles.js +36 -0
  188. package/dist/snapshotTreeDependencies.js +58 -0
  189. package/dist/snapshotTreeLoader.js +10 -0
  190. package/dist/snapshotTreeRead.js +158 -0
  191. package/dist/staticPathSet.js +177 -0
  192. package/dist/staticPathSetRest.js +129 -0
  193. package/dist/staticPathSetService.js +249 -0
  194. package/dist/staticPathSetStore.js +338 -0
  195. package/dist/tree.js +9 -9
  196. package/dist/validation.js +53 -53
  197. package/dist/web.d.ts +709 -7
  198. package/dist/web.js +50 -33
  199. package/dist/workflow.js +8 -8
  200. package/dist/write.js +250 -225
  201. package/package.json +20 -6
@@ -1,14 +1,19 @@
1
- import { asTyped as e } from "./effectForm.js";
2
- import { indexForSearch as t } from "./search.js";
3
- import { recordPaths as n } from "./redirects.js";
4
- import { hasReferenceFields as r, writeReferences as i } from "./references.js";
5
- import { writeAvailability as a } from "./availability.js";
6
- import { newVariantId as o, pickDeclared as s, scopeColumns as c, writeRevision as l } from "./write.js";
7
- import { and as u, eq as d, neq as f } from "@voltro/database";
1
+ import { PublicRouteRegistryUnavailable as e } from "./publicRouteRegistry.js";
2
+ import { ChangeFeedUnavailable as t } from "./errors.js";
3
+ import { asTyped as n } from "./effectForm.js";
4
+ import { indexForSearch as r } from "./search.js";
5
+ import { lockPublicationStream as i, recordChange as a } from "./changes.js";
6
+ import { recordPublicationPaths as o } from "./redirects.js";
7
+ import { hasReferenceFields as s, writeReferences as c } from "./references.js";
8
+ import { pickDeclared as l } from "./contentValues.js";
9
+ import { reconcilePublishedContentRoutes as u, withPublicRoutePublicationBatch as d } from "./publicRoutePublication.js";
10
+ import { writeAvailability as f } from "./availability.js";
11
+ import { newVariantId as p, scopeColumns as m, writeRevision as h } from "./write.js";
12
+ import { and as g, eq as _, neq as v } from "@voltro/database";
8
13
  //#region src/environments.ts
9
- var p = (e, t, n, r) => e.query({
14
+ var y = (e, t, n, r) => e.query({
10
15
  table: t,
11
- predicate: u(d("site", n), d("environment", r), f("status", "archived")),
16
+ predicate: g(_("site", n), _("environment", r), v("status", "archived")),
12
17
  order: [{
13
18
  column: "id",
14
19
  direction: "asc"
@@ -16,84 +21,117 @@ var p = (e, t, n, r) => e.query({
16
21
  take: void 0,
17
22
  skip: void 0,
18
23
  projection: void 0
19
- }), m = async (e, u, d) => {
20
- if (d.from === d.to) return {
24
+ }), b = async (e, n, r) => {
25
+ let a;
26
+ for (let i of n) for (let n of [.../* @__PURE__ */ new Set([r.from, r.to])].sort()) for (let o of [i.name + "_drafts", i.name + "_published"]) {
27
+ let i = await y(e, o, r.site, n);
28
+ for (let e of i) {
29
+ if (typeof e.tenantId != "string" || e.tenantId === "" || a !== void 0 && e.tenantId !== a) throw new t({ reason: "scope" });
30
+ a = e.tenantId;
31
+ }
32
+ }
33
+ if (a === void 0) return null;
34
+ for (let t of [.../* @__PURE__ */ new Set([r.from, r.to])].sort()) await i(e, {
35
+ tenantId: a,
36
+ site: r.site,
37
+ environment: t
38
+ });
39
+ return {
40
+ tenantId: a,
41
+ site: r.site,
42
+ environment: r.to
43
+ };
44
+ }, x = async (e, n, g) => {
45
+ if (g.from === g.to) return {
21
46
  ok: !1,
22
47
  reason: "sameEnvironment",
23
48
  variants: 0
24
49
  };
25
- let f = 0;
26
- for (let t of u) f += (await p(e, `${t.name}_drafts`, d.site, d.to)).length;
27
- if (f > 0) return {
50
+ let _ = await b(e, n, g), v = 0;
51
+ for (let t of n) v += (await y(e, `${t.name}_drafts`, g.site, g.to)).length;
52
+ return v > 0 ? {
28
53
  ok: !1,
29
54
  reason: "targetNotEmpty",
30
- variants: f
31
- };
32
- let m = 0, h = 0;
33
- for (let f of u) {
34
- let u = await p(e, `${f.name}_drafts`, d.site, d.from), g = new Map((await p(e, `${f.name}_published`, d.site, d.from)).map((e) => [String(e.id), e])), _ = /* @__PURE__ */ new Set();
35
- for (let n of u) {
36
- let u = {
37
- site: d.site,
38
- environment: d.to,
39
- locale: String(n.locale)
40
- }, p = String(n.documentId), v = n.tenantId, y = o(f), b = g.get(String(n.id)), x = s(f, n), S = 0, C;
41
- b !== void 0 && (C = await l(e, f, p, ++S, s(f, b), u, v));
42
- let w = b !== void 0 && b.revisionId === n.revisionId && C !== void 0 ? C : await l(e, f, p, ++S, x, u, v), T = v == null ? {} : { tenantId: v }, E = await e.insert(`${f.name}_drafts`, {
43
- ...x,
44
- id: y,
45
- documentId: p,
46
- ...c(u),
47
- status: n.status,
48
- revisionId: w.id,
49
- revision: w.number,
50
- ...T
51
- });
52
- if (await t(e, f, E, u, "draft"), r(f) && await i(e, f, E, u, "draft"), m++, b !== void 0 && C !== void 0) {
53
- let n = await e.insert(`${f.name}_published`, {
54
- ...s(f, b),
55
- id: y,
56
- documentId: p,
57
- ...c(u),
58
- status: "published",
59
- revisionId: C.id,
60
- revision: C.number,
61
- ...T
55
+ variants: v
56
+ } : _ === null ? {
57
+ ok: !0,
58
+ variants: 0,
59
+ published: 0
60
+ } : d(e, _, async () => {
61
+ let d = 0, v = 0;
62
+ for (let b of n) {
63
+ let n = await y(e, `${b.name}_drafts`, g.site, g.from), x = new Map((await y(e, `${b.name}_published`, g.site, g.from)).map((e) => [String(e.id), e])), S = /* @__PURE__ */ new Set();
64
+ for (let o of n) {
65
+ let n = {
66
+ site: g.site,
67
+ environment: g.to,
68
+ locale: String(o.locale)
69
+ }, y = String(o.documentId), C = o.tenantId;
70
+ if (_ === null || C !== _.tenantId) throw new t({ reason: "scope" });
71
+ let w = p(b), T = x.get(String(o.id)), E = l(b, o), D = 0, O;
72
+ T !== void 0 && (O = await h(e, b, y, ++D, l(b, T), n, C));
73
+ let k = T !== void 0 && T.revisionId === o.revisionId && O !== void 0 ? O : await h(e, b, y, ++D, E, n, C), A = C == null ? {} : { tenantId: C }, j = await e.insert(`${b.name}_drafts`, {
74
+ ...E,
75
+ id: w,
76
+ documentId: y,
77
+ ...m(n),
78
+ status: o.status,
79
+ revisionId: k.id,
80
+ revision: k.number,
81
+ ...A
62
82
  });
63
- await i(e, f, n, u), await a(e, f, n, u), await t(e, f, n, u, "published"), _.add(`${u.locale}\u0000${String(v ?? "")}`), h++;
83
+ if (await r(e, b, j, n, "draft"), s(b) && await c(e, b, j, n, "draft"), d++, T !== void 0 && O !== void 0) {
84
+ if (typeof C != "string" || C === "") throw new t({ reason: "scope" });
85
+ await i(e, {
86
+ tenantId: C,
87
+ site: g.site,
88
+ environment: g.to
89
+ });
90
+ let o = await e.insert(`${b.name}_published`, {
91
+ ...l(b, T),
92
+ id: w,
93
+ documentId: y,
94
+ ...m(n),
95
+ status: "published",
96
+ revisionId: O.id,
97
+ revision: O.number,
98
+ ...A
99
+ });
100
+ await a(e, b, o, n, "published"), await u(e, b, o, n), await c(e, b, o, n), await f(e, b, o, n), await r(e, b, o, n, "published"), S.add(`${n.locale}\u0000${String(C ?? "")}`), v++;
101
+ }
102
+ }
103
+ for (let t of S) {
104
+ let [n, r] = t.split("\0");
105
+ await o(e, b, {
106
+ site: g.site,
107
+ environment: g.to,
108
+ locale: n
109
+ }, r === "" ? void 0 : r);
64
110
  }
65
111
  }
66
- for (let t of _) {
67
- let [r, i] = t.split("\0");
68
- await n(e, f, {
69
- site: d.site,
70
- environment: d.to,
71
- locale: r
72
- }, i === "" ? void 0 : i);
73
- }
74
- }
75
- return {
76
- ok: !0,
77
- variants: m,
78
- published: h
79
- };
80
- }, h = (e) => JSON.stringify(e, (e, t) => typeof t == "object" && t && !Array.isArray(t) && !(t instanceof Date) ? Object.fromEntries(Object.entries(t).sort(([e], [t]) => e < t ? -1 : 1)) : t), g = (e) => {
112
+ return {
113
+ ok: !0,
114
+ variants: d,
115
+ published: v
116
+ };
117
+ });
118
+ }, S = (e) => JSON.stringify(e, (e, t) => typeof t == "object" && t && !Array.isArray(t) && !(t instanceof Date) ? Object.fromEntries(Object.entries(t).sort(([e], [t]) => e < t ? -1 : 1)) : t), C = (e) => {
81
119
  for (let t of [
82
120
  "title",
83
121
  "name",
84
122
  "slug"
85
123
  ]) if (typeof e[t] == "string" && e[t] !== "") return e[t];
86
124
  return String(e.documentId);
87
- }, _ = async (e, t, n) => {
125
+ }, w = async (e, t, n) => {
88
126
  let r = [];
89
127
  for (let i of t) {
90
- let t = async (t) => new Set((await p(e, `${i.name}_drafts`, n.site, t)).map((e) => String(e.documentId))), [a, o] = [await t(n.from), await t(n.to)], c = async (t) => new Map((await p(e, `${i.name}_published`, n.site, t)).map((e) => [`${String(e.documentId)}\u0000${String(e.locale)}`, e])), [l, u] = [await c(n.from), await c(n.to)], d = [];
91
- for (let [e, t] of l) {
128
+ let t = async (t) => new Set((await y(e, `${i.name}_drafts`, n.site, t)).map((e) => String(e.documentId))), [a, o] = [await t(n.from), await t(n.to)], s = async (t) => new Map((await y(e, `${i.name}_published`, n.site, t)).map((e) => [`${String(e.documentId)}\u0000${String(e.locale)}`, e])), [c, u] = [await s(n.from), await s(n.to)], d = [];
129
+ for (let [e, t] of c) {
92
130
  let n = u.get(e);
93
- n !== void 0 && h(s(i, t)) !== h(s(i, n)) && d.push({
131
+ n !== void 0 && S(l(i, t)) !== S(l(i, n)) && d.push({
94
132
  documentId: String(t.documentId),
95
133
  locale: String(t.locale),
96
- title: g(n)
134
+ title: C(n)
97
135
  });
98
136
  }
99
137
  r.push({
@@ -104,6 +142,6 @@ var p = (e, t, n, r) => e.query({
104
142
  });
105
143
  }
106
144
  return r;
107
- }, v = (...t) => e(() => _(...t)), y = (...t) => e(() => m(...t));
145
+ }, T = (...e) => n(() => w(...e)), E = (...r) => n(() => x(...r), t, e);
108
146
  //#endregion
109
- export { _ as compareEnvironments, v as compareEnvironmentsEffect, m as copyEnvironment, y as copyEnvironmentEffect };
147
+ export { w as compareEnvironments, T as compareEnvironmentsEffect, x as copyEnvironment, E as copyEnvironmentEffect, b as lockEnvironmentPairForPublication };
package/dist/errors.js CHANGED
@@ -1,13 +1,21 @@
1
1
  import { Schema as e } from "effect";
2
2
  //#region src/errors.ts
3
- var t = e.Struct({
3
+ var t = class extends e.TaggedError()("EnvironmentAliasUnavailable", { reason: e.Literals([
4
+ "scope",
5
+ "name",
6
+ "target",
7
+ "missing",
8
+ "conflict",
9
+ "revision",
10
+ "state"
11
+ ]) }) {}, n = e.Struct({
4
12
  field: e.String,
5
13
  rule: e.String,
6
14
  message: e.String
7
- }), n = class extends e.TaggedError()("ContentValidationFailed", {
15
+ }), r = class extends e.TaggedError()("ContentValidationFailed", {
8
16
  contentType: e.String,
9
- violations: e.Array(t)
10
- }) {}, r = class extends e.TaggedError()("ContentNotFound", {
17
+ violations: e.Array(n)
18
+ }) {}, i = class extends e.TaggedError()("ContentNotFound", {
11
19
  contentType: e.String,
12
20
  id: e.String,
13
21
  stage: e.Literals([
@@ -16,25 +24,25 @@ var t = e.Struct({
16
24
  "revision",
17
25
  "share"
18
26
  ])
19
- }) {}, i = class extends e.TaggedError()("ContentGone", {
27
+ }) {}, a = class extends e.TaggedError()("ContentGone", {
20
28
  contentType: e.String,
21
29
  path: e.String
22
- }) {}, a = class extends e.TaggedError()("ContentIdConflict", {
30
+ }) {}, o = class extends e.TaggedError()("ContentIdConflict", {
23
31
  contentType: e.String,
24
32
  id: e.String
25
- }) {}, o = class extends e.TaggedError()("RevisionMismatch", {
33
+ }) {}, s = class extends e.TaggedError()("RevisionMismatch", {
26
34
  contentType: e.String,
27
35
  id: e.String,
28
36
  expected: e.String,
29
37
  actual: e.String
30
- }) {}, s = class extends e.TaggedError()("ReleaseNotEditable", {
38
+ }) {}, c = class extends e.TaggedError()("ReleaseNotEditable", {
31
39
  id: e.String,
32
40
  status: e.String
33
- }) {}, c = class extends e.TaggedError()("PreviewShareRejected", { reason: e.Literals(["expiryInPast", "expiryTooFar"]) }) {}, l = class extends e.TaggedError()("ReviewRequired", {
41
+ }) {}, l = class extends e.TaggedError()("PreviewShareRejected", { reason: e.Literals(["expiryInPast", "expiryTooFar"]) }) {}, u = class extends e.TaggedError()("ReviewRequired", {
34
42
  contentType: e.String,
35
43
  id: e.String,
36
44
  revisionId: e.String
37
- }) {}, u = class extends e.TaggedError()("ReviewStepRefused", {
45
+ }) {}, d = class extends e.TaggedError()("ReviewStepRefused", {
38
46
  contentType: e.String,
39
47
  id: e.String,
40
48
  reason: e.Literals([
@@ -42,7 +50,7 @@ var t = e.Struct({
42
50
  "selfApproval",
43
51
  "ambiguousOrder"
44
52
  ])
45
- }) {}, d = class extends e.TaggedError()("ReferenceUnavailable", {
53
+ }) {}, f = class extends e.TaggedError()("ReferenceUnavailable", {
46
54
  contentType: e.String,
47
55
  id: e.String,
48
56
  targets: e.Array(e.Struct({
@@ -58,10 +66,42 @@ var t = e.Struct({
58
66
  "purpose"
59
67
  ])
60
68
  }))
61
- }) {}, f = class extends e.TaggedError()("QuotaExceeded", {
69
+ }) {}, p = class extends e.TaggedError()("QuotaExceeded", {
62
70
  quota: e.String,
63
71
  limit: e.Number,
64
72
  used: e.Number
65
- }) {};
73
+ }) {}, m = class extends e.TaggedError()("ChangeFeedUnavailable", { reason: e.Literals([
74
+ "scope",
75
+ "cursor",
76
+ "migration",
77
+ "exhausted"
78
+ ]) }) {}, h = class extends e.TaggedError()("SiteStateUnavailable", { reason: e.Literals(["scope", "state"]) }) {}, g = class extends e.TaggedError()("SiteBindingUnavailable", { reason: e.Literals([
79
+ "scope",
80
+ "name",
81
+ "target",
82
+ "missing",
83
+ "conflict",
84
+ "revision",
85
+ "state"
86
+ ]) }) {}, _ = class extends e.TaggedError()("SiteDeliveryUnavailable", { reason: e.Literals([
87
+ "definition",
88
+ "environment",
89
+ "locale",
90
+ "fallback",
91
+ "prefix",
92
+ "binding"
93
+ ]) }) {}, v = class extends e.TaggedError()("ContentLocationUnavailable", { reason: e.Literals([
94
+ "definition",
95
+ "field",
96
+ "tree",
97
+ "path",
98
+ "bounds"
99
+ ]) }) {}, y = class extends e.TaggedError()("ContentSeoUnavailable", { reason: e.Literals([
100
+ "definition",
101
+ "field",
102
+ "defaults",
103
+ "values",
104
+ "scope"
105
+ ]) }) {};
66
106
  //#endregion
67
- export { i as ContentGone, a as ContentIdConflict, r as ContentNotFound, n as ContentValidationFailed, c as PreviewShareRejected, f as QuotaExceeded, d as ReferenceUnavailable, s as ReleaseNotEditable, l as ReviewRequired, u as ReviewStepRefused, o as RevisionMismatch };
107
+ export { m as ChangeFeedUnavailable, a as ContentGone, o as ContentIdConflict, v as ContentLocationUnavailable, i as ContentNotFound, y as ContentSeoUnavailable, r as ContentValidationFailed, t as EnvironmentAliasUnavailable, l as PreviewShareRejected, p as QuotaExceeded, f as ReferenceUnavailable, c as ReleaseNotEditable, u as ReviewRequired, d as ReviewStepRefused, s as RevisionMismatch, g as SiteBindingUnavailable, _ as SiteDeliveryUnavailable, h as SiteStateUnavailable };
@@ -1,5 +1,5 @@
1
- import { asTyped as e } from "./effectForm.js";
2
- import { ContentIdConflict as t, ContentNotFound as n, ContentValidationFailed as r, ReleaseNotEditable as i, RevisionMismatch as a } from "./errors.js";
1
+ import { ContentIdConflict as e, ContentNotFound as t, ContentValidationFailed as n, ReleaseNotEditable as r, RevisionMismatch as i } from "./errors.js";
2
+ import { asTyped as a } from "./effectForm.js";
3
3
  import { saveDraft as o } from "./write.js";
4
4
  import { CMS_RELEASE_ITEMS_TABLE as s, addToRelease as c, createRelease as l, releaseStatusOf as u } from "./release.js";
5
5
  import { and as d, eq as f, id as p, integer as m, json as h, table as g, text as _, timestamp as v } from "@voltro/database";
@@ -518,11 +518,11 @@ var b = "cms_experiments", x = "cms_experiment_events", S = g(b, {
518
518
  adopted: i
519
519
  };
520
520
  }, Y = [
521
- r,
522
- t,
523
521
  n,
524
- a,
525
- i
526
- ], X = (...t) => e(() => V(...t)), Z = (...t) => e(() => K(...t)), Q = (...t) => e(() => H(...t)), $ = (...t) => e(() => U(...t)), ee = (...t) => e(() => B(...t)), te = (...t) => e(() => P(...t)), ne = (...t) => e(() => z(...t)), re = (...t) => e(() => q(...t), ...Y), ie = (...t) => e(() => L(...t)), ae = (...t) => e(() => J(...t));
522
+ e,
523
+ t,
524
+ i,
525
+ r
526
+ ], X = (...e) => a(() => V(...e)), Z = (...e) => a(() => K(...e)), Q = (...e) => a(() => H(...e)), $ = (...e) => a(() => U(...e)), ee = (...e) => a(() => B(...e)), te = (...e) => a(() => P(...e)), ne = (...e) => a(() => z(...e)), re = (...e) => a(() => q(...e), ...Y), ie = (...e) => a(() => L(...e)), ae = (...e) => a(() => J(...e));
527
527
  //#endregion
528
528
  export { b as CMS_EXPERIMENTS_TABLE, x as CMS_EXPERIMENT_EVENTS_TABLE, W as MIN_READERS, q as adoptWinner, re as adoptWinnerEffect, A as applyVariant, O as assignVariant, C as cmsExperimentEventsTable, S as cmsExperimentsTable, V as experimentById, X as experimentByIdEffect, j as experimentFields, J as experimentLineage, ae as experimentLineageEffect, M as experimentOverrideKeys, R as experimentReleaseHook, K as experimentResults, Z as experimentResultsEffect, H as listExperiments, Q as listExperimentsEffect, L as planExperiment, ie as planExperimentEffect, U as recordExperimentEvent, $ as recordExperimentEventEffect, B as runningExperiment, ee as runningExperimentEffect, P as startExperiment, te as startExperimentEffect, z as stopExperiment, ne as stopExperimentEffect };
@@ -0,0 +1,99 @@
1
+ import { createFrontendMediaReader as e } from "./frontendMedia.js";
2
+ import { admitSnapshotPresentation as t } from "./snapshotPresentation.js";
3
+ import { Schema as n } from "effect";
4
+ //#region src/frontendBindings.ts
5
+ var r = [
6
+ "empty",
7
+ "loading",
8
+ "error"
9
+ ], i = class extends n.TaggedError()("FrontendBindingUnavailable", { reason: n.Literals([
10
+ "definition",
11
+ "missing",
12
+ "schema",
13
+ "implementation",
14
+ "context"
15
+ ]) }) {}, a = (e) => {
16
+ throw new i({ reason: e });
17
+ }, o = (e) => typeof e == "string" && /^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/.test(e), s = (e) => {
18
+ if (typeof e != "object" || !e || Array.isArray(e) || ![Object.prototype, null].includes(Object.getPrototypeOf(e)) || Object.getOwnPropertySymbols(e).length) return a("definition");
19
+ let t = Object.getOwnPropertyDescriptors(e);
20
+ return Object.values(t).some((e) => !e.enumerable || !("value" in e)) ? a("definition") : Object.fromEntries(Object.entries(t).map(([e, t]) => [e, t.value]));
21
+ }, c = (e) => {
22
+ let t = s(e);
23
+ return Object.keys(t).length !== 2 || !o(t.channel) || !o(t.theme) ? a("definition") : Object.freeze({
24
+ channel: t.channel,
25
+ theme: t.theme
26
+ });
27
+ }, l = (e) => {
28
+ let t = s(e), n = c({
29
+ channel: t.channel,
30
+ theme: t.theme
31
+ });
32
+ return Object.keys(t).length !== 6 || typeof t.localeId != "string" || !/^[a-z][a-z0-9_-]{0,63}$/.test(t.localeId) || typeof t.contentLocale != "string" || t.contentLocale.length === 0 || t.contentLocale.length > 64 || t.contentLocale.trim() !== t.contentLocale || typeof t.languageTag != "string" || t.languageTag.length > 128 || !/^[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)*$/.test(t.languageTag) || t.direction !== "ltr" && t.direction !== "rtl" ? a("definition") : Object.freeze({
33
+ ...n,
34
+ localeId: t.localeId,
35
+ contentLocale: t.contentLocale,
36
+ languageTag: t.languageTag,
37
+ direction: t.direction
38
+ });
39
+ }, u = (e) => JSON.stringify(l(e)), d = (e) => {
40
+ if (!Array.isArray(e) || e.length === 0 || e.length > 1024 || Object.getOwnPropertySymbols(e).length || Object.keys(e).length !== e.length || Object.keys(e).some((e, t) => e !== String(t))) return a("definition");
41
+ let t = Object.getOwnPropertyDescriptors(e);
42
+ if (Object.entries(t).some(([e, t]) => e !== "length" && (!t.enumerable || !("value" in t)))) return a("definition");
43
+ let n = Array.from({ length: e.length }, (e, n) => l(t[String(n)].value)).map((e) => [u(e), e]).sort(([e], [t]) => e < t ? -1 : +(e > t));
44
+ return new Set(n.map(([e]) => e)).size === n.length ? Object.freeze(n.map(([, e]) => e)) : a("definition");
45
+ }, f = (e, t) => e.some((e) => u(e) === u(t)), p = (e) => {
46
+ let t = s(e), n = /* @__PURE__ */ new Map();
47
+ return Object.keys(t).length > 4096 ? a("definition") : Object.freeze(Object.fromEntries(Object.keys(t).sort().map((e) => {
48
+ let i = s(t[e]), c = s(i.schema);
49
+ if (c.id !== e || !/^[a-z][a-zA-Z0-9]*$/.test(e) || Object.keys(i).some((e) => ![
50
+ "schema",
51
+ "renderer",
52
+ "contexts",
53
+ "render",
54
+ "restricted",
55
+ ...r
56
+ ].includes(e)) || !o(i.renderer)) return a("definition");
57
+ if (typeof i.render != "function" || r.some((e) => typeof i[e] != "function") || i.restricted !== void 0 && typeof i.restricted != "function" || c.consent !== void 0 && typeof i.restricted != "function") return a("implementation");
58
+ if (c.consent !== void 0 && (typeof c.consent != "string" || c.consent.length === 0)) return a("definition");
59
+ let l = d(i.contexts), u = [
60
+ "render",
61
+ ...r,
62
+ "restricted"
63
+ ].map((e) => i[e]), f = n.get(i.renderer);
64
+ return f !== void 0 && f.some((e, t) => e !== u[t]) ? a("implementation") : (n.set(i.renderer, u), [e, Object.freeze({
65
+ schema: i.schema,
66
+ renderer: i.renderer,
67
+ contexts: l,
68
+ render: i.render,
69
+ empty: i.empty,
70
+ loading: i.loading,
71
+ error: i.error,
72
+ ...i.restricted === void 0 ? {} : { restricted: i.restricted }
73
+ })]);
74
+ })));
75
+ }, m = (n, i) => {
76
+ let o = p(n);
77
+ if (!Object.hasOwn(o, i.componentId)) return a("missing");
78
+ let s = o[i.componentId], c = l(i.context);
79
+ if (!f(s.contexts, c)) return a("context");
80
+ if (i.state !== "content" && !r.includes(i.state)) return a("definition");
81
+ let u = t(i.consentPurposes, i.presentation), d = s.schema.consent !== void 0 && !u.granted.some((e) => e.id === s.schema.consent), m = {
82
+ componentId: i.componentId,
83
+ context: c,
84
+ ...i.source === void 0 ? {} : { source: i.source }
85
+ };
86
+ return i.observe?.({
87
+ componentId: i.componentId,
88
+ renderer: s.renderer,
89
+ handler: d ? "restricted" : i.state === "content" ? "render" : i.state
90
+ }), d ? s.restricted({
91
+ ...m,
92
+ purpose: s.schema.consent
93
+ }) : i.state === "content" ? s.render(i.props, c, {
94
+ media: e(i.media?.entries ?? [], i.media?.fieldPath ?? [], i.media?.observe),
95
+ ...i.source === void 0 ? {} : { source: i.source }
96
+ }) : s[i.state](m);
97
+ };
98
+ //#endregion
99
+ export { i as FrontendBindingUnavailable, d as copyFrontendContexts, l as copyFrontendOutputContext, c as copyFrontendOutputSelection, p as defineFrontendBindings, u as frontendContextKey, o as frontendRendererId, r as frontendStates, m as renderCapturedFrontendComponent, f as supportsFrontendContext };
@@ -0,0 +1,18 @@
1
+ //#region src/frontendMedia.ts
2
+ var e = (e, t = [], n) => {
3
+ let r = [...t];
4
+ return (t, i = { kind: "original" }) => {
5
+ let a = [...r, ...t], o = e.filter((e) => e.fieldPath.length === a.length && e.fieldPath.every((e, t) => e === a[t]) && e.output.kind === i.kind && (i.kind !== "rendition" || e.output.kind === "rendition" && e.output.slot === i.slot));
6
+ if (o.length > 1) throw Error("Ambiguous rendered media selection");
7
+ let s = o[0];
8
+ return s !== void 0 && n?.({
9
+ fieldPath: [...a],
10
+ output: { ...s.output }
11
+ }), s === void 0 ? null : {
12
+ url: s.url,
13
+ contentType: s.contentType
14
+ };
15
+ };
16
+ };
17
+ //#endregion
18
+ export { e as createFrontendMediaReader };