@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.
- package/CHANGELOG.md +5484 -0
- package/README.md +138 -0
- package/THIRD-PARTY-NOTICES.md +1511 -276
- package/dist/ContentForm.js +1 -2
- package/dist/RichDocumentEditor.js +1 -2
- package/dist/RichDocumentView.js +82 -38
- package/dist/RichTextSurface.js +1 -2
- package/dist/aiCandidates.js +4 -5
- package/dist/aiOperations.js +1 -2
- package/dist/applicationBuildSnapshotService.js +100 -0
- package/dist/assetRenditions.js +101 -0
- package/dist/assetRevision.js +45 -0
- package/dist/assetUseRights.js +71 -0
- package/dist/audiences.js +1 -2
- package/dist/availability.js +20 -18
- package/dist/blueprint.js +76 -77
- package/dist/build.d.ts +3063 -0
- package/dist/build.js +37 -0
- package/dist/buildApplicationAdmission.js +15 -0
- package/dist/buildApplicationCatalog.js +135 -0
- package/dist/buildApplicationCatalogTable.js +23 -0
- package/dist/buildApplicationRest.js +98 -0
- package/dist/buildApplicationUpload.js +110 -0
- package/dist/buildSnapshot.js +400 -0
- package/dist/buildSnapshotApplicationPin.js +31 -0
- package/dist/buildSnapshotRest.js +209 -0
- package/dist/buildSnapshotService.js +264 -0
- package/dist/buildSnapshotTables.js +24 -0
- package/dist/bulk.js +72 -72
- package/dist/cacheIdentity.js +1 -2
- package/dist/changes.js +280 -64
- package/dist/cmsContext.js +1 -2
- package/dist/collections.js +1 -2
- package/dist/consent.js +6 -7
- package/dist/contentLocations.js +52 -0
- package/dist/contentProjection.js +82 -0
- package/dist/contentRouteIdentity.js +12 -0
- package/dist/contentRouteMaterializer.js +96 -0
- package/dist/contentRouteTypes.js +38 -0
- package/dist/contentSeo.js +188 -0
- package/dist/contentTreePath.js +59 -0
- package/dist/contentType.js +121 -105
- package/dist/contentValues.js +17 -0
- package/dist/contentfulImport.js +1 -2
- package/dist/copies.js +4 -5
- package/dist/cutover.js +1 -2
- package/dist/deliveryChecks.js +1 -2
- package/dist/domainHost.js +6 -0
- package/dist/domains.js +82 -89
- package/dist/draftTexts.js +38 -39
- package/dist/duplicates.js +24 -25
- package/dist/edgePurge.js +1 -2
- package/dist/editHistory.js +1 -2
- package/dist/effectForm.js +1 -2
- package/dist/environmentAliases.js +137 -0
- package/dist/environments.js +108 -71
- package/dist/errors.js +55 -16
- package/dist/experiments.js +8 -9
- package/dist/exposure.js +1 -2
- package/dist/extensionManifest.js +2 -3
- package/dist/extensions.js +1 -2
- package/dist/fieldSchema.js +1 -2
- package/dist/formStrings.js +1 -2
- package/dist/frontendBindings.js +98 -0
- package/dist/frontendMedia.js +17 -0
- package/dist/glossary.js +1 -2
- package/dist/history.js +1 -2
- package/dist/htmlImport.js +1 -2
- package/dist/index.d.ts +760 -47
- package/dist/index.js +89 -73
- package/dist/initializePublicRoutes.js +27 -0
- package/dist/liveContentRouteView.js +75 -0
- package/dist/media.js +1 -2
- package/dist/metrics.js +1 -2
- package/dist/migration.js +1 -2
- package/dist/migrationStages.js +1 -2
- package/dist/nativeOutputDeploymentService.js +204 -0
- package/dist/outputActivation.js +233 -0
- package/dist/outputActivationOrigin.js +50 -0
- package/dist/outputActivationStore.js +410 -0
- package/dist/outputActivationTables.js +10 -0
- package/dist/outputActivationTarget.js +80 -0
- package/dist/outputActivationTargetTable.js +24 -0
- package/dist/outputDeployment.js +173 -0
- package/dist/outputDeploymentRest.js +167 -0
- package/dist/outputDeploymentService.js +240 -0
- package/dist/outputRouteGraph.js +176 -0
- package/dist/outputSafetyArtifact.js +146 -0
- package/dist/outputTargetRest.js +61 -0
- package/dist/pathSegmentEncoding.js +3 -0
- package/dist/presenceAnchors.js +1 -2
- package/dist/preview.js +1 -2
- package/dist/privateCmsTransport.js +75 -0
- package/dist/privateNativeRouteReservation.js +9 -0
- package/dist/promotion.js +69 -61
- package/dist/publicBuild.js +89 -0
- package/dist/publicBuildRest.js +97 -0
- package/dist/publicBuildService.js +62 -0
- package/dist/publicOutputHttp.js +128 -0
- package/dist/publicOutputService.js +286 -0
- package/dist/publicPresentation.js +16 -0
- package/dist/publicRouteDispositionAdmission.js +37 -0
- package/dist/publicRouteHistoryStore.js +11 -0
- package/dist/publicRouteHistoryView.js +33 -0
- package/dist/publicRouteIntegrity.js +4 -0
- package/dist/publicRouteMutation.js +5 -0
- package/dist/publicRouteNamespace.js +133 -0
- package/dist/publicRoutePublication.js +35 -0
- package/dist/publicRouteRegistry.js +16 -0
- package/dist/publicRouteRegistryBinding.js +193 -0
- package/dist/publicRouteRegistryDefinition.js +75 -0
- package/dist/publicRouteSitePublication.js +39 -0
- package/dist/publicRouteTables.js +12 -0
- package/dist/publicRouteUrl.js +17 -0
- package/dist/publicationSeo.js +51 -0
- package/dist/publicationState.js +295 -0
- package/dist/quality.js +9 -10
- package/dist/reconfigurePublicRoutes.js +40 -0
- package/dist/recurrence.js +1 -2
- package/dist/redirects.js +105 -75
- package/dist/referenceGraph.js +16 -16
- package/dist/references.js +3 -4
- package/dist/release.js +178 -143
- package/dist/renderReadAuthority.js +42 -0
- package/dist/renderReadGrant.js +136 -0
- package/dist/rest.js +1 -2
- package/dist/review.js +29 -30
- package/dist/richDocument.js +56 -27
- package/dist/richInline.js +1 -2
- package/dist/routeDispositionGraph.js +43 -0
- package/dist/routeDispositionRest.js +50 -0
- package/dist/routeDispositionService.js +72 -0
- package/dist/routeDispositionStore.js +288 -0
- package/dist/routeDispositionTables.js +4 -0
- package/dist/routeDispositions.js +90 -0
- package/dist/routeHistoryStorage.js +319 -0
- package/dist/routeHistoryStore.js +11 -0
- package/dist/schedule.js +37 -38
- package/dist/search.js +1 -2
- package/dist/selectionIntent.js +1 -2
- package/dist/seo.js +2 -3
- package/dist/series.js +12 -13
- package/dist/share.js +14 -15
- package/dist/siteBindings.js +158 -0
- package/dist/siteBuildCandidate.js +103 -0
- package/dist/siteDelivery.js +114 -0
- package/dist/siteState.js +46 -0
- package/dist/snapshotAddressGraph.js +54 -0
- package/dist/snapshotAddressRead.js +72 -0
- package/dist/snapshotAppConsumer.js +70 -0
- package/dist/snapshotAppExecution.js +101 -0
- package/dist/snapshotApplication.js +74 -0
- package/dist/snapshotApprovedRouteDispositions.js +43 -0
- package/dist/snapshotAssetAssembly.js +69 -0
- package/dist/snapshotAssetAssemblyRest.js +49 -0
- package/dist/snapshotBindingRead.js +60 -0
- package/dist/snapshotCodeSeo.js +28 -0
- package/dist/snapshotComponent.js +33 -0
- package/dist/snapshotComponentSource.js +23 -0
- package/dist/snapshotConsumer.js +86 -0
- package/dist/snapshotContentIdentity.js +9 -0
- package/dist/snapshotDefinitions.js +263 -0
- package/dist/snapshotDocumentAssembly.js +192 -0
- package/dist/snapshotDocumentAssemblyRest.js +83 -0
- package/dist/snapshotDocumentProjection.js +201 -0
- package/dist/snapshotDocumentTransfer.js +34 -0
- package/dist/snapshotDocumentTransferRest.js +79 -0
- package/dist/snapshotDomains.js +55 -0
- package/dist/snapshotEnvironment.js +30 -0
- package/dist/snapshotFieldPlan.js +84 -0
- package/dist/snapshotFrontend.js +102 -0
- package/dist/snapshotLink.js +7 -0
- package/dist/snapshotMedia.js +110 -0
- package/dist/snapshotMediaCapture.js +245 -0
- package/dist/snapshotMediaFields.js +224 -0
- package/dist/snapshotMediaRead.js +184 -0
- package/dist/snapshotMediaReader.js +12 -0
- package/dist/snapshotObservation.js +15 -0
- package/dist/snapshotObservedRouteHistory.js +33 -0
- package/dist/snapshotOutputTransfer.js +77 -0
- package/dist/snapshotPageLoader.js +6 -0
- package/dist/snapshotPageSeo.js +58 -0
- package/dist/snapshotPathLocale.js +14 -0
- package/dist/snapshotPresentation.js +85 -0
- package/dist/snapshotPresentationPolicy.js +11 -0
- package/dist/snapshotProjection.js +118 -0
- package/dist/snapshotPublicAccess.js +160 -0
- package/dist/snapshotPublicRouteHistory.js +39 -0
- package/dist/snapshotReadAdmission.js +37 -0
- package/dist/snapshotRedirectOutput.js +150 -0
- package/dist/snapshotRedirectTargets.js +23 -0
- package/dist/snapshotRedirects.js +131 -0
- package/dist/snapshotReference.js +7 -0
- package/dist/snapshotReferenceAddress.js +9 -0
- package/dist/snapshotReferenceGraph.js +78 -0
- package/dist/snapshotReferenceRead.js +64 -0
- package/dist/snapshotRelease.js +98 -0
- package/dist/snapshotRender.js +360 -0
- package/dist/snapshotRenderDependencies.js +177 -0
- package/dist/snapshotRenditions.js +87 -0
- package/dist/snapshotRichDocument.js +61 -0
- package/dist/snapshotRoleTransfer.js +105 -0
- package/dist/snapshotRoleTransferRest.js +98 -0
- package/dist/snapshotRouteAdmission.js +70 -0
- package/dist/snapshotRouteDispatch.js +110 -0
- package/dist/snapshotRouteDispositionPlan.js +72 -0
- package/dist/snapshotRouteRead.js +42 -0
- package/dist/snapshotRoutes.js +78 -0
- package/dist/snapshotRouting.js +112 -0
- package/dist/snapshotSeo.js +178 -0
- package/dist/snapshotSeoControls.js +100 -0
- package/dist/snapshotSeoDocumentInventory.js +114 -0
- package/dist/snapshotSeoDocuments.js +128 -0
- package/dist/snapshotSeoMerge.js +84 -0
- package/dist/snapshotSeoMetadata.js +136 -0
- package/dist/snapshotSeoOutput.js +172 -0
- package/dist/snapshotSeoPathSets.js +104 -0
- package/dist/snapshotSeoRead.js +87 -0
- package/dist/snapshotSite.js +127 -0
- package/dist/snapshotSitemapFiles.js +35 -0
- package/dist/snapshotTreeDependencies.js +57 -0
- package/dist/snapshotTreeLoader.js +9 -0
- package/dist/snapshotTreeRead.js +157 -0
- package/dist/staticPathSet.js +176 -0
- package/dist/staticPathSetRest.js +128 -0
- package/dist/staticPathSetService.js +248 -0
- package/dist/staticPathSetStore.js +337 -0
- package/dist/stewardship.js +2 -3
- package/dist/taxonomy.js +1 -2
- package/dist/team.js +1 -2
- package/dist/templates.js +2 -3
- package/dist/trackChanges.js +1 -2
- package/dist/translation.js +1 -2
- package/dist/tree.js +10 -11
- package/dist/usage.js +1 -2
- package/dist/validation.js +54 -55
- package/dist/visualEditing.js +1 -2
- package/dist/web.d.ts +709 -7
- package/dist/web.js +50 -33
- package/dist/workflow.js +9 -10
- package/dist/write.js +251 -227
- package/dist/xliff.js +1 -2
- package/package.json +21 -7
package/dist/review.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ContentNotFound as e, ReviewRequired as t, ReviewStepRefused as n, RevisionMismatch as r } from "./errors.js";
|
|
2
|
+
import { asTyped as i } from "./effectForm.js";
|
|
3
3
|
import { approvedByWorkflow as a } from "./workflow.js";
|
|
4
4
|
import { workspaceReviewTypes as o } from "./team.js";
|
|
5
5
|
import { and as s, eq as c, id as l, integer as u, table as d, text as f } from "@voltro/database";
|
|
6
6
|
import { tenant as p } from "@voltro/plugin-multitenancy/mixin";
|
|
7
|
-
|
|
7
|
+
// src/review.ts
|
|
8
8
|
var m = "cms_reviews", h = [
|
|
9
9
|
"requested",
|
|
10
10
|
"approved",
|
|
@@ -26,8 +26,8 @@ var m = "cms_reviews", h = [
|
|
|
26
26
|
c("site", e.site),
|
|
27
27
|
c("environment", e.environment),
|
|
28
28
|
c("locale", e.locale)
|
|
29
|
-
], v = async (
|
|
30
|
-
let [o] = await
|
|
29
|
+
], v = async (t, n, r, i, a = !1) => {
|
|
30
|
+
let [o] = await t.query({
|
|
31
31
|
table: `${n.name}_drafts`,
|
|
32
32
|
predicate: s(c("id", r), ..._(i)),
|
|
33
33
|
order: [],
|
|
@@ -36,7 +36,7 @@ var m = "cms_reviews", h = [
|
|
|
36
36
|
projection: void 0,
|
|
37
37
|
...a ? { lock: "update" } : {}
|
|
38
38
|
});
|
|
39
|
-
if (o === void 0) throw new
|
|
39
|
+
if (o === void 0) throw new e({
|
|
40
40
|
contentType: n.name,
|
|
41
41
|
id: r,
|
|
42
42
|
stage: "draft"
|
|
@@ -70,37 +70,37 @@ var m = "cms_reviews", h = [
|
|
|
70
70
|
actorId: a,
|
|
71
71
|
note: o ?? null
|
|
72
72
|
});
|
|
73
|
-
}, x = (e, t,
|
|
73
|
+
}, x = (e, t, r) => {
|
|
74
74
|
let [i, a] = e;
|
|
75
|
-
if (i !== void 0 && a !== void 0 && Number(i.sequence ?? 0) === 0 && new Date(i.createdAt).getTime() === new Date(a.createdAt).getTime()) throw new
|
|
75
|
+
if (i !== void 0 && a !== void 0 && Number(i.sequence ?? 0) === 0 && new Date(i.createdAt).getTime() === new Date(a.createdAt).getTime()) throw new n({
|
|
76
76
|
contentType: t.name,
|
|
77
|
-
id:
|
|
77
|
+
id: r,
|
|
78
78
|
reason: "ambiguousOrder"
|
|
79
79
|
});
|
|
80
80
|
return i;
|
|
81
|
-
}, S = async (e, t, n, r, i) => b(e, t, await v(e, t, n, r, !0), r, "requested", i.actorId, i.note), C = async (e, t,
|
|
82
|
-
let s = await v(e, t,
|
|
83
|
-
if (s.revisionId !== o) throw new
|
|
81
|
+
}, S = async (e, t, n, r, i) => b(e, t, await v(e, t, n, r, !0), r, "requested", i.actorId, i.note), C = async (e, t, i, a, o) => {
|
|
82
|
+
let s = await v(e, t, i, a, !0);
|
|
83
|
+
if (s.revisionId !== o) throw new r({
|
|
84
84
|
contentType: t.name,
|
|
85
|
-
id:
|
|
85
|
+
id: i,
|
|
86
86
|
expected: o,
|
|
87
87
|
actual: String(s.revisionId)
|
|
88
88
|
});
|
|
89
|
-
let c = x(await y(e, t,
|
|
90
|
-
if (c === void 0 || c.action !== "requested" || c.revisionId !== o) throw new
|
|
89
|
+
let c = x(await y(e, t, i, a), t, i);
|
|
90
|
+
if (c === void 0 || c.action !== "requested" || c.revisionId !== o) throw new n({
|
|
91
91
|
contentType: t.name,
|
|
92
|
-
id:
|
|
92
|
+
id: i,
|
|
93
93
|
reason: "notInReview"
|
|
94
94
|
});
|
|
95
95
|
return {
|
|
96
96
|
draft: s,
|
|
97
97
|
request: c
|
|
98
98
|
};
|
|
99
|
-
}, w = async (e, t,
|
|
100
|
-
let { draft: o, request: s } = await C(e, t,
|
|
101
|
-
if (a.allowSelfApproval !== !0 && s.actorId === a.actorId) throw new
|
|
99
|
+
}, w = async (e, t, r, i, a) => {
|
|
100
|
+
let { draft: o, request: s } = await C(e, t, r, i, a.revisionId);
|
|
101
|
+
if (a.allowSelfApproval !== !0 && s.actorId === a.actorId) throw new n({
|
|
102
102
|
contentType: t.name,
|
|
103
|
-
id:
|
|
103
|
+
id: r,
|
|
104
104
|
reason: "selfApproval"
|
|
105
105
|
});
|
|
106
106
|
return b(e, t, o, i, "approved", a.actorId, a.note);
|
|
@@ -134,27 +134,26 @@ var m = "cms_reviews", h = [
|
|
|
134
134
|
projection: void 0
|
|
135
135
|
}), a = i?.tenantId;
|
|
136
136
|
return typeof a == "string" && (await o(e, a)).includes(t.name);
|
|
137
|
-
}, O = async (e,
|
|
138
|
-
if (await D(e,
|
|
139
|
-
if (
|
|
140
|
-
if (!await a(e,
|
|
141
|
-
contentType:
|
|
137
|
+
}, O = async (e, n, r, i, o) => {
|
|
138
|
+
if (await D(e, n, r)) {
|
|
139
|
+
if (n.review?.workflow !== void 0) {
|
|
140
|
+
if (!await a(e, n, r, o)) throw new t({
|
|
141
|
+
contentType: n.name,
|
|
142
142
|
id: r,
|
|
143
143
|
revisionId: o
|
|
144
144
|
});
|
|
145
145
|
} else if ((await e.query({
|
|
146
146
|
table: "cms_reviews",
|
|
147
|
-
predicate: s(c("contentType",
|
|
147
|
+
predicate: s(c("contentType", n.name), c("variantId", r), c("revisionId", o), c("action", "approved"), ..._(i)),
|
|
148
148
|
order: [],
|
|
149
149
|
take: 1,
|
|
150
150
|
skip: void 0,
|
|
151
151
|
projection: void 0
|
|
152
|
-
})).length === 0) throw new
|
|
153
|
-
contentType:
|
|
152
|
+
})).length === 0) throw new t({
|
|
153
|
+
contentType: n.name,
|
|
154
154
|
id: r,
|
|
155
155
|
revisionId: o
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
}, k = (...
|
|
159
|
-
//#endregion
|
|
158
|
+
}, k = (...e) => i(() => y(...e)), A = (...t) => i(() => S(...t), e), j = (...t) => i(() => w(...t), e, r, n), M = (...t) => i(() => T(...t), e, r, n), N = (...t) => i(() => E(...t), e, n), P = (...e) => i(() => D(...e)), F = (...e) => i(() => O(...e), t);
|
|
160
159
|
export { m as CMS_REVIEWS_TABLE, h as REVIEW_ACTIONS, w as approveReview, j as approveReviewEffect, O as assertApproved, F as assertApprovedEffect, g as cmsReviewsTable, T as requestChanges, M as requestChangesEffect, S as requestReview, A as requestReviewEffect, y as reviewLog, k as reviewLogEffect, D as reviewRequiredFor, P as reviewRequiredForEffect, E as reviewStatus, N as reviewStatusEffect };
|
package/dist/richDocument.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/richDocument.ts
|
|
2
2
|
var e = 3, t = (e, t) => t === 0 ? e.ordered : (e.sublists?.[t - 1] ?? (e.ordered ? "ordered" : "unordered")) === "ordered", n = /* @__PURE__ */ new Set([
|
|
3
3
|
"bold",
|
|
4
4
|
"italic",
|
|
@@ -53,7 +53,7 @@ var e = 3, t = (e, t) => t === 0 ? e.ordered : (e.sublists?.[t - 1] ?? (e.ordere
|
|
|
53
53
|
rule: "profile",
|
|
54
54
|
message: "this field has no styles"
|
|
55
55
|
});
|
|
56
|
-
|
|
56
|
+
typeof t == "string" && t in i.tokens || r.push({
|
|
57
57
|
path: `${e}.style`,
|
|
58
58
|
rule: "profile",
|
|
59
59
|
message: `a style is one of: ${Object.keys(i.tokens).join(", ")}`
|
|
@@ -310,23 +310,36 @@ var e = 3, t = (e, t) => t === 0 ? e.ordered : (e.sublists?.[t - 1] ?? (e.ordere
|
|
|
310
310
|
let r = [], i = n.profile?.contactPoints, a = (e, t) => {
|
|
311
311
|
t.forEach((t, a) => {
|
|
312
312
|
t.type === "link" && n.links !== void 0 && t.target !== "" && r.push({
|
|
313
|
-
path:
|
|
313
|
+
path: [...e, a],
|
|
314
314
|
targetType: n.links,
|
|
315
315
|
targetDocumentId: t.target
|
|
316
316
|
}), t.type === "contact" && i !== void 0 && "target" in t.contact && t.contact.target !== "" && r.push({
|
|
317
|
-
path:
|
|
317
|
+
path: [...e, a],
|
|
318
318
|
targetType: i,
|
|
319
319
|
targetDocumentId: t.contact.target
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
};
|
|
323
323
|
return t.blocks.forEach((t, i) => {
|
|
324
|
-
let o =
|
|
324
|
+
let o = [
|
|
325
|
+
...e,
|
|
326
|
+
"blocks",
|
|
327
|
+
i
|
|
328
|
+
];
|
|
325
329
|
switch (t.type) {
|
|
326
330
|
case "paragraph":
|
|
327
|
-
case "heading": return a(
|
|
328
|
-
case "list": return t.items.forEach((e, t) => a(
|
|
329
|
-
|
|
331
|
+
case "heading": return a([...o, "content"], t.content);
|
|
332
|
+
case "list": return t.items.forEach((e, t) => a([
|
|
333
|
+
...o,
|
|
334
|
+
"items",
|
|
335
|
+
t
|
|
336
|
+
], e));
|
|
337
|
+
case "table": return t.rows.forEach((e, t) => e.forEach((e, n) => a([
|
|
338
|
+
...o,
|
|
339
|
+
"rows",
|
|
340
|
+
t,
|
|
341
|
+
n
|
|
342
|
+
], e)));
|
|
330
343
|
case "image":
|
|
331
344
|
n.images !== void 0 && t.asset !== "" && r.push({
|
|
332
345
|
path: o,
|
|
@@ -344,7 +357,24 @@ var e = 3, t = (e, t) => t === 0 ? e.ordered : (e.sublists?.[t - 1] ?? (e.ordere
|
|
|
344
357
|
case "component": return;
|
|
345
358
|
}
|
|
346
359
|
}), r;
|
|
347
|
-
}, _ =
|
|
360
|
+
}, _ = (e, t, n) => g(e, t, n).map((n) => {
|
|
361
|
+
let r = t;
|
|
362
|
+
for (let t of n.path.slice(e.length)) {
|
|
363
|
+
if (typeof r != "object" || !r || !Object.hasOwn(r, t)) throw Error("Rich document reference unavailable");
|
|
364
|
+
r = r[t];
|
|
365
|
+
}
|
|
366
|
+
if (typeof r != "object" || !r) throw Error("Rich document reference unavailable");
|
|
367
|
+
let i = r.type, a = i === "contact" ? ["contact", "target"] : i === "link" ? ["target"] : i === "image" || i === "file" ? ["asset"] : null;
|
|
368
|
+
if (a === null) throw Error("Rich document reference unavailable");
|
|
369
|
+
return {
|
|
370
|
+
fieldPath: [...n.path, ...a],
|
|
371
|
+
targetType: n.targetType,
|
|
372
|
+
targetDocumentId: n.targetDocumentId
|
|
373
|
+
};
|
|
374
|
+
}), v = (e, t, n) => g([], t, n).map((t) => ({
|
|
375
|
+
...t,
|
|
376
|
+
path: e + t.path.map((e) => typeof e == "number" ? `[${e}]` : `.${e}`).join("")
|
|
377
|
+
})), y = /[*_+[\]()\\{}|]/, b = (e, t = []) => {
|
|
348
378
|
let n = [], r = "", i = [], a, o = () => {
|
|
349
379
|
if (r === "") return;
|
|
350
380
|
let e = n[n.length - 1];
|
|
@@ -362,7 +392,7 @@ var e = 3, t = (e, t) => t === 0 ? e.ordered : (e.sublists?.[t - 1] ?? (e.ordere
|
|
|
362
392
|
}, c = 0;
|
|
363
393
|
for (; c < e.length;) {
|
|
364
394
|
let l = e[c];
|
|
365
|
-
if (l === "\\" && c + 1 < e.length &&
|
|
395
|
+
if (l === "\\" && c + 1 < e.length && y.test(e[c + 1])) r += e[c + 1], c += 2;
|
|
366
396
|
else {
|
|
367
397
|
if (e.startsWith("**", c)) {
|
|
368
398
|
let t = i.includes("bold");
|
|
@@ -420,60 +450,60 @@ var e = 3, t = (e, t) => t === 0 ? e.ordered : (e.sublists?.[t - 1] ?? (e.ordere
|
|
|
420
450
|
}
|
|
421
451
|
}
|
|
422
452
|
return o(), n;
|
|
423
|
-
},
|
|
424
|
-
if (e.type === "link") return `[${
|
|
453
|
+
}, x = (e) => e.replace(/[*_+[\]()\\{}|]/g, (e) => `\\${e}`), S = (e) => e.map((e) => {
|
|
454
|
+
if (e.type === "link") return `[${x(e.text)}](doc:${e.target})`;
|
|
425
455
|
if (e.type === "contact") {
|
|
426
456
|
let t = "target" in e.contact ? `contact:${e.contact.target}` : `${e.contact.channel === "email" ? "mailto" : "tel"}:${e.contact.value}`;
|
|
427
|
-
return `[${
|
|
457
|
+
return `[${x(e.text)}](${t})`;
|
|
428
458
|
}
|
|
429
|
-
let t = e.marks ?? [], n = t.includes("bold") ? "**" : "", r = t.includes("italic") ? "_" : "", i = t.includes("underline") ? "++" : "", a = `${n}${r}${i}${
|
|
459
|
+
let t = e.marks ?? [], n = t.includes("bold") ? "**" : "", r = t.includes("italic") ? "_" : "", i = t.includes("underline") ? "++" : "", a = `${n}${r}${i}${x(e.text)}${i}${r}${n}`;
|
|
430
460
|
return e.style === void 0 ? a : `{${e.style}|${a}}`;
|
|
431
|
-
}).join(""),
|
|
461
|
+
}).join(""), C = (e) => {
|
|
432
462
|
switch (e.type) {
|
|
433
463
|
case "paragraph":
|
|
434
|
-
case "heading": return
|
|
435
|
-
case "list": return e.items.map((t, n) => `${" ".repeat(e.levels?.[n] ?? 0)}${
|
|
436
|
-
case "table": return e.rows.map((e) => e.map(
|
|
464
|
+
case "heading": return S(e.content);
|
|
465
|
+
case "list": return e.items.map((t, n) => `${" ".repeat(e.levels?.[n] ?? 0)}${S(t)}`).join("\n");
|
|
466
|
+
case "table": return e.rows.map((e) => e.map(S).join(" | ")).join("\n");
|
|
437
467
|
case "image":
|
|
438
468
|
case "file":
|
|
439
469
|
case "component": return "";
|
|
440
470
|
}
|
|
441
|
-
},
|
|
471
|
+
}, w = (e, t) => {
|
|
442
472
|
let n = [], r = [];
|
|
443
473
|
for (let i of e.split("\n")) {
|
|
444
474
|
if (i.trim() === "") continue;
|
|
445
475
|
let e = /^[ \t]*/.exec(i)[0].replace(/\t/g, " ").length, a = Math.floor(e / 2), o = Math.min(a, 3, r.length === 0 ? 0 : r[r.length - 1] + 1);
|
|
446
|
-
n.push(
|
|
476
|
+
n.push(b(i.trim(), t)), r.push(o);
|
|
447
477
|
}
|
|
448
478
|
return r.some((e) => e > 0) ? {
|
|
449
479
|
items: n,
|
|
450
480
|
levels: r
|
|
451
481
|
} : { items: n };
|
|
452
|
-
},
|
|
482
|
+
}, T = (e) => e.split("\n").map((e) => e.trim()).filter((e) => e !== ""), E = (e, t, n = []) => {
|
|
453
483
|
switch (e.type) {
|
|
454
484
|
case "paragraph":
|
|
455
485
|
case "heading": return {
|
|
456
486
|
...e,
|
|
457
|
-
content:
|
|
487
|
+
content: b(t, n)
|
|
458
488
|
};
|
|
459
489
|
case "list": return {
|
|
460
490
|
id: e.id,
|
|
461
491
|
type: "list",
|
|
462
492
|
ordered: e.ordered,
|
|
463
|
-
...
|
|
493
|
+
...w(t, n),
|
|
464
494
|
...e.change === void 0 ? {} : { change: e.change },
|
|
465
495
|
...e.sublists === void 0 ? {} : { sublists: e.sublists },
|
|
466
496
|
...e.style === void 0 ? {} : { style: e.style }
|
|
467
497
|
};
|
|
468
498
|
case "table": return {
|
|
469
499
|
...e,
|
|
470
|
-
rows:
|
|
500
|
+
rows: T(t).map((e) => e.split("|").map((e) => b(e.trim())))
|
|
471
501
|
};
|
|
472
502
|
case "image":
|
|
473
503
|
case "file":
|
|
474
504
|
case "component": return e;
|
|
475
505
|
}
|
|
476
|
-
},
|
|
506
|
+
}, D = (e) => {
|
|
477
507
|
let t = (e) => e.map((e) => e.text).join("");
|
|
478
508
|
return e.blocks.map((e) => {
|
|
479
509
|
switch (e.type) {
|
|
@@ -487,5 +517,4 @@ var e = 3, t = (e, t) => t === 0 ? e.ordered : (e.sublists?.[t - 1] ?? (e.ordere
|
|
|
487
517
|
}
|
|
488
518
|
}).filter((e) => e !== "").join("\n");
|
|
489
519
|
};
|
|
490
|
-
|
|
491
|
-
export { e as MAX_LIST_LEVEL, x as blockMarkup, d as contactLiteralHref, u as contactLiteralProblem, o as emptyRichDocument, b as inlineMarkupOf, t as listNumberedAt, a as newBlockId, s as normalizeRichDocument, v as parseInlineMarkup, T as plainTextOf, h as richDocumentProblems, g as richDocumentReferences, w as withBlockMarkup };
|
|
520
|
+
export { e as MAX_LIST_LEVEL, C as blockMarkup, d as contactLiteralHref, u as contactLiteralProblem, o as emptyRichDocument, S as inlineMarkupOf, t as listNumberedAt, a as newBlockId, s as normalizeRichDocument, b as parseInlineMarkup, D as plainTextOf, h as richDocumentProblems, _ as richDocumentReferenceFields, g as richDocumentReferencePaths, v as richDocumentReferences, E as withBlockMarkup };
|
package/dist/richInline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/richInline.ts
|
|
2
2
|
var e = (e) => e.type === "text" ? e.marks ?? [] : [], t = (e) => e.type === "text" ? e.style : void 0, n = (e, t) => e.length === t.length && e.every((e) => t.includes(e)), r = (e, t, n, r) => ({
|
|
3
3
|
type: "text",
|
|
4
4
|
text: e,
|
|
@@ -96,5 +96,4 @@ var e = (e) => e.type === "text" ? e.marks ?? [] : [], t = (e) => e.type === "te
|
|
|
96
96
|
for (let t of Array.from(e.childNodes)) n(t, [], void 0);
|
|
97
97
|
return o(t);
|
|
98
98
|
};
|
|
99
|
-
//#endregion
|
|
100
99
|
export { c as hasMark, h as inlineFromDom, p as inlineHtml, s as inlineText, o as mergeInline, d as replaceText, u as sliceInline, l as toggleMark };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { copyObservedRoutes as e } from "./routeHistoryStorage.js";
|
|
2
|
+
import { copyRouteDispositionDefinition as t, routeDispositionFail as n } from "./routeDispositions.js";
|
|
3
|
+
// src/routeDispositionGraph.ts
|
|
4
|
+
var r = (r) => {
|
|
5
|
+
let i = e(r.observed), a = e(r.current), o = e(r.sourceObserved ?? []), s = e(r.currentOwned ?? []), c = new Set(e(r.reserved ?? []).map((e) => e.url));
|
|
6
|
+
if (!Number.isSafeInteger(r.now) || r.now < 0 || r.now > 864e13) return n("input");
|
|
7
|
+
if (!Array.isArray(r.decisions) || r.decisions.length > 1e5 || Object.getOwnPropertySymbols(r.decisions).length !== 0 || Object.keys(r.decisions).length !== r.decisions.length) return n("bounds");
|
|
8
|
+
let l = /* @__PURE__ */ new Map();
|
|
9
|
+
for (let e = 0; e < r.decisions.length; e++) {
|
|
10
|
+
let i = Object.getOwnPropertyDescriptor(r.decisions, String(e));
|
|
11
|
+
if (i === void 0 || !i.enumerable || !("value" in i)) return n("input");
|
|
12
|
+
let a = t(i.value);
|
|
13
|
+
if (l.has(a.source.url)) return n("graph");
|
|
14
|
+
l.set(a.source.url, a);
|
|
15
|
+
}
|
|
16
|
+
let u = new Map(a.map((e) => [e.url, e.routeId])), d = new Map(s.map((e) => [e.url, e.routeId]));
|
|
17
|
+
for (let e of a) {
|
|
18
|
+
if (c.has(e.url) || d.has(e.url) && d.get(e.url) !== e.routeId) return n("graph");
|
|
19
|
+
d.set(e.url, e.routeId);
|
|
20
|
+
}
|
|
21
|
+
e([...d].map(([e, t]) => ({
|
|
22
|
+
url: e,
|
|
23
|
+
routeId: t
|
|
24
|
+
})));
|
|
25
|
+
let f = new Map(i.map((e) => [e.url, e.routeId])), p = /* @__PURE__ */ new Set();
|
|
26
|
+
for (let e of o) f.has(e.url) && f.get(e.url) !== e.routeId ? p.add(e.url) : f.set(e.url, e.routeId);
|
|
27
|
+
let m = e([...f].map(([e, t]) => ({
|
|
28
|
+
url: e,
|
|
29
|
+
routeId: t
|
|
30
|
+
})));
|
|
31
|
+
for (let e of l.values()) if (!f.has(e.source.url) && !d.has(e.source.url)) return n("graph");
|
|
32
|
+
let h = [];
|
|
33
|
+
for (let e of m) {
|
|
34
|
+
if (d.has(e.url) || c.has(e.url)) continue;
|
|
35
|
+
if (p.has(e.url)) return n("hold");
|
|
36
|
+
let t = l.get(e.url);
|
|
37
|
+
if (t === void 0 || t.source.routeId !== e.routeId || t.action.kind === "hold" || t.activeFrom !== null && r.now < t.activeFrom || t.activeUntil !== null && r.now >= t.activeUntil) return n("hold");
|
|
38
|
+
if (t.action.kind === "redirect" && u.get(t.action.target.url) !== t.action.target.routeId) return n("graph");
|
|
39
|
+
h.push(t);
|
|
40
|
+
}
|
|
41
|
+
return h;
|
|
42
|
+
};
|
|
43
|
+
export { r as planExactRouteDispositions };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { RouteDispositionDefinitionSchema as e, RouteDispositionUnavailable as t } from "./routeDispositions.js";
|
|
2
|
+
import { cmsCredential as n, privateCmsHttpRoutes as r, privateCmsOperation as i } from "./privateCmsTransport.js";
|
|
3
|
+
import { Schema as a } from "effect";
|
|
4
|
+
import { strictInput as o } from "@voltro/protocol";
|
|
5
|
+
// src/routeDispositionRest.ts
|
|
6
|
+
var s = a.Struct({
|
|
7
|
+
revision: a.Int,
|
|
8
|
+
revisionId: a.String,
|
|
9
|
+
previousRevisionId: a.NullOr(a.String),
|
|
10
|
+
definition: e,
|
|
11
|
+
approvedAt: a.Int
|
|
12
|
+
}), c = {
|
|
13
|
+
namespace: "cms.routeDisposition",
|
|
14
|
+
path: "/v1/cms/route-dispositions",
|
|
15
|
+
operationPrefix: "cmsRouteDisposition",
|
|
16
|
+
tags: ["CMS route dispositions"],
|
|
17
|
+
error: t,
|
|
18
|
+
errorStatus: { RouteDispositionUnavailable: 409 },
|
|
19
|
+
credentialError: "RouteDispositionUnavailable"
|
|
20
|
+
}, l = (t) => {
|
|
21
|
+
let l = [i(c, "approve", "Approve one exact scoped route disposition", "Organization API-key bearer with the server-configured approval capability. Scope, authority and approval time come from the server. The expected revision is a CAS observation, never authority. This records editorial intent; only a separately admitted complete output graph may activate a redirect or retirement.", o(a.Struct({
|
|
22
|
+
expectedRevision: a.Int,
|
|
23
|
+
definition: e
|
|
24
|
+
}), "cms.routeDisposition.approve", !0), a.Struct({
|
|
25
|
+
...s.fields,
|
|
26
|
+
count: a.Int
|
|
27
|
+
}), (e, r) => t.approve({
|
|
28
|
+
...e,
|
|
29
|
+
apiKey: n(r, c.credentialError)
|
|
30
|
+
})), i(c, "list", "Read one scoped page of approved route dispositions", "Organization API-key bearer with the server-configured read capability. A continuation requires the observed revision and refuses after a change. No private key identity or credentials are projected. Revoked, personal or foreign credentials never authorize a read.", o(a.Struct({
|
|
31
|
+
expectedRevision: a.optional(a.Int),
|
|
32
|
+
after: a.optional(a.String),
|
|
33
|
+
take: a.optional(a.Int)
|
|
34
|
+
}), "cms.routeDisposition.list", !0), a.Struct({
|
|
35
|
+
revision: a.Int,
|
|
36
|
+
count: a.Int,
|
|
37
|
+
entries: a.Array(s),
|
|
38
|
+
next: a.NullOr(a.String)
|
|
39
|
+
}), (e, r) => t.list({
|
|
40
|
+
apiKey: n(r, c.credentialError),
|
|
41
|
+
...e.expectedRevision === void 0 ? {} : { expectedRevision: e.expectedRevision },
|
|
42
|
+
...e.after === void 0 ? {} : { after: e.after },
|
|
43
|
+
...e.take === void 0 ? {} : { take: e.take }
|
|
44
|
+
}))];
|
|
45
|
+
return {
|
|
46
|
+
routes: l,
|
|
47
|
+
httpRoutes: r(l)
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export { l as cmsRouteDispositionRest };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { lockPublicationStream as e } from "./changes.js";
|
|
2
|
+
import { copyOutputActivationScope as t } from "./outputActivation.js";
|
|
3
|
+
import { RouteDispositionUnavailable as n, copyRouteDispositionDefinition as r, routeDispositionFail as i } from "./routeDispositions.js";
|
|
4
|
+
import { readRenderReadOrganization as a } from "./renderReadAuthority.js";
|
|
5
|
+
import { readApprovedRouteDispositionPage as o, writeApprovedRouteDisposition as s } from "./routeDispositionStore.js";
|
|
6
|
+
import { Effect as c } from "effect";
|
|
7
|
+
import { API_KEYS_TABLE as l, dataStoreApiKeyStore as u, makeApiKeyService as d } from "@voltro/runtime";
|
|
8
|
+
// src/routeDispositionService.ts
|
|
9
|
+
var f = (f) => {
|
|
10
|
+
let { store: p, approvalScope: m, readScope: h } = f, g = t(f.scope), _ = f.now ?? Date.now;
|
|
11
|
+
if (![m, h].every((e) => /^[A-Za-z][A-Za-z0-9:_.-]{0,127}$/.test(e))) return i("input");
|
|
12
|
+
let v = ({ authority: e, ...t }) => t, y = (e) => c.tryPromise({
|
|
13
|
+
try: e,
|
|
14
|
+
catch: (e) => e instanceof n ? e : new n({ reason: "state" })
|
|
15
|
+
}), b = (e) => new Proxy(e, { get(e, t) {
|
|
16
|
+
if (t === "query") return (t) => e.query(t.table === l ? {
|
|
17
|
+
...t,
|
|
18
|
+
lock: "update"
|
|
19
|
+
} : t);
|
|
20
|
+
let n = Reflect.get(e, t);
|
|
21
|
+
return typeof n == "function" ? n.bind(e) : n;
|
|
22
|
+
} }), x = async (e, t, n) => {
|
|
23
|
+
let r = await a(b(e), g, t, _());
|
|
24
|
+
return r === null || !r.scopes.includes(n) ? i("credential") : t;
|
|
25
|
+
}, S = async (e, t, n) => {
|
|
26
|
+
if (typeof t != "string" || t.length === 0 || t.length > 512) return i("credential");
|
|
27
|
+
let r = await d(u(b(e))).verify(t, _());
|
|
28
|
+
return r === null ? i("credential") : x(e, r.id, n);
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
approve: (t) => y(async () => {
|
|
32
|
+
let n = t.apiKey, a = t.expectedRevision, o = r(t.definition);
|
|
33
|
+
return p.transactional(async (t) => {
|
|
34
|
+
await e(t, g);
|
|
35
|
+
let r = await S(t, n, m);
|
|
36
|
+
if (await x(t, r, m) !== r) return i("credential");
|
|
37
|
+
let c = await s(t, g, {
|
|
38
|
+
expectedRevision: a,
|
|
39
|
+
definition: o,
|
|
40
|
+
authority: {
|
|
41
|
+
kind: "apiKey",
|
|
42
|
+
id: r,
|
|
43
|
+
scope: m
|
|
44
|
+
},
|
|
45
|
+
now: _()
|
|
46
|
+
});
|
|
47
|
+
if (await x(t, r, m) !== r) return i("credential");
|
|
48
|
+
let { count: l, ...u } = c;
|
|
49
|
+
return {
|
|
50
|
+
...v(u),
|
|
51
|
+
count: l
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}),
|
|
55
|
+
list: (t) => y(async () => {
|
|
56
|
+
let n = t.apiKey, { expectedRevision: r, after: a, take: s } = t;
|
|
57
|
+
return p.transactional(async (t) => {
|
|
58
|
+
await e(t, g);
|
|
59
|
+
let c = await S(t, n, h), l = await o(t, g, {
|
|
60
|
+
...r === void 0 ? {} : { expectedRevision: r },
|
|
61
|
+
...a === void 0 ? {} : { after: a },
|
|
62
|
+
...s === void 0 ? {} : { take: s }
|
|
63
|
+
});
|
|
64
|
+
return await x(t, c, h) === c ? {
|
|
65
|
+
...l,
|
|
66
|
+
entries: l.entries.map(({ urlKey: e, ...t }) => v(t))
|
|
67
|
+
} : i("credential");
|
|
68
|
+
});
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export { f as createCmsRouteDispositions };
|