@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/contentType.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ContentLocationUnavailable as e, ContentSeoUnavailable as t } from "./errors.js";
|
|
2
|
+
import { defineContentSeo as n, validateContentSeoFields as r } from "./contentSeo.js";
|
|
3
|
+
import { defineContentSeoSites as i } from "./publicationSeo.js";
|
|
4
|
+
import { checkTemplates as a } from "./templates.js";
|
|
5
|
+
import { checkSearch as o } from "./search.js";
|
|
6
|
+
import { taxonomyProblem as s } from "./taxonomy.js";
|
|
7
|
+
import { componentExampleViolations as c } from "./validation.js";
|
|
8
|
+
import { defineContentLocations as l } from "./contentLocations.js";
|
|
9
|
+
import { boolean as u, date as d, id as f, integer as p, json as m, real as h, table as g, text as _, timestamp as v } from "@voltro/database";
|
|
10
|
+
import { tenant as y } from "@voltro/plugin-multitenancy/mixin";
|
|
11
|
+
// src/contentType.ts
|
|
12
|
+
var b = [
|
|
9
13
|
"site",
|
|
10
14
|
"environment",
|
|
11
15
|
"locale"
|
|
12
|
-
],
|
|
16
|
+
], x = [
|
|
13
17
|
"draft",
|
|
14
18
|
"published",
|
|
15
19
|
"archived"
|
|
16
|
-
],
|
|
20
|
+
], S = [
|
|
17
21
|
"id",
|
|
18
22
|
"status",
|
|
19
23
|
"publishAt",
|
|
@@ -29,58 +33,71 @@ var m = [
|
|
|
29
33
|
"updatedAt",
|
|
30
34
|
"createdBy",
|
|
31
35
|
"updatedBy"
|
|
32
|
-
],
|
|
33
|
-
let
|
|
34
|
-
for (let [e, t] of Object.entries(
|
|
35
|
-
if (
|
|
36
|
+
], C = (u) => {
|
|
37
|
+
let d = {}, f = [], p = [];
|
|
38
|
+
for (let [e, t] of Object.entries(u.fields)) {
|
|
39
|
+
if (S.includes(e)) throw Error(`defineContentType('${u.name}'): field '${e}' collides with a reserved lifecycle column (${S.join(", ")}). Rename it.`);
|
|
36
40
|
let n = t;
|
|
37
|
-
if (n.unique && n.kind !== "string") throw Error(`defineContentType('${
|
|
38
|
-
|
|
41
|
+
if (n.unique && n.kind !== "string") throw Error(`defineContentType('${u.name}'): field '${e}' is marked unique() but is a '${n.kind}' field — per-tenant uniqueness is only supported on string fields (a slug). Remove unique() or make it a Schema.String.`);
|
|
42
|
+
d[e] = n, n.derived && f.push(e), n.unique && p.push(e);
|
|
39
43
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
44
|
+
let m = u.asset === void 0 ? void 0 : { file: u.asset.file };
|
|
45
|
+
if (m !== void 0 && (Object.keys(u.asset).some((e) => e !== "file") || typeof m.file != "string" || !Object.hasOwn(d, m.file) || d[m.file]?.kind !== "media" || d[m.file]?.isOptional === !0)) throw Error(`defineContentType('${u.name}'): asset.file must name a required Media field.`);
|
|
46
|
+
if (u.list) {
|
|
47
|
+
let e = /* @__PURE__ */ new Set([...Object.keys(d), ...S]);
|
|
48
|
+
for (let t of u.list.columns) if (!e.has(t)) throw Error(`defineContentType('${u.name}'): list.columns entry '${t}' is not a declared field (or lifecycle column) of this content type.`);
|
|
49
|
+
let t = u.list.defaultSort?.field;
|
|
50
|
+
if (t !== void 0 && !e.has(t)) throw Error(`defineContentType('${u.name}'): list.defaultSort.field '${t}' is not a declared field (or lifecycle column) of this content type.`);
|
|
45
51
|
}
|
|
46
|
-
if (
|
|
47
|
-
if (
|
|
48
|
-
if (
|
|
52
|
+
if (u.tree && T(u.name, d, u.tree), u.address !== void 0) {
|
|
53
|
+
if (u.tree) throw Error(`defineContentType('${u.name}'): address is for a type outside a tree — a tree type is addressed by its tree.`);
|
|
54
|
+
if (d[u.address]?.kind !== "string") throw Error(`defineContentType('${u.name}'): address '${u.address}' must be a declared string field.`);
|
|
49
55
|
}
|
|
50
|
-
|
|
51
|
-
for (let e of Object.values(
|
|
52
|
-
let [e] =
|
|
53
|
-
if (e !== void 0) throw Error(`defineContentType('${
|
|
56
|
+
u.availability && E(u.name, d, u.availability), u.templates && a(u.name, d, u.templates), u.search && o(u.name, d, u.search), u.quality && w(u.name, d, u.quality);
|
|
57
|
+
for (let e of Object.values(d)) for (let t of e.components ?? []) {
|
|
58
|
+
let [e] = c(t);
|
|
59
|
+
if (e !== void 0) throw Error(`defineContentType('${u.name}'): component '${t.id}' ${e.field}: ${e.message}.`);
|
|
54
60
|
}
|
|
55
|
-
if (
|
|
56
|
-
let e =
|
|
57
|
-
if (e?.kind !== "array" || e.element?.kind !== "string") throw Error(`defineContentType('${
|
|
58
|
-
let t =
|
|
59
|
-
if (t !== null) throw Error(`defineContentType('${
|
|
61
|
+
if (u.taxonomy) {
|
|
62
|
+
let e = d[u.taxonomy.field];
|
|
63
|
+
if (e?.kind !== "array" || e.element?.kind !== "string") throw Error(`defineContentType('${u.name}'): taxonomy field '${u.taxonomy.field}' must be a declared Schema.Array(Schema.String) field.`);
|
|
64
|
+
let t = s(u.taxonomy);
|
|
65
|
+
if (t !== null) throw Error(`defineContentType('${u.name}'): taxonomy ${t}.`);
|
|
66
|
+
}
|
|
67
|
+
if (u.lifecycle && !(Number.isInteger(u.lifecycle.reviewEveryDays) && u.lifecycle.reviewEveryDays > 0)) throw Error(`defineContentType('${u.name}'): lifecycle.reviewEveryDays must be a positive whole number of days.`);
|
|
68
|
+
let h = u.seo === void 0 ? void 0 : n(u.seo);
|
|
69
|
+
if (h !== void 0 && r(h, d), u.seoSites !== void 0 && h === void 0) throw new t({ reason: "definition" });
|
|
70
|
+
let g = u.seoSites === void 0 ? void 0 : i(u.seoSites), _ = u.locations === void 0 ? void 0 : l(u.locations);
|
|
71
|
+
for (let t of _ ?? []) for (let n of t.segments) if (typeof n != "string") {
|
|
72
|
+
if ("field" in n && d[n.field]?.kind !== "string") throw new e({ reason: "field" });
|
|
73
|
+
if ("tree" in n && u.tree === void 0) throw new e({ reason: "tree" });
|
|
60
74
|
}
|
|
61
|
-
if (i.lifecycle && !(Number.isInteger(i.lifecycle.reviewEveryDays) && i.lifecycle.reviewEveryDays > 0)) throw Error(`defineContentType('${i.name}'): lifecycle.reviewEveryDays must be a positive whole number of days.`);
|
|
62
75
|
return {
|
|
63
|
-
name:
|
|
64
|
-
displayName:
|
|
65
|
-
pluralName:
|
|
66
|
-
fields:
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
-
...
|
|
70
|
-
...
|
|
71
|
-
...
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
-
...
|
|
75
|
-
...
|
|
76
|
-
...
|
|
77
|
-
...
|
|
78
|
-
...
|
|
79
|
-
...
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
name: u.name,
|
|
77
|
+
displayName: u.displayName,
|
|
78
|
+
pluralName: u.pluralName,
|
|
79
|
+
fields: d,
|
|
80
|
+
...m === void 0 ? {} : { asset: m },
|
|
81
|
+
...u.list ? { list: u.list } : {},
|
|
82
|
+
...u.idPrefix ? { idPrefix: u.idPrefix } : {},
|
|
83
|
+
...u.revalidate ? { revalidate: u.revalidate } : {},
|
|
84
|
+
...u.tree ? { tree: u.tree } : {},
|
|
85
|
+
...u.address === void 0 ? {} : { address: u.address },
|
|
86
|
+
..._ === void 0 ? {} : { locations: _ },
|
|
87
|
+
...h === void 0 ? {} : { seo: h },
|
|
88
|
+
...g === void 0 ? {} : { seoSites: g },
|
|
89
|
+
...u.review ? { review: u.review } : {},
|
|
90
|
+
...u.availability ? { availability: u.availability } : {},
|
|
91
|
+
...u.lifecycle ? { lifecycle: u.lifecycle } : {},
|
|
92
|
+
...u.templates ? { templates: u.templates } : {},
|
|
93
|
+
...u.changeFeed === !0 ? { changeFeed: !0 } : {},
|
|
94
|
+
...u.search ? { search: u.search } : {},
|
|
95
|
+
...u.quality && u.quality.length > 0 ? { quality: u.quality } : {},
|
|
96
|
+
...u.taxonomy ? { taxonomy: u.taxonomy } : {},
|
|
97
|
+
derivedFields: f,
|
|
98
|
+
uniqueFields: p
|
|
82
99
|
};
|
|
83
|
-
},
|
|
100
|
+
}, w = (e, t, n) => {
|
|
84
101
|
let r = /* @__PURE__ */ new Set();
|
|
85
102
|
for (let i of n) {
|
|
86
103
|
if (!/^[A-Za-z][A-Za-z0-9.-]{0,63}$/.test(i.id)) throw Error(`defineContentType('${e}'): quality rule id '${i.id}' must be letters, digits, '.' or '-', at most 64.`);
|
|
@@ -88,18 +105,18 @@ var m = [
|
|
|
88
105
|
if (r.add(i.id), t[i.field] === void 0) throw Error(`defineContentType('${e}'): quality rule '${i.id}' names '${i.field}', which is no field of this type.`);
|
|
89
106
|
if (i.sites?.length === 0 || i.locales?.length === 0) throw Error(`defineContentType('${e}'): quality rule '${i.id}' names an empty list of sites or locales — leave it out to apply everywhere.`);
|
|
90
107
|
}
|
|
91
|
-
},
|
|
108
|
+
}, T = (e, t, n) => {
|
|
92
109
|
let r = (t) => {
|
|
93
110
|
throw Error(`defineContentType('${e}'): tree ${t}`);
|
|
94
111
|
}, i = t[n.parent];
|
|
95
|
-
i === void 0 ? r(`parent '${n.parent}' is not a declared field.`) :
|
|
112
|
+
i === void 0 ? r(`parent '${n.parent}' is not a declared field.`) : i.kind === "reference" && i.referenceType === e && i.isOptional || r(`parent '${n.parent}' must be Schema.Reference('${e}').optional() — roots have no parent.`);
|
|
96
113
|
let a = t[n.segment];
|
|
97
114
|
(a === void 0 || a.kind !== "string") && r(`segment '${n.segment}' must be a declared string field.`), n.order !== void 0 && t[n.order]?.kind !== "number" && r(`order '${n.order}' must be a declared number field.`);
|
|
98
|
-
for (let [e, i] of Object.entries(n.inherit ?? {})) if (
|
|
115
|
+
for (let [e, i] of Object.entries(n.inherit ?? {})) if (t[e] !== void 0 && t[e].isOptional || r(`inherit '${e}' must be a declared optional field — a page that sets nothing inherits.`), i.mask !== void 0) {
|
|
99
116
|
let n = t[i.mask];
|
|
100
|
-
|
|
117
|
+
n !== void 0 && n.isOptional && n.kind === "boolean" || r(`inherit '${e}' mask '${i.mask}' must be a declared optional Boolean field.`), i.locked === !0 && r(`inherit '${e}' is locked, so it cannot be masked — drop 'mask' or 'locked'.`);
|
|
101
118
|
}
|
|
102
|
-
},
|
|
119
|
+
}, E = (e, t, n) => {
|
|
103
120
|
let r = n.until === void 0 ? void 0 : t[n.until];
|
|
104
121
|
if (n.until !== void 0 && (r === void 0 || r.kind !== "date" && r.kind !== "datetime")) throw Error(`defineContentType('${e}'): availability.until '${n.until}' must be a declared date or datetime field.`);
|
|
105
122
|
let i = n.blocked === void 0 ? void 0 : t[n.blocked];
|
|
@@ -114,78 +131,77 @@ var m = [
|
|
|
114
131
|
let i = n[r] === void 0 ? void 0 : t[n[r]];
|
|
115
132
|
if (n[r] !== void 0 && (i?.kind !== "array" || i.element?.kind !== "string" && i.element?.kind !== "literal")) throw Error(`defineContentType('${e}'): availability.${r} '${n[r]}' must be a declared list of text or choices.`);
|
|
116
133
|
}
|
|
117
|
-
},
|
|
134
|
+
}, D = (e) => {
|
|
118
135
|
switch (e.kind) {
|
|
119
|
-
case "string": return e.isOptional ?
|
|
120
|
-
case "number": return e.fraction === !0 ? e.isOptional ?
|
|
121
|
-
case "boolean": return e.isOptional ?
|
|
122
|
-
case "date": return e.isOptional ?
|
|
123
|
-
case "datetime": return e.isOptional ?
|
|
136
|
+
case "string": return e.isOptional ? _().nullable() : _();
|
|
137
|
+
case "number": return e.fraction === !0 ? e.isOptional ? h().nullable() : h() : e.isOptional ? p().nullable() : p();
|
|
138
|
+
case "boolean": return e.isOptional ? u().nullable() : u();
|
|
139
|
+
case "date": return e.isOptional ? d().nullable() : d();
|
|
140
|
+
case "datetime": return e.isOptional ? v().nullable() : v();
|
|
124
141
|
case "literal": {
|
|
125
|
-
let t = e.literals ?? [], n = t.length > 0 ?
|
|
142
|
+
let t = e.literals ?? [], n = t.length > 0 ? _().oneOf(t) : _();
|
|
126
143
|
return e.isOptional ? n.nullable() : n;
|
|
127
144
|
}
|
|
128
145
|
case "richText":
|
|
129
146
|
case "array":
|
|
130
147
|
case "struct":
|
|
131
148
|
case "components": {
|
|
132
|
-
let t =
|
|
149
|
+
let t = m();
|
|
133
150
|
return e.isOptional ? t.nullable() : t;
|
|
134
151
|
}
|
|
135
152
|
case "media":
|
|
136
|
-
case "reference": return e.isOptional ?
|
|
153
|
+
case "reference": return e.isOptional ? _().nullable() : _();
|
|
137
154
|
}
|
|
138
|
-
},
|
|
155
|
+
}, O = (e) => {
|
|
139
156
|
let t = {};
|
|
140
|
-
for (let [n, r] of Object.entries(e.fields)) t[n] =
|
|
157
|
+
for (let [n, r] of Object.entries(e.fields)) t[n] = D(r);
|
|
141
158
|
return t;
|
|
142
|
-
},
|
|
143
|
-
let n =
|
|
159
|
+
}, k = (e) => e.idPrefix, A = (e, t) => {
|
|
160
|
+
let n = k(e), r = n ? f({ prefix: n }) : f(), i = g(`${e.name}_${t}`, {
|
|
144
161
|
id: r,
|
|
145
|
-
status:
|
|
162
|
+
status: _().oneOf(x),
|
|
146
163
|
...t === "drafts" ? {
|
|
147
|
-
publishAt:
|
|
148
|
-
unpublishAt:
|
|
164
|
+
publishAt: v().nullable(),
|
|
165
|
+
unpublishAt: v().nullable()
|
|
149
166
|
} : {},
|
|
150
|
-
revisionId:
|
|
151
|
-
revision:
|
|
152
|
-
documentId:
|
|
153
|
-
site:
|
|
154
|
-
environment:
|
|
155
|
-
locale:
|
|
156
|
-
...
|
|
157
|
-
}).with(
|
|
167
|
+
revisionId: _().default(""),
|
|
168
|
+
revision: p().default(0),
|
|
169
|
+
documentId: _().maxLength(64).backfill((e) => String(e.id)),
|
|
170
|
+
site: _().maxLength(64).default(""),
|
|
171
|
+
environment: _().maxLength(64).default(""),
|
|
172
|
+
locale: _().maxLength(64).default(""),
|
|
173
|
+
...O(e)
|
|
174
|
+
}).with(y()).unique(N(e, `${e.name}_${t}_variant_key`, "the document variant key"), [
|
|
158
175
|
"tenantId",
|
|
159
|
-
...
|
|
176
|
+
...b,
|
|
160
177
|
"documentId"
|
|
161
178
|
]);
|
|
162
|
-
return e.uniqueFields.reduce((n, r) => n.unique(
|
|
179
|
+
return e.uniqueFields.reduce((n, r) => n.unique(M(e, t, r), [
|
|
163
180
|
"tenantId",
|
|
164
|
-
...
|
|
181
|
+
...b,
|
|
165
182
|
r
|
|
166
183
|
]), i);
|
|
167
|
-
},
|
|
168
|
-
if (t.length >
|
|
184
|
+
}, j = 63, M = (e, t, n) => N(e, `${e.name}_${t}_uq_${n}`, `the unique constraint for field '${n}'`), N = (e, t, n) => {
|
|
185
|
+
if (t.length > j) throw Error(`contentTypeToEntities('${e.name}'): ${n} would be named '${t}' (${t.length} chars), past the ${j}-byte identifier limit. Shorten the content type name or the field name.`);
|
|
169
186
|
return t;
|
|
170
|
-
},
|
|
171
|
-
id:
|
|
172
|
-
contentType:
|
|
173
|
-
documentId:
|
|
174
|
-
number:
|
|
175
|
-
site:
|
|
176
|
-
environment:
|
|
177
|
-
locale:
|
|
178
|
-
values:
|
|
179
|
-
basedOn:
|
|
180
|
-
}).with(
|
|
187
|
+
}, P = "cms_revisions", F = g(P, {
|
|
188
|
+
id: f({ prefix: "crev" }),
|
|
189
|
+
contentType: _().maxLength(64),
|
|
190
|
+
documentId: _().maxLength(64),
|
|
191
|
+
number: p(),
|
|
192
|
+
site: _().maxLength(64).default(""),
|
|
193
|
+
environment: _().maxLength(64).default(""),
|
|
194
|
+
locale: _().maxLength(64).default(""),
|
|
195
|
+
values: m(),
|
|
196
|
+
basedOn: _().nullable()
|
|
197
|
+
}).with(y()).unique("cms_revisions_uq_variant_number", [
|
|
181
198
|
"tenantId",
|
|
182
199
|
"contentType",
|
|
183
200
|
"documentId",
|
|
184
|
-
...
|
|
201
|
+
...b,
|
|
185
202
|
"number"
|
|
186
|
-
]),
|
|
187
|
-
draft:
|
|
188
|
-
published:
|
|
203
|
+
]), I = (e) => ({
|
|
204
|
+
draft: A(e, "drafts"),
|
|
205
|
+
published: A(e, "published")
|
|
189
206
|
});
|
|
190
|
-
|
|
191
|
-
export { O as CMS_REVISIONS_TABLE, m as CMS_SCOPE_COLUMNS, h as CONTENT_STATUSES, g as RESERVED_FIELD_NAMES, k as cmsRevisionsTable, A as contentTypeToEntities, _ as defineContentType };
|
|
207
|
+
export { P as CMS_REVISIONS_TABLE, b as CMS_SCOPE_COLUMNS, x as CONTENT_STATUSES, S as RESERVED_FIELD_NAMES, F as cmsRevisionsTable, I as contentTypeToEntities, C as defineContentType };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/contentValues.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
let n = {};
|
|
4
|
+
for (let r of Object.keys(e.fields)) r in t && (n[r] = t[r]);
|
|
5
|
+
return n;
|
|
6
|
+
}, t = (e) => {
|
|
7
|
+
if (e == null) return {
|
|
8
|
+
ok: !0,
|
|
9
|
+
value: null
|
|
10
|
+
};
|
|
11
|
+
let t = e instanceof Date ? e : typeof e == "string" || typeof e == "number" ? new Date(e) : null;
|
|
12
|
+
return t === null || !Number.isFinite(t.getTime()) ? { ok: !1 } : {
|
|
13
|
+
ok: !0,
|
|
14
|
+
value: t.toISOString()
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export { e as pickDeclared, t as readContentModificationTime };
|
package/dist/contentfulImport.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./richDocument.js";
|
|
2
|
-
|
|
2
|
+
// src/contentfulImport.ts
|
|
3
3
|
var e = {
|
|
4
4
|
bold: "bold",
|
|
5
5
|
italic: "italic",
|
|
@@ -158,5 +158,4 @@ var e = {
|
|
|
158
158
|
findings: a
|
|
159
159
|
};
|
|
160
160
|
};
|
|
161
|
-
//#endregion
|
|
162
161
|
export { t as richDocumentFromContentful };
|
package/dist/copies.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ContentIdConflict as e, ContentNotFound as t, ContentValidationFailed as n, RevisionMismatch as r } from "./errors.js";
|
|
2
|
+
import { asTyped as i } from "./effectForm.js";
|
|
3
3
|
import { saveDraft as a } from "./write.js";
|
|
4
4
|
import { and as o, eq as s, id as c, table as l, text as u, timestamp as d } from "@voltro/database";
|
|
5
5
|
import { tenant as f } from "@voltro/plugin-multitenancy/mixin";
|
|
6
|
-
|
|
6
|
+
// src/copies.ts
|
|
7
7
|
var p = "cms_copies", m = l(p, {
|
|
8
8
|
id: c({ prefix: "ccpy" }),
|
|
9
9
|
contentType: u().maxLength(64),
|
|
@@ -84,6 +84,5 @@ var p = "cms_copies", m = l(p, {
|
|
|
84
84
|
})).map((e) => ({
|
|
85
85
|
...b(e),
|
|
86
86
|
documentId: String(e.documentId)
|
|
87
|
-
})), S = (...a) =>
|
|
88
|
-
//#endregion
|
|
87
|
+
})), S = (...a) => i(() => v(...a), n, t, e, r), C = (...e) => i(() => y(...e)), w = (...e) => i(() => x(...e));
|
|
89
88
|
export { p as CMS_COPIES_TABLE, m as cmsCopiesTable, x as copiesOf, w as copiesOfEffect, v as copyDocument, S as copyDocumentEffect, y as copyOrigin, C as copyOriginEffect };
|
package/dist/cutover.js
CHANGED
|
@@ -2,7 +2,7 @@ import { asTyped as e } from "./effectForm.js";
|
|
|
2
2
|
import { CMS_REVISIONS_TABLE as t } from "./contentType.js";
|
|
3
3
|
import { and as n, eq as r, gt as i, id as a, inSet as o, json as s, table as c, text as l, timestamp as u } from "@voltro/database";
|
|
4
4
|
import { tenant as d } from "@voltro/plugin-multitenancy/mixin";
|
|
5
|
-
|
|
5
|
+
// src/cutover.ts
|
|
6
6
|
var f = "cms_cutover_issues", p = "cms_cutover_decisions", m = c(f, {
|
|
7
7
|
id: a({ prefix: "ccis" }),
|
|
8
8
|
source: l().maxLength(200),
|
|
@@ -198,5 +198,4 @@ var f = "cms_cutover_issues", p = "cms_cutover_decisions", m = c(f, {
|
|
|
198
198
|
decidedBy: String(e.decidedBy),
|
|
199
199
|
decidedAt: e.decidedAt instanceof Date ? e.decidedAt : new Date(String(e.decidedAt))
|
|
200
200
|
})), E = (...t) => e(() => b(...t)), D = (...t) => e(() => x(...t)), O = (...t) => e(() => S(...t)), k = (...t) => e(() => C(...t)), A = (...t) => e(() => w(...t)), j = (...t) => e(() => T(...t));
|
|
201
|
-
//#endregion
|
|
202
201
|
export { p as CMS_CUTOVER_DECISIONS_TABLE, f as CMS_CUTOVER_ISSUES_TABLE, g as MAX_ROLLBACK_DAYS, h as cmsCutoverDecisionsTable, m as cmsCutoverIssuesTable, C as cutoverAdoption, k as cutoverAdoptionEffect, T as cutoverDecisions, j as cutoverDecisionsEffect, x as cutoverIssues, D as cutoverIssuesEffect, _ as cutoverPlanProblem, w as decideCutover, A as decideCutoverEffect, v as evaluateCutover, b as recordCutoverIssues, E as recordCutoverIssuesEffect, S as resolveCutoverIssue, O as resolveCutoverIssueEffect };
|
package/dist/deliveryChecks.js
CHANGED
|
@@ -2,7 +2,7 @@ import { asTyped as e } from "./effectForm.js";
|
|
|
2
2
|
import { CMS_RELEASES_TABLE as t, CMS_RELEASE_ITEMS_TABLE as n } from "./release.js";
|
|
3
3
|
import { and as r, eq as i, id as a, integer as o, table as s, text as c, timestamp as l } from "@voltro/database";
|
|
4
4
|
import { tenant as u } from "@voltro/plugin-multitenancy/mixin";
|
|
5
|
-
|
|
5
|
+
// src/deliveryChecks.ts
|
|
6
6
|
var d = "cms_delivery_checks", f = s(d, {
|
|
7
7
|
id: a({ prefix: "cdlv" }),
|
|
8
8
|
contentType: c().maxLength(64),
|
|
@@ -134,5 +134,4 @@ var d = "cms_delivery_checks", f = s(d, {
|
|
|
134
134
|
complete: u.length > 0 && f === u.length
|
|
135
135
|
};
|
|
136
136
|
}, b = (...t) => e(() => h(...t)), x = (...t) => e(() => g(...t)), S = (...t) => e(() => _(...t)), C = (...t) => e(() => y(...t));
|
|
137
|
-
//#endregion
|
|
138
137
|
export { d as CMS_DELIVERY_CHECKS_TABLE, f as cmsDeliveryChecksTable, _ as deliveryChecks, S as deliveryChecksEffect, y as releaseCheckpoint, C as releaseCheckpointEffect, h as requestDeliveryCheck, b as requestDeliveryCheckEffect, g as runDeliveryChecks, x as runDeliveryChecksEffect };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// src/domainHost.ts
|
|
2
|
+
var e = /^(?=.{1,253}$)(?!-)[a-z0-9-]{1,63}(?<!-)(\.(?!-)[a-z0-9-]{1,63}(?<!-))+$/, t = (t) => {
|
|
3
|
+
let n = t.trim().toLowerCase().replace(/\.$/, "");
|
|
4
|
+
return e.test(n) && !/^\d+(\.\d+){3}$/.test(n) ? n : null;
|
|
5
|
+
};
|
|
6
|
+
export { t as normalizeHost };
|
package/dist/domains.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { PublicRouteRegistryUnavailable as e } from "./publicRouteRegistry.js";
|
|
2
|
+
import { ChangeFeedUnavailable as t, SiteStateUnavailable as n } from "./errors.js";
|
|
3
|
+
import { asTyped as r } from "./effectForm.js";
|
|
4
|
+
import { copySiteScope as i, lockSiteState as a, siteStatePredicate as o } from "./siteState.js";
|
|
5
|
+
import { normalizeHost as s } from "./domainHost.js";
|
|
6
|
+
import { withPublicRouteStateMutation as c } from "./publicRouteMutation.js";
|
|
7
|
+
import { reconcileDomainPublication as l } from "./publicRouteSitePublication.js";
|
|
8
|
+
import { and as u, boolean as d, eq as f, id as p, table as m, text as h, timestamp as g } from "@voltro/database";
|
|
9
|
+
import { tenant as _ } from "@voltro/plugin-multitenancy/mixin";
|
|
10
|
+
import { randomBytes as v } from "node:crypto";
|
|
11
|
+
// src/domains.ts
|
|
12
|
+
var y = "cms_site_domains", b = m(y, {
|
|
13
|
+
id: p({ prefix: "cdom" }),
|
|
14
|
+
site: h().maxLength(64),
|
|
15
|
+
host: h().maxLength(253),
|
|
16
|
+
token: h().maxLength(64),
|
|
17
|
+
status: h().oneOf(["pending", "verified"]),
|
|
18
|
+
verifiedAt: g().nullable(),
|
|
19
|
+
isPrimary: d().default(!1)
|
|
20
|
+
}).with(_()).unique("cms_site_domains_host", ["host"]), x = (e) => ({
|
|
18
21
|
id: String(e.id),
|
|
19
22
|
site: String(e.site),
|
|
20
23
|
host: String(e.host),
|
|
@@ -25,9 +28,9 @@ var u = "cms_site_domains", d = a(u, {
|
|
|
25
28
|
name: `_voltro-verify.${String(e.host)}`,
|
|
26
29
|
value: `voltro-verify=${String(e.token)}`
|
|
27
30
|
}
|
|
28
|
-
}),
|
|
29
|
-
table:
|
|
30
|
-
predicate:
|
|
31
|
+
}), S = async (e, t) => (await e.query({
|
|
32
|
+
table: y,
|
|
33
|
+
predicate: o(i(t)),
|
|
31
34
|
order: [{
|
|
32
35
|
column: "host",
|
|
33
36
|
direction: "asc"
|
|
@@ -35,111 +38,101 @@ var u = "cms_site_domains", d = a(u, {
|
|
|
35
38
|
take: 100,
|
|
36
39
|
skip: void 0,
|
|
37
40
|
projection: void 0
|
|
38
|
-
})).map(
|
|
39
|
-
let i =
|
|
40
|
-
if (
|
|
41
|
+
})).map(x).sort((e, t) => Number(t.primary) - Number(e.primary)), C = async (e, t, n) => {
|
|
42
|
+
let r = i(t), o = s(n);
|
|
43
|
+
if (o === null) return {
|
|
41
44
|
ok: !1,
|
|
42
45
|
reason: "notAHost"
|
|
43
46
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
return
|
|
54
|
-
ok: !0,
|
|
55
|
-
domain: m(await e.insert(u, {
|
|
56
|
-
site: t,
|
|
57
|
-
host: i,
|
|
58
|
-
token: l(16).toString("hex"),
|
|
59
|
-
status: "pending",
|
|
60
|
-
verifiedAt: null,
|
|
61
|
-
isPrimary: !1
|
|
62
|
-
}))
|
|
63
|
-
} : {
|
|
47
|
+
await a(e, r);
|
|
48
|
+
let c = await e.insertIgnoreWithOutcome(y, {
|
|
49
|
+
...r,
|
|
50
|
+
host: o,
|
|
51
|
+
token: v(16).toString("hex"),
|
|
52
|
+
status: "pending",
|
|
53
|
+
verifiedAt: null,
|
|
54
|
+
isPrimary: !1
|
|
55
|
+
}, { conflictColumns: ["host"] });
|
|
56
|
+
return c.outcome === "ignored" ? {
|
|
64
57
|
ok: !1,
|
|
65
58
|
reason: "taken"
|
|
59
|
+
} : {
|
|
60
|
+
ok: !0,
|
|
61
|
+
domain: x(c.row)
|
|
66
62
|
};
|
|
67
|
-
},
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
}, w = async (e, t, n) => {
|
|
64
|
+
let r = i(t);
|
|
65
|
+
await a(e, r);
|
|
66
|
+
let [s] = await e.query({
|
|
67
|
+
table: y,
|
|
68
|
+
predicate: u(o(r), f("id", n)),
|
|
69
|
+
lock: "update",
|
|
71
70
|
order: [],
|
|
72
71
|
take: 1,
|
|
73
72
|
skip: void 0,
|
|
74
73
|
projection: void 0
|
|
75
74
|
});
|
|
75
|
+
return s;
|
|
76
|
+
}, T = async (e, t, n, r, i = /* @__PURE__ */ new Date()) => {
|
|
77
|
+
let a = await w(e, t, n);
|
|
76
78
|
if (a === void 0) return {
|
|
77
79
|
ok: !1,
|
|
78
80
|
reason: "notFound"
|
|
79
81
|
};
|
|
80
|
-
let o =
|
|
82
|
+
let o = x(a);
|
|
81
83
|
if (o.status === "verified") return {
|
|
82
84
|
ok: !0,
|
|
83
85
|
domain: o
|
|
84
86
|
};
|
|
85
|
-
let s = await
|
|
86
|
-
return s.some((e) => e.trim() === o.record.value) ? {
|
|
87
|
-
|
|
88
|
-
domain: m(await e.update(u, t, {
|
|
87
|
+
let s = await r(o.record.name).catch(() => []);
|
|
88
|
+
return s.some((e) => e.trim() === o.record.value) ? c(e, async () => {
|
|
89
|
+
let r = await e.update(y, n, {
|
|
89
90
|
status: "verified",
|
|
90
91
|
verifiedAt: i
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
});
|
|
93
|
+
return await l(e, t), {
|
|
94
|
+
ok: !0,
|
|
95
|
+
domain: x(r ?? {
|
|
96
|
+
...a,
|
|
97
|
+
status: "verified",
|
|
98
|
+
verifiedAt: i
|
|
99
|
+
})
|
|
100
|
+
};
|
|
101
|
+
}) : {
|
|
97
102
|
ok: !1,
|
|
98
103
|
reason: "recordMissing",
|
|
99
104
|
found: s
|
|
100
105
|
};
|
|
101
|
-
},
|
|
102
|
-
let
|
|
103
|
-
|
|
104
|
-
predicate: r("id", n),
|
|
105
|
-
order: [],
|
|
106
|
-
take: 1,
|
|
107
|
-
skip: void 0,
|
|
108
|
-
projection: void 0
|
|
109
|
-
});
|
|
110
|
-
return i === void 0 ? {
|
|
106
|
+
}, E = async (e, t, n) => {
|
|
107
|
+
let r = await w(e, t, n);
|
|
108
|
+
return r === void 0 ? {
|
|
111
109
|
ok: !1,
|
|
112
110
|
reason: "notFound"
|
|
113
|
-
} :
|
|
111
|
+
} : r.status === "verified" ? c(e, async () => (await e.updateMany(y, { isPrimary: !1 }, { where: u(o({
|
|
112
|
+
tenantId: String(r.tenantId),
|
|
113
|
+
site: String(r.site)
|
|
114
|
+
}), f("isPrimary", !0)) }), await e.update(y, n, { isPrimary: !0 }), await l(e, t), { ok: !0 })) : {
|
|
114
115
|
ok: !1,
|
|
115
116
|
reason: "notVerified"
|
|
116
117
|
};
|
|
117
|
-
},
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
predicate: r("id", t),
|
|
121
|
-
order: [],
|
|
122
|
-
take: 1,
|
|
123
|
-
skip: void 0,
|
|
124
|
-
projection: void 0
|
|
125
|
-
});
|
|
126
|
-
return n === void 0 ? {
|
|
118
|
+
}, D = async (e, t, n) => {
|
|
119
|
+
let r = await w(e, t, n);
|
|
120
|
+
return r === void 0 ? {
|
|
127
121
|
ok: !1,
|
|
128
122
|
reason: "notFound"
|
|
129
|
-
} :
|
|
123
|
+
} : r.isPrimary === !0 ? {
|
|
130
124
|
ok: !1,
|
|
131
125
|
reason: "primary"
|
|
132
|
-
} : (await e.delete(
|
|
133
|
-
},
|
|
134
|
-
let [
|
|
135
|
-
table:
|
|
136
|
-
predicate: t(
|
|
126
|
+
} : c(e, async () => (await e.delete(y, n), r.status === "verified" && await l(e, t), { ok: !0 }));
|
|
127
|
+
}, O = async (e, t) => {
|
|
128
|
+
let [n] = await e.query({
|
|
129
|
+
table: y,
|
|
130
|
+
predicate: u(o(i(t)), f("status", "verified"), f("isPrimary", !0)),
|
|
137
131
|
order: [],
|
|
138
132
|
take: 1,
|
|
139
133
|
skip: void 0,
|
|
140
134
|
projection: void 0
|
|
141
135
|
});
|
|
142
|
-
return
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
export { u as CMS_SITE_DOMAINS_TABLE, g as addDomain, S as addDomainEffect, d as cmsSiteDomainsTable, p as normalizeHost, b as primaryDomain, E as primaryDomainEffect, y as removeDomain, T as removeDomainEffect, v as setPrimaryDomain, w as setPrimaryDomainEffect, h as siteDomains, x as siteDomainsEffect, _ as verifyDomain, C as verifyDomainEffect };
|
|
136
|
+
return n === void 0 ? null : String(n.host);
|
|
137
|
+
}, k = (...e) => r(() => S(...e), n), A = (...e) => r(() => C(...e), n), j = (...i) => r(() => T(...i), n, t, e), M = (...i) => r(() => E(...i), n, t, e), N = (...i) => r(() => D(...i), n, t, e), P = (...e) => r(() => O(...e), n);
|
|
138
|
+
export { y as CMS_SITE_DOMAINS_TABLE, C as addDomain, A as addDomainEffect, b as cmsSiteDomainsTable, s as normalizeHost, O as primaryDomain, P as primaryDomainEffect, D as removeDomain, N as removeDomainEffect, E as setPrimaryDomain, M as setPrimaryDomainEffect, S as siteDomains, k as siteDomainsEffect, T as verifyDomain, j as verifyDomainEffect };
|