@voltro/cms 0.85.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 (244) hide show
  1. package/CHANGELOG.md +5987 -0
  2. package/README.md +138 -0
  3. package/THIRD-PARTY-NOTICES.md +864 -253
  4. package/dist/ContentForm.js +282 -0
  5. package/dist/RichDocumentEditor.js +550 -0
  6. package/dist/RichDocumentView.js +177 -0
  7. package/dist/RichTextSurface.js +135 -0
  8. package/dist/aiCandidates.js +199 -0
  9. package/dist/aiOperations.js +152 -0
  10. package/dist/applicationBuildSnapshotService.js +101 -0
  11. package/dist/assetRenditions.js +102 -0
  12. package/dist/assetRevision.js +46 -0
  13. package/dist/assetUseRights.js +72 -0
  14. package/dist/audiences.js +31 -0
  15. package/dist/availability.js +124 -0
  16. package/dist/blueprint.js +166 -0
  17. package/dist/build.d.ts +3063 -0
  18. package/dist/build.js +37 -0
  19. package/dist/buildApplicationAdmission.js +16 -0
  20. package/dist/buildApplicationCatalog.js +136 -0
  21. package/dist/buildApplicationCatalogTable.js +24 -0
  22. package/dist/buildApplicationRest.js +99 -0
  23. package/dist/buildApplicationUpload.js +111 -0
  24. package/dist/buildSnapshot.js +401 -0
  25. package/dist/buildSnapshotApplicationPin.js +32 -0
  26. package/dist/buildSnapshotRest.js +210 -0
  27. package/dist/buildSnapshotService.js +265 -0
  28. package/dist/buildSnapshotTables.js +25 -0
  29. package/dist/bulk.js +282 -0
  30. package/dist/cacheIdentity.js +152 -0
  31. package/dist/changes.js +307 -0
  32. package/dist/cmsContext.js +229 -0
  33. package/dist/collections.js +224 -0
  34. package/dist/consent.js +29 -0
  35. package/dist/contentLocations.js +53 -0
  36. package/dist/contentProjection.js +83 -0
  37. package/dist/contentRouteIdentity.js +13 -0
  38. package/dist/contentRouteMaterializer.js +97 -0
  39. package/dist/contentRouteTypes.js +39 -0
  40. package/dist/contentSeo.js +189 -0
  41. package/dist/contentTreePath.js +60 -0
  42. package/dist/contentType.js +208 -0
  43. package/dist/contentValues.js +18 -0
  44. package/dist/contentfulImport.js +162 -0
  45. package/dist/copies.js +89 -0
  46. package/dist/cutover.js +202 -0
  47. package/dist/deliveryChecks.js +138 -0
  48. package/dist/domainHost.js +7 -0
  49. package/dist/domains.js +139 -0
  50. package/dist/draftTexts.js +164 -0
  51. package/dist/duplicates.js +78 -0
  52. package/dist/edgePurge.js +69 -0
  53. package/dist/editHistory.js +113 -0
  54. package/dist/effectForm.js +11 -0
  55. package/dist/environmentAliases.js +138 -0
  56. package/dist/environments.js +147 -0
  57. package/dist/errors.js +107 -0
  58. package/dist/experiments.js +528 -0
  59. package/dist/exposure.js +28 -0
  60. package/dist/extensionManifest.js +81 -0
  61. package/dist/extensions.js +314 -0
  62. package/dist/fieldSchema.js +199 -0
  63. package/dist/formStrings.js +74 -0
  64. package/dist/frontendBindings.js +99 -0
  65. package/dist/frontendMedia.js +18 -0
  66. package/dist/glossary.js +73 -0
  67. package/dist/history.js +54 -0
  68. package/dist/htmlImport.js +297 -0
  69. package/dist/index.d.ts +771 -54
  70. package/dist/index.js +89 -6082
  71. package/dist/initializePublicRoutes.js +28 -0
  72. package/dist/liveContentRouteView.js +76 -0
  73. package/dist/media.js +29 -0
  74. package/dist/metrics.js +46 -0
  75. package/dist/migration.js +193 -0
  76. package/dist/migrationStages.js +13 -0
  77. package/dist/nativeOutputDeploymentService.js +205 -0
  78. package/dist/outputActivation.js +234 -0
  79. package/dist/outputActivationOrigin.js +51 -0
  80. package/dist/outputActivationStore.js +411 -0
  81. package/dist/outputActivationTables.js +11 -0
  82. package/dist/outputActivationTarget.js +81 -0
  83. package/dist/outputActivationTargetTable.js +25 -0
  84. package/dist/outputDeployment.js +174 -0
  85. package/dist/outputDeploymentRest.js +168 -0
  86. package/dist/outputDeploymentService.js +241 -0
  87. package/dist/outputRouteGraph.js +177 -0
  88. package/dist/outputSafetyArtifact.js +147 -0
  89. package/dist/outputTargetRest.js +62 -0
  90. package/dist/pathSegmentEncoding.js +4 -0
  91. package/dist/presenceAnchors.js +68 -0
  92. package/dist/preview.js +31 -0
  93. package/dist/privateCmsTransport.js +76 -0
  94. package/dist/privateNativeRouteReservation.js +10 -0
  95. package/dist/promotion.js +116 -0
  96. package/dist/publicBuild.js +90 -0
  97. package/dist/publicBuildRest.js +98 -0
  98. package/dist/publicBuildService.js +63 -0
  99. package/dist/publicOutputHttp.js +129 -0
  100. package/dist/publicOutputService.js +287 -0
  101. package/dist/publicPresentation.js +17 -0
  102. package/dist/publicRouteDispositionAdmission.js +38 -0
  103. package/dist/publicRouteHistoryStore.js +12 -0
  104. package/dist/publicRouteHistoryView.js +34 -0
  105. package/dist/publicRouteIntegrity.js +5 -0
  106. package/dist/publicRouteMutation.js +6 -0
  107. package/dist/publicRouteNamespace.js +134 -0
  108. package/dist/publicRoutePublication.js +36 -0
  109. package/dist/publicRouteRegistry.js +17 -0
  110. package/dist/publicRouteRegistryBinding.js +194 -0
  111. package/dist/publicRouteRegistryDefinition.js +76 -0
  112. package/dist/publicRouteSitePublication.js +40 -0
  113. package/dist/publicRouteTables.js +13 -0
  114. package/dist/publicRouteUrl.js +18 -0
  115. package/dist/publicationSeo.js +52 -0
  116. package/dist/publicationState.js +296 -0
  117. package/dist/quality.js +188 -0
  118. package/dist/reconfigurePublicRoutes.js +41 -0
  119. package/dist/recurrence.js +78 -0
  120. package/dist/redirects.js +130 -0
  121. package/dist/referenceGraph.js +224 -0
  122. package/dist/references.js +173 -0
  123. package/dist/release.js +241 -0
  124. package/dist/renderReadAuthority.js +43 -0
  125. package/dist/renderReadGrant.js +137 -0
  126. package/dist/rest.js +52 -0
  127. package/dist/review.js +160 -0
  128. package/dist/richDocument.js +521 -0
  129. package/dist/richInline.js +100 -0
  130. package/dist/routeDispositionGraph.js +44 -0
  131. package/dist/routeDispositionRest.js +51 -0
  132. package/dist/routeDispositionService.js +73 -0
  133. package/dist/routeDispositionStore.js +289 -0
  134. package/dist/routeDispositionTables.js +5 -0
  135. package/dist/routeDispositions.js +91 -0
  136. package/dist/routeHistoryStorage.js +320 -0
  137. package/dist/routeHistoryStore.js +12 -0
  138. package/dist/schedule.js +80 -0
  139. package/dist/search.js +148 -0
  140. package/dist/selectionIntent.js +164 -0
  141. package/dist/seo.js +31 -0
  142. package/dist/series.js +105 -0
  143. package/dist/share.js +112 -0
  144. package/dist/siteBindings.js +159 -0
  145. package/dist/siteBuildCandidate.js +104 -0
  146. package/dist/siteDelivery.js +115 -0
  147. package/dist/siteState.js +47 -0
  148. package/dist/snapshotAddressGraph.js +55 -0
  149. package/dist/snapshotAddressRead.js +73 -0
  150. package/dist/snapshotAppConsumer.js +71 -0
  151. package/dist/snapshotAppExecution.js +102 -0
  152. package/dist/snapshotApplication.js +75 -0
  153. package/dist/snapshotApprovedRouteDispositions.js +44 -0
  154. package/dist/snapshotAssetAssembly.js +70 -0
  155. package/dist/snapshotAssetAssemblyRest.js +50 -0
  156. package/dist/snapshotBindingRead.js +61 -0
  157. package/dist/snapshotCodeSeo.js +29 -0
  158. package/dist/snapshotComponent.js +34 -0
  159. package/dist/snapshotComponentSource.js +24 -0
  160. package/dist/snapshotConsumer.js +87 -0
  161. package/dist/snapshotContentIdentity.js +10 -0
  162. package/dist/snapshotDefinitions.js +264 -0
  163. package/dist/snapshotDocumentAssembly.js +193 -0
  164. package/dist/snapshotDocumentAssemblyRest.js +84 -0
  165. package/dist/snapshotDocumentProjection.js +202 -0
  166. package/dist/snapshotDocumentTransfer.js +35 -0
  167. package/dist/snapshotDocumentTransferRest.js +80 -0
  168. package/dist/snapshotDomains.js +56 -0
  169. package/dist/snapshotEnvironment.js +31 -0
  170. package/dist/snapshotFieldPlan.js +85 -0
  171. package/dist/snapshotFrontend.js +103 -0
  172. package/dist/snapshotLink.js +8 -0
  173. package/dist/snapshotMedia.js +111 -0
  174. package/dist/snapshotMediaCapture.js +246 -0
  175. package/dist/snapshotMediaFields.js +225 -0
  176. package/dist/snapshotMediaRead.js +185 -0
  177. package/dist/snapshotMediaReader.js +13 -0
  178. package/dist/snapshotObservation.js +16 -0
  179. package/dist/snapshotObservedRouteHistory.js +34 -0
  180. package/dist/snapshotOutputTransfer.js +78 -0
  181. package/dist/snapshotPageLoader.js +7 -0
  182. package/dist/snapshotPageSeo.js +59 -0
  183. package/dist/snapshotPathLocale.js +15 -0
  184. package/dist/snapshotPresentation.js +86 -0
  185. package/dist/snapshotPresentationPolicy.js +12 -0
  186. package/dist/snapshotProjection.js +119 -0
  187. package/dist/snapshotPublicAccess.js +161 -0
  188. package/dist/snapshotPublicRouteHistory.js +40 -0
  189. package/dist/snapshotReadAdmission.js +38 -0
  190. package/dist/snapshotRedirectOutput.js +151 -0
  191. package/dist/snapshotRedirectTargets.js +24 -0
  192. package/dist/snapshotRedirects.js +132 -0
  193. package/dist/snapshotReference.js +8 -0
  194. package/dist/snapshotReferenceAddress.js +10 -0
  195. package/dist/snapshotReferenceGraph.js +79 -0
  196. package/dist/snapshotReferenceRead.js +65 -0
  197. package/dist/snapshotRelease.js +99 -0
  198. package/dist/snapshotRender.js +361 -0
  199. package/dist/snapshotRenderDependencies.js +178 -0
  200. package/dist/snapshotRenditions.js +88 -0
  201. package/dist/snapshotRichDocument.js +62 -0
  202. package/dist/snapshotRoleTransfer.js +106 -0
  203. package/dist/snapshotRoleTransferRest.js +99 -0
  204. package/dist/snapshotRouteAdmission.js +71 -0
  205. package/dist/snapshotRouteDispatch.js +111 -0
  206. package/dist/snapshotRouteDispositionPlan.js +73 -0
  207. package/dist/snapshotRouteRead.js +43 -0
  208. package/dist/snapshotRoutes.js +79 -0
  209. package/dist/snapshotRouting.js +113 -0
  210. package/dist/snapshotSeo.js +179 -0
  211. package/dist/snapshotSeoControls.js +101 -0
  212. package/dist/snapshotSeoDocumentInventory.js +115 -0
  213. package/dist/snapshotSeoDocuments.js +129 -0
  214. package/dist/snapshotSeoMerge.js +85 -0
  215. package/dist/snapshotSeoMetadata.js +137 -0
  216. package/dist/snapshotSeoOutput.js +173 -0
  217. package/dist/snapshotSeoPathSets.js +105 -0
  218. package/dist/snapshotSeoRead.js +88 -0
  219. package/dist/snapshotSite.js +128 -0
  220. package/dist/snapshotSitemapFiles.js +36 -0
  221. package/dist/snapshotTreeDependencies.js +58 -0
  222. package/dist/snapshotTreeLoader.js +10 -0
  223. package/dist/snapshotTreeRead.js +158 -0
  224. package/dist/staticPathSet.js +177 -0
  225. package/dist/staticPathSetRest.js +129 -0
  226. package/dist/staticPathSetService.js +249 -0
  227. package/dist/staticPathSetStore.js +338 -0
  228. package/dist/stewardship.js +146 -0
  229. package/dist/taxonomy.js +36 -0
  230. package/dist/team.js +103 -0
  231. package/dist/templates.js +106 -0
  232. package/dist/trackChanges.js +197 -0
  233. package/dist/translation.js +64 -0
  234. package/dist/tree.js +87 -0
  235. package/dist/usage.js +50 -0
  236. package/dist/validation.js +192 -0
  237. package/dist/visualEditing.js +60 -0
  238. package/dist/web.d.ts +709 -7
  239. package/dist/web.js +50 -2
  240. package/dist/workflow.js +322 -0
  241. package/dist/write.js +419 -0
  242. package/dist/xliff.js +325 -0
  243. package/package.json +20 -6
  244. package/dist/presenceAnchors-4iHAVQB3.js +0 -4367
@@ -0,0 +1,314 @@
1
+ import { asTyped as e } from "./effectForm.js";
2
+ import { ExtensionAccessDenied as t, compareVersions as n, manifestProblems as r, newCapabilities as i, settingsProblems as a, settingsWithDefaults as o } from "./extensionManifest.js";
3
+ import { and as s, eq as c, id as l, json as u, table as d, text as f } from "@voltro/database";
4
+ import { tenant as p } from "@voltro/plugin-multitenancy/mixin";
5
+ //#region src/extensions.ts
6
+ var m = "cms_extensions", h = "cms_extension_data", g = "cms_extension_secrets", _ = d(m, {
7
+ id: l({ prefix: "cext" }),
8
+ extensionId: f(),
9
+ manifest: u(),
10
+ granted: u(),
11
+ pending: u().nullable(),
12
+ previous: u().nullable()
13
+ }).with(p()).unique("cms_extensions_uq_extension", ["tenantId", "extensionId"]), v = d(h, {
14
+ id: l({ prefix: "cexd" }),
15
+ extensionId: f(),
16
+ key: f(),
17
+ value: u()
18
+ }).with(p()).unique("cms_extension_data_uq_key", [
19
+ "tenantId",
20
+ "extensionId",
21
+ "key"
22
+ ]), y = d(g, {
23
+ id: l({ prefix: "cexs" }),
24
+ extensionId: f(),
25
+ name: f(),
26
+ value: f().encrypted().serverOnly()
27
+ }).with(p()).unique("cms_extension_secrets_uq_name", [
28
+ "tenantId",
29
+ "extensionId",
30
+ "name"
31
+ ]), b = (e, t, n) => e.query({
32
+ table: t,
33
+ predicate: n,
34
+ order: [{
35
+ column: "id",
36
+ direction: "asc"
37
+ }],
38
+ take: void 0,
39
+ skip: void 0,
40
+ projection: void 0
41
+ }), x = async (e, t) => (await b(e, m, c("extensionId", t)))[0], S = (e) => {
42
+ let t = e.granted, n = e.pending, r = e.previous;
43
+ return {
44
+ extensionId: String(e.extensionId),
45
+ manifest: e.manifest,
46
+ granted: t,
47
+ pending: n == null ? null : {
48
+ manifest: n,
49
+ adds: i(t, n.capabilities)
50
+ },
51
+ previous: r == null ? null : r.manifest
52
+ };
53
+ }, C = async (e) => (await b(e, m, void 0)).map(S).sort((e, t) => e.extensionId < t.extensionId ? -1 : 1), w = async (e, t) => {
54
+ let n = await x(e, t);
55
+ return n === void 0 ? null : S(n);
56
+ }, T = async (e, t, n) => {
57
+ let a = r(t);
58
+ if (a.length > 0) return {
59
+ ok: !1,
60
+ reason: "invalidManifest",
61
+ problems: a
62
+ };
63
+ let o = i(n, t.capabilities);
64
+ return o.length > 0 ? {
65
+ ok: !1,
66
+ reason: "consentIncomplete",
67
+ missing: o
68
+ } : await x(e, t.id) === void 0 ? {
69
+ ok: !0,
70
+ installed: S(await e.insert(m, {
71
+ extensionId: t.id,
72
+ manifest: t,
73
+ granted: [...t.capabilities],
74
+ pending: null,
75
+ previous: null
76
+ }))
77
+ } : {
78
+ ok: !1,
79
+ reason: "alreadyInstalled"
80
+ };
81
+ }, E = async (e, t) => {
82
+ let a = r(t);
83
+ if (a.length > 0) return {
84
+ ok: !1,
85
+ reason: "invalidManifest",
86
+ problems: a
87
+ };
88
+ let o = await x(e, t.id);
89
+ if (o === void 0) return {
90
+ ok: !1,
91
+ reason: "notInstalled"
92
+ };
93
+ let s = S(o);
94
+ if (n(t.version, s.manifest.version) <= 0) return {
95
+ ok: !1,
96
+ reason: "notNewer"
97
+ };
98
+ let c = i(s.granted, t.capabilities).length === 0 ? {
99
+ manifest: t,
100
+ granted: [...t.capabilities],
101
+ pending: null,
102
+ previous: {
103
+ manifest: s.manifest,
104
+ granted: s.granted
105
+ }
106
+ } : { pending: t }, l = await e.update(m, String(o.id), c);
107
+ return l === null ? {
108
+ ok: !1,
109
+ reason: "notInstalled"
110
+ } : {
111
+ ok: !0,
112
+ installed: S(l)
113
+ };
114
+ }, D = async (e, t, n) => {
115
+ let r = await x(e, t);
116
+ if (r === void 0) return {
117
+ ok: !1,
118
+ reason: "notInstalled"
119
+ };
120
+ let { pending: a } = S(r);
121
+ if (a === null) return {
122
+ ok: !1,
123
+ reason: "nothingPending"
124
+ };
125
+ let o = i(n, a.adds);
126
+ if (o.length > 0) return {
127
+ ok: !1,
128
+ reason: "consentIncomplete",
129
+ missing: o
130
+ };
131
+ let s = S(r), c = await e.update(m, String(r.id), {
132
+ manifest: a.manifest,
133
+ granted: [...a.manifest.capabilities],
134
+ pending: null,
135
+ previous: {
136
+ manifest: s.manifest,
137
+ granted: s.granted
138
+ }
139
+ });
140
+ return c === null ? {
141
+ ok: !1,
142
+ reason: "notInstalled"
143
+ } : {
144
+ ok: !0,
145
+ installed: S(c)
146
+ };
147
+ }, O = async (e, t) => {
148
+ let n = await x(e, t);
149
+ if (n === void 0) return {
150
+ ok: !1,
151
+ reason: "notInstalled"
152
+ };
153
+ let r = n.previous;
154
+ if (r == null) return {
155
+ ok: !1,
156
+ reason: "nothingToRollBack"
157
+ };
158
+ let i = await e.update(m, String(n.id), {
159
+ manifest: r.manifest,
160
+ granted: [...r.granted],
161
+ pending: null,
162
+ previous: null
163
+ });
164
+ return i === null ? {
165
+ ok: !1,
166
+ reason: "notInstalled"
167
+ } : {
168
+ ok: !0,
169
+ installed: S(i)
170
+ };
171
+ }, k = async (e, t) => {
172
+ let n = await x(e, t);
173
+ if (n === void 0) return {
174
+ ok: !1,
175
+ reason: "notInstalled"
176
+ };
177
+ let r = await e.update(m, String(n.id), {
178
+ granted: [],
179
+ pending: null
180
+ });
181
+ return r === null ? {
182
+ ok: !1,
183
+ reason: "notInstalled"
184
+ } : {
185
+ ok: !0,
186
+ installed: S(r)
187
+ };
188
+ }, A = async (e, t, n) => {
189
+ let r = await x(e, t);
190
+ if (r === void 0) return {
191
+ ok: !1,
192
+ reason: "notInstalled"
193
+ };
194
+ let { manifest: a } = S(r), o = i(n, a.capabilities);
195
+ if (o.length > 0) return {
196
+ ok: !1,
197
+ reason: "consentIncomplete",
198
+ missing: o
199
+ };
200
+ let s = await e.update(m, String(r.id), { granted: [...a.capabilities] });
201
+ return s === null ? {
202
+ ok: !1,
203
+ reason: "notInstalled"
204
+ } : {
205
+ ok: !0,
206
+ installed: S(s)
207
+ };
208
+ }, j = "voltro:settings", M = async (e, t) => {
209
+ let n = await w(e, t);
210
+ if (n === null) return null;
211
+ let [r] = await b(e, h, s(c("extensionId", t), c("key", j))), i = r?.value;
212
+ return o(n.manifest, typeof i == "object" && i ? i : {});
213
+ }, N = async (e, t, n) => {
214
+ let r = await w(e, t);
215
+ if (r === null) return {
216
+ ok: !1,
217
+ reason: "notInstalled"
218
+ };
219
+ let i = a(r.manifest, n);
220
+ if (i.length > 0) return {
221
+ ok: !1,
222
+ reason: "invalid",
223
+ problems: i
224
+ };
225
+ let l = {
226
+ ...await M(e, t),
227
+ ...n
228
+ }, [u] = await b(e, h, s(c("extensionId", t), c("key", j)));
229
+ return u === void 0 ? await e.insert(h, {
230
+ extensionId: t,
231
+ key: j,
232
+ value: l
233
+ }) : await e.update(h, String(u.id), { value: l }), {
234
+ ok: !0,
235
+ settings: o(r.manifest, l)
236
+ };
237
+ }, P = async (e, t) => {
238
+ let n = await x(e, t);
239
+ if (n === void 0) return {
240
+ ok: !1,
241
+ reason: "notInstalled"
242
+ };
243
+ let r = await b(e, h, c("extensionId", t));
244
+ for (let t of r) await e.delete(h, String(t.id));
245
+ for (let n of await b(e, g, c("extensionId", t))) await e.delete(g, String(n.id));
246
+ return await e.delete(m, String(n.id)), {
247
+ ok: !0,
248
+ data: r.map((e) => ({
249
+ key: String(e.key),
250
+ value: e.value
251
+ }))
252
+ };
253
+ }, F = async (e, t, n, r) => {
254
+ let i = await w(e, t);
255
+ if (i === null) return {
256
+ ok: !1,
257
+ reason: "notInstalled"
258
+ };
259
+ if (![...i.manifest.capabilities, ...i.pending?.manifest.capabilities ?? []].includes(`secret:${n}`)) return {
260
+ ok: !1,
261
+ reason: "notAsked"
262
+ };
263
+ let [a] = await b(e, g, s(c("extensionId", t), c("name", n)));
264
+ return r === null ? a !== void 0 && await e.delete(g, String(a.id)) : a === void 0 ? await e.insert(g, {
265
+ extensionId: t,
266
+ name: n,
267
+ value: r
268
+ }) : await e.update(g, String(a.id), { value: r }), { ok: !0 };
269
+ }, I = async (e, t, n) => {
270
+ let [r] = await b(e, g, s(c("extensionId", t), c("name", n)));
271
+ return typeof r?.value == "string" ? r.value : void 0;
272
+ }, L = (e, n, r) => {
273
+ let i = n.extensionId, a = (e) => {
274
+ if (!n.granted.includes(e)) throw new t({
275
+ extensionId: i,
276
+ capability: e
277
+ });
278
+ }, o = async (t) => (await b(e, h, s(c("extensionId", i), c("key", t))))[0];
279
+ return {
280
+ extensionId: i,
281
+ readContent: (e, t) => (a("content:read"), r.readContent(e, t)),
282
+ listContent: (e) => (a("content:read"), r.listContent(e)),
283
+ countContent: (e) => (a("content:read"), r.countContent(e)),
284
+ readRevision: (e) => (a("content:read"), r.readRevision(e)),
285
+ writeContent: (e, t, n) => (a("content:write"), r.writeContent(e, t, n)),
286
+ fetch: (e, n) => {
287
+ let o = URL.canParse(e) ? new URL(e) : null;
288
+ if (o === null || o.protocol !== "https:" || o.port !== "") throw new t({
289
+ extensionId: i,
290
+ capability: `egress:${e}`
291
+ });
292
+ return a(`egress:${o.hostname}`), r.fetch(o.href, n);
293
+ },
294
+ secret: (e) => (a(`secret:${e}`), r.secret(e)),
295
+ settings: async () => await M(e, i) ?? {},
296
+ data: {
297
+ get: async (e) => (await o(e))?.value,
298
+ set: async (n, r) => {
299
+ if (n === j) throw new t({
300
+ extensionId: i,
301
+ capability: "settings:write"
302
+ });
303
+ let a = await o(n);
304
+ a === void 0 ? await e.insert(h, {
305
+ extensionId: i,
306
+ key: n,
307
+ value: r
308
+ }) : await e.update(h, String(a.id), { value: r });
309
+ }
310
+ }
311
+ };
312
+ }, R = (...t) => e(() => F(...t)), z = (...t) => e(() => D(...t)), B = (...t) => e(() => I(...t)), V = (...t) => e(() => M(...t)), H = (...t) => e(() => N(...t)), U = (...t) => e(() => T(...t)), W = (...t) => e(() => w(...t)), G = (...t) => e(() => C(...t)), K = (...t) => e(() => A(...t)), q = (...t) => e(() => k(...t)), J = (...t) => e(() => O(...t)), Y = (...t) => e(() => P(...t)), X = (...t) => e(() => E(...t));
313
+ //#endregion
314
+ export { m as CMS_EXTENSIONS_TABLE, h as CMS_EXTENSION_DATA_TABLE, g as CMS_EXTENSION_SECRETS_TABLE, F as bindExtensionSecret, R as bindExtensionSecretEffect, v as cmsExtensionDataTable, y as cmsExtensionSecretsTable, _ as cmsExtensionsTable, D as consentToUpgrade, z as consentToUpgradeEffect, L as extensionSandbox, I as extensionSecret, B as extensionSecretEffect, M as extensionSettings, V as extensionSettingsEffect, T as installExtension, U as installExtensionEffect, w as installedExtension, W as installedExtensionEffect, C as installedExtensions, G as installedExtensionsEffect, A as regrantExtension, K as regrantExtensionEffect, k as revokeExtension, q as revokeExtensionEffect, O as rollbackExtension, J as rollbackExtensionEffect, N as setExtensionSettings, H as setExtensionSettingsEffect, P as uninstallExtension, Y as uninstallExtensionEffect, E as upgradeExtension, X as upgradeExtensionEffect };
@@ -0,0 +1,199 @@
1
+ //#region src/fieldSchema.ts
2
+ var e = (t) => ({
3
+ ...t,
4
+ pipe(...n) {
5
+ let r = t;
6
+ for (let e of n) r = e(r);
7
+ return e(r);
8
+ },
9
+ optional() {
10
+ return e({
11
+ ...t,
12
+ isOptional: !0
13
+ });
14
+ },
15
+ requiredToPublish() {
16
+ return e({
17
+ ...t,
18
+ isOptional: !0,
19
+ publishRequired: !0
20
+ });
21
+ }
22
+ }), t = (e) => (t) => ({
23
+ ...t,
24
+ maxLength: e,
25
+ editorHint: t.kind === "string" && e > 120 ? "textarea" : t.editorHint
26
+ }), n = (e) => (t) => ({
27
+ ...t,
28
+ pattern: e.source
29
+ }), r = () => (e) => ({
30
+ ...e,
31
+ unique: !0
32
+ }), i = (t, n) => e({
33
+ kind: t,
34
+ editorHint: n,
35
+ isOptional: !1
36
+ }), a = {
37
+ String: i("string", "text"),
38
+ Number: i("number", "number"),
39
+ Fraction: e({
40
+ kind: "number",
41
+ editorHint: "number",
42
+ isOptional: !1,
43
+ fraction: !0
44
+ }),
45
+ Boolean: i("boolean", "boolean"),
46
+ Date: i("date", "date"),
47
+ DateTime: i("datetime", "datetime"),
48
+ maxLength: t,
49
+ pattern: n,
50
+ unique: r,
51
+ Literal: (...t) => e({
52
+ kind: "literal",
53
+ editorHint: "select",
54
+ isOptional: !1,
55
+ literals: t
56
+ }),
57
+ Token: (t, n) => {
58
+ let r = t[n];
59
+ if (r === void 0 || Object.keys(r).length === 0) throw Error(`Schema.Token: the design tokens declare no group '${n}'.`);
60
+ return e({
61
+ kind: "literal",
62
+ editorHint: "select",
63
+ isOptional: !1,
64
+ token: n,
65
+ literals: Object.keys(r),
66
+ literalLabels: Object.fromEntries(Object.entries(r).map(([e, t]) => [e, `${e} — ${t}`]))
67
+ });
68
+ },
69
+ Action: (t) => {
70
+ let n = Object.keys(t);
71
+ if (n.length === 0) throw Error("Schema.Action: name at least one action.");
72
+ return e({
73
+ kind: "literal",
74
+ editorHint: "select",
75
+ isOptional: !1,
76
+ action: !0,
77
+ literals: n,
78
+ literalLabels: { ...t }
79
+ });
80
+ },
81
+ RichText: (t = {}) => e({
82
+ kind: "richText",
83
+ editorHint: "richText",
84
+ isOptional: !1,
85
+ richText: t
86
+ }),
87
+ Media: () => e({
88
+ kind: "media",
89
+ editorHint: "media",
90
+ isOptional: !1
91
+ }),
92
+ Reference: (t) => e({
93
+ kind: "reference",
94
+ editorHint: "reference",
95
+ isOptional: !1,
96
+ referenceType: t
97
+ }),
98
+ Array: (t) => e({
99
+ kind: "array",
100
+ editorHint: "array",
101
+ isOptional: !1,
102
+ element: t
103
+ }),
104
+ Struct: (t) => e({
105
+ kind: "struct",
106
+ editorHint: "struct",
107
+ isOptional: !1,
108
+ struct: t
109
+ }),
110
+ Components: (t) => {
111
+ let n = t.map((e) => e.id), r = n.find((e, t) => n.indexOf(e) !== t);
112
+ if (r !== void 0) throw Error(`Schema.Components: component '${r}' is listed twice.`);
113
+ return e({
114
+ kind: "components",
115
+ editorHint: "components",
116
+ isOptional: !1,
117
+ components: t
118
+ });
119
+ }
120
+ }, o = (e) => Object.keys(e).sort().map((t) => {
121
+ let n = e[t], r = n.struct ? `{${o(n.struct)}}` : n.element ? `[${o({ _: n.element })}]` : "";
122
+ return `${t}:${n.kind}${n.isOptional ? "?" : ""}${n.literals ? `(${n.literals.join("|")})` : ""}${n.referenceType ? `->${n.referenceType}` : ""}${r}`;
123
+ }).join(","), s = (e) => {
124
+ let t = 2166136261;
125
+ for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
126
+ return (t >>> 0).toString(16).padStart(8, "0");
127
+ }, c = (e) => s(`${e.id}|${o(e.props)}`), l = (e) => {
128
+ for (let [t, n] of Object.entries(e)) for (let e of [t, ...Object.keys(n)]) if (!/^[a-z][a-zA-Z0-9]*$/.test(e)) throw Error(`defineDesignTokens: '${e}' must be camelCase letters and digits.`);
129
+ return e;
130
+ }, u = (e) => {
131
+ if (!/^[a-z][a-zA-Z0-9]*$/.test(e.name)) throw Error(`defineRichTextProfile('${e.name}'): the name must be camelCase letters and digits.`);
132
+ if (!Number.isInteger(e.version) || e.version < 1) throw Error(`defineRichTextProfile('${e.name}'): the version is a whole number from 1.`);
133
+ let t = e.styles === void 0 ? void 0 : e.styles.tokens[e.styles.group];
134
+ if (e.styles !== void 0 && (t === void 0 || Object.keys(t).length === 0)) throw Error(`defineRichTextProfile('${e.name}'): the design tokens declare no group '${e.styles.group}'.`);
135
+ let n = e.components ?? [], r = n.map((e) => e.id);
136
+ if (new Set(r).size !== r.length) throw Error(`defineRichTextProfile('${e.name}'): a component is listed twice.`);
137
+ let i = [...e.blocks ?? [
138
+ "paragraph",
139
+ "heading",
140
+ "list",
141
+ "table",
142
+ "image",
143
+ "file"
144
+ ], ...n.length > 0 ? ["component"] : []];
145
+ return {
146
+ name: e.name,
147
+ version: e.version,
148
+ id: `${e.name}@${e.version}`,
149
+ blocks: i,
150
+ headings: e.headings ?? [2, 3],
151
+ marks: e.marks ?? [
152
+ "bold",
153
+ "italic",
154
+ "underline"
155
+ ],
156
+ ...e.styles !== void 0 && t !== void 0 ? { styles: {
157
+ group: e.styles.group,
158
+ tokens: t
159
+ } } : {},
160
+ components: n,
161
+ ...e.contactPoints === void 0 ? {} : { contactPoints: e.contactPoints },
162
+ contactLiterals: e.contactLiterals === !0
163
+ };
164
+ }, d = (e) => {
165
+ if (!/^[a-z][a-zA-Z0-9]*$/.test(e.id)) throw Error(`defineComponent('${e.id}'): the id must be camelCase letters and digits.`);
166
+ let t = e.props;
167
+ return {
168
+ id: e.id,
169
+ displayName: e.displayName,
170
+ props: t,
171
+ fingerprint: s(`${e.id}|${o(t)}`),
172
+ ...e.consent === void 0 ? {} : { consent: e.consent },
173
+ ...e.description !== void 0 && e.description.trim() !== "" ? { description: e.description.trim() } : {},
174
+ ...e.jobs !== void 0 && e.jobs.length > 0 ? { jobs: [...new Set(e.jobs.map((e) => e.trim()).filter((e) => e !== ""))] } : {},
175
+ ...e.variants === void 0 ? {} : { variants: e.variants },
176
+ ...e.fixtures === void 0 ? {} : { fixtures: e.fixtures },
177
+ ...e.migrations === void 0 ? {} : { migrations: e.migrations }
178
+ };
179
+ }, f = (e, t) => (n) => ({
180
+ ...n,
181
+ derived: {
182
+ source: e,
183
+ transform: t
184
+ }
185
+ }), p = {
186
+ ä: "ae",
187
+ ö: "oe",
188
+ ü: "ue",
189
+ ß: "ss",
190
+ æ: "ae",
191
+ œ: "oe",
192
+ ø: "o",
193
+ å: "a",
194
+ ł: "l",
195
+ đ: "d",
196
+ þ: "th"
197
+ }, m = (e) => String(e).normalize("NFC").toLowerCase().trim().replace(/[äöüßæœøåłđþ]/g, (e) => p[e] ?? e).normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
198
+ //#endregion
199
+ export { a as Schema, c as componentFingerprint, d as defineComponent, l as defineDesignTokens, u as defineRichTextProfile, f as derivedFrom, s as fnv1a, t as maxLength, n as pattern, m as slugify, r as unique };
@@ -0,0 +1,74 @@
1
+ //#region src/formStrings.ts
2
+ var e = {
3
+ blockNames: {
4
+ paragraph: "Paragraph",
5
+ heading: "Heading",
6
+ list: "List",
7
+ table: "Table",
8
+ image: "Image",
9
+ file: "Download",
10
+ component: "Component"
11
+ },
12
+ moveUp: "Move up",
13
+ moveDown: "Move down",
14
+ remove: "Remove",
15
+ moveUpLabel: (e) => `Move ${e} up`,
16
+ moveDownLabel: (e) => `Move ${e} down`,
17
+ removeLabel: (e) => `Remove ${e}`,
18
+ add: "Add",
19
+ addBlock: "Add block",
20
+ addComponent: "Add component",
21
+ findComponent: "Find a component by what it is for",
22
+ noComponentFound: "No component matches.",
23
+ otherComponents: "Other",
24
+ unknownComponent: (e) => `Unknown component '${e}'.`,
25
+ level: "Level",
26
+ numbered: "Numbered",
27
+ numberedAt: (e) => `Numbered at level ${e}`,
28
+ headerRow: "First row is the header",
29
+ image: "Image",
30
+ file: "File",
31
+ fileLabel: "Link text",
32
+ caption: "Caption",
33
+ text: "Text",
34
+ listItems: "Items, one per line (two spaces in front nest an item)",
35
+ tableRows: "Rows, one per line, cells split by |",
36
+ linkTo: "Link to",
37
+ linkText: "Link text",
38
+ insertLink: "Insert link",
39
+ item: (e, t) => `${e} ${t}`,
40
+ addItem: "Add entry",
41
+ bold: "Bold",
42
+ italic: "Italic",
43
+ underline: "Underline",
44
+ style: "Style",
45
+ noStyle: "No style",
46
+ component: "Component",
47
+ contactKind: "Contact",
48
+ contactPoint: "Contact point",
49
+ contactEmail: "E-mail address",
50
+ contactPhone: "Phone number",
51
+ contactValue: "Address or number",
52
+ contactText: "Contact text",
53
+ insertContact: "Insert contact",
54
+ suggestedChanges: "Suggested changes — accept or reject them to edit this block again.",
55
+ changeBy: (e, t, n) => [
56
+ `${e}:`,
57
+ t === "" ? "" : `adds “${t}”`,
58
+ n === "" ? "" : `removes “${n}”`,
59
+ t === "" && n === "" ? "changes the block" : ""
60
+ ].filter((e) => e !== "").join(" "),
61
+ accept: "Accept",
62
+ reject: "Reject",
63
+ acceptLabel: (e) => `Accept the change by ${e}`,
64
+ rejectLabel: (e) => `Reject the change by ${e}`
65
+ }, t = (t) => t === void 0 ? e : {
66
+ ...e,
67
+ ...t,
68
+ blockNames: {
69
+ ...e.blockNames,
70
+ ...t.blockNames
71
+ }
72
+ };
73
+ //#endregion
74
+ export { e as CONTENT_FORM_STRINGS, t as contentFormStrings };
@@ -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 };