@riverbankcms/sdk 0.89.1 → 0.90.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -4
- package/dist/{PreviewEditorSidebar-JDR64FEC.mjs → PreviewEditorSidebar-FNFRVSIM.mjs} +3 -3
- package/dist/{PreviewEditorUI-67TMJMAF.mjs → PreviewEditorUI-3WXJFQXG.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-2UCIMKUB.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +216 -0
- package/dist/_dts/altcha/src/AltchaWidget.d.ts +1 -1
- package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
- package/dist/_dts/api/src/bookingOperations.d.ts +2 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +4 -2
- package/dist/_dts/api/src/bookings.d.ts +3 -1
- package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
- package/dist/_dts/api/src/index.d.ts +10 -5
- 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 +18 -6
- package/dist/_dts/api/src/request.d.ts +21 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +3 -1
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
- package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
- package/dist/_dts/api/src/types.d.ts +4 -1
- package/dist/_dts/api/src/url.d.ts +6 -3
- package/dist/_dts/block-form/src/utils/visibleWhen.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailCard.d.ts +5 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailGrid.d.ts +9 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/index.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +7 -11
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +6 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +14 -6
- 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 +16 -5
- package/dist/_dts/blocks/src/system/blocks/hero.d.ts +0 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +8 -0
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
- package/dist/_dts/blocks/src/system/constants/events.d.ts +4 -1
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +17 -5
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +51 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/logic.d.ts +1 -17
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +5 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +5 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +7 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +48 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.d.ts +50 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/calendarViewOptions.d.ts +10 -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/eventProductEligibility.d.ts +24 -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/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout-form.d.ts +2 -2
- package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
- package/dist/_dts/content-model/src/entry-slots/sdkBlocks.d.ts +21 -0
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +7 -0
- package/dist/_dts/core/src/event-pricing.d.ts +12 -2
- package/dist/_dts/core/src/money-input.d.ts +18 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +50 -0
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
- package/dist/_dts/media-editor/src/fieldUi.d.ts +6 -0
- package/dist/_dts/media-editor/src/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewThemedSiteDocument.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/SiteChromeEditableSurface.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/themeRuntime.d.ts +6 -0
- package/dist/_dts/preview-next/src/client/sdk/SdkPreviewMode.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/pull-dated-offering-scope.d.ts +10 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +12 -5
- package/dist/_dts/sdk/src/client/management/types.d.ts +6 -55
- package/dist/_dts/sdk/src/components.d.ts +1 -0
- package/dist/_dts/sdk/src/config/field-definitions.d.ts +3 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +3 -1
- package/dist/_dts/sdk/src/next/types.d.ts +8 -11
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +1 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/blocks-theme-scope.d.ts +2 -1
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +8 -7
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +5 -6
- package/dist/_dts/sdk/src/rendering/index.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/themeRuntime.d.ts +26 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +18 -0
- package/dist/_dts/theme-core/src/ResponsiveScope.d.ts +12 -0
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +5 -5
- package/dist/_dts/theme-core/src/cards/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +21 -21
- package/dist/_dts/theme-core/src/schema.d.ts +18 -18
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
- package/dist/_dts/theme-core/src/themeRuntime.d.ts +11 -0
- package/dist/{chunk-F645A5UV.mjs → chunk-BOQXMCSP.mjs} +129 -101
- package/dist/{chunk-7YUAXONX.mjs → chunk-CR2VX432.mjs} +1563 -877
- package/dist/{chunk-HKJQERFR.mjs → chunk-FA6LVZ7C.mjs} +91 -55
- package/dist/{chunk-TGBJWKMP.mjs → chunk-H6TT5ZXI.mjs} +9 -1
- package/dist/{chunk-ZQRBLCW5.mjs → chunk-SYYJZPKU.mjs} +2 -2
- package/dist/{chunk-7N46MZHI.mjs → chunk-UG7I7S7W.mjs} +1 -1
- package/dist/cli/index.mjs +1057 -632
- package/dist/cli/init-docs/content/cli-reference.md +6 -1
- package/dist/cli/init-docs/content/content-management.md +27 -0
- package/dist/client/{accordion-MUCVNGQ7.mjs → accordion-4K7VGZ3I.mjs} +2 -2
- package/dist/client/{bookingForm-PKD6EFIE.mjs → bookingForm-3QXA3CIS.mjs} +26 -271
- package/dist/client/bookings.mjs +1586 -825
- package/dist/client/{carousel-3TKQSNJC.mjs → carousel-BEJKNGQ7.mjs} +3 -3
- package/dist/client/{cart-6XHSZK23.mjs → cart-44BBM6XG.mjs} +7 -8
- package/dist/client/{checkout-FVSPM6FI.mjs → checkout-THMHEYKF.mjs} +7 -8
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-3H5CLFKT.mjs} +8 -0
- package/dist/client/{chunk-ZJZZA5EP.mjs → chunk-4COPESPO.mjs} +13 -16
- package/dist/client/chunk-5AJIMWKS.mjs +436 -0
- package/dist/client/{chunk-UQFY4AHX.mjs → chunk-B4H6QMPY.mjs} +157 -49
- package/dist/client/{chunk-VGLXACVK.mjs → chunk-DQIRKNZE.mjs} +1 -1
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-EJBHK74Y.mjs} +1 -1
- package/dist/client/{chunk-SDIYSQAY.mjs → chunk-HIHOQGIP.mjs} +2 -3
- package/dist/client/{chunk-CQKKFEQD.mjs → chunk-JV7ZNAOU.mjs} +378 -111
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-KNTLBQ3N.mjs} +1 -1
- package/dist/client/{chunk-RSQWWUAD.mjs → chunk-PEDNDLPB.mjs} +4 -4
- package/dist/client/{chunk-EY42X22F.mjs → chunk-SLY6UDAS.mjs} +157 -5
- package/dist/client/{chunk-STJ2NCQM.mjs → chunk-WHZQDPBZ.mjs} +19 -1
- package/dist/client/{chunk-ZT5XE7FK.mjs → chunk-ZIAF2DA4.mjs} +1 -1
- package/dist/client/client.mjs +3552 -2898
- package/dist/client/{courseRegistration-ATZSYDHM.mjs → courseRegistration-URX7RCCK.mjs} +20 -58
- package/dist/client/{eventCalendar-6T2UGKKP.mjs → eventCalendar-GTENOQCE.mjs} +10 -11
- package/dist/client/{eventCombined-Q4VANXVF.mjs → eventCombined-EZVB72MF.mjs} +10 -11
- package/dist/client/{eventDetails-DW37E7VW.mjs → eventDetails-CH4BJR5Z.mjs} +10 -11
- package/dist/client/{eventListing-XURTSAUW.mjs → eventListing-4BVOI5HS.mjs} +10 -11
- package/dist/client/{eventRegistration-MRKEVAXW.mjs → eventRegistration-37LPIKIE.mjs} +10 -11
- package/dist/client/{form-WZZFFGMU.mjs → form-FX3Y54YK.mjs} +7 -7
- package/dist/client/{headerSection-EQYVQBLM.mjs → headerSection-UOZZGVYL.mjs} +3 -3
- package/dist/client/hooks.mjs +1169 -1063
- package/dist/client/{locationMap-MFF5VAZR.mjs → locationMap-VSIPKV35.mjs} +3 -3
- package/dist/client/{newsletterForm-JQ77UYIE.mjs → newsletterForm-6FRJKNAF.mjs} +5 -5
- package/dist/client/{productDetail-25LMT3IZ.mjs → productDetail-6AHMLXCO.mjs} +7 -8
- package/dist/client/{productList-5ABEMKUG.mjs → productList-M2CYIZVH.mjs} +7 -8
- package/dist/client/rendering/client.mjs +2912 -2316
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +2874 -2230
- package/dist/client/{shop-OMMQZ6YO.mjs → shop-AUOT6GEX.mjs} +7 -8
- package/dist/client/spam-protection.mjs +4 -5
- package/dist/preview-next/before-render.mjs +2 -2
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-WNLBZ3ZH.mjs → sdk-runtime-6GPJNLU6.mjs} +6 -6
- package/dist/server/components.mjs +1856 -1509
- package/dist/server/config-validation.mjs +1394 -1288
- package/dist/server/config.mjs +1394 -1288
- package/dist/server/data.mjs +1169 -1063
- package/dist/server/index.mjs +135 -100
- package/dist/server/navigation.mjs +20 -30
- package/dist/server/next.mjs +1936 -1576
- package/dist/server/page-converter.mjs +1081 -967
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1868 -1521
- package/dist/server/rendering.mjs +1878 -1531
- package/dist/server/routing.mjs +1248 -1089
- package/dist/server/server.mjs +1312 -1171
- package/dist/server/theme-bridge.mjs +8 -5
- package/package.json +3 -3
- package/dist/SdkPreviewModeRuntime-ZBEMRV7N.mjs +0 -8
- package/dist/client/chunk-LQFDYWPJ.mjs +0 -184
- package/dist/client/chunk-ZFHRN6W2.mjs +0 -66
package/dist/cli/index.mjs
CHANGED
|
@@ -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
|
}
|
|
@@ -1545,12 +1548,17 @@ var init_schema2 = __esm({
|
|
|
1545
1548
|
minItems: z.number().int().nonnegative().optional(),
|
|
1546
1549
|
maxItems: z.number().int().nonnegative().optional()
|
|
1547
1550
|
});
|
|
1548
|
-
visibleWhenSchema = z.
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1551
|
+
visibleWhenSchema = z.lazy(
|
|
1552
|
+
() => z.union([
|
|
1553
|
+
visibleWhenPredicateSchema,
|
|
1554
|
+
z.object({
|
|
1555
|
+
allOf: z.array(visibleWhenSchema).min(1)
|
|
1556
|
+
}),
|
|
1557
|
+
z.object({
|
|
1558
|
+
anyOf: z.array(visibleWhenSchema).min(1)
|
|
1559
|
+
})
|
|
1560
|
+
])
|
|
1561
|
+
);
|
|
1554
1562
|
uiSchema = z.object({
|
|
1555
1563
|
widget: z.string().optional(),
|
|
1556
1564
|
// Container/widget presets (used by Group/Repeater widgets themselves, not for widget selection)
|
|
@@ -13388,11 +13396,11 @@ function bind(from, options) {
|
|
|
13388
13396
|
}
|
|
13389
13397
|
});
|
|
13390
13398
|
}
|
|
13391
|
-
function when(
|
|
13399
|
+
function when(path28, options) {
|
|
13392
13400
|
return (node) => ({
|
|
13393
13401
|
...node,
|
|
13394
13402
|
$when: {
|
|
13395
|
-
when: { from:
|
|
13403
|
+
when: { from: path28 },
|
|
13396
13404
|
...options?.equals !== void 0 ? { equals: options.equals } : {},
|
|
13397
13405
|
...options?.not ? { not: true } : {}
|
|
13398
13406
|
}
|
|
@@ -13499,7 +13507,7 @@ var init_builder2 = __esm({
|
|
|
13499
13507
|
});
|
|
13500
13508
|
|
|
13501
13509
|
// ../blocks/src/system/node/fragments/backgroundLayer.ts
|
|
13502
|
-
function backgroundLayer(
|
|
13510
|
+
function backgroundLayer(path28, options = {}) {
|
|
13503
13511
|
const {
|
|
13504
13512
|
styleClassName = "background-style rb-absolute rb-inset-0 rb-z-neg-10 rb-h-full rb-w-full rb-pointer-events-none",
|
|
13505
13513
|
imageClassName,
|
|
@@ -13513,7 +13521,7 @@ function backgroundLayer(path27, options = {}) {
|
|
|
13513
13521
|
className: styleClassName,
|
|
13514
13522
|
style: {
|
|
13515
13523
|
$bind: {
|
|
13516
|
-
from:
|
|
13524
|
+
from: path28,
|
|
13517
13525
|
transforms: [
|
|
13518
13526
|
{
|
|
13519
13527
|
id: "background.resolveStyle",
|
|
@@ -13523,20 +13531,20 @@ function backgroundLayer(path27, options = {}) {
|
|
|
13523
13531
|
}
|
|
13524
13532
|
}
|
|
13525
13533
|
});
|
|
13526
|
-
const imageLayer = createBackgroundImageNode(
|
|
13534
|
+
const imageLayer = createBackgroundImageNode(path28, imageClassName, {
|
|
13527
13535
|
loading: imageLoading,
|
|
13528
13536
|
fetchPriority: imageFetchPriority
|
|
13529
13537
|
});
|
|
13530
|
-
const overlayLayer = createBackgroundOverlayNode(
|
|
13538
|
+
const overlayLayer = createBackgroundOverlayNode(path28, overlayClassName);
|
|
13531
13539
|
return omitImageLayer ? [styleLayer, overlayLayer] : [styleLayer, imageLayer, overlayLayer];
|
|
13532
13540
|
}
|
|
13533
|
-
function createBackgroundImageNode(
|
|
13534
|
-
const imagePath = `${
|
|
13541
|
+
function createBackgroundImageNode(path28, baseClassName = "rb-absolute rb-z-neg-10", options = {}) {
|
|
13542
|
+
const imagePath = `${path28}.image`;
|
|
13535
13543
|
return media(
|
|
13536
13544
|
{
|
|
13537
13545
|
className: {
|
|
13538
13546
|
$bind: {
|
|
13539
|
-
from:
|
|
13547
|
+
from: path28,
|
|
13540
13548
|
transforms: [
|
|
13541
13549
|
{
|
|
13542
13550
|
id: "background.resolveImageClassName",
|
|
@@ -13547,7 +13555,7 @@ function createBackgroundImageNode(path27, baseClassName = "rb-absolute rb-z-neg
|
|
|
13547
13555
|
},
|
|
13548
13556
|
style: {
|
|
13549
13557
|
$bind: {
|
|
13550
|
-
from:
|
|
13558
|
+
from: path28,
|
|
13551
13559
|
transforms: [{ id: "background.resolveImageStyle" }]
|
|
13552
13560
|
}
|
|
13553
13561
|
},
|
|
@@ -13559,8 +13567,8 @@ function createBackgroundImageNode(path27, baseClassName = "rb-absolute rb-z-neg
|
|
|
13559
13567
|
bind(imagePath)
|
|
13560
13568
|
);
|
|
13561
13569
|
}
|
|
13562
|
-
function createBackgroundOverlayNode(
|
|
13563
|
-
const overlayPath = `${
|
|
13570
|
+
function createBackgroundOverlayNode(path28, className = "background-overlay rb-absolute rb-inset-0 rb-z-neg-10 rb-h-full rb-w-full rb-pointer-events-none") {
|
|
13571
|
+
const overlayPath = `${path28}.overlay`;
|
|
13564
13572
|
return el("div", {
|
|
13565
13573
|
className,
|
|
13566
13574
|
style: {
|
|
@@ -14400,10 +14408,10 @@ var init_sectionForegroundStyles = __esm({
|
|
|
14400
14408
|
});
|
|
14401
14409
|
|
|
14402
14410
|
// ../blocks/src/system/transforms/registry/boxStyles.ts
|
|
14403
|
-
function readPath(source,
|
|
14404
|
-
if (!source || !
|
|
14405
|
-
if (!
|
|
14406
|
-
return
|
|
14411
|
+
function readPath(source, path28) {
|
|
14412
|
+
if (!source || !path28) return void 0;
|
|
14413
|
+
if (!path28.includes(".")) return source[path28];
|
|
14414
|
+
return path28.split(".").reduce((acc, segment) => {
|
|
14407
14415
|
if (acc && typeof acc === "object" && segment in acc) {
|
|
14408
14416
|
return acc[segment];
|
|
14409
14417
|
}
|
|
@@ -15395,27 +15403,27 @@ function scopePropValue(value, scope) {
|
|
|
15395
15403
|
}
|
|
15396
15404
|
return value;
|
|
15397
15405
|
}
|
|
15398
|
-
function scopeContentPath(
|
|
15406
|
+
function scopeContentPath(path28, scope) {
|
|
15399
15407
|
if (!scope || scope.length === 0) {
|
|
15400
|
-
return
|
|
15408
|
+
return path28;
|
|
15401
15409
|
}
|
|
15402
|
-
if (
|
|
15410
|
+
if (path28 === "content") {
|
|
15403
15411
|
return `content.${scope}`;
|
|
15404
15412
|
}
|
|
15405
|
-
if (
|
|
15406
|
-
const remainder =
|
|
15413
|
+
if (path28.startsWith("content.")) {
|
|
15414
|
+
const remainder = path28.slice("content.".length);
|
|
15407
15415
|
return remainder.length > 0 ? `content.${scope}.${remainder}` : `content.${scope}`;
|
|
15408
15416
|
}
|
|
15409
|
-
if (
|
|
15410
|
-
return
|
|
15417
|
+
if (path28.startsWith("content[")) {
|
|
15418
|
+
return path28.replace(/^content/, `content.${scope}`);
|
|
15411
15419
|
}
|
|
15412
|
-
if (
|
|
15413
|
-
return
|
|
15420
|
+
if (path28.startsWith("$root.")) {
|
|
15421
|
+
return path28;
|
|
15414
15422
|
}
|
|
15415
|
-
if (
|
|
15416
|
-
return
|
|
15423
|
+
if (path28.includes(".")) {
|
|
15424
|
+
return path28;
|
|
15417
15425
|
}
|
|
15418
|
-
return `content.${scope}.${
|
|
15426
|
+
return `content.${scope}.${path28}`;
|
|
15419
15427
|
}
|
|
15420
15428
|
var FRAGMENT_ID_PATTERN, FIELD_ID_PATTERN, dataLoaderSchema, fragmentDataSchema, fragmentConfigSchema, FragmentConfigError;
|
|
15421
15429
|
var init_types14 = __esm({
|
|
@@ -15700,9 +15708,6 @@ var init_heroCopy = __esm({
|
|
|
15700
15708
|
maxLength: 600
|
|
15701
15709
|
}
|
|
15702
15710
|
],
|
|
15703
|
-
// Layout order is [eyebrow, headline, subheadline]. The hero block's
|
|
15704
|
-
// `splitEditorial` variant reads these nodes by index; keep the order stable
|
|
15705
|
-
// (it fails fast at import if the count changes).
|
|
15706
15711
|
layout: [
|
|
15707
15712
|
text(
|
|
15708
15713
|
{
|
|
@@ -18334,8 +18339,8 @@ function decodeSuccess(value) {
|
|
|
18334
18339
|
function decodeFailure(issues) {
|
|
18335
18340
|
return { ok: false, issues };
|
|
18336
18341
|
}
|
|
18337
|
-
function zodIssuePath(
|
|
18338
|
-
return
|
|
18342
|
+
function zodIssuePath(path28) {
|
|
18343
|
+
return path28.flatMap((segment) => {
|
|
18339
18344
|
if (typeof segment === "string" || typeof segment === "number") {
|
|
18340
18345
|
return [segment];
|
|
18341
18346
|
}
|
|
@@ -18820,7 +18825,7 @@ var init_schemas = __esm({
|
|
|
18820
18825
|
publicCoursesArraySchema = z.array(publicCourseSchema);
|
|
18821
18826
|
}
|
|
18822
18827
|
});
|
|
18823
|
-
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, eventVenueSchema, eventCategorySchema, accessRestrictionSchema, publicCoursePriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
18828
|
+
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, publicEventDestinationSchema, eventVenueSchema, eventCategorySchema, accessRestrictionSchema, publicCoursePriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
18824
18829
|
var init_schemas2 = __esm({
|
|
18825
18830
|
"../blocks/src/system/blocks/events/shared/schemas.ts"() {
|
|
18826
18831
|
init_media2();
|
|
@@ -18830,6 +18835,18 @@ var init_schemas2 = __esm({
|
|
|
18830
18835
|
eventPresetSchema = z.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
18831
18836
|
eventScheduleScopeSchema = z.enum(["recurring", "oneOff"]);
|
|
18832
18837
|
eventDestinationModeSchema = z.enum(["cms-managed", "system-managed"]);
|
|
18838
|
+
publicEventDestinationSchema = z.discriminatedUnion("kind", [
|
|
18839
|
+
z.object({
|
|
18840
|
+
kind: z.literal("native"),
|
|
18841
|
+
mode: eventDestinationModeSchema,
|
|
18842
|
+
path: z.string()
|
|
18843
|
+
}),
|
|
18844
|
+
z.object({
|
|
18845
|
+
kind: z.literal("external"),
|
|
18846
|
+
url: z.string(),
|
|
18847
|
+
label: z.string()
|
|
18848
|
+
})
|
|
18849
|
+
]);
|
|
18833
18850
|
eventVenueSchema = z.object({
|
|
18834
18851
|
id: z.string(),
|
|
18835
18852
|
name: z.string(),
|
|
@@ -18844,7 +18861,7 @@ var init_schemas2 = __esm({
|
|
|
18844
18861
|
name: z.string(),
|
|
18845
18862
|
color: z.string().nullable()
|
|
18846
18863
|
});
|
|
18847
|
-
z.enum(["free", "paid"]);
|
|
18864
|
+
z.enum(["free", "paid", "external"]);
|
|
18848
18865
|
accessRestrictionSchema = z.enum(["none", "category"]);
|
|
18849
18866
|
z.enum(["single", "ticket_types"]);
|
|
18850
18867
|
publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
@@ -18865,6 +18882,7 @@ var init_schemas2 = __esm({
|
|
|
18865
18882
|
currency: z.string()
|
|
18866
18883
|
}),
|
|
18867
18884
|
z.object({ kind: z.literal("unavailable"), currency: z.string() }),
|
|
18885
|
+
z.object({ kind: z.literal("external"), label: z.string() }),
|
|
18868
18886
|
z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
18869
18887
|
]);
|
|
18870
18888
|
publicEventTicketTypePriceDisplaySchema = z.union([
|
|
@@ -18943,6 +18961,10 @@ var init_schemas2 = __esm({
|
|
|
18943
18961
|
z.object({
|
|
18944
18962
|
kind: z.literal("course"),
|
|
18945
18963
|
display: z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
18964
|
+
}),
|
|
18965
|
+
z.object({
|
|
18966
|
+
kind: z.literal("external"),
|
|
18967
|
+
display: z.object({ kind: z.literal("external"), label: z.string() })
|
|
18946
18968
|
})
|
|
18947
18969
|
]);
|
|
18948
18970
|
publicTeamMemberSummarySchema = z.object({
|
|
@@ -18971,7 +18993,8 @@ var init_schemas2 = __esm({
|
|
|
18971
18993
|
image: mediaSchema2.nullable().optional()
|
|
18972
18994
|
}).optional(),
|
|
18973
18995
|
slug: z.string(),
|
|
18974
|
-
path: z.string(),
|
|
18996
|
+
path: z.string().nullable(),
|
|
18997
|
+
destination: publicEventDestinationSchema,
|
|
18975
18998
|
requiresRegistration: z.boolean(),
|
|
18976
18999
|
deliveryMode: z.enum(["in_person", "online", "hybrid"]),
|
|
18977
19000
|
attendanceModes: z.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -19232,6 +19255,40 @@ var init_shared2 = __esm({
|
|
|
19232
19255
|
init_filtering();
|
|
19233
19256
|
}
|
|
19234
19257
|
});
|
|
19258
|
+
var publicPassProductSchema, publicPassProductCollectionSchema, publicMembershipProductSchema, publicMembershipProductCollectionSchema;
|
|
19259
|
+
var init_shop_shared = __esm({
|
|
19260
|
+
"../blocks/src/system/blocks/shop.shared.ts"() {
|
|
19261
|
+
publicPassProductSchema = z.object({
|
|
19262
|
+
id: z.string(),
|
|
19263
|
+
productUseCase: z.enum(["event_pass", "appointment_package"]).default("event_pass"),
|
|
19264
|
+
name: z.string(),
|
|
19265
|
+
description: z.string().nullable(),
|
|
19266
|
+
price: z.number(),
|
|
19267
|
+
currency: z.string(),
|
|
19268
|
+
creditsTotal: z.number(),
|
|
19269
|
+
pricePerCredit: z.number(),
|
|
19270
|
+
validDays: z.number().nullable(),
|
|
19271
|
+
eligibleCategoryIds: z.array(z.string()),
|
|
19272
|
+
eligibleCategoryNames: z.array(z.string())
|
|
19273
|
+
});
|
|
19274
|
+
publicPassProductCollectionSchema = z.object({
|
|
19275
|
+
passes: z.array(publicPassProductSchema)
|
|
19276
|
+
});
|
|
19277
|
+
publicMembershipProductSchema = z.object({
|
|
19278
|
+
id: z.string(),
|
|
19279
|
+
name: z.string(),
|
|
19280
|
+
description: z.string().nullable(),
|
|
19281
|
+
price: z.number(),
|
|
19282
|
+
currency: z.string(),
|
|
19283
|
+
billingInterval: z.enum(["month", "year"]),
|
|
19284
|
+
eligibleCategoryIds: z.array(z.string()),
|
|
19285
|
+
eligibleCategoryNames: z.array(z.string())
|
|
19286
|
+
});
|
|
19287
|
+
publicMembershipProductCollectionSchema = z.object({
|
|
19288
|
+
memberships: z.array(publicMembershipProductSchema)
|
|
19289
|
+
});
|
|
19290
|
+
}
|
|
19291
|
+
});
|
|
19235
19292
|
var occurrenceContextSchema;
|
|
19236
19293
|
var init_event_registration_shared = __esm({
|
|
19237
19294
|
"../blocks/src/system/blocks/event-registration.shared.ts"() {
|
|
@@ -19251,6 +19308,9 @@ var init_event_registration_shared = __esm({
|
|
|
19251
19308
|
function isEventCalendarDisplayMode(value) {
|
|
19252
19309
|
return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
|
|
19253
19310
|
}
|
|
19311
|
+
function isEventCalendarDefaultView(value) {
|
|
19312
|
+
return typeof value === "string" && eventCalendarDefaultViewValues.includes(value);
|
|
19313
|
+
}
|
|
19254
19314
|
function isEventCalendarListLayout(value) {
|
|
19255
19315
|
return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
|
|
19256
19316
|
}
|
|
@@ -19258,11 +19318,12 @@ function isEventContentType(slug) {
|
|
|
19258
19318
|
if (!slug) return false;
|
|
19259
19319
|
return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
|
|
19260
19320
|
}
|
|
19261
|
-
var EVENT_CONTENT_TYPE_SLUGS, eventCalendarDisplayModeValues, eventCalendarListLayoutValues, eventCalendarListLayoutOptions;
|
|
19321
|
+
var EVENT_CONTENT_TYPE_SLUGS, eventCalendarDisplayModeValues, eventCalendarDefaultViewValues, eventCalendarListLayoutValues, eventCalendarListLayoutOptions;
|
|
19262
19322
|
var init_events = __esm({
|
|
19263
19323
|
"../blocks/src/system/constants/events.ts"() {
|
|
19264
19324
|
EVENT_CONTENT_TYPE_SLUGS = ["event", "events"];
|
|
19265
|
-
eventCalendarDisplayModeValues = ["combined", "
|
|
19325
|
+
eventCalendarDisplayModeValues = ["combined", "calendar", "list", "timetable"];
|
|
19326
|
+
eventCalendarDefaultViewValues = ["month", "week"];
|
|
19266
19327
|
eventCalendarListLayoutValues = ["stack", "grid", "compact"];
|
|
19267
19328
|
eventCalendarListLayoutOptions = [
|
|
19268
19329
|
{ id: "stack", label: "Stack" },
|
|
@@ -19272,11 +19333,44 @@ var init_events = __esm({
|
|
|
19272
19333
|
}
|
|
19273
19334
|
});
|
|
19274
19335
|
|
|
19336
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
19337
|
+
function isRecord4(value) {
|
|
19338
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19339
|
+
}
|
|
19340
|
+
function isRuntimeEventDestination(value) {
|
|
19341
|
+
if (!isRecord4(value) || typeof value.kind !== "string") return false;
|
|
19342
|
+
if (value.kind === "native") {
|
|
19343
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
19344
|
+
}
|
|
19345
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
19346
|
+
}
|
|
19347
|
+
function resolveRuntimeEventDestination(event) {
|
|
19348
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
19349
|
+
return event.destination;
|
|
19350
|
+
}
|
|
19351
|
+
return {
|
|
19352
|
+
kind: "native",
|
|
19353
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
19354
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
19355
|
+
};
|
|
19356
|
+
}
|
|
19357
|
+
var init_destination = __esm({
|
|
19358
|
+
"../blocks/src/system/runtime/nodes/events/shared/destination.ts"() {
|
|
19359
|
+
}
|
|
19360
|
+
});
|
|
19361
|
+
|
|
19275
19362
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
19276
19363
|
function resolveRuntimeEventPricing(event) {
|
|
19277
19364
|
if (isPublicEventPricing(event.pricing)) {
|
|
19278
19365
|
return event.pricing;
|
|
19279
19366
|
}
|
|
19367
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
19368
|
+
if (destination.kind === "external") {
|
|
19369
|
+
return {
|
|
19370
|
+
kind: "external",
|
|
19371
|
+
display: { kind: "external", label: "External registration" }
|
|
19372
|
+
};
|
|
19373
|
+
}
|
|
19280
19374
|
const legacy = event;
|
|
19281
19375
|
const currency = readCurrency(legacy.currency);
|
|
19282
19376
|
if (event.requiresRegistration === false) {
|
|
@@ -19313,22 +19407,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
19313
19407
|
function readCurrency(value) {
|
|
19314
19408
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
19315
19409
|
}
|
|
19316
|
-
function
|
|
19410
|
+
function isRecord5(value) {
|
|
19317
19411
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19318
19412
|
}
|
|
19319
19413
|
function isPublicEventPricing(value) {
|
|
19320
|
-
if (!
|
|
19321
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
19414
|
+
if (!isRecord5(value) || typeof value.kind !== "string") return false;
|
|
19415
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
19322
19416
|
}
|
|
19323
19417
|
function isPublicEventTicketType(value) {
|
|
19324
|
-
return
|
|
19418
|
+
return isRecord5(value) && typeof value.id === "string";
|
|
19325
19419
|
}
|
|
19326
19420
|
function readTicketTypePriceDisplay(value, currency) {
|
|
19327
19421
|
const display = readLegacyPriceDisplay(value, currency);
|
|
19328
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
19422
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
19329
19423
|
}
|
|
19330
19424
|
function readLegacyPriceDisplay(value, currency) {
|
|
19331
|
-
if (!
|
|
19425
|
+
if (!isRecord5(value) || typeof value.kind !== "string") {
|
|
19332
19426
|
return { kind: "unavailable", currency };
|
|
19333
19427
|
}
|
|
19334
19428
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -19367,7 +19461,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
19367
19461
|
case "unavailable":
|
|
19368
19462
|
return { kind: "unavailable", currency: displayCurrency };
|
|
19369
19463
|
case "course":
|
|
19370
|
-
return
|
|
19464
|
+
return isRecord5(value.display) ? {
|
|
19371
19465
|
kind: "course",
|
|
19372
19466
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
19373
19467
|
} : {
|
|
@@ -19404,10 +19498,11 @@ function readAmount(value) {
|
|
|
19404
19498
|
var DEFAULT_EVENT_CURRENCY;
|
|
19405
19499
|
var init_pricing = __esm({
|
|
19406
19500
|
"../blocks/src/system/runtime/nodes/events/shared/pricing.ts"() {
|
|
19501
|
+
init_destination();
|
|
19407
19502
|
DEFAULT_EVENT_CURRENCY = "USD";
|
|
19408
19503
|
}
|
|
19409
19504
|
});
|
|
19410
|
-
var previewStageSchema, registrationButtonVariantSchema, eventButtonVariantSchema, eventLayoutSchema, eventCalendarDisplayModeSchema, columnOptionSchema, weekStartSchema, filterAutoShowSchema, calendarTabViewsSchema;
|
|
19505
|
+
var previewStageSchema, registrationButtonVariantSchema, eventButtonVariantSchema, eventLayoutSchema, eventCalendarDisplayModeSchema, eventCalendarDefaultViewSchema, columnOptionSchema, weekStartSchema, filterAutoShowSchema, calendarTabViewsSchema;
|
|
19411
19506
|
var init_contract_schemas = __esm({
|
|
19412
19507
|
"../blocks/src/system/runtime/nodes/shared/contract-schemas.ts"() {
|
|
19413
19508
|
init_events();
|
|
@@ -19416,6 +19511,7 @@ var init_contract_schemas = __esm({
|
|
|
19416
19511
|
eventButtonVariantSchema = z.enum(["primary", "secondary", "outline", "link"]);
|
|
19417
19512
|
eventLayoutSchema = z.enum(eventCalendarListLayoutValues);
|
|
19418
19513
|
eventCalendarDisplayModeSchema = z.enum(eventCalendarDisplayModeValues);
|
|
19514
|
+
eventCalendarDefaultViewSchema = z.enum(eventCalendarDefaultViewValues);
|
|
19419
19515
|
columnOptionSchema = z.enum(["2", "3", "4"]);
|
|
19420
19516
|
weekStartSchema = z.enum(["sunday", "monday"]);
|
|
19421
19517
|
filterAutoShowSchema = z.enum(["auto", "always", "never"]);
|
|
@@ -19443,7 +19539,7 @@ function eventMatchesOccurrenceId(event, occurrenceId) {
|
|
|
19443
19539
|
function findPreSelectedEvent(input) {
|
|
19444
19540
|
const occurrenceContext = input.occurrenceContext;
|
|
19445
19541
|
if (!occurrenceContext) {
|
|
19446
|
-
return null;
|
|
19542
|
+
return input.scopedEvents.length === 1 ? input.scopedEvents[0] ?? null : null;
|
|
19447
19543
|
}
|
|
19448
19544
|
const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
19449
19545
|
startsAt: occurrenceContext.startsAt,
|
|
@@ -19463,7 +19559,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
19463
19559
|
if (!input.event) {
|
|
19464
19560
|
return false;
|
|
19465
19561
|
}
|
|
19466
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
19562
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
19467
19563
|
}
|
|
19468
19564
|
var init_registrationDerivations = __esm({
|
|
19469
19565
|
"../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts"() {
|
|
@@ -19565,24 +19661,27 @@ function buildEventRegistrationShellBodyText(stepLabels) {
|
|
|
19565
19661
|
return "Preparing dates, tickets, and booking details.";
|
|
19566
19662
|
}
|
|
19567
19663
|
function normalizeEventRegistrationEventInput(value) {
|
|
19568
|
-
if (!
|
|
19664
|
+
if (!isRecord6(value)) {
|
|
19569
19665
|
return value;
|
|
19570
19666
|
}
|
|
19571
19667
|
return {
|
|
19572
19668
|
...value,
|
|
19669
|
+
destination: resolveRuntimeEventDestination(value),
|
|
19573
19670
|
pricing: resolveRuntimeEventPricing(value)
|
|
19574
19671
|
};
|
|
19575
19672
|
}
|
|
19576
|
-
function
|
|
19673
|
+
function isRecord6(value) {
|
|
19577
19674
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19578
19675
|
}
|
|
19579
19676
|
var EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS, EVENT_REGISTRATION_SHELL_STEP_LABELS, contentEntrySchema, eventRegistrationPublicEventSchema, eventRegistrationSourceSchema, eventRegistrationDisplaySchema, eventRegistrationHydrationSchema, eventRegistrationRenderSchema, eventRegistrationBlockRuntime;
|
|
19580
19677
|
var init_event_registration_interactive = __esm({
|
|
19581
19678
|
"../blocks/src/system/runtime/nodes/event-registration.interactive.ts"() {
|
|
19582
19679
|
init_schemas2();
|
|
19680
|
+
init_shop_shared();
|
|
19583
19681
|
init_event_registration_shared();
|
|
19584
19682
|
init_events();
|
|
19585
19683
|
init_pricing();
|
|
19684
|
+
init_destination();
|
|
19586
19685
|
init_islands();
|
|
19587
19686
|
init_runtime();
|
|
19588
19687
|
init_contract_schemas();
|
|
@@ -19619,7 +19718,9 @@ var init_event_registration_interactive = __esm({
|
|
|
19619
19718
|
overlayEnabled: z.boolean().optional(),
|
|
19620
19719
|
spamProtectionEnabled: z.boolean().optional(),
|
|
19621
19720
|
stage: previewStageSchema.optional(),
|
|
19622
|
-
supportEmail: z.string().optional()
|
|
19721
|
+
supportEmail: z.string().optional(),
|
|
19722
|
+
sitePasses: publicPassProductCollectionSchema.nullable().optional(),
|
|
19723
|
+
siteMemberships: publicMembershipProductCollectionSchema.nullable().optional()
|
|
19623
19724
|
});
|
|
19624
19725
|
eventRegistrationDisplaySchema = z.object({
|
|
19625
19726
|
kind: z.literal("event-registration"),
|
|
@@ -19642,7 +19743,9 @@ var init_event_registration_interactive = __esm({
|
|
|
19642
19743
|
buttonVariant: registrationButtonVariantSchema.optional(),
|
|
19643
19744
|
overlayEnabled: z.boolean().optional(),
|
|
19644
19745
|
spamProtectionEnabled: z.boolean().optional(),
|
|
19645
|
-
supportEmail: z.string().optional()
|
|
19746
|
+
supportEmail: z.string().optional(),
|
|
19747
|
+
sitePasses: publicPassProductCollectionSchema.nullable().optional(),
|
|
19748
|
+
siteMemberships: publicMembershipProductCollectionSchema.nullable().optional()
|
|
19646
19749
|
});
|
|
19647
19750
|
eventRegistrationRenderSchema = z.object({
|
|
19648
19751
|
display: eventRegistrationDisplaySchema,
|
|
@@ -19675,7 +19778,9 @@ var init_event_registration_interactive = __esm({
|
|
|
19675
19778
|
buttonVariant: source.buttonVariant,
|
|
19676
19779
|
overlayEnabled: source.overlayEnabled,
|
|
19677
19780
|
spamProtectionEnabled: source.spamProtectionEnabled,
|
|
19678
|
-
supportEmail: source.supportEmail
|
|
19781
|
+
supportEmail: source.supportEmail,
|
|
19782
|
+
sitePasses: source.sitePasses ?? null,
|
|
19783
|
+
siteMemberships: source.siteMemberships ?? null
|
|
19679
19784
|
}
|
|
19680
19785
|
})
|
|
19681
19786
|
});
|
|
@@ -19811,34 +19916,6 @@ var init_course_registration_interactive = __esm({
|
|
|
19811
19916
|
});
|
|
19812
19917
|
}
|
|
19813
19918
|
});
|
|
19814
|
-
var publicPassProductSchema, publicMembershipProductSchema;
|
|
19815
|
-
var init_shop_shared = __esm({
|
|
19816
|
-
"../blocks/src/system/blocks/shop.shared.ts"() {
|
|
19817
|
-
publicPassProductSchema = z.object({
|
|
19818
|
-
id: z.string(),
|
|
19819
|
-
productUseCase: z.enum(["event_pass", "appointment_package"]).default("event_pass"),
|
|
19820
|
-
name: z.string(),
|
|
19821
|
-
description: z.string().nullable(),
|
|
19822
|
-
price: z.number(),
|
|
19823
|
-
currency: z.string(),
|
|
19824
|
-
creditsTotal: z.number(),
|
|
19825
|
-
pricePerCredit: z.number(),
|
|
19826
|
-
validDays: z.number().nullable(),
|
|
19827
|
-
eligibleCategoryIds: z.array(z.string()),
|
|
19828
|
-
eligibleCategoryNames: z.array(z.string())
|
|
19829
|
-
});
|
|
19830
|
-
publicMembershipProductSchema = z.object({
|
|
19831
|
-
id: z.string(),
|
|
19832
|
-
name: z.string(),
|
|
19833
|
-
description: z.string().nullable(),
|
|
19834
|
-
price: z.number(),
|
|
19835
|
-
currency: z.string(),
|
|
19836
|
-
billingInterval: z.enum(["month", "year"]),
|
|
19837
|
-
eligibleCategoryIds: z.array(z.string()),
|
|
19838
|
-
eligibleCategoryNames: z.array(z.string())
|
|
19839
|
-
});
|
|
19840
|
-
}
|
|
19841
|
-
});
|
|
19842
19919
|
var eventDetailsManifest, occurrenceContextSchema2, eventAutoApplyDiscountPreviewBaseSchema, eventAutoApplyDiscountPreviewSchema, eventDetailsBlockDefinition;
|
|
19843
19920
|
var init_event_details = __esm({
|
|
19844
19921
|
"../blocks/src/system/blocks/event-details.ts"() {
|
|
@@ -20012,8 +20089,8 @@ var init_event_details = __esm({
|
|
|
20012
20089
|
dataSchemas: {
|
|
20013
20090
|
eventDetailsData: z.object({
|
|
20014
20091
|
events: publicEventsArraySchema,
|
|
20015
|
-
sitePasses:
|
|
20016
|
-
siteMemberships:
|
|
20092
|
+
sitePasses: publicPassProductCollectionSchema,
|
|
20093
|
+
siteMemberships: publicMembershipProductCollectionSchema,
|
|
20017
20094
|
autoApplyDiscount: eventAutoApplyDiscountPreviewSchema.nullable().optional().default(null)
|
|
20018
20095
|
}).optional(),
|
|
20019
20096
|
occurrenceContext: occurrenceContextSchema2.optional()
|
|
@@ -20385,6 +20462,7 @@ function buildEventCalendarDisplay(source) {
|
|
|
20385
20462
|
}),
|
|
20386
20463
|
startOfWeek: source.startOfWeek ?? "monday",
|
|
20387
20464
|
calendarTabViews: source.calendarTabViews ?? "both",
|
|
20465
|
+
defaultCalendarView: source.defaultCalendarView ?? "month",
|
|
20388
20466
|
showFilters: source.showFilters ?? true,
|
|
20389
20467
|
showCategoryFilter: source.showCategoryFilter ?? "auto",
|
|
20390
20468
|
showVenueFilter: source.showVenueFilter ?? false,
|
|
@@ -20436,6 +20514,7 @@ var init_EventCalendar_interactive = __esm({
|
|
|
20436
20514
|
loadMoreText: z.string().optional(),
|
|
20437
20515
|
startOfWeek: weekStartSchema.optional(),
|
|
20438
20516
|
calendarTabViews: calendarTabViewsSchema.optional(),
|
|
20517
|
+
defaultCalendarView: eventCalendarDefaultViewSchema.optional(),
|
|
20439
20518
|
showFilters: z.boolean().nullable().optional(),
|
|
20440
20519
|
showCategoryFilter: filterAutoShowSchema.optional(),
|
|
20441
20520
|
showVenueFilter: z.boolean().nullable().optional(),
|
|
@@ -20467,6 +20546,7 @@ var init_EventCalendar_interactive = __esm({
|
|
|
20467
20546
|
paginationAction: eventListPaginationActionSchema,
|
|
20468
20547
|
startOfWeek: weekStartSchema,
|
|
20469
20548
|
calendarTabViews: calendarTabViewsSchema,
|
|
20549
|
+
defaultCalendarView: eventCalendarDefaultViewSchema,
|
|
20470
20550
|
showFilters: z.boolean(),
|
|
20471
20551
|
showCategoryFilter: filterAutoShowSchema,
|
|
20472
20552
|
showVenueFilter: z.boolean(),
|
|
@@ -28937,11 +29017,11 @@ function validationContext(options = {}) {
|
|
|
28937
29017
|
allowIncomplete: isDraft || (options.allowIncomplete ?? false)
|
|
28938
29018
|
};
|
|
28939
29019
|
}
|
|
28940
|
-
function formatFieldPath(
|
|
28941
|
-
return
|
|
29020
|
+
function formatFieldPath(path28) {
|
|
29021
|
+
return path28.map((segment) => String(segment)).join(".");
|
|
28942
29022
|
}
|
|
28943
|
-
function toZodIssuePath(
|
|
28944
|
-
return [...
|
|
29023
|
+
function toZodIssuePath(path28) {
|
|
29024
|
+
return [...path28];
|
|
28945
29025
|
}
|
|
28946
29026
|
function fieldIssueToMessage(issue5) {
|
|
28947
29027
|
switch (issue5.kind) {
|
|
@@ -28995,7 +29075,7 @@ function pluralize(label, count) {
|
|
|
28995
29075
|
if (count === 1) return label;
|
|
28996
29076
|
return label.endsWith("s") ? label : `${label}s`;
|
|
28997
29077
|
}
|
|
28998
|
-
function deriveFieldValidationPlan(field,
|
|
29078
|
+
function deriveFieldValidationPlan(field, path28 = [field.id]) {
|
|
28999
29079
|
const required = Boolean(field.required);
|
|
29000
29080
|
switch (field.type) {
|
|
29001
29081
|
case "text": {
|
|
@@ -29006,7 +29086,7 @@ function deriveFieldValidationPlan(field, path27 = [field.id]) {
|
|
|
29006
29086
|
});
|
|
29007
29087
|
if (typeof field.ui?.min === "number") constraints2.push({ kind: "numberMin", minimum: field.ui.min });
|
|
29008
29088
|
if (typeof field.ui?.max === "number") constraints2.push({ kind: "numberMax", maximum: field.ui.max });
|
|
29009
|
-
return makePlan("number", "number", field,
|
|
29089
|
+
return makePlan("number", "number", field, path28, required, constraints2);
|
|
29010
29090
|
}
|
|
29011
29091
|
const constraints = commonConstraints(required, {
|
|
29012
29092
|
kind: field.ui?.widget === "iconPicker" ? "blockIconValue" : "textType"
|
|
@@ -29015,7 +29095,7 @@ function deriveFieldValidationPlan(field, path27 = [field.id]) {
|
|
|
29015
29095
|
if (inputType === "tel") constraints.push({ kind: "phoneFormat" });
|
|
29016
29096
|
if (field.ui?.pattern) constraints.push({ kind: "patternFormat", pattern: field.ui.pattern });
|
|
29017
29097
|
if (typeof field.maxLength === "number") constraints.push({ kind: "maxLength", maximum: field.maxLength });
|
|
29018
|
-
return makePlan("string", "string", field,
|
|
29098
|
+
return makePlan("string", "string", field, path28, required, constraints);
|
|
29019
29099
|
}
|
|
29020
29100
|
case "number": {
|
|
29021
29101
|
const constraints = commonConstraints(required, {
|
|
@@ -29023,34 +29103,34 @@ function deriveFieldValidationPlan(field, path27 = [field.id]) {
|
|
|
29023
29103
|
});
|
|
29024
29104
|
if (typeof field.min === "number") constraints.push({ kind: "numberMin", minimum: field.min });
|
|
29025
29105
|
if (typeof field.max === "number") constraints.push({ kind: "numberMax", maximum: field.max });
|
|
29026
|
-
return makePlan("number", "number", field,
|
|
29106
|
+
return makePlan("number", "number", field, path28, required, constraints);
|
|
29027
29107
|
}
|
|
29028
29108
|
case "slug": {
|
|
29029
29109
|
const constraints = commonConstraints(required, { kind: "textType" }, { kind: "slugFormat" });
|
|
29030
29110
|
if (typeof field.maxLength === "number") constraints.push({ kind: "maxLength", maximum: field.maxLength });
|
|
29031
|
-
return makePlan("string", "string", field,
|
|
29111
|
+
return makePlan("string", "string", field, path28, required, constraints);
|
|
29032
29112
|
}
|
|
29033
29113
|
case "url":
|
|
29034
29114
|
return makePlan(
|
|
29035
29115
|
"string",
|
|
29036
29116
|
"string",
|
|
29037
29117
|
field,
|
|
29038
|
-
|
|
29118
|
+
path28,
|
|
29039
29119
|
required,
|
|
29040
29120
|
commonConstraints(required, { kind: "textType" }, { kind: "urlFormat", allowRelative: Boolean(field.allowRelative) })
|
|
29041
29121
|
);
|
|
29042
29122
|
case "reference":
|
|
29043
|
-
return makePlan("string", "string", field,
|
|
29123
|
+
return makePlan("string", "string", field, path28, required, commonConstraints(required, { kind: "referenceText" }));
|
|
29044
29124
|
case "date":
|
|
29045
|
-
return makePlan("string", "string", field,
|
|
29125
|
+
return makePlan("string", "string", field, path28, required, commonConstraints(required, { kind: "textType" }, { kind: "dateFormat" }));
|
|
29046
29126
|
case "time":
|
|
29047
|
-
return makePlan("string", "string", field,
|
|
29127
|
+
return makePlan("string", "string", field, path28, required, commonConstraints(required, { kind: "textType" }, { kind: "timeFormat" }));
|
|
29048
29128
|
case "datetime":
|
|
29049
29129
|
return makePlan(
|
|
29050
29130
|
"string",
|
|
29051
29131
|
"string",
|
|
29052
29132
|
field,
|
|
29053
|
-
|
|
29133
|
+
path28,
|
|
29054
29134
|
required,
|
|
29055
29135
|
commonConstraints(required, { kind: "textType" }, { kind: "datetimeFormat" })
|
|
29056
29136
|
);
|
|
@@ -29059,7 +29139,7 @@ function deriveFieldValidationPlan(field, path27 = [field.id]) {
|
|
|
29059
29139
|
"select",
|
|
29060
29140
|
"select",
|
|
29061
29141
|
field,
|
|
29062
|
-
|
|
29142
|
+
path28,
|
|
29063
29143
|
required,
|
|
29064
29144
|
commonConstraints(required, {
|
|
29065
29145
|
kind: "selectOption",
|
|
@@ -29068,40 +29148,40 @@ function deriveFieldValidationPlan(field, path27 = [field.id]) {
|
|
|
29068
29148
|
})
|
|
29069
29149
|
);
|
|
29070
29150
|
case "richText":
|
|
29071
|
-
return makePlan("richText", "object", field,
|
|
29151
|
+
return makePlan("richText", "object", field, path28, required, commonConstraints(required, { kind: "richTextDoc" }));
|
|
29072
29152
|
case "media":
|
|
29073
29153
|
case "file":
|
|
29074
|
-
return makePlan("media", "object", field,
|
|
29154
|
+
return makePlan("media", "object", field, path28, required, commonConstraints(required, { kind: "mediaObject" }));
|
|
29075
29155
|
case "link":
|
|
29076
|
-
return makePlan("link", "object", field,
|
|
29156
|
+
return makePlan("link", "object", field, path28, required, commonConstraints(required, { kind: "linkObject" }));
|
|
29077
29157
|
case "boolean":
|
|
29078
|
-
return makePlan("boolean", "boolean", field,
|
|
29158
|
+
return makePlan("boolean", "boolean", field, path28, required, requiredConstraints(required));
|
|
29079
29159
|
case "repeater":
|
|
29080
29160
|
return {
|
|
29081
|
-
...makePlan("repeater", "array", field,
|
|
29161
|
+
...makePlan("repeater", "array", field, path28, required, commonConstraints(required, { kind: "arrayType" })),
|
|
29082
29162
|
...field.polymorphic && field.itemTypes ? {
|
|
29083
|
-
repeatedItemVariants: deriveRepeatedItemVariants(field, [...
|
|
29163
|
+
repeatedItemVariants: deriveRepeatedItemVariants(field, [...path28, 0])
|
|
29084
29164
|
} : {
|
|
29085
|
-
repeatedItemPlan: deriveNestedFieldPlans(getRepeaterFields(field), [...
|
|
29165
|
+
repeatedItemPlan: deriveNestedFieldPlans(getRepeaterFields(field), [...path28, 0])
|
|
29086
29166
|
},
|
|
29087
29167
|
constraints: withRepeaterItemConstraints(field, commonConstraints(required, { kind: "arrayType" }))
|
|
29088
29168
|
};
|
|
29089
29169
|
case "group":
|
|
29090
29170
|
case "modal":
|
|
29091
29171
|
return {
|
|
29092
|
-
...makePlan("group", "object", field,
|
|
29093
|
-
children: deriveNestedFieldPlans(field.schema?.fields ?? [],
|
|
29172
|
+
...makePlan("group", "object", field, path28, required, requiredConstraints(required)),
|
|
29173
|
+
children: deriveNestedFieldPlans(field.schema?.fields ?? [], path28),
|
|
29094
29174
|
allowNullChildren: field.type === "group" && field.ui?.widget === "locationPicker"
|
|
29095
29175
|
};
|
|
29096
29176
|
case "tabGroup":
|
|
29097
29177
|
return {
|
|
29098
|
-
...makePlan("group", "object", field,
|
|
29099
|
-
children: field.tabs.flatMap((tab) => deriveNestedFieldPlans(tab.fields,
|
|
29178
|
+
...makePlan("group", "object", field, path28, required, requiredConstraints(required)),
|
|
29179
|
+
children: field.tabs.flatMap((tab) => deriveNestedFieldPlans(tab.fields, path28))
|
|
29100
29180
|
};
|
|
29101
29181
|
case "presetOrCustom":
|
|
29102
29182
|
case "contentTypeSelect":
|
|
29103
29183
|
case "entryPicker":
|
|
29104
|
-
return makePlan("passthrough", "unknown", field,
|
|
29184
|
+
return makePlan("passthrough", "unknown", field, path28, false, []);
|
|
29105
29185
|
default:
|
|
29106
29186
|
return assertNever2(field);
|
|
29107
29187
|
}
|
|
@@ -29115,14 +29195,14 @@ function commonConstraints(required, ...specific) {
|
|
|
29115
29195
|
function requiredConstraints(required) {
|
|
29116
29196
|
return required ? [{ kind: "required" }] : [];
|
|
29117
29197
|
}
|
|
29118
|
-
function makePlan(kind, valueKind2, field,
|
|
29198
|
+
function makePlan(kind, valueKind2, field, path28, required, constraints) {
|
|
29119
29199
|
return {
|
|
29120
29200
|
kind,
|
|
29121
29201
|
valueKind: valueKind2,
|
|
29122
29202
|
fieldId: field.id,
|
|
29123
29203
|
label: field.label,
|
|
29124
29204
|
fieldType: field.type,
|
|
29125
|
-
path:
|
|
29205
|
+
path: path28,
|
|
29126
29206
|
required,
|
|
29127
29207
|
visibility: fieldVisibility(field),
|
|
29128
29208
|
constraints
|
|
@@ -29459,18 +29539,18 @@ function materializeRepeaterItemPlan(plan, parentPath, index) {
|
|
|
29459
29539
|
return rebaseFieldPlanPath(plan, [...parentPath, 0], [...parentPath, index]);
|
|
29460
29540
|
}
|
|
29461
29541
|
function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
|
|
29462
|
-
const
|
|
29542
|
+
const path28 = rebaseFieldPath(plan.path, fromPrefix, toPrefix);
|
|
29463
29543
|
switch (plan.kind) {
|
|
29464
29544
|
case "group":
|
|
29465
29545
|
return {
|
|
29466
29546
|
...plan,
|
|
29467
|
-
path:
|
|
29547
|
+
path: path28,
|
|
29468
29548
|
children: plan.children.map((childPlan) => rebaseFieldPlanPath(childPlan, fromPrefix, toPrefix))
|
|
29469
29549
|
};
|
|
29470
29550
|
case "repeater":
|
|
29471
29551
|
return {
|
|
29472
29552
|
...plan,
|
|
29473
|
-
path:
|
|
29553
|
+
path: path28,
|
|
29474
29554
|
...plan.repeatedItemVariants ? {
|
|
29475
29555
|
repeatedItemVariants: plan.repeatedItemVariants.map((variant) => ({
|
|
29476
29556
|
...variant,
|
|
@@ -29491,20 +29571,20 @@ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
|
|
|
29491
29571
|
case "passthrough":
|
|
29492
29572
|
return {
|
|
29493
29573
|
...plan,
|
|
29494
|
-
path:
|
|
29574
|
+
path: path28
|
|
29495
29575
|
};
|
|
29496
29576
|
default:
|
|
29497
29577
|
return assertNever2(plan);
|
|
29498
29578
|
}
|
|
29499
29579
|
}
|
|
29500
|
-
function rebaseFieldPath(
|
|
29501
|
-
if (!startsWithFieldPath(
|
|
29502
|
-
throw new Error(`Cannot rebase field path ${formatFieldPath(
|
|
29580
|
+
function rebaseFieldPath(path28, fromPrefix, toPrefix) {
|
|
29581
|
+
if (!startsWithFieldPath(path28, fromPrefix)) {
|
|
29582
|
+
throw new Error(`Cannot rebase field path ${formatFieldPath(path28)} from ${formatFieldPath(fromPrefix)}`);
|
|
29503
29583
|
}
|
|
29504
|
-
return [...toPrefix, ...
|
|
29584
|
+
return [...toPrefix, ...path28.slice(fromPrefix.length)];
|
|
29505
29585
|
}
|
|
29506
|
-
function startsWithFieldPath(
|
|
29507
|
-
return prefix.every((segment, index) =>
|
|
29586
|
+
function startsWithFieldPath(path28, prefix) {
|
|
29587
|
+
return prefix.every((segment, index) => path28[index] === segment);
|
|
29508
29588
|
}
|
|
29509
29589
|
function issue(plan, kind, extra) {
|
|
29510
29590
|
return {
|
|
@@ -29530,8 +29610,8 @@ function fieldPlanToZod(plan, options = {}) {
|
|
|
29530
29610
|
}
|
|
29531
29611
|
function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
29532
29612
|
const message = fieldIssueToMessage(validationIssue);
|
|
29533
|
-
const
|
|
29534
|
-
const issuePath =
|
|
29613
|
+
const path28 = relativeZodIssuePath(validationIssue.path, rootPath);
|
|
29614
|
+
const issuePath = path28.length > 0 ? { path: toZodIssuePath(path28) } : {};
|
|
29535
29615
|
switch (validationIssue.kind) {
|
|
29536
29616
|
case "required":
|
|
29537
29617
|
if (validationIssue.emptyOrigin) {
|
|
@@ -29584,8 +29664,8 @@ function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
|
29584
29664
|
assertNever2(validationIssue);
|
|
29585
29665
|
}
|
|
29586
29666
|
}
|
|
29587
|
-
function relativeZodIssuePath(
|
|
29588
|
-
return startsWithFieldPath(
|
|
29667
|
+
function relativeZodIssuePath(path28, rootPath) {
|
|
29668
|
+
return startsWithFieldPath(path28, rootPath) ? path28.slice(rootPath.length) : path28;
|
|
29589
29669
|
}
|
|
29590
29670
|
function compilePattern(pattern) {
|
|
29591
29671
|
try {
|
|
@@ -29954,32 +30034,6 @@ var splitReverseLayout = splitLayoutWith([
|
|
|
29954
30034
|
splitContentColumn,
|
|
29955
30035
|
splitImageColumn
|
|
29956
30036
|
]);
|
|
29957
|
-
var heroEyebrowNode = heroCopyFragment.layout[0];
|
|
29958
|
-
var heroHeadlineNode = heroCopyFragment.layout[1];
|
|
29959
|
-
var heroSubheadlineNode = heroCopyFragment.layout[2];
|
|
29960
|
-
var heroCtaRowNode = heroCtaRowFragment.layout[0];
|
|
29961
|
-
if (!heroEyebrowNode || !heroHeadlineNode || !heroSubheadlineNode || !heroCtaRowNode) {
|
|
29962
|
-
throw new Error("Hero copy/CTA fragments are missing their expected layout nodes.");
|
|
29963
|
-
}
|
|
29964
|
-
var heroEditorialBottomRow = inline(
|
|
29965
|
-
{
|
|
29966
|
-
gap: "lg",
|
|
29967
|
-
align: "end",
|
|
29968
|
-
justify: "start",
|
|
29969
|
-
wrap: true,
|
|
29970
|
-
className: "rb-w-full"
|
|
29971
|
-
},
|
|
29972
|
-
[heroSubheadlineNode, heroCtaRowNode]
|
|
29973
|
-
);
|
|
29974
|
-
var splitEditorialContentColumn = heroContentWrapper(
|
|
29975
|
-
[heroEyebrowNode, heroHeadlineNode, heroEditorialBottomRow],
|
|
29976
|
-
"md",
|
|
29977
|
-
"rb-w-full rb-text-left"
|
|
29978
|
-
);
|
|
29979
|
-
var splitEditorialLayout = splitLayoutWith([
|
|
29980
|
-
splitEditorialContentColumn,
|
|
29981
|
-
splitImageColumn
|
|
29982
|
-
]);
|
|
29983
30037
|
var heroConfig = {
|
|
29984
30038
|
id: "block.hero",
|
|
29985
30039
|
title: "Hero",
|
|
@@ -30003,7 +30057,8 @@ var heroConfig = {
|
|
|
30003
30057
|
id: "imageShape",
|
|
30004
30058
|
label: "Image shape",
|
|
30005
30059
|
defaultValue: "default",
|
|
30006
|
-
uiIntent: "display"
|
|
30060
|
+
uiIntent: "display",
|
|
30061
|
+
visibleWhen: { field: "variant", oneOf: ["split", "splitReverse"] }
|
|
30007
30062
|
})
|
|
30008
30063
|
],
|
|
30009
30064
|
layout: classicLayout,
|
|
@@ -30011,8 +30066,7 @@ var heroConfig = {
|
|
|
30011
30066
|
classic: classicLayout,
|
|
30012
30067
|
micro: microLayout,
|
|
30013
30068
|
split: splitLayout,
|
|
30014
|
-
splitReverse: splitReverseLayout
|
|
30015
|
-
splitEditorial: splitEditorialLayout
|
|
30069
|
+
splitReverse: splitReverseLayout
|
|
30016
30070
|
},
|
|
30017
30071
|
defaultVariant: "classic",
|
|
30018
30072
|
description: "Hero section with headline, subtitle, and repeatable CTAs.",
|
|
@@ -31659,8 +31713,10 @@ function resolveGeneratedHeroLayoutStyles(content) {
|
|
|
31659
31713
|
return isPlainObject2(raw) ? raw : null;
|
|
31660
31714
|
}
|
|
31661
31715
|
function readHeroLayoutString(content, generatedKey, fallbackKey = generatedKey) {
|
|
31716
|
+
const explicitValue = readString(content, fallbackKey);
|
|
31717
|
+
if (explicitValue !== void 0) return explicitValue;
|
|
31662
31718
|
const generated = resolveGeneratedHeroLayoutStyles(content);
|
|
31663
|
-
return generated && typeof generated[generatedKey] === "string" ? generated[generatedKey] :
|
|
31719
|
+
return generated && typeof generated[generatedKey] === "string" ? generated[generatedKey] : void 0;
|
|
31664
31720
|
}
|
|
31665
31721
|
function resolveHeroVariant(content) {
|
|
31666
31722
|
const variant = readString(content, "variant");
|
|
@@ -31673,7 +31729,7 @@ function resolveHeroContentAlignment(content) {
|
|
|
31673
31729
|
const raw = readHeroLayoutString(content, "contentAlignment");
|
|
31674
31730
|
if (raw === "left" || raw === "center" || raw === "right") return raw;
|
|
31675
31731
|
const variant = resolveHeroVariant(content);
|
|
31676
|
-
if (variant === "split" || variant === "splitReverse"
|
|
31732
|
+
if (variant === "split" || variant === "splitReverse") return "left";
|
|
31677
31733
|
return "center";
|
|
31678
31734
|
}
|
|
31679
31735
|
function resolveHeroVerticalAlignment(content) {
|
|
@@ -31683,7 +31739,7 @@ function resolveHeroVerticalAlignment(content) {
|
|
|
31683
31739
|
const minHeight = sectionStyles?.minHeight;
|
|
31684
31740
|
if (minHeight === "banner" || minHeight === "hero" || minHeight === "immersive") return "center";
|
|
31685
31741
|
const variant = resolveHeroVariant(content);
|
|
31686
|
-
if (variant === "split" || variant === "splitReverse"
|
|
31742
|
+
if (variant === "split" || variant === "splitReverse") return "center";
|
|
31687
31743
|
return "top";
|
|
31688
31744
|
}
|
|
31689
31745
|
function resolveHeroContentMaxWidth(content) {
|
|
@@ -32743,9 +32799,9 @@ function maybeBuildSupabaseTransformUrl(inputUrl, options) {
|
|
|
32743
32799
|
const remainder = url.pathname.slice(idx + marker.length);
|
|
32744
32800
|
const parts = remainder.split("/").filter(Boolean);
|
|
32745
32801
|
const bucket = parts[0];
|
|
32746
|
-
const
|
|
32747
|
-
if (!bucket || !
|
|
32748
|
-
url.pathname = `/storage/v1/render/image/public/${bucket}/${
|
|
32802
|
+
const path28 = parts.slice(1).join("/");
|
|
32803
|
+
if (!bucket || !path28) return inputUrl;
|
|
32804
|
+
url.pathname = `/storage/v1/render/image/public/${bucket}/${path28}`;
|
|
32749
32805
|
url.search = "";
|
|
32750
32806
|
if (width) url.searchParams.set("width", String(width));
|
|
32751
32807
|
if (height) url.searchParams.set("height", String(height));
|
|
@@ -35304,6 +35360,7 @@ init_styledSection();
|
|
|
35304
35360
|
init_fragments();
|
|
35305
35361
|
init_api_bindings();
|
|
35306
35362
|
init_shared2();
|
|
35363
|
+
init_shop_shared();
|
|
35307
35364
|
init_defineBlock();
|
|
35308
35365
|
init_event_registration_shared();
|
|
35309
35366
|
init_event_registration_interactive();
|
|
@@ -35458,6 +35515,8 @@ var eventRegistrationManifest = createBlockManifest({
|
|
|
35458
35515
|
},
|
|
35459
35516
|
// Event data from loader
|
|
35460
35517
|
events: { $bind: { from: "data.events" } },
|
|
35518
|
+
sitePasses: { $bind: { from: "data.sitePasses" } },
|
|
35519
|
+
siteMemberships: { $bind: { from: "data.siteMemberships" } },
|
|
35461
35520
|
// Stage for preview mode (allows registering for draft events)
|
|
35462
35521
|
stage: {
|
|
35463
35522
|
$bind: { from: "$root.previewStage", fallback: "published" }
|
|
@@ -35476,7 +35535,9 @@ var eventRegistrationBlockDefinition = {
|
|
|
35476
35535
|
manifest: eventRegistrationManifest,
|
|
35477
35536
|
runtime: eventRegistrationBlockRuntime,
|
|
35478
35537
|
dataSchemas: {
|
|
35479
|
-
events:
|
|
35538
|
+
events: publicEventsArraySchema.optional(),
|
|
35539
|
+
sitePasses: publicPassProductCollectionSchema.optional(),
|
|
35540
|
+
siteMemberships: publicMembershipProductCollectionSchema.optional(),
|
|
35480
35541
|
occurrenceContext: occurrenceContextSchema.optional()
|
|
35481
35542
|
},
|
|
35482
35543
|
dataLoaders: {
|
|
@@ -35495,6 +35556,20 @@ var eventRegistrationBlockDefinition = {
|
|
|
35495
35556
|
entryId: { $bind: { from: "$root.contentEntry._entryId", fallback: "" } }
|
|
35496
35557
|
},
|
|
35497
35558
|
mode: "server"
|
|
35559
|
+
},
|
|
35560
|
+
sitePasses: {
|
|
35561
|
+
endpoint: "listPublicPasses",
|
|
35562
|
+
params: {
|
|
35563
|
+
siteId: { $bind: { from: "$root.siteId" } }
|
|
35564
|
+
},
|
|
35565
|
+
mode: "server"
|
|
35566
|
+
},
|
|
35567
|
+
siteMemberships: {
|
|
35568
|
+
endpoint: "listPublicMemberships",
|
|
35569
|
+
params: {
|
|
35570
|
+
siteId: { $bind: { from: "$root.siteId" } }
|
|
35571
|
+
},
|
|
35572
|
+
mode: "server"
|
|
35498
35573
|
}
|
|
35499
35574
|
}
|
|
35500
35575
|
};
|
|
@@ -36319,6 +36394,9 @@ function normalizeEventCalendarContent(content) {
|
|
|
36319
36394
|
...variant ? { variant } : {},
|
|
36320
36395
|
displayMode: normalizeEventCalendarDisplayMode(record.displayMode),
|
|
36321
36396
|
listLayout: normalizeEventCalendarListLayout(record.listLayout),
|
|
36397
|
+
defaultCalendarView: normalizeEventCalendarDefaultView(
|
|
36398
|
+
record.defaultCalendarView
|
|
36399
|
+
),
|
|
36322
36400
|
kind,
|
|
36323
36401
|
eventSurface: normalizeEventSurfaceScope(record.eventSurface),
|
|
36324
36402
|
filterEventPresets: normalizeEventSurfacePresets(record.filterEventPresets),
|
|
@@ -36336,6 +36414,9 @@ function normalizeEventCalendarDisplayMode(value) {
|
|
|
36336
36414
|
function normalizeEventCalendarListLayout(value) {
|
|
36337
36415
|
return isEventCalendarListLayout(value) ? value : void 0;
|
|
36338
36416
|
}
|
|
36417
|
+
function normalizeEventCalendarDefaultView(value) {
|
|
36418
|
+
return isEventCalendarDefaultView(value) ? value : void 0;
|
|
36419
|
+
}
|
|
36339
36420
|
var eventCalendarLayout = [
|
|
36340
36421
|
styledSection({
|
|
36341
36422
|
children: sectionContainer(
|
|
@@ -36395,6 +36476,9 @@ var eventCalendarLayout = [
|
|
|
36395
36476
|
calendarTabViews: {
|
|
36396
36477
|
$bind: { from: "content.calendarTabViews", fallback: "both" }
|
|
36397
36478
|
},
|
|
36479
|
+
defaultCalendarView: {
|
|
36480
|
+
$bind: { from: "content.defaultCalendarView", fallback: "month" }
|
|
36481
|
+
},
|
|
36398
36482
|
// Filtering options
|
|
36399
36483
|
showFilters: {
|
|
36400
36484
|
$bind: { from: "content.showFilters", fallback: true }
|
|
@@ -36461,8 +36545,7 @@ var eventCalendarAdditionalFields = [
|
|
|
36461
36545
|
defaultValue: "combined",
|
|
36462
36546
|
options: [
|
|
36463
36547
|
{ value: "combined", label: "Combined (List + Calendar tabs)" },
|
|
36464
|
-
{ value: "
|
|
36465
|
-
{ value: "week", label: "Week agenda" },
|
|
36548
|
+
{ value: "calendar", label: "Calendar" },
|
|
36466
36549
|
{ value: "timetable", label: "Timetable" },
|
|
36467
36550
|
{ value: "list", label: "List" }
|
|
36468
36551
|
],
|
|
@@ -36501,7 +36584,12 @@ var eventCalendarAdditionalFields = [
|
|
|
36501
36584
|
],
|
|
36502
36585
|
ui: {
|
|
36503
36586
|
intent: "display",
|
|
36504
|
-
visibleWhen: {
|
|
36587
|
+
visibleWhen: {
|
|
36588
|
+
allOf: [
|
|
36589
|
+
{ field: "variant", oneOf: ["combined", "list"] },
|
|
36590
|
+
{ field: "listLayout", equals: "grid" }
|
|
36591
|
+
]
|
|
36592
|
+
}
|
|
36505
36593
|
}
|
|
36506
36594
|
},
|
|
36507
36595
|
{
|
|
@@ -36549,7 +36637,12 @@ var eventCalendarAdditionalFields = [
|
|
|
36549
36637
|
required: false,
|
|
36550
36638
|
ui: {
|
|
36551
36639
|
intent: "display",
|
|
36552
|
-
visibleWhen: {
|
|
36640
|
+
visibleWhen: {
|
|
36641
|
+
allOf: [
|
|
36642
|
+
{ field: "variant", oneOf: ["combined", "list"] },
|
|
36643
|
+
{ field: "paginationMode", equals: "seeAllLink" }
|
|
36644
|
+
]
|
|
36645
|
+
}
|
|
36553
36646
|
}
|
|
36554
36647
|
},
|
|
36555
36648
|
{
|
|
@@ -36582,7 +36675,7 @@ var eventCalendarAdditionalFields = [
|
|
|
36582
36675
|
intent: "display",
|
|
36583
36676
|
visibleWhen: {
|
|
36584
36677
|
field: "variant",
|
|
36585
|
-
oneOf: ["combined", "
|
|
36678
|
+
oneOf: ["combined", "calendar", "timetable"]
|
|
36586
36679
|
}
|
|
36587
36680
|
}
|
|
36588
36681
|
},
|
|
@@ -36605,6 +36698,33 @@ var eventCalendarAdditionalFields = [
|
|
|
36605
36698
|
visibleWhen: { field: "variant", equals: "combined" }
|
|
36606
36699
|
}
|
|
36607
36700
|
},
|
|
36701
|
+
{
|
|
36702
|
+
id: "defaultCalendarView",
|
|
36703
|
+
type: "select",
|
|
36704
|
+
label: "Calendar view",
|
|
36705
|
+
description: "Choose the standalone calendar view, or the first view in combined mode",
|
|
36706
|
+
required: false,
|
|
36707
|
+
multiple: false,
|
|
36708
|
+
defaultValue: "month",
|
|
36709
|
+
options: [
|
|
36710
|
+
{ value: "month", label: "Month" },
|
|
36711
|
+
{ value: "week", label: "Week" }
|
|
36712
|
+
],
|
|
36713
|
+
ui: {
|
|
36714
|
+
intent: "display",
|
|
36715
|
+
visibleWhen: {
|
|
36716
|
+
anyOf: [
|
|
36717
|
+
{ field: "variant", equals: "calendar" },
|
|
36718
|
+
{
|
|
36719
|
+
allOf: [
|
|
36720
|
+
{ field: "variant", equals: "combined" },
|
|
36721
|
+
{ field: "calendarTabViews", equals: "both" }
|
|
36722
|
+
]
|
|
36723
|
+
}
|
|
36724
|
+
]
|
|
36725
|
+
}
|
|
36726
|
+
}
|
|
36727
|
+
},
|
|
36608
36728
|
// Filtering options
|
|
36609
36729
|
{
|
|
36610
36730
|
id: "kind",
|
|
@@ -36632,7 +36752,7 @@ var eventCalendarAdditionalFields = [
|
|
|
36632
36752
|
intent: "display",
|
|
36633
36753
|
visibleWhen: {
|
|
36634
36754
|
field: "variant",
|
|
36635
|
-
oneOf: ["combined", "list", "timetable"]
|
|
36755
|
+
oneOf: ["combined", "calendar", "list", "timetable"]
|
|
36636
36756
|
}
|
|
36637
36757
|
}
|
|
36638
36758
|
},
|
|
@@ -36652,8 +36772,10 @@ var eventCalendarAdditionalFields = [
|
|
|
36652
36772
|
ui: {
|
|
36653
36773
|
intent: "display",
|
|
36654
36774
|
visibleWhen: {
|
|
36655
|
-
|
|
36656
|
-
|
|
36775
|
+
allOf: [
|
|
36776
|
+
{ field: "variant", oneOf: ["combined", "calendar", "list", "timetable"] },
|
|
36777
|
+
{ field: "showFilters", equals: true }
|
|
36778
|
+
]
|
|
36657
36779
|
}
|
|
36658
36780
|
}
|
|
36659
36781
|
},
|
|
@@ -36667,8 +36789,10 @@ var eventCalendarAdditionalFields = [
|
|
|
36667
36789
|
ui: {
|
|
36668
36790
|
intent: "display",
|
|
36669
36791
|
visibleWhen: {
|
|
36670
|
-
|
|
36671
|
-
|
|
36792
|
+
allOf: [
|
|
36793
|
+
{ field: "variant", oneOf: ["combined", "calendar", "list", "timetable"] },
|
|
36794
|
+
{ field: "showFilters", equals: true }
|
|
36795
|
+
]
|
|
36672
36796
|
}
|
|
36673
36797
|
}
|
|
36674
36798
|
},
|
|
@@ -36682,8 +36806,10 @@ var eventCalendarAdditionalFields = [
|
|
|
36682
36806
|
ui: {
|
|
36683
36807
|
intent: "display",
|
|
36684
36808
|
visibleWhen: {
|
|
36685
|
-
|
|
36686
|
-
|
|
36809
|
+
allOf: [
|
|
36810
|
+
{ field: "variant", oneOf: ["combined", "calendar", "list", "timetable"] },
|
|
36811
|
+
{ field: "showFilters", equals: true }
|
|
36812
|
+
]
|
|
36687
36813
|
}
|
|
36688
36814
|
}
|
|
36689
36815
|
},
|
|
@@ -36697,8 +36823,15 @@ var eventCalendarAdditionalFields = [
|
|
|
36697
36823
|
ui: {
|
|
36698
36824
|
intent: "display",
|
|
36699
36825
|
visibleWhen: {
|
|
36700
|
-
|
|
36701
|
-
|
|
36826
|
+
anyOf: [
|
|
36827
|
+
{ field: "variant", oneOf: ["combined", "list", "timetable"] },
|
|
36828
|
+
{
|
|
36829
|
+
allOf: [
|
|
36830
|
+
{ field: "variant", equals: "calendar" },
|
|
36831
|
+
{ field: "defaultCalendarView", equals: "week" }
|
|
36832
|
+
]
|
|
36833
|
+
}
|
|
36834
|
+
]
|
|
36702
36835
|
}
|
|
36703
36836
|
}
|
|
36704
36837
|
},
|
|
@@ -36814,8 +36947,7 @@ var eventCalendarAdditionalFields = [
|
|
|
36814
36947
|
];
|
|
36815
36948
|
var eventCalendarVariants = {
|
|
36816
36949
|
combined: eventCalendarLayout[0],
|
|
36817
|
-
|
|
36818
|
-
week: eventCalendarLayout[0],
|
|
36950
|
+
calendar: eventCalendarLayout[0],
|
|
36819
36951
|
timetable: eventCalendarLayout[0],
|
|
36820
36952
|
list: eventCalendarLayout[0]
|
|
36821
36953
|
};
|
|
@@ -36827,8 +36959,7 @@ var eventCalendarVariants = {
|
|
|
36827
36959
|
multiple: false,
|
|
36828
36960
|
options: [
|
|
36829
36961
|
{ value: "combined" },
|
|
36830
|
-
{ value: "
|
|
36831
|
-
{ value: "week" },
|
|
36962
|
+
{ value: "calendar" },
|
|
36832
36963
|
{ value: "timetable" },
|
|
36833
36964
|
{ value: "list" }
|
|
36834
36965
|
]
|
|
@@ -36841,6 +36972,13 @@ var eventCalendarVariants = {
|
|
|
36841
36972
|
options: eventCalendarListLayoutOptions.map((option) => ({
|
|
36842
36973
|
value: option.id
|
|
36843
36974
|
}))
|
|
36975
|
+
},
|
|
36976
|
+
{
|
|
36977
|
+
id: "defaultCalendarView",
|
|
36978
|
+
type: "select",
|
|
36979
|
+
required: false,
|
|
36980
|
+
multiple: false,
|
|
36981
|
+
options: [{ value: "month" }, { value: "week" }]
|
|
36844
36982
|
}
|
|
36845
36983
|
];
|
|
36846
36984
|
var eventCalendarConfig = {
|
|
@@ -36884,8 +37022,7 @@ var eventCalendarConfig = {
|
|
|
36884
37022
|
defaultVariant: "combined",
|
|
36885
37023
|
variantOptions: {
|
|
36886
37024
|
combined: { label: "Combined" },
|
|
36887
|
-
|
|
36888
|
-
week: { label: "Week" },
|
|
37025
|
+
calendar: { label: "Calendar" },
|
|
36889
37026
|
timetable: { label: "Timetable" },
|
|
36890
37027
|
list: { label: "List" }
|
|
36891
37028
|
}
|
|
@@ -36995,7 +37132,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
36995
37132
|
return keys.length >= 2 ? keys : [];
|
|
36996
37133
|
}
|
|
36997
37134
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
36998
|
-
if (!
|
|
37135
|
+
if (!isRecord7(value)) return null;
|
|
36999
37136
|
const groupOrderValue = value.groupOrder;
|
|
37000
37137
|
if (Array.isArray(groupOrderValue)) {
|
|
37001
37138
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -37008,7 +37145,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
37008
37145
|
return { ...value, groupOrder: [] };
|
|
37009
37146
|
}
|
|
37010
37147
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
37011
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
37148
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord7) : []
|
|
37012
37149
|
);
|
|
37013
37150
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
37014
37151
|
}
|
|
@@ -37022,7 +37159,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
37022
37159
|
}
|
|
37023
37160
|
return keys;
|
|
37024
37161
|
}
|
|
37025
|
-
function
|
|
37162
|
+
function isRecord7(value) {
|
|
37026
37163
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37027
37164
|
}
|
|
37028
37165
|
|
|
@@ -37389,7 +37526,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
37389
37526
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
37390
37527
|
}
|
|
37391
37528
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
37392
|
-
if (!
|
|
37529
|
+
if (!isRecord8(value)) return [];
|
|
37393
37530
|
const override = {};
|
|
37394
37531
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
37395
37532
|
override.sourceKey = value.sourceKey;
|
|
@@ -37421,12 +37558,12 @@ function isButtonVariant(value) {
|
|
|
37421
37558
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
37422
37559
|
}
|
|
37423
37560
|
function normalizeCardStylesContent(value) {
|
|
37424
|
-
return
|
|
37561
|
+
return isRecord8(value) || value === null ? value : void 0;
|
|
37425
37562
|
}
|
|
37426
37563
|
function normalizeSectionStylesContent(value) {
|
|
37427
|
-
return
|
|
37564
|
+
return isRecord8(value) || value === null ? value : void 0;
|
|
37428
37565
|
}
|
|
37429
|
-
function
|
|
37566
|
+
function isRecord8(value) {
|
|
37430
37567
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37431
37568
|
}
|
|
37432
37569
|
|
|
@@ -39084,9 +39221,9 @@ var shopBlockDefinition = {
|
|
|
39084
39221
|
runtime: shopBlockRuntime,
|
|
39085
39222
|
dataSchemas: {
|
|
39086
39223
|
// listPublicPasses returns { passes: [...] }
|
|
39087
|
-
passes:
|
|
39224
|
+
passes: publicPassProductCollectionSchema.optional(),
|
|
39088
39225
|
// listPublicMemberships returns { memberships: [...] }
|
|
39089
|
-
memberships:
|
|
39226
|
+
memberships: publicMembershipProductCollectionSchema.optional()
|
|
39090
39227
|
},
|
|
39091
39228
|
dataLoaders: {
|
|
39092
39229
|
// Load passes for display
|
|
@@ -40536,13 +40673,6 @@ var systemBlockDefinitionsRaw = [
|
|
|
40536
40673
|
weight: "featured",
|
|
40537
40674
|
bias: "clear",
|
|
40538
40675
|
surfaces: heroSectionSurfaces
|
|
40539
|
-
}),
|
|
40540
|
-
layoutProfile({
|
|
40541
|
-
variantKey: "splitEditorial",
|
|
40542
|
-
family: "split",
|
|
40543
|
-
weight: "featured",
|
|
40544
|
-
bias: "clear",
|
|
40545
|
-
surfaces: heroSectionSurfaces
|
|
40546
40676
|
})
|
|
40547
40677
|
]
|
|
40548
40678
|
})),
|
|
@@ -40786,9 +40916,8 @@ var systemBlockDefinitionsRaw = [
|
|
|
40786
40916
|
flow: offeringsFlow,
|
|
40787
40917
|
layoutProfiles: [
|
|
40788
40918
|
layoutProfile({ variantKey: "combined", family: "grid", weight: "standard" }),
|
|
40919
|
+
layoutProfile({ variantKey: "calendar", family: "stack", weight: "standard" }),
|
|
40789
40920
|
layoutProfile({ variantKey: "list", family: "stack", weight: "standard" }),
|
|
40790
|
-
layoutProfile({ variantKey: "month", family: "grid", weight: "standard" }),
|
|
40791
|
-
layoutProfile({ variantKey: "week", family: "stack", weight: "standard" }),
|
|
40792
40921
|
layoutProfile({ variantKey: "timetable", family: "stack", weight: "standard" })
|
|
40793
40922
|
]
|
|
40794
40923
|
})),
|
|
@@ -41370,10 +41499,7 @@ function normalizeRenderStage(stage) {
|
|
|
41370
41499
|
return stage === "preview" ? "preview" : "published";
|
|
41371
41500
|
}
|
|
41372
41501
|
function isRouteVisibleInStage(routeEntry, stageInput) {
|
|
41373
|
-
|
|
41374
|
-
if (stage === "preview" || !isRouteRecord(routeEntry)) {
|
|
41375
|
-
return true;
|
|
41376
|
-
}
|
|
41502
|
+
if (normalizeRenderStage(stageInput) === "preview" || !isRouteRecord(routeEntry)) return true;
|
|
41377
41503
|
const status = routeEntry.status;
|
|
41378
41504
|
return !(typeof status === "string" && status !== "published");
|
|
41379
41505
|
}
|
|
@@ -41382,52 +41508,45 @@ function extractRouteHref(candidate, stageInput = "published") {
|
|
|
41382
41508
|
const trimmed = candidate.trim();
|
|
41383
41509
|
return trimmed.length > 0 ? trimmed : null;
|
|
41384
41510
|
}
|
|
41385
|
-
if (!isRouteRecord(candidate))
|
|
41386
|
-
|
|
41387
|
-
|
|
41388
|
-
|
|
41389
|
-
|
|
41511
|
+
if (!isRouteRecord(candidate)) return null;
|
|
41512
|
+
const fields3 = normalizeRenderStage(stageInput) === "preview" ? [
|
|
41513
|
+
"draftPath",
|
|
41514
|
+
"path",
|
|
41515
|
+
"href",
|
|
41516
|
+
"url"
|
|
41517
|
+
] : [
|
|
41518
|
+
"path",
|
|
41519
|
+
"href",
|
|
41520
|
+
"url"
|
|
41521
|
+
];
|
|
41390
41522
|
for (const field of fields3) {
|
|
41391
41523
|
const value = candidate[field];
|
|
41392
|
-
if (typeof value === "string" && value.trim().length > 0)
|
|
41393
|
-
return value.trim();
|
|
41394
|
-
}
|
|
41524
|
+
if (typeof value === "string" && value.trim().length > 0) return value.trim();
|
|
41395
41525
|
}
|
|
41396
41526
|
return null;
|
|
41397
41527
|
}
|
|
41398
41528
|
function extractRouteUpdatedAt(candidate) {
|
|
41399
|
-
if (!isRouteRecord(candidate))
|
|
41400
|
-
|
|
41401
|
-
}
|
|
41402
|
-
const fields3 = [
|
|
41529
|
+
if (!isRouteRecord(candidate)) return null;
|
|
41530
|
+
for (const field of [
|
|
41403
41531
|
"updatedAt",
|
|
41404
41532
|
"updated_at",
|
|
41405
41533
|
"publishedAt",
|
|
41406
41534
|
"published_at",
|
|
41407
41535
|
"modifiedAt",
|
|
41408
41536
|
"modified_at"
|
|
41409
|
-
]
|
|
41410
|
-
for (const field of fields3) {
|
|
41537
|
+
]) {
|
|
41411
41538
|
const value = candidate[field];
|
|
41412
|
-
if (typeof value === "string" && value.length > 0)
|
|
41413
|
-
return value;
|
|
41414
|
-
}
|
|
41539
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
41415
41540
|
}
|
|
41416
41541
|
return null;
|
|
41417
41542
|
}
|
|
41418
41543
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
41419
41544
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
41420
|
-
if (!routeId || !routes)
|
|
41421
|
-
return null;
|
|
41422
|
-
}
|
|
41545
|
+
if (!routeId || !routes) return null;
|
|
41423
41546
|
const routeEntry = routes[routeId];
|
|
41424
|
-
if (!isRouteVisibleInStage(routeEntry, stageInput))
|
|
41425
|
-
return null;
|
|
41426
|
-
}
|
|
41547
|
+
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
41427
41548
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
41428
|
-
if (!href)
|
|
41429
|
-
return null;
|
|
41430
|
-
}
|
|
41549
|
+
if (!href) return null;
|
|
41431
41550
|
return {
|
|
41432
41551
|
routeId,
|
|
41433
41552
|
href,
|
|
@@ -42582,19 +42701,23 @@ function normalizeDashboardOrigin(input) {
|
|
|
42582
42701
|
}
|
|
42583
42702
|
function deriveCmsApiUrlFromDashboardUrl(input) {
|
|
42584
42703
|
const origin = normalizeDashboardOrigin(input);
|
|
42585
|
-
return origin ? `${origin}/api` : "";
|
|
42704
|
+
return origin ? normalizeCmsApiBaseUrl(`${origin}/api`) : "";
|
|
42705
|
+
}
|
|
42706
|
+
function normalizeCmsApiBaseUrl(input) {
|
|
42707
|
+
return input.trim().replace(/\/+$/, "").replace(/(?:\/api)+$/i, "/api");
|
|
42586
42708
|
}
|
|
42587
42709
|
function getCmsApiUrl() {
|
|
42588
42710
|
if (typeof window !== "undefined") {
|
|
42589
|
-
return "/api";
|
|
42711
|
+
return normalizeCmsApiBaseUrl("/api");
|
|
42590
42712
|
}
|
|
42591
42713
|
const internalUrl = process.env.CMS_API_URL;
|
|
42592
42714
|
if (internalUrl) {
|
|
42593
|
-
return internalUrl
|
|
42715
|
+
return normalizeCmsApiBaseUrl(internalUrl);
|
|
42594
42716
|
}
|
|
42595
42717
|
const dashboardUrl = process.env.NEXT_PUBLIC_DASHBOARD_URL;
|
|
42596
42718
|
if (dashboardUrl) {
|
|
42597
|
-
|
|
42719
|
+
const apiUrl = deriveCmsApiUrlFromDashboardUrl(dashboardUrl);
|
|
42720
|
+
if (apiUrl) return apiUrl;
|
|
42598
42721
|
}
|
|
42599
42722
|
throw new Error(
|
|
42600
42723
|
"CMS_API_URL or NEXT_PUBLIC_DASHBOARD_URL is not configured. Set NEXT_PUBLIC_DASHBOARD_URL to your dashboard URL (e.g., http://localhost:4000)"
|
|
@@ -42728,6 +42851,27 @@ function serializeQueryValue(value) {
|
|
|
42728
42851
|
if (value instanceof Date) return value.toISOString();
|
|
42729
42852
|
return null;
|
|
42730
42853
|
}
|
|
42854
|
+
function normalizeHeaders(source) {
|
|
42855
|
+
const normalized = {};
|
|
42856
|
+
if (!source) return normalized;
|
|
42857
|
+
new Headers(source).forEach((value, key) => {
|
|
42858
|
+
normalized[key] = value;
|
|
42859
|
+
});
|
|
42860
|
+
return normalized;
|
|
42861
|
+
}
|
|
42862
|
+
function buildRequestHeaders(input) {
|
|
42863
|
+
const headers = {
|
|
42864
|
+
...normalizeHeaders(input.optionsHeaders),
|
|
42865
|
+
...normalizeHeaders(input.authHeaders)
|
|
42866
|
+
};
|
|
42867
|
+
if (input.sdkVersion) {
|
|
42868
|
+
headers["x-sdk-version"] = input.sdkVersion;
|
|
42869
|
+
}
|
|
42870
|
+
if (input.includeJsonContentType) {
|
|
42871
|
+
headers["Content-Type"] = "application/json";
|
|
42872
|
+
}
|
|
42873
|
+
return headers;
|
|
42874
|
+
}
|
|
42731
42875
|
function serializePathParam(endpoint, key, value) {
|
|
42732
42876
|
if (typeof value === "string") {
|
|
42733
42877
|
return value;
|
|
@@ -42863,104 +43007,20 @@ function createRawCMSClient(headers = {}, baseUrl) {
|
|
|
42863
43007
|
params,
|
|
42864
43008
|
options = {}
|
|
42865
43009
|
}) => {
|
|
42866
|
-
const
|
|
42867
|
-
|
|
42868
|
-
|
|
42869
|
-
|
|
42870
|
-
|
|
42871
|
-
|
|
42872
|
-
|
|
42873
|
-
|
|
42874
|
-
if (originalPath.includes(bracePlaceholder) || originalPath.includes(colonPlaceholder)) {
|
|
42875
|
-
const stringValue2 = serializePathParam(endpoint, key, value);
|
|
42876
|
-
url = url.replace(bracePlaceholder, stringValue2);
|
|
42877
|
-
url = url.replace(colonPlaceholder, stringValue2);
|
|
42878
|
-
} else {
|
|
42879
|
-
unusedParams[key] = value;
|
|
42880
|
-
}
|
|
42881
|
-
});
|
|
42882
|
-
}
|
|
42883
|
-
const unresolvedPathParams = [
|
|
42884
|
-
...url.match(/\{[^}]+\}/g) ?? [],
|
|
42885
|
-
...url.match(/(^|\/):([A-Za-z][A-Za-z0-9_]*)\b/g) ?? []
|
|
42886
|
-
];
|
|
42887
|
-
if (unresolvedPathParams.length > 0) {
|
|
42888
|
-
const missingParams = Array.from(
|
|
42889
|
-
new Set(
|
|
42890
|
-
unresolvedPathParams.map((token) => {
|
|
42891
|
-
if (token.startsWith("{") && token.endsWith("}")) {
|
|
42892
|
-
return token.slice(1, -1);
|
|
42893
|
-
}
|
|
42894
|
-
return token.replace(/^\//, "").slice(1);
|
|
42895
|
-
})
|
|
42896
|
-
)
|
|
42897
|
-
);
|
|
42898
|
-
throw new Error(
|
|
42899
|
-
`Missing required path params for endpoint ${String(endpoint)}: ${missingParams.join(", ")}`
|
|
42900
|
-
);
|
|
42901
|
-
}
|
|
42902
|
-
const endpointConfig = API_ENDPOINTS[endpoint];
|
|
42903
|
-
const method = endpointConfig.method;
|
|
42904
|
-
const isGetOrHead = method === "GET" || method === "HEAD";
|
|
42905
|
-
const queryParams = new URLSearchParams();
|
|
42906
|
-
Object.entries(unusedParams).forEach(([key, value]) => {
|
|
42907
|
-
appendQueryParam(queryParams, key, value);
|
|
43010
|
+
const plan = buildApiRequestPlan({
|
|
43011
|
+
endpoint,
|
|
43012
|
+
body,
|
|
43013
|
+
params,
|
|
43014
|
+
options,
|
|
43015
|
+
headers,
|
|
43016
|
+
baseUrl: normalizeCmsApiBaseUrl(baseUrl ?? resolveApiBaseUrl()),
|
|
43017
|
+
sdkVersion
|
|
42908
43018
|
});
|
|
42909
|
-
|
|
42910
|
-
|
|
42911
|
-
appendQueryParam(queryParams, key, value);
|
|
42912
|
-
});
|
|
42913
|
-
}
|
|
42914
|
-
const queryString = queryParams.toString();
|
|
42915
|
-
if (queryString) {
|
|
42916
|
-
url += (url.includes("?") ? "&" : "?") + queryString;
|
|
42917
|
-
}
|
|
42918
|
-
const formDataBody = isFormDataBody(body) ? body : void 0;
|
|
42919
|
-
const optionsNext = options?.next;
|
|
42920
|
-
const nextOptions = { ...optionsNext ?? {} };
|
|
42921
|
-
const cacheIsNoStore = options?.cache === "no-store";
|
|
42922
|
-
if (cacheIsNoStore) {
|
|
42923
|
-
delete nextOptions.revalidate;
|
|
42924
|
-
} else if (isGetOrHead && nextOptions.revalidate === void 0 && "revalidate" in endpointConfig && typeof endpointConfig.revalidate === "number") {
|
|
42925
|
-
nextOptions.revalidate = endpointConfig.revalidate;
|
|
42926
|
-
}
|
|
42927
|
-
if ("tags" in endpointConfig && Array.isArray(endpointConfig.tags)) {
|
|
42928
|
-
const processedTags = endpointConfig.tags.map((tag) => {
|
|
42929
|
-
let processedTag = tag;
|
|
42930
|
-
if (params) {
|
|
42931
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
42932
|
-
processedTag = processedTag.replace(`{${key}}`, String(value));
|
|
42933
|
-
});
|
|
42934
|
-
}
|
|
42935
|
-
return /\{[^}]+\}/.test(processedTag) ? null : processedTag;
|
|
42936
|
-
}).filter((tag) => tag !== null);
|
|
42937
|
-
nextOptions.tags = Array.from(/* @__PURE__ */ new Set([...nextOptions.tags ?? [], ...processedTags]));
|
|
42938
|
-
}
|
|
42939
|
-
const requestInit = {
|
|
42940
|
-
method,
|
|
42941
|
-
...options,
|
|
42942
|
-
// Include credentials for same-origin requests (sends cookies for auth)
|
|
42943
|
-
credentials: "same-origin",
|
|
42944
|
-
// Don't include body for GET/HEAD requests
|
|
42945
|
-
// FormData is pre-narrowed via isFormDataBody() above
|
|
42946
|
-
body: isGetOrHead || body == null ? void 0 : formDataBody ?? JSON.stringify(body),
|
|
42947
|
-
headers: {
|
|
42948
|
-
...options.headers,
|
|
42949
|
-
...headers,
|
|
42950
|
-
// Include SDK version if set
|
|
42951
|
-
...sdkVersion && { "x-sdk-version": sdkVersion },
|
|
42952
|
-
// Don't set Content-Type for GET/HEAD requests without body
|
|
42953
|
-
...isGetOrHead ? {} : formDataBody ? {} : { "Content-Type": "application/json" }
|
|
42954
|
-
},
|
|
42955
|
-
// Add Next.js caching options
|
|
42956
|
-
next: Object.keys(nextOptions).length > 0 ? nextOptions : void 0
|
|
42957
|
-
};
|
|
42958
|
-
const fetchPromise = fetch(url, requestInit);
|
|
42959
|
-
if (!isGetOrHead && "tags" in endpointConfig && Array.isArray(endpointConfig.tags)) {
|
|
42960
|
-
const tags2 = endpointConfig.tags.map((tag) => tag);
|
|
43019
|
+
const fetchPromise = fetch(plan.url, plan.init);
|
|
43020
|
+
if (plan.cacheInvalidationTags) {
|
|
42961
43021
|
return fetchPromise.then((response) => {
|
|
42962
43022
|
if (response.ok) {
|
|
42963
|
-
invalidateCacheTags(
|
|
43023
|
+
invalidateCacheTags(plan.cacheInvalidationTags, params);
|
|
42964
43024
|
}
|
|
42965
43025
|
return response;
|
|
42966
43026
|
});
|
|
@@ -42968,6 +43028,100 @@ function createRawCMSClient(headers = {}, baseUrl) {
|
|
|
42968
43028
|
return fetchPromise;
|
|
42969
43029
|
};
|
|
42970
43030
|
}
|
|
43031
|
+
function buildApiRequestPlan(input) {
|
|
43032
|
+
const { endpoint, body, params, headers = {}, baseUrl } = input;
|
|
43033
|
+
const options = input.options ?? {};
|
|
43034
|
+
let url = buildEndpointURL(baseUrl, endpoint);
|
|
43035
|
+
const originalPath = API_ENDPOINTS[endpoint].path;
|
|
43036
|
+
const unusedParams = {};
|
|
43037
|
+
if (params) {
|
|
43038
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
43039
|
+
const bracePlaceholder = `{${key}}`;
|
|
43040
|
+
const colonPlaceholder = `:${key}`;
|
|
43041
|
+
if (originalPath.includes(bracePlaceholder) || originalPath.includes(colonPlaceholder)) {
|
|
43042
|
+
const stringValue2 = serializePathParam(endpoint, key, value);
|
|
43043
|
+
url = url.replace(bracePlaceholder, stringValue2);
|
|
43044
|
+
url = url.replace(colonPlaceholder, stringValue2);
|
|
43045
|
+
} else {
|
|
43046
|
+
unusedParams[key] = value;
|
|
43047
|
+
}
|
|
43048
|
+
});
|
|
43049
|
+
}
|
|
43050
|
+
const unresolvedPathParams = [
|
|
43051
|
+
...url.match(/\{[^}]+\}/g) ?? [],
|
|
43052
|
+
...url.match(/(^|\/):([A-Za-z][A-Za-z0-9_]*)\b/g) ?? []
|
|
43053
|
+
];
|
|
43054
|
+
if (unresolvedPathParams.length > 0) {
|
|
43055
|
+
const missingParams = Array.from(
|
|
43056
|
+
new Set(
|
|
43057
|
+
unresolvedPathParams.map((token) => {
|
|
43058
|
+
if (token.startsWith("{") && token.endsWith("}")) {
|
|
43059
|
+
return token.slice(1, -1);
|
|
43060
|
+
}
|
|
43061
|
+
return token.replace(/^\//, "").slice(1);
|
|
43062
|
+
})
|
|
43063
|
+
)
|
|
43064
|
+
);
|
|
43065
|
+
throw new Error(
|
|
43066
|
+
`Missing required path params for endpoint ${String(endpoint)}: ${missingParams.join(", ")}`
|
|
43067
|
+
);
|
|
43068
|
+
}
|
|
43069
|
+
const endpointConfig = API_ENDPOINTS[endpoint];
|
|
43070
|
+
const method = endpointConfig.method;
|
|
43071
|
+
const isGetOrHead = method === "GET" || method === "HEAD";
|
|
43072
|
+
const queryParams = new URLSearchParams();
|
|
43073
|
+
Object.entries(unusedParams).forEach(([key, value]) => {
|
|
43074
|
+
appendQueryParam(queryParams, key, value);
|
|
43075
|
+
});
|
|
43076
|
+
if (isGetOrHead && typeof body === "object" && body !== null && !isFormDataBody(body)) {
|
|
43077
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
43078
|
+
appendQueryParam(queryParams, key, value);
|
|
43079
|
+
});
|
|
43080
|
+
}
|
|
43081
|
+
const queryString = queryParams.toString();
|
|
43082
|
+
if (queryString) {
|
|
43083
|
+
url += (url.includes("?") ? "&" : "?") + queryString;
|
|
43084
|
+
}
|
|
43085
|
+
const formDataBody = isFormDataBody(body) ? body : void 0;
|
|
43086
|
+
const optionsNext = options?.next;
|
|
43087
|
+
const nextOptions = { ...optionsNext ?? {} };
|
|
43088
|
+
const cacheIsNoStore = options?.cache === "no-store";
|
|
43089
|
+
if (cacheIsNoStore) {
|
|
43090
|
+
delete nextOptions.revalidate;
|
|
43091
|
+
} else if (isGetOrHead && nextOptions.revalidate === void 0 && "revalidate" in endpointConfig && typeof endpointConfig.revalidate === "number") {
|
|
43092
|
+
nextOptions.revalidate = endpointConfig.revalidate;
|
|
43093
|
+
}
|
|
43094
|
+
if ("tags" in endpointConfig && Array.isArray(endpointConfig.tags)) {
|
|
43095
|
+
const processedTags = endpointConfig.tags.map((tag) => {
|
|
43096
|
+
let processedTag = tag;
|
|
43097
|
+
if (params) {
|
|
43098
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
43099
|
+
processedTag = processedTag.replace(`{${key}}`, String(value));
|
|
43100
|
+
});
|
|
43101
|
+
}
|
|
43102
|
+
return /\{[^}]+\}/.test(processedTag) ? null : processedTag;
|
|
43103
|
+
}).filter((tag) => tag !== null);
|
|
43104
|
+
nextOptions.tags = Array.from(/* @__PURE__ */ new Set([...nextOptions.tags ?? [], ...processedTags]));
|
|
43105
|
+
}
|
|
43106
|
+
const init = {
|
|
43107
|
+
method,
|
|
43108
|
+
...options,
|
|
43109
|
+
credentials: "same-origin",
|
|
43110
|
+
body: isGetOrHead || body == null ? void 0 : formDataBody ?? JSON.stringify(body),
|
|
43111
|
+
headers: buildRequestHeaders({
|
|
43112
|
+
optionsHeaders: options.headers,
|
|
43113
|
+
authHeaders: headers,
|
|
43114
|
+
sdkVersion: input.sdkVersion,
|
|
43115
|
+
includeJsonContentType: !isGetOrHead && !formDataBody
|
|
43116
|
+
}),
|
|
43117
|
+
...Object.keys(nextOptions).length > 0 ? { next: nextOptions } : {}
|
|
43118
|
+
};
|
|
43119
|
+
return {
|
|
43120
|
+
url,
|
|
43121
|
+
init,
|
|
43122
|
+
...!isGetOrHead && "tags" in endpointConfig && Array.isArray(endpointConfig.tags) ? { cacheInvalidationTags: endpointConfig.tags.map((tag) => tag) } : {}
|
|
43123
|
+
};
|
|
43124
|
+
}
|
|
42971
43125
|
function createParsedClient(rawClient) {
|
|
42972
43126
|
return async (params) => {
|
|
42973
43127
|
const response = await rawClient(params);
|
|
@@ -43224,7 +43378,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
|
|
|
43224
43378
|
}
|
|
43225
43379
|
|
|
43226
43380
|
// ../api/src/utils/isRecord.ts
|
|
43227
|
-
function
|
|
43381
|
+
function isRecord9(value) {
|
|
43228
43382
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43229
43383
|
}
|
|
43230
43384
|
var APPOINTMENT_SETUP_MAX_MINUTES = 1440;
|
|
@@ -43497,7 +43651,7 @@ function sanitizeMarks(marks) {
|
|
|
43497
43651
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
43498
43652
|
return [{ type: mark.type }];
|
|
43499
43653
|
}
|
|
43500
|
-
if (mark.type === "link" &&
|
|
43654
|
+
if (mark.type === "link" && isRecord9(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
43501
43655
|
const attrs = { href: mark.attrs.href };
|
|
43502
43656
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
43503
43657
|
attrs.target = mark.attrs.target;
|
|
@@ -43512,10 +43666,10 @@ function sanitizeMarks(marks) {
|
|
|
43512
43666
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
43513
43667
|
}
|
|
43514
43668
|
function unwrapRichTextValue(value) {
|
|
43515
|
-
if (
|
|
43669
|
+
if (isRecord9(value) && isRecord9(value.doc)) {
|
|
43516
43670
|
return unwrapRichTextValue(value.doc);
|
|
43517
43671
|
}
|
|
43518
|
-
if (
|
|
43672
|
+
if (isRecord9(value) && value.type === "doc") {
|
|
43519
43673
|
return {
|
|
43520
43674
|
type: "doc",
|
|
43521
43675
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -43524,7 +43678,7 @@ function unwrapRichTextValue(value) {
|
|
|
43524
43678
|
return EMPTY_SITE_BANNER_BODY;
|
|
43525
43679
|
}
|
|
43526
43680
|
function isTipTapNodeLike(value) {
|
|
43527
|
-
return
|
|
43681
|
+
return isRecord9(value) && typeof value.type === "string";
|
|
43528
43682
|
}
|
|
43529
43683
|
function coerceTipTapNode(value) {
|
|
43530
43684
|
return {
|
|
@@ -43532,9 +43686,9 @@ function coerceTipTapNode(value) {
|
|
|
43532
43686
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
43533
43687
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
43534
43688
|
...Array.isArray(value.marks) ? {
|
|
43535
|
-
marks: value.marks.filter((mark) =>
|
|
43689
|
+
marks: value.marks.filter((mark) => isRecord9(mark) && typeof mark.type === "string").map((mark) => ({
|
|
43536
43690
|
type: mark.type,
|
|
43537
|
-
...
|
|
43691
|
+
...isRecord9(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
43538
43692
|
}))
|
|
43539
43693
|
} : {}
|
|
43540
43694
|
};
|
|
@@ -43650,7 +43804,7 @@ function collectCartLinkStats(items, depth = 0) {
|
|
|
43650
43804
|
return result;
|
|
43651
43805
|
}
|
|
43652
43806
|
function isNavigationMenuValidationItem(value) {
|
|
43653
|
-
if (!
|
|
43807
|
+
if (!isRecord9(value)) return false;
|
|
43654
43808
|
return typeof value.label === "string";
|
|
43655
43809
|
}
|
|
43656
43810
|
|
|
@@ -43909,8 +44063,8 @@ var TEMPLATE_BINDING_META_PATHS = [
|
|
|
43909
44063
|
"createdAt",
|
|
43910
44064
|
"updatedAt"
|
|
43911
44065
|
];
|
|
43912
|
-
function describeInvalidTemplateBindingMetaPath(
|
|
43913
|
-
return `Meta path "${
|
|
44066
|
+
function describeInvalidTemplateBindingMetaPath(path28) {
|
|
44067
|
+
return `Meta path "${path28}" is not valid. Allowed: ${TEMPLATE_BINDING_META_PATHS.join(", ")}`;
|
|
43914
44068
|
}
|
|
43915
44069
|
|
|
43916
44070
|
// ../content-model/src/routeTemplate.ts
|
|
@@ -43989,6 +44143,25 @@ function splitRouteSegments(routePattern) {
|
|
|
43989
44143
|
function isUnsupportedDynamicSegment(segment) {
|
|
43990
44144
|
return segment.startsWith(":") || segment.includes("{") || segment.includes("}");
|
|
43991
44145
|
}
|
|
44146
|
+
var defaultContentSchema = z.record(
|
|
44147
|
+
z.string(),
|
|
44148
|
+
z.unknown()
|
|
44149
|
+
);
|
|
44150
|
+
function createSdkEntrySlotBlockInputSchema(contentSchema = defaultContentSchema) {
|
|
44151
|
+
return z.object({
|
|
44152
|
+
identifier: z.string().nullable().optional(),
|
|
44153
|
+
kind: z.string().min(1, "Block kind is required"),
|
|
44154
|
+
content: contentSchema
|
|
44155
|
+
});
|
|
44156
|
+
}
|
|
44157
|
+
function createSdkEntrySlotBlocksInputSchema(contentSchema) {
|
|
44158
|
+
return z.record(
|
|
44159
|
+
z.string(),
|
|
44160
|
+
z.array(createSdkEntrySlotBlockInputSchema(contentSchema))
|
|
44161
|
+
);
|
|
44162
|
+
}
|
|
44163
|
+
createSdkEntrySlotBlockInputSchema();
|
|
44164
|
+
var sdkEntrySlotBlocksInputSchema = createSdkEntrySlotBlocksInputSchema();
|
|
43992
44165
|
|
|
43993
44166
|
// src/contracts/bindings.ts
|
|
43994
44167
|
var BINDING_TRANSFORMS = {
|
|
@@ -44299,7 +44472,7 @@ var contentConfigSchema = contentConfigBaseSchema.superRefine((data, ctx) => {
|
|
|
44299
44472
|
});
|
|
44300
44473
|
}
|
|
44301
44474
|
const paths = data.pages.map((p) => p.path);
|
|
44302
|
-
const duplicatePaths = paths.filter((
|
|
44475
|
+
const duplicatePaths = paths.filter((path28, i) => paths.indexOf(path28) !== i);
|
|
44303
44476
|
if (duplicatePaths.length > 0) {
|
|
44304
44477
|
ctx.addIssue({
|
|
44305
44478
|
code: z.ZodIssueCode.custom,
|
|
@@ -44356,18 +44529,18 @@ function validateLayoutNodeTypes(layout) {
|
|
|
44356
44529
|
errors
|
|
44357
44530
|
};
|
|
44358
44531
|
}
|
|
44359
|
-
function validateNodeTypesRecursive(node,
|
|
44532
|
+
function validateNodeTypesRecursive(node, path28, errors) {
|
|
44360
44533
|
if (!ALLOWED_NODE_TYPES_SET.has(node.type)) {
|
|
44361
44534
|
errors.push({
|
|
44362
|
-
path: `${
|
|
44535
|
+
path: `${path28}.type`,
|
|
44363
44536
|
type: "invalid_node_type",
|
|
44364
44537
|
value: node.type,
|
|
44365
|
-
message: `Unknown node type "${node.type}" at ${
|
|
44538
|
+
message: `Unknown node type "${node.type}" at ${path28}. Valid types: section, stack, text, etc.`
|
|
44366
44539
|
});
|
|
44367
44540
|
}
|
|
44368
44541
|
if (node.children && Array.isArray(node.children)) {
|
|
44369
44542
|
node.children.forEach((child, index) => {
|
|
44370
|
-
validateNodeTypesRecursive(child, `${
|
|
44543
|
+
validateNodeTypesRecursive(child, `${path28}.children[${index}]`, errors);
|
|
44371
44544
|
});
|
|
44372
44545
|
}
|
|
44373
44546
|
}
|
|
@@ -44379,45 +44552,45 @@ function validateTransformIds(layout) {
|
|
|
44379
44552
|
errors
|
|
44380
44553
|
};
|
|
44381
44554
|
}
|
|
44382
|
-
function validateTransformIdsRecursive(node,
|
|
44555
|
+
function validateTransformIdsRecursive(node, path28, errors) {
|
|
44383
44556
|
if (node.$bind?.transforms && Array.isArray(node.$bind.transforms)) {
|
|
44384
|
-
validateTransformList(node.$bind.transforms, `${
|
|
44557
|
+
validateTransformList(node.$bind.transforms, `${path28}.$bind.transforms`, errors);
|
|
44385
44558
|
}
|
|
44386
44559
|
if (node.$repeat?.collection?.transforms && Array.isArray(node.$repeat.collection.transforms)) {
|
|
44387
|
-
validateTransformList(node.$repeat.collection.transforms, `${
|
|
44560
|
+
validateTransformList(node.$repeat.collection.transforms, `${path28}.$repeat.collection.transforms`, errors);
|
|
44388
44561
|
}
|
|
44389
44562
|
if (node.$when?.when?.transforms && Array.isArray(node.$when.when.transforms)) {
|
|
44390
|
-
validateTransformList(node.$when.when.transforms, `${
|
|
44563
|
+
validateTransformList(node.$when.when.transforms, `${path28}.$when.when.transforms`, errors);
|
|
44391
44564
|
}
|
|
44392
44565
|
if (node.$scopes && Array.isArray(node.$scopes)) {
|
|
44393
44566
|
node.$scopes.forEach((scope, index) => {
|
|
44394
44567
|
if (scope.from?.transforms && Array.isArray(scope.from.transforms)) {
|
|
44395
|
-
validateTransformList(scope.from.transforms, `${
|
|
44568
|
+
validateTransformList(scope.from.transforms, `${path28}.$scopes[${index}].from.transforms`, errors);
|
|
44396
44569
|
}
|
|
44397
44570
|
});
|
|
44398
44571
|
}
|
|
44399
44572
|
if (node.props) {
|
|
44400
|
-
validatePropsTransforms(node.props, `${
|
|
44573
|
+
validatePropsTransforms(node.props, `${path28}.props`, errors);
|
|
44401
44574
|
}
|
|
44402
44575
|
if (node.children && Array.isArray(node.children)) {
|
|
44403
44576
|
node.children.forEach((child, index) => {
|
|
44404
|
-
validateTransformIdsRecursive(child, `${
|
|
44577
|
+
validateTransformIdsRecursive(child, `${path28}.children[${index}]`, errors);
|
|
44405
44578
|
});
|
|
44406
44579
|
}
|
|
44407
44580
|
}
|
|
44408
|
-
function validateTransformList(transforms,
|
|
44581
|
+
function validateTransformList(transforms, path28, errors) {
|
|
44409
44582
|
transforms.forEach((transform, index) => {
|
|
44410
44583
|
if (!ALLOWED_TRANSFORM_IDS_SET.has(transform.id)) {
|
|
44411
44584
|
errors.push({
|
|
44412
|
-
path: `${
|
|
44585
|
+
path: `${path28}[${index}].id`,
|
|
44413
44586
|
type: "invalid_transform_id",
|
|
44414
44587
|
value: transform.id,
|
|
44415
|
-
message: `Unknown transform "${transform.id}" at ${
|
|
44588
|
+
message: `Unknown transform "${transform.id}" at ${path28}. Valid transforms: string.uppercase, value.fallback, etc.`
|
|
44416
44589
|
});
|
|
44417
44590
|
}
|
|
44418
44591
|
});
|
|
44419
44592
|
}
|
|
44420
|
-
function validatePropsTransforms(props2,
|
|
44593
|
+
function validatePropsTransforms(props2, path28, errors) {
|
|
44421
44594
|
for (const [key, value] of Object.entries(props2)) {
|
|
44422
44595
|
if (isBindingObject(value)) {
|
|
44423
44596
|
const binding = value;
|
|
@@ -44425,16 +44598,16 @@ function validatePropsTransforms(props2, path27, errors) {
|
|
|
44425
44598
|
binding.$bind.transforms.forEach((transform, index) => {
|
|
44426
44599
|
if (!ALLOWED_TRANSFORM_IDS_SET.has(transform.id)) {
|
|
44427
44600
|
errors.push({
|
|
44428
|
-
path: `${
|
|
44601
|
+
path: `${path28}.${key}.$bind.transforms[${index}].id`,
|
|
44429
44602
|
type: "invalid_transform_id",
|
|
44430
44603
|
value: transform.id,
|
|
44431
|
-
message: `Unknown transform "${transform.id}" at ${
|
|
44604
|
+
message: `Unknown transform "${transform.id}" at ${path28}.${key}. Valid transforms: string.uppercase, value.fallback, etc.`
|
|
44432
44605
|
});
|
|
44433
44606
|
}
|
|
44434
44607
|
});
|
|
44435
44608
|
}
|
|
44436
44609
|
} else if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
44437
|
-
validatePropsTransforms(value, `${
|
|
44610
|
+
validatePropsTransforms(value, `${path28}.${key}`, errors);
|
|
44438
44611
|
}
|
|
44439
44612
|
}
|
|
44440
44613
|
}
|
|
@@ -44884,20 +45057,20 @@ var ManagementApiError = class extends Error {
|
|
|
44884
45057
|
function is404Error(error) {
|
|
44885
45058
|
return error instanceof ManagementApiError && error.statusCode === 404;
|
|
44886
45059
|
}
|
|
44887
|
-
function
|
|
45060
|
+
function isRecord10(value) {
|
|
44888
45061
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
44889
45062
|
}
|
|
44890
45063
|
function isFieldError(value) {
|
|
44891
|
-
return
|
|
45064
|
+
return isRecord10(value) && typeof value.field === "string" && typeof value.code === "string" && typeof value.message === "string";
|
|
44892
45065
|
}
|
|
44893
45066
|
function parseApiResponse(value) {
|
|
44894
|
-
if (!
|
|
45067
|
+
if (!isRecord10(value)) return null;
|
|
44895
45068
|
if (value.success === true) {
|
|
44896
45069
|
return { success: true, data: value.data };
|
|
44897
45070
|
}
|
|
44898
45071
|
if (value.success === false) {
|
|
44899
45072
|
const error = value.error;
|
|
44900
|
-
if (!
|
|
45073
|
+
if (!isRecord10(error) || typeof error.code !== "string" || typeof error.message !== "string") {
|
|
44901
45074
|
return { success: false, error: { code: "sdk:http-error", message: "Request failed", details: error } };
|
|
44902
45075
|
}
|
|
44903
45076
|
const fieldErrorsRaw = error.fieldErrors;
|
|
@@ -44964,8 +45137,8 @@ async function readApiResponse(response, requestInfo, options = {}) {
|
|
|
44964
45137
|
function createHttpClient(config2) {
|
|
44965
45138
|
const baseUrl = `${config2.dashboardUrl}/api/sdk/${config2.siteId}`;
|
|
44966
45139
|
const timeout = config2.timeout ?? 3e4;
|
|
44967
|
-
async function request(method,
|
|
44968
|
-
let url = `${baseUrl}${
|
|
45140
|
+
async function request(method, path28, options) {
|
|
45141
|
+
let url = `${baseUrl}${path28}`;
|
|
44969
45142
|
if (options?.params && Object.keys(options.params).length > 0) {
|
|
44970
45143
|
const searchParams = new URLSearchParams(options.params);
|
|
44971
45144
|
url = `${url}?${searchParams.toString()}`;
|
|
@@ -44988,7 +45161,7 @@ function createHttpClient(config2) {
|
|
|
44988
45161
|
} catch (error) {
|
|
44989
45162
|
const requestInfo2 = buildRequestInfo({
|
|
44990
45163
|
method,
|
|
44991
|
-
path:
|
|
45164
|
+
path: path28,
|
|
44992
45165
|
url,
|
|
44993
45166
|
baseUrl,
|
|
44994
45167
|
dashboardUrl: config2.dashboardUrl,
|
|
@@ -45013,7 +45186,7 @@ function createHttpClient(config2) {
|
|
|
45013
45186
|
}
|
|
45014
45187
|
const requestInfo = buildRequestInfo({
|
|
45015
45188
|
method,
|
|
45016
|
-
path:
|
|
45189
|
+
path: path28,
|
|
45017
45190
|
url,
|
|
45018
45191
|
baseUrl,
|
|
45019
45192
|
dashboardUrl: config2.dashboardUrl,
|
|
@@ -45043,17 +45216,17 @@ function createHttpClient(config2) {
|
|
|
45043
45216
|
return json.data;
|
|
45044
45217
|
}
|
|
45045
45218
|
return {
|
|
45046
|
-
async get(
|
|
45047
|
-
return request("GET",
|
|
45219
|
+
async get(path28, params) {
|
|
45220
|
+
return request("GET", path28, { params });
|
|
45048
45221
|
},
|
|
45049
|
-
async post(
|
|
45050
|
-
return request("POST",
|
|
45222
|
+
async post(path28, body) {
|
|
45223
|
+
return request("POST", path28, { body });
|
|
45051
45224
|
},
|
|
45052
|
-
async patch(
|
|
45053
|
-
return request("PATCH",
|
|
45225
|
+
async patch(path28, body) {
|
|
45226
|
+
return request("PATCH", path28, { body });
|
|
45054
45227
|
},
|
|
45055
|
-
async delete(
|
|
45056
|
-
await request("DELETE",
|
|
45228
|
+
async delete(path28, body) {
|
|
45229
|
+
await request("DELETE", path28, { body });
|
|
45057
45230
|
}
|
|
45058
45231
|
};
|
|
45059
45232
|
}
|
|
@@ -46426,7 +46599,7 @@ function createListCommand(config2) {
|
|
|
46426
46599
|
|
|
46427
46600
|
// src/cli/push-config.ts
|
|
46428
46601
|
var DEFAULT_CONFIG_PATH = "./riverbank.config.ts";
|
|
46429
|
-
function
|
|
46602
|
+
function isRecord11(value) {
|
|
46430
46603
|
return typeof value === "object" && value !== null;
|
|
46431
46604
|
}
|
|
46432
46605
|
function parseErrorDetails(value) {
|
|
@@ -46434,10 +46607,10 @@ function parseErrorDetails(value) {
|
|
|
46434
46607
|
if (typeof value === "string") {
|
|
46435
46608
|
return { message: value };
|
|
46436
46609
|
}
|
|
46437
|
-
if (!
|
|
46610
|
+
if (!isRecord11(value)) return {};
|
|
46438
46611
|
const message = typeof value.message === "string" ? value.message : void 0;
|
|
46439
46612
|
const fieldErrorsRaw = value.fieldErrors;
|
|
46440
|
-
const fieldErrors = Array.isArray(fieldErrorsRaw) ? fieldErrorsRaw.filter(
|
|
46613
|
+
const fieldErrors = Array.isArray(fieldErrorsRaw) ? fieldErrorsRaw.filter(isRecord11).map((d) => ({
|
|
46441
46614
|
field: typeof d.field === "string" ? d.field : "",
|
|
46442
46615
|
message: typeof d.message === "string" ? d.message : ""
|
|
46443
46616
|
})).filter((d) => d.field.length > 0 && d.message.length > 0) : void 0;
|
|
@@ -46449,12 +46622,12 @@ function formatFieldErrors(fieldErrors) {
|
|
|
46449
46622
|
}
|
|
46450
46623
|
function getDashboardErrorMessage(responseJson, fallback) {
|
|
46451
46624
|
if (!responseJson) return fallback;
|
|
46452
|
-
if (
|
|
46625
|
+
if (isRecord11(responseJson) && responseJson.success === false && "error" in responseJson) {
|
|
46453
46626
|
const parsed = parseErrorDetails(responseJson.error);
|
|
46454
46627
|
const msg = parsed.message ?? fallback;
|
|
46455
46628
|
return msg + formatFieldErrors(parsed.fieldErrors);
|
|
46456
46629
|
}
|
|
46457
|
-
if (
|
|
46630
|
+
if (isRecord11(responseJson) && "error" in responseJson) {
|
|
46458
46631
|
const parsed = parseErrorDetails(responseJson.error);
|
|
46459
46632
|
const msg = parsed.message ?? fallback;
|
|
46460
46633
|
return msg + formatFieldErrors(parsed.fieldErrors);
|
|
@@ -46498,12 +46671,12 @@ function collectPushConfigSyncWarnings(sync) {
|
|
|
46498
46671
|
async function pushToDashboard(output, dashboardUrl, siteId, apiKey, config2, options) {
|
|
46499
46672
|
const normalizedDashboardUrl = dashboardUrl.replace(/\/+$/, "");
|
|
46500
46673
|
const baseUrl = `${normalizedDashboardUrl}/api`;
|
|
46501
|
-
const
|
|
46502
|
-
const pushUrl = `${baseUrl}${
|
|
46674
|
+
const path28 = `/sites/${siteId}/sdk-config`;
|
|
46675
|
+
const pushUrl = `${baseUrl}${path28}`;
|
|
46503
46676
|
output.info(`Pushing config to ${pushUrl}...`);
|
|
46504
46677
|
const requestInfo = {
|
|
46505
46678
|
method: "POST",
|
|
46506
|
-
path:
|
|
46679
|
+
path: path28,
|
|
46507
46680
|
url: pushUrl,
|
|
46508
46681
|
baseUrl,
|
|
46509
46682
|
dashboardUrl: normalizedDashboardUrl,
|
|
@@ -46779,7 +46952,7 @@ function duplicateNavigationIdentityMessage(error) {
|
|
|
46779
46952
|
|
|
46780
46953
|
// src/cli/media/portable.ts
|
|
46781
46954
|
var ENV_SPECIFIC_MEDIA_KEYS = ["assetId", "storagePath", "storageBucket"];
|
|
46782
|
-
var
|
|
46955
|
+
var isRecord12 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
46783
46956
|
var isMediaObject = (value) => value.type === "image" || value.type === "video";
|
|
46784
46957
|
function stripEnvSpecificMediaFieldsInPlace(value) {
|
|
46785
46958
|
if (value === null || value === void 0) return;
|
|
@@ -46789,7 +46962,7 @@ function stripEnvSpecificMediaFieldsInPlace(value) {
|
|
|
46789
46962
|
}
|
|
46790
46963
|
return;
|
|
46791
46964
|
}
|
|
46792
|
-
if (!
|
|
46965
|
+
if (!isRecord12(value)) return;
|
|
46793
46966
|
if (isMediaObject(value)) {
|
|
46794
46967
|
const hasCmsRef = typeof value.identifier === "string" || typeof value.assetId === "string" || typeof value.storagePath === "string" || typeof value.storageBucket === "string";
|
|
46795
46968
|
for (const key of ENV_SPECIFIC_MEDIA_KEYS) {
|
|
@@ -46800,7 +46973,7 @@ function stripEnvSpecificMediaFieldsInPlace(value) {
|
|
|
46800
46973
|
}
|
|
46801
46974
|
delete value.mimeType;
|
|
46802
46975
|
}
|
|
46803
|
-
if (value.type === "image" &&
|
|
46976
|
+
if (value.type === "image" && isRecord12(value.attrs)) {
|
|
46804
46977
|
const attrs = value.attrs;
|
|
46805
46978
|
const hasIdentifier = typeof attrs.identifier === "string" && attrs.identifier.trim().length > 0;
|
|
46806
46979
|
if (hasIdentifier) {
|
|
@@ -46972,11 +47145,11 @@ function entryFilePath(input) {
|
|
|
46972
47145
|
}
|
|
46973
47146
|
|
|
46974
47147
|
// src/cli/content/writer.ts
|
|
46975
|
-
function
|
|
47148
|
+
function isRecord13(value) {
|
|
46976
47149
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
46977
47150
|
}
|
|
46978
47151
|
function parseThemeMeta(value) {
|
|
46979
|
-
if (!
|
|
47152
|
+
if (!isRecord13(value) || typeof value.pulledAt !== "string" || !isRecord13(value.themes)) {
|
|
46980
47153
|
return null;
|
|
46981
47154
|
}
|
|
46982
47155
|
return { pulledAt: value.pulledAt, themes: value.themes };
|
|
@@ -47307,6 +47480,7 @@ function toWritableLocalEvent(event) {
|
|
|
47307
47480
|
identifier: event.identifier,
|
|
47308
47481
|
title: event.title,
|
|
47309
47482
|
slug: event.slug,
|
|
47483
|
+
path: event.path,
|
|
47310
47484
|
status: event.status,
|
|
47311
47485
|
visibility: event.visibility,
|
|
47312
47486
|
schedule: event.schedule,
|
|
@@ -47319,7 +47493,8 @@ function toWritableLocalEvent(event) {
|
|
|
47319
47493
|
formRef: event.formRef,
|
|
47320
47494
|
settings: event.settings,
|
|
47321
47495
|
presentation: event.presentation,
|
|
47322
|
-
tags: event.tags
|
|
47496
|
+
tags: event.tags,
|
|
47497
|
+
blocks: event.blocks
|
|
47323
47498
|
};
|
|
47324
47499
|
}
|
|
47325
47500
|
async function writeCourses(contentDir, pulledCourses, options) {
|
|
@@ -47708,13 +47883,16 @@ async function readEventCategories(contentDir) {
|
|
|
47708
47883
|
return categories;
|
|
47709
47884
|
}
|
|
47710
47885
|
async function readEvents(contentDir) {
|
|
47886
|
+
return (await readEventsWithFilePaths(contentDir)).map(({ filePath: _filePath, ...event }) => event);
|
|
47887
|
+
}
|
|
47888
|
+
async function readEventsWithFilePaths(contentDir) {
|
|
47711
47889
|
const eventsDir = path5.join(contentDir, "events");
|
|
47712
47890
|
const events = [];
|
|
47713
47891
|
const files = await listFiles(eventsDir, ".json");
|
|
47714
47892
|
for (const filePath of files) {
|
|
47715
47893
|
try {
|
|
47716
47894
|
const event = await readJsonFile(filePath);
|
|
47717
|
-
events.push(event);
|
|
47895
|
+
events.push({ ...event, filePath });
|
|
47718
47896
|
} catch (error) {
|
|
47719
47897
|
console.warn(`Warning: Could not parse ${filePath}:`, error);
|
|
47720
47898
|
}
|
|
@@ -48394,9 +48572,9 @@ async function localMediaFileExists(filePath) {
|
|
|
48394
48572
|
}
|
|
48395
48573
|
|
|
48396
48574
|
// src/cli/media/identifiers.ts
|
|
48397
|
-
var
|
|
48575
|
+
var isRecord14 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
48398
48576
|
var isMediaValue = (value) => {
|
|
48399
|
-
if (!
|
|
48577
|
+
if (!isRecord14(value)) return false;
|
|
48400
48578
|
const type = value.type;
|
|
48401
48579
|
if (type !== "image" && type !== "video" && type !== "audio" && type !== "document" && type !== "spreadsheet" && type !== "archive") return false;
|
|
48402
48580
|
return typeof value.identifier === "string" || typeof value.assetId === "string" || typeof value.storagePath === "string" || typeof value.src === "string";
|
|
@@ -48411,7 +48589,7 @@ var walkMediaValues = (value, location2, handler) => {
|
|
|
48411
48589
|
});
|
|
48412
48590
|
return;
|
|
48413
48591
|
}
|
|
48414
|
-
if (
|
|
48592
|
+
if (isRecord14(value)) {
|
|
48415
48593
|
Object.entries(value).forEach(([key, entry]) => {
|
|
48416
48594
|
walkMediaValues(entry, location2 ? `${location2}.${key}` : key, handler);
|
|
48417
48595
|
});
|
|
@@ -48537,7 +48715,7 @@ var normalizeMediaValueToIdentifierOnly = (value, identifier, asset) => {
|
|
|
48537
48715
|
};
|
|
48538
48716
|
|
|
48539
48717
|
// src/cli/media/rich-text.ts
|
|
48540
|
-
var
|
|
48718
|
+
var isRecord15 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
48541
48719
|
function collectRichTextImageAttrs(value, out = [], location2 = "") {
|
|
48542
48720
|
if (Array.isArray(value)) {
|
|
48543
48721
|
value.forEach(
|
|
@@ -48545,8 +48723,8 @@ function collectRichTextImageAttrs(value, out = [], location2 = "") {
|
|
|
48545
48723
|
);
|
|
48546
48724
|
return out;
|
|
48547
48725
|
}
|
|
48548
|
-
if (!
|
|
48549
|
-
if (value.type === "image" &&
|
|
48726
|
+
if (!isRecord15(value)) return out;
|
|
48727
|
+
if (value.type === "image" && isRecord15(value.attrs)) {
|
|
48550
48728
|
out.push({ attrs: value.attrs, location: location2 ? `${location2}.attrs` : "attrs" });
|
|
48551
48729
|
}
|
|
48552
48730
|
for (const [key, child] of Object.entries(value)) {
|
|
@@ -49377,11 +49555,11 @@ function findChangedFields(local, remote, prefix = "") {
|
|
|
49377
49555
|
const changes = [];
|
|
49378
49556
|
const allKeys = /* @__PURE__ */ new Set([...Object.keys(local), ...Object.keys(remote)]);
|
|
49379
49557
|
for (const key of allKeys) {
|
|
49380
|
-
const
|
|
49558
|
+
const path28 = prefix ? `${prefix}.${key}` : key;
|
|
49381
49559
|
const localVal = local[key];
|
|
49382
49560
|
const remoteVal = remote[key];
|
|
49383
49561
|
if (!equal(localVal, remoteVal)) {
|
|
49384
|
-
changes.push(
|
|
49562
|
+
changes.push(path28);
|
|
49385
49563
|
}
|
|
49386
49564
|
}
|
|
49387
49565
|
return changes;
|
|
@@ -50451,11 +50629,11 @@ function findChangedFieldsWithValues(local, remote, prefix = "") {
|
|
|
50451
50629
|
const changes = [];
|
|
50452
50630
|
const allKeys = /* @__PURE__ */ new Set([...Object.keys(local), ...Object.keys(remote)]);
|
|
50453
50631
|
for (const key of allKeys) {
|
|
50454
|
-
const
|
|
50632
|
+
const path28 = prefix ? `${prefix}.${key}` : key;
|
|
50455
50633
|
const localVal = local[key];
|
|
50456
50634
|
const remoteVal = remote[key];
|
|
50457
50635
|
if (!equal(localVal, remoteVal)) {
|
|
50458
|
-
changes.push({ path:
|
|
50636
|
+
changes.push({ path: path28, before: remoteVal, after: localVal });
|
|
50459
50637
|
}
|
|
50460
50638
|
}
|
|
50461
50639
|
return changes;
|
|
@@ -50872,6 +51050,19 @@ function maskPullDiffForScope(diff, pullScope) {
|
|
|
50872
51050
|
}
|
|
50873
51051
|
return diff;
|
|
50874
51052
|
}
|
|
51053
|
+
|
|
51054
|
+
// src/cli/commands/pull-dated-offering-scope.ts
|
|
51055
|
+
function isDatedOfferingPullScope(scope) {
|
|
51056
|
+
return scope === "venues" || scope === "event-categories" || scope === "events" || scope === "courses";
|
|
51057
|
+
}
|
|
51058
|
+
function filterPullItemsByIdentifier(items, identifier, getIdentifier) {
|
|
51059
|
+
return identifier ? items.filter((item) => getIdentifier(item) === identifier) : [...items];
|
|
51060
|
+
}
|
|
51061
|
+
function reportMissingScopedPullItem(input) {
|
|
51062
|
+
if (!input.identifier || input.found) return false;
|
|
51063
|
+
input.output.error(`${input.scope} item not found: ${input.identifier}`);
|
|
51064
|
+
return true;
|
|
51065
|
+
}
|
|
50875
51066
|
var CANONICAL_EVENT_ENTRY_TYPE = "event";
|
|
50876
51067
|
var EVENT_MIGRATION_COMMAND = "riverbankcms migrate events";
|
|
50877
51068
|
var EVENT_PUSH_COMMAND = "riverbankcms push events";
|
|
@@ -51170,7 +51361,8 @@ function mapRemoteEventToLocalComparable(e) {
|
|
|
51170
51361
|
formRef: e.formRef,
|
|
51171
51362
|
settings: e.settings,
|
|
51172
51363
|
presentation: e.presentation,
|
|
51173
|
-
tags: e.tags
|
|
51364
|
+
tags: e.tags,
|
|
51365
|
+
blocks: e.blocks
|
|
51174
51366
|
};
|
|
51175
51367
|
}
|
|
51176
51368
|
function mapLocalEventToComparable(e) {
|
|
@@ -51189,7 +51381,8 @@ function mapLocalEventToComparable(e) {
|
|
|
51189
51381
|
formRef: e.formRef,
|
|
51190
51382
|
settings: e.settings,
|
|
51191
51383
|
presentation: e.presentation,
|
|
51192
|
-
tags: e.tags
|
|
51384
|
+
tags: e.tags,
|
|
51385
|
+
blocks: e.blocks
|
|
51193
51386
|
};
|
|
51194
51387
|
}
|
|
51195
51388
|
function mapRemoteCourseToLocalComparable(course) {
|
|
@@ -51501,7 +51694,7 @@ async function warnForLocalLegacyEventEntries(input) {
|
|
|
51501
51694
|
formatLegacyEventEntryWarning(legacyEventEntryFiles)
|
|
51502
51695
|
);
|
|
51503
51696
|
}
|
|
51504
|
-
var pullCommand = new Command("pull").description("Pull content from CMS").argument("[scope]", "What to pull: entries, pages, navigation, settings, forms, theme, footer, venues, event-categories, events, courses, or all (default)").argument("[type]", "Content type (entries) or
|
|
51697
|
+
var pullCommand = new Command("pull").description("Pull content from CMS").argument("[scope]", "What to pull: entries, pages, navigation, settings, forms, theme, footer, venues, event-categories, events, courses, or all (default)").argument("[type]", "Content type (entries) or item identifier (pages, venues, event-categories, events, courses)").argument("[identifier]", 'Entry identifier (when scope is "entries" and type is set)').option("--output <dir>", "Output directory", "./content").option("--force", "Overwrite existing files without prompting").option("--yes", "Skip confirmation prompt (same as --force)").option("--sync-media", "Sync media files from source to target environment").option("--overwrite-media", "When using --sync-media, overwrite target media on checksum mismatch").option("--local-media", "Download media referenced by identifiers to content/media").option("--dry-run", "Show what would be pulled without writing files").option("--json-diff [mode]", "Output diff as JSON (summary or full)", "summary").option("--with-theme", "Also pull theme when pulling all content").option("--name <name>", "Theme name for theme pull / --with-theme (default: current)").option("--no-meta", "Skip writing .meta/ and media manifest files (content files still written)").option("--diff", "Show human-readable field-level diff with before/after values (requires --dry-run)").addHelpText("after", `
|
|
51505
51698
|
Examples:
|
|
51506
51699
|
$ riverbankcms pull # Pull all content
|
|
51507
51700
|
$ riverbankcms pull --dry-run # Preview what would be pulled
|
|
@@ -51520,7 +51713,9 @@ Examples:
|
|
|
51520
51713
|
$ riverbankcms pull venues # Pull venues
|
|
51521
51714
|
$ riverbankcms pull event-categories # Pull event categories
|
|
51522
51715
|
$ riverbankcms pull events # Pull events
|
|
51716
|
+
$ riverbankcms pull events the-whole-in-your-heart # Pull a specific event
|
|
51523
51717
|
$ riverbankcms pull courses # Pull courses
|
|
51718
|
+
$ riverbankcms pull courses beginners # Pull a specific course
|
|
51524
51719
|
$ riverbankcms pull theme # Pull theme to content/themes/current.json
|
|
51525
51720
|
$ riverbankcms pull theme --name=neon # Pull theme to content/themes/neon.json
|
|
51526
51721
|
$ riverbankcms pull --output ./src/content # Custom output directory
|
|
@@ -51588,7 +51783,7 @@ Media Sync:
|
|
|
51588
51783
|
const resolvedJsonDiffMode = jsonDiffMode ?? (options.jsonDiff === true ? "summary" : void 0);
|
|
51589
51784
|
if (identifier && pullScope2 !== "entries") {
|
|
51590
51785
|
output.error("An item identifier is only supported for entries pulls", {
|
|
51591
|
-
suggestion: 'Use "riverbankcms pull pages <page-identifier>"
|
|
51786
|
+
suggestion: 'Use "riverbankcms pull events <event-identifier>" or "riverbankcms pull pages <page-identifier>" with the identifier as the second argument.'
|
|
51592
51787
|
});
|
|
51593
51788
|
return;
|
|
51594
51789
|
}
|
|
@@ -51732,17 +51927,23 @@ Media Sync:
|
|
|
51732
51927
|
}
|
|
51733
51928
|
process.exitCode = 1;
|
|
51734
51929
|
};
|
|
51735
|
-
if (pullScope2
|
|
51930
|
+
if (isDatedOfferingPullScope(pullScope2)) {
|
|
51736
51931
|
const hasLocal = await contentDirExists(contentDir);
|
|
51737
51932
|
const label = pullScope2 === "venues" ? "Venues" : pullScope2 === "event-categories" ? "Event Categories" : pullScope2 === "events" ? "Events" : "Courses";
|
|
51738
51933
|
if (pullScope2 === "venues") {
|
|
51739
51934
|
const result = await client.pull.venues();
|
|
51935
|
+
if (reportMissingScopedPullItem({
|
|
51936
|
+
output,
|
|
51937
|
+
scope: pullScope2,
|
|
51938
|
+
identifier: type,
|
|
51939
|
+
found: result.venues.some((venue) => venue.slug === type)
|
|
51940
|
+
})) return;
|
|
51740
51941
|
const local = hasLocal ? await readVenues(contentDir) : [];
|
|
51741
51942
|
await handleDryRunKeyedArrayScope({
|
|
51742
51943
|
scope: "venues",
|
|
51743
51944
|
label,
|
|
51744
|
-
remoteItems: result.venues,
|
|
51745
|
-
localItems: local,
|
|
51945
|
+
remoteItems: filterPullItemsByIdentifier(result.venues, type, (venue) => venue.slug),
|
|
51946
|
+
localItems: filterPullItemsByIdentifier(local, type, (venue) => venue.slug),
|
|
51746
51947
|
getRemoteId: (v) => v.slug,
|
|
51747
51948
|
getLocalId: (v) => v.slug,
|
|
51748
51949
|
remoteToComparable: mapRemoteVenueToLocalComparable,
|
|
@@ -51752,12 +51953,18 @@ Media Sync:
|
|
|
51752
51953
|
}
|
|
51753
51954
|
if (pullScope2 === "event-categories") {
|
|
51754
51955
|
const result = await client.pull.eventCategories();
|
|
51956
|
+
if (reportMissingScopedPullItem({
|
|
51957
|
+
output,
|
|
51958
|
+
scope: pullScope2,
|
|
51959
|
+
identifier: type,
|
|
51960
|
+
found: result.eventCategories.some((category) => category.identifier === type)
|
|
51961
|
+
})) return;
|
|
51755
51962
|
const local = hasLocal ? await readEventCategories(contentDir) : [];
|
|
51756
51963
|
await handleDryRunKeyedArrayScope({
|
|
51757
51964
|
scope: "event-categories",
|
|
51758
51965
|
label,
|
|
51759
|
-
remoteItems: result.eventCategories,
|
|
51760
|
-
localItems: local,
|
|
51966
|
+
remoteItems: filterPullItemsByIdentifier(result.eventCategories, type, (category) => category.identifier),
|
|
51967
|
+
localItems: filterPullItemsByIdentifier(local, type, (category) => category.identifier),
|
|
51761
51968
|
getRemoteId: (c) => c.identifier,
|
|
51762
51969
|
getLocalId: (c) => c.identifier,
|
|
51763
51970
|
remoteToComparable: mapRemoteEventCategoryToLocalComparable,
|
|
@@ -51767,12 +51974,18 @@ Media Sync:
|
|
|
51767
51974
|
}
|
|
51768
51975
|
if (pullScope2 === "courses") {
|
|
51769
51976
|
const result = await client.pull.courses();
|
|
51977
|
+
if (reportMissingScopedPullItem({
|
|
51978
|
+
output,
|
|
51979
|
+
scope: pullScope2,
|
|
51980
|
+
identifier: type,
|
|
51981
|
+
found: result.courses.some((course) => course.identifier === type)
|
|
51982
|
+
})) return;
|
|
51770
51983
|
const local = hasLocal ? await readCourses(contentDir) : [];
|
|
51771
51984
|
await handleDryRunKeyedArrayScope({
|
|
51772
51985
|
scope: "courses",
|
|
51773
51986
|
label,
|
|
51774
|
-
remoteItems: result.courses,
|
|
51775
|
-
localItems: local,
|
|
51987
|
+
remoteItems: filterPullItemsByIdentifier(result.courses, type, (course) => course.identifier),
|
|
51988
|
+
localItems: filterPullItemsByIdentifier(local, type, (course) => course.identifier),
|
|
51776
51989
|
getRemoteId: (course) => course.identifier,
|
|
51777
51990
|
getLocalId: (course) => course.identifier,
|
|
51778
51991
|
remoteToComparable: mapRemoteCourseToLocalComparable,
|
|
@@ -51782,12 +51995,18 @@ Media Sync:
|
|
|
51782
51995
|
}
|
|
51783
51996
|
{
|
|
51784
51997
|
const result = await client.pull.events();
|
|
51998
|
+
if (reportMissingScopedPullItem({
|
|
51999
|
+
output,
|
|
52000
|
+
scope: pullScope2,
|
|
52001
|
+
identifier: type,
|
|
52002
|
+
found: result.events.some((event) => event.identifier === type)
|
|
52003
|
+
})) return;
|
|
51785
52004
|
const local = hasLocal ? await readEvents(contentDir) : [];
|
|
51786
52005
|
await handleDryRunKeyedArrayScope({
|
|
51787
52006
|
scope: "events",
|
|
51788
52007
|
label,
|
|
51789
|
-
remoteItems: result.events,
|
|
51790
|
-
localItems: local,
|
|
52008
|
+
remoteItems: filterPullItemsByIdentifier(result.events, type, (event) => event.identifier),
|
|
52009
|
+
localItems: filterPullItemsByIdentifier(local, type, (event) => event.identifier),
|
|
51791
52010
|
getRemoteId: (e) => e.identifier,
|
|
51792
52011
|
getLocalId: (e) => e.identifier,
|
|
51793
52012
|
remoteToComparable: mapRemoteEventToLocalComparable,
|
|
@@ -51956,7 +52175,7 @@ Media Sync:
|
|
|
51956
52175
|
const dirExists = await contentDirExists(contentDir);
|
|
51957
52176
|
if (identifier && pullScope !== "entries") {
|
|
51958
52177
|
output.error("An item identifier is only supported for entries pulls", {
|
|
51959
|
-
suggestion: 'Use "riverbankcms pull pages <page-identifier>"
|
|
52178
|
+
suggestion: 'Use "riverbankcms pull events <event-identifier>" or "riverbankcms pull pages <page-identifier>" with the identifier as the second argument.'
|
|
51960
52179
|
});
|
|
51961
52180
|
return;
|
|
51962
52181
|
}
|
|
@@ -52186,8 +52405,15 @@ Media Sync:
|
|
|
52186
52405
|
break;
|
|
52187
52406
|
}
|
|
52188
52407
|
case "venues": {
|
|
52189
|
-
output.info(
|
|
52408
|
+
output.info(`Pulling venues${type ? ` ${type}` : ""}`);
|
|
52190
52409
|
const result = await client.pull.venues();
|
|
52410
|
+
if (reportMissingScopedPullItem({
|
|
52411
|
+
output,
|
|
52412
|
+
scope: "venues",
|
|
52413
|
+
identifier: type,
|
|
52414
|
+
found: result.venues.some((venue) => venue.slug === type)
|
|
52415
|
+
})) return;
|
|
52416
|
+
result.venues = filterPullItemsByIdentifier(result.venues, type, (venue) => venue.slug);
|
|
52191
52417
|
const mediaContent = createScopedPullContent(result.meta, { venues: result.venues });
|
|
52192
52418
|
await applyMediaIdentifiers(mediaContent);
|
|
52193
52419
|
await syncMediaIfRequested(mediaContent);
|
|
@@ -52196,8 +52422,15 @@ Media Sync:
|
|
|
52196
52422
|
break;
|
|
52197
52423
|
}
|
|
52198
52424
|
case "event-categories": {
|
|
52199
|
-
output.info(
|
|
52425
|
+
output.info(`Pulling event categories${type ? ` ${type}` : ""}`);
|
|
52200
52426
|
const result = await client.pull.eventCategories();
|
|
52427
|
+
if (reportMissingScopedPullItem({
|
|
52428
|
+
output,
|
|
52429
|
+
scope: "event-categories",
|
|
52430
|
+
identifier: type,
|
|
52431
|
+
found: result.eventCategories.some((category) => category.identifier === type)
|
|
52432
|
+
})) return;
|
|
52433
|
+
result.eventCategories = filterPullItemsByIdentifier(result.eventCategories, type, (category) => category.identifier);
|
|
52201
52434
|
const mediaContent = createScopedPullContent(result.meta, { eventCategories: result.eventCategories });
|
|
52202
52435
|
await applyMediaIdentifiers(mediaContent);
|
|
52203
52436
|
await syncMediaIfRequested(mediaContent);
|
|
@@ -52206,8 +52439,15 @@ Media Sync:
|
|
|
52206
52439
|
break;
|
|
52207
52440
|
}
|
|
52208
52441
|
case "events": {
|
|
52209
|
-
output.info(
|
|
52442
|
+
output.info(`Pulling events${type ? ` ${type}` : ""}`);
|
|
52210
52443
|
const result = await client.pull.events();
|
|
52444
|
+
if (reportMissingScopedPullItem({
|
|
52445
|
+
output,
|
|
52446
|
+
scope: "events",
|
|
52447
|
+
identifier: type,
|
|
52448
|
+
found: result.events.some((event) => event.identifier === type)
|
|
52449
|
+
})) return;
|
|
52450
|
+
result.events = filterPullItemsByIdentifier(result.events, type, (event) => event.identifier);
|
|
52211
52451
|
const mediaContent = createScopedPullContent(result.meta, { events: result.events });
|
|
52212
52452
|
await applyMediaIdentifiers(mediaContent);
|
|
52213
52453
|
await syncMediaIfRequested(mediaContent);
|
|
@@ -52217,8 +52457,15 @@ Media Sync:
|
|
|
52217
52457
|
break;
|
|
52218
52458
|
}
|
|
52219
52459
|
case "courses": {
|
|
52220
|
-
output.info(
|
|
52460
|
+
output.info(`Pulling courses${type ? ` ${type}` : ""}`);
|
|
52221
52461
|
const result = await client.pull.courses();
|
|
52462
|
+
if (reportMissingScopedPullItem({
|
|
52463
|
+
output,
|
|
52464
|
+
scope: "courses",
|
|
52465
|
+
identifier: type,
|
|
52466
|
+
found: result.courses.some((course) => course.identifier === type)
|
|
52467
|
+
})) return;
|
|
52468
|
+
result.courses = filterPullItemsByIdentifier(result.courses, type, (course) => course.identifier);
|
|
52222
52469
|
const mediaContent = createScopedPullContent(result.meta, { courses: result.courses });
|
|
52223
52470
|
await applyMediaIdentifiers(mediaContent);
|
|
52224
52471
|
await syncMediaIfRequested(mediaContent);
|
|
@@ -52612,10 +52859,10 @@ function normalizeLocalContentShape(content) {
|
|
|
52612
52859
|
var identifierRegex = /^[a-z0-9][a-z0-9-]*$/;
|
|
52613
52860
|
var currencyRegex = /^[A-Z]{3}$/;
|
|
52614
52861
|
var isoDateTimeRegex = /^\d{4}-\d{2}-\d{2}T.+/;
|
|
52615
|
-
function issue2(
|
|
52616
|
-
return { path:
|
|
52862
|
+
function issue2(path28, message) {
|
|
52863
|
+
return { path: path28, message };
|
|
52617
52864
|
}
|
|
52618
|
-
function
|
|
52865
|
+
function isRecord16(value) {
|
|
52619
52866
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
52620
52867
|
}
|
|
52621
52868
|
function isCurrency(value) {
|
|
@@ -52630,27 +52877,27 @@ function isWholeMinuteIsoDateTime(value) {
|
|
|
52630
52877
|
return Number.isFinite(epochMs) && epochMs % 6e4 === 0;
|
|
52631
52878
|
}
|
|
52632
52879
|
function validateTicketType(raw, index, currency) {
|
|
52633
|
-
const
|
|
52634
|
-
if (!
|
|
52880
|
+
const path28 = ["ticketTypes", String(index)];
|
|
52881
|
+
if (!isRecord16(raw)) return [issue2(path28, "Ticket type must be an object")];
|
|
52635
52882
|
const issues = [];
|
|
52636
52883
|
const identifier = raw.identifier;
|
|
52637
52884
|
if (typeof identifier !== "string" || !identifierRegex.test(identifier)) {
|
|
52638
52885
|
issues.push(
|
|
52639
52886
|
issue2(
|
|
52640
|
-
[...
|
|
52887
|
+
[...path28, "identifier"],
|
|
52641
52888
|
"Ticket identifier must use lowercase letters, numbers, and hyphens"
|
|
52642
52889
|
)
|
|
52643
52890
|
);
|
|
52644
52891
|
}
|
|
52645
52892
|
const name = raw.name;
|
|
52646
52893
|
if (typeof name !== "string" || name.trim().length === 0) {
|
|
52647
|
-
issues.push(issue2([...
|
|
52894
|
+
issues.push(issue2([...path28, "name"], "Ticket name is required"));
|
|
52648
52895
|
}
|
|
52649
52896
|
const priceAmount = raw.priceAmount;
|
|
52650
52897
|
if (!isWholeNumber(priceAmount) || priceAmount < 0) {
|
|
52651
52898
|
issues.push(
|
|
52652
52899
|
issue2(
|
|
52653
|
-
[...
|
|
52900
|
+
[...path28, "priceAmount"],
|
|
52654
52901
|
"Ticket priceAmount must be a non-negative integer"
|
|
52655
52902
|
)
|
|
52656
52903
|
);
|
|
@@ -52659,7 +52906,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52659
52906
|
if (priceCurrency !== void 0 && priceCurrency !== null && priceCurrency !== currency) {
|
|
52660
52907
|
issues.push(
|
|
52661
52908
|
issue2(
|
|
52662
|
-
[...
|
|
52909
|
+
[...path28, "priceCurrency"],
|
|
52663
52910
|
"Ticket priceCurrency must match pricing.priceCurrency"
|
|
52664
52911
|
)
|
|
52665
52912
|
);
|
|
@@ -52668,7 +52915,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52668
52915
|
if (sortOrder !== void 0 && (!isWholeNumber(sortOrder) || sortOrder < 0)) {
|
|
52669
52916
|
issues.push(
|
|
52670
52917
|
issue2(
|
|
52671
|
-
[...
|
|
52918
|
+
[...path28, "sortOrder"],
|
|
52672
52919
|
"Ticket sortOrder must be a non-negative integer"
|
|
52673
52920
|
)
|
|
52674
52921
|
);
|
|
@@ -52677,7 +52924,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52677
52924
|
if (capacityLimit2 !== void 0 && capacityLimit2 !== null && (!isWholeNumber(capacityLimit2) || capacityLimit2 < 1)) {
|
|
52678
52925
|
issues.push(
|
|
52679
52926
|
issue2(
|
|
52680
|
-
[...
|
|
52927
|
+
[...path28, "capacityLimit"],
|
|
52681
52928
|
"Ticket capacityLimit must be a positive integer"
|
|
52682
52929
|
)
|
|
52683
52930
|
);
|
|
@@ -52686,7 +52933,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52686
52933
|
if (attendanceScope !== void 0 && attendanceScope !== "in_person" && attendanceScope !== "online" && attendanceScope !== "both") {
|
|
52687
52934
|
issues.push(
|
|
52688
52935
|
issue2(
|
|
52689
|
-
[...
|
|
52936
|
+
[...path28, "attendanceScope"],
|
|
52690
52937
|
"Ticket attendanceScope must be in_person, online, or both"
|
|
52691
52938
|
)
|
|
52692
52939
|
);
|
|
@@ -52695,7 +52942,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52695
52942
|
if (saleStartsAt !== void 0 && saleStartsAt !== null && (typeof saleStartsAt !== "string" || !isWholeMinuteIsoDateTime(saleStartsAt))) {
|
|
52696
52943
|
issues.push(
|
|
52697
52944
|
issue2(
|
|
52698
|
-
[...
|
|
52945
|
+
[...path28, "saleStartsAt"],
|
|
52699
52946
|
"Ticket saleStartsAt must be an ISO datetime aligned to a whole minute"
|
|
52700
52947
|
)
|
|
52701
52948
|
);
|
|
@@ -52704,7 +52951,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52704
52951
|
if (saleEndsAt !== void 0 && saleEndsAt !== null && (typeof saleEndsAt !== "string" || !isWholeMinuteIsoDateTime(saleEndsAt))) {
|
|
52705
52952
|
issues.push(
|
|
52706
52953
|
issue2(
|
|
52707
|
-
[...
|
|
52954
|
+
[...path28, "saleEndsAt"],
|
|
52708
52955
|
"Ticket saleEndsAt must be an ISO datetime aligned to a whole minute"
|
|
52709
52956
|
)
|
|
52710
52957
|
);
|
|
@@ -52712,7 +52959,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52712
52959
|
if (typeof saleStartsAt === "string" && typeof saleEndsAt === "string" && Date.parse(saleEndsAt) <= Date.parse(saleStartsAt)) {
|
|
52713
52960
|
issues.push(
|
|
52714
52961
|
issue2(
|
|
52715
|
-
[...
|
|
52962
|
+
[...path28, "saleEndsAt"],
|
|
52716
52963
|
"Ticket saleEndsAt must be after saleStartsAt"
|
|
52717
52964
|
)
|
|
52718
52965
|
);
|
|
@@ -52721,7 +52968,7 @@ function validateTicketType(raw, index, currency) {
|
|
|
52721
52968
|
if (cmsTicketTypeId !== void 0 && cmsTicketTypeId !== null && (typeof cmsTicketTypeId !== "string" || cmsTicketTypeId.length === 0)) {
|
|
52722
52969
|
issues.push(
|
|
52723
52970
|
issue2(
|
|
52724
|
-
[...
|
|
52971
|
+
[...path28, "cmsTicketTypeId"],
|
|
52725
52972
|
"Ticket cmsTicketTypeId must be a non-empty string"
|
|
52726
52973
|
)
|
|
52727
52974
|
);
|
|
@@ -52754,7 +53001,7 @@ function validateTicketTypes(rawTicketTypes, currency) {
|
|
|
52754
53001
|
const ticketTypes = [];
|
|
52755
53002
|
const seenIdentifiers = /* @__PURE__ */ new Set();
|
|
52756
53003
|
rawTicketTypes.forEach((rawTicketType, index) => {
|
|
52757
|
-
const rawIdentifier =
|
|
53004
|
+
const rawIdentifier = isRecord16(rawTicketType) ? rawTicketType.identifier : void 0;
|
|
52758
53005
|
const hasValidIdentifier = typeof rawIdentifier === "string" && identifierRegex.test(rawIdentifier);
|
|
52759
53006
|
const isDuplicateIdentifier = hasValidIdentifier && seenIdentifiers.has(rawIdentifier);
|
|
52760
53007
|
if (isDuplicateIdentifier) {
|
|
@@ -52798,7 +53045,7 @@ function classifySdkEventPricing(rawInput) {
|
|
|
52798
53045
|
if (rawInput === void 0 || rawInput === null) {
|
|
52799
53046
|
return { ok: true, pricing: { kind: "free" } };
|
|
52800
53047
|
}
|
|
52801
|
-
if (!
|
|
53048
|
+
if (!isRecord16(rawInput)) {
|
|
52802
53049
|
return { ok: false, issues: [issue2([], "Pricing must be an object")] };
|
|
52803
53050
|
}
|
|
52804
53051
|
const record = rawInput;
|
|
@@ -52905,10 +53152,10 @@ var supportedKinds = /* @__PURE__ */ new Set([
|
|
|
52905
53152
|
"deferred_manual",
|
|
52906
53153
|
"flexible_balance"
|
|
52907
53154
|
]);
|
|
52908
|
-
function issue3(
|
|
52909
|
-
return { path:
|
|
53155
|
+
function issue3(path28, message) {
|
|
53156
|
+
return { path: path28, message };
|
|
52910
53157
|
}
|
|
52911
|
-
function
|
|
53158
|
+
function isRecord17(value) {
|
|
52912
53159
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
52913
53160
|
}
|
|
52914
53161
|
function isWholeNumber2(value) {
|
|
@@ -52923,15 +53170,15 @@ function isDepositRefundability(value) {
|
|
|
52923
53170
|
function isSupportedOptionKind(value) {
|
|
52924
53171
|
return typeof value === "string" && supportedKinds.has(value);
|
|
52925
53172
|
}
|
|
52926
|
-
function validateFlexibleBalanceDueDateRule(raw,
|
|
52927
|
-
if (!
|
|
52928
|
-
return [issue3(
|
|
53173
|
+
function validateFlexibleBalanceDueDateRule(raw, path28) {
|
|
53174
|
+
if (!isRecord17(raw)) {
|
|
53175
|
+
return [issue3(path28, "Flexible balance dueDateRule must be an object")];
|
|
52929
53176
|
}
|
|
52930
53177
|
if (raw.kind === "relative_to_start_date") {
|
|
52931
53178
|
if (!isPositiveWholeNumber(raw.daysBeforeStart)) {
|
|
52932
53179
|
return [
|
|
52933
53180
|
issue3(
|
|
52934
|
-
[...
|
|
53181
|
+
[...path28, "daysBeforeStart"],
|
|
52935
53182
|
"Flexible balance daysBeforeStart must be a positive integer"
|
|
52936
53183
|
)
|
|
52937
53184
|
];
|
|
@@ -52945,7 +53192,7 @@ function validateFlexibleBalanceDueDateRule(raw, path27) {
|
|
|
52945
53192
|
if (typeof raw.dueAt !== "string" || !Number.isFinite(Date.parse(raw.dueAt))) {
|
|
52946
53193
|
return [
|
|
52947
53194
|
issue3(
|
|
52948
|
-
[...
|
|
53195
|
+
[...path28, "dueAt"],
|
|
52949
53196
|
"Flexible balance fixed dueAt must be an ISO datetime"
|
|
52950
53197
|
)
|
|
52951
53198
|
];
|
|
@@ -52957,14 +53204,14 @@ function validateFlexibleBalanceDueDateRule(raw, path27) {
|
|
|
52957
53204
|
}
|
|
52958
53205
|
return [
|
|
52959
53206
|
issue3(
|
|
52960
|
-
[...
|
|
53207
|
+
[...path28, "kind"],
|
|
52961
53208
|
"Flexible balance dueDateRule kind must be relative_to_start_date or fixed_calendar_date"
|
|
52962
53209
|
)
|
|
52963
53210
|
];
|
|
52964
53211
|
}
|
|
52965
|
-
function validateFlexibleBalanceConfig(raw,
|
|
52966
|
-
if (!
|
|
52967
|
-
return [issue3(
|
|
53212
|
+
function validateFlexibleBalanceConfig(raw, path28) {
|
|
53213
|
+
if (!isRecord17(raw)) {
|
|
53214
|
+
return [issue3(path28, "Flexible balance config must be an object")];
|
|
52968
53215
|
}
|
|
52969
53216
|
const issues = [];
|
|
52970
53217
|
const upfrontAmountCents = raw.upfrontAmountCents;
|
|
@@ -52974,7 +53221,7 @@ function validateFlexibleBalanceConfig(raw, path27) {
|
|
|
52974
53221
|
if (!isWholeNumber2(upfrontAmountCents) || upfrontAmountCents < 0) {
|
|
52975
53222
|
issues.push(
|
|
52976
53223
|
issue3(
|
|
52977
|
-
[...
|
|
53224
|
+
[...path28, "upfrontAmountCents"],
|
|
52978
53225
|
"Flexible balance upfrontAmountCents must be a non-negative integer"
|
|
52979
53226
|
)
|
|
52980
53227
|
);
|
|
@@ -52984,7 +53231,7 @@ function validateFlexibleBalanceConfig(raw, path27) {
|
|
|
52984
53231
|
if (!isDepositRefundability(depositRefundability)) {
|
|
52985
53232
|
issues.push(
|
|
52986
53233
|
issue3(
|
|
52987
|
-
[...
|
|
53234
|
+
[...path28, "depositRefundability"],
|
|
52988
53235
|
"Flexible balance depositRefundability must be refundable or non_refundable"
|
|
52989
53236
|
)
|
|
52990
53237
|
);
|
|
@@ -52993,7 +53240,7 @@ function validateFlexibleBalanceConfig(raw, path27) {
|
|
|
52993
53240
|
}
|
|
52994
53241
|
const dueDateRule = validateFlexibleBalanceDueDateRule(
|
|
52995
53242
|
raw.dueDateRule,
|
|
52996
|
-
[...
|
|
53243
|
+
[...path28, "dueDateRule"]
|
|
52997
53244
|
);
|
|
52998
53245
|
if (Array.isArray(dueDateRule)) {
|
|
52999
53246
|
issues.push(...dueDateRule);
|
|
@@ -53008,14 +53255,14 @@ function validateFlexibleBalanceConfig(raw, path27) {
|
|
|
53008
53255
|
};
|
|
53009
53256
|
}
|
|
53010
53257
|
function validateCollectionOption(raw, index) {
|
|
53011
|
-
const
|
|
53012
|
-
if (!
|
|
53013
|
-
return [issue3(
|
|
53258
|
+
const path28 = ["allowedOptions", String(index)];
|
|
53259
|
+
if (!isRecord17(raw)) {
|
|
53260
|
+
return [issue3(path28, "Payment option must be an object")];
|
|
53014
53261
|
}
|
|
53015
53262
|
if (raw.kind === "instalment_plan") {
|
|
53016
53263
|
return [
|
|
53017
53264
|
issue3(
|
|
53018
|
-
[...
|
|
53265
|
+
[...path28, "kind"],
|
|
53019
53266
|
"Event instalment plans are not supported yet. Use upfront, deferred_manual, or flexible_balance."
|
|
53020
53267
|
)
|
|
53021
53268
|
];
|
|
@@ -53023,7 +53270,7 @@ function validateCollectionOption(raw, index) {
|
|
|
53023
53270
|
if (!isSupportedOptionKind(raw.kind)) {
|
|
53024
53271
|
return [
|
|
53025
53272
|
issue3(
|
|
53026
|
-
[...
|
|
53273
|
+
[...path28, "kind"],
|
|
53027
53274
|
"Payment option kind must be upfront, deferred_manual, or flexible_balance"
|
|
53028
53275
|
)
|
|
53029
53276
|
];
|
|
@@ -53034,7 +53281,7 @@ function validateCollectionOption(raw, index) {
|
|
|
53034
53281
|
return { kind: raw.kind };
|
|
53035
53282
|
case "flexible_balance": {
|
|
53036
53283
|
const config2 = validateFlexibleBalanceConfig(raw.config, [
|
|
53037
|
-
...
|
|
53284
|
+
...path28,
|
|
53038
53285
|
"config"
|
|
53039
53286
|
]);
|
|
53040
53287
|
if (Array.isArray(config2)) {
|
|
@@ -53080,7 +53327,7 @@ function classifySdkEventPaymentTerms(rawInput) {
|
|
|
53080
53327
|
if (rawInput === void 0 || rawInput === null) {
|
|
53081
53328
|
return { ok: true, paymentTerms: void 0 };
|
|
53082
53329
|
}
|
|
53083
|
-
if (!
|
|
53330
|
+
if (!isRecord17(rawInput)) {
|
|
53084
53331
|
return {
|
|
53085
53332
|
ok: false,
|
|
53086
53333
|
issues: [issue3([], "Event paymentTerms must be an object")]
|
|
@@ -53131,7 +53378,7 @@ function classifySdkEventPaymentTerms(rawInput) {
|
|
|
53131
53378
|
function nullishToNull(value) {
|
|
53132
53379
|
return value == null ? null : value;
|
|
53133
53380
|
}
|
|
53134
|
-
function
|
|
53381
|
+
function isRecord18(value) {
|
|
53135
53382
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53136
53383
|
}
|
|
53137
53384
|
function stringValue(value, fallback) {
|
|
@@ -53152,7 +53399,7 @@ function normalizeEventPaymentTermsForCompare(paymentTerms) {
|
|
|
53152
53399
|
return void 0;
|
|
53153
53400
|
}
|
|
53154
53401
|
function normalizeVenueAddress(value) {
|
|
53155
|
-
const obj =
|
|
53402
|
+
const obj = isRecord18(value) ? value : {};
|
|
53156
53403
|
return {
|
|
53157
53404
|
line1: nullishToNull(typeof obj.line1 === "string" ? obj.line1 : void 0),
|
|
53158
53405
|
line2: nullishToNull(typeof obj.line2 === "string" ? obj.line2 : void 0),
|
|
@@ -53169,7 +53416,7 @@ function normalizeVenueAddress(value) {
|
|
|
53169
53416
|
};
|
|
53170
53417
|
}
|
|
53171
53418
|
function normalizeVenueLocation(value) {
|
|
53172
|
-
if (!
|
|
53419
|
+
if (!isRecord18(value)) return null;
|
|
53173
53420
|
const obj = value;
|
|
53174
53421
|
const lat = typeof obj.lat === "number" ? obj.lat : null;
|
|
53175
53422
|
const lng = typeof obj.lng === "number" ? obj.lng : null;
|
|
@@ -53177,7 +53424,7 @@ function normalizeVenueLocation(value) {
|
|
|
53177
53424
|
return { lat, lng };
|
|
53178
53425
|
}
|
|
53179
53426
|
function normalizeVenueForCompare(venue) {
|
|
53180
|
-
const obj =
|
|
53427
|
+
const obj = isRecord18(venue) ? venue : {};
|
|
53181
53428
|
return {
|
|
53182
53429
|
slug: String(obj.slug),
|
|
53183
53430
|
title: String(obj.title),
|
|
@@ -53198,7 +53445,7 @@ function normalizeVenueForCompare(venue) {
|
|
|
53198
53445
|
};
|
|
53199
53446
|
}
|
|
53200
53447
|
function normalizeEventCategoryForCompare(category) {
|
|
53201
|
-
const obj =
|
|
53448
|
+
const obj = isRecord18(category) ? category : {};
|
|
53202
53449
|
return {
|
|
53203
53450
|
identifier: String(obj.identifier),
|
|
53204
53451
|
name: String(obj.name),
|
|
@@ -53210,8 +53457,8 @@ function normalizeEventCategoryForCompare(category) {
|
|
|
53210
53457
|
};
|
|
53211
53458
|
}
|
|
53212
53459
|
function normalizeRemoteEventForCompare(event) {
|
|
53213
|
-
const obj =
|
|
53214
|
-
const schedule =
|
|
53460
|
+
const obj = isRecord18(event) ? event : {};
|
|
53461
|
+
const schedule = isRecord18(obj.schedule) ? obj.schedule : {};
|
|
53215
53462
|
return {
|
|
53216
53463
|
identifier: String(obj.identifier),
|
|
53217
53464
|
title: String(obj.title),
|
|
@@ -53240,14 +53487,14 @@ function normalizeRemoteEventForCompare(event) {
|
|
|
53240
53487
|
formRef: nullishToNull(
|
|
53241
53488
|
typeof obj.formRef === "string" ? obj.formRef : void 0
|
|
53242
53489
|
),
|
|
53243
|
-
content:
|
|
53244
|
-
settings:
|
|
53245
|
-
presentation:
|
|
53490
|
+
content: isRecord18(obj.content) ? obj.content : {},
|
|
53491
|
+
settings: isRecord18(obj.settings) ? obj.settings : {},
|
|
53492
|
+
presentation: isRecord18(obj.presentation) ? obj.presentation : null,
|
|
53246
53493
|
tags: Array.isArray(obj.tags) ? obj.tags : []
|
|
53247
53494
|
};
|
|
53248
53495
|
}
|
|
53249
53496
|
function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
53250
|
-
const local =
|
|
53497
|
+
const local = isRecord18(localEvent) ? localEvent : {};
|
|
53251
53498
|
const base = remoteEvent ? normalizeRemoteEventForCompare(remoteEvent) : normalizeRemoteEventForCompare({
|
|
53252
53499
|
identifier: local.identifier,
|
|
53253
53500
|
title: local.title,
|
|
@@ -53266,7 +53513,7 @@ function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
|
53266
53513
|
presentation: local.presentation ?? null,
|
|
53267
53514
|
tags: local.tags ?? []
|
|
53268
53515
|
});
|
|
53269
|
-
const schedule =
|
|
53516
|
+
const schedule = isRecord18(local.schedule) ? local.schedule : {};
|
|
53270
53517
|
return {
|
|
53271
53518
|
...base,
|
|
53272
53519
|
identifier: stringValue(local.identifier, base.identifier),
|
|
@@ -53297,9 +53544,9 @@ function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
|
53297
53544
|
formRef: local.formRef === void 0 ? base.formRef : nullishToNull(
|
|
53298
53545
|
typeof local.formRef === "string" ? local.formRef : void 0
|
|
53299
53546
|
),
|
|
53300
|
-
content: local.content === void 0 ? base.content :
|
|
53301
|
-
settings: local.settings === void 0 ? base.settings :
|
|
53302
|
-
presentation: local.presentation === void 0 ? base.presentation :
|
|
53547
|
+
content: local.content === void 0 ? base.content : isRecord18(local.content) ? local.content : {},
|
|
53548
|
+
settings: local.settings === void 0 ? base.settings : isRecord18(local.settings) ? local.settings : {},
|
|
53549
|
+
presentation: local.presentation === void 0 ? base.presentation : isRecord18(local.presentation) ? local.presentation : null,
|
|
53303
53550
|
tags: local.tags === void 0 ? base.tags : Array.isArray(local.tags) ? local.tags : []
|
|
53304
53551
|
};
|
|
53305
53552
|
}
|
|
@@ -53311,7 +53558,7 @@ function toIsoStringOrOriginal(value) {
|
|
|
53311
53558
|
function normalizeCourseSessions(value) {
|
|
53312
53559
|
if (!Array.isArray(value)) return [];
|
|
53313
53560
|
return value.map((session) => {
|
|
53314
|
-
const obj =
|
|
53561
|
+
const obj = isRecord18(session) ? session : {};
|
|
53315
53562
|
return {
|
|
53316
53563
|
startsAt: toIsoStringOrOriginal(obj.startsAt),
|
|
53317
53564
|
endsAt: toIsoStringOrOriginal(obj.endsAt)
|
|
@@ -53323,18 +53570,18 @@ function normalizeCourseSessions(value) {
|
|
|
53323
53570
|
}
|
|
53324
53571
|
function normalizeCourseProgram(value) {
|
|
53325
53572
|
if (value == null) return null;
|
|
53326
|
-
if (!
|
|
53573
|
+
if (!isRecord18(value)) {
|
|
53327
53574
|
return { identifier: null, data: {} };
|
|
53328
53575
|
}
|
|
53329
53576
|
return {
|
|
53330
53577
|
identifier: nullishToNull(
|
|
53331
53578
|
typeof value.identifier === "string" ? value.identifier : void 0
|
|
53332
53579
|
),
|
|
53333
|
-
data:
|
|
53580
|
+
data: isRecord18(value.data) ? value.data : {}
|
|
53334
53581
|
};
|
|
53335
53582
|
}
|
|
53336
53583
|
function normalizeRemoteCourseForCompare(course) {
|
|
53337
|
-
const obj =
|
|
53584
|
+
const obj = isRecord18(course) ? course : {};
|
|
53338
53585
|
return {
|
|
53339
53586
|
identifier: String(obj.identifier),
|
|
53340
53587
|
title: String(obj.title),
|
|
@@ -53369,7 +53616,7 @@ function normalizeRemoteCourseForCompare(course) {
|
|
|
53369
53616
|
};
|
|
53370
53617
|
}
|
|
53371
53618
|
function normalizeLocalCourseAgainstRemoteForCompare(localCourse, remoteCourse) {
|
|
53372
|
-
const local =
|
|
53619
|
+
const local = isRecord18(localCourse) ? localCourse : {};
|
|
53373
53620
|
const base = remoteCourse ? normalizeRemoteCourseForCompare(remoteCourse) : normalizeRemoteCourseForCompare({
|
|
53374
53621
|
identifier: local.identifier,
|
|
53375
53622
|
title: local.title,
|
|
@@ -53390,11 +53637,11 @@ function normalizeLocalCourseAgainstRemoteForCompare(localCourse, remoteCourse)
|
|
|
53390
53637
|
});
|
|
53391
53638
|
const status = local.status === void 0 ? base.status : local.status === "active" || local.status === "cancelled" || local.status === "completed" ? local.status : "draft";
|
|
53392
53639
|
const visibility = local.visibility === void 0 ? base.visibility : local.visibility === "public" || local.visibility === "private" || local.visibility === "unlisted" ? local.visibility : "public";
|
|
53393
|
-
const program2 = local.program === void 0 ? base.program : local.program === null ? null :
|
|
53640
|
+
const program2 = local.program === void 0 ? base.program : local.program === null ? null : isRecord18(local.program) ? {
|
|
53394
53641
|
identifier: local.program.identifier === void 0 ? base.program?.identifier ?? null : nullishToNull(
|
|
53395
53642
|
typeof local.program.identifier === "string" ? local.program.identifier : void 0
|
|
53396
53643
|
),
|
|
53397
|
-
data:
|
|
53644
|
+
data: isRecord18(local.program.data) ? local.program.data : base.program?.data ?? {}
|
|
53398
53645
|
} : base.program;
|
|
53399
53646
|
return {
|
|
53400
53647
|
...base,
|
|
@@ -54504,6 +54751,7 @@ var upsertEventSeriesCommandSchema = z.object({
|
|
|
54504
54751
|
ref: eventSeriesRefSchema,
|
|
54505
54752
|
input: z.object({
|
|
54506
54753
|
slug: z.string().min(1),
|
|
54754
|
+
path: z.string().startsWith("/").nullable().optional(),
|
|
54507
54755
|
title: z.string().min(1),
|
|
54508
54756
|
archetype: z.enum(offeringArchetypes),
|
|
54509
54757
|
status: z.enum(["draft", "active", "archived", "cancelled"]).optional(),
|
|
@@ -54528,6 +54776,7 @@ var upsertEventSeriesCommandSchema = z.object({
|
|
|
54528
54776
|
paymentTerms: z.unknown().optional(),
|
|
54529
54777
|
presentation: unknownRecordSchema.nullable().optional(),
|
|
54530
54778
|
tags: z.array(z.string()).readonly().optional(),
|
|
54779
|
+
blocks: entrySlotBlocksSchema.optional(),
|
|
54531
54780
|
staffRefs: z.array(staffRefSchema).readonly().optional()
|
|
54532
54781
|
}).strict()
|
|
54533
54782
|
}).strict();
|
|
@@ -55645,7 +55894,7 @@ function getSiteCommandLifecycleIntent(command) {
|
|
|
55645
55894
|
init_src();
|
|
55646
55895
|
|
|
55647
55896
|
// ../site-commands/src/guards.ts
|
|
55648
|
-
function
|
|
55897
|
+
function isRecord19(value) {
|
|
55649
55898
|
return typeof value === "object" && value !== null;
|
|
55650
55899
|
}
|
|
55651
55900
|
|
|
@@ -55905,13 +56154,13 @@ function collectOfferingRequires(input, intervals, intervalPath) {
|
|
|
55905
56154
|
function optionalRef(ref, field) {
|
|
55906
56155
|
return ref ? [{ ref, field }] : [];
|
|
55907
56156
|
}
|
|
55908
|
-
function collectVenueRefsFromIntervals(intervals,
|
|
55909
|
-
return intervals.flatMap((interval, index) => optionalRef(interval.venueRef, `${
|
|
56157
|
+
function collectVenueRefsFromIntervals(intervals, path28) {
|
|
56158
|
+
return intervals.flatMap((interval, index) => optionalRef(interval.venueRef, `${path28}[${index}].venueRef`));
|
|
55910
56159
|
}
|
|
55911
|
-
function collectNavigationRefs(items,
|
|
56160
|
+
function collectNavigationRefs(items, path28) {
|
|
55912
56161
|
return items.flatMap((item, index) => {
|
|
55913
|
-
if (!
|
|
55914
|
-
const itemPath = `${
|
|
56162
|
+
if (!isRecord19(item)) return [];
|
|
56163
|
+
const itemPath = `${path28}[${index}]`;
|
|
55915
56164
|
const refs = [];
|
|
55916
56165
|
if (typeof item.pageRef === "string") {
|
|
55917
56166
|
refs.push({ ref: item.pageRef, field: `${itemPath}.pageRef` });
|
|
@@ -55925,26 +56174,26 @@ function collectNavigationRefs(items, path27) {
|
|
|
55925
56174
|
return refs;
|
|
55926
56175
|
});
|
|
55927
56176
|
}
|
|
55928
|
-
function collectBlockRefs(blocks,
|
|
56177
|
+
function collectBlockRefs(blocks, path28) {
|
|
55929
56178
|
return blocks.flatMap((block, index) => {
|
|
55930
|
-
if (!
|
|
55931
|
-
const blockPath = `${
|
|
56179
|
+
if (!isRecord19(block)) return [];
|
|
56180
|
+
const blockPath = `${path28}[${index}]`;
|
|
55932
56181
|
return [
|
|
55933
56182
|
...collectNestedRefs(block.props, `${blockPath}.props`),
|
|
55934
56183
|
...collectNestedRefs(block.children, `${blockPath}.children`)
|
|
55935
56184
|
];
|
|
55936
56185
|
});
|
|
55937
56186
|
}
|
|
55938
|
-
function collectNestedRefs(value,
|
|
56187
|
+
function collectNestedRefs(value, path28) {
|
|
55939
56188
|
if (typeof value === "string") {
|
|
55940
56189
|
const parsed = parseResourceRef(value);
|
|
55941
|
-
return parsed.ok ? [{ ref: value, field:
|
|
56190
|
+
return parsed.ok ? [{ ref: value, field: path28 }] : [];
|
|
55942
56191
|
}
|
|
55943
56192
|
if (Array.isArray(value)) {
|
|
55944
|
-
return value.flatMap((item, index) => collectNestedRefs(item, `${
|
|
56193
|
+
return value.flatMap((item, index) => collectNestedRefs(item, `${path28}[${index}]`));
|
|
55945
56194
|
}
|
|
55946
|
-
if (!
|
|
55947
|
-
return Object.entries(value).flatMap(([key, child]) => collectNestedRefs(child, `${
|
|
56195
|
+
if (!isRecord19(value)) return [];
|
|
56196
|
+
return Object.entries(value).flatMap(([key, child]) => collectNestedRefs(child, `${path28}.${key}`));
|
|
55948
56197
|
}
|
|
55949
56198
|
|
|
55950
56199
|
// ../site-commands/src/staticExecutionGaps.ts
|
|
@@ -56199,9 +56448,9 @@ function deriveIdempotencyKey(input) {
|
|
|
56199
56448
|
].join("|"));
|
|
56200
56449
|
}
|
|
56201
56450
|
function findUnknownCommandTypes(input) {
|
|
56202
|
-
if (!
|
|
56451
|
+
if (!isRecord19(input) || !Array.isArray(input.commands)) return [];
|
|
56203
56452
|
return input.commands.flatMap((command, commandIndex) => {
|
|
56204
|
-
if (!
|
|
56453
|
+
if (!isRecord19(command) || typeof command.type !== "string") return [];
|
|
56205
56454
|
if (commandTypeSet.has(command.type)) return [];
|
|
56206
56455
|
return [{
|
|
56207
56456
|
code: "unknown_command_type",
|
|
@@ -56223,20 +56472,20 @@ function invalidPayloadError(input, issue5) {
|
|
|
56223
56472
|
message: `${field}: ${issue5.message}`
|
|
56224
56473
|
};
|
|
56225
56474
|
}
|
|
56226
|
-
function commandIndexForIssuePath(
|
|
56227
|
-
return
|
|
56475
|
+
function commandIndexForIssuePath(path28) {
|
|
56476
|
+
return path28[0] === "commands" && typeof path28[1] === "number" ? path28[1] : -1;
|
|
56228
56477
|
}
|
|
56229
56478
|
function commandTypeForIssue(input, commandIndex) {
|
|
56230
|
-
if (!
|
|
56479
|
+
if (!isRecord19(input) || !isUnknownArray3(input.commands)) return null;
|
|
56231
56480
|
const command = input.commands[commandIndex];
|
|
56232
|
-
return
|
|
56481
|
+
return isRecord19(command) && typeof command.type === "string" ? command.type : null;
|
|
56233
56482
|
}
|
|
56234
56483
|
function isUnknownArray3(value) {
|
|
56235
56484
|
return Array.isArray(value);
|
|
56236
56485
|
}
|
|
56237
|
-
function formatIssuePath(
|
|
56238
|
-
if (
|
|
56239
|
-
return
|
|
56486
|
+
function formatIssuePath(path28) {
|
|
56487
|
+
if (path28.length === 0) return "<root>";
|
|
56488
|
+
return path28.reduce((formatted, segment) => {
|
|
56240
56489
|
if (typeof segment === "number") return `${formatted}[${segment}]`;
|
|
56241
56490
|
if (formatted.length === 0) return String(segment);
|
|
56242
56491
|
return `${formatted}.${String(segment)}`;
|
|
@@ -56905,8 +57154,8 @@ init_src();
|
|
|
56905
57154
|
var timeRegex = /^([01]\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/;
|
|
56906
57155
|
var explicitOffsetDateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})T([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?(\.\d{1,3})?(Z|[+-]([01]\d|2[0-3]):[0-5]\d)$/;
|
|
56907
57156
|
var localDateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})T([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?(\.\d{1,3})?$/;
|
|
56908
|
-
function issue4(
|
|
56909
|
-
return { path:
|
|
57157
|
+
function issue4(path28, message) {
|
|
57158
|
+
return { path: path28, message };
|
|
56910
57159
|
}
|
|
56911
57160
|
function isValidDateParts(year, month, day) {
|
|
56912
57161
|
const date = new Date(Date.UTC(year, month - 1, day));
|
|
@@ -57330,6 +57579,7 @@ function eventSeriesCommand(event) {
|
|
|
57330
57579
|
ref: createEventSeriesRef([event.identifier]),
|
|
57331
57580
|
input: {
|
|
57332
57581
|
slug: event.slug,
|
|
57582
|
+
path: event.path,
|
|
57333
57583
|
title: event.title,
|
|
57334
57584
|
archetype: "custom",
|
|
57335
57585
|
status: event.status === "completed" ? void 0 : event.status,
|
|
@@ -57354,7 +57604,8 @@ function eventSeriesCommand(event) {
|
|
|
57354
57604
|
settings: event.settings,
|
|
57355
57605
|
paymentTerms: event.paymentTerms,
|
|
57356
57606
|
presentation: event.presentation,
|
|
57357
|
-
tags: event.tags
|
|
57607
|
+
tags: event.tags,
|
|
57608
|
+
blocks: event.blocks
|
|
57358
57609
|
}
|
|
57359
57610
|
});
|
|
57360
57611
|
}
|
|
@@ -57518,6 +57769,7 @@ function eventSeriesUpsertInput(command) {
|
|
|
57518
57769
|
identifier: command.input.slug,
|
|
57519
57770
|
title: command.input.title,
|
|
57520
57771
|
slug: command.input.slug,
|
|
57772
|
+
path: command.input.path,
|
|
57521
57773
|
status: command.input.status,
|
|
57522
57774
|
visibility: managementVisibility(command.input.visibility),
|
|
57523
57775
|
schedule: scheduleFromOccurrence(occurrence),
|
|
@@ -57532,15 +57784,16 @@ function eventSeriesUpsertInput(command) {
|
|
|
57532
57784
|
formRef: command.input.formIdentifier ?? (command.input.formRef ? refSlug(command.input.formRef) : null),
|
|
57533
57785
|
settings: command.input.settings,
|
|
57534
57786
|
presentation: command.input.presentation,
|
|
57535
|
-
tags: command.input.tags ? [...command.input.tags] : void 0
|
|
57787
|
+
tags: command.input.tags ? [...command.input.tags] : void 0,
|
|
57788
|
+
blocks: command.input.blocks
|
|
57536
57789
|
};
|
|
57537
57790
|
}
|
|
57538
57791
|
function eventContentInput(content) {
|
|
57539
57792
|
if (!content) return void 0;
|
|
57540
57793
|
return {
|
|
57541
57794
|
...content.summary ? { summary: content.summary } : {},
|
|
57542
|
-
...typeof content.body === "string" ||
|
|
57543
|
-
...typeof content.image === "string" ||
|
|
57795
|
+
...typeof content.body === "string" || isRecord20(content.body) ? { body: content.body } : {},
|
|
57796
|
+
...typeof content.image === "string" || isRecord20(content.image) ? { image: content.image } : {}
|
|
57544
57797
|
};
|
|
57545
57798
|
}
|
|
57546
57799
|
function courseUpsertInput(command) {
|
|
@@ -57721,7 +57974,7 @@ function toUtcIso(date, time) {
|
|
|
57721
57974
|
const normalizedTime = time.length === 5 ? `${time}:00` : time;
|
|
57722
57975
|
return (/* @__PURE__ */ new Date(`${date}T${normalizedTime}Z`)).toISOString();
|
|
57723
57976
|
}
|
|
57724
|
-
function
|
|
57977
|
+
function isRecord20(value) {
|
|
57725
57978
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
57726
57979
|
}
|
|
57727
57980
|
function unsupported(identifier, message) {
|
|
@@ -60407,13 +60660,118 @@ async function pushEventCategoriesScope(ctx, options) {
|
|
|
60407
60660
|
})
|
|
60408
60661
|
});
|
|
60409
60662
|
}
|
|
60410
|
-
|
|
60411
|
-
|
|
60663
|
+
function findDuplicateLocalEventIdentifiers(events) {
|
|
60664
|
+
const filePathsByIdentifier = /* @__PURE__ */ new Map();
|
|
60665
|
+
for (const event of events) {
|
|
60666
|
+
const filePaths = filePathsByIdentifier.get(event.identifier) ?? [];
|
|
60667
|
+
filePaths.push(event.filePath);
|
|
60668
|
+
filePathsByIdentifier.set(event.identifier, filePaths);
|
|
60669
|
+
}
|
|
60670
|
+
return [...filePathsByIdentifier.entries()].filter(([, filePaths]) => filePaths.length > 1).map(([identifier, filePaths]) => ({ identifier, filePaths }));
|
|
60671
|
+
}
|
|
60672
|
+
function formatDuplicateEventFilePath(contentDir, filePath) {
|
|
60673
|
+
return path5.relative(contentDir, filePath) || filePath;
|
|
60674
|
+
}
|
|
60675
|
+
function normalizeLocalPath(value) {
|
|
60676
|
+
const [withoutHash] = value.split("#");
|
|
60677
|
+
const [withoutQuery] = (withoutHash ?? "").split("?");
|
|
60678
|
+
if (!withoutQuery || !withoutQuery.startsWith("/")) return value;
|
|
60679
|
+
return withoutQuery.length > 1 ? withoutQuery.replace(/\/+$/u, "") || "/" : "/";
|
|
60680
|
+
}
|
|
60681
|
+
function localEventPath(event) {
|
|
60682
|
+
return normalizeLocalPath(event.path?.trim() || `/events/${event.slug}`);
|
|
60683
|
+
}
|
|
60684
|
+
function collectNavigationPathReferences(navigation) {
|
|
60685
|
+
if (!navigation) return [];
|
|
60686
|
+
const references = [];
|
|
60687
|
+
const visit = (items, menuName) => {
|
|
60688
|
+
for (const item of items) {
|
|
60689
|
+
const link2 = item.link;
|
|
60690
|
+
if (link2 && typeof link2 === "object" && "href" in link2) {
|
|
60691
|
+
const href = link2.href;
|
|
60692
|
+
if (typeof href === "string" && href.startsWith("/")) {
|
|
60693
|
+
references.push({
|
|
60694
|
+
path: normalizeLocalPath(href),
|
|
60695
|
+
menuName,
|
|
60696
|
+
label: item.label
|
|
60697
|
+
});
|
|
60698
|
+
}
|
|
60699
|
+
}
|
|
60700
|
+
if (item.children?.length) {
|
|
60701
|
+
visit(item.children, menuName);
|
|
60702
|
+
}
|
|
60703
|
+
}
|
|
60704
|
+
};
|
|
60705
|
+
for (const menu of navigation.menus) {
|
|
60706
|
+
visit(menu.items, menu.name);
|
|
60707
|
+
}
|
|
60708
|
+
return references;
|
|
60709
|
+
}
|
|
60710
|
+
function findEventNavigationPathMismatches(events, navigation) {
|
|
60711
|
+
const references = collectNavigationPathReferences(navigation);
|
|
60712
|
+
const mismatches = [];
|
|
60713
|
+
for (const event of events) {
|
|
60714
|
+
const eventPath = localEventPath(event);
|
|
60715
|
+
const slugSuffix = `/${event.slug}`;
|
|
60716
|
+
for (const reference of references) {
|
|
60717
|
+
if (reference.path.endsWith(slugSuffix) && reference.path !== eventPath && !reference.path.startsWith(`${eventPath}/`)) {
|
|
60718
|
+
mismatches.push({
|
|
60719
|
+
eventIdentifier: event.identifier,
|
|
60720
|
+
eventPath,
|
|
60721
|
+
navigationPath: reference.path,
|
|
60722
|
+
menuName: reference.menuName,
|
|
60723
|
+
label: reference.label
|
|
60724
|
+
});
|
|
60725
|
+
}
|
|
60726
|
+
}
|
|
60727
|
+
}
|
|
60728
|
+
return mismatches;
|
|
60729
|
+
}
|
|
60730
|
+
function warnForEventNavigationPathMismatches(ctx, mismatches) {
|
|
60731
|
+
if (mismatches.length === 0) return;
|
|
60732
|
+
ctx.output.warn("Navigation links may not match canonical event paths", {
|
|
60733
|
+
details: mismatches.map(
|
|
60734
|
+
(mismatch) => ` - ${mismatch.menuName} > ${mismatch.label}: ${mismatch.navigationPath} points at event "${mismatch.eventIdentifier}", but content/events uses ${mismatch.eventPath}`
|
|
60735
|
+
).join("\n"),
|
|
60736
|
+
suggestion: "Update content/events/*.json path or content/navigation.json so event links resolve to the same route."
|
|
60737
|
+
});
|
|
60738
|
+
}
|
|
60412
60739
|
async function pushEventsScope(ctx, options) {
|
|
60413
60740
|
const { client } = ctx;
|
|
60414
60741
|
const only = options?.only;
|
|
60415
|
-
const events = await
|
|
60416
|
-
const
|
|
60742
|
+
const events = await readEventsWithFilePaths(ctx.contentDir);
|
|
60743
|
+
const duplicateIdentifiers = findDuplicateLocalEventIdentifiers(
|
|
60744
|
+
only ? events.filter((event) => only.has(event.identifier)) : events
|
|
60745
|
+
);
|
|
60746
|
+
if (duplicateIdentifiers.length > 0) {
|
|
60747
|
+
ctx.output.error("Duplicate event identifiers detected", {
|
|
60748
|
+
details: duplicateIdentifiers.map(
|
|
60749
|
+
(duplicate) => ` ${duplicate.identifier}:
|
|
60750
|
+
${duplicate.filePaths.map((filePath) => ` - ${formatDuplicateEventFilePath(ctx.contentDir, filePath)}`).join("\n")}`
|
|
60751
|
+
).join("\n"),
|
|
60752
|
+
suggestion: "Each content/events/*.json file must have a unique identifier. Delete or merge stale duplicate event files before pushing."
|
|
60753
|
+
});
|
|
60754
|
+
return {
|
|
60755
|
+
status: "aborted",
|
|
60756
|
+
scopeCommand: "events",
|
|
60757
|
+
scopeName: "events",
|
|
60758
|
+
created: 0,
|
|
60759
|
+
updated: 0,
|
|
60760
|
+
deleted: 0,
|
|
60761
|
+
failed: duplicateIdentifiers.length,
|
|
60762
|
+
errors: duplicateIdentifiers.map((duplicate) => ({
|
|
60763
|
+
identifier: duplicate.identifier,
|
|
60764
|
+
error: `Duplicate event identifier in ${duplicate.filePaths.map((filePath) => formatDuplicateEventFilePath(ctx.contentDir, filePath)).join(", ")}`
|
|
60765
|
+
}))
|
|
60766
|
+
};
|
|
60767
|
+
}
|
|
60768
|
+
const eventItems = events.map(({ filePath: _filePath, ...event }) => event);
|
|
60769
|
+
const selectedEventItems = only ? eventItems.filter((event) => only.has(event.identifier)) : eventItems;
|
|
60770
|
+
warnForEventNavigationPathMismatches(
|
|
60771
|
+
ctx,
|
|
60772
|
+
findEventNavigationPathMismatches(selectedEventItems, await readNavigation(ctx.contentDir))
|
|
60773
|
+
);
|
|
60774
|
+
const mediaContent = { ...createEmptyLocalContent(), events: eventItems };
|
|
60417
60775
|
const mediaResult = await syncLocalMediaForScopePush(ctx, mediaContent);
|
|
60418
60776
|
if (!mediaResult.ok) {
|
|
60419
60777
|
ctx.output.error("Local media sync failed", {
|
|
@@ -60438,7 +60796,7 @@ async function pushEventsScope(ctx, options) {
|
|
|
60438
60796
|
getIdentifier: (event) => event.identifier,
|
|
60439
60797
|
getDisplayLabel: (event) => event.title,
|
|
60440
60798
|
shouldPushItem: only ? (event) => only.has(event.identifier) : void 0,
|
|
60441
|
-
readLocal: async () =>
|
|
60799
|
+
readLocal: async () => eventItems,
|
|
60442
60800
|
readMeta: async (dir) => {
|
|
60443
60801
|
const meta = await readEventsMeta(dir);
|
|
60444
60802
|
return meta?.events ?? null;
|
|
@@ -60673,7 +61031,7 @@ function firstNestedContainerChange(localChanges, remoteChanges) {
|
|
|
60673
61031
|
}
|
|
60674
61032
|
function firstSameFieldConflictPath(localChanges, remoteChanges) {
|
|
60675
61033
|
const remotePaths = new Set(remoteChanges.keys());
|
|
60676
|
-
return [...localChanges.keys()].filter((
|
|
61034
|
+
return [...localChanges.keys()].filter((path28) => remotePaths.has(path28)).sort()[0] ?? null;
|
|
60677
61035
|
}
|
|
60678
61036
|
function unsupportedNestedMerge(subject, fieldPath) {
|
|
60679
61037
|
return {
|
|
@@ -60755,37 +61113,37 @@ function valueKind(value) {
|
|
|
60755
61113
|
if (typeof value === "object") return "object";
|
|
60756
61114
|
return "scalar";
|
|
60757
61115
|
}
|
|
60758
|
-
function entryChange(
|
|
61116
|
+
function entryChange(path28, value, containerKind) {
|
|
60759
61117
|
switch (containerKind) {
|
|
60760
61118
|
case "array":
|
|
60761
|
-
if (Array.isArray(value)) return { path:
|
|
61119
|
+
if (Array.isArray(value)) return { path: path28, value, containerKind };
|
|
60762
61120
|
break;
|
|
60763
61121
|
case "object":
|
|
60764
61122
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
60765
|
-
return { path:
|
|
61123
|
+
return { path: path28, value, containerKind };
|
|
60766
61124
|
}
|
|
60767
61125
|
break;
|
|
60768
61126
|
case "null":
|
|
60769
|
-
if (value === null || value === void 0) return { path:
|
|
61127
|
+
if (value === null || value === void 0) return { path: path28, value, containerKind };
|
|
60770
61128
|
break;
|
|
60771
61129
|
case "scalar":
|
|
60772
|
-
if (isScalarEntryChangeValue(value)) return { path:
|
|
61130
|
+
if (isScalarEntryChangeValue(value)) return { path: path28, value, containerKind };
|
|
60773
61131
|
break;
|
|
60774
61132
|
default:
|
|
60775
61133
|
assertNever(containerKind);
|
|
60776
61134
|
}
|
|
60777
|
-
throw new Error(`Invalid entry merge change at ${
|
|
61135
|
+
throw new Error(`Invalid entry merge change at ${path28}.`);
|
|
60778
61136
|
}
|
|
60779
61137
|
function isScalarEntryChangeValue(value) {
|
|
60780
61138
|
return value === void 0 || value === null || ["boolean", "number", "string"].includes(typeof value);
|
|
60781
61139
|
}
|
|
60782
|
-
function expectStringValue(
|
|
61140
|
+
function expectStringValue(path28, value) {
|
|
60783
61141
|
if (typeof value === "string") return value;
|
|
60784
|
-
throw new Error(`Entry merge expected ${
|
|
61142
|
+
throw new Error(`Entry merge expected ${path28} to be a string.`);
|
|
60785
61143
|
}
|
|
60786
|
-
function expectBooleanValue(
|
|
61144
|
+
function expectBooleanValue(path28, value) {
|
|
60787
61145
|
if (typeof value === "boolean") return value;
|
|
60788
|
-
throw new Error(`Entry merge expected ${
|
|
61146
|
+
throw new Error(`Entry merge expected ${path28} to be a boolean.`);
|
|
60789
61147
|
}
|
|
60790
61148
|
function expectStatusValue(value) {
|
|
60791
61149
|
if (value === "draft" || value === "published") return value;
|
|
@@ -61297,7 +61655,7 @@ async function unlinkIfExists(filePath) {
|
|
|
61297
61655
|
}
|
|
61298
61656
|
|
|
61299
61657
|
// src/cli/commands/push-execute.ts
|
|
61300
|
-
async function executeScopedPush(output, isRemote, options, globalOpts, scopeLabel, pullCommand2, shouldDeleteOrphans, pushFn) {
|
|
61658
|
+
async function executeScopedPush(output, isRemote, options, globalOpts, scopeLabel, pullCommand2, shouldDeleteOrphans, pushFn, scopedOptions) {
|
|
61301
61659
|
const cliConfig = await loadCliConfig();
|
|
61302
61660
|
const contentDir = path5.resolve(options.contentDir ?? cliConfig.contentDir);
|
|
61303
61661
|
if (!await contentDirExists(contentDir)) {
|
|
@@ -61311,21 +61669,24 @@ async function executeScopedPush(output, isRemote, options, globalOpts, scopeLab
|
|
|
61311
61669
|
managementApiKey: env.managementApiKey,
|
|
61312
61670
|
siteId: env.siteId
|
|
61313
61671
|
});
|
|
61314
|
-
const result = await pushFn(
|
|
61315
|
-
|
|
61316
|
-
|
|
61317
|
-
|
|
61318
|
-
|
|
61319
|
-
|
|
61320
|
-
|
|
61321
|
-
|
|
61322
|
-
|
|
61323
|
-
|
|
61324
|
-
|
|
61325
|
-
|
|
61326
|
-
|
|
61327
|
-
|
|
61328
|
-
|
|
61672
|
+
const result = await pushFn(
|
|
61673
|
+
{
|
|
61674
|
+
output,
|
|
61675
|
+
contentDir,
|
|
61676
|
+
siteId: env.siteId,
|
|
61677
|
+
targetEnv: isRemote ? "remote" : "local",
|
|
61678
|
+
client,
|
|
61679
|
+
dryRun: options.dryRun,
|
|
61680
|
+
force: options.force ?? false,
|
|
61681
|
+
isJsonOutput: globalOpts.json ?? false,
|
|
61682
|
+
forceUpdateAsset: options.forceUpdateAsset,
|
|
61683
|
+
deleteOrphaned: shouldDeleteOrphans,
|
|
61684
|
+
autoPullStale: options.autoPullStale ?? false,
|
|
61685
|
+
skipMeta: !(options.meta ?? true),
|
|
61686
|
+
humanDiff: options.diff ?? false
|
|
61687
|
+
},
|
|
61688
|
+
scopedOptions
|
|
61689
|
+
);
|
|
61329
61690
|
if (result.status === "pushed" && result.failed > 0 || result.status === "failed") {
|
|
61330
61691
|
process.exitCode = 1;
|
|
61331
61692
|
output.result(false, `${scopeLabel} push had failures`, result);
|
|
@@ -61582,6 +61943,7 @@ ${errors}`
|
|
|
61582
61943
|
return { success: true };
|
|
61583
61944
|
}
|
|
61584
61945
|
if (pushScope === "venues") {
|
|
61946
|
+
const only = type ? /* @__PURE__ */ new Set([type]) : void 0;
|
|
61585
61947
|
return executeScopedPush(
|
|
61586
61948
|
output,
|
|
61587
61949
|
isRemote,
|
|
@@ -61590,10 +61952,12 @@ ${errors}`
|
|
|
61590
61952
|
"Venues",
|
|
61591
61953
|
"venues",
|
|
61592
61954
|
shouldDeleteOrphans,
|
|
61593
|
-
pushVenuesScope
|
|
61955
|
+
pushVenuesScope,
|
|
61956
|
+
only ? { only } : void 0
|
|
61594
61957
|
);
|
|
61595
61958
|
}
|
|
61596
61959
|
if (pushScope === "event-categories") {
|
|
61960
|
+
const only = type ? /* @__PURE__ */ new Set([type]) : void 0;
|
|
61597
61961
|
return executeScopedPush(
|
|
61598
61962
|
output,
|
|
61599
61963
|
isRemote,
|
|
@@ -61602,10 +61966,12 @@ ${errors}`
|
|
|
61602
61966
|
"Event categories",
|
|
61603
61967
|
"event-categories",
|
|
61604
61968
|
shouldDeleteOrphans,
|
|
61605
|
-
pushEventCategoriesScope
|
|
61969
|
+
pushEventCategoriesScope,
|
|
61970
|
+
only ? { only } : void 0
|
|
61606
61971
|
);
|
|
61607
61972
|
}
|
|
61608
61973
|
if (pushScope === "events") {
|
|
61974
|
+
const only = type ? /* @__PURE__ */ new Set([type]) : void 0;
|
|
61609
61975
|
return executeScopedPush(
|
|
61610
61976
|
output,
|
|
61611
61977
|
isRemote,
|
|
@@ -61614,10 +61980,12 @@ ${errors}`
|
|
|
61614
61980
|
"Events",
|
|
61615
61981
|
"events",
|
|
61616
61982
|
shouldDeleteOrphans,
|
|
61617
|
-
pushEventsScope
|
|
61983
|
+
pushEventsScope,
|
|
61984
|
+
only ? { only } : void 0
|
|
61618
61985
|
);
|
|
61619
61986
|
}
|
|
61620
61987
|
if (pushScope === "courses") {
|
|
61988
|
+
const only = type ? /* @__PURE__ */ new Set([type]) : void 0;
|
|
61621
61989
|
return executeScopedPush(
|
|
61622
61990
|
output,
|
|
61623
61991
|
isRemote,
|
|
@@ -61626,7 +61994,8 @@ ${errors}`
|
|
|
61626
61994
|
"Courses",
|
|
61627
61995
|
"courses",
|
|
61628
61996
|
shouldDeleteOrphans,
|
|
61629
|
-
pushCoursesScope
|
|
61997
|
+
pushCoursesScope,
|
|
61998
|
+
only ? { only } : void 0
|
|
61630
61999
|
);
|
|
61631
62000
|
}
|
|
61632
62001
|
if (pushScope === "footer") {
|
|
@@ -63807,7 +64176,7 @@ var THEME_FIELD_CATEGORY_MAP = {
|
|
|
63807
64176
|
};
|
|
63808
64177
|
|
|
63809
64178
|
// src/cli/init-docs/zod-to-markdown.ts
|
|
63810
|
-
function
|
|
64179
|
+
function isRecord21(value) {
|
|
63811
64180
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
63812
64181
|
}
|
|
63813
64182
|
function isZodTypeAny(value) {
|
|
@@ -63935,7 +64304,7 @@ function extractLiteralValue(schema) {
|
|
|
63935
64304
|
const typeName = getTypeName(schema);
|
|
63936
64305
|
if (typeName !== ZodTypeName.ZodLiteral) return void 0;
|
|
63937
64306
|
const def = schema._def;
|
|
63938
|
-
if (!
|
|
64307
|
+
if (!isRecord21(def)) return void 0;
|
|
63939
64308
|
return String(def.value);
|
|
63940
64309
|
}
|
|
63941
64310
|
function extractSchemaInfo(schema, skipFields = []) {
|
|
@@ -64005,7 +64374,7 @@ function extractFieldInfo(name, schema) {
|
|
|
64005
64374
|
}
|
|
64006
64375
|
if (typeName === ZodTypeName.ZodRecord) {
|
|
64007
64376
|
const def = inner._def;
|
|
64008
|
-
const valueSchema =
|
|
64377
|
+
const valueSchema = isRecord21(def) ? def.valueType : void 0;
|
|
64009
64378
|
if (!isZodTypeAny(valueSchema)) {
|
|
64010
64379
|
info.recordValueType = "unknown";
|
|
64011
64380
|
return info;
|
|
@@ -64020,7 +64389,7 @@ function extractFieldInfo(name, schema) {
|
|
|
64020
64389
|
}
|
|
64021
64390
|
} else if (getTypeName(valueInner) === ZodTypeName.ZodRecord) {
|
|
64022
64391
|
const nestedDef = valueInner._def;
|
|
64023
|
-
const nestedValueSchema =
|
|
64392
|
+
const nestedValueSchema = isRecord21(nestedDef) ? nestedDef.valueType : void 0;
|
|
64024
64393
|
if (!isZodTypeAny(nestedValueSchema)) {
|
|
64025
64394
|
info.recordValueType = "record<string, unknown>";
|
|
64026
64395
|
return info;
|
|
@@ -64031,7 +64400,7 @@ function extractFieldInfo(name, schema) {
|
|
|
64031
64400
|
}
|
|
64032
64401
|
if (typeName === ZodTypeName.ZodUnion || typeName === ZodTypeName.ZodDiscriminatedUnion) {
|
|
64033
64402
|
const def = inner._def;
|
|
64034
|
-
const optionsValue =
|
|
64403
|
+
const optionsValue = isRecord21(def) ? def.options : void 0;
|
|
64035
64404
|
const options = Array.isArray(optionsValue) ? optionsValue.filter(isZodTypeAny) : [];
|
|
64036
64405
|
const optionTypes = options.map((opt) => {
|
|
64037
64406
|
const { inner: optInner } = unwrapSchema(opt);
|
|
@@ -65196,7 +65565,7 @@ var SimpleCache = class {
|
|
|
65196
65565
|
};
|
|
65197
65566
|
|
|
65198
65567
|
// src/version.ts
|
|
65199
|
-
var SDK_VERSION = "0.
|
|
65568
|
+
var SDK_VERSION = "0.90.1";
|
|
65200
65569
|
|
|
65201
65570
|
// src/client/error.ts
|
|
65202
65571
|
var RiverbankApiError = class _RiverbankApiError extends Error {
|
|
@@ -66759,19 +67128,19 @@ function createRiverbankClient(config2) {
|
|
|
66759
67128
|
);
|
|
66760
67129
|
}
|
|
66761
67130
|
async function getPageWithResilienceInternal(params) {
|
|
66762
|
-
const { siteId, path:
|
|
67131
|
+
const { siteId, path: path28, preview = false, signal } = params;
|
|
66763
67132
|
const publishedRuntimeCache = planPublishedRuntimeCache({
|
|
66764
67133
|
endpoint: "getContentByPath",
|
|
66765
|
-
params: { siteId, path:
|
|
67134
|
+
params: { siteId, path: path28, preview },
|
|
66766
67135
|
siteId
|
|
66767
67136
|
});
|
|
66768
|
-
const cacheKey = publishedRuntimeCache?.cacheKey ?? `page:${siteId}:${
|
|
67137
|
+
const cacheKey = publishedRuntimeCache?.cacheKey ?? `page:${siteId}:${path28}:${preview}`;
|
|
66769
67138
|
return resilientFetch(
|
|
66770
67139
|
cacheKey,
|
|
66771
67140
|
async (sig) => {
|
|
66772
67141
|
return await apiClient({
|
|
66773
67142
|
endpoint: "getContentByPath",
|
|
66774
|
-
params: { siteId, path:
|
|
67143
|
+
params: { siteId, path: path28, preview: String(preview) },
|
|
66775
67144
|
options: { signal: sig }
|
|
66776
67145
|
});
|
|
66777
67146
|
},
|
|
@@ -66780,7 +67149,7 @@ function createRiverbankClient(config2) {
|
|
|
66780
67149
|
signal,
|
|
66781
67150
|
publishedRuntimeCache,
|
|
66782
67151
|
// Prebuild fallback only for published pages (not preview)
|
|
66783
|
-
prebuildFallback: prebuildLoader && !preview ? () => prebuildLoader.loadPage(siteId,
|
|
67152
|
+
prebuildFallback: prebuildLoader && !preview ? () => prebuildLoader.loadPage(siteId, path28) : void 0
|
|
66784
67153
|
}
|
|
66785
67154
|
);
|
|
66786
67155
|
}
|
|
@@ -67240,17 +67609,17 @@ function createRiverbankClient(config2) {
|
|
|
67240
67609
|
};
|
|
67241
67610
|
},
|
|
67242
67611
|
async checkRedirect(params) {
|
|
67243
|
-
const { siteId, path:
|
|
67244
|
-
if (!siteId || !
|
|
67612
|
+
const { siteId, path: path28, signal } = params;
|
|
67613
|
+
if (!siteId || !path28) {
|
|
67245
67614
|
throw new Error("checkRedirect() requires siteId and path");
|
|
67246
67615
|
}
|
|
67247
|
-
const cacheKey = `redirect:${siteId}:${
|
|
67616
|
+
const cacheKey = `redirect:${siteId}:${path28}`;
|
|
67248
67617
|
return resilientFetchData(
|
|
67249
67618
|
cacheKey,
|
|
67250
67619
|
async (sig) => {
|
|
67251
67620
|
return await apiClient({
|
|
67252
67621
|
endpoint: "checkRedirect",
|
|
67253
|
-
params: { site: siteId, path:
|
|
67622
|
+
params: { site: siteId, path: path28 },
|
|
67254
67623
|
options: { signal: sig }
|
|
67255
67624
|
});
|
|
67256
67625
|
},
|
|
@@ -67660,7 +68029,7 @@ async function loadDeployConfig() {
|
|
|
67660
68029
|
}
|
|
67661
68030
|
async function checkWorkingDirectoryClean(git, prebuildOutput) {
|
|
67662
68031
|
const status = await git.status();
|
|
67663
|
-
const dirtyFiles = status.files.map((f) => f.path).filter((
|
|
68032
|
+
const dirtyFiles = status.files.map((f) => f.path).filter((path28) => !path28.startsWith(prebuildOutput));
|
|
67664
68033
|
return {
|
|
67665
68034
|
clean: dirtyFiles.length === 0,
|
|
67666
68035
|
dirtyFiles
|
|
@@ -68191,25 +68560,25 @@ function mapMediaGuardDiagnosticsToAuditIssues(diagnostics) {
|
|
|
68191
68560
|
}
|
|
68192
68561
|
}));
|
|
68193
68562
|
}
|
|
68194
|
-
function extractEmbedReferences(data,
|
|
68563
|
+
function extractEmbedReferences(data, path28 = []) {
|
|
68195
68564
|
const refs = [];
|
|
68196
68565
|
if (!data || typeof data !== "object") return refs;
|
|
68197
68566
|
if (Array.isArray(data)) {
|
|
68198
68567
|
data.forEach((item, index) => {
|
|
68199
|
-
refs.push(...extractEmbedReferences(item, [...
|
|
68568
|
+
refs.push(...extractEmbedReferences(item, [...path28, String(index)]));
|
|
68200
68569
|
});
|
|
68201
68570
|
return refs;
|
|
68202
68571
|
}
|
|
68203
68572
|
const obj = data;
|
|
68204
68573
|
if (obj.kind === "embed" && typeof obj.contentType === "string" && typeof obj.identifier === "string") {
|
|
68205
68574
|
refs.push({
|
|
68206
|
-
path:
|
|
68575
|
+
path: path28.join("."),
|
|
68207
68576
|
contentType: obj.contentType,
|
|
68208
68577
|
identifier: obj.identifier
|
|
68209
68578
|
});
|
|
68210
68579
|
}
|
|
68211
68580
|
for (const [key, value] of Object.entries(obj)) {
|
|
68212
|
-
refs.push(...extractEmbedReferences(value, [...
|
|
68581
|
+
refs.push(...extractEmbedReferences(value, [...path28, key]));
|
|
68213
68582
|
}
|
|
68214
68583
|
return refs;
|
|
68215
68584
|
}
|
|
@@ -69143,7 +69512,7 @@ function formatThemeSummaryForPrompt(summary) {
|
|
|
69143
69512
|
}
|
|
69144
69513
|
|
|
69145
69514
|
// src/manifest/validation/layout-utils.ts
|
|
69146
|
-
function collectLayoutNodeInfos(node,
|
|
69515
|
+
function collectLayoutNodeInfos(node, path28 = "layout", out = []) {
|
|
69147
69516
|
if (!node || typeof node !== "object") return out;
|
|
69148
69517
|
const n = node;
|
|
69149
69518
|
const type = typeof n.type === "string" ? n.type : "unknown";
|
|
@@ -69152,10 +69521,10 @@ function collectLayoutNodeInfos(node, path27 = "layout", out = []) {
|
|
|
69152
69521
|
const b = n.$bind;
|
|
69153
69522
|
if (typeof b.from === "string") bindFrom = b.from;
|
|
69154
69523
|
}
|
|
69155
|
-
out.push({ path:
|
|
69524
|
+
out.push({ path: path28, type, bindFrom });
|
|
69156
69525
|
if (Array.isArray(n.children)) {
|
|
69157
69526
|
for (let i = 0; i < n.children.length; i++) {
|
|
69158
|
-
collectLayoutNodeInfos(n.children[i], `${
|
|
69527
|
+
collectLayoutNodeInfos(n.children[i], `${path28}.children[${i}]`, out);
|
|
69159
69528
|
}
|
|
69160
69529
|
}
|
|
69161
69530
|
return out;
|
|
@@ -69577,7 +69946,7 @@ function extractNestedHrefBindFromProps(props2) {
|
|
|
69577
69946
|
const bind2 = href.$bind;
|
|
69578
69947
|
return bind2 && typeof bind2 === "object" ? bind2 : null;
|
|
69579
69948
|
}
|
|
69580
|
-
function findMissingLinkHrefs(node, blockId, fields3,
|
|
69949
|
+
function findMissingLinkHrefs(node, blockId, fields3, path28 = "layout", repeatStack = []) {
|
|
69581
69950
|
const errors = [];
|
|
69582
69951
|
if (!node || typeof node !== "object") return errors;
|
|
69583
69952
|
const n = node;
|
|
@@ -69606,21 +69975,21 @@ function findMissingLinkHrefs(node, blockId, fields3, path27 = "layout", repeatS
|
|
|
69606
69975
|
if (isBoundToLinkField) {
|
|
69607
69976
|
if (!hrefBind || !hrefFrom) {
|
|
69608
69977
|
errors.push({
|
|
69609
|
-
path:
|
|
69610
|
-
message: `Block "${blockId}": ${nodeType} node at ${
|
|
69978
|
+
path: path28,
|
|
69979
|
+
message: `Block "${blockId}": ${nodeType} node at ${path28} is bound to a link field but is missing props.href binding`,
|
|
69611
69980
|
suggestion: `Add props.href: { "$bind": { "from": "${bindFrom ?? "content.yourLinkField"}", "fallback": null, "transforms": [{ "id": "links.resolve" }] } }`
|
|
69612
69981
|
});
|
|
69613
69982
|
} else if (!bindingHasTransform(hrefBind, "links.resolve")) {
|
|
69614
69983
|
errors.push({
|
|
69615
|
-
path:
|
|
69616
|
-
message: `Block "${blockId}": ${nodeType} node at ${
|
|
69984
|
+
path: path28,
|
|
69985
|
+
message: `Block "${blockId}": ${nodeType} node at ${path28} has props.href binding but is missing transforms: [{id:"links.resolve"}]`,
|
|
69617
69986
|
suggestion: `Set props.href.$bind.transforms to [{ "id": "links.resolve" }].`
|
|
69618
69987
|
});
|
|
69619
69988
|
}
|
|
69620
69989
|
if (bindFrom && bindFieldType === "link" && !bindingHasTransform(bind2, "links.label")) {
|
|
69621
69990
|
errors.push({
|
|
69622
|
-
path:
|
|
69623
|
-
message: `Block "${blockId}": ${nodeType} node at ${
|
|
69991
|
+
path: path28,
|
|
69992
|
+
message: `Block "${blockId}": ${nodeType} node at ${path28} binds label from a link field but is missing links.label transform`,
|
|
69624
69993
|
suggestion: `Set node.$bind.transforms to [{ "id": "links.label" }] so the label renders as text.`
|
|
69625
69994
|
});
|
|
69626
69995
|
}
|
|
@@ -69633,7 +70002,7 @@ function findMissingLinkHrefs(node, blockId, fields3, path27 = "layout", repeatS
|
|
|
69633
70002
|
n.children[i],
|
|
69634
70003
|
blockId,
|
|
69635
70004
|
fields3,
|
|
69636
|
-
`${
|
|
70005
|
+
`${path28}.children[${i}]`,
|
|
69637
70006
|
nextRepeatStack
|
|
69638
70007
|
)
|
|
69639
70008
|
);
|
|
@@ -69641,7 +70010,7 @@ function findMissingLinkHrefs(node, blockId, fields3, path27 = "layout", repeatS
|
|
|
69641
70010
|
}
|
|
69642
70011
|
return errors;
|
|
69643
70012
|
}
|
|
69644
|
-
function detectRedundantLinkLabels(node, blockId, fields3,
|
|
70013
|
+
function detectRedundantLinkLabels(node, blockId, fields3, path28 = "layout", repeatStack = []) {
|
|
69645
70014
|
const errors = [];
|
|
69646
70015
|
if (!node || typeof node !== "object") return errors;
|
|
69647
70016
|
const n = node;
|
|
@@ -69663,7 +70032,7 @@ function detectRedundantLinkLabels(node, blockId, fields3, path27 = "layout", re
|
|
|
69663
70032
|
const redundancies = findRedundantLinkTextSiblings(
|
|
69664
70033
|
children,
|
|
69665
70034
|
nextRepeatStack,
|
|
69666
|
-
|
|
70035
|
+
path28
|
|
69667
70036
|
);
|
|
69668
70037
|
errors.push(
|
|
69669
70038
|
...redundancies.map((r) => ({
|
|
@@ -69680,7 +70049,7 @@ function detectRedundantLinkLabels(node, blockId, fields3, path27 = "layout", re
|
|
|
69680
70049
|
n.children[i],
|
|
69681
70050
|
blockId,
|
|
69682
70051
|
fields3,
|
|
69683
|
-
`${
|
|
70052
|
+
`${path28}.children[${i}]`,
|
|
69684
70053
|
nextRepeatStack
|
|
69685
70054
|
)
|
|
69686
70055
|
);
|
|
@@ -69919,19 +70288,19 @@ function extractBlockIdFromSelector(selector) {
|
|
|
69919
70288
|
const match = selector.match(/\[data-block=(["'])(custom\.[^"']+)\1\]/);
|
|
69920
70289
|
return match?.[2] ?? null;
|
|
69921
70290
|
}
|
|
69922
|
-
function validateNodeType(nodeType,
|
|
70291
|
+
function validateNodeType(nodeType, path28, ctx) {
|
|
69923
70292
|
if (!ALLOWED_NODE_TYPES.includes(
|
|
69924
70293
|
nodeType
|
|
69925
70294
|
)) {
|
|
69926
70295
|
return {
|
|
69927
|
-
path: `${
|
|
69928
|
-
message: `Block "${ctx.blockId}": Unknown node type "${nodeType}" at ${
|
|
70296
|
+
path: `${path28}.type`,
|
|
70297
|
+
message: `Block "${ctx.blockId}": Unknown node type "${nodeType}" at ${path28}`,
|
|
69929
70298
|
suggestion: `ALLOWED: ${ALLOWED_NODE_TYPES.slice(0, 10).join(", ")}... FIX: Replace "${nodeType}" with a valid node type.`
|
|
69930
70299
|
};
|
|
69931
70300
|
}
|
|
69932
70301
|
return null;
|
|
69933
70302
|
}
|
|
69934
|
-
function validateTransforms(transforms,
|
|
70303
|
+
function validateTransforms(transforms, path28, ctx) {
|
|
69935
70304
|
const errors = [];
|
|
69936
70305
|
for (let i = 0; i < transforms.length; i++) {
|
|
69937
70306
|
const transform = transforms[i];
|
|
@@ -69940,7 +70309,7 @@ function validateTransforms(transforms, path27, ctx) {
|
|
|
69940
70309
|
transform.id
|
|
69941
70310
|
)) {
|
|
69942
70311
|
errors.push({
|
|
69943
|
-
path: `${
|
|
70312
|
+
path: `${path28}.transforms[${i}].id`,
|
|
69944
70313
|
message: `Block "${ctx.blockId}": Unknown transform "${transform.id}"`,
|
|
69945
70314
|
suggestion: `ALLOWED: ${ALLOWED_TRANSFORM_IDS.slice(0, 8).join(", ")}... FIX: Replace with a valid transform ID or remove.`
|
|
69946
70315
|
});
|
|
@@ -69949,7 +70318,7 @@ function validateTransforms(transforms, path27, ctx) {
|
|
|
69949
70318
|
}
|
|
69950
70319
|
return errors;
|
|
69951
70320
|
}
|
|
69952
|
-
function validateBinding(bind2,
|
|
70321
|
+
function validateBinding(bind2, path28, ctx) {
|
|
69953
70322
|
const errors = [];
|
|
69954
70323
|
if ("from" in bind2 && typeof bind2.from === "string") {
|
|
69955
70324
|
const bindPath = bind2.from;
|
|
@@ -69957,7 +70326,7 @@ function validateBinding(bind2, path27, ctx) {
|
|
|
69957
70326
|
const fieldId = bindPath.replace("content.", "").split(".")[0] ?? "";
|
|
69958
70327
|
if (fieldId && !ctx.fieldIds.has(fieldId)) {
|
|
69959
70328
|
errors.push({
|
|
69960
|
-
path: `${
|
|
70329
|
+
path: `${path28}.from`,
|
|
69961
70330
|
message: `Block "${ctx.blockId}": $bind references unknown field "${fieldId}"`,
|
|
69962
70331
|
suggestion: `DEFINED FIELDS: ${Array.from(ctx.fieldIds).join(", ")}. FIX: Add field { id: '${fieldId}', type: '...' } or use existing field.`
|
|
69963
70332
|
});
|
|
@@ -69965,31 +70334,31 @@ function validateBinding(bind2, path27, ctx) {
|
|
|
69965
70334
|
}
|
|
69966
70335
|
}
|
|
69967
70336
|
if ("transforms" in bind2 && Array.isArray(bind2.transforms)) {
|
|
69968
|
-
errors.push(...validateTransforms(bind2.transforms,
|
|
70337
|
+
errors.push(...validateTransforms(bind2.transforms, path28, ctx));
|
|
69969
70338
|
}
|
|
69970
70339
|
return errors;
|
|
69971
70340
|
}
|
|
69972
|
-
function validateLayoutDeep(node, blockId, fields3,
|
|
70341
|
+
function validateLayoutDeep(node, blockId, fields3, path28 = "layout") {
|
|
69973
70342
|
const ctx = {
|
|
69974
70343
|
blockId,
|
|
69975
70344
|
fieldIds: collectFieldIds(fields3)
|
|
69976
70345
|
};
|
|
69977
|
-
return validateLayoutNode(node,
|
|
70346
|
+
return validateLayoutNode(node, path28, ctx);
|
|
69978
70347
|
}
|
|
69979
|
-
function validateLayoutNode(node,
|
|
70348
|
+
function validateLayoutNode(node, path28, ctx) {
|
|
69980
70349
|
const errors = [];
|
|
69981
70350
|
if (!node || typeof node !== "object") {
|
|
69982
70351
|
return errors;
|
|
69983
70352
|
}
|
|
69984
70353
|
const n = node;
|
|
69985
70354
|
if ("type" in n && typeof n.type === "string") {
|
|
69986
|
-
const typeError = validateNodeType(n.type,
|
|
70355
|
+
const typeError = validateNodeType(n.type, path28, ctx);
|
|
69987
70356
|
if (typeError) errors.push(typeError);
|
|
69988
70357
|
}
|
|
69989
70358
|
if ("$bind" in n && n.$bind && typeof n.$bind === "object") {
|
|
69990
70359
|
const bindErrors = validateBinding(
|
|
69991
70360
|
n.$bind,
|
|
69992
|
-
`${
|
|
70361
|
+
`${path28}.$bind`,
|
|
69993
70362
|
ctx
|
|
69994
70363
|
);
|
|
69995
70364
|
errors.push(...bindErrors);
|
|
@@ -69997,7 +70366,7 @@ function validateLayoutNode(node, path27, ctx) {
|
|
|
69997
70366
|
if ("props" in n && n.props && typeof n.props === "object") {
|
|
69998
70367
|
const propsErrors = validatePropsBindings(
|
|
69999
70368
|
n.props,
|
|
70000
|
-
`${
|
|
70369
|
+
`${path28}.props`,
|
|
70001
70370
|
ctx
|
|
70002
70371
|
);
|
|
70003
70372
|
errors.push(...propsErrors);
|
|
@@ -70006,7 +70375,7 @@ function validateLayoutNode(node, path27, ctx) {
|
|
|
70006
70375
|
for (let i = 0; i < n.children.length; i++) {
|
|
70007
70376
|
const childErrors = validateLayoutNode(
|
|
70008
70377
|
n.children[i],
|
|
70009
|
-
`${
|
|
70378
|
+
`${path28}.children[${i}]`,
|
|
70010
70379
|
ctx
|
|
70011
70380
|
);
|
|
70012
70381
|
errors.push(...childErrors);
|
|
@@ -70014,17 +70383,17 @@ function validateLayoutNode(node, path27, ctx) {
|
|
|
70014
70383
|
}
|
|
70015
70384
|
return errors;
|
|
70016
70385
|
}
|
|
70017
|
-
function validatePropsBindings(props2,
|
|
70386
|
+
function validatePropsBindings(props2, path28, ctx) {
|
|
70018
70387
|
const errors = [];
|
|
70019
70388
|
for (const [key, value] of Object.entries(props2)) {
|
|
70020
70389
|
if (value && typeof value === "object" && "$bind" in value) {
|
|
70021
70390
|
const bind2 = value.$bind;
|
|
70022
|
-
const bindErrors = validateBinding(bind2, `${
|
|
70391
|
+
const bindErrors = validateBinding(bind2, `${path28}.${key}.$bind`, ctx);
|
|
70023
70392
|
errors.push(...bindErrors);
|
|
70024
70393
|
} else if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
70025
70394
|
const nestedErrors = validatePropsBindings(
|
|
70026
70395
|
value,
|
|
70027
|
-
`${
|
|
70396
|
+
`${path28}.${key}`,
|
|
70028
70397
|
ctx
|
|
70029
70398
|
);
|
|
70030
70399
|
errors.push(...nestedErrors);
|
|
@@ -70157,7 +70526,7 @@ function collectUsedFieldRefs(node) {
|
|
|
70157
70526
|
visit(node, []);
|
|
70158
70527
|
return { topLevel, nestedByRepeater, itemNameByRepeater };
|
|
70159
70528
|
}
|
|
70160
|
-
function findMissingBindings(node, blockId,
|
|
70529
|
+
function findMissingBindings(node, blockId, path28 = "layout") {
|
|
70161
70530
|
const errors = [];
|
|
70162
70531
|
if (!node || typeof node !== "object") {
|
|
70163
70532
|
return errors;
|
|
@@ -70167,15 +70536,15 @@ function findMissingBindings(node, blockId, path27 = "layout") {
|
|
|
70167
70536
|
if ("$repeat" in n && n.$repeat && typeof n.$repeat === "object") {
|
|
70168
70537
|
if (nodeType && CONTENT_NODE_TYPES.includes(nodeType)) {
|
|
70169
70538
|
errors.push({
|
|
70170
|
-
path:
|
|
70171
|
-
message: `Block "${blockId}": ${nodeType} node at ${
|
|
70539
|
+
path: path28,
|
|
70540
|
+
message: `Block "${blockId}": ${nodeType} node at ${path28} uses $repeat, but content nodes cannot be repeat containers`,
|
|
70172
70541
|
suggestion: `Move $repeat to a container node (grid/stack/div) and put a ${nodeType} child inside with $bind.from like "item.field".`
|
|
70173
70542
|
});
|
|
70174
70543
|
}
|
|
70175
70544
|
if (!Array.isArray(n.children) || n.children.length === 0) {
|
|
70176
70545
|
errors.push({
|
|
70177
|
-
path:
|
|
70178
|
-
message: `Block "${blockId}": node at ${
|
|
70546
|
+
path: path28,
|
|
70547
|
+
message: `Block "${blockId}": node at ${path28} uses $repeat but has no children to repeat`,
|
|
70179
70548
|
suggestion: 'Add one or more child nodes under children[] that bind to the repeat item (e.g., $bind.from: "item.text").'
|
|
70180
70549
|
});
|
|
70181
70550
|
}
|
|
@@ -70184,15 +70553,15 @@ function findMissingBindings(node, blockId, path27 = "layout") {
|
|
|
70184
70553
|
const hasBind = "$bind" in n && n.$bind && typeof n.$bind === "object" && "from" in n.$bind;
|
|
70185
70554
|
if (Array.isArray(n.children) && n.children.length > 0) {
|
|
70186
70555
|
errors.push({
|
|
70187
|
-
path:
|
|
70188
|
-
message: `Block "${blockId}": ${nodeType} node at ${
|
|
70556
|
+
path: path28,
|
|
70557
|
+
message: `Block "${blockId}": ${nodeType} node at ${path28} has children, but content nodes must have children: null`,
|
|
70189
70558
|
suggestion: `Replace this ${nodeType} with a container node (div/stack/inline) and put the ${nodeType} nodes inside it.`
|
|
70190
70559
|
});
|
|
70191
70560
|
}
|
|
70192
70561
|
if (!hasBind) {
|
|
70193
70562
|
errors.push({
|
|
70194
|
-
path: `${
|
|
70195
|
-
message: `Block "${blockId}": ${nodeType} node at ${
|
|
70563
|
+
path: `${path28}`,
|
|
70564
|
+
message: `Block "${blockId}": ${nodeType} node at ${path28} has no $bind - it won't display any content`,
|
|
70196
70565
|
suggestion: `Add $bind: { from: "content.fieldName" } to connect this ${nodeType} to a field. Example: { "type": "${nodeType}", "$bind": { "from": "content.headline" } }`
|
|
70197
70566
|
});
|
|
70198
70567
|
}
|
|
@@ -70202,7 +70571,7 @@ function findMissingBindings(node, blockId, path27 = "layout") {
|
|
|
70202
70571
|
const childErrors = findMissingBindings(
|
|
70203
70572
|
n.children[i],
|
|
70204
70573
|
blockId,
|
|
70205
|
-
`${
|
|
70574
|
+
`${path28}.children[${i}]`
|
|
70206
70575
|
);
|
|
70207
70576
|
errors.push(...childErrors);
|
|
70208
70577
|
}
|
|
@@ -70219,13 +70588,13 @@ function getMaxDepth(node, currentDepth = 0) {
|
|
|
70219
70588
|
);
|
|
70220
70589
|
}
|
|
70221
70590
|
var CONTAINER_NODE_TYPES = ["section", "stack", "grid", "div", "inline"];
|
|
70222
|
-
function detectPotentialTruncation(node, maxAllowedDepth, currentDepth = 0,
|
|
70591
|
+
function detectPotentialTruncation(node, maxAllowedDepth, currentDepth = 0, path28 = "layout") {
|
|
70223
70592
|
if (!node || typeof node !== "object") return [];
|
|
70224
70593
|
const n = node;
|
|
70225
70594
|
const truncatedPaths = [];
|
|
70226
70595
|
if (currentDepth === maxAllowedDepth && n.children === null) {
|
|
70227
70596
|
if (CONTAINER_NODE_TYPES.includes(n.type || "")) {
|
|
70228
|
-
truncatedPaths.push(`${
|
|
70597
|
+
truncatedPaths.push(`${path28} (${n.type ?? "node"} at depth ${currentDepth})`);
|
|
70229
70598
|
}
|
|
70230
70599
|
}
|
|
70231
70600
|
if (n.children && Array.isArray(n.children)) {
|
|
@@ -70235,7 +70604,7 @@ function detectPotentialTruncation(node, maxAllowedDepth, currentDepth = 0, path
|
|
|
70235
70604
|
child,
|
|
70236
70605
|
maxAllowedDepth,
|
|
70237
70606
|
currentDepth + 1,
|
|
70238
|
-
`${
|
|
70607
|
+
`${path28}.children[${i}]`
|
|
70239
70608
|
)
|
|
70240
70609
|
);
|
|
70241
70610
|
});
|
|
@@ -70255,8 +70624,8 @@ function formatValidationFeedback(errors, output) {
|
|
|
70255
70624
|
`The layout reached the maximum depth of ${MAX_LAYOUT_DEPTH} levels.`
|
|
70256
70625
|
);
|
|
70257
70626
|
lines.push("These container nodes at the depth limit have no children:");
|
|
70258
|
-
for (const
|
|
70259
|
-
lines.push(` \u26A0\uFE0F ${
|
|
70627
|
+
for (const path28 of truncatedPaths) {
|
|
70628
|
+
lines.push(` \u26A0\uFE0F ${path28}`);
|
|
70260
70629
|
}
|
|
70261
70630
|
lines.push("");
|
|
70262
70631
|
lines.push(
|
|
@@ -70719,11 +71088,11 @@ var pass3bOutputSchema = z.object({
|
|
|
70719
71088
|
customCssAtRules: z.array(llmMediaAtRuleSchema).nullable(),
|
|
70720
71089
|
rationale: z.string()
|
|
70721
71090
|
});
|
|
70722
|
-
function getNodeAtPath(layout,
|
|
70723
|
-
if (
|
|
71091
|
+
function getNodeAtPath(layout, path28) {
|
|
71092
|
+
if (path28 === "" || path28 === "root" || path28 === "layout") {
|
|
70724
71093
|
return layout;
|
|
70725
71094
|
}
|
|
70726
|
-
let normalizedPath =
|
|
71095
|
+
let normalizedPath = path28;
|
|
70727
71096
|
if (normalizedPath.startsWith("layout.")) {
|
|
70728
71097
|
normalizedPath = normalizedPath.slice(7);
|
|
70729
71098
|
}
|
|
@@ -72410,6 +72779,7 @@ var eventUpsertInputSchema = z.object({
|
|
|
72410
72779
|
identifier: z.string().min(1).optional(),
|
|
72411
72780
|
title: z.string().min(1, "title is required"),
|
|
72412
72781
|
slug: z.string().min(1).optional(),
|
|
72782
|
+
path: z.string().startsWith("/", "path must start with /").nullable().optional(),
|
|
72413
72783
|
status: z.enum(["draft", "active", "archived", "cancelled", "completed"]).optional(),
|
|
72414
72784
|
visibility: z.enum(["private", "public", "unlisted"]).optional(),
|
|
72415
72785
|
schedule: eventScheduleInputSchema,
|
|
@@ -72422,7 +72792,8 @@ var eventUpsertInputSchema = z.object({
|
|
|
72422
72792
|
formRef: z.string().nullable().optional(),
|
|
72423
72793
|
settings: z.record(z.string(), z.unknown()).optional(),
|
|
72424
72794
|
presentation: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
72425
|
-
tags: z.array(z.string()).optional()
|
|
72795
|
+
tags: z.array(z.string()).optional(),
|
|
72796
|
+
blocks: sdkEntrySlotBlocksInputSchema.optional()
|
|
72426
72797
|
});
|
|
72427
72798
|
var formatEventRow = (event) => [
|
|
72428
72799
|
event.identifier,
|
|
@@ -72905,20 +73276,20 @@ var LEGACY_DATA_FIELDS = /* @__PURE__ */ new Set([
|
|
|
72905
73276
|
"cardTitleOverride",
|
|
72906
73277
|
"presentation"
|
|
72907
73278
|
]);
|
|
72908
|
-
function
|
|
73279
|
+
function isRecord22(value) {
|
|
72909
73280
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72910
73281
|
}
|
|
72911
73282
|
function hasMeaningfulValue(value) {
|
|
72912
73283
|
if (value === void 0 || value === null) return false;
|
|
72913
73284
|
if (typeof value === "string") return value.trim().length > 0;
|
|
72914
73285
|
if (Array.isArray(value)) return value.length > 0;
|
|
72915
|
-
if (
|
|
73286
|
+
if (isRecord22(value)) return Object.keys(value).length > 0;
|
|
72916
73287
|
return true;
|
|
72917
73288
|
}
|
|
72918
73289
|
function normalizeComparable(value) {
|
|
72919
73290
|
if (value === void 0 || value === null) return null;
|
|
72920
73291
|
if (Array.isArray(value)) return value.map(normalizeComparable);
|
|
72921
|
-
if (!
|
|
73292
|
+
if (!isRecord22(value)) return value;
|
|
72922
73293
|
const normalized = {};
|
|
72923
73294
|
for (const key of Object.keys(value).sort()) {
|
|
72924
73295
|
const normalizedValue = normalizeComparable(value[key]);
|
|
@@ -72938,7 +73309,7 @@ function slugFromPath(value) {
|
|
|
72938
73309
|
}
|
|
72939
73310
|
function legacySlugCandidates(legacy) {
|
|
72940
73311
|
const candidates = /* @__PURE__ */ new Set();
|
|
72941
|
-
const data =
|
|
73312
|
+
const data = isRecord22(legacy.entry.data) ? legacy.entry.data : {};
|
|
72942
73313
|
for (const value of [
|
|
72943
73314
|
legacy.entry.slug,
|
|
72944
73315
|
data.slug,
|
|
@@ -72959,7 +73330,7 @@ async function readLegacyEventEntries(contentDir) {
|
|
|
72959
73330
|
const entries = [];
|
|
72960
73331
|
for (const filePath of files) {
|
|
72961
73332
|
const raw = await readJsonFile(filePath);
|
|
72962
|
-
if (!
|
|
73333
|
+
if (!isRecord22(raw)) {
|
|
72963
73334
|
entries.push({
|
|
72964
73335
|
tag: "invalid",
|
|
72965
73336
|
filePath,
|
|
@@ -72967,7 +73338,7 @@ async function readLegacyEventEntries(contentDir) {
|
|
|
72967
73338
|
});
|
|
72968
73339
|
continue;
|
|
72969
73340
|
}
|
|
72970
|
-
if (!
|
|
73341
|
+
if (!isRecord22(raw.data)) {
|
|
72971
73342
|
entries.push({
|
|
72972
73343
|
tag: "invalid",
|
|
72973
73344
|
filePath,
|
|
@@ -73029,9 +73400,6 @@ function mergeLegacyEventIntoCanonical(legacy, event) {
|
|
|
73029
73400
|
unmappableFields.push(`data.${key}`);
|
|
73030
73401
|
}
|
|
73031
73402
|
}
|
|
73032
|
-
if (legacy.entry.blocks && Object.keys(legacy.entry.blocks).length > 0) {
|
|
73033
|
-
unmappableFields.push("blocks");
|
|
73034
|
-
}
|
|
73035
73403
|
if (unmappableFields.length > 0) {
|
|
73036
73404
|
return { tag: "unmappable", fields: unmappableFields.sort() };
|
|
73037
73405
|
}
|
|
@@ -73096,8 +73464,19 @@ function mergeLegacyEventIntoCanonical(legacy, event) {
|
|
|
73096
73464
|
conflicts.push(result.field);
|
|
73097
73465
|
}
|
|
73098
73466
|
}
|
|
73467
|
+
const blocksResult = mergeBlocks({
|
|
73468
|
+
current: event.blocks,
|
|
73469
|
+
incoming: legacy.entry.blocks,
|
|
73470
|
+
set: (blocks) => ({ ...mergedEvent, blocks })
|
|
73471
|
+
});
|
|
73472
|
+
if (blocksResult.tag === "changed") {
|
|
73473
|
+
mergedEvent = blocksResult.event;
|
|
73474
|
+
mergedFields.push(...blocksResult.fields);
|
|
73475
|
+
} else if (blocksResult.tag === "conflict") {
|
|
73476
|
+
conflicts.push(...blocksResult.fields);
|
|
73477
|
+
}
|
|
73099
73478
|
if (hasMeaningfulValue(data.presentation)) {
|
|
73100
|
-
if (!
|
|
73479
|
+
if (!isRecord22(data.presentation)) {
|
|
73101
73480
|
return { tag: "unmappable", fields: ["data.presentation"] };
|
|
73102
73481
|
}
|
|
73103
73482
|
for (const [key, value] of Object.entries(data.presentation)) {
|
|
@@ -73127,6 +73506,52 @@ function mergeLegacyEventIntoCanonical(legacy, event) {
|
|
|
73127
73506
|
conflicts
|
|
73128
73507
|
};
|
|
73129
73508
|
}
|
|
73509
|
+
function mergeBlocks(input) {
|
|
73510
|
+
if (!hasMeaningfulValue(input.incoming)) {
|
|
73511
|
+
return { tag: "ignored" };
|
|
73512
|
+
}
|
|
73513
|
+
const incoming = input.incoming;
|
|
73514
|
+
const current = input.current;
|
|
73515
|
+
if (!incoming) {
|
|
73516
|
+
return { tag: "ignored" };
|
|
73517
|
+
}
|
|
73518
|
+
if (!current || !hasMeaningfulValue(current)) {
|
|
73519
|
+
return {
|
|
73520
|
+
tag: "changed",
|
|
73521
|
+
event: input.set(incoming),
|
|
73522
|
+
fields: Object.keys(incoming).sort().map((slotKey) => `blocks.${slotKey}`)
|
|
73523
|
+
};
|
|
73524
|
+
}
|
|
73525
|
+
const nextBlocks = { ...current };
|
|
73526
|
+
const changedFields = [];
|
|
73527
|
+
const conflictFields = [];
|
|
73528
|
+
for (const slotKey of Object.keys(incoming).sort()) {
|
|
73529
|
+
const incomingBlocks = incoming[slotKey] ?? [];
|
|
73530
|
+
const currentBlocks = current[slotKey];
|
|
73531
|
+
if (currentBlocks === void 0) {
|
|
73532
|
+
nextBlocks[slotKey] = incomingBlocks;
|
|
73533
|
+
changedFields.push(`blocks.${slotKey}`);
|
|
73534
|
+
continue;
|
|
73535
|
+
}
|
|
73536
|
+
if (!valuesMatch(currentBlocks, incomingBlocks)) {
|
|
73537
|
+
conflictFields.push(`blocks.${slotKey}`);
|
|
73538
|
+
}
|
|
73539
|
+
}
|
|
73540
|
+
if (conflictFields.length > 0) {
|
|
73541
|
+
return {
|
|
73542
|
+
tag: "conflict",
|
|
73543
|
+
fields: conflictFields
|
|
73544
|
+
};
|
|
73545
|
+
}
|
|
73546
|
+
if (changedFields.length === 0) {
|
|
73547
|
+
return { tag: "unchanged" };
|
|
73548
|
+
}
|
|
73549
|
+
return {
|
|
73550
|
+
tag: "changed",
|
|
73551
|
+
event: input.set(nextBlocks),
|
|
73552
|
+
fields: changedFields
|
|
73553
|
+
};
|
|
73554
|
+
}
|
|
73130
73555
|
async function planEventMigration(contentDir) {
|
|
73131
73556
|
const legacyReadResults = await readLegacyEventEntries(contentDir);
|
|
73132
73557
|
const invalidLegacyItems = legacyReadResults.filter((result) => result.tag === "invalid").map((result) => ({
|