@riverbankcms/sdk 0.90.0 → 0.91.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/{PreviewEditorSidebar-KVXNF3VW.mjs → PreviewEditorSidebar-3TT47WCF.mjs} +3 -3
- package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-ORCLLUNZ.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +8 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
- package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
- package/dist/_dts/api/src/index.d.ts +4 -0
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
- package/dist/_dts/api/src/navigation.d.ts +2 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
- package/dist/_dts/api/src/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +12 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
- package/dist/_dts/core/src/event-pricing.d.ts +12 -2
- package/dist/_dts/core/src/string.d.ts +12 -0
- package/dist/_dts/sdk/src/cli/sync/validation.d.ts +2 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-GSPFFUVB.mjs → chunk-AFPMCLS7.mjs} +2 -2
- package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-GDT2QGIL.mjs} +1 -1
- package/dist/{chunk-PMBB6MQ7.mjs → chunk-RQUZYSES.mjs} +345 -153
- package/dist/{chunk-AEOYWPE4.mjs → chunk-S3YHJWEU.mjs} +7 -7
- package/dist/{chunk-UG7I7S7W.mjs → chunk-U5YM4AWE.mjs} +1 -1
- package/dist/{chunk-BOQXMCSP.mjs → chunk-ZA2S7H34.mjs} +3 -3
- package/dist/cli/index.mjs +363 -437
- package/dist/cli/init-docs/content/workflow-add-block.md +48 -0
- package/dist/cli/init-docs/content/workflow-custom-block.md +10 -0
- package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-AFX37652.mjs} +2 -2
- package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-32V5QCOW.mjs} +6 -6
- package/dist/client/bookings.mjs +1170 -571
- package/dist/client/{carousel-CVRN6EPP.mjs → carousel-TJGQJ7ER.mjs} +3 -3
- package/dist/client/{cart-IYIBA5CL.mjs → cart-JUU2JEW4.mjs} +6 -6
- package/dist/client/{checkout-O3BGM4GS.mjs → checkout-RD6BTFX4.mjs} +6 -6
- package/dist/client/{chunk-DAS5CIER.mjs → chunk-6QZIBNGV.mjs} +119 -21
- package/dist/client/{chunk-VFHZLZAC.mjs → chunk-6RN62XBV.mjs} +1 -1
- package/dist/client/{chunk-D3ETC2SU.mjs → chunk-C4LP6BPG.mjs} +1 -1
- package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-CKXEUWWA.mjs} +2 -2
- package/dist/client/{chunk-4RTFGHZN.mjs → chunk-E6VIWZUG.mjs} +6 -3
- package/dist/client/{chunk-Z62JYS5O.mjs → chunk-FMZZHAIR.mjs} +2 -2
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-ISAUXU5R.mjs} +1 -1
- package/dist/client/{chunk-HIHOQGIP.mjs → chunk-LJCX6V7Q.mjs} +9 -9
- package/dist/client/{chunk-6DPXDOIL.mjs → chunk-MLBNVN4H.mjs} +99 -26
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-PMNAV6LO.mjs} +1 -1
- package/dist/client/{chunk-MFPKS6QS.mjs → chunk-RMOFBBNA.mjs} +5 -5
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-RWYFG625.mjs} +17 -8
- package/dist/client/client.mjs +305 -113
- package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-X63QAIVV.mjs} +6 -6
- package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-5T24GCZL.mjs} +9 -9
- package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-AZVTF22X.mjs} +9 -9
- package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-7GPFNLGF.mjs} +9 -9
- package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-QEUMTMUM.mjs} +9 -9
- package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-P2EDKCQZ.mjs} +9 -9
- package/dist/client/{form-ZS6KX4U2.mjs → form-NUJ7H4IN.mjs} +3 -3
- package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-JB7LECPL.mjs} +3 -3
- package/dist/client/hooks.mjs +93 -42
- package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-UEYWUCSW.mjs} +3 -3
- package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-S2YZQ2X7.mjs} +3 -3
- package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-H5MADGG7.mjs} +6 -6
- package/dist/client/{productList-NI72Q62Z.mjs → productList-DK7YON7H.mjs} +6 -6
- package/dist/client/rendering/client.mjs +262 -70
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +306 -114
- package/dist/client/{shop-3ZQPEWYI.mjs → shop-6PA7RDRJ.mjs} +6 -6
- package/dist/client/spam-protection.mjs +10 -10
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-JP5347OB.mjs} +6 -6
- package/dist/server/components.mjs +149 -69
- package/dist/server/config-validation.mjs +85 -34
- package/dist/server/config.mjs +85 -34
- package/dist/server/data.mjs +93 -42
- package/dist/server/index.mjs +1 -1
- package/dist/server/navigation.mjs +2 -2
- package/dist/server/next.mjs +170 -90
- package/dist/server/page-converter.mjs +77 -26
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +161 -81
- package/dist/server/rendering.mjs +165 -85
- package/dist/server/routing.mjs +135 -58
- package/dist/server/server.mjs +102 -51
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
package/dist/cli/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import z41, { z } from 'zod';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import { createJiti } from 'jiti';
|
|
5
5
|
import * as fs11 from 'fs';
|
|
@@ -170,6 +170,8 @@ function publicEventPricingType(pricing) {
|
|
|
170
170
|
case "ticket_types":
|
|
171
171
|
case "course":
|
|
172
172
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
173
|
+
case "external":
|
|
174
|
+
return "external";
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
function isFreePublicEventPriceDisplay(display) {
|
|
@@ -183,6 +185,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
183
185
|
case "range":
|
|
184
186
|
case "mixed":
|
|
185
187
|
case "unavailable":
|
|
188
|
+
case "external":
|
|
186
189
|
return false;
|
|
187
190
|
}
|
|
188
191
|
}
|
|
@@ -226,11 +229,11 @@ function isValidTimeZone(timeZone) {
|
|
|
226
229
|
}
|
|
227
230
|
function getSafeTimeZone(timeZone) {
|
|
228
231
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
229
|
-
return normalized && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
232
|
+
return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
230
233
|
}
|
|
231
234
|
function parseStrictBookingTimeZone(timeZone) {
|
|
232
235
|
const normalized = timeZone.trim();
|
|
233
|
-
if (
|
|
236
|
+
if (normalized.length === 0 || !isValidTimeZone(normalized)) {
|
|
234
237
|
return null;
|
|
235
238
|
}
|
|
236
239
|
return normalized;
|
|
@@ -304,7 +307,7 @@ function parseScheduledBookingDateTime(input) {
|
|
|
304
307
|
try {
|
|
305
308
|
const startsAt = toUtcIsoDateTimeString(input.startsAt);
|
|
306
309
|
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
307
|
-
if (
|
|
310
|
+
if (timeZone === null) {
|
|
308
311
|
return {
|
|
309
312
|
ok: false,
|
|
310
313
|
field: "timeZone",
|
|
@@ -370,10 +373,10 @@ function normalizeLocationAddressText(value) {
|
|
|
370
373
|
return null;
|
|
371
374
|
}
|
|
372
375
|
const trimmed = value.trim();
|
|
373
|
-
return trimmed ? trimmed : null;
|
|
376
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
374
377
|
}
|
|
375
378
|
function hasLocationCoordinates(value) {
|
|
376
|
-
return typeof value
|
|
379
|
+
return value != null && typeof value.lat === "number" && typeof value.lng === "number";
|
|
377
380
|
}
|
|
378
381
|
function toLocationCoordinates(value) {
|
|
379
382
|
if (!hasLocationCoordinates(value)) {
|
|
@@ -389,6 +392,18 @@ var init_location = __esm({
|
|
|
389
392
|
}
|
|
390
393
|
});
|
|
391
394
|
|
|
395
|
+
// ../core/src/string.ts
|
|
396
|
+
function isNonEmptyString(value) {
|
|
397
|
+
return typeof value === "string" && value.length > 0;
|
|
398
|
+
}
|
|
399
|
+
function hasText(value) {
|
|
400
|
+
return isNonEmptyString(value);
|
|
401
|
+
}
|
|
402
|
+
var init_string = __esm({
|
|
403
|
+
"../core/src/string.ts"() {
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
|
|
392
407
|
// ../core/src/business-address.ts
|
|
393
408
|
var init_business_address = __esm({
|
|
394
409
|
"../core/src/business-address.ts"() {
|
|
@@ -509,12 +524,6 @@ var init_slug = __esm({
|
|
|
509
524
|
}
|
|
510
525
|
});
|
|
511
526
|
|
|
512
|
-
// ../core/src/string.ts
|
|
513
|
-
var init_string = __esm({
|
|
514
|
-
"../core/src/string.ts"() {
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
|
|
518
527
|
// ../core/src/uuid.ts
|
|
519
528
|
var init_uuid = __esm({
|
|
520
529
|
"../core/src/uuid.ts"() {
|
|
@@ -4891,44 +4900,44 @@ var init_styleTags = __esm({
|
|
|
4891
4900
|
var hotspotSchema, rotationSchema, rectSchema, aspectCropSchema, transformSchema, mediaSchema;
|
|
4892
4901
|
var init_media = __esm({
|
|
4893
4902
|
"../theme-core/src/lib/media.ts"() {
|
|
4894
|
-
hotspotSchema =
|
|
4895
|
-
x:
|
|
4896
|
-
y:
|
|
4897
|
-
radius:
|
|
4903
|
+
hotspotSchema = z41.object({
|
|
4904
|
+
x: z41.number().min(0).max(1),
|
|
4905
|
+
y: z41.number().min(0).max(1),
|
|
4906
|
+
radius: z41.number().optional()
|
|
4898
4907
|
});
|
|
4899
|
-
rotationSchema =
|
|
4900
|
-
rectSchema =
|
|
4901
|
-
aspectCropSchema =
|
|
4902
|
-
aspect:
|
|
4903
|
-
rect:
|
|
4904
|
-
hotspot:
|
|
4905
|
-
rotation:
|
|
4908
|
+
rotationSchema = z41.union([z41.literal(0), z41.literal(90), z41.literal(180), z41.literal(270)]);
|
|
4909
|
+
rectSchema = z41.tuple([z41.number(), z41.number(), z41.number(), z41.number()]);
|
|
4910
|
+
aspectCropSchema = z41.object({
|
|
4911
|
+
aspect: z41.preprocess((value) => value == null ? void 0 : value, z41.string().optional()),
|
|
4912
|
+
rect: z41.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
4913
|
+
hotspot: z41.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
4914
|
+
rotation: z41.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
4906
4915
|
});
|
|
4907
|
-
transformSchema =
|
|
4908
|
-
aspectCrops:
|
|
4916
|
+
transformSchema = z41.object({
|
|
4917
|
+
aspectCrops: z41.preprocess((value) => {
|
|
4909
4918
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
4910
4919
|
return void 0;
|
|
4911
4920
|
}
|
|
4912
4921
|
return value;
|
|
4913
|
-
},
|
|
4922
|
+
}, z41.record(z41.string(), aspectCropSchema.catch({}))).optional(),
|
|
4914
4923
|
rect: rectSchema.optional(),
|
|
4915
4924
|
hotspot: hotspotSchema.optional(),
|
|
4916
4925
|
rotation: rotationSchema.optional()
|
|
4917
4926
|
});
|
|
4918
|
-
mediaSchema =
|
|
4919
|
-
type:
|
|
4920
|
-
purpose:
|
|
4921
|
-
placeholder:
|
|
4922
|
-
assetId:
|
|
4923
|
-
identifier:
|
|
4924
|
-
src:
|
|
4925
|
-
alt:
|
|
4926
|
-
filename:
|
|
4927
|
-
mimeType:
|
|
4928
|
-
width:
|
|
4929
|
-
height:
|
|
4930
|
-
storageBucket:
|
|
4931
|
-
storagePath:
|
|
4927
|
+
mediaSchema = z41.object({
|
|
4928
|
+
type: z41.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
|
|
4929
|
+
purpose: z41.string().optional(),
|
|
4930
|
+
placeholder: z41.boolean().default(true).optional(),
|
|
4931
|
+
assetId: z41.string().optional(),
|
|
4932
|
+
identifier: z41.string().optional(),
|
|
4933
|
+
src: z41.string().optional(),
|
|
4934
|
+
alt: z41.string().optional(),
|
|
4935
|
+
filename: z41.string().optional(),
|
|
4936
|
+
mimeType: z41.string().optional(),
|
|
4937
|
+
width: z41.number().optional(),
|
|
4938
|
+
height: z41.number().optional(),
|
|
4939
|
+
storageBucket: z41.string().optional(),
|
|
4940
|
+
storagePath: z41.string().optional(),
|
|
4932
4941
|
transform: transformSchema.optional()
|
|
4933
4942
|
});
|
|
4934
4943
|
}
|
|
@@ -18542,66 +18551,66 @@ var init_media2 = __esm({
|
|
|
18542
18551
|
"archive",
|
|
18543
18552
|
"audio"
|
|
18544
18553
|
];
|
|
18545
|
-
hotspotSchema2 =
|
|
18546
|
-
x:
|
|
18547
|
-
y:
|
|
18548
|
-
radius:
|
|
18554
|
+
hotspotSchema2 = z41.object({
|
|
18555
|
+
x: z41.number().min(0).max(1),
|
|
18556
|
+
y: z41.number().min(0).max(1),
|
|
18557
|
+
radius: z41.number().optional()
|
|
18549
18558
|
});
|
|
18550
|
-
rotationSchema2 =
|
|
18551
|
-
rectSchema2 =
|
|
18552
|
-
aspectCropSchema2 =
|
|
18553
|
-
aspect:
|
|
18554
|
-
rect:
|
|
18555
|
-
hotspot:
|
|
18556
|
-
rotation:
|
|
18559
|
+
rotationSchema2 = z41.union([z41.literal(0), z41.literal(90), z41.literal(180), z41.literal(270)]);
|
|
18560
|
+
rectSchema2 = z41.tuple([z41.number(), z41.number(), z41.number(), z41.number()]);
|
|
18561
|
+
aspectCropSchema2 = z41.object({
|
|
18562
|
+
aspect: z41.preprocess((value) => value == null ? void 0 : value, z41.string().optional()),
|
|
18563
|
+
rect: z41.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
|
|
18564
|
+
hotspot: z41.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
|
|
18565
|
+
rotation: z41.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
|
|
18557
18566
|
});
|
|
18558
|
-
transformSchema2 =
|
|
18559
|
-
aspectCrops:
|
|
18567
|
+
transformSchema2 = z41.object({
|
|
18568
|
+
aspectCrops: z41.preprocess((value) => {
|
|
18560
18569
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
18561
18570
|
return void 0;
|
|
18562
18571
|
}
|
|
18563
18572
|
return value;
|
|
18564
|
-
},
|
|
18573
|
+
}, z41.record(z41.string(), aspectCropSchema2.catch({}))).optional(),
|
|
18565
18574
|
rect: rectSchema2.optional(),
|
|
18566
18575
|
hotspot: hotspotSchema2.optional(),
|
|
18567
18576
|
rotation: rotationSchema2.optional()
|
|
18568
18577
|
});
|
|
18569
|
-
mediaPosterSchema =
|
|
18570
|
-
|
|
18571
|
-
tag:
|
|
18572
|
-
assetId:
|
|
18573
|
-
storageBucket:
|
|
18574
|
-
storagePath:
|
|
18578
|
+
mediaPosterSchema = z41.discriminatedUnion("tag", [
|
|
18579
|
+
z41.object({
|
|
18580
|
+
tag: z41.literal("storage"),
|
|
18581
|
+
assetId: z41.string().optional(),
|
|
18582
|
+
storageBucket: z41.string().min(1),
|
|
18583
|
+
storagePath: z41.string().min(1)
|
|
18575
18584
|
}),
|
|
18576
|
-
|
|
18577
|
-
tag:
|
|
18578
|
-
assetId:
|
|
18579
|
-
src:
|
|
18585
|
+
z41.object({
|
|
18586
|
+
tag: z41.literal("external-src"),
|
|
18587
|
+
assetId: z41.string().optional(),
|
|
18588
|
+
src: z41.string().url()
|
|
18580
18589
|
})
|
|
18581
18590
|
]);
|
|
18582
|
-
mediaBaseSchema =
|
|
18583
|
-
purpose:
|
|
18584
|
-
placeholder:
|
|
18585
|
-
assetId:
|
|
18586
|
-
identifier:
|
|
18587
|
-
src:
|
|
18588
|
-
alt:
|
|
18589
|
-
filename:
|
|
18590
|
-
mimeType:
|
|
18591
|
-
width:
|
|
18592
|
-
height:
|
|
18593
|
-
storageBucket:
|
|
18594
|
-
storagePath:
|
|
18591
|
+
mediaBaseSchema = z41.object({
|
|
18592
|
+
purpose: z41.string().optional(),
|
|
18593
|
+
placeholder: z41.boolean().default(true).optional(),
|
|
18594
|
+
assetId: z41.string().optional(),
|
|
18595
|
+
identifier: z41.string().optional(),
|
|
18596
|
+
src: z41.string().optional(),
|
|
18597
|
+
alt: z41.string().optional(),
|
|
18598
|
+
filename: z41.string().optional(),
|
|
18599
|
+
mimeType: z41.string().optional(),
|
|
18600
|
+
width: z41.number().optional(),
|
|
18601
|
+
height: z41.number().optional(),
|
|
18602
|
+
storageBucket: z41.string().optional(),
|
|
18603
|
+
storagePath: z41.string().optional(),
|
|
18595
18604
|
poster: mediaPosterSchema.optional(),
|
|
18596
18605
|
transform: transformSchema2.optional()
|
|
18597
18606
|
});
|
|
18598
|
-
imageMediaSchema = mediaBaseSchema.extend({ type:
|
|
18599
|
-
videoMediaSchema = mediaBaseSchema.extend({ type:
|
|
18600
|
-
audioMediaSchema = mediaBaseSchema.extend({ type:
|
|
18601
|
-
documentMediaSchema = mediaBaseSchema.extend({ type:
|
|
18602
|
-
spreadsheetMediaSchema = mediaBaseSchema.extend({ type:
|
|
18603
|
-
archiveMediaSchema = mediaBaseSchema.extend({ type:
|
|
18604
|
-
mediaSchema2 =
|
|
18607
|
+
imageMediaSchema = mediaBaseSchema.extend({ type: z41.literal("image") });
|
|
18608
|
+
videoMediaSchema = mediaBaseSchema.extend({ type: z41.literal("video") });
|
|
18609
|
+
audioMediaSchema = mediaBaseSchema.extend({ type: z41.literal("audio") });
|
|
18610
|
+
documentMediaSchema = mediaBaseSchema.extend({ type: z41.literal("document") });
|
|
18611
|
+
spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z41.literal("spreadsheet") });
|
|
18612
|
+
archiveMediaSchema = mediaBaseSchema.extend({ type: z41.literal("archive") });
|
|
18613
|
+
mediaSchema2 = z41.discriminatedUnion("type", [
|
|
18605
18614
|
imageMediaSchema,
|
|
18606
18615
|
videoMediaSchema,
|
|
18607
18616
|
audioMediaSchema,
|
|
@@ -18822,7 +18831,7 @@ var init_schemas = __esm({
|
|
|
18822
18831
|
publicCoursesArraySchema = z.array(publicCourseSchema);
|
|
18823
18832
|
}
|
|
18824
18833
|
});
|
|
18825
|
-
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, eventVenueSchema, eventCategorySchema, accessRestrictionSchema, publicCoursePriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
18834
|
+
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, publicEventDestinationSchema, eventVenueSchema, eventCategorySchema, accessRestrictionSchema, publicCoursePriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
18826
18835
|
var init_schemas2 = __esm({
|
|
18827
18836
|
"../blocks/src/system/blocks/events/shared/schemas.ts"() {
|
|
18828
18837
|
init_media2();
|
|
@@ -18832,6 +18841,18 @@ var init_schemas2 = __esm({
|
|
|
18832
18841
|
eventPresetSchema = z.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
18833
18842
|
eventScheduleScopeSchema = z.enum(["recurring", "oneOff"]);
|
|
18834
18843
|
eventDestinationModeSchema = z.enum(["cms-managed", "system-managed"]);
|
|
18844
|
+
publicEventDestinationSchema = z.discriminatedUnion("kind", [
|
|
18845
|
+
z.object({
|
|
18846
|
+
kind: z.literal("native"),
|
|
18847
|
+
mode: eventDestinationModeSchema,
|
|
18848
|
+
path: z.string()
|
|
18849
|
+
}),
|
|
18850
|
+
z.object({
|
|
18851
|
+
kind: z.literal("external"),
|
|
18852
|
+
url: z.string(),
|
|
18853
|
+
label: z.string()
|
|
18854
|
+
})
|
|
18855
|
+
]);
|
|
18835
18856
|
eventVenueSchema = z.object({
|
|
18836
18857
|
id: z.string(),
|
|
18837
18858
|
name: z.string(),
|
|
@@ -18846,7 +18867,7 @@ var init_schemas2 = __esm({
|
|
|
18846
18867
|
name: z.string(),
|
|
18847
18868
|
color: z.string().nullable()
|
|
18848
18869
|
});
|
|
18849
|
-
z.enum(["free", "paid"]);
|
|
18870
|
+
z.enum(["free", "paid", "external"]);
|
|
18850
18871
|
accessRestrictionSchema = z.enum(["none", "category"]);
|
|
18851
18872
|
z.enum(["single", "ticket_types"]);
|
|
18852
18873
|
publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
@@ -18867,6 +18888,7 @@ var init_schemas2 = __esm({
|
|
|
18867
18888
|
currency: z.string()
|
|
18868
18889
|
}),
|
|
18869
18890
|
z.object({ kind: z.literal("unavailable"), currency: z.string() }),
|
|
18891
|
+
z.object({ kind: z.literal("external"), label: z.string() }),
|
|
18870
18892
|
z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
18871
18893
|
]);
|
|
18872
18894
|
publicEventTicketTypePriceDisplaySchema = z.union([
|
|
@@ -18945,6 +18967,10 @@ var init_schemas2 = __esm({
|
|
|
18945
18967
|
z.object({
|
|
18946
18968
|
kind: z.literal("course"),
|
|
18947
18969
|
display: z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
18970
|
+
}),
|
|
18971
|
+
z.object({
|
|
18972
|
+
kind: z.literal("external"),
|
|
18973
|
+
display: z.object({ kind: z.literal("external"), label: z.string() })
|
|
18948
18974
|
})
|
|
18949
18975
|
]);
|
|
18950
18976
|
publicTeamMemberSummarySchema = z.object({
|
|
@@ -18973,7 +18999,8 @@ var init_schemas2 = __esm({
|
|
|
18973
18999
|
image: mediaSchema2.nullable().optional()
|
|
18974
19000
|
}).optional(),
|
|
18975
19001
|
slug: z.string(),
|
|
18976
|
-
path: z.string(),
|
|
19002
|
+
path: z.string().nullable(),
|
|
19003
|
+
destination: publicEventDestinationSchema,
|
|
18977
19004
|
requiresRegistration: z.boolean(),
|
|
18978
19005
|
deliveryMode: z.enum(["in_person", "online", "hybrid"]),
|
|
18979
19006
|
attendanceModes: z.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -19312,11 +19339,44 @@ var init_events = __esm({
|
|
|
19312
19339
|
}
|
|
19313
19340
|
});
|
|
19314
19341
|
|
|
19342
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
19343
|
+
function isRecord4(value) {
|
|
19344
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19345
|
+
}
|
|
19346
|
+
function isRuntimeEventDestination(value) {
|
|
19347
|
+
if (!isRecord4(value) || typeof value.kind !== "string") return false;
|
|
19348
|
+
if (value.kind === "native") {
|
|
19349
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
19350
|
+
}
|
|
19351
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
19352
|
+
}
|
|
19353
|
+
function resolveRuntimeEventDestination(event) {
|
|
19354
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
19355
|
+
return event.destination;
|
|
19356
|
+
}
|
|
19357
|
+
return {
|
|
19358
|
+
kind: "native",
|
|
19359
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
19360
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
19361
|
+
};
|
|
19362
|
+
}
|
|
19363
|
+
var init_destination = __esm({
|
|
19364
|
+
"../blocks/src/system/runtime/nodes/events/shared/destination.ts"() {
|
|
19365
|
+
}
|
|
19366
|
+
});
|
|
19367
|
+
|
|
19315
19368
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
19316
19369
|
function resolveRuntimeEventPricing(event) {
|
|
19317
19370
|
if (isPublicEventPricing(event.pricing)) {
|
|
19318
19371
|
return event.pricing;
|
|
19319
19372
|
}
|
|
19373
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
19374
|
+
if (destination.kind === "external") {
|
|
19375
|
+
return {
|
|
19376
|
+
kind: "external",
|
|
19377
|
+
display: { kind: "external", label: "External registration" }
|
|
19378
|
+
};
|
|
19379
|
+
}
|
|
19320
19380
|
const legacy = event;
|
|
19321
19381
|
const currency = readCurrency(legacy.currency);
|
|
19322
19382
|
if (event.requiresRegistration === false) {
|
|
@@ -19353,22 +19413,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
19353
19413
|
function readCurrency(value) {
|
|
19354
19414
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
19355
19415
|
}
|
|
19356
|
-
function
|
|
19416
|
+
function isRecord5(value) {
|
|
19357
19417
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19358
19418
|
}
|
|
19359
19419
|
function isPublicEventPricing(value) {
|
|
19360
|
-
if (!
|
|
19361
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
19420
|
+
if (!isRecord5(value) || typeof value.kind !== "string") return false;
|
|
19421
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
19362
19422
|
}
|
|
19363
19423
|
function isPublicEventTicketType(value) {
|
|
19364
|
-
return
|
|
19424
|
+
return isRecord5(value) && typeof value.id === "string";
|
|
19365
19425
|
}
|
|
19366
19426
|
function readTicketTypePriceDisplay(value, currency) {
|
|
19367
19427
|
const display = readLegacyPriceDisplay(value, currency);
|
|
19368
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
19428
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
19369
19429
|
}
|
|
19370
19430
|
function readLegacyPriceDisplay(value, currency) {
|
|
19371
|
-
if (!
|
|
19431
|
+
if (!isRecord5(value) || typeof value.kind !== "string") {
|
|
19372
19432
|
return { kind: "unavailable", currency };
|
|
19373
19433
|
}
|
|
19374
19434
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -19407,7 +19467,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
19407
19467
|
case "unavailable":
|
|
19408
19468
|
return { kind: "unavailable", currency: displayCurrency };
|
|
19409
19469
|
case "course":
|
|
19410
|
-
return
|
|
19470
|
+
return isRecord5(value.display) ? {
|
|
19411
19471
|
kind: "course",
|
|
19412
19472
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
19413
19473
|
} : {
|
|
@@ -19444,6 +19504,7 @@ function readAmount(value) {
|
|
|
19444
19504
|
var DEFAULT_EVENT_CURRENCY;
|
|
19445
19505
|
var init_pricing = __esm({
|
|
19446
19506
|
"../blocks/src/system/runtime/nodes/events/shared/pricing.ts"() {
|
|
19507
|
+
init_destination();
|
|
19447
19508
|
DEFAULT_EVENT_CURRENCY = "USD";
|
|
19448
19509
|
}
|
|
19449
19510
|
});
|
|
@@ -19504,7 +19565,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
19504
19565
|
if (!input.event) {
|
|
19505
19566
|
return false;
|
|
19506
19567
|
}
|
|
19507
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
19568
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
19508
19569
|
}
|
|
19509
19570
|
var init_registrationDerivations = __esm({
|
|
19510
19571
|
"../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts"() {
|
|
@@ -19606,15 +19667,16 @@ function buildEventRegistrationShellBodyText(stepLabels) {
|
|
|
19606
19667
|
return "Preparing dates, tickets, and booking details.";
|
|
19607
19668
|
}
|
|
19608
19669
|
function normalizeEventRegistrationEventInput(value) {
|
|
19609
|
-
if (!
|
|
19670
|
+
if (!isRecord6(value)) {
|
|
19610
19671
|
return value;
|
|
19611
19672
|
}
|
|
19612
19673
|
return {
|
|
19613
19674
|
...value,
|
|
19675
|
+
destination: resolveRuntimeEventDestination(value),
|
|
19614
19676
|
pricing: resolveRuntimeEventPricing(value)
|
|
19615
19677
|
};
|
|
19616
19678
|
}
|
|
19617
|
-
function
|
|
19679
|
+
function isRecord6(value) {
|
|
19618
19680
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19619
19681
|
}
|
|
19620
19682
|
var EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS, EVENT_REGISTRATION_SHELL_STEP_LABELS, contentEntrySchema, eventRegistrationPublicEventSchema, eventRegistrationSourceSchema, eventRegistrationDisplaySchema, eventRegistrationHydrationSchema, eventRegistrationRenderSchema, eventRegistrationBlockRuntime;
|
|
@@ -19625,6 +19687,7 @@ var init_event_registration_interactive = __esm({
|
|
|
19625
19687
|
init_event_registration_shared();
|
|
19626
19688
|
init_events();
|
|
19627
19689
|
init_pricing();
|
|
19690
|
+
init_destination();
|
|
19628
19691
|
init_islands();
|
|
19629
19692
|
init_runtime();
|
|
19630
19693
|
init_contract_schemas();
|
|
@@ -28960,12 +29023,16 @@ function validationContext(options = {}) {
|
|
|
28960
29023
|
allowIncomplete: isDraft || (options.allowIncomplete ?? false)
|
|
28961
29024
|
};
|
|
28962
29025
|
}
|
|
29026
|
+
function strictValidationContext(options = {}) {
|
|
29027
|
+
const ctx = validationContext(options);
|
|
29028
|
+
return {
|
|
29029
|
+
...ctx,
|
|
29030
|
+
allowNull: options.allowNull ?? false
|
|
29031
|
+
};
|
|
29032
|
+
}
|
|
28963
29033
|
function formatFieldPath(path28) {
|
|
28964
29034
|
return path28.map((segment) => String(segment)).join(".");
|
|
28965
29035
|
}
|
|
28966
|
-
function toZodIssuePath(path28) {
|
|
28967
|
-
return [...path28];
|
|
28968
|
-
}
|
|
28969
29036
|
function fieldIssueToMessage(issue5) {
|
|
28970
29037
|
switch (issue5.kind) {
|
|
28971
29038
|
case "required":
|
|
@@ -29202,70 +29269,10 @@ function resolveSelectConstraintSource(field) {
|
|
|
29202
29269
|
return assertNever2(source);
|
|
29203
29270
|
}
|
|
29204
29271
|
}
|
|
29205
|
-
function
|
|
29206
|
-
|
|
29207
|
-
|
|
29208
|
-
|
|
29209
|
-
const planMap = new Map(plans.map((plan) => [plan.fieldId, plan]));
|
|
29210
|
-
const normalized = {};
|
|
29211
|
-
const ctx = validationContext(options);
|
|
29212
|
-
for (const [key, value] of Object.entries(content)) {
|
|
29213
|
-
const plan = planMap.get(key);
|
|
29214
|
-
normalized[key] = plan ? normalizeStoredFieldValueWithContext(plan, value, ctx) : value;
|
|
29215
|
-
}
|
|
29216
|
-
return normalized;
|
|
29217
|
-
}
|
|
29218
|
-
function normalizeStoredFieldValueWithContext(plan, value, ctx) {
|
|
29219
|
-
if (value === null && !plan.required) {
|
|
29220
|
-
return void 0;
|
|
29221
|
-
}
|
|
29222
|
-
switch (plan.kind) {
|
|
29223
|
-
case "group":
|
|
29224
|
-
return normalizeStoredObjectChildren(plan.children, value, childValidationContext(plan, ctx));
|
|
29225
|
-
case "repeater":
|
|
29226
|
-
return normalizeStoredRepeaterItems(plan, value, ctx);
|
|
29227
|
-
case "string":
|
|
29228
|
-
case "number":
|
|
29229
|
-
case "boolean":
|
|
29230
|
-
case "richText":
|
|
29231
|
-
case "media":
|
|
29232
|
-
case "link":
|
|
29233
|
-
case "select":
|
|
29234
|
-
case "passthrough":
|
|
29235
|
-
return normalizeFieldValue(plan, value, ctx);
|
|
29236
|
-
default:
|
|
29237
|
-
return assertNever2(plan);
|
|
29238
|
-
}
|
|
29239
|
-
}
|
|
29240
|
-
function normalizeStoredObjectChildren(children, value, ctx) {
|
|
29241
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
29242
|
-
return value;
|
|
29243
|
-
}
|
|
29244
|
-
const normalized = { ...value };
|
|
29245
|
-
for (const child of children) {
|
|
29246
|
-
normalized[child.fieldId] = normalizeStoredFieldValueWithContext(
|
|
29247
|
-
child,
|
|
29248
|
-
normalized[child.fieldId],
|
|
29249
|
-
ctx
|
|
29250
|
-
);
|
|
29251
|
-
}
|
|
29252
|
-
return normalized;
|
|
29253
|
-
}
|
|
29254
|
-
function normalizeStoredRepeaterItems(plan, value, ctx) {
|
|
29255
|
-
if (!isUnknownArray(value)) {
|
|
29256
|
-
return value;
|
|
29257
|
-
}
|
|
29258
|
-
return value.map((item) => {
|
|
29259
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) {
|
|
29260
|
-
return item;
|
|
29261
|
-
}
|
|
29262
|
-
const itemRecord = item;
|
|
29263
|
-
const fields3 = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemRecord._type)?.fields : plan.repeatedItemPlan;
|
|
29264
|
-
if (!fields3) {
|
|
29265
|
-
return item;
|
|
29266
|
-
}
|
|
29267
|
-
return normalizeStoredObjectChildren(fields3, itemRecord, ctx);
|
|
29268
|
-
});
|
|
29272
|
+
function validateFieldValue(plan, value, options = {}) {
|
|
29273
|
+
const ctx = strictValidationContext(options);
|
|
29274
|
+
const normalized = normalizeFieldValue(plan, value, ctx);
|
|
29275
|
+
return validateNormalizedFieldValue(plan, normalized, ctx);
|
|
29269
29276
|
}
|
|
29270
29277
|
function normalizeFieldValue(plan, value, ctx) {
|
|
29271
29278
|
switch (plan.kind) {
|
|
@@ -29543,72 +29550,32 @@ function requiredIssue(plan, value) {
|
|
|
29543
29550
|
if (Array.isArray(value)) return issue(plan, "required", { emptyOrigin: "array" });
|
|
29544
29551
|
return issue(plan, "required");
|
|
29545
29552
|
}
|
|
29546
|
-
function
|
|
29547
|
-
|
|
29548
|
-
|
|
29549
|
-
|
|
29550
|
-
addFieldIssueToZodContext(zodCtx, validationIssue, plan.path);
|
|
29551
|
-
}
|
|
29552
|
-
});
|
|
29553
|
+
function validateManifestValues(fields3, values, options = {}) {
|
|
29554
|
+
return deriveFieldValidationPlans(fields3).flatMap(
|
|
29555
|
+
(plan) => validateFieldValue(plan, values[plan.fieldId], options)
|
|
29556
|
+
);
|
|
29553
29557
|
}
|
|
29554
|
-
function
|
|
29555
|
-
const
|
|
29556
|
-
|
|
29557
|
-
|
|
29558
|
-
|
|
29559
|
-
|
|
29560
|
-
if (validationIssue.emptyOrigin) {
|
|
29561
|
-
zodCtx.addIssue({
|
|
29562
|
-
...issuePath,
|
|
29563
|
-
code: "too_small",
|
|
29564
|
-
origin: validationIssue.emptyOrigin,
|
|
29565
|
-
minimum: 1,
|
|
29566
|
-
inclusive: true,
|
|
29567
|
-
message
|
|
29568
|
-
});
|
|
29569
|
-
return;
|
|
29570
|
-
}
|
|
29571
|
-
zodCtx.addIssue({ ...issuePath, code: "invalid_type", expected: "nonoptional", message });
|
|
29572
|
-
return;
|
|
29573
|
-
case "tooLong":
|
|
29574
|
-
zodCtx.addIssue({
|
|
29575
|
-
...issuePath,
|
|
29576
|
-
code: "too_big",
|
|
29577
|
-
origin: "string",
|
|
29578
|
-
maximum: validationIssue.maximum,
|
|
29579
|
-
inclusive: true,
|
|
29580
|
-
message
|
|
29581
|
-
});
|
|
29582
|
-
return;
|
|
29583
|
-
case "invalidOption":
|
|
29584
|
-
zodCtx.addIssue({ ...issuePath, code: "invalid_value", values: [], message });
|
|
29585
|
-
return;
|
|
29586
|
-
case "wrongType":
|
|
29587
|
-
case "invalidEmail":
|
|
29588
|
-
case "invalidPhone":
|
|
29589
|
-
case "invalidPattern":
|
|
29590
|
-
case "invalidUrl":
|
|
29591
|
-
case "invalidDate":
|
|
29592
|
-
case "invalidTime":
|
|
29593
|
-
case "invalidDateTime":
|
|
29594
|
-
case "invalidNumber":
|
|
29595
|
-
case "tooSmall":
|
|
29596
|
-
case "tooLarge":
|
|
29597
|
-
case "invalidSlug":
|
|
29598
|
-
case "tooFewItems":
|
|
29599
|
-
case "tooManyItems":
|
|
29600
|
-
case "invalidRichText":
|
|
29601
|
-
case "invalidMedia":
|
|
29602
|
-
case "invalidLink":
|
|
29603
|
-
case "invalidReference":
|
|
29604
|
-
zodCtx.addIssue({ ...issuePath, code: "custom", message });
|
|
29605
|
-
return;
|
|
29606
|
-
default:
|
|
29607
|
-
assertNever2(validationIssue);
|
|
29608
|
-
}
|
|
29558
|
+
function validateManifestContentForPush(fields3, values, options = {}) {
|
|
29559
|
+
const issues = validateManifestValues(fields3, values, options).map(toManifestContentValidationIssue);
|
|
29560
|
+
return issues.length === 0 ? { kind: "valid", issues: [] } : { kind: "invalid", issues };
|
|
29561
|
+
}
|
|
29562
|
+
function isTopLevelRequiredManifestContentIssue(issue5) {
|
|
29563
|
+
return issue5.requiredScope === "topLevel";
|
|
29609
29564
|
}
|
|
29610
|
-
function
|
|
29611
|
-
return
|
|
29565
|
+
function formatManifestContentValidationIssue(issue5) {
|
|
29566
|
+
return `Invalid content${issue5.field ? ` in "${issue5.field}"` : ""}: ${issue5.message}`;
|
|
29567
|
+
}
|
|
29568
|
+
function toManifestContentValidationIssue(issue5) {
|
|
29569
|
+
return {
|
|
29570
|
+
kind: issue5.kind,
|
|
29571
|
+
field: formatFieldPath(issue5.path),
|
|
29572
|
+
message: fieldIssueToMessage(issue5),
|
|
29573
|
+
requiredScope: requiredScopeForIssue(issue5)
|
|
29574
|
+
};
|
|
29575
|
+
}
|
|
29576
|
+
function requiredScopeForIssue(issue5) {
|
|
29577
|
+
if (issue5.kind !== "required") return null;
|
|
29578
|
+
return issue5.path.length === 1 ? "topLevel" : "nested";
|
|
29612
29579
|
}
|
|
29613
29580
|
function compilePattern(pattern) {
|
|
29614
29581
|
try {
|
|
@@ -29689,13 +29656,6 @@ function isValidSelectValue(value, values, multiple) {
|
|
|
29689
29656
|
}
|
|
29690
29657
|
return typeof value === "string" && values.includes(value);
|
|
29691
29658
|
}
|
|
29692
|
-
function isEmptyValue(value) {
|
|
29693
|
-
if (value === null || value === void 0) return true;
|
|
29694
|
-
if (typeof value === "string" && value.trim() === "") return true;
|
|
29695
|
-
if (Array.isArray(value) && value.length === 0) return true;
|
|
29696
|
-
if (isEmptyRichTextDoc(value)) return true;
|
|
29697
|
-
return false;
|
|
29698
|
-
}
|
|
29699
29659
|
function isPlainObject(value) {
|
|
29700
29660
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
29701
29661
|
}
|
|
@@ -29706,16 +29666,6 @@ function isValidRichTextDoc(value) {
|
|
|
29706
29666
|
const doc = richTextDoc(value);
|
|
29707
29667
|
return Boolean(isPlainObject(doc) && doc.type === "doc");
|
|
29708
29668
|
}
|
|
29709
|
-
function isEmptyRichTextDoc(value) {
|
|
29710
|
-
const doc = richTextDoc(value);
|
|
29711
|
-
if (!isPlainObject(doc)) return false;
|
|
29712
|
-
if (doc.type !== "doc") return false;
|
|
29713
|
-
const content = doc.content;
|
|
29714
|
-
if (!Array.isArray(content) || content.length === 0) return true;
|
|
29715
|
-
if (content.length !== 1) return false;
|
|
29716
|
-
const first = content[0];
|
|
29717
|
-
return first?.type === "paragraph" && (!Array.isArray(first.content) || first.content.length === 0);
|
|
29718
|
-
}
|
|
29719
29669
|
function richTextDoc(value) {
|
|
29720
29670
|
if (!isPlainObject(value)) return value;
|
|
29721
29671
|
return isPlainObject(value.doc) ? value.doc : value;
|
|
@@ -29730,44 +29680,6 @@ function registerManifest(manifest) {
|
|
|
29730
29680
|
manifestStore.set(manifest.name, manifest);
|
|
29731
29681
|
return manifest;
|
|
29732
29682
|
}
|
|
29733
|
-
function preprocessEmptyValues(content) {
|
|
29734
|
-
if (!content || typeof content !== "object" || Array.isArray(content)) {
|
|
29735
|
-
return {};
|
|
29736
|
-
}
|
|
29737
|
-
const result = {};
|
|
29738
|
-
for (const [key, value] of Object.entries(content)) {
|
|
29739
|
-
result[key] = isEmptyValue(value) ? void 0 : value;
|
|
29740
|
-
}
|
|
29741
|
-
return result;
|
|
29742
|
-
}
|
|
29743
|
-
function createManifestValidator(manifestOrFields, options = {}) {
|
|
29744
|
-
const isDraft = options.mode === "draft";
|
|
29745
|
-
const plans = derivePlansFromManifestOrFields(manifestOrFields);
|
|
29746
|
-
const baseSchema = deriveContentZodFromPlans(plans, options);
|
|
29747
|
-
if (isDraft) {
|
|
29748
|
-
return z.preprocess(
|
|
29749
|
-
(content) => preprocessEmptyValues(
|
|
29750
|
-
normalizeStoredContentValues(plans, content, options)
|
|
29751
|
-
),
|
|
29752
|
-
baseSchema
|
|
29753
|
-
);
|
|
29754
|
-
}
|
|
29755
|
-
return z.preprocess(
|
|
29756
|
-
(content) => normalizeStoredContentValues(plans, content, options),
|
|
29757
|
-
baseSchema
|
|
29758
|
-
);
|
|
29759
|
-
}
|
|
29760
|
-
function deriveContentZodFromPlans(plans, options) {
|
|
29761
|
-
const shape = {};
|
|
29762
|
-
for (const plan of plans) {
|
|
29763
|
-
shape[plan.fieldId] = fieldPlanToZod(plan, options);
|
|
29764
|
-
}
|
|
29765
|
-
return z.object(shape).catchall(z.unknown()).passthrough();
|
|
29766
|
-
}
|
|
29767
|
-
function derivePlansFromManifestOrFields(manifestOrFields) {
|
|
29768
|
-
const fields3 = Array.isArray(manifestOrFields) ? manifestOrFields : manifestOrFields.fields ?? [];
|
|
29769
|
-
return deriveFieldValidationPlans(fields3);
|
|
29770
|
-
}
|
|
29771
29683
|
|
|
29772
29684
|
// ../blocks/src/system/blocks/index.ts
|
|
29773
29685
|
init_site_styles();
|
|
@@ -37075,7 +36987,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
37075
36987
|
return keys.length >= 2 ? keys : [];
|
|
37076
36988
|
}
|
|
37077
36989
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
37078
|
-
if (!
|
|
36990
|
+
if (!isRecord7(value)) return null;
|
|
37079
36991
|
const groupOrderValue = value.groupOrder;
|
|
37080
36992
|
if (Array.isArray(groupOrderValue)) {
|
|
37081
36993
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -37088,7 +37000,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
37088
37000
|
return { ...value, groupOrder: [] };
|
|
37089
37001
|
}
|
|
37090
37002
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
37091
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
37003
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord7) : []
|
|
37092
37004
|
);
|
|
37093
37005
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
37094
37006
|
}
|
|
@@ -37102,7 +37014,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
37102
37014
|
}
|
|
37103
37015
|
return keys;
|
|
37104
37016
|
}
|
|
37105
|
-
function
|
|
37017
|
+
function isRecord7(value) {
|
|
37106
37018
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37107
37019
|
}
|
|
37108
37020
|
|
|
@@ -37469,7 +37381,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
37469
37381
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
37470
37382
|
}
|
|
37471
37383
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
37472
|
-
if (!
|
|
37384
|
+
if (!isRecord8(value)) return [];
|
|
37473
37385
|
const override = {};
|
|
37474
37386
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
37475
37387
|
override.sourceKey = value.sourceKey;
|
|
@@ -37501,12 +37413,12 @@ function isButtonVariant(value) {
|
|
|
37501
37413
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
37502
37414
|
}
|
|
37503
37415
|
function normalizeCardStylesContent(value) {
|
|
37504
|
-
return
|
|
37416
|
+
return isRecord8(value) || value === null ? value : void 0;
|
|
37505
37417
|
}
|
|
37506
37418
|
function normalizeSectionStylesContent(value) {
|
|
37507
|
-
return
|
|
37419
|
+
return isRecord8(value) || value === null ? value : void 0;
|
|
37508
37420
|
}
|
|
37509
|
-
function
|
|
37421
|
+
function isRecord8(value) {
|
|
37510
37422
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37511
37423
|
}
|
|
37512
37424
|
|
|
@@ -41485,11 +41397,11 @@ function extractRouteUpdatedAt(candidate) {
|
|
|
41485
41397
|
}
|
|
41486
41398
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
41487
41399
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
41488
|
-
if (
|
|
41400
|
+
if (routeId === null || routeId.length === 0 || routes === void 0) return null;
|
|
41489
41401
|
const routeEntry = routes[routeId];
|
|
41490
41402
|
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
41491
41403
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
41492
|
-
if (
|
|
41404
|
+
if (href === null) return null;
|
|
41493
41405
|
return {
|
|
41494
41406
|
routeId,
|
|
41495
41407
|
href,
|
|
@@ -43321,7 +43233,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
|
|
|
43321
43233
|
}
|
|
43322
43234
|
|
|
43323
43235
|
// ../api/src/utils/isRecord.ts
|
|
43324
|
-
function
|
|
43236
|
+
function isRecord9(value) {
|
|
43325
43237
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43326
43238
|
}
|
|
43327
43239
|
var APPOINTMENT_SETUP_MAX_MINUTES = 1440;
|
|
@@ -43594,7 +43506,7 @@ function sanitizeMarks(marks) {
|
|
|
43594
43506
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
43595
43507
|
return [{ type: mark.type }];
|
|
43596
43508
|
}
|
|
43597
|
-
if (mark.type === "link" &&
|
|
43509
|
+
if (mark.type === "link" && isRecord9(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
43598
43510
|
const attrs = { href: mark.attrs.href };
|
|
43599
43511
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
43600
43512
|
attrs.target = mark.attrs.target;
|
|
@@ -43609,10 +43521,10 @@ function sanitizeMarks(marks) {
|
|
|
43609
43521
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
43610
43522
|
}
|
|
43611
43523
|
function unwrapRichTextValue(value) {
|
|
43612
|
-
if (
|
|
43524
|
+
if (isRecord9(value) && isRecord9(value.doc)) {
|
|
43613
43525
|
return unwrapRichTextValue(value.doc);
|
|
43614
43526
|
}
|
|
43615
|
-
if (
|
|
43527
|
+
if (isRecord9(value) && value.type === "doc") {
|
|
43616
43528
|
return {
|
|
43617
43529
|
type: "doc",
|
|
43618
43530
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -43621,7 +43533,7 @@ function unwrapRichTextValue(value) {
|
|
|
43621
43533
|
return EMPTY_SITE_BANNER_BODY;
|
|
43622
43534
|
}
|
|
43623
43535
|
function isTipTapNodeLike(value) {
|
|
43624
|
-
return
|
|
43536
|
+
return isRecord9(value) && typeof value.type === "string";
|
|
43625
43537
|
}
|
|
43626
43538
|
function coerceTipTapNode(value) {
|
|
43627
43539
|
return {
|
|
@@ -43629,9 +43541,9 @@ function coerceTipTapNode(value) {
|
|
|
43629
43541
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
43630
43542
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
43631
43543
|
...Array.isArray(value.marks) ? {
|
|
43632
|
-
marks: value.marks.filter((mark) =>
|
|
43544
|
+
marks: value.marks.filter((mark) => isRecord9(mark) && typeof mark.type === "string").map((mark) => ({
|
|
43633
43545
|
type: mark.type,
|
|
43634
|
-
...
|
|
43546
|
+
...isRecord9(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
43635
43547
|
}))
|
|
43636
43548
|
} : {}
|
|
43637
43549
|
};
|
|
@@ -43747,7 +43659,7 @@ function collectCartLinkStats(items, depth = 0) {
|
|
|
43747
43659
|
return result;
|
|
43748
43660
|
}
|
|
43749
43661
|
function isNavigationMenuValidationItem(value) {
|
|
43750
|
-
if (!
|
|
43662
|
+
if (!isRecord9(value)) return false;
|
|
43751
43663
|
return typeof value.label === "string";
|
|
43752
43664
|
}
|
|
43753
43665
|
|
|
@@ -45000,20 +44912,20 @@ var ManagementApiError = class extends Error {
|
|
|
45000
44912
|
function is404Error(error) {
|
|
45001
44913
|
return error instanceof ManagementApiError && error.statusCode === 404;
|
|
45002
44914
|
}
|
|
45003
|
-
function
|
|
44915
|
+
function isRecord10(value) {
|
|
45004
44916
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
45005
44917
|
}
|
|
45006
44918
|
function isFieldError(value) {
|
|
45007
|
-
return
|
|
44919
|
+
return isRecord10(value) && typeof value.field === "string" && typeof value.code === "string" && typeof value.message === "string";
|
|
45008
44920
|
}
|
|
45009
44921
|
function parseApiResponse(value) {
|
|
45010
|
-
if (!
|
|
44922
|
+
if (!isRecord10(value)) return null;
|
|
45011
44923
|
if (value.success === true) {
|
|
45012
44924
|
return { success: true, data: value.data };
|
|
45013
44925
|
}
|
|
45014
44926
|
if (value.success === false) {
|
|
45015
44927
|
const error = value.error;
|
|
45016
|
-
if (!
|
|
44928
|
+
if (!isRecord10(error) || typeof error.code !== "string" || typeof error.message !== "string") {
|
|
45017
44929
|
return { success: false, error: { code: "sdk:http-error", message: "Request failed", details: error } };
|
|
45018
44930
|
}
|
|
45019
44931
|
const fieldErrorsRaw = error.fieldErrors;
|
|
@@ -46542,7 +46454,7 @@ function createListCommand(config2) {
|
|
|
46542
46454
|
|
|
46543
46455
|
// src/cli/push-config.ts
|
|
46544
46456
|
var DEFAULT_CONFIG_PATH = "./riverbank.config.ts";
|
|
46545
|
-
function
|
|
46457
|
+
function isRecord11(value) {
|
|
46546
46458
|
return typeof value === "object" && value !== null;
|
|
46547
46459
|
}
|
|
46548
46460
|
function parseErrorDetails(value) {
|
|
@@ -46550,10 +46462,10 @@ function parseErrorDetails(value) {
|
|
|
46550
46462
|
if (typeof value === "string") {
|
|
46551
46463
|
return { message: value };
|
|
46552
46464
|
}
|
|
46553
|
-
if (!
|
|
46465
|
+
if (!isRecord11(value)) return {};
|
|
46554
46466
|
const message = typeof value.message === "string" ? value.message : void 0;
|
|
46555
46467
|
const fieldErrorsRaw = value.fieldErrors;
|
|
46556
|
-
const fieldErrors = Array.isArray(fieldErrorsRaw) ? fieldErrorsRaw.filter(
|
|
46468
|
+
const fieldErrors = Array.isArray(fieldErrorsRaw) ? fieldErrorsRaw.filter(isRecord11).map((d) => ({
|
|
46557
46469
|
field: typeof d.field === "string" ? d.field : "",
|
|
46558
46470
|
message: typeof d.message === "string" ? d.message : ""
|
|
46559
46471
|
})).filter((d) => d.field.length > 0 && d.message.length > 0) : void 0;
|
|
@@ -46565,12 +46477,12 @@ function formatFieldErrors(fieldErrors) {
|
|
|
46565
46477
|
}
|
|
46566
46478
|
function getDashboardErrorMessage(responseJson, fallback) {
|
|
46567
46479
|
if (!responseJson) return fallback;
|
|
46568
|
-
if (
|
|
46480
|
+
if (isRecord11(responseJson) && responseJson.success === false && "error" in responseJson) {
|
|
46569
46481
|
const parsed = parseErrorDetails(responseJson.error);
|
|
46570
46482
|
const msg = parsed.message ?? fallback;
|
|
46571
46483
|
return msg + formatFieldErrors(parsed.fieldErrors);
|
|
46572
46484
|
}
|
|
46573
|
-
if (
|
|
46485
|
+
if (isRecord11(responseJson) && "error" in responseJson) {
|
|
46574
46486
|
const parsed = parseErrorDetails(responseJson.error);
|
|
46575
46487
|
const msg = parsed.message ?? fallback;
|
|
46576
46488
|
return msg + formatFieldErrors(parsed.fieldErrors);
|
|
@@ -46895,7 +46807,7 @@ function duplicateNavigationIdentityMessage(error) {
|
|
|
46895
46807
|
|
|
46896
46808
|
// src/cli/media/portable.ts
|
|
46897
46809
|
var ENV_SPECIFIC_MEDIA_KEYS = ["assetId", "storagePath", "storageBucket"];
|
|
46898
|
-
var
|
|
46810
|
+
var isRecord12 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
46899
46811
|
var isMediaObject = (value) => value.type === "image" || value.type === "video";
|
|
46900
46812
|
function stripEnvSpecificMediaFieldsInPlace(value) {
|
|
46901
46813
|
if (value === null || value === void 0) return;
|
|
@@ -46905,7 +46817,7 @@ function stripEnvSpecificMediaFieldsInPlace(value) {
|
|
|
46905
46817
|
}
|
|
46906
46818
|
return;
|
|
46907
46819
|
}
|
|
46908
|
-
if (!
|
|
46820
|
+
if (!isRecord12(value)) return;
|
|
46909
46821
|
if (isMediaObject(value)) {
|
|
46910
46822
|
const hasCmsRef = typeof value.identifier === "string" || typeof value.assetId === "string" || typeof value.storagePath === "string" || typeof value.storageBucket === "string";
|
|
46911
46823
|
for (const key of ENV_SPECIFIC_MEDIA_KEYS) {
|
|
@@ -46916,7 +46828,7 @@ function stripEnvSpecificMediaFieldsInPlace(value) {
|
|
|
46916
46828
|
}
|
|
46917
46829
|
delete value.mimeType;
|
|
46918
46830
|
}
|
|
46919
|
-
if (value.type === "image" &&
|
|
46831
|
+
if (value.type === "image" && isRecord12(value.attrs)) {
|
|
46920
46832
|
const attrs = value.attrs;
|
|
46921
46833
|
const hasIdentifier = typeof attrs.identifier === "string" && attrs.identifier.trim().length > 0;
|
|
46922
46834
|
if (hasIdentifier) {
|
|
@@ -47088,11 +47000,11 @@ function entryFilePath(input) {
|
|
|
47088
47000
|
}
|
|
47089
47001
|
|
|
47090
47002
|
// src/cli/content/writer.ts
|
|
47091
|
-
function
|
|
47003
|
+
function isRecord13(value) {
|
|
47092
47004
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
47093
47005
|
}
|
|
47094
47006
|
function parseThemeMeta(value) {
|
|
47095
|
-
if (!
|
|
47007
|
+
if (!isRecord13(value) || typeof value.pulledAt !== "string" || !isRecord13(value.themes)) {
|
|
47096
47008
|
return null;
|
|
47097
47009
|
}
|
|
47098
47010
|
return { pulledAt: value.pulledAt, themes: value.themes };
|
|
@@ -48424,6 +48336,11 @@ var MIME_TYPES = {
|
|
|
48424
48336
|
".mp4": "video/mp4",
|
|
48425
48337
|
".webm": "video/webm",
|
|
48426
48338
|
".mov": "video/quicktime",
|
|
48339
|
+
".mp3": "audio/mpeg",
|
|
48340
|
+
".m4a": "audio/mp4",
|
|
48341
|
+
".wav": "audio/wav",
|
|
48342
|
+
".ogg": "audio/ogg",
|
|
48343
|
+
".flac": "audio/flac",
|
|
48427
48344
|
".pdf": "application/pdf"
|
|
48428
48345
|
};
|
|
48429
48346
|
var EXTENSIONS_BY_MIME = {
|
|
@@ -48437,6 +48354,13 @@ var EXTENSIONS_BY_MIME = {
|
|
|
48437
48354
|
"video/mp4": ".mp4",
|
|
48438
48355
|
"video/webm": ".webm",
|
|
48439
48356
|
"video/quicktime": ".mov",
|
|
48357
|
+
"audio/mpeg": ".mp3",
|
|
48358
|
+
"audio/mp4": ".m4a",
|
|
48359
|
+
"audio/wav": ".wav",
|
|
48360
|
+
"audio/x-wav": ".wav",
|
|
48361
|
+
"audio/ogg": ".ogg",
|
|
48362
|
+
"audio/webm": ".webm",
|
|
48363
|
+
"audio/flac": ".flac",
|
|
48440
48364
|
"application/pdf": ".pdf"
|
|
48441
48365
|
};
|
|
48442
48366
|
function getMimeType(filename) {
|
|
@@ -48515,9 +48439,9 @@ async function localMediaFileExists(filePath) {
|
|
|
48515
48439
|
}
|
|
48516
48440
|
|
|
48517
48441
|
// src/cli/media/identifiers.ts
|
|
48518
|
-
var
|
|
48442
|
+
var isRecord14 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
48519
48443
|
var isMediaValue = (value) => {
|
|
48520
|
-
if (!
|
|
48444
|
+
if (!isRecord14(value)) return false;
|
|
48521
48445
|
const type = value.type;
|
|
48522
48446
|
if (type !== "image" && type !== "video" && type !== "audio" && type !== "document" && type !== "spreadsheet" && type !== "archive") return false;
|
|
48523
48447
|
return typeof value.identifier === "string" || typeof value.assetId === "string" || typeof value.storagePath === "string" || typeof value.src === "string";
|
|
@@ -48532,7 +48456,7 @@ var walkMediaValues = (value, location2, handler) => {
|
|
|
48532
48456
|
});
|
|
48533
48457
|
return;
|
|
48534
48458
|
}
|
|
48535
|
-
if (
|
|
48459
|
+
if (isRecord14(value)) {
|
|
48536
48460
|
Object.entries(value).forEach(([key, entry]) => {
|
|
48537
48461
|
walkMediaValues(entry, location2 ? `${location2}.${key}` : key, handler);
|
|
48538
48462
|
});
|
|
@@ -48658,7 +48582,7 @@ var normalizeMediaValueToIdentifierOnly = (value, identifier, asset) => {
|
|
|
48658
48582
|
};
|
|
48659
48583
|
|
|
48660
48584
|
// src/cli/media/rich-text.ts
|
|
48661
|
-
var
|
|
48585
|
+
var isRecord15 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
48662
48586
|
function collectRichTextImageAttrs(value, out = [], location2 = "") {
|
|
48663
48587
|
if (Array.isArray(value)) {
|
|
48664
48588
|
value.forEach(
|
|
@@ -48666,8 +48590,8 @@ function collectRichTextImageAttrs(value, out = [], location2 = "") {
|
|
|
48666
48590
|
);
|
|
48667
48591
|
return out;
|
|
48668
48592
|
}
|
|
48669
|
-
if (!
|
|
48670
|
-
if (value.type === "image" &&
|
|
48593
|
+
if (!isRecord15(value)) return out;
|
|
48594
|
+
if (value.type === "image" && isRecord15(value.attrs)) {
|
|
48671
48595
|
out.push({ attrs: value.attrs, location: location2 ? `${location2}.attrs` : "attrs" });
|
|
48672
48596
|
}
|
|
48673
48597
|
for (const [key, child] of Object.entries(value)) {
|
|
@@ -52805,7 +52729,7 @@ var isoDateTimeRegex = /^\d{4}-\d{2}-\d{2}T.+/;
|
|
|
52805
52729
|
function issue2(path28, message) {
|
|
52806
52730
|
return { path: path28, message };
|
|
52807
52731
|
}
|
|
52808
|
-
function
|
|
52732
|
+
function isRecord16(value) {
|
|
52809
52733
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
52810
52734
|
}
|
|
52811
52735
|
function isCurrency(value) {
|
|
@@ -52821,7 +52745,7 @@ function isWholeMinuteIsoDateTime(value) {
|
|
|
52821
52745
|
}
|
|
52822
52746
|
function validateTicketType(raw, index, currency) {
|
|
52823
52747
|
const path28 = ["ticketTypes", String(index)];
|
|
52824
|
-
if (!
|
|
52748
|
+
if (!isRecord16(raw)) return [issue2(path28, "Ticket type must be an object")];
|
|
52825
52749
|
const issues = [];
|
|
52826
52750
|
const identifier = raw.identifier;
|
|
52827
52751
|
if (typeof identifier !== "string" || !identifierRegex.test(identifier)) {
|
|
@@ -52944,7 +52868,7 @@ function validateTicketTypes(rawTicketTypes, currency) {
|
|
|
52944
52868
|
const ticketTypes = [];
|
|
52945
52869
|
const seenIdentifiers = /* @__PURE__ */ new Set();
|
|
52946
52870
|
rawTicketTypes.forEach((rawTicketType, index) => {
|
|
52947
|
-
const rawIdentifier =
|
|
52871
|
+
const rawIdentifier = isRecord16(rawTicketType) ? rawTicketType.identifier : void 0;
|
|
52948
52872
|
const hasValidIdentifier = typeof rawIdentifier === "string" && identifierRegex.test(rawIdentifier);
|
|
52949
52873
|
const isDuplicateIdentifier = hasValidIdentifier && seenIdentifiers.has(rawIdentifier);
|
|
52950
52874
|
if (isDuplicateIdentifier) {
|
|
@@ -52988,7 +52912,7 @@ function classifySdkEventPricing(rawInput) {
|
|
|
52988
52912
|
if (rawInput === void 0 || rawInput === null) {
|
|
52989
52913
|
return { ok: true, pricing: { kind: "free" } };
|
|
52990
52914
|
}
|
|
52991
|
-
if (!
|
|
52915
|
+
if (!isRecord16(rawInput)) {
|
|
52992
52916
|
return { ok: false, issues: [issue2([], "Pricing must be an object")] };
|
|
52993
52917
|
}
|
|
52994
52918
|
const record = rawInput;
|
|
@@ -53098,7 +53022,7 @@ var supportedKinds = /* @__PURE__ */ new Set([
|
|
|
53098
53022
|
function issue3(path28, message) {
|
|
53099
53023
|
return { path: path28, message };
|
|
53100
53024
|
}
|
|
53101
|
-
function
|
|
53025
|
+
function isRecord17(value) {
|
|
53102
53026
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53103
53027
|
}
|
|
53104
53028
|
function isWholeNumber2(value) {
|
|
@@ -53114,7 +53038,7 @@ function isSupportedOptionKind(value) {
|
|
|
53114
53038
|
return typeof value === "string" && supportedKinds.has(value);
|
|
53115
53039
|
}
|
|
53116
53040
|
function validateFlexibleBalanceDueDateRule(raw, path28) {
|
|
53117
|
-
if (!
|
|
53041
|
+
if (!isRecord17(raw)) {
|
|
53118
53042
|
return [issue3(path28, "Flexible balance dueDateRule must be an object")];
|
|
53119
53043
|
}
|
|
53120
53044
|
if (raw.kind === "relative_to_start_date") {
|
|
@@ -53153,7 +53077,7 @@ function validateFlexibleBalanceDueDateRule(raw, path28) {
|
|
|
53153
53077
|
];
|
|
53154
53078
|
}
|
|
53155
53079
|
function validateFlexibleBalanceConfig(raw, path28) {
|
|
53156
|
-
if (!
|
|
53080
|
+
if (!isRecord17(raw)) {
|
|
53157
53081
|
return [issue3(path28, "Flexible balance config must be an object")];
|
|
53158
53082
|
}
|
|
53159
53083
|
const issues = [];
|
|
@@ -53199,7 +53123,7 @@ function validateFlexibleBalanceConfig(raw, path28) {
|
|
|
53199
53123
|
}
|
|
53200
53124
|
function validateCollectionOption(raw, index) {
|
|
53201
53125
|
const path28 = ["allowedOptions", String(index)];
|
|
53202
|
-
if (!
|
|
53126
|
+
if (!isRecord17(raw)) {
|
|
53203
53127
|
return [issue3(path28, "Payment option must be an object")];
|
|
53204
53128
|
}
|
|
53205
53129
|
if (raw.kind === "instalment_plan") {
|
|
@@ -53270,7 +53194,7 @@ function classifySdkEventPaymentTerms(rawInput) {
|
|
|
53270
53194
|
if (rawInput === void 0 || rawInput === null) {
|
|
53271
53195
|
return { ok: true, paymentTerms: void 0 };
|
|
53272
53196
|
}
|
|
53273
|
-
if (!
|
|
53197
|
+
if (!isRecord17(rawInput)) {
|
|
53274
53198
|
return {
|
|
53275
53199
|
ok: false,
|
|
53276
53200
|
issues: [issue3([], "Event paymentTerms must be an object")]
|
|
@@ -53321,7 +53245,7 @@ function classifySdkEventPaymentTerms(rawInput) {
|
|
|
53321
53245
|
function nullishToNull(value) {
|
|
53322
53246
|
return value == null ? null : value;
|
|
53323
53247
|
}
|
|
53324
|
-
function
|
|
53248
|
+
function isRecord18(value) {
|
|
53325
53249
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53326
53250
|
}
|
|
53327
53251
|
function stringValue(value, fallback) {
|
|
@@ -53342,7 +53266,7 @@ function normalizeEventPaymentTermsForCompare(paymentTerms) {
|
|
|
53342
53266
|
return void 0;
|
|
53343
53267
|
}
|
|
53344
53268
|
function normalizeVenueAddress(value) {
|
|
53345
|
-
const obj =
|
|
53269
|
+
const obj = isRecord18(value) ? value : {};
|
|
53346
53270
|
return {
|
|
53347
53271
|
line1: nullishToNull(typeof obj.line1 === "string" ? obj.line1 : void 0),
|
|
53348
53272
|
line2: nullishToNull(typeof obj.line2 === "string" ? obj.line2 : void 0),
|
|
@@ -53359,7 +53283,7 @@ function normalizeVenueAddress(value) {
|
|
|
53359
53283
|
};
|
|
53360
53284
|
}
|
|
53361
53285
|
function normalizeVenueLocation(value) {
|
|
53362
|
-
if (!
|
|
53286
|
+
if (!isRecord18(value)) return null;
|
|
53363
53287
|
const obj = value;
|
|
53364
53288
|
const lat = typeof obj.lat === "number" ? obj.lat : null;
|
|
53365
53289
|
const lng = typeof obj.lng === "number" ? obj.lng : null;
|
|
@@ -53367,7 +53291,7 @@ function normalizeVenueLocation(value) {
|
|
|
53367
53291
|
return { lat, lng };
|
|
53368
53292
|
}
|
|
53369
53293
|
function normalizeVenueForCompare(venue) {
|
|
53370
|
-
const obj =
|
|
53294
|
+
const obj = isRecord18(venue) ? venue : {};
|
|
53371
53295
|
return {
|
|
53372
53296
|
slug: String(obj.slug),
|
|
53373
53297
|
title: String(obj.title),
|
|
@@ -53388,7 +53312,7 @@ function normalizeVenueForCompare(venue) {
|
|
|
53388
53312
|
};
|
|
53389
53313
|
}
|
|
53390
53314
|
function normalizeEventCategoryForCompare(category) {
|
|
53391
|
-
const obj =
|
|
53315
|
+
const obj = isRecord18(category) ? category : {};
|
|
53392
53316
|
return {
|
|
53393
53317
|
identifier: String(obj.identifier),
|
|
53394
53318
|
name: String(obj.name),
|
|
@@ -53400,8 +53324,8 @@ function normalizeEventCategoryForCompare(category) {
|
|
|
53400
53324
|
};
|
|
53401
53325
|
}
|
|
53402
53326
|
function normalizeRemoteEventForCompare(event) {
|
|
53403
|
-
const obj =
|
|
53404
|
-
const schedule =
|
|
53327
|
+
const obj = isRecord18(event) ? event : {};
|
|
53328
|
+
const schedule = isRecord18(obj.schedule) ? obj.schedule : {};
|
|
53405
53329
|
return {
|
|
53406
53330
|
identifier: String(obj.identifier),
|
|
53407
53331
|
title: String(obj.title),
|
|
@@ -53430,14 +53354,14 @@ function normalizeRemoteEventForCompare(event) {
|
|
|
53430
53354
|
formRef: nullishToNull(
|
|
53431
53355
|
typeof obj.formRef === "string" ? obj.formRef : void 0
|
|
53432
53356
|
),
|
|
53433
|
-
content:
|
|
53434
|
-
settings:
|
|
53435
|
-
presentation:
|
|
53357
|
+
content: isRecord18(obj.content) ? obj.content : {},
|
|
53358
|
+
settings: isRecord18(obj.settings) ? obj.settings : {},
|
|
53359
|
+
presentation: isRecord18(obj.presentation) ? obj.presentation : null,
|
|
53436
53360
|
tags: Array.isArray(obj.tags) ? obj.tags : []
|
|
53437
53361
|
};
|
|
53438
53362
|
}
|
|
53439
53363
|
function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
53440
|
-
const local =
|
|
53364
|
+
const local = isRecord18(localEvent) ? localEvent : {};
|
|
53441
53365
|
const base = remoteEvent ? normalizeRemoteEventForCompare(remoteEvent) : normalizeRemoteEventForCompare({
|
|
53442
53366
|
identifier: local.identifier,
|
|
53443
53367
|
title: local.title,
|
|
@@ -53456,7 +53380,7 @@ function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
|
53456
53380
|
presentation: local.presentation ?? null,
|
|
53457
53381
|
tags: local.tags ?? []
|
|
53458
53382
|
});
|
|
53459
|
-
const schedule =
|
|
53383
|
+
const schedule = isRecord18(local.schedule) ? local.schedule : {};
|
|
53460
53384
|
return {
|
|
53461
53385
|
...base,
|
|
53462
53386
|
identifier: stringValue(local.identifier, base.identifier),
|
|
@@ -53487,9 +53411,9 @@ function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
|
53487
53411
|
formRef: local.formRef === void 0 ? base.formRef : nullishToNull(
|
|
53488
53412
|
typeof local.formRef === "string" ? local.formRef : void 0
|
|
53489
53413
|
),
|
|
53490
|
-
content: local.content === void 0 ? base.content :
|
|
53491
|
-
settings: local.settings === void 0 ? base.settings :
|
|
53492
|
-
presentation: local.presentation === void 0 ? base.presentation :
|
|
53414
|
+
content: local.content === void 0 ? base.content : isRecord18(local.content) ? local.content : {},
|
|
53415
|
+
settings: local.settings === void 0 ? base.settings : isRecord18(local.settings) ? local.settings : {},
|
|
53416
|
+
presentation: local.presentation === void 0 ? base.presentation : isRecord18(local.presentation) ? local.presentation : null,
|
|
53493
53417
|
tags: local.tags === void 0 ? base.tags : Array.isArray(local.tags) ? local.tags : []
|
|
53494
53418
|
};
|
|
53495
53419
|
}
|
|
@@ -53501,7 +53425,7 @@ function toIsoStringOrOriginal(value) {
|
|
|
53501
53425
|
function normalizeCourseSessions(value) {
|
|
53502
53426
|
if (!Array.isArray(value)) return [];
|
|
53503
53427
|
return value.map((session) => {
|
|
53504
|
-
const obj =
|
|
53428
|
+
const obj = isRecord18(session) ? session : {};
|
|
53505
53429
|
return {
|
|
53506
53430
|
startsAt: toIsoStringOrOriginal(obj.startsAt),
|
|
53507
53431
|
endsAt: toIsoStringOrOriginal(obj.endsAt)
|
|
@@ -53513,18 +53437,18 @@ function normalizeCourseSessions(value) {
|
|
|
53513
53437
|
}
|
|
53514
53438
|
function normalizeCourseProgram(value) {
|
|
53515
53439
|
if (value == null) return null;
|
|
53516
|
-
if (!
|
|
53440
|
+
if (!isRecord18(value)) {
|
|
53517
53441
|
return { identifier: null, data: {} };
|
|
53518
53442
|
}
|
|
53519
53443
|
return {
|
|
53520
53444
|
identifier: nullishToNull(
|
|
53521
53445
|
typeof value.identifier === "string" ? value.identifier : void 0
|
|
53522
53446
|
),
|
|
53523
|
-
data:
|
|
53447
|
+
data: isRecord18(value.data) ? value.data : {}
|
|
53524
53448
|
};
|
|
53525
53449
|
}
|
|
53526
53450
|
function normalizeRemoteCourseForCompare(course) {
|
|
53527
|
-
const obj =
|
|
53451
|
+
const obj = isRecord18(course) ? course : {};
|
|
53528
53452
|
return {
|
|
53529
53453
|
identifier: String(obj.identifier),
|
|
53530
53454
|
title: String(obj.title),
|
|
@@ -53559,7 +53483,7 @@ function normalizeRemoteCourseForCompare(course) {
|
|
|
53559
53483
|
};
|
|
53560
53484
|
}
|
|
53561
53485
|
function normalizeLocalCourseAgainstRemoteForCompare(localCourse, remoteCourse) {
|
|
53562
|
-
const local =
|
|
53486
|
+
const local = isRecord18(localCourse) ? localCourse : {};
|
|
53563
53487
|
const base = remoteCourse ? normalizeRemoteCourseForCompare(remoteCourse) : normalizeRemoteCourseForCompare({
|
|
53564
53488
|
identifier: local.identifier,
|
|
53565
53489
|
title: local.title,
|
|
@@ -53580,11 +53504,11 @@ function normalizeLocalCourseAgainstRemoteForCompare(localCourse, remoteCourse)
|
|
|
53580
53504
|
});
|
|
53581
53505
|
const status = local.status === void 0 ? base.status : local.status === "active" || local.status === "cancelled" || local.status === "completed" ? local.status : "draft";
|
|
53582
53506
|
const visibility = local.visibility === void 0 ? base.visibility : local.visibility === "public" || local.visibility === "private" || local.visibility === "unlisted" ? local.visibility : "public";
|
|
53583
|
-
const program2 = local.program === void 0 ? base.program : local.program === null ? null :
|
|
53507
|
+
const program2 = local.program === void 0 ? base.program : local.program === null ? null : isRecord18(local.program) ? {
|
|
53584
53508
|
identifier: local.program.identifier === void 0 ? base.program?.identifier ?? null : nullishToNull(
|
|
53585
53509
|
typeof local.program.identifier === "string" ? local.program.identifier : void 0
|
|
53586
53510
|
),
|
|
53587
|
-
data:
|
|
53511
|
+
data: isRecord18(local.program.data) ? local.program.data : base.program?.data ?? {}
|
|
53588
53512
|
} : base.program;
|
|
53589
53513
|
return {
|
|
53590
53514
|
...base,
|
|
@@ -54351,7 +54275,8 @@ var salesWindowSchema = z.object({
|
|
|
54351
54275
|
});
|
|
54352
54276
|
});
|
|
54353
54277
|
function validateChronologicalFields(input) {
|
|
54354
|
-
if (
|
|
54278
|
+
if (input.start === void 0 || input.start.length === 0) return;
|
|
54279
|
+
if (input.end === void 0 || input.end.length === 0) return;
|
|
54355
54280
|
if (Date.parse(input.start) < Date.parse(input.end)) return;
|
|
54356
54281
|
input.ctx.addIssue({
|
|
54357
54282
|
code: "custom",
|
|
@@ -54535,7 +54460,7 @@ var upsertNavigationMenuCommandSchema = z.object({
|
|
|
54535
54460
|
location: z.enum(navigationLocations).optional(),
|
|
54536
54461
|
role: z.enum(navigationMenuRoles).optional(),
|
|
54537
54462
|
items: z.array(navigationItemSchema).readonly()
|
|
54538
|
-
}).strict().refine((input) => input.name || input.location, {
|
|
54463
|
+
}).strict().refine((input) => input.name !== void 0 || input.location !== void 0, {
|
|
54539
54464
|
message: "Navigation commands require either input.name or input.location."
|
|
54540
54465
|
})
|
|
54541
54466
|
}).strict();
|
|
@@ -54875,14 +54800,14 @@ var upsertBookingPassProductCommandSchema = z.object({
|
|
|
54875
54800
|
productUseCase: z.enum(bookingPassProductUseCases).default("event_pass"),
|
|
54876
54801
|
appointmentScope: appointmentPackageScopeSchema.optional()
|
|
54877
54802
|
}).strict().superRefine((input, ctx) => {
|
|
54878
|
-
if (input.productUseCase === "event_pass" && input.appointmentScope) {
|
|
54803
|
+
if (input.productUseCase === "event_pass" && input.appointmentScope !== void 0) {
|
|
54879
54804
|
ctx.addIssue({
|
|
54880
54805
|
code: "custom",
|
|
54881
54806
|
path: ["appointmentScope"],
|
|
54882
54807
|
message: "appointmentScope is only valid for appointment_package passes"
|
|
54883
54808
|
});
|
|
54884
54809
|
}
|
|
54885
|
-
if (input.productUseCase === "appointment_package" &&
|
|
54810
|
+
if (input.productUseCase === "appointment_package" && input.appointmentScope === void 0) {
|
|
54886
54811
|
ctx.addIssue({
|
|
54887
54812
|
code: "custom",
|
|
54888
54813
|
path: ["appointmentScope"],
|
|
@@ -55191,7 +55116,7 @@ var siteCommandBatchSchema = z.object({
|
|
|
55191
55116
|
commands: z.array(siteCommandSchema).readonly()
|
|
55192
55117
|
}).strict();
|
|
55193
55118
|
function entryIdentifierForCommand(command) {
|
|
55194
|
-
if (command.input.identifier) return command.input.identifier;
|
|
55119
|
+
if (command.input.identifier !== void 0 && command.input.identifier.length > 0) return command.input.identifier;
|
|
55195
55120
|
switch (command.type) {
|
|
55196
55121
|
case "upsertContentEntry":
|
|
55197
55122
|
return refSlug(command.ref);
|
|
@@ -55202,13 +55127,13 @@ function entryIdentifierForCommand(command) {
|
|
|
55202
55127
|
}
|
|
55203
55128
|
}
|
|
55204
55129
|
function pageIdentifierForCommand(command) {
|
|
55205
|
-
if (command.input.identifier) return command.input.identifier;
|
|
55130
|
+
if (command.input.identifier !== void 0 && command.input.identifier.length > 0) return command.input.identifier;
|
|
55206
55131
|
switch (command.type) {
|
|
55207
55132
|
case "upsertPage":
|
|
55208
55133
|
return refSlug(command.ref);
|
|
55209
55134
|
case "publishPage":
|
|
55210
55135
|
case "unpublishPage": {
|
|
55211
|
-
if (
|
|
55136
|
+
if (command.input.pageRef === void 0) {
|
|
55212
55137
|
throw new Error(`Page command ${command.ref} is missing identifier and pageRef.`);
|
|
55213
55138
|
}
|
|
55214
55139
|
return refSlug(command.input.pageRef);
|
|
@@ -55222,7 +55147,7 @@ function pageIdentifierForBlockCommand(command) {
|
|
|
55222
55147
|
return command.input.pageIdentifier;
|
|
55223
55148
|
}
|
|
55224
55149
|
function blockIdentifierForCommand(command) {
|
|
55225
|
-
if (command.input.identifier) return command.input.identifier;
|
|
55150
|
+
if (command.input.identifier !== void 0 && command.input.identifier.length > 0) return command.input.identifier;
|
|
55226
55151
|
switch (command.type) {
|
|
55227
55152
|
case "upsertPageBlock":
|
|
55228
55153
|
return refSlug(command.ref);
|
|
@@ -55828,7 +55753,7 @@ function getSiteCommandMetadata(type) {
|
|
|
55828
55753
|
}
|
|
55829
55754
|
function getSiteCommandLifecycleIntent(command) {
|
|
55830
55755
|
if (command.type === "ensureTeamMemberProfile") {
|
|
55831
|
-
return command.input.publish ? "publish" : "mutation";
|
|
55756
|
+
return command.input.publish === true ? "publish" : "mutation";
|
|
55832
55757
|
}
|
|
55833
55758
|
return getSiteCommandMetadata(command.type).lifecycleIntent;
|
|
55834
55759
|
}
|
|
@@ -55837,7 +55762,7 @@ function getSiteCommandLifecycleIntent(command) {
|
|
|
55837
55762
|
init_src();
|
|
55838
55763
|
|
|
55839
55764
|
// ../site-commands/src/guards.ts
|
|
55840
|
-
function
|
|
55765
|
+
function isRecord19(value) {
|
|
55841
55766
|
return typeof value === "object" && value !== null;
|
|
55842
55767
|
}
|
|
55843
55768
|
|
|
@@ -55983,7 +55908,7 @@ function commandRefContributions(command) {
|
|
|
55983
55908
|
provides: [{ ref: command.ref, field: "ref" }],
|
|
55984
55909
|
requires: [
|
|
55985
55910
|
{ ref: command.input.resourceRef, field: "input.resourceRef" },
|
|
55986
|
-
...command.input.serviceRef ? [{ ref: command.input.serviceRef, field: "input.serviceRef" }] : []
|
|
55911
|
+
...command.input.serviceRef !== void 0 && command.input.serviceRef !== null ? [{ ref: command.input.serviceRef, field: "input.serviceRef" }] : []
|
|
55987
55912
|
]
|
|
55988
55913
|
};
|
|
55989
55914
|
case "upsertBlockTree":
|
|
@@ -55997,22 +55922,22 @@ function commandRefContributions(command) {
|
|
|
55997
55922
|
case "upsertPageBlock":
|
|
55998
55923
|
return {
|
|
55999
55924
|
provides: [{ ref: command.ref, field: "ref" }],
|
|
56000
|
-
requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
55925
|
+
requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
56001
55926
|
};
|
|
56002
55927
|
case "patchPageBlockContent":
|
|
56003
55928
|
return {
|
|
56004
55929
|
provides: [],
|
|
56005
|
-
requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
55930
|
+
requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
56006
55931
|
};
|
|
56007
55932
|
case "deletePageBlock":
|
|
56008
55933
|
return {
|
|
56009
55934
|
provides: [],
|
|
56010
|
-
requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
55935
|
+
requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
56011
55936
|
};
|
|
56012
55937
|
case "reorderPageBlocks":
|
|
56013
55938
|
return {
|
|
56014
55939
|
provides: [{ ref: command.ref, field: "ref" }],
|
|
56015
|
-
requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : [],
|
|
55940
|
+
requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : [],
|
|
56016
55941
|
requiresIfProvided: command.input.blocks.map((block, index) => ({
|
|
56017
55942
|
ref: block.blockRef,
|
|
56018
55943
|
field: `input.blocks[${index}].blockRef`
|
|
@@ -56022,7 +55947,7 @@ function commandRefContributions(command) {
|
|
|
56022
55947
|
return {
|
|
56023
55948
|
provides: [{ ref: command.ref, field: "ref" }],
|
|
56024
55949
|
requires: [
|
|
56025
|
-
...command.input.linkedSubjectRef ? [{ ref: command.input.linkedSubjectRef, field: "input.linkedSubjectRef" }] : [],
|
|
55950
|
+
...command.input.linkedSubjectRef !== void 0 ? [{ ref: command.input.linkedSubjectRef, field: "input.linkedSubjectRef" }] : [],
|
|
56026
55951
|
...(command.input.mediaRefs ?? []).map((ref, index) => ({
|
|
56027
55952
|
ref,
|
|
56028
55953
|
field: `input.mediaRefs[${index}]`
|
|
@@ -56039,18 +55964,18 @@ function commandRefContributions(command) {
|
|
|
56039
55964
|
case "unpublishPage":
|
|
56040
55965
|
return {
|
|
56041
55966
|
provides: [],
|
|
56042
|
-
requires: command.input.pageRef ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
55967
|
+
requires: command.input.pageRef !== void 0 ? [{ ref: command.input.pageRef, field: "input.pageRef" }] : []
|
|
56043
55968
|
};
|
|
56044
55969
|
case "publishContentEntry":
|
|
56045
55970
|
return {
|
|
56046
55971
|
provides: [],
|
|
56047
|
-
requires: command.input.contentEntryRef ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
|
|
55972
|
+
requires: command.input.contentEntryRef !== void 0 ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
|
|
56048
55973
|
};
|
|
56049
55974
|
case "unpublishContentEntry":
|
|
56050
55975
|
case "deleteContentEntry":
|
|
56051
55976
|
return {
|
|
56052
55977
|
provides: [],
|
|
56053
|
-
requires: command.input.contentEntryRef ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
|
|
55978
|
+
requires: command.input.contentEntryRef !== void 0 ? [{ ref: command.input.contentEntryRef, field: "input.contentEntryRef" }] : []
|
|
56054
55979
|
};
|
|
56055
55980
|
default:
|
|
56056
55981
|
return assertNever(command);
|
|
@@ -56095,14 +56020,14 @@ function collectOfferingRequires(input, intervals, intervalPath) {
|
|
|
56095
56020
|
];
|
|
56096
56021
|
}
|
|
56097
56022
|
function optionalRef(ref, field) {
|
|
56098
|
-
return ref ? [{ ref, field }] : [];
|
|
56023
|
+
return ref !== void 0 && ref.length > 0 ? [{ ref, field }] : [];
|
|
56099
56024
|
}
|
|
56100
56025
|
function collectVenueRefsFromIntervals(intervals, path28) {
|
|
56101
56026
|
return intervals.flatMap((interval, index) => optionalRef(interval.venueRef, `${path28}[${index}].venueRef`));
|
|
56102
56027
|
}
|
|
56103
56028
|
function collectNavigationRefs(items, path28) {
|
|
56104
56029
|
return items.flatMap((item, index) => {
|
|
56105
|
-
if (!
|
|
56030
|
+
if (!isRecord19(item)) return [];
|
|
56106
56031
|
const itemPath = `${path28}[${index}]`;
|
|
56107
56032
|
const refs = [];
|
|
56108
56033
|
if (typeof item.pageRef === "string") {
|
|
@@ -56119,7 +56044,7 @@ function collectNavigationRefs(items, path28) {
|
|
|
56119
56044
|
}
|
|
56120
56045
|
function collectBlockRefs(blocks, path28) {
|
|
56121
56046
|
return blocks.flatMap((block, index) => {
|
|
56122
|
-
if (!
|
|
56047
|
+
if (!isRecord19(block)) return [];
|
|
56123
56048
|
const blockPath = `${path28}[${index}]`;
|
|
56124
56049
|
return [
|
|
56125
56050
|
...collectNestedRefs(block.props, `${blockPath}.props`),
|
|
@@ -56135,7 +56060,7 @@ function collectNestedRefs(value, path28) {
|
|
|
56135
56060
|
if (Array.isArray(value)) {
|
|
56136
56061
|
return value.flatMap((item, index) => collectNestedRefs(item, `${path28}[${index}]`));
|
|
56137
56062
|
}
|
|
56138
|
-
if (!
|
|
56063
|
+
if (!isRecord19(value)) return [];
|
|
56139
56064
|
return Object.entries(value).flatMap(([key, child]) => collectNestedRefs(child, `${path28}.${key}`));
|
|
56140
56065
|
}
|
|
56141
56066
|
|
|
@@ -56160,19 +56085,19 @@ function eventSeriesStaticExecutionGaps(command) {
|
|
|
56160
56085
|
"event_external_payment_unsupported",
|
|
56161
56086
|
"External-payment event commands need public checkout/link policy mapping before mutation."
|
|
56162
56087
|
)] : [],
|
|
56163
|
-
...command.input.waitlist && command.input.waitlist.kind !== "disabled" ? [staticGap(
|
|
56088
|
+
...command.input.waitlist !== void 0 && command.input.waitlist.kind !== "disabled" ? [staticGap(
|
|
56164
56089
|
"event_waitlist_requires_waitlist_adapter",
|
|
56165
56090
|
"Event waitlist commands need waitlist service mapping before mutation."
|
|
56166
56091
|
)] : [],
|
|
56167
|
-
...command.input.content?.imageRef || command.input.content?.mediaRefs ? [staticGap(
|
|
56092
|
+
...command.input.content?.imageRef !== void 0 || command.input.content?.mediaRefs !== void 0 ? [staticGap(
|
|
56168
56093
|
"event_media_content_requires_media_adapter",
|
|
56169
56094
|
"Event media content needs media adapter mapping before mutation."
|
|
56170
56095
|
)] : [],
|
|
56171
|
-
...command.input.content?.contentEntryRef ? [staticGap(
|
|
56096
|
+
...command.input.content?.contentEntryRef !== void 0 ? [staticGap(
|
|
56172
56097
|
"event_linked_content_requires_content_adapter",
|
|
56173
56098
|
"Event linked content-entry refs need content adapter mapping before mutation."
|
|
56174
56099
|
)] : [],
|
|
56175
|
-
...command.input.staffRefs?.length ? [staticGap(
|
|
56100
|
+
...(command.input.staffRefs?.length ?? 0) > 0 ? [staticGap(
|
|
56176
56101
|
"event_staff_assignment_unsupported",
|
|
56177
56102
|
"Event staff refs need staff assignment mapping before mutation."
|
|
56178
56103
|
)] : [],
|
|
@@ -56198,11 +56123,11 @@ function courseStaticExecutionGaps(command) {
|
|
|
56198
56123
|
"course_external_payment_unsupported",
|
|
56199
56124
|
"External-payment course commands need public checkout/link policy mapping before mutation."
|
|
56200
56125
|
)] : [],
|
|
56201
|
-
...command.input.waitlist && command.input.waitlist.kind !== "disabled" ? [staticGap(
|
|
56126
|
+
...command.input.waitlist !== void 0 && command.input.waitlist.kind !== "disabled" ? [staticGap(
|
|
56202
56127
|
"course_waitlist_requires_waitlist_adapter",
|
|
56203
56128
|
"Course waitlist commands need waitlist service mapping before mutation."
|
|
56204
56129
|
)] : [],
|
|
56205
|
-
...command.input.staffRefs?.length ? [staticGap(
|
|
56130
|
+
...(command.input.staffRefs?.length ?? 0) > 0 ? [staticGap(
|
|
56206
56131
|
"course_staff_assignment_unsupported",
|
|
56207
56132
|
"Course staff refs need staff assignment mapping before mutation."
|
|
56208
56133
|
)] : []
|
|
@@ -56391,9 +56316,9 @@ function deriveIdempotencyKey(input) {
|
|
|
56391
56316
|
].join("|"));
|
|
56392
56317
|
}
|
|
56393
56318
|
function findUnknownCommandTypes(input) {
|
|
56394
|
-
if (!
|
|
56319
|
+
if (!isRecord19(input) || !Array.isArray(input.commands)) return [];
|
|
56395
56320
|
return input.commands.flatMap((command, commandIndex) => {
|
|
56396
|
-
if (!
|
|
56321
|
+
if (!isRecord19(command) || typeof command.type !== "string") return [];
|
|
56397
56322
|
if (commandTypeSet.has(command.type)) return [];
|
|
56398
56323
|
return [{
|
|
56399
56324
|
code: "unknown_command_type",
|
|
@@ -56419,9 +56344,9 @@ function commandIndexForIssuePath(path28) {
|
|
|
56419
56344
|
return path28[0] === "commands" && typeof path28[1] === "number" ? path28[1] : -1;
|
|
56420
56345
|
}
|
|
56421
56346
|
function commandTypeForIssue(input, commandIndex) {
|
|
56422
|
-
if (!
|
|
56347
|
+
if (!isRecord19(input) || !isUnknownArray3(input.commands)) return null;
|
|
56423
56348
|
const command = input.commands[commandIndex];
|
|
56424
|
-
return
|
|
56349
|
+
return isRecord19(command) && typeof command.type === "string" ? command.type : null;
|
|
56425
56350
|
}
|
|
56426
56351
|
function isUnknownArray3(value) {
|
|
56427
56352
|
return Array.isArray(value);
|
|
@@ -56469,7 +56394,7 @@ function validateBatchRefs(batch) {
|
|
|
56469
56394
|
requiresByCommand.set(command.ref, [...dedupeContributions(requires)]);
|
|
56470
56395
|
for (const { ref } of provides) {
|
|
56471
56396
|
const existing = providerByRef.get(ref);
|
|
56472
|
-
if (existing) {
|
|
56397
|
+
if (existing !== void 0) {
|
|
56473
56398
|
errors.push({
|
|
56474
56399
|
code: "duplicate_resource_ref",
|
|
56475
56400
|
resourceRef: ref,
|
|
@@ -56526,7 +56451,7 @@ function addInBatchProvidedRefRequirement(input) {
|
|
|
56526
56451
|
const nextRequires = [...dedupeContributions([...currentRequires, input.requirement])];
|
|
56527
56452
|
input.requiresByCommand.set(input.commandRef, nextRequires);
|
|
56528
56453
|
const contribution = input.contributionsByCommand.get(input.commandRef);
|
|
56529
|
-
if (contribution) {
|
|
56454
|
+
if (contribution !== void 0) {
|
|
56530
56455
|
input.contributionsByCommand.set(input.commandRef, {
|
|
56531
56456
|
...contribution,
|
|
56532
56457
|
requires: nextRequires
|
|
@@ -56572,7 +56497,7 @@ function checkPortalOrdersHaveUniqueSubjects(batch) {
|
|
|
56572
56497
|
if (command.type !== "seedPortalOrder") continue;
|
|
56573
56498
|
const key = portalOrderSubjectKey(command.input.subject);
|
|
56574
56499
|
const previous = seenBySubject.get(key);
|
|
56575
|
-
if (previous) {
|
|
56500
|
+
if (previous !== void 0) {
|
|
56576
56501
|
errors.push(commandInvariantViolation(
|
|
56577
56502
|
command.ref,
|
|
56578
56503
|
"input.subject",
|
|
@@ -56694,7 +56619,7 @@ function checkTicketQuantitiesWithinCapacity(indexes) {
|
|
|
56694
56619
|
function checkTicketsTargetTicketPricedEvents(indexes) {
|
|
56695
56620
|
return indexes.ticketGroups.flatMap((tickets) => tickets.flatMap((ticket) => {
|
|
56696
56621
|
const event = indexes.eventByRef.get(ticket.input.eventRef);
|
|
56697
|
-
if (
|
|
56622
|
+
if (event === void 0 || event.input.pricing.kind === "ticket_types") return [];
|
|
56698
56623
|
return [commandInvariantViolation(
|
|
56699
56624
|
ticket.ref,
|
|
56700
56625
|
"input.eventRef",
|
|
@@ -56705,10 +56630,10 @@ function checkTicketsTargetTicketPricedEvents(indexes) {
|
|
|
56705
56630
|
function checkTicketCurrencyMatchesEvent(indexes) {
|
|
56706
56631
|
return indexes.ticketGroups.flatMap((tickets) => tickets.flatMap((ticket) => {
|
|
56707
56632
|
const event = indexes.eventByRef.get(ticket.input.eventRef);
|
|
56708
|
-
if (
|
|
56633
|
+
if (event === void 0 || event.input.pricing.kind !== "ticket_types") return [];
|
|
56709
56634
|
const expectedCurrency = event.input.pricing.currency;
|
|
56710
56635
|
const ticketCurrency = ticket.input.price.currency;
|
|
56711
|
-
if (!expectedCurrency || !ticketCurrency || ticketCurrency === expectedCurrency) return [];
|
|
56636
|
+
if (!hasText(expectedCurrency) || !hasText(ticketCurrency) || ticketCurrency === expectedCurrency) return [];
|
|
56712
56637
|
return [commandInvariantViolation(
|
|
56713
56638
|
ticket.ref,
|
|
56714
56639
|
"input.price.currency",
|
|
@@ -56736,10 +56661,11 @@ function orderCommands(commands, providerByRef, requiresByCommand) {
|
|
|
56736
56661
|
const requires = requiresByCommand.get(command.ref) ?? [];
|
|
56737
56662
|
for (const { ref } of requires) {
|
|
56738
56663
|
const provider = providerByRef.get(ref);
|
|
56739
|
-
if (
|
|
56664
|
+
if (provider === void 0 || provider === command.ref) continue;
|
|
56740
56665
|
if (!outgoing.has(provider)) outgoing.set(provider, /* @__PURE__ */ new Set());
|
|
56741
|
-
|
|
56742
|
-
|
|
56666
|
+
const dependents = outgoing.get(provider);
|
|
56667
|
+
if (dependents !== void 0 && !dependents.has(command.ref)) {
|
|
56668
|
+
dependents.add(command.ref);
|
|
56743
56669
|
indegree.set(command.ref, (indegree.get(command.ref) ?? 0) + 1);
|
|
56744
56670
|
}
|
|
56745
56671
|
}
|
|
@@ -56749,9 +56675,9 @@ function orderCommands(commands, providerByRef, requiresByCommand) {
|
|
|
56749
56675
|
while (ready.length > 0) {
|
|
56750
56676
|
ready.sort((left, right) => (authorIndex.get(left) ?? 0) - (authorIndex.get(right) ?? 0) || left.localeCompare(right));
|
|
56751
56677
|
const nextRef = ready.shift();
|
|
56752
|
-
if (
|
|
56678
|
+
if (nextRef === void 0) continue;
|
|
56753
56679
|
const command = commandByRef.get(nextRef);
|
|
56754
|
-
if (command) ordered.push(command);
|
|
56680
|
+
if (command !== void 0) ordered.push(command);
|
|
56755
56681
|
for (const dependent of outgoing.get(nextRef) ?? []) {
|
|
56756
56682
|
const nextDegree = (indegree.get(dependent) ?? 0) - 1;
|
|
56757
56683
|
indegree.set(dependent, nextDegree);
|
|
@@ -56874,7 +56800,7 @@ function stableStringify(value) {
|
|
|
56874
56800
|
}
|
|
56875
56801
|
function sortValue(value) {
|
|
56876
56802
|
if (Array.isArray(value)) return value.map(sortValue);
|
|
56877
|
-
if (value && typeof value === "object") return sortRecord(value);
|
|
56803
|
+
if (value !== null && typeof value === "object") return sortRecord(value);
|
|
56878
56804
|
return value;
|
|
56879
56805
|
}
|
|
56880
56806
|
function sortRecord(record) {
|
|
@@ -57735,8 +57661,8 @@ function eventContentInput(content) {
|
|
|
57735
57661
|
if (!content) return void 0;
|
|
57736
57662
|
return {
|
|
57737
57663
|
...content.summary ? { summary: content.summary } : {},
|
|
57738
|
-
...typeof content.body === "string" ||
|
|
57739
|
-
...typeof content.image === "string" ||
|
|
57664
|
+
...typeof content.body === "string" || isRecord20(content.body) ? { body: content.body } : {},
|
|
57665
|
+
...typeof content.image === "string" || isRecord20(content.image) ? { image: content.image } : {}
|
|
57740
57666
|
};
|
|
57741
57667
|
}
|
|
57742
57668
|
function courseUpsertInput(command) {
|
|
@@ -57917,7 +57843,7 @@ function toUtcIso(date, time) {
|
|
|
57917
57843
|
const normalizedTime = time.length === 5 ? `${time}:00` : time;
|
|
57918
57844
|
return (/* @__PURE__ */ new Date(`${date}T${normalizedTime}Z`)).toISOString();
|
|
57919
57845
|
}
|
|
57920
|
-
function
|
|
57846
|
+
function isRecord20(value) {
|
|
57921
57847
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
57922
57848
|
}
|
|
57923
57849
|
function unsupported(identifier, message) {
|
|
@@ -58671,6 +58597,8 @@ function recordNavigationFailure(result, identifier, message) {
|
|
|
58671
58597
|
|
|
58672
58598
|
// src/cli/site-commands/pageCommands.ts
|
|
58673
58599
|
init_src();
|
|
58600
|
+
|
|
58601
|
+
// src/cli/sync/validation.ts
|
|
58674
58602
|
function assertNeverField(field) {
|
|
58675
58603
|
throw new Error(`Unhandled field type while extracting field ids: ${JSON.stringify(field)}`);
|
|
58676
58604
|
}
|
|
@@ -58748,31 +58676,17 @@ function getDataKeys(data) {
|
|
|
58748
58676
|
return new Set(Object.keys(data));
|
|
58749
58677
|
}
|
|
58750
58678
|
function validateBlockContent(data, manifest, customFields) {
|
|
58751
|
-
const
|
|
58752
|
-
|
|
58753
|
-
|
|
58754
|
-
|
|
58755
|
-
|
|
58756
|
-
|
|
58757
|
-
|
|
58758
|
-
|
|
58759
|
-
|
|
58760
|
-
|
|
58761
|
-
|
|
58762
|
-
for (const issue5 of error.issues) {
|
|
58763
|
-
const fieldPath = issue5.path.join(".");
|
|
58764
|
-
if (issue5.code === "invalid_type" && issue5.received === "undefined") {
|
|
58765
|
-
continue;
|
|
58766
|
-
}
|
|
58767
|
-
warnings.push({
|
|
58768
|
-
type: "invalid_content",
|
|
58769
|
-
field: fieldPath || "(root)",
|
|
58770
|
-
message: `Invalid content${fieldPath ? ` in "${fieldPath}"` : ""}: ${issue5.message}`
|
|
58771
|
-
});
|
|
58772
|
-
}
|
|
58773
|
-
}
|
|
58774
|
-
}
|
|
58775
|
-
return warnings;
|
|
58679
|
+
const manifestWithCustomFields = customFields ? { ...manifest, fields: [...manifest.fields, ...customFields] } : manifest;
|
|
58680
|
+
const normalizedFields = parseFieldDefinitions([...manifestWithCustomFields.fields]);
|
|
58681
|
+
const validation = validateManifestContentForPush(normalizedFields, data);
|
|
58682
|
+
if (validation.kind === "valid") return [];
|
|
58683
|
+
return validation.issues.filter((issue5) => !isTopLevelRequiredManifestContentIssue(issue5)).map((issue5) => {
|
|
58684
|
+
return {
|
|
58685
|
+
type: "invalid_content",
|
|
58686
|
+
field: issue5.field || "(root)",
|
|
58687
|
+
message: formatManifestContentValidationIssue(issue5)
|
|
58688
|
+
};
|
|
58689
|
+
});
|
|
58776
58690
|
}
|
|
58777
58691
|
function validateBlockData(data, manifest, customFields) {
|
|
58778
58692
|
const warnings = [];
|
|
@@ -64119,7 +64033,7 @@ var THEME_FIELD_CATEGORY_MAP = {
|
|
|
64119
64033
|
};
|
|
64120
64034
|
|
|
64121
64035
|
// src/cli/init-docs/zod-to-markdown.ts
|
|
64122
|
-
function
|
|
64036
|
+
function isRecord21(value) {
|
|
64123
64037
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
64124
64038
|
}
|
|
64125
64039
|
function isZodTypeAny(value) {
|
|
@@ -64247,7 +64161,7 @@ function extractLiteralValue(schema) {
|
|
|
64247
64161
|
const typeName = getTypeName(schema);
|
|
64248
64162
|
if (typeName !== ZodTypeName.ZodLiteral) return void 0;
|
|
64249
64163
|
const def = schema._def;
|
|
64250
|
-
if (!
|
|
64164
|
+
if (!isRecord21(def)) return void 0;
|
|
64251
64165
|
return String(def.value);
|
|
64252
64166
|
}
|
|
64253
64167
|
function extractSchemaInfo(schema, skipFields = []) {
|
|
@@ -64317,7 +64231,7 @@ function extractFieldInfo(name, schema) {
|
|
|
64317
64231
|
}
|
|
64318
64232
|
if (typeName === ZodTypeName.ZodRecord) {
|
|
64319
64233
|
const def = inner._def;
|
|
64320
|
-
const valueSchema =
|
|
64234
|
+
const valueSchema = isRecord21(def) ? def.valueType : void 0;
|
|
64321
64235
|
if (!isZodTypeAny(valueSchema)) {
|
|
64322
64236
|
info.recordValueType = "unknown";
|
|
64323
64237
|
return info;
|
|
@@ -64332,7 +64246,7 @@ function extractFieldInfo(name, schema) {
|
|
|
64332
64246
|
}
|
|
64333
64247
|
} else if (getTypeName(valueInner) === ZodTypeName.ZodRecord) {
|
|
64334
64248
|
const nestedDef = valueInner._def;
|
|
64335
|
-
const nestedValueSchema =
|
|
64249
|
+
const nestedValueSchema = isRecord21(nestedDef) ? nestedDef.valueType : void 0;
|
|
64336
64250
|
if (!isZodTypeAny(nestedValueSchema)) {
|
|
64337
64251
|
info.recordValueType = "record<string, unknown>";
|
|
64338
64252
|
return info;
|
|
@@ -64343,7 +64257,7 @@ function extractFieldInfo(name, schema) {
|
|
|
64343
64257
|
}
|
|
64344
64258
|
if (typeName === ZodTypeName.ZodUnion || typeName === ZodTypeName.ZodDiscriminatedUnion) {
|
|
64345
64259
|
const def = inner._def;
|
|
64346
|
-
const optionsValue =
|
|
64260
|
+
const optionsValue = isRecord21(def) ? def.options : void 0;
|
|
64347
64261
|
const options = Array.isArray(optionsValue) ? optionsValue.filter(isZodTypeAny) : [];
|
|
64348
64262
|
const optionTypes = options.map((opt) => {
|
|
64349
64263
|
const { inner: optInner } = unwrapSchema(opt);
|
|
@@ -64451,6 +64365,12 @@ function buildBlockTypesTemplate() {
|
|
|
64451
64365
|
"",
|
|
64452
64366
|
"Reference list of all built-in CMS block types.",
|
|
64453
64367
|
"The generated section is updated by `riverbankcms init-docs`.",
|
|
64368
|
+
"",
|
|
64369
|
+
"Authoring notes:",
|
|
64370
|
+
"- Fields marked `required` must be present with a valid value.",
|
|
64371
|
+
"- Optional fields may be omitted from pushed JSON; you do not need to include every key or set unused fields to `null`.",
|
|
64372
|
+
"- Defaults shown here document the editor/rendering contract. Include an optional field only when you want to override the default.",
|
|
64373
|
+
"- Required nested fields apply when their parent object or repeater item is present.",
|
|
64454
64374
|
""
|
|
64455
64375
|
].join("\n");
|
|
64456
64376
|
const generated = buildBlockTypesGeneratedSection();
|
|
@@ -64469,6 +64389,12 @@ function buildSiteBlockTypesTemplate(state) {
|
|
|
64469
64389
|
"- System blocks (`block.*`) with `blockFieldExtensions` and `blockFieldOptions` merged in",
|
|
64470
64390
|
"- Custom blocks (`custom.*`) from `riverbank.config.ts`",
|
|
64471
64391
|
"",
|
|
64392
|
+
"Authoring notes:",
|
|
64393
|
+
"- Fields marked `required` must be present with a valid value.",
|
|
64394
|
+
"- Optional fields may be omitted from pushed JSON; you do not need to include every key or set unused fields to `null`.",
|
|
64395
|
+
"- Defaults shown here document the editor/rendering contract. Include an optional field only when you want to override the default.",
|
|
64396
|
+
"- Required nested fields apply when their parent object or repeater item is present.",
|
|
64397
|
+
"",
|
|
64472
64398
|
"The generated section is updated by `riverbankcms init-docs`.",
|
|
64473
64399
|
""
|
|
64474
64400
|
].join("\n");
|
|
@@ -65508,7 +65434,7 @@ var SimpleCache = class {
|
|
|
65508
65434
|
};
|
|
65509
65435
|
|
|
65510
65436
|
// src/version.ts
|
|
65511
|
-
var SDK_VERSION = "0.
|
|
65437
|
+
var SDK_VERSION = "0.91.0";
|
|
65512
65438
|
|
|
65513
65439
|
// src/client/error.ts
|
|
65514
65440
|
var RiverbankApiError = class _RiverbankApiError extends Error {
|
|
@@ -73219,20 +73145,20 @@ var LEGACY_DATA_FIELDS = /* @__PURE__ */ new Set([
|
|
|
73219
73145
|
"cardTitleOverride",
|
|
73220
73146
|
"presentation"
|
|
73221
73147
|
]);
|
|
73222
|
-
function
|
|
73148
|
+
function isRecord22(value) {
|
|
73223
73149
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
73224
73150
|
}
|
|
73225
73151
|
function hasMeaningfulValue(value) {
|
|
73226
73152
|
if (value === void 0 || value === null) return false;
|
|
73227
73153
|
if (typeof value === "string") return value.trim().length > 0;
|
|
73228
73154
|
if (Array.isArray(value)) return value.length > 0;
|
|
73229
|
-
if (
|
|
73155
|
+
if (isRecord22(value)) return Object.keys(value).length > 0;
|
|
73230
73156
|
return true;
|
|
73231
73157
|
}
|
|
73232
73158
|
function normalizeComparable(value) {
|
|
73233
73159
|
if (value === void 0 || value === null) return null;
|
|
73234
73160
|
if (Array.isArray(value)) return value.map(normalizeComparable);
|
|
73235
|
-
if (!
|
|
73161
|
+
if (!isRecord22(value)) return value;
|
|
73236
73162
|
const normalized = {};
|
|
73237
73163
|
for (const key of Object.keys(value).sort()) {
|
|
73238
73164
|
const normalizedValue = normalizeComparable(value[key]);
|
|
@@ -73252,7 +73178,7 @@ function slugFromPath(value) {
|
|
|
73252
73178
|
}
|
|
73253
73179
|
function legacySlugCandidates(legacy) {
|
|
73254
73180
|
const candidates = /* @__PURE__ */ new Set();
|
|
73255
|
-
const data =
|
|
73181
|
+
const data = isRecord22(legacy.entry.data) ? legacy.entry.data : {};
|
|
73256
73182
|
for (const value of [
|
|
73257
73183
|
legacy.entry.slug,
|
|
73258
73184
|
data.slug,
|
|
@@ -73273,7 +73199,7 @@ async function readLegacyEventEntries(contentDir) {
|
|
|
73273
73199
|
const entries = [];
|
|
73274
73200
|
for (const filePath of files) {
|
|
73275
73201
|
const raw = await readJsonFile(filePath);
|
|
73276
|
-
if (!
|
|
73202
|
+
if (!isRecord22(raw)) {
|
|
73277
73203
|
entries.push({
|
|
73278
73204
|
tag: "invalid",
|
|
73279
73205
|
filePath,
|
|
@@ -73281,7 +73207,7 @@ async function readLegacyEventEntries(contentDir) {
|
|
|
73281
73207
|
});
|
|
73282
73208
|
continue;
|
|
73283
73209
|
}
|
|
73284
|
-
if (!
|
|
73210
|
+
if (!isRecord22(raw.data)) {
|
|
73285
73211
|
entries.push({
|
|
73286
73212
|
tag: "invalid",
|
|
73287
73213
|
filePath,
|
|
@@ -73419,7 +73345,7 @@ function mergeLegacyEventIntoCanonical(legacy, event) {
|
|
|
73419
73345
|
conflicts.push(...blocksResult.fields);
|
|
73420
73346
|
}
|
|
73421
73347
|
if (hasMeaningfulValue(data.presentation)) {
|
|
73422
|
-
if (!
|
|
73348
|
+
if (!isRecord22(data.presentation)) {
|
|
73423
73349
|
return { tag: "unmappable", fields: ["data.presentation"] };
|
|
73424
73350
|
}
|
|
73425
73351
|
for (const [key, value] of Object.entries(data.presentation)) {
|