@riverbankcms/sdk 0.91.0 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PreviewEditorSidebar-3TT47WCF.mjs → PreviewEditorSidebar-D3PAF7NW.mjs} +3 -3
- package/dist/{PreviewEditorUI-ORCLLUNZ.mjs → PreviewEditorUI-G5JVJEIJ.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-NHTLRNQD.mjs +8 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +13 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +1 -0
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +6 -6
- package/dist/_dts/api/src/common/envelope.d.ts +10 -0
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +4 -4
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +6 -0
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +32 -0
- package/dist/_dts/blocks/src/system/blocks/courses/shared/pricing.d.ts +12 -1
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +12 -0
- package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +4 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +44 -0
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +8 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +8 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +40 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.reserved-fields.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +29 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/components.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +9 -0
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +14 -14
- package/dist/_dts/content-editor/src/controller/useEntrySyncHelpers.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +5 -15
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +46 -0
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +43 -36
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +110 -2
- package/dist/_dts/core/src/branded.d.ts +3 -0
- package/dist/_dts/core/src/event-pricing.d.ts +18 -1
- package/dist/_dts/core/src/money-input.d.ts +34 -4
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +70 -0
- package/dist/_dts/media-core/src/fileAssetCompatibility.d.ts +1 -1
- package/dist/_dts/media-core/src/filePersistence.d.ts +5 -1
- package/dist/_dts/media-core/src/fileStorage.d.ts +1 -0
- package/dist/_dts/media-core/src/fileUploadFinalization.d.ts +29 -1
- package/dist/_dts/media-core/src/index.d.ts +1 -0
- package/dist/_dts/media-core/src/legacyMediaValue.d.ts +11 -0
- package/dist/_dts/media-core/src/videoPrep.d.ts +15 -6
- package/dist/_dts/media-core/src/videoSlotPolicy.d.ts +5 -5
- package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/commands/push/execute/localMediaReporting.d.ts +23 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +54 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/mediaPrep.d.ts +7 -2
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +6 -0
- package/dist/_dts/sdk/src/cli/media/local-sync.d.ts +35 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +23 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-GDT2QGIL.mjs → chunk-A63UXN3P.mjs} +21 -19
- package/dist/{chunk-U5YM4AWE.mjs → chunk-AJZGT6YG.mjs} +1 -1
- package/dist/{chunk-AFPMCLS7.mjs → chunk-AQ6RT6LZ.mjs} +2 -2
- package/dist/{chunk-ZA2S7H34.mjs → chunk-NT76QGIJ.mjs} +98 -1
- package/dist/{chunk-RQUZYSES.mjs → chunk-PCNCETBI.mjs} +1196 -426
- package/dist/{chunk-S3YHJWEU.mjs → chunk-XIK2HYI3.mjs} +7 -7
- package/dist/cli/index.mjs +749 -166
- package/dist/client/{accordion-AFX37652.mjs → accordion-RNQIPG55.mjs} +2 -2
- package/dist/client/{bookingForm-32V5QCOW.mjs → bookingForm-HYEEVRLP.mjs} +89 -14
- package/dist/client/bookings.mjs +243 -17
- package/dist/client/{carousel-TJGQJ7ER.mjs → carousel-W7DQ3YPU.mjs} +3 -3
- package/dist/client/{cart-JUU2JEW4.mjs → cart-PXJ3SXXO.mjs} +7 -7
- package/dist/client/{checkout-RD6BTFX4.mjs → checkout-X3JYSOXI.mjs} +7 -7
- package/dist/client/{chunk-MLBNVN4H.mjs → chunk-6SYGVVWA.mjs} +67 -4
- package/dist/client/{chunk-E6VIWZUG.mjs → chunk-DUOHLWLF.mjs} +3 -3
- package/dist/client/{chunk-6QZIBNGV.mjs → chunk-IXDSXF2D.mjs} +154 -16
- package/dist/client/{chunk-CKXEUWWA.mjs → chunk-J6TMMMXW.mjs} +3 -3
- package/dist/client/{chunk-PMNAV6LO.mjs → chunk-JNE6UI6U.mjs} +7 -6
- package/dist/client/{chunk-ISAUXU5R.mjs → chunk-OLAOAZEO.mjs} +1 -1
- package/dist/client/{chunk-RWYFG625.mjs → chunk-PCHACQEB.mjs} +30 -2
- package/dist/client/{chunk-FMZZHAIR.mjs → chunk-PICR3NTQ.mjs} +52 -5
- package/dist/client/{chunk-6RN62XBV.mjs → chunk-Q47XGAGS.mjs} +1 -1
- package/dist/client/{chunk-WHZQDPBZ.mjs → chunk-TNGL2WJF.mjs} +1 -0
- package/dist/client/{chunk-C4LP6BPG.mjs → chunk-WERRJXNJ.mjs} +1 -1
- package/dist/client/{chunk-RMOFBBNA.mjs → chunk-YYVGSYBO.mjs} +6 -6
- package/dist/client/client.mjs +641 -54
- package/dist/client/{courseRegistration-X63QAIVV.mjs → courseRegistration-QZ67PVHO.mjs} +111 -11
- package/dist/client/{eventCalendar-5T24GCZL.mjs → eventCalendar-V3BDHQNT.mjs} +9 -9
- package/dist/client/{eventCombined-AZVTF22X.mjs → eventCombined-XYFRN2RG.mjs} +9 -9
- package/dist/client/{eventDetails-7GPFNLGF.mjs → eventDetails-TFE5TWKV.mjs} +9 -9
- package/dist/client/{eventListing-QEUMTMUM.mjs → eventListing-IQ6AGWZ6.mjs} +9 -9
- package/dist/client/{eventRegistration-P2EDKCQZ.mjs → eventRegistration-WGJVFKQJ.mjs} +9 -9
- package/dist/client/{form-NUJ7H4IN.mjs → form-6UZY6RUA.mjs} +3 -3
- package/dist/client/{headerSection-JB7LECPL.mjs → headerSection-RSFXY6V3.mjs} +3 -3
- package/dist/client/hooks.mjs +57 -5
- package/dist/client/{locationMap-UEYWUCSW.mjs → locationMap-24FH67I4.mjs} +3 -3
- package/dist/client/{newsletterForm-S2YZQ2X7.mjs → newsletterForm-QVL3MLTN.mjs} +3 -3
- package/dist/client/{productDetail-H5MADGG7.mjs → productDetail-ZDYN3G4T.mjs} +7 -7
- package/dist/client/{productList-DK7YON7H.mjs → productList-4BMJLQHZ.mjs} +7 -7
- package/dist/client/rendering/client.mjs +503 -36
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +583 -39
- package/dist/client/{shop-6PA7RDRJ.mjs → shop-U5C634FF.mjs} +7 -7
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-JP5347OB.mjs → sdk-runtime-VGV46WVB.mjs} +6 -6
- package/dist/server/components.mjs +287 -68
- package/dist/server/config-validation.mjs +58 -5
- package/dist/server/config.mjs +58 -5
- package/dist/server/data.mjs +57 -5
- package/dist/server/index.mjs +104 -29
- package/dist/server/next.mjs +347 -85
- package/dist/server/page-converter.mjs +22 -5
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +287 -68
- package/dist/server/rendering.mjs +287 -68
- package/dist/server/routing.mjs +131 -67
- package/dist/server/server.mjs +189 -94
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +0 -8
|
@@ -57,65 +57,6 @@ function formatKeyAsLabel(key) {
|
|
|
57
57
|
// ../blocks/src/system/manifest/fieldValidation/index.ts
|
|
58
58
|
import { z as z4 } from "zod";
|
|
59
59
|
|
|
60
|
-
// ../blocks/src/system/types/link.ts
|
|
61
|
-
import { z } from "zod";
|
|
62
|
-
var nullableString = z.union([z.string().min(1), z.null()]);
|
|
63
|
-
var resolvedInternalLinkKeys = ["entityId", "entityType", "href", "title", "typeLabel"];
|
|
64
|
-
var internalRouteOnlyLinkSchema = z.object({
|
|
65
|
-
kind: z.literal("internal"),
|
|
66
|
-
routeId: z.string().min(1)
|
|
67
|
-
}).passthrough().superRefine((value, ctx) => {
|
|
68
|
-
const hasResolvedMetadata = resolvedInternalLinkKeys.some((key) => value[key] != null);
|
|
69
|
-
if (!hasResolvedMetadata) return;
|
|
70
|
-
ctx.addIssue({
|
|
71
|
-
code: "custom",
|
|
72
|
-
message: "Internal links with resolved metadata must include entityId, entityType, href, title, and typeLabel"
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
var internalResolvedLinkSchema = z.object({
|
|
76
|
-
kind: z.literal("internal"),
|
|
77
|
-
routeId: z.string().min(1),
|
|
78
|
-
entityId: z.string().min(1),
|
|
79
|
-
entityType: z.enum(["page", "content"]),
|
|
80
|
-
href: z.string().min(1),
|
|
81
|
-
title: z.string().min(1),
|
|
82
|
-
typeLabel: z.string().min(1),
|
|
83
|
-
contentTypeKey: nullableString.optional(),
|
|
84
|
-
contentTypeName: nullableString.optional(),
|
|
85
|
-
updatedAt: nullableString.optional()
|
|
86
|
-
}).passthrough();
|
|
87
|
-
var internalLinkSchema = z.union([
|
|
88
|
-
internalResolvedLinkSchema,
|
|
89
|
-
internalRouteOnlyLinkSchema
|
|
90
|
-
]);
|
|
91
|
-
var externalLinkSchema = z.object({
|
|
92
|
-
kind: z.literal("external"),
|
|
93
|
-
href: z.string().min(1)
|
|
94
|
-
}).passthrough();
|
|
95
|
-
var customLinkSchema = z.object({
|
|
96
|
-
kind: z.literal("url"),
|
|
97
|
-
href: z.string().min(1)
|
|
98
|
-
}).passthrough();
|
|
99
|
-
var pageLinkSchema = z.object({
|
|
100
|
-
kind: z.literal("page"),
|
|
101
|
-
identifier: z.string().min(1)
|
|
102
|
-
}).passthrough();
|
|
103
|
-
var entryLinkSchema = z.object({
|
|
104
|
-
kind: z.literal("entry"),
|
|
105
|
-
contentType: z.string().min(1),
|
|
106
|
-
identifier: z.string().min(1)
|
|
107
|
-
}).passthrough();
|
|
108
|
-
var linkSchema = z.union([
|
|
109
|
-
internalLinkSchema,
|
|
110
|
-
externalLinkSchema,
|
|
111
|
-
customLinkSchema,
|
|
112
|
-
pageLinkSchema,
|
|
113
|
-
entryLinkSchema
|
|
114
|
-
]);
|
|
115
|
-
|
|
116
|
-
// ../blocks/src/system/manifest/schema.ts
|
|
117
|
-
import { z as z3 } from "zod";
|
|
118
|
-
|
|
119
60
|
// ../core/src/result.ts
|
|
120
61
|
function ok(value) {
|
|
121
62
|
return { ok: true, value };
|
|
@@ -126,6 +67,8 @@ function err(error) {
|
|
|
126
67
|
|
|
127
68
|
// ../core/src/branded.ts
|
|
128
69
|
var unsafeAsMediaAssetId = (id) => id;
|
|
70
|
+
var unsafeAsStorageBucketName = (value) => value;
|
|
71
|
+
var unsafeAsStoragePath = (value) => value;
|
|
129
72
|
|
|
130
73
|
// ../core/src/assert-never.ts
|
|
131
74
|
function assertNever(value, message = "Unexpected variant") {
|
|
@@ -180,6 +123,7 @@ function publicEventPricingType(pricing) {
|
|
|
180
123
|
return "free";
|
|
181
124
|
case "single_paid":
|
|
182
125
|
case "ticket_types":
|
|
126
|
+
case "sliding_scale":
|
|
183
127
|
case "course":
|
|
184
128
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
185
129
|
case "external":
|
|
@@ -192,6 +136,7 @@ function publicEventPricingCurrency(pricing) {
|
|
|
192
136
|
case "free_registration":
|
|
193
137
|
case "single_paid":
|
|
194
138
|
case "ticket_types":
|
|
139
|
+
case "sliding_scale":
|
|
195
140
|
return pricing.currency;
|
|
196
141
|
case "course":
|
|
197
142
|
return pricing.display.display.currency;
|
|
@@ -223,6 +168,8 @@ function formatCoursePriceDisplayLabel(display, options) {
|
|
|
223
168
|
return `Course (${formatCurrencyAmount(display.amount, display.currency, options)})`;
|
|
224
169
|
case "from":
|
|
225
170
|
return `Course (From ${formatCurrencyAmount(display.amount, display.currency, options)})`;
|
|
171
|
+
case "range":
|
|
172
|
+
return `Course (${formatCurrencyAmount(display.minAmount, display.currency, options)} - ${formatCurrencyAmount(display.maxAmount, display.currency, options)})`;
|
|
226
173
|
default:
|
|
227
174
|
return assertNever(display);
|
|
228
175
|
}
|
|
@@ -514,6 +461,77 @@ function resolvePlanningDateInput(input = {}) {
|
|
|
514
461
|
return resolvePlanningNowDate(input);
|
|
515
462
|
}
|
|
516
463
|
|
|
464
|
+
// ../media-core/src/fileSafety.ts
|
|
465
|
+
var CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f]/u;
|
|
466
|
+
function containsUnsafePathSegmentCharacter(value) {
|
|
467
|
+
return value.includes("/") || value.includes("\\") || CONTROL_CHARACTER_PATTERN.test(value);
|
|
468
|
+
}
|
|
469
|
+
function isReservedPathSegment(value) {
|
|
470
|
+
return value === "." || value === "..";
|
|
471
|
+
}
|
|
472
|
+
function isUnsafePathSegment(segment) {
|
|
473
|
+
return segment.trim().length === 0 || segment !== segment.trim() || isReservedPathSegment(segment) || containsUnsafePathSegmentCharacter(segment);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// ../media-core/src/fileStorage.ts
|
|
477
|
+
var FILE_STORAGE_BUCKETS = {
|
|
478
|
+
publicSite: unsafeAsStorageBucketName("media"),
|
|
479
|
+
privateSite: unsafeAsStorageBucketName("site-files-private"),
|
|
480
|
+
temporary: unsafeAsStorageBucketName("temp-uploads")
|
|
481
|
+
};
|
|
482
|
+
var PUBLIC_SITE_FILE_STORAGE_BUCKETS = [
|
|
483
|
+
FILE_STORAGE_BUCKETS.publicSite,
|
|
484
|
+
// Existing site logo and font uploads predate the unified file buckets.
|
|
485
|
+
unsafeAsStorageBucketName("site-assets"),
|
|
486
|
+
unsafeAsStorageBucketName("site-fonts")
|
|
487
|
+
];
|
|
488
|
+
var PRIVATE_SITE_FILE_BUCKET_MIME_TYPES = [
|
|
489
|
+
"application/pdf",
|
|
490
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
491
|
+
"text/plain",
|
|
492
|
+
"application/rtf",
|
|
493
|
+
"text/rtf",
|
|
494
|
+
"image/jpeg",
|
|
495
|
+
"image/png",
|
|
496
|
+
"image/webp",
|
|
497
|
+
"image/gif",
|
|
498
|
+
"image/avif",
|
|
499
|
+
"image/heic",
|
|
500
|
+
"image/heif",
|
|
501
|
+
"image/svg+xml",
|
|
502
|
+
"text/csv",
|
|
503
|
+
"application/csv",
|
|
504
|
+
"application/vnd.ms-excel",
|
|
505
|
+
"application/zip",
|
|
506
|
+
"application/x-zip-compressed",
|
|
507
|
+
"audio/mpeg",
|
|
508
|
+
"audio/mp4",
|
|
509
|
+
"audio/wav",
|
|
510
|
+
"audio/x-wav",
|
|
511
|
+
"audio/ogg",
|
|
512
|
+
"audio/webm",
|
|
513
|
+
"audio/flac",
|
|
514
|
+
"video/mp4",
|
|
515
|
+
"video/webm",
|
|
516
|
+
"video/quicktime"
|
|
517
|
+
];
|
|
518
|
+
var TEMP_UPLOAD_BUCKET_MIME_TYPES = [
|
|
519
|
+
...PRIVATE_SITE_FILE_BUCKET_MIME_TYPES,
|
|
520
|
+
"font/woff2",
|
|
521
|
+
"application/font-woff2",
|
|
522
|
+
"application/x-font-woff2",
|
|
523
|
+
"application/octet-stream"
|
|
524
|
+
];
|
|
525
|
+
function parseStoragePath(value) {
|
|
526
|
+
return joinStoragePathSegments(value.split("/"));
|
|
527
|
+
}
|
|
528
|
+
function joinStoragePathSegments(segments) {
|
|
529
|
+
if (segments.some(isUnsafePathSegment)) {
|
|
530
|
+
return err("unsafe-path-segment");
|
|
531
|
+
}
|
|
532
|
+
return ok(unsafeAsStoragePath(segments.join("/")));
|
|
533
|
+
}
|
|
534
|
+
|
|
517
535
|
// ../media-core/src/typeGuards.ts
|
|
518
536
|
function isRecord(value) {
|
|
519
537
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -530,10 +548,10 @@ var RELATIVE_STORAGE_PATH_PREFIXES = [
|
|
|
530
548
|
"imports/"
|
|
531
549
|
];
|
|
532
550
|
function isRelativeDirectImageStoragePath(storagePath) {
|
|
533
|
-
return RELATIVE_STORAGE_PATH_PREFIXES.some((prefix) => storagePath.startsWith(prefix));
|
|
551
|
+
return RELATIVE_STORAGE_PATH_PREFIXES.some((prefix) => storagePath.startsWith(prefix)) && parseStoragePath(storagePath).ok;
|
|
534
552
|
}
|
|
535
553
|
function isSiteScopedDirectImageStoragePath(storagePath) {
|
|
536
|
-
return storagePath.startsWith("sites/");
|
|
554
|
+
return storagePath.startsWith("sites/") && parseStoragePath(storagePath).ok;
|
|
537
555
|
}
|
|
538
556
|
function encodeStoragePath(storagePath) {
|
|
539
557
|
return storagePath.split("/").map((segment) => encodeURIComponent(segment)).join("/");
|
|
@@ -789,6 +807,82 @@ function mediaIdentifierOrFallback(current, fallback2) {
|
|
|
789
807
|
return fallback2 ?? (typeof current === "string" ? current : void 0);
|
|
790
808
|
}
|
|
791
809
|
|
|
810
|
+
// ../media-core/src/legacyMediaValue.ts
|
|
811
|
+
function legacyStringMediaTypeForField(field) {
|
|
812
|
+
if (field.type === "file") {
|
|
813
|
+
return field.fileKinds?.[0] ?? "document";
|
|
814
|
+
}
|
|
815
|
+
return field.mediaKinds?.[0] ?? "image";
|
|
816
|
+
}
|
|
817
|
+
function normalizeLegacyStringMediaValueForField(value, field) {
|
|
818
|
+
if (typeof value !== "string") return value;
|
|
819
|
+
const src = value.trim();
|
|
820
|
+
if (!src) return value;
|
|
821
|
+
return {
|
|
822
|
+
type: legacyStringMediaTypeForField(field),
|
|
823
|
+
src
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// ../blocks/src/system/types/link.ts
|
|
828
|
+
import { z } from "zod";
|
|
829
|
+
var nullableString = z.union([z.string().min(1), z.null()]);
|
|
830
|
+
var resolvedInternalLinkKeys = ["entityId", "entityType", "href", "title", "typeLabel"];
|
|
831
|
+
var internalRouteOnlyLinkSchema = z.object({
|
|
832
|
+
kind: z.literal("internal"),
|
|
833
|
+
routeId: z.string().min(1)
|
|
834
|
+
}).passthrough().superRefine((value, ctx) => {
|
|
835
|
+
const hasResolvedMetadata = resolvedInternalLinkKeys.some((key) => value[key] != null);
|
|
836
|
+
if (!hasResolvedMetadata) return;
|
|
837
|
+
ctx.addIssue({
|
|
838
|
+
code: "custom",
|
|
839
|
+
message: "Internal links with resolved metadata must include entityId, entityType, href, title, and typeLabel"
|
|
840
|
+
});
|
|
841
|
+
});
|
|
842
|
+
var internalResolvedLinkSchema = z.object({
|
|
843
|
+
kind: z.literal("internal"),
|
|
844
|
+
routeId: z.string().min(1),
|
|
845
|
+
entityId: z.string().min(1),
|
|
846
|
+
entityType: z.enum(["page", "content"]),
|
|
847
|
+
href: z.string().min(1),
|
|
848
|
+
title: z.string().min(1),
|
|
849
|
+
typeLabel: z.string().min(1),
|
|
850
|
+
contentTypeKey: nullableString.optional(),
|
|
851
|
+
contentTypeName: nullableString.optional(),
|
|
852
|
+
updatedAt: nullableString.optional()
|
|
853
|
+
}).passthrough();
|
|
854
|
+
var internalLinkSchema = z.union([
|
|
855
|
+
internalResolvedLinkSchema,
|
|
856
|
+
internalRouteOnlyLinkSchema
|
|
857
|
+
]);
|
|
858
|
+
var externalLinkSchema = z.object({
|
|
859
|
+
kind: z.literal("external"),
|
|
860
|
+
href: z.string().min(1)
|
|
861
|
+
}).passthrough();
|
|
862
|
+
var customLinkSchema = z.object({
|
|
863
|
+
kind: z.literal("url"),
|
|
864
|
+
href: z.string().min(1)
|
|
865
|
+
}).passthrough();
|
|
866
|
+
var pageLinkSchema = z.object({
|
|
867
|
+
kind: z.literal("page"),
|
|
868
|
+
identifier: z.string().min(1)
|
|
869
|
+
}).passthrough();
|
|
870
|
+
var entryLinkSchema = z.object({
|
|
871
|
+
kind: z.literal("entry"),
|
|
872
|
+
contentType: z.string().min(1),
|
|
873
|
+
identifier: z.string().min(1)
|
|
874
|
+
}).passthrough();
|
|
875
|
+
var linkSchema = z.union([
|
|
876
|
+
internalLinkSchema,
|
|
877
|
+
externalLinkSchema,
|
|
878
|
+
customLinkSchema,
|
|
879
|
+
pageLinkSchema,
|
|
880
|
+
entryLinkSchema
|
|
881
|
+
]);
|
|
882
|
+
|
|
883
|
+
// ../blocks/src/system/manifest/schema.ts
|
|
884
|
+
import { z as z3 } from "zod";
|
|
885
|
+
|
|
792
886
|
// ../blocks/src/system/node/schema.ts
|
|
793
887
|
import { z as z2 } from "zod";
|
|
794
888
|
var transformStepSchema = z2.object({
|
|
@@ -2549,7 +2643,10 @@ function deriveFieldValidationPlan(field, path = [field.id]) {
|
|
|
2549
2643
|
return makePlan("richText", "object", field, path, required, commonConstraints(required, { kind: "richTextDoc" }));
|
|
2550
2644
|
case "media":
|
|
2551
2645
|
case "file":
|
|
2552
|
-
return
|
|
2646
|
+
return {
|
|
2647
|
+
...makePlan("media", "object", field, path, required, commonConstraints(required, { kind: "mediaObject" })),
|
|
2648
|
+
legacyStringType: legacyStringMediaTypeForField(field)
|
|
2649
|
+
};
|
|
2553
2650
|
case "link":
|
|
2554
2651
|
return makePlan("link", "object", field, path, required, commonConstraints(required, { kind: "linkObject" }));
|
|
2555
2652
|
case "boolean":
|
|
@@ -2734,15 +2831,23 @@ function normalizeFieldValue(plan, value, ctx) {
|
|
|
2734
2831
|
return normalizeRepeaterItems(plan, value, ctx);
|
|
2735
2832
|
case "boolean":
|
|
2736
2833
|
case "richText":
|
|
2737
|
-
case "media":
|
|
2738
2834
|
case "link":
|
|
2739
2835
|
case "select":
|
|
2740
2836
|
case "passthrough":
|
|
2741
2837
|
return value;
|
|
2838
|
+
case "media":
|
|
2839
|
+
return normalizeMediaInput(plan, value);
|
|
2742
2840
|
default:
|
|
2743
2841
|
return assertNever2(plan);
|
|
2744
2842
|
}
|
|
2745
2843
|
}
|
|
2844
|
+
function normalizeMediaInput(plan, value) {
|
|
2845
|
+
return normalizeLegacyStringMediaValueForField(value, {
|
|
2846
|
+
type: plan.fieldType,
|
|
2847
|
+
mediaKinds: plan.fieldType === "media" ? [plan.legacyStringType] : void 0,
|
|
2848
|
+
fileKinds: plan.fieldType === "file" ? [plan.legacyStringType] : void 0
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2746
2851
|
function normalizeObjectChildren(children, value, ctx) {
|
|
2747
2852
|
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
2748
2853
|
const normalized = {
|
|
@@ -3006,6 +3111,21 @@ function fieldPlanToZod(plan, options = {}) {
|
|
|
3006
3111
|
}
|
|
3007
3112
|
});
|
|
3008
3113
|
}
|
|
3114
|
+
function fieldPresenceForPlan(plan) {
|
|
3115
|
+
return plan.required ? { kind: "required" } : { kind: "optional" };
|
|
3116
|
+
}
|
|
3117
|
+
function fieldPlanToObjectPropertyZod(plan, options = {}) {
|
|
3118
|
+
const schema = fieldPlanToZod(plan, options);
|
|
3119
|
+
const presence = fieldPresenceForPlan(plan);
|
|
3120
|
+
switch (presence.kind) {
|
|
3121
|
+
case "required":
|
|
3122
|
+
return schema;
|
|
3123
|
+
case "optional":
|
|
3124
|
+
return schema.optional();
|
|
3125
|
+
default:
|
|
3126
|
+
return assertNever2(presence);
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3009
3129
|
function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
3010
3130
|
const message = fieldIssueToMessage(validationIssue);
|
|
3011
3131
|
const path = relativeZodIssuePath(validationIssue.path, rootPath);
|
|
@@ -3218,7 +3338,7 @@ function createManifestValidator(manifestOrFields, options = {}) {
|
|
|
3218
3338
|
function deriveContentZodFromPlans(plans, options) {
|
|
3219
3339
|
const shape = {};
|
|
3220
3340
|
for (const plan of plans) {
|
|
3221
|
-
shape[plan.fieldId] =
|
|
3341
|
+
shape[plan.fieldId] = fieldPlanToObjectPropertyZod(plan, options);
|
|
3222
3342
|
}
|
|
3223
3343
|
return z5.object(shape).catchall(z5.unknown()).passthrough();
|
|
3224
3344
|
}
|
|
@@ -26327,9 +26447,12 @@ var coursePricingOptionSchema = z43.object({
|
|
|
26327
26447
|
});
|
|
26328
26448
|
var coursePricingSchema = z43.object({
|
|
26329
26449
|
bookingRequirement: z43.enum(["none", "required"]),
|
|
26330
|
-
pricingStrategy: z43.enum(["free", "single", "tiered"]),
|
|
26450
|
+
pricingStrategy: z43.enum(["free", "single", "tiered", "sliding_scale"]),
|
|
26331
26451
|
currency: z43.string(),
|
|
26332
26452
|
singlePriceAmount: z43.number().nullable(),
|
|
26453
|
+
slidingMinAmount: z43.number().nullable().optional(),
|
|
26454
|
+
slidingMaxAmount: z43.number().nullable().optional(),
|
|
26455
|
+
slidingSuggestedAmount: z43.number().nullable().optional(),
|
|
26333
26456
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
26334
26457
|
options: z43.array(coursePricingOptionSchema)
|
|
26335
26458
|
});
|
|
@@ -26483,6 +26606,19 @@ var publicEventPricingSchema = z44.discriminatedUnion("kind", [
|
|
|
26483
26606
|
ticketTypes: z44.array(publicEventTicketTypeSchema),
|
|
26484
26607
|
display: publicEventTicketTypePriceDisplaySchema
|
|
26485
26608
|
}),
|
|
26609
|
+
z44.object({
|
|
26610
|
+
kind: z44.literal("sliding_scale"),
|
|
26611
|
+
minAmount: z44.number(),
|
|
26612
|
+
maxAmount: z44.number(),
|
|
26613
|
+
suggestedAmount: z44.number().nullable(),
|
|
26614
|
+
currency: z44.string(),
|
|
26615
|
+
display: z44.object({
|
|
26616
|
+
kind: z44.literal("range"),
|
|
26617
|
+
minAmount: z44.number(),
|
|
26618
|
+
maxAmount: z44.number(),
|
|
26619
|
+
currency: z44.string()
|
|
26620
|
+
})
|
|
26621
|
+
}),
|
|
26486
26622
|
z44.object({
|
|
26487
26623
|
kind: z44.literal("course"),
|
|
26488
26624
|
display: z44.object({ kind: z44.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
@@ -26899,7 +27035,7 @@ function isRecord6(value) {
|
|
|
26899
27035
|
}
|
|
26900
27036
|
function isPublicEventPricing(value) {
|
|
26901
27037
|
if (!isRecord6(value) || typeof value.kind !== "string") return false;
|
|
26902
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
27038
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "sliding_scale" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
26903
27039
|
}
|
|
26904
27040
|
function isPublicEventTicketType(value) {
|
|
26905
27041
|
return isRecord6(value) && typeof value.id === "string";
|
|
@@ -27516,7 +27652,9 @@ function getSelectableCoursePricingOptionsForNow(course, now) {
|
|
|
27516
27652
|
return left.name.localeCompare(right.name);
|
|
27517
27653
|
});
|
|
27518
27654
|
}
|
|
27519
|
-
function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {}) {
|
|
27655
|
+
function resolveCoursePricingState(course, selectedPricingOptionId, selectedSlidingAmountOrNowInput, nowInput = {}) {
|
|
27656
|
+
const selectedSlidingAmount = typeof selectedSlidingAmountOrNowInput === "number" || selectedSlidingAmountOrNowInput === null ? selectedSlidingAmountOrNowInput : null;
|
|
27657
|
+
const effectiveNowInput = typeof selectedSlidingAmountOrNowInput === "object" && selectedSlidingAmountOrNowInput !== null ? selectedSlidingAmountOrNowInput : nowInput;
|
|
27520
27658
|
const currency = course.pricing?.currency ?? course.currency;
|
|
27521
27659
|
if (!course.pricing) {
|
|
27522
27660
|
const legacyAmount = course.priceCents ?? 0;
|
|
@@ -27526,6 +27664,8 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
27526
27664
|
selectableOptions: [],
|
|
27527
27665
|
requiresSelection: false,
|
|
27528
27666
|
selectedOption: null,
|
|
27667
|
+
slidingScale: null,
|
|
27668
|
+
selectedSlidingAmount: null,
|
|
27529
27669
|
selectedPriceAmount: legacyAmount,
|
|
27530
27670
|
selectedRequiresPayment: legacyAmount > 0,
|
|
27531
27671
|
hasPaidSelection: legacyAmount > 0,
|
|
@@ -27540,6 +27680,8 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
27540
27680
|
selectableOptions: [],
|
|
27541
27681
|
requiresSelection: false,
|
|
27542
27682
|
selectedOption: null,
|
|
27683
|
+
slidingScale: null,
|
|
27684
|
+
selectedSlidingAmount: null,
|
|
27543
27685
|
selectedPriceAmount: 0,
|
|
27544
27686
|
selectedRequiresPayment: false,
|
|
27545
27687
|
hasPaidSelection: false,
|
|
@@ -27553,6 +27695,8 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
27553
27695
|
selectableOptions: [],
|
|
27554
27696
|
requiresSelection: false,
|
|
27555
27697
|
selectedOption: null,
|
|
27698
|
+
slidingScale: null,
|
|
27699
|
+
selectedSlidingAmount: null,
|
|
27556
27700
|
selectedPriceAmount: amount,
|
|
27557
27701
|
selectedRequiresPayment: amount > 0,
|
|
27558
27702
|
hasPaidSelection: amount > 0,
|
|
@@ -27562,7 +27706,7 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
27562
27706
|
case "tiered": {
|
|
27563
27707
|
const selectableOptions = getSelectableCoursePricingOptionsForNow(
|
|
27564
27708
|
course,
|
|
27565
|
-
resolvePlanningDateInput(
|
|
27709
|
+
resolvePlanningDateInput(effectiveNowInput)
|
|
27566
27710
|
);
|
|
27567
27711
|
const selectedOption = (selectedPricingOptionId ? selectableOptions.find((option) => option.id === selectedPricingOptionId) : null) ?? (selectableOptions.length === 1 ? selectableOptions[0] ?? null : null);
|
|
27568
27712
|
const lowestAmount = selectableOptions.reduce((lowest, option) => {
|
|
@@ -27578,12 +27722,51 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
27578
27722
|
selectableOptions,
|
|
27579
27723
|
requiresSelection: selectableOptions.length > 1,
|
|
27580
27724
|
selectedOption,
|
|
27725
|
+
slidingScale: null,
|
|
27726
|
+
selectedSlidingAmount: null,
|
|
27581
27727
|
selectedPriceAmount: selectedOption?.priceAmount ?? null,
|
|
27582
27728
|
selectedRequiresPayment: (selectedOption?.priceAmount ?? 0) > 0,
|
|
27583
27729
|
hasPaidSelection: selectableOptions.some((option) => option.priceAmount > 0),
|
|
27584
27730
|
hasFreeSelection: selectableOptions.some((option) => option.priceAmount === 0)
|
|
27585
27731
|
};
|
|
27586
27732
|
}
|
|
27733
|
+
case "sliding_scale": {
|
|
27734
|
+
const minAmount = course.pricing.slidingMinAmount ?? null;
|
|
27735
|
+
const maxAmount = course.pricing.slidingMaxAmount ?? null;
|
|
27736
|
+
if (minAmount === null || maxAmount === null || minAmount < 0 || maxAmount < minAmount) {
|
|
27737
|
+
return {
|
|
27738
|
+
currency,
|
|
27739
|
+
display: { kind: "unavailable", currency },
|
|
27740
|
+
selectableOptions: [],
|
|
27741
|
+
requiresSelection: true,
|
|
27742
|
+
selectedOption: null,
|
|
27743
|
+
slidingScale: null,
|
|
27744
|
+
selectedSlidingAmount: null,
|
|
27745
|
+
selectedPriceAmount: null,
|
|
27746
|
+
selectedRequiresPayment: false,
|
|
27747
|
+
hasPaidSelection: false,
|
|
27748
|
+
hasFreeSelection: false
|
|
27749
|
+
};
|
|
27750
|
+
}
|
|
27751
|
+
const normalizedSelectedAmount = typeof selectedSlidingAmount === "number" && Number.isFinite(selectedSlidingAmount) ? selectedSlidingAmount : null;
|
|
27752
|
+
return {
|
|
27753
|
+
currency,
|
|
27754
|
+
display: { kind: "range", minAmount, maxAmount, currency },
|
|
27755
|
+
selectableOptions: [],
|
|
27756
|
+
requiresSelection: normalizedSelectedAmount === null,
|
|
27757
|
+
selectedOption: null,
|
|
27758
|
+
slidingScale: {
|
|
27759
|
+
minAmount,
|
|
27760
|
+
maxAmount,
|
|
27761
|
+
suggestedAmount: course.pricing.slidingSuggestedAmount ?? null
|
|
27762
|
+
},
|
|
27763
|
+
selectedSlidingAmount: normalizedSelectedAmount,
|
|
27764
|
+
selectedPriceAmount: normalizedSelectedAmount,
|
|
27765
|
+
selectedRequiresPayment: (normalizedSelectedAmount ?? 0) > 0,
|
|
27766
|
+
hasPaidSelection: maxAmount > 0,
|
|
27767
|
+
hasFreeSelection: minAmount === 0
|
|
27768
|
+
};
|
|
27769
|
+
}
|
|
27587
27770
|
}
|
|
27588
27771
|
}
|
|
27589
27772
|
function formatCoursePriceDisplay(display, locale) {
|
|
@@ -40069,6 +40252,7 @@ var bookingServiceSchema = z64.object({
|
|
|
40069
40252
|
title: z64.string(),
|
|
40070
40253
|
description: z64.string().nullable().optional().transform((value) => value ?? void 0),
|
|
40071
40254
|
durationMinutes: z64.number().optional(),
|
|
40255
|
+
pricing: z64.custom().optional(),
|
|
40072
40256
|
priceAmount: z64.number().nullable().optional(),
|
|
40073
40257
|
priceCurrency: z64.string().nullable().optional(),
|
|
40074
40258
|
paymentTerms: blockBookingPaymentTermsSchema.optional(),
|
|
@@ -68216,6 +68400,38 @@ var NAMED_SURFACE_IDS = SURFACE_IDS.filter(
|
|
|
68216
68400
|
(surfaceId) => surfaceId !== DEFAULT_SURFACE_ID
|
|
68217
68401
|
);
|
|
68218
68402
|
|
|
68403
|
+
// ../api/src/common/envelope.ts
|
|
68404
|
+
var API_ERROR_CODES = [
|
|
68405
|
+
"auth:unauthenticated",
|
|
68406
|
+
"auth:token_expired",
|
|
68407
|
+
"auth:token_invalid",
|
|
68408
|
+
"auth:forbidden",
|
|
68409
|
+
"auth:mfa_required",
|
|
68410
|
+
"auth:sudo_required",
|
|
68411
|
+
"auth:insufficient_permissions",
|
|
68412
|
+
"auth:impersonation_restricted",
|
|
68413
|
+
"validation:invalid_input",
|
|
68414
|
+
"validation:missing_field",
|
|
68415
|
+
"validation:invalid_format",
|
|
68416
|
+
"validation:payload_too_large",
|
|
68417
|
+
"resource:not_found",
|
|
68418
|
+
"resource:already_exists",
|
|
68419
|
+
"resource:conflict",
|
|
68420
|
+
"resource:gone",
|
|
68421
|
+
"rate_limit:exceeded",
|
|
68422
|
+
"billing:payment_required",
|
|
68423
|
+
"billing:plan_limit_exceeded",
|
|
68424
|
+
"billing:pass_redemption_failed",
|
|
68425
|
+
"server:internal_error",
|
|
68426
|
+
"server:unavailable",
|
|
68427
|
+
"external:service_error",
|
|
68428
|
+
"external:registrar_orphaned_contact_profile",
|
|
68429
|
+
"network:connection_error",
|
|
68430
|
+
"network:timeout",
|
|
68431
|
+
"network:dns_error"
|
|
68432
|
+
];
|
|
68433
|
+
var API_ERROR_CODE_SET = new Set(API_ERROR_CODES);
|
|
68434
|
+
|
|
68219
68435
|
// ../api/src/customerMembershipOutcomes.ts
|
|
68220
68436
|
var CANONICAL_REFUND_CONFLICT_CODES = [
|
|
68221
68437
|
"already_refunded",
|
|
@@ -68225,6 +68441,7 @@ var CANONICAL_REFUND_CONFLICT_CODES = [
|
|
|
68225
68441
|
];
|
|
68226
68442
|
var CANONICAL_REFUND_PLANNER_ERROR_CODES = [
|
|
68227
68443
|
...CANONICAL_REFUND_CONFLICT_CODES,
|
|
68444
|
+
"invalid_amount",
|
|
68228
68445
|
"amount_exceeds_remaining",
|
|
68229
68446
|
"pass_revoke_requires_full_refund",
|
|
68230
68447
|
"refund_failed"
|
|
@@ -68251,6 +68468,7 @@ var CUSTOMER_MEMBERSHIP_PAYMENT_REFUND_FAILED_CODES = [
|
|
|
68251
68468
|
// ../api/src/bookingRefundOutcomes.ts
|
|
68252
68469
|
var STANDARD_LINE_ITEM_REFUND_INVALID_CODES = [
|
|
68253
68470
|
"missing_amount",
|
|
68471
|
+
"invalid_amount",
|
|
68254
68472
|
"amount_exceeds_remaining",
|
|
68255
68473
|
"credit_refunds_disabled",
|
|
68256
68474
|
"missing_credit_customer",
|
|
@@ -68265,6 +68483,7 @@ var EVENT_ATTENDEE_REFUND_INVALID_CODES = [
|
|
|
68265
68483
|
var MANAGED_PRODUCT_REFUND_INVALID_CODES = [
|
|
68266
68484
|
"credit_refunds_disabled",
|
|
68267
68485
|
"not_refundable",
|
|
68486
|
+
"invalid_amount",
|
|
68268
68487
|
"amount_exceeds_remaining"
|
|
68269
68488
|
];
|
|
68270
68489
|
var CUSTOMER_PASS_REFUND_INVALID_CODES = [
|