riverbankcms 0.27.0 → 0.28.1
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 +3 -3
- package/dist/cli/index.mjs +3040 -5001
- package/dist/{entryCommands-Dg5IT7Uv.mjs → entryCommands-CrfobcW7.mjs} +2938 -363
- package/dist/{eventUpsertInputSchema-D4xpVjUT.mjs → eventUpsertInputSchema-R2GbOsj2.mjs} +372 -45
- package/dist/load-config-BB5L2u1y.mjs +4 -0
- package/dist/{load-config-DsPKn5yN.mjs → load-config-DTbiJyCf.mjs} +16 -6
- package/dist/{plan-oltx4aO0.mjs → plan-DJfyedxU.mjs} +1 -1
- package/dist/scaffold/index.mjs +2 -2
- package/dist/{sdk-event-upsert-CnvVuQJy.mjs → sdk-event-upsert-4Dn75Ui9.mjs} +5667 -2259
- package/dist/{src-DqoU7zKs.mjs → src-nzVzuMR1.mjs} +591 -352
- package/dist/testing.mjs +4 -4
- package/package.json +1 -1
- package/dist/load-config-BcATOVmw.mjs +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as normalizeLinkValue, a as classifySdkEventSchedule, g as linkSchema, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer } from "./sdk-event-upsert-
|
|
3
|
-
import {
|
|
2
|
+
import { _ as normalizeLinkValue, a as classifySdkEventSchedule, g as linkSchema, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer, s as RESOLVED_INTERNAL_LINK_ENTITY_TYPES } from "./sdk-event-upsert-4Dn75Ui9.mjs";
|
|
3
|
+
import { m as EVENT_PRESET_VALUES, r as isRecord$4 } from "./src-nzVzuMR1.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region ../blocks/src/lib/typeGuards.ts
|
|
@@ -27,6 +27,359 @@ function asRecord(value) {
|
|
|
27
27
|
return isRecord$3(value) ? value : {};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../blocks/src/primitives/content/utils/sanitizeHref.ts
|
|
32
|
+
const SAFE_PROTOCOLS = new Set([
|
|
33
|
+
"http:",
|
|
34
|
+
"https:",
|
|
35
|
+
"mailto:",
|
|
36
|
+
"tel:"
|
|
37
|
+
]);
|
|
38
|
+
const CONTROL_CHARS_PATTERN = /[\u0000-\u001F\u007F]+/g;
|
|
39
|
+
function normalizeInput(value) {
|
|
40
|
+
return value.replace(CONTROL_CHARS_PATTERN, "").trim();
|
|
41
|
+
}
|
|
42
|
+
function decodeForSchemeCheck(value) {
|
|
43
|
+
try {
|
|
44
|
+
return decodeURIComponent(value);
|
|
45
|
+
} catch {
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns a safe href for rich-text anchors, or null when the value should not be rendered.
|
|
51
|
+
*
|
|
52
|
+
* Policy:
|
|
53
|
+
* - Allow absolute URLs with protocols: http, https, mailto, tel.
|
|
54
|
+
* - Allow root-relative ("/path") and hash-only ("#section") links.
|
|
55
|
+
* - Reject protocol-relative URLs ("//example.com"), bare domains ("example.com"),
|
|
56
|
+
* backslashes, executable schemes (javascript/data/vbscript), malformed URLs, and empty values.
|
|
57
|
+
* - Preserve percent-encoding from the original normalized input.
|
|
58
|
+
*/
|
|
59
|
+
function sanitizeHref(raw) {
|
|
60
|
+
if (typeof raw !== "string") return null;
|
|
61
|
+
const normalized = normalizeInput(raw);
|
|
62
|
+
if (!normalized) return null;
|
|
63
|
+
if (normalized.includes("\\") || normalized.startsWith("//")) return null;
|
|
64
|
+
if (normalized.startsWith("/")) return normalized;
|
|
65
|
+
if (normalized.startsWith("#")) return normalized;
|
|
66
|
+
return sanitizeAbsoluteHref(normalized);
|
|
67
|
+
}
|
|
68
|
+
function sanitizeAbsoluteHref(normalized) {
|
|
69
|
+
const decoded = normalizeInput(decodeForSchemeCheck(normalized));
|
|
70
|
+
const schemeMatch = decoded.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
|
|
71
|
+
if (!schemeMatch) return null;
|
|
72
|
+
const rawScheme = schemeMatch[1];
|
|
73
|
+
if (!rawScheme) return null;
|
|
74
|
+
const protocol = `${rawScheme.toLowerCase()}:`;
|
|
75
|
+
if (!SAFE_PROTOCOLS.has(protocol)) return null;
|
|
76
|
+
try {
|
|
77
|
+
const parsed = new URL(normalized);
|
|
78
|
+
if (!SAFE_PROTOCOLS.has(parsed.protocol.toLowerCase())) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return normalized;
|
|
85
|
+
}
|
|
86
|
+
/** Strict authoring admission; existing stored links keep the renderer's normalization. */
|
|
87
|
+
function isSafeRichTextHref(raw) {
|
|
88
|
+
const decoded = decodeForSchemeCheck(raw);
|
|
89
|
+
return !/[\u0000-\u001F\u007F\\]/.test(decoded) && !decoded.startsWith("//") && sanitizeHref(raw) === raw;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region ../blocks/src/system/manifest/richTextAuthoring.ts
|
|
94
|
+
const optionalText = z.string().max(2048).nullable().optional();
|
|
95
|
+
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
|
+
const linkAttributes = z.object({
|
|
97
|
+
href: destination.nullable().optional(),
|
|
98
|
+
target: z.enum([
|
|
99
|
+
"_blank",
|
|
100
|
+
"_self",
|
|
101
|
+
"_parent",
|
|
102
|
+
"_top"
|
|
103
|
+
]).nullable().optional(),
|
|
104
|
+
rel: optionalText,
|
|
105
|
+
class: optionalText,
|
|
106
|
+
kind: z.enum([
|
|
107
|
+
"internal",
|
|
108
|
+
"page",
|
|
109
|
+
"entry",
|
|
110
|
+
"external",
|
|
111
|
+
"url"
|
|
112
|
+
]).nullable().optional(),
|
|
113
|
+
identifier: optionalText,
|
|
114
|
+
contentType: optionalText,
|
|
115
|
+
routeId: optionalText,
|
|
116
|
+
entityId: optionalText,
|
|
117
|
+
entityType: z.enum(RESOLVED_INTERNAL_LINK_ENTITY_TYPES).nullable().optional(),
|
|
118
|
+
title: optionalText,
|
|
119
|
+
typeLabel: optionalText,
|
|
120
|
+
contentTypeKey: optionalText,
|
|
121
|
+
contentTypeName: optionalText,
|
|
122
|
+
updatedAt: optionalText
|
|
123
|
+
}).strict().refine((attrs) => Boolean(attrs.href) || (attrs.kind === "internal" || attrs.kind === "page" || attrs.kind === "entry") && [attrs.routeId, attrs.identifier].some((value) => typeof value === "string" && value.trim().length > 0), {
|
|
124
|
+
message: "Links require a safe href, or an internal kind with a routeId or identifier",
|
|
125
|
+
path: ["href"]
|
|
126
|
+
});
|
|
127
|
+
const noAttributes = z.object({}).strict().optional();
|
|
128
|
+
const markSchema = z.discriminatedUnion("type", [
|
|
129
|
+
z.object({
|
|
130
|
+
type: z.literal("bold"),
|
|
131
|
+
attrs: noAttributes
|
|
132
|
+
}).strict(),
|
|
133
|
+
z.object({
|
|
134
|
+
type: z.literal("italic"),
|
|
135
|
+
attrs: noAttributes
|
|
136
|
+
}).strict(),
|
|
137
|
+
z.object({
|
|
138
|
+
type: z.literal("strike"),
|
|
139
|
+
attrs: noAttributes
|
|
140
|
+
}).strict(),
|
|
141
|
+
z.object({
|
|
142
|
+
type: z.literal("code"),
|
|
143
|
+
attrs: noAttributes
|
|
144
|
+
}).strict(),
|
|
145
|
+
z.object({
|
|
146
|
+
type: z.literal("link"),
|
|
147
|
+
attrs: linkAttributes
|
|
148
|
+
}).strict()
|
|
149
|
+
]);
|
|
150
|
+
const marksSchema = z.array(markSchema).max(5).superRefine((marks, ctx) => {
|
|
151
|
+
if (new Set(marks.map((mark) => mark.type)).size !== marks.length) {
|
|
152
|
+
ctx.addIssue({
|
|
153
|
+
code: "custom",
|
|
154
|
+
message: "Use each mark type at most once"
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
if (marks.some((mark) => mark.type === "code") && marks.length !== 1) {
|
|
158
|
+
ctx.addIssue({
|
|
159
|
+
code: "custom",
|
|
160
|
+
message: "Code cannot be combined with other marks"
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
const textSchema = z.object({
|
|
165
|
+
type: z.literal("text"),
|
|
166
|
+
text: z.string().min(1).max(5e4),
|
|
167
|
+
marks: marksSchema.optional()
|
|
168
|
+
}).strict();
|
|
169
|
+
const hardBreakSchema = z.object({
|
|
170
|
+
type: z.literal("hardBreak"),
|
|
171
|
+
attrs: noAttributes
|
|
172
|
+
}).strict();
|
|
173
|
+
const inlineSchema = z.discriminatedUnion("type", [textSchema, hardBreakSchema]);
|
|
174
|
+
const paragraphSchema = z.object({
|
|
175
|
+
type: z.literal("paragraph"),
|
|
176
|
+
attrs: noAttributes,
|
|
177
|
+
content: z.array(inlineSchema).max(1e3).optional()
|
|
178
|
+
}).strict();
|
|
179
|
+
const headingSchema = z.object({
|
|
180
|
+
type: z.literal("heading"),
|
|
181
|
+
attrs: z.object({ level: z.union([
|
|
182
|
+
z.literal(1),
|
|
183
|
+
z.literal(2),
|
|
184
|
+
z.literal(3),
|
|
185
|
+
z.literal(4),
|
|
186
|
+
z.literal(5)
|
|
187
|
+
]) }).strict(),
|
|
188
|
+
content: z.array(inlineSchema).max(1e3).optional()
|
|
189
|
+
}).strict();
|
|
190
|
+
const codeBlockSchema = z.object({
|
|
191
|
+
type: z.literal("codeBlock"),
|
|
192
|
+
attrs: z.object({ language: optionalText }).strict().optional(),
|
|
193
|
+
content: z.array(z.object({
|
|
194
|
+
type: z.literal("text"),
|
|
195
|
+
text: z.string().min(1).max(5e4)
|
|
196
|
+
}).strict()).max(1e3).optional()
|
|
197
|
+
}).strict();
|
|
198
|
+
const imageSchema = z.object({
|
|
199
|
+
type: z.literal("image"),
|
|
200
|
+
attrs: z.object({
|
|
201
|
+
src: destination.nullable().optional(),
|
|
202
|
+
identifier: optionalText,
|
|
203
|
+
alt: optionalText,
|
|
204
|
+
title: optionalText,
|
|
205
|
+
width: z.number().positive().nullable().optional(),
|
|
206
|
+
height: z.number().positive().nullable().optional()
|
|
207
|
+
}).strict()
|
|
208
|
+
}).strict();
|
|
209
|
+
const horizontalRuleSchema = z.object({
|
|
210
|
+
type: z.literal("horizontalRule"),
|
|
211
|
+
attrs: noAttributes
|
|
212
|
+
}).strict();
|
|
213
|
+
const blockSchema = z.lazy(() => z.discriminatedUnion("type", [
|
|
214
|
+
paragraphSchema,
|
|
215
|
+
headingSchema,
|
|
216
|
+
codeBlockSchema,
|
|
217
|
+
imageSchema,
|
|
218
|
+
horizontalRuleSchema,
|
|
219
|
+
z.object({
|
|
220
|
+
type: z.literal("blockquote"),
|
|
221
|
+
attrs: noAttributes,
|
|
222
|
+
content: z.array(blockSchema).min(1).max(1e3)
|
|
223
|
+
}).strict(),
|
|
224
|
+
z.object({
|
|
225
|
+
type: z.literal("bulletList"),
|
|
226
|
+
attrs: noAttributes,
|
|
227
|
+
content: z.array(listItemSchema).min(1).max(1e3)
|
|
228
|
+
}).strict(),
|
|
229
|
+
z.object({
|
|
230
|
+
type: z.literal("orderedList"),
|
|
231
|
+
attrs: z.object({
|
|
232
|
+
start: z.number().int().positive().optional(),
|
|
233
|
+
type: z.enum([
|
|
234
|
+
"1",
|
|
235
|
+
"a",
|
|
236
|
+
"A",
|
|
237
|
+
"i",
|
|
238
|
+
"I"
|
|
239
|
+
]).nullable().optional()
|
|
240
|
+
}).strict().optional(),
|
|
241
|
+
content: z.array(listItemSchema).min(1).max(1e3)
|
|
242
|
+
}).strict()
|
|
243
|
+
]));
|
|
244
|
+
const listItemSchema = z.lazy(() => z.object({
|
|
245
|
+
type: z.literal("listItem"),
|
|
246
|
+
attrs: noAttributes,
|
|
247
|
+
content: z.tuple([paragraphSchema]).rest(blockSchema)
|
|
248
|
+
}).strict());
|
|
249
|
+
function treeSize(value, depth = 0) {
|
|
250
|
+
if (depth > 12) return {
|
|
251
|
+
depth,
|
|
252
|
+
nodes: 0,
|
|
253
|
+
text: 0
|
|
254
|
+
};
|
|
255
|
+
if (!isRecord$4(value)) return {
|
|
256
|
+
depth,
|
|
257
|
+
nodes: 0,
|
|
258
|
+
text: 0
|
|
259
|
+
};
|
|
260
|
+
const nodes = Array.isArray(value.content) ? value.content : [];
|
|
261
|
+
if (nodes.length > 2e3) return {
|
|
262
|
+
depth,
|
|
263
|
+
nodes: 2001,
|
|
264
|
+
text: 0
|
|
265
|
+
};
|
|
266
|
+
return nodes.reduce((total, node) => {
|
|
267
|
+
if (exceedsBounds(total)) return total;
|
|
268
|
+
const child = treeSize(node, depth + 1);
|
|
269
|
+
return {
|
|
270
|
+
depth: Math.max(total.depth, child.depth),
|
|
271
|
+
nodes: total.nodes + child.nodes,
|
|
272
|
+
text: total.text + child.text
|
|
273
|
+
};
|
|
274
|
+
}, {
|
|
275
|
+
depth,
|
|
276
|
+
nodes: depth === 0 ? 0 : 1,
|
|
277
|
+
text: typeof value.text === "string" ? value.text.length : 0
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function exceedsBounds(size) {
|
|
281
|
+
return size.depth > 12 || size.nodes > 2e3 || size.text > 1e5;
|
|
282
|
+
}
|
|
283
|
+
/** Closed authoring contract for generated content. Stored legacy documents keep their existing reader. */
|
|
284
|
+
const RichTextAuthoringDocSchema = z.preprocess((value, ctx) => {
|
|
285
|
+
if (exceedsBounds(treeSize(value))) {
|
|
286
|
+
ctx.addIssue({
|
|
287
|
+
code: "custom",
|
|
288
|
+
message: "Rich text must have at most 12 levels, 2000 nodes and 100000 text characters"
|
|
289
|
+
});
|
|
290
|
+
return z.NEVER;
|
|
291
|
+
}
|
|
292
|
+
return value;
|
|
293
|
+
}, z.object({
|
|
294
|
+
type: z.literal("doc"),
|
|
295
|
+
content: z.array(blockSchema).max(1e3)
|
|
296
|
+
}).strict());
|
|
297
|
+
const inlineNodes = [
|
|
298
|
+
"paragraph",
|
|
299
|
+
"text",
|
|
300
|
+
"hardBreak"
|
|
301
|
+
];
|
|
302
|
+
const inlineMarks = [
|
|
303
|
+
"bold",
|
|
304
|
+
"italic",
|
|
305
|
+
"strike",
|
|
306
|
+
"code",
|
|
307
|
+
"link"
|
|
308
|
+
];
|
|
309
|
+
const fullCapabilities = {
|
|
310
|
+
nodes: [
|
|
311
|
+
...inlineNodes,
|
|
312
|
+
"heading",
|
|
313
|
+
"blockquote",
|
|
314
|
+
"bulletList",
|
|
315
|
+
"orderedList",
|
|
316
|
+
"listItem",
|
|
317
|
+
"codeBlock",
|
|
318
|
+
"horizontalRule",
|
|
319
|
+
"image"
|
|
320
|
+
],
|
|
321
|
+
marks: inlineMarks,
|
|
322
|
+
headingLevels: [
|
|
323
|
+
1,
|
|
324
|
+
2,
|
|
325
|
+
3,
|
|
326
|
+
4,
|
|
327
|
+
5
|
|
328
|
+
]
|
|
329
|
+
};
|
|
330
|
+
const inlineCapabilities = {
|
|
331
|
+
nodes: inlineNodes,
|
|
332
|
+
marks: inlineMarks,
|
|
333
|
+
headingLevels: []
|
|
334
|
+
};
|
|
335
|
+
const variantCapabilities = {
|
|
336
|
+
full: fullCapabilities,
|
|
337
|
+
media: fullCapabilities,
|
|
338
|
+
inline: inlineCapabilities,
|
|
339
|
+
limited: inlineCapabilities,
|
|
340
|
+
notes: {
|
|
341
|
+
...inlineCapabilities,
|
|
342
|
+
nodes: [
|
|
343
|
+
...inlineNodes,
|
|
344
|
+
"bulletList",
|
|
345
|
+
"orderedList",
|
|
346
|
+
"listItem"
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
consent: {
|
|
350
|
+
...inlineCapabilities,
|
|
351
|
+
marks: [
|
|
352
|
+
"bold",
|
|
353
|
+
"italic",
|
|
354
|
+
"link"
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
/** One capability description for editor configuration, admission and model guidance. */
|
|
359
|
+
function richTextVariantCapabilities(variant) {
|
|
360
|
+
const capabilities = variantCapabilities[variant];
|
|
361
|
+
return {
|
|
362
|
+
nodes: [...capabilities.nodes],
|
|
363
|
+
marks: [...capabilities.marks],
|
|
364
|
+
headingLevels: [...capabilities.headingLevels]
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
function richTextDocumentSupportsVariant(doc, variant) {
|
|
368
|
+
const capabilities = richTextVariantCapabilities(variant);
|
|
369
|
+
const supports = (nodes) => nodes.every((node) => capabilities.nodes.some((type) => type === node.type) && (node.marks ?? []).every((mark) => capabilities.marks.some((type) => type === mark.type)) && (node.type !== "heading" || capabilities.headingLevels.some((level) => level === node.attrs?.level)) && supports(node.content ?? []));
|
|
370
|
+
return supports(doc.content);
|
|
371
|
+
}
|
|
372
|
+
/** Measured product allowance for whole-document edits; output-token limits remain separately enforced. */
|
|
373
|
+
function richTextEditingBudget(doc) {
|
|
374
|
+
const serializedBytes = new TextEncoder().encode(JSON.stringify(doc)).length;
|
|
375
|
+
const nodes = treeSize(doc).nodes;
|
|
376
|
+
return {
|
|
377
|
+
kind: serializedBytes <= 8e3 && nodes <= 120 ? "supported" : "too-large",
|
|
378
|
+
serializedBytes,
|
|
379
|
+
nodes
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
|
|
30
383
|
//#endregion
|
|
31
384
|
//#region ../blocks/src/system/manifest/richTextSchema.ts
|
|
32
385
|
/**
|
|
@@ -280,34 +633,24 @@ const ROUTE_METADATA_MANIFEST = {
|
|
|
280
633
|
id: "draftTitle",
|
|
281
634
|
type: "text",
|
|
282
635
|
label: "Title",
|
|
636
|
+
description: "The page's own name. It doesn't change any heading on the page.",
|
|
283
637
|
required: true,
|
|
284
638
|
multiline: false
|
|
285
639
|
},
|
|
286
|
-
{
|
|
287
|
-
id: "draftSlug",
|
|
288
|
-
type: "slug",
|
|
289
|
-
label: "Slug",
|
|
290
|
-
description: "Used in the URL.",
|
|
291
|
-
required: true,
|
|
292
|
-
sourceFieldId: "draftTitle",
|
|
293
|
-
statusFieldId: "draftStatus",
|
|
294
|
-
maxLength: 96,
|
|
295
|
-
ui: { showSlugPreview: true }
|
|
296
|
-
},
|
|
297
640
|
{
|
|
298
641
|
id: "draftMetaTitle",
|
|
299
642
|
type: "text",
|
|
300
|
-
label: "
|
|
301
|
-
description: "
|
|
302
|
-
multiline:
|
|
643
|
+
label: "Search title",
|
|
644
|
+
description: "Shown as the link in search results.",
|
|
645
|
+
multiline: false,
|
|
303
646
|
required: false,
|
|
304
647
|
ui: { showCharCount: { max: 60 } }
|
|
305
648
|
},
|
|
306
649
|
{
|
|
307
650
|
id: "draftMetaDescription",
|
|
308
651
|
type: "text",
|
|
309
|
-
label: "
|
|
310
|
-
description: "
|
|
652
|
+
label: "Search description",
|
|
653
|
+
description: "The short summary under the link in search results.",
|
|
311
654
|
required: false,
|
|
312
655
|
multiline: true,
|
|
313
656
|
ui: { showCharCount: { max: 160 } }
|
|
@@ -315,8 +658,9 @@ const ROUTE_METADATA_MANIFEST = {
|
|
|
315
658
|
{
|
|
316
659
|
id: "ogImageId",
|
|
317
660
|
type: "text",
|
|
318
|
-
label: "Social image
|
|
319
|
-
description: "
|
|
661
|
+
label: "Social image",
|
|
662
|
+
description: "Shown when someone shares a link to this page.",
|
|
663
|
+
ui: { widget: "socialImage" },
|
|
320
664
|
required: false,
|
|
321
665
|
multiline: false
|
|
322
666
|
}
|
|
@@ -387,11 +731,7 @@ function getRouteMetadataManifestForContext(context) {
|
|
|
387
731
|
if (context.kind === "content") {
|
|
388
732
|
return getRouteMetadataManifestForType(context.typeKey);
|
|
389
733
|
}
|
|
390
|
-
|
|
391
|
-
return {
|
|
392
|
-
...ROUTE_METADATA_MANIFEST,
|
|
393
|
-
fields
|
|
394
|
-
};
|
|
734
|
+
return ROUTE_METADATA_MANIFEST;
|
|
395
735
|
}
|
|
396
736
|
function deriveRouteMetadataPresentation(context, options = {}) {
|
|
397
737
|
const contextManifest = getRouteMetadataManifestForContext(context);
|
|
@@ -423,18 +763,7 @@ function deriveRouteMetadataPresentation(context, options = {}) {
|
|
|
423
763
|
* We still keep `draftTitle` in the underlying manifest for page creation flows, but we omit it from entry editors.
|
|
424
764
|
*/
|
|
425
765
|
function omitRouteTitleFieldFromManifest(manifest) {
|
|
426
|
-
const fields =
|
|
427
|
-
if (field && typeof field === "object" && "sourceFieldId" in field) {
|
|
428
|
-
const sourceFieldId = field.sourceFieldId;
|
|
429
|
-
if (String(sourceFieldId) === "draftTitle") {
|
|
430
|
-
return {
|
|
431
|
-
...field,
|
|
432
|
-
sourceFieldId: undefined
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
return field;
|
|
437
|
-
});
|
|
766
|
+
const fields = manifest.fields.filter((field) => field.id !== "draftTitle");
|
|
438
767
|
return {
|
|
439
768
|
...manifest,
|
|
440
769
|
fields
|
|
@@ -1482,7 +1811,6 @@ function createMetadataStateFromSnapshot(snapshot) {
|
|
|
1482
1811
|
}
|
|
1483
1812
|
const values = {
|
|
1484
1813
|
draftTitle: snapshot.draft.title,
|
|
1485
|
-
draftSlug: snapshot.draft.slug,
|
|
1486
1814
|
draftMetaTitle: snapshot.route.draftMetaTitle ?? null,
|
|
1487
1815
|
draftMetaDescription: snapshot.route.draftMetaDescription ?? null,
|
|
1488
1816
|
ogImageId: snapshot.route.ogImageId ?? null
|
|
@@ -1505,7 +1833,7 @@ function routeLifecycleContext(snapshot) {
|
|
|
1505
1833
|
*
|
|
1506
1834
|
* Returns null if the entry has never been published.
|
|
1507
1835
|
*/
|
|
1508
|
-
function getPublishedMetadataFromSnapshot(snapshot,
|
|
1836
|
+
function getPublishedMetadataFromSnapshot(snapshot, _routing) {
|
|
1509
1837
|
if (snapshot.kind === "non-routable") {
|
|
1510
1838
|
return null;
|
|
1511
1839
|
}
|
|
@@ -1515,11 +1843,8 @@ function getPublishedMetadataFromSnapshot(snapshot, routing) {
|
|
|
1515
1843
|
}
|
|
1516
1844
|
const publishedTitle = snapshot.published.title ?? snapshot.draft.title;
|
|
1517
1845
|
if (!publishedTitle) return null;
|
|
1518
|
-
const publishedPath = snapshot.published.path ?? snapshot.draft.path ?? "";
|
|
1519
|
-
const publishedSlug = routing ? routing.toSlug(publishedPath) : publishedPath ? publishedPath.replace(/^\//, "").replace(/\/$/, "") : "";
|
|
1520
1846
|
return {
|
|
1521
1847
|
draftTitle: publishedTitle,
|
|
1522
|
-
draftSlug: publishedSlug,
|
|
1523
1848
|
draftMetaTitle: snapshot.route.publishedMetaTitle ?? null,
|
|
1524
1849
|
draftMetaDescription: snapshot.route.publishedMetaDescription ?? null,
|
|
1525
1850
|
ogImageId: snapshot.route.ogImageId ?? null
|
|
@@ -3317,7 +3642,8 @@ const DEFAULT_TEMPLATE_DEFINITIONS = {
|
|
|
3317
3642
|
showVenue: true,
|
|
3318
3643
|
showMap: true,
|
|
3319
3644
|
showOtherDates: true,
|
|
3320
|
-
otherDatesLimit: "5"
|
|
3645
|
+
otherDatesLimit: "5",
|
|
3646
|
+
showCapacity: true
|
|
3321
3647
|
}
|
|
3322
3648
|
},
|
|
3323
3649
|
{
|
|
@@ -3422,7 +3748,8 @@ const EVENT_HEADER_TEMPLATE_DEFINITION = {
|
|
|
3422
3748
|
showVenue: true,
|
|
3423
3749
|
showMap: true,
|
|
3424
3750
|
showOtherDates: true,
|
|
3425
|
-
otherDatesLimit: "5"
|
|
3751
|
+
otherDatesLimit: "5",
|
|
3752
|
+
showCapacity: true
|
|
3426
3753
|
}
|
|
3427
3754
|
}, ...DEFAULT_TEMPLATE_DEFINITIONS.event.blocks.slice(2)]
|
|
3428
3755
|
};
|
|
@@ -4857,4 +5184,4 @@ const eventUpsertInputSchema = z.object({
|
|
|
4857
5184
|
}));
|
|
4858
5185
|
|
|
4859
5186
|
//#endregion
|
|
4860
|
-
export { RichTextDocSchema as a,
|
|
5187
|
+
export { RichTextDocSchema as a, isObjectRecord as c, findUnfilledSentinels as i, isRecord$3 as l, 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.28.1";
|
|
11
11
|
var peerDependencies = { "@riverbankcms/sdk": ">=0.157.0 <1.0.0" };
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "riverbankcms",
|
|
@@ -15,9 +15,18 @@ var package_default = {
|
|
|
15
15
|
description: "Riverbank CMS command-line tools for SDK site developers",
|
|
16
16
|
bin: { "riverbankcms": "dist/cli/index.mjs" },
|
|
17
17
|
exports: {
|
|
18
|
-
"./scaffold":
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
"./scaffold": {
|
|
19
|
+
"@riverbankcms/source": "./src/scaffold/index.ts",
|
|
20
|
+
"default": "./dist/scaffold/index.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./testing": {
|
|
23
|
+
"@riverbankcms/source": "./src/testing.ts",
|
|
24
|
+
"default": "./dist/testing.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./acceptance/matrix": {
|
|
27
|
+
"@riverbankcms/source": "./src/acceptance/matrix.ts",
|
|
28
|
+
"default": "./dist/acceptance/matrix.mjs"
|
|
29
|
+
},
|
|
21
30
|
"./package.json": "./package.json"
|
|
22
31
|
},
|
|
23
32
|
files: ["dist", "README.md"],
|
|
@@ -35,7 +44,8 @@ var package_default = {
|
|
|
35
44
|
"check:packed-exports": "node scripts/check-packed-exports.mjs",
|
|
36
45
|
"check:consumer-contract": "node scripts/check-packed-consumer-contract.mjs",
|
|
37
46
|
"check:packed-account-smoke": "node scripts/check-packed-account-smoke.mjs",
|
|
38
|
-
"cli": "pnpm --filter @riverbankcms/sdk build && pnpm build && node dist/cli/index.mjs"
|
|
47
|
+
"cli": "pnpm --filter @riverbankcms/sdk build && pnpm build && node dist/cli/index.mjs",
|
|
48
|
+
"prepack": "node ../../scripts/package-boundaries/pack-published.mjs refuse"
|
|
39
49
|
},
|
|
40
50
|
dependencies: {
|
|
41
51
|
"commander": "^12.1.0",
|
|
@@ -83,7 +93,7 @@ var package_default = {
|
|
|
83
93
|
//#endregion
|
|
84
94
|
//#region src/version.ts
|
|
85
95
|
/** The package manifest is the source-run fallback; builds inject this value. */
|
|
86
|
-
const CLI_VERSION = typeof "0.
|
|
96
|
+
const CLI_VERSION = typeof "0.28.1" === "string" ? "0.28.1" : version;
|
|
87
97
|
/**
|
|
88
98
|
* The CLI's SDK peer range is bundled from the CLI manifest alongside its
|
|
89
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 { Yn as parseSiteId, or as err, sr as ok } from "./src-nzVzuMR1.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-nzVzuMR1.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-DJfyedxU.mjs";
|
|
4
4
|
|
|
5
5
|
export { deriveGeneratedPackageRanges, deriveScaffoldLocalManifest, deriveScaffoldPlan, findPackageManifestPath, loadGeneratedPackageRanges, preflightScaffoldPlan, preflightScaffoldTargets, prepareScaffoldExecution, writeScaffoldFiles };
|