riverbankcms 0.29.0 → 0.30.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/dist/acceptance/matrix.mjs +17 -3
- package/dist/cli/index.mjs +74354 -29516
- package/dist/cli/init-docs/content/cli-reference.md +22 -0
- package/dist/{entryCommands-5kz7nIFG.mjs → entryCommands-DqqGit0l.mjs} +15303 -10582
- package/dist/{eventUpsertInputSchema-DEN6k1oM.mjs → eventUpsertInputSchema-EGy8zFUx.mjs} +24 -106
- package/dist/load-config-3e2Npz2O.mjs +4 -0
- package/dist/{load-config-JcidEUjc.mjs → load-config-Dgw0C6y3.mjs} +2 -2
- package/dist/{plan-BppGb0gS.mjs → plan-cE7TKMc1.mjs} +1 -1
- package/dist/scaffold/index.mjs +2 -2
- package/dist/sdk-event-upsert-mPJpEQ2x.mjs +15022 -0
- package/dist/{src-4CBCWovR.mjs → src-DOwrYdTk.mjs} +27 -6
- package/dist/testing.mjs +4 -4
- package/package.json +1 -1
- package/dist/load-config-DkoaFO1t.mjs +0 -4
- package/dist/sdk-event-upsert-CXc13KPT.mjs +0 -63038
|
@@ -1,34 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { m as EVENT_PRESET_VALUES, r as isRecord$
|
|
2
|
+
import { Pn as ICON_PICKER_PRESETS, a as classifySdkEventSchedule, g as normalizeLinkValue, h as linkSchema, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer, s as RESOLVED_INTERNAL_LINK_ENTITY_TYPES } from "./sdk-event-upsert-mPJpEQ2x.mjs";
|
|
3
|
+
import { m as EVENT_PRESET_VALUES, r as isRecord$3 } from "./src-DOwrYdTk.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
|
-
//#region ../
|
|
7
|
-
/**
|
|
8
|
-
* Strict record guard: excludes null, primitives, and arrays.
|
|
9
|
-
*/
|
|
10
|
-
function isRecord$3(value) {
|
|
11
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Non-null object guard: includes arrays for behavior parity with legacy helpers.
|
|
15
|
-
*
|
|
16
|
-
* NOTE: This intentionally narrows to UnknownRecord for compatibility with existing
|
|
17
|
-
* callsites even though arrays pass at runtime. Follow-up cleanup should replace
|
|
18
|
-
* this API with a more precise predicate type and migrate consumers.
|
|
19
|
-
*/
|
|
20
|
-
function isObjectRecord(value) {
|
|
21
|
-
return typeof value === "object" && value !== null;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Coerces unknown input into a strict record, returning an empty object fallback.
|
|
25
|
-
*/
|
|
26
|
-
function asRecord(value) {
|
|
27
|
-
return isRecord$3(value) ? value : {};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region ../blocks/src/primitives/content/utils/sanitizeHref.ts
|
|
6
|
+
//#region ../core/src/rich-text-href.ts
|
|
32
7
|
const SAFE_PROTOCOLS = new Set([
|
|
33
8
|
"http:",
|
|
34
9
|
"https:",
|
|
@@ -68,9 +43,9 @@ function sanitizeHref(raw) {
|
|
|
68
43
|
function sanitizeAbsoluteHref(normalized) {
|
|
69
44
|
const decoded = normalizeInput(decodeForSchemeCheck(normalized));
|
|
70
45
|
const schemeMatch = decoded.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
|
|
71
|
-
if (
|
|
46
|
+
if (schemeMatch === null) return null;
|
|
72
47
|
const rawScheme = schemeMatch[1];
|
|
73
|
-
if (
|
|
48
|
+
if (rawScheme === undefined || rawScheme.length === 0) return null;
|
|
74
49
|
const protocol = `${rawScheme.toLowerCase()}:`;
|
|
75
50
|
if (!SAFE_PROTOCOLS.has(protocol)) return null;
|
|
76
51
|
try {
|
|
@@ -90,7 +65,7 @@ function isSafeRichTextHref(raw) {
|
|
|
90
65
|
}
|
|
91
66
|
|
|
92
67
|
//#endregion
|
|
93
|
-
//#region ../
|
|
68
|
+
//#region ../core/src/rich-text-authoring.ts
|
|
94
69
|
const optionalText = z.string().max(2048).nullable().optional();
|
|
95
70
|
const destination = z.string().max(2048).refine(isSafeRichTextHref, "Use http, https, mailto, tel, a single-root-relative path or a #fragment without controls or backslashes");
|
|
96
71
|
const linkAttributes = z.object({
|
|
@@ -252,7 +227,7 @@ function treeSize(value, depth = 0) {
|
|
|
252
227
|
nodes: 0,
|
|
253
228
|
text: 0
|
|
254
229
|
};
|
|
255
|
-
if (!isRecord$
|
|
230
|
+
if (!isRecord$3(value)) return {
|
|
256
231
|
depth,
|
|
257
232
|
nodes: 0,
|
|
258
233
|
text: 0
|
|
@@ -381,7 +356,7 @@ function richTextEditingBudget(doc) {
|
|
|
381
356
|
}
|
|
382
357
|
|
|
383
358
|
//#endregion
|
|
384
|
-
//#region ../
|
|
359
|
+
//#region ../core/src/rich-text-schema.ts
|
|
385
360
|
/**
|
|
386
361
|
* Shared Rich Text Schema
|
|
387
362
|
*
|
|
@@ -492,82 +467,26 @@ function createRichTextDoc(paragraphs) {
|
|
|
492
467
|
} : { type: "paragraph" })
|
|
493
468
|
};
|
|
494
469
|
}
|
|
495
|
-
function createHardBreakNode() {
|
|
496
|
-
return { type: "hardBreak" };
|
|
497
|
-
}
|
|
498
470
|
/**
|
|
499
|
-
*
|
|
471
|
+
* Build Zod validation schema for rich text fields
|
|
500
472
|
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
type: "text",
|
|
510
|
-
text: value,
|
|
511
|
-
marks
|
|
512
|
-
} : {
|
|
513
|
-
type: "text",
|
|
514
|
-
text: value
|
|
515
|
-
});
|
|
516
|
-
};
|
|
517
|
-
let rest = text;
|
|
518
|
-
while (rest.length > 0) {
|
|
519
|
-
const start = rest.indexOf("**");
|
|
520
|
-
if (start === -1) {
|
|
521
|
-
pushText(rest);
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
const end = rest.indexOf("**", start + 2);
|
|
525
|
-
if (end === -1) {
|
|
526
|
-
pushText(rest);
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
pushText(rest.slice(0, start));
|
|
530
|
-
pushText(rest.slice(start + 2, end), [{ type: "bold" }]);
|
|
531
|
-
rest = rest.slice(end + 2);
|
|
532
|
-
}
|
|
533
|
-
return out;
|
|
534
|
-
}
|
|
535
|
-
function parseRichTextParagraphInlineMarkdown(text) {
|
|
536
|
-
return text.split("\n").flatMap((line, index) => {
|
|
537
|
-
const lineNodes = parseRichTextInlineMarkdown(line.trim());
|
|
538
|
-
return index === 0 ? lineNodes : [createHardBreakNode(), ...lineNodes];
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* Convert a plain string with a tiny markdown subset to canonical TipTap JSON.
|
|
473
|
+
* @param options - Optional configuration
|
|
474
|
+
* @param options.required - If true, validates that content is not empty
|
|
475
|
+
* @param options.label - Field label for error messages (defaults to 'This field')
|
|
476
|
+
* @returns Zod schema for rich text validation
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* // Basic usage
|
|
480
|
+
* const schema = buildRichTextSchema()
|
|
543
481
|
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
482
|
+
* @example
|
|
483
|
+
* // Required field with custom label
|
|
484
|
+
* const schema = buildRichTextSchema({ required: true, label: 'Description' })
|
|
547
485
|
*/
|
|
548
|
-
function createRichTextDocFromMarkdown(markdown) {
|
|
549
|
-
const normalized = markdown.replace(/\r\n/g, "\n").trim();
|
|
550
|
-
if (!normalized) return {
|
|
551
|
-
type: "doc",
|
|
552
|
-
content: []
|
|
553
|
-
};
|
|
554
|
-
const paragraphs = normalized.split(/\n{2,}/).map((paragraph) => paragraph.trim()).filter(Boolean);
|
|
555
|
-
return {
|
|
556
|
-
type: "doc",
|
|
557
|
-
content: paragraphs.map((paragraph) => {
|
|
558
|
-
const inline = parseRichTextParagraphInlineMarkdown(paragraph);
|
|
559
|
-
return inline.length > 0 ? {
|
|
560
|
-
type: "paragraph",
|
|
561
|
-
content: inline
|
|
562
|
-
} : { type: "paragraph" };
|
|
563
|
-
})
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
486
|
function buildRichTextSchema(options) {
|
|
567
|
-
|
|
568
|
-
if (options?.required) {
|
|
487
|
+
if (options?.required === true) {
|
|
569
488
|
const label = options.label ?? "This field";
|
|
570
|
-
|
|
489
|
+
return RichTextDocSchema.refine((val) => {
|
|
571
490
|
const content = val.content;
|
|
572
491
|
if (!Array.isArray(content) || content.length === 0) return false;
|
|
573
492
|
const first = content[0];
|
|
@@ -577,7 +496,7 @@ function buildRichTextSchema(options) {
|
|
|
577
496
|
return true;
|
|
578
497
|
}, { message: `${label} is required` });
|
|
579
498
|
}
|
|
580
|
-
return
|
|
499
|
+
return RichTextDocSchema;
|
|
581
500
|
}
|
|
582
501
|
|
|
583
502
|
//#endregion
|
|
@@ -1118,7 +1037,6 @@ function parseReferenceKind(referenceKind) {
|
|
|
1118
1037
|
|
|
1119
1038
|
//#endregion
|
|
1120
1039
|
//#region ../content-model/src/contentManifest.ts
|
|
1121
|
-
const CONTENT_MODEL_ICON_PICKER_PRESETS = ["cta", "feature"];
|
|
1122
1040
|
function assertNever$1(value) {
|
|
1123
1041
|
throw new Error(`Unhandled content field mapping decision: ${JSON.stringify(value)}`);
|
|
1124
1042
|
}
|
|
@@ -5183,4 +5101,4 @@ const eventUpsertInputSchema = z.object({
|
|
|
5183
5101
|
}));
|
|
5184
5102
|
|
|
5185
5103
|
//#endregion
|
|
5186
|
-
export { RichTextDocSchema as a,
|
|
5104
|
+
export { RichTextDocSchema as a, findUnfilledSentinels as i, buildEntryScaffold as n, isRichTextDoc as o, validateEntryInstance as r, sanitizeHref as s, eventUpsertInputSchema as t };
|
|
@@ -7,7 +7,7 @@ import { existsSync as existsSync$1 } from "fs";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
|
-
var version = "0.
|
|
10
|
+
var version = "0.30.0";
|
|
11
11
|
var peerDependencies = { "@riverbankcms/sdk": ">=0.157.0 <1.0.0" };
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "riverbankcms",
|
|
@@ -93,7 +93,7 @@ var package_default = {
|
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/version.ts
|
|
95
95
|
/** The package manifest is the source-run fallback; builds inject this value. */
|
|
96
|
-
const CLI_VERSION = typeof "0.
|
|
96
|
+
const CLI_VERSION = typeof "0.30.0" === "string" ? "0.30.0" : version;
|
|
97
97
|
/**
|
|
98
98
|
* The CLI's SDK peer range is bundled from the CLI manifest alongside its
|
|
99
99
|
* version. Runtime config loading uses this value as the single compatibility
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { Zn as parseSiteId, cr as err, lr as ok } from "./src-DOwrYdTk.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
package/dist/scaffold/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../src-
|
|
3
|
-
import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-
|
|
2
|
+
import "../src-DOwrYdTk.mjs";
|
|
3
|
+
import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-cE7TKMc1.mjs";
|
|
4
4
|
|
|
5
5
|
export { deriveGeneratedPackageRanges, deriveScaffoldLocalManifest, deriveScaffoldPlan, findPackageManifestPath, loadGeneratedPackageRanges, preflightScaffoldPlan, preflightScaffoldTargets, prepareScaffoldExecution, writeScaffoldFiles };
|