@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/availability.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ReferenceUnavailable as e } from "./errors.js";
|
|
2
|
+
import { asTyped as t } from "./effectForm.js";
|
|
3
3
|
import { referencesOf as n } from "./references.js";
|
|
4
4
|
import { and as r, boolean as i, eq as a, gt as o, id as s, inSet as c, json as l, lte as u, table as d, text as f, timestamp as p } from "@voltro/database";
|
|
5
5
|
import { tenant as m } from "@voltro/plugin-multitenancy/mixin";
|
|
6
|
-
|
|
6
|
+
// src/availability.ts
|
|
7
7
|
var h = "cms_availability", g = d(h, {
|
|
8
8
|
id: s({ prefix: "cavl" }),
|
|
9
9
|
contentType: f().maxLength(64),
|
|
@@ -31,7 +31,13 @@ var h = "cms_availability", g = d(h, {
|
|
|
31
31
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
32
32
|
}
|
|
33
33
|
return null;
|
|
34
|
-
}, y =
|
|
34
|
+
}, y = (e, t, n = {}) => {
|
|
35
|
+
let r = (e, t, n = !1) => {
|
|
36
|
+
let r = _(e);
|
|
37
|
+
return r === null || t == null || t === "" ? !1 : !r.includes(n ? t.toUpperCase() : t);
|
|
38
|
+
}, i = v(e.availableUntil), a = v(e.availableFrom);
|
|
39
|
+
return e.blocked === !0 ? "blocked" : i !== null && i.getTime() <= t.getTime() ? "expired" : a !== null && a.getTime() > t.getTime() ? "notYet" : r(e.territories, n.territory, !0) ? "territory" : r(e.channels, n.channel) ? "channel" : r(e.purposes, n.purpose) ? "purpose" : null;
|
|
40
|
+
}, b = async (e, t, n, i) => {
|
|
35
41
|
let o = t.availability;
|
|
36
42
|
if (o === void 0) return;
|
|
37
43
|
let s = {
|
|
@@ -62,7 +68,7 @@ var h = "cms_availability", g = d(h, {
|
|
|
62
68
|
...s,
|
|
63
69
|
...l == null ? {} : { tenantId: l }
|
|
64
70
|
});
|
|
65
|
-
},
|
|
71
|
+
}, x = async (e, t, n, i = /* @__PURE__ */ new Date(), o = {}) => {
|
|
66
72
|
let s = /* @__PURE__ */ new Map(), l = [...new Set(t)];
|
|
67
73
|
if (l.length === 0) return s;
|
|
68
74
|
let u = await e.query({
|
|
@@ -72,16 +78,13 @@ var h = "cms_availability", g = d(h, {
|
|
|
72
78
|
take: void 0,
|
|
73
79
|
skip: void 0,
|
|
74
80
|
projection: void 0
|
|
75
|
-
})
|
|
76
|
-
let r = _(e);
|
|
77
|
-
return r === null || t == null || t === "" ? !1 : !r.includes(n ? t.toUpperCase() : t);
|
|
78
|
-
};
|
|
81
|
+
});
|
|
79
82
|
for (let e of u) {
|
|
80
|
-
let t = e.documentId, n =
|
|
81
|
-
|
|
83
|
+
let t = e.documentId, n = y(e, i, o);
|
|
84
|
+
n !== null && s.set(t, n);
|
|
82
85
|
}
|
|
83
86
|
return s;
|
|
84
|
-
},
|
|
87
|
+
}, S = async (e, t, n, i = /* @__PURE__ */ new Date()) => {
|
|
85
88
|
let s = new Date(i.getTime() + n * 864e5);
|
|
86
89
|
return (await e.query({
|
|
87
90
|
table: h,
|
|
@@ -102,11 +105,11 @@ var h = "cms_availability", g = d(h, {
|
|
|
102
105
|
days: Math.ceil((t.getTime() - i.getTime()) / 864e5)
|
|
103
106
|
}];
|
|
104
107
|
});
|
|
105
|
-
},
|
|
108
|
+
}, C = async (t, r, i, a, o, s = /* @__PURE__ */ new Date()) => {
|
|
106
109
|
let c = n(r, a);
|
|
107
110
|
if (c.length === 0) return;
|
|
108
|
-
let l = await
|
|
109
|
-
if (l.size !== 0) throw new
|
|
111
|
+
let l = await x(t, c.map((e) => e.targetDocumentId), o, s);
|
|
112
|
+
if (l.size !== 0) throw new e({
|
|
110
113
|
contentType: r.name,
|
|
111
114
|
id: i,
|
|
112
115
|
targets: c.filter((e) => l.has(e.targetDocumentId)).map((e) => ({
|
|
@@ -116,6 +119,5 @@ var h = "cms_availability", g = d(h, {
|
|
|
116
119
|
reason: l.get(e.targetDocumentId)
|
|
117
120
|
}))
|
|
118
121
|
});
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
export { h as CMS_AVAILABILITY_TABLE, S as assertReferencesAvailable, T as assertReferencesAvailableEffect, g as cmsAvailabilityTable, x as expiringAmong, w as expiringAmongEffect, b as unavailableAmong, E as unavailableAmongEffect, y as writeAvailability, D as writeAvailabilityEffect };
|
|
122
|
+
}, w = [e], T = (...e) => t(() => S(...e)), E = (...e) => t(() => C(...e), ...w), D = (...e) => t(() => x(...e), ...w), O = (...e) => t(() => b(...e), ...w);
|
|
123
|
+
export { h as CMS_AVAILABILITY_TABLE, C as assertReferencesAvailable, E as assertReferencesAvailableEffect, y as availabilityReason, g as cmsAvailabilityTable, S as expiringAmong, T as expiringAmongEffect, x as unavailableAmong, D as unavailableAmongEffect, b as writeAvailability, O as writeAvailabilityEffect };
|
package/dist/blueprint.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { applyDerivations as
|
|
5
|
-
import { teamProblems as
|
|
6
|
-
import { reviewRequiredFor as
|
|
7
|
-
import { publish as
|
|
8
|
-
import { and as
|
|
9
|
-
|
|
10
|
-
var
|
|
1
|
+
import { ChangeFeedUnavailable as e, ContentIdConflict as t, ContentNotFound as n, ContentValidationFailed as r, ReferenceUnavailable as i, ReviewRequired as a, RevisionMismatch as o } from "./errors.js";
|
|
2
|
+
import { templateValues as s } from "./templates.js";
|
|
3
|
+
import { asTyped as c } from "./effectForm.js";
|
|
4
|
+
import { applyDerivations as l } from "./validation.js";
|
|
5
|
+
import { teamProblems as u } from "./team.js";
|
|
6
|
+
import { reviewRequiredFor as d } from "./review.js";
|
|
7
|
+
import { publish as f, saveDraft as p } from "./write.js";
|
|
8
|
+
import { and as m, eq as h } from "@voltro/database";
|
|
9
|
+
// src/blueprint.ts
|
|
10
|
+
var g = class extends Error {
|
|
11
11
|
reason;
|
|
12
12
|
_tag = "BlueprintInvalid";
|
|
13
13
|
constructor(e) {
|
|
14
14
|
super(`blueprint not usable: ${e}`), this.reason = e;
|
|
15
15
|
}
|
|
16
|
-
},
|
|
16
|
+
}, _ = "$entry", v = (e) => ({ [_]: e }), y = (e) => {
|
|
17
17
|
if (typeof e != "object" || !e || Array.isArray(e)) return;
|
|
18
|
-
let t = Object.keys(e), n = e[
|
|
18
|
+
let t = Object.keys(e), n = e[_];
|
|
19
19
|
return t.length === 1 && typeof n == "string" ? n : void 0;
|
|
20
|
-
},
|
|
21
|
-
let n =
|
|
20
|
+
}, b = (e, t) => {
|
|
21
|
+
let n = y(e);
|
|
22
22
|
if (n !== void 0) t.add(n);
|
|
23
|
-
else if (Array.isArray(e)) for (let n of e)
|
|
24
|
-
else if (typeof e == "object" && e) for (let n of Object.values(e))
|
|
23
|
+
else if (Array.isArray(e)) for (let n of e) b(n, t);
|
|
24
|
+
else if (typeof e == "object" && e) for (let n of Object.values(e)) b(n, t);
|
|
25
25
|
return t;
|
|
26
|
-
},
|
|
27
|
-
let n =
|
|
28
|
-
return n === void 0 ? Array.isArray(e) ? e.map((e) =>
|
|
29
|
-
},
|
|
30
|
-
let t = e.team === void 0 ? [] :
|
|
31
|
-
if (t.length > 0) throw new
|
|
26
|
+
}, x = (e, t) => {
|
|
27
|
+
let n = y(e);
|
|
28
|
+
return n === void 0 ? Array.isArray(e) ? e.map((e) => x(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, x(n, t)])) : e : t.get(n);
|
|
29
|
+
}, S = (e) => {
|
|
30
|
+
let t = e.team === void 0 ? [] : u(e.team);
|
|
31
|
+
if (t.length > 0) throw new g(t.join("; "));
|
|
32
32
|
let n = /* @__PURE__ */ new Map();
|
|
33
33
|
for (let t of e.entries) {
|
|
34
|
-
if (n.has(t.key)) throw new
|
|
34
|
+
if (n.has(t.key)) throw new g(`the key '${t.key}' is used twice`);
|
|
35
35
|
n.set(t.key, t);
|
|
36
36
|
}
|
|
37
|
-
let r = new Map(e.entries.map((e) => [e.key,
|
|
38
|
-
for (let [e, t] of r) for (let r of t) if (!n.has(r)) throw new
|
|
37
|
+
let r = new Map(e.entries.map((e) => [e.key, b([e.values, e.translations ?? {}], /* @__PURE__ */ new Set())]));
|
|
38
|
+
for (let [e, t] of r) for (let r of t) if (!n.has(r)) throw new g(`'${e}' references '${r}', which is no entry`);
|
|
39
39
|
let i = [], a = /* @__PURE__ */ new Map(), o = (e, t) => {
|
|
40
40
|
if (a.get(e) !== "done") {
|
|
41
|
-
if (a.get(e) === "visiting") throw new
|
|
41
|
+
if (a.get(e) === "visiting") throw new g(`the entries reference each other in a circle: ${[...t, e].join(" → ")}`);
|
|
42
42
|
a.set(e, "visiting");
|
|
43
43
|
for (let n of r.get(e) ?? []) o(n, [...t, e]);
|
|
44
44
|
a.set(e, "done"), i.push(n.get(e));
|
|
@@ -49,31 +49,31 @@ var h = class extends Error {
|
|
|
49
49
|
...e,
|
|
50
50
|
entries: i
|
|
51
51
|
};
|
|
52
|
-
},
|
|
52
|
+
}, C = (e, t) => {
|
|
53
53
|
let n = e.find((e) => e.name === t.type);
|
|
54
|
-
if (n === void 0) throw new
|
|
55
|
-
if (t.match !== void 0 && n.fields[t.match] === void 0) throw new
|
|
54
|
+
if (n === void 0) throw new g(`'${t.key}' is of type '${t.type}', which this app does not have`);
|
|
55
|
+
if (t.match !== void 0 && n.fields[t.match] === void 0) throw new g(`'${t.key}' matches on '${t.match}', which ${n.name} does not have`);
|
|
56
56
|
return n;
|
|
57
|
-
},
|
|
58
|
-
let
|
|
59
|
-
if (
|
|
60
|
-
let
|
|
61
|
-
if (
|
|
62
|
-
|
|
57
|
+
}, w = (e, t, n, r) => {
|
|
58
|
+
let i = {};
|
|
59
|
+
if (t.template !== void 0) {
|
|
60
|
+
let n = s(e, t.template);
|
|
61
|
+
if (n === null) throw new g(`'${t.key}' is built from the template '${t.template}', which ${e.name} does not have`);
|
|
62
|
+
i = n;
|
|
63
63
|
}
|
|
64
|
-
let
|
|
64
|
+
let a = n === r ? {} : t.translations?.[n] ?? {};
|
|
65
65
|
return {
|
|
66
|
-
...
|
|
67
|
-
...
|
|
68
|
-
...
|
|
66
|
+
...i,
|
|
67
|
+
...t.values,
|
|
68
|
+
...a
|
|
69
69
|
};
|
|
70
|
-
},
|
|
70
|
+
}, T = (e, t) => {
|
|
71
71
|
if (typeof t.title == "string" && t.title !== "") return t.title;
|
|
72
72
|
let n = e.match === void 0 ? void 0 : t[e.match];
|
|
73
73
|
return typeof n == "string" && n !== "" ? n : e.key;
|
|
74
|
-
},
|
|
74
|
+
}, E = (e, t, n, r) => e.query({
|
|
75
75
|
table: `${t.name}_drafts`,
|
|
76
|
-
predicate:
|
|
76
|
+
predicate: m(h("site", n.site), h("environment", n.environment), h("locale", n.locale), ...r === null ? [] : [r]),
|
|
77
77
|
order: [{
|
|
78
78
|
column: "id",
|
|
79
79
|
direction: "asc"
|
|
@@ -81,47 +81,47 @@ var h = class extends Error {
|
|
|
81
81
|
take: 1,
|
|
82
82
|
skip: void 0,
|
|
83
83
|
projection: void 0
|
|
84
|
-
}),
|
|
84
|
+
}), D = async (e, t, n, r, i, a) => {
|
|
85
85
|
if (a !== null) {
|
|
86
|
-
let [n] = await
|
|
86
|
+
let [n] = await E(e, t, r, h("documentId", a));
|
|
87
87
|
if (n !== void 0) return n;
|
|
88
88
|
}
|
|
89
89
|
let o = n.match === void 0 ? void 0 : i[n.match];
|
|
90
90
|
if (n.match !== void 0 && (o == null || o === "")) return null;
|
|
91
|
-
let [s] = await
|
|
91
|
+
let [s] = await E(e, t, r, n.match === void 0 ? null : h(n.match, o));
|
|
92
92
|
return s ?? null;
|
|
93
|
-
},
|
|
93
|
+
}, O = (e, t) => [e.locale, ...Object.keys(t.translations ?? {}).filter((t) => t !== e.locale)], k = async (e, t, n, r, i) => {
|
|
94
94
|
let a = /* @__PURE__ */ new Map(), o = [], s = 0;
|
|
95
|
-
for (let
|
|
96
|
-
let
|
|
97
|
-
for (let t of
|
|
95
|
+
for (let c of n.entries) {
|
|
96
|
+
let u = C(t, c), m = null, h = !1, g = !1;
|
|
97
|
+
for (let t of O(n, c)) {
|
|
98
98
|
if (g) break;
|
|
99
99
|
let _ = {
|
|
100
100
|
site: r.site,
|
|
101
101
|
environment: r.environment,
|
|
102
102
|
locale: t
|
|
103
|
-
}, v =
|
|
104
|
-
if (
|
|
105
|
-
g = t === n.locale, m ??= String(
|
|
106
|
-
key:
|
|
107
|
-
type:
|
|
103
|
+
}, v = w(u, c, t, n.locale), y = l(u, x(v, a)), b = await D(e, u, c, _, y, m);
|
|
104
|
+
if (b !== null) {
|
|
105
|
+
g = t === n.locale, m ??= String(b.documentId), o.push({
|
|
106
|
+
key: c.key,
|
|
107
|
+
type: u.name,
|
|
108
108
|
locale: t,
|
|
109
|
-
label:
|
|
109
|
+
label: T(c, b),
|
|
110
110
|
action: "present",
|
|
111
|
-
documentId: String(
|
|
112
|
-
variantId: String(
|
|
111
|
+
documentId: String(b.documentId),
|
|
112
|
+
variantId: String(b.id),
|
|
113
113
|
outcome: null
|
|
114
114
|
});
|
|
115
115
|
continue;
|
|
116
116
|
}
|
|
117
|
-
let S =
|
|
117
|
+
let S = T(c, y);
|
|
118
118
|
m === null && !h && s++, h = !0;
|
|
119
|
-
let
|
|
119
|
+
let C = c.publish === !1 ? "draft" : u.review?.required === !0 || u.review?.required === "workspace" && (n.team?.reviewRequired ?? []).includes(u.name) ? "review" : "live";
|
|
120
120
|
if (!i) {
|
|
121
|
-
let e =
|
|
121
|
+
let e = C;
|
|
122
122
|
o.push({
|
|
123
|
-
key:
|
|
124
|
-
type:
|
|
123
|
+
key: c.key,
|
|
124
|
+
type: u.name,
|
|
125
125
|
locale: t,
|
|
126
126
|
label: S,
|
|
127
127
|
action: "create",
|
|
@@ -131,36 +131,35 @@ var h = class extends Error {
|
|
|
131
131
|
});
|
|
132
132
|
continue;
|
|
133
133
|
}
|
|
134
|
-
let
|
|
134
|
+
let E = await p(e, u, {
|
|
135
135
|
...y,
|
|
136
136
|
...m === null ? {} : { documentId: m }
|
|
137
|
-
}, _), O =
|
|
138
|
-
O === "live" && await
|
|
139
|
-
key:
|
|
140
|
-
type:
|
|
137
|
+
}, _), O = C === "live" && await d(e, u, String(E.id)) ? "review" : C;
|
|
138
|
+
O === "live" && await f(e, u, String(E.id), _), m ??= String(E.documentId), o.push({
|
|
139
|
+
key: c.key,
|
|
140
|
+
type: u.name,
|
|
141
141
|
locale: t,
|
|
142
142
|
label: S,
|
|
143
143
|
action: "create",
|
|
144
|
-
documentId: String(
|
|
145
|
-
variantId: String(
|
|
144
|
+
documentId: String(E.documentId),
|
|
145
|
+
variantId: String(E.id),
|
|
146
146
|
outcome: O
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
m !== null && a.set(
|
|
149
|
+
m !== null && a.set(c.key, m);
|
|
150
150
|
}
|
|
151
151
|
return {
|
|
152
152
|
blueprint: n.id,
|
|
153
153
|
steps: o,
|
|
154
154
|
documents: s
|
|
155
155
|
};
|
|
156
|
-
},
|
|
157
|
-
|
|
156
|
+
}, A = (e, t, n, r) => k(e, t, n, r, !1), j = (e, t, n, r) => k(e, t, n, r, !0), M = [
|
|
157
|
+
g,
|
|
158
|
+
t,
|
|
158
159
|
n,
|
|
159
160
|
r,
|
|
160
161
|
i,
|
|
161
162
|
a,
|
|
162
|
-
o
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
//#endregion
|
|
166
|
-
export { h as BlueprintInvalid, A as applyBlueprint, M as applyBlueprintEffect, _ as blueprintRef, x as defineBlueprint, k as planBlueprint, N as planBlueprintEffect };
|
|
163
|
+
o
|
|
164
|
+
], N = (...t) => c(() => j(...t), ...M, e), P = (...e) => c(() => A(...e), ...M);
|
|
165
|
+
export { g as BlueprintInvalid, j as applyBlueprint, N as applyBlueprintEffect, v as blueprintRef, S as defineBlueprint, A as planBlueprint, P as planBlueprintEffect };
|