@riverbankcms/sdk 0.90.1 → 0.92.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-FNFRVSIM.mjs → PreviewEditorSidebar-3CI5MKV3.mjs} +3 -3
- package/dist/{PreviewEditorUI-3WXJFQXG.mjs → PreviewEditorUI-DKEP636I.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-BRGRDQFH.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/customerMembershipOutcomes.d.ts +4 -4
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +6 -0
- 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 +24 -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-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/core/src/string.d.ts +12 -0
- 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/videoPrep.d.ts +15 -6
- package/dist/_dts/media-core/src/videoSlotPolicy.d.ts +5 -5
- 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/cli/sync/validation.d.ts +2 -2
- 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-SYYJZPKU.mjs → chunk-6D7PLF4M.mjs} +2 -2
- package/dist/{chunk-CR2VX432.mjs → chunk-I6EOKV6B.mjs} +568 -76
- package/dist/{chunk-FA6LVZ7C.mjs → chunk-LERKJM3E.mjs} +7 -7
- package/dist/{chunk-UG7I7S7W.mjs → chunk-U5YM4AWE.mjs} +1 -1
- package/dist/{chunk-H6TT5ZXI.mjs → chunk-UOMTCHZD.mjs} +1 -1
- package/dist/{chunk-BOQXMCSP.mjs → chunk-ZA2S7H34.mjs} +3 -3
- package/dist/cli/index.mjs +755 -414
- package/dist/cli/init-docs/content/workflow-add-block.md +48 -0
- package/dist/cli/init-docs/content/workflow-custom-block.md +10 -0
- package/dist/client/{accordion-4K7VGZ3I.mjs → accordion-BUDH2G3S.mjs} +2 -2
- package/dist/client/{bookingForm-3QXA3CIS.mjs → bookingForm-NQMCELVB.mjs} +90 -15
- package/dist/client/bookings.mjs +259 -32
- package/dist/client/{carousel-BEJKNGQ7.mjs → carousel-ONCEW6IJ.mjs} +3 -3
- package/dist/client/{cart-44BBM6XG.mjs → cart-V2TCK2GI.mjs} +7 -7
- package/dist/client/{checkout-THMHEYKF.mjs → checkout-ZI7SWNCS.mjs} +7 -7
- package/dist/client/{chunk-PEDNDLPB.mjs → chunk-AUMRQ242.mjs} +52 -5
- package/dist/client/{chunk-EJBHK74Y.mjs → chunk-B5UC2D6X.mjs} +7 -6
- package/dist/client/{chunk-DQIRKNZE.mjs → chunk-ERQDHUS2.mjs} +1 -1
- package/dist/client/{chunk-3H5CLFKT.mjs → chunk-GH6IIOOE.mjs} +39 -10
- package/dist/client/{chunk-ZIAF2DA4.mjs → chunk-HQWIJLYN.mjs} +1 -1
- package/dist/client/{chunk-4COPESPO.mjs → chunk-JXY6NHG6.mjs} +6 -6
- package/dist/client/{chunk-JV7ZNAOU.mjs → chunk-KXYEKEV6.mjs} +155 -17
- package/dist/client/{chunk-HIHOQGIP.mjs → chunk-LJCX6V7Q.mjs} +9 -9
- package/dist/client/{chunk-5AJIMWKS.mjs → chunk-N2WJPTF7.mjs} +3 -3
- package/dist/client/{chunk-KNTLBQ3N.mjs → chunk-QQNVQ62W.mjs} +1 -1
- package/dist/client/{chunk-B4H6QMPY.mjs → chunk-R3CZQLXF.mjs} +73 -8
- package/dist/client/{chunk-WHZQDPBZ.mjs → chunk-TNGL2WJF.mjs} +1 -0
- package/dist/client/{chunk-SLY6UDAS.mjs → chunk-ZJDBOLX7.mjs} +3 -3
- package/dist/client/client.mjs +548 -68
- package/dist/client/{courseRegistration-URX7RCCK.mjs → courseRegistration-JPWAQ6KM.mjs} +112 -12
- package/dist/client/{eventCalendar-GTENOQCE.mjs → eventCalendar-QDOCHBBV.mjs} +10 -10
- package/dist/client/{eventCombined-EZVB72MF.mjs → eventCombined-ZS2CXSIE.mjs} +10 -10
- package/dist/client/{eventDetails-CH4BJR5Z.mjs → eventDetails-5LOBMPLN.mjs} +10 -10
- package/dist/client/{eventListing-4BVOI5HS.mjs → eventListing-SBGY4I3L.mjs} +10 -10
- package/dist/client/{eventRegistration-37LPIKIE.mjs → eventRegistration-XGPIU3Z2.mjs} +10 -10
- package/dist/client/{form-FX3Y54YK.mjs → form-R7D4LZWW.mjs} +4 -4
- package/dist/client/{headerSection-UOZZGVYL.mjs → headerSection-RRLYUCGC.mjs} +3 -3
- package/dist/client/hooks.mjs +29 -9
- package/dist/client/{locationMap-VSIPKV35.mjs → locationMap-35ZJMRBZ.mjs} +3 -3
- package/dist/client/{newsletterForm-6FRJKNAF.mjs → newsletterForm-MJ2VCFUT.mjs} +4 -4
- package/dist/client/{productDetail-6AHMLXCO.mjs → productDetail-2O7YQNBX.mjs} +7 -7
- package/dist/client/{productList-M2CYIZVH.mjs → productList-FDP5BH7W.mjs} +7 -7
- package/dist/client/rendering/client.mjs +526 -64
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +547 -67
- package/dist/client/{shop-AUOT6GEX.mjs → shop-BGYJ3LDT.mjs} +7 -7
- package/dist/client/spam-protection.mjs +10 -10
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-6GPJNLU6.mjs → sdk-runtime-B3TFXRXZ.mjs} +6 -6
- package/dist/server/components.mjs +179 -18
- package/dist/server/config-validation.mjs +30 -9
- package/dist/server/config.mjs +30 -9
- package/dist/server/data.mjs +29 -9
- package/dist/server/index.mjs +1 -1
- package/dist/server/navigation.mjs +2 -2
- package/dist/server/next.mjs +180 -19
- package/dist/server/page-converter.mjs +24 -7
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +179 -18
- package/dist/server/rendering.mjs +179 -18
- package/dist/server/routing.mjs +43 -19
- package/dist/server/server.mjs +30 -10
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-2UCIMKUB.mjs +0 -8
package/dist/server/next.mjs
CHANGED
|
@@ -6481,6 +6481,8 @@ function err(error) {
|
|
|
6481
6481
|
|
|
6482
6482
|
// ../core/src/branded.ts
|
|
6483
6483
|
var unsafeAsMediaAssetId = (id) => id;
|
|
6484
|
+
var unsafeAsStorageBucketName = (value) => value;
|
|
6485
|
+
var unsafeAsStoragePath = (value) => value;
|
|
6484
6486
|
|
|
6485
6487
|
// ../core/src/assert-never.ts
|
|
6486
6488
|
function assertNever(value, message = "Unexpected variant") {
|
|
@@ -6535,6 +6537,7 @@ function publicEventPricingType(pricing) {
|
|
|
6535
6537
|
return "free";
|
|
6536
6538
|
case "single_paid":
|
|
6537
6539
|
case "ticket_types":
|
|
6540
|
+
case "sliding_scale":
|
|
6538
6541
|
case "course":
|
|
6539
6542
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
6540
6543
|
case "external":
|
|
@@ -6547,6 +6550,7 @@ function publicEventPricingCurrency(pricing) {
|
|
|
6547
6550
|
case "free_registration":
|
|
6548
6551
|
case "single_paid":
|
|
6549
6552
|
case "ticket_types":
|
|
6553
|
+
case "sliding_scale":
|
|
6550
6554
|
return pricing.currency;
|
|
6551
6555
|
case "course":
|
|
6552
6556
|
return pricing.display.display.currency;
|
|
@@ -6578,6 +6582,8 @@ function formatCoursePriceDisplayLabel(display, options) {
|
|
|
6578
6582
|
return `Course (${formatCurrencyAmount(display.amount, display.currency, options)})`;
|
|
6579
6583
|
case "from":
|
|
6580
6584
|
return `Course (From ${formatCurrencyAmount(display.amount, display.currency, options)})`;
|
|
6585
|
+
case "range":
|
|
6586
|
+
return `Course (${formatCurrencyAmount(display.minAmount, display.currency, options)} - ${formatCurrencyAmount(display.maxAmount, display.currency, options)})`;
|
|
6581
6587
|
default:
|
|
6582
6588
|
return assertNever(display);
|
|
6583
6589
|
}
|
|
@@ -6621,11 +6627,11 @@ function isValidTimeZone(timeZone) {
|
|
|
6621
6627
|
}
|
|
6622
6628
|
function getSafeTimeZone(timeZone) {
|
|
6623
6629
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
6624
|
-
return normalized && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
6630
|
+
return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
6625
6631
|
}
|
|
6626
6632
|
function parseStrictBookingTimeZone(timeZone) {
|
|
6627
6633
|
const normalized = timeZone.trim();
|
|
6628
|
-
if (
|
|
6634
|
+
if (normalized.length === 0 || !isValidTimeZone(normalized)) {
|
|
6629
6635
|
return null;
|
|
6630
6636
|
}
|
|
6631
6637
|
return normalized;
|
|
@@ -6702,7 +6708,7 @@ function parseScheduledBookingDateTime(input) {
|
|
|
6702
6708
|
try {
|
|
6703
6709
|
const startsAt = toUtcIsoDateTimeString(input.startsAt);
|
|
6704
6710
|
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
6705
|
-
if (
|
|
6711
|
+
if (timeZone === null) {
|
|
6706
6712
|
return {
|
|
6707
6713
|
ok: false,
|
|
6708
6714
|
field: "timeZone",
|
|
@@ -6837,10 +6843,10 @@ function normalizeLocationAddressText(value) {
|
|
|
6837
6843
|
return null;
|
|
6838
6844
|
}
|
|
6839
6845
|
const trimmed = value.trim();
|
|
6840
|
-
return trimmed ? trimmed : null;
|
|
6846
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
6841
6847
|
}
|
|
6842
6848
|
function hasLocationCoordinates(value) {
|
|
6843
|
-
return typeof value
|
|
6849
|
+
return value != null && typeof value.lat === "number" && typeof value.lng === "number";
|
|
6844
6850
|
}
|
|
6845
6851
|
function toLocationCoordinates(value) {
|
|
6846
6852
|
if (!hasLocationCoordinates(value)) {
|
|
@@ -7087,6 +7093,77 @@ var linkSchema = z3.union([
|
|
|
7087
7093
|
// ../blocks/src/system/manifest/schema.ts
|
|
7088
7094
|
import { z as z5 } from "zod";
|
|
7089
7095
|
|
|
7096
|
+
// ../media-core/src/fileSafety.ts
|
|
7097
|
+
var CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f]/u;
|
|
7098
|
+
function containsUnsafePathSegmentCharacter(value) {
|
|
7099
|
+
return value.includes("/") || value.includes("\\") || CONTROL_CHARACTER_PATTERN.test(value);
|
|
7100
|
+
}
|
|
7101
|
+
function isReservedPathSegment(value) {
|
|
7102
|
+
return value === "." || value === "..";
|
|
7103
|
+
}
|
|
7104
|
+
function isUnsafePathSegment(segment) {
|
|
7105
|
+
return segment.trim().length === 0 || segment !== segment.trim() || isReservedPathSegment(segment) || containsUnsafePathSegmentCharacter(segment);
|
|
7106
|
+
}
|
|
7107
|
+
|
|
7108
|
+
// ../media-core/src/fileStorage.ts
|
|
7109
|
+
var FILE_STORAGE_BUCKETS = {
|
|
7110
|
+
publicSite: unsafeAsStorageBucketName("media"),
|
|
7111
|
+
privateSite: unsafeAsStorageBucketName("site-files-private"),
|
|
7112
|
+
temporary: unsafeAsStorageBucketName("temp-uploads")
|
|
7113
|
+
};
|
|
7114
|
+
var PUBLIC_SITE_FILE_STORAGE_BUCKETS = [
|
|
7115
|
+
FILE_STORAGE_BUCKETS.publicSite,
|
|
7116
|
+
// Existing site logo and font uploads predate the unified file buckets.
|
|
7117
|
+
unsafeAsStorageBucketName("site-assets"),
|
|
7118
|
+
unsafeAsStorageBucketName("site-fonts")
|
|
7119
|
+
];
|
|
7120
|
+
var PRIVATE_SITE_FILE_BUCKET_MIME_TYPES = [
|
|
7121
|
+
"application/pdf",
|
|
7122
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
7123
|
+
"text/plain",
|
|
7124
|
+
"application/rtf",
|
|
7125
|
+
"text/rtf",
|
|
7126
|
+
"image/jpeg",
|
|
7127
|
+
"image/png",
|
|
7128
|
+
"image/webp",
|
|
7129
|
+
"image/gif",
|
|
7130
|
+
"image/avif",
|
|
7131
|
+
"image/heic",
|
|
7132
|
+
"image/heif",
|
|
7133
|
+
"image/svg+xml",
|
|
7134
|
+
"text/csv",
|
|
7135
|
+
"application/csv",
|
|
7136
|
+
"application/vnd.ms-excel",
|
|
7137
|
+
"application/zip",
|
|
7138
|
+
"application/x-zip-compressed",
|
|
7139
|
+
"audio/mpeg",
|
|
7140
|
+
"audio/mp4",
|
|
7141
|
+
"audio/wav",
|
|
7142
|
+
"audio/x-wav",
|
|
7143
|
+
"audio/ogg",
|
|
7144
|
+
"audio/webm",
|
|
7145
|
+
"audio/flac",
|
|
7146
|
+
"video/mp4",
|
|
7147
|
+
"video/webm",
|
|
7148
|
+
"video/quicktime"
|
|
7149
|
+
];
|
|
7150
|
+
var TEMP_UPLOAD_BUCKET_MIME_TYPES = [
|
|
7151
|
+
...PRIVATE_SITE_FILE_BUCKET_MIME_TYPES,
|
|
7152
|
+
"font/woff2",
|
|
7153
|
+
"application/font-woff2",
|
|
7154
|
+
"application/x-font-woff2",
|
|
7155
|
+
"application/octet-stream"
|
|
7156
|
+
];
|
|
7157
|
+
function parseStoragePath(value) {
|
|
7158
|
+
return joinStoragePathSegments(value.split("/"));
|
|
7159
|
+
}
|
|
7160
|
+
function joinStoragePathSegments(segments) {
|
|
7161
|
+
if (segments.some(isUnsafePathSegment)) {
|
|
7162
|
+
return err("unsafe-path-segment");
|
|
7163
|
+
}
|
|
7164
|
+
return ok(unsafeAsStoragePath(segments.join("/")));
|
|
7165
|
+
}
|
|
7166
|
+
|
|
7090
7167
|
// ../media-core/src/typeGuards.ts
|
|
7091
7168
|
function isRecord(value) {
|
|
7092
7169
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -7103,10 +7180,10 @@ var RELATIVE_STORAGE_PATH_PREFIXES = [
|
|
|
7103
7180
|
"imports/"
|
|
7104
7181
|
];
|
|
7105
7182
|
function isRelativeDirectImageStoragePath(storagePath) {
|
|
7106
|
-
return RELATIVE_STORAGE_PATH_PREFIXES.some((prefix) => storagePath.startsWith(prefix));
|
|
7183
|
+
return RELATIVE_STORAGE_PATH_PREFIXES.some((prefix) => storagePath.startsWith(prefix)) && parseStoragePath(storagePath).ok;
|
|
7107
7184
|
}
|
|
7108
7185
|
function isSiteScopedDirectImageStoragePath(storagePath) {
|
|
7109
|
-
return storagePath.startsWith("sites/");
|
|
7186
|
+
return storagePath.startsWith("sites/") && parseStoragePath(storagePath).ok;
|
|
7110
7187
|
}
|
|
7111
7188
|
function encodeStoragePath(storagePath) {
|
|
7112
7189
|
return storagePath.split("/").map((segment) => encodeURIComponent(segment)).join("/");
|
|
@@ -9579,6 +9656,21 @@ function fieldPlanToZod(plan, options = {}) {
|
|
|
9579
9656
|
}
|
|
9580
9657
|
});
|
|
9581
9658
|
}
|
|
9659
|
+
function fieldPresenceForPlan(plan) {
|
|
9660
|
+
return plan.required ? { kind: "required" } : { kind: "optional" };
|
|
9661
|
+
}
|
|
9662
|
+
function fieldPlanToObjectPropertyZod(plan, options = {}) {
|
|
9663
|
+
const schema = fieldPlanToZod(plan, options);
|
|
9664
|
+
const presence = fieldPresenceForPlan(plan);
|
|
9665
|
+
switch (presence.kind) {
|
|
9666
|
+
case "required":
|
|
9667
|
+
return schema;
|
|
9668
|
+
case "optional":
|
|
9669
|
+
return schema.optional();
|
|
9670
|
+
default:
|
|
9671
|
+
return assertNever2(presence);
|
|
9672
|
+
}
|
|
9673
|
+
}
|
|
9582
9674
|
function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
9583
9675
|
const message = fieldIssueToMessage(validationIssue);
|
|
9584
9676
|
const path = relativeZodIssuePath(validationIssue.path, rootPath);
|
|
@@ -9791,7 +9883,7 @@ function createManifestValidator(manifestOrFields, options = {}) {
|
|
|
9791
9883
|
function deriveContentZodFromPlans(plans, options) {
|
|
9792
9884
|
const shape = {};
|
|
9793
9885
|
for (const plan of plans) {
|
|
9794
|
-
shape[plan.fieldId] =
|
|
9886
|
+
shape[plan.fieldId] = fieldPlanToObjectPropertyZod(plan, options);
|
|
9795
9887
|
}
|
|
9796
9888
|
return z7.object(shape).catchall(z7.unknown()).passthrough();
|
|
9797
9889
|
}
|
|
@@ -32900,9 +32992,12 @@ var coursePricingOptionSchema = z45.object({
|
|
|
32900
32992
|
});
|
|
32901
32993
|
var coursePricingSchema = z45.object({
|
|
32902
32994
|
bookingRequirement: z45.enum(["none", "required"]),
|
|
32903
|
-
pricingStrategy: z45.enum(["free", "single", "tiered"]),
|
|
32995
|
+
pricingStrategy: z45.enum(["free", "single", "tiered", "sliding_scale"]),
|
|
32904
32996
|
currency: z45.string(),
|
|
32905
32997
|
singlePriceAmount: z45.number().nullable(),
|
|
32998
|
+
slidingMinAmount: z45.number().nullable().optional(),
|
|
32999
|
+
slidingMaxAmount: z45.number().nullable().optional(),
|
|
33000
|
+
slidingSuggestedAmount: z45.number().nullable().optional(),
|
|
32906
33001
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
32907
33002
|
options: z45.array(coursePricingOptionSchema)
|
|
32908
33003
|
});
|
|
@@ -33056,6 +33151,19 @@ var publicEventPricingSchema = z46.discriminatedUnion("kind", [
|
|
|
33056
33151
|
ticketTypes: z46.array(publicEventTicketTypeSchema),
|
|
33057
33152
|
display: publicEventTicketTypePriceDisplaySchema
|
|
33058
33153
|
}),
|
|
33154
|
+
z46.object({
|
|
33155
|
+
kind: z46.literal("sliding_scale"),
|
|
33156
|
+
minAmount: z46.number(),
|
|
33157
|
+
maxAmount: z46.number(),
|
|
33158
|
+
suggestedAmount: z46.number().nullable(),
|
|
33159
|
+
currency: z46.string(),
|
|
33160
|
+
display: z46.object({
|
|
33161
|
+
kind: z46.literal("range"),
|
|
33162
|
+
minAmount: z46.number(),
|
|
33163
|
+
maxAmount: z46.number(),
|
|
33164
|
+
currency: z46.string()
|
|
33165
|
+
})
|
|
33166
|
+
}),
|
|
33059
33167
|
z46.object({
|
|
33060
33168
|
kind: z46.literal("course"),
|
|
33061
33169
|
display: z46.object({ kind: z46.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
@@ -33472,7 +33580,7 @@ function isRecord6(value) {
|
|
|
33472
33580
|
}
|
|
33473
33581
|
function isPublicEventPricing(value) {
|
|
33474
33582
|
if (!isRecord6(value) || typeof value.kind !== "string") return false;
|
|
33475
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
33583
|
+
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";
|
|
33476
33584
|
}
|
|
33477
33585
|
function isPublicEventTicketType(value) {
|
|
33478
33586
|
return isRecord6(value) && typeof value.id === "string";
|
|
@@ -34089,7 +34197,9 @@ function getSelectableCoursePricingOptionsForNow(course, now) {
|
|
|
34089
34197
|
return left.name.localeCompare(right.name);
|
|
34090
34198
|
});
|
|
34091
34199
|
}
|
|
34092
|
-
function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {}) {
|
|
34200
|
+
function resolveCoursePricingState(course, selectedPricingOptionId, selectedSlidingAmountOrNowInput, nowInput = {}) {
|
|
34201
|
+
const selectedSlidingAmount = typeof selectedSlidingAmountOrNowInput === "number" || selectedSlidingAmountOrNowInput === null ? selectedSlidingAmountOrNowInput : null;
|
|
34202
|
+
const effectiveNowInput = typeof selectedSlidingAmountOrNowInput === "object" && selectedSlidingAmountOrNowInput !== null ? selectedSlidingAmountOrNowInput : nowInput;
|
|
34093
34203
|
const currency = course.pricing?.currency ?? course.currency;
|
|
34094
34204
|
if (!course.pricing) {
|
|
34095
34205
|
const legacyAmount = course.priceCents ?? 0;
|
|
@@ -34099,6 +34209,8 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
34099
34209
|
selectableOptions: [],
|
|
34100
34210
|
requiresSelection: false,
|
|
34101
34211
|
selectedOption: null,
|
|
34212
|
+
slidingScale: null,
|
|
34213
|
+
selectedSlidingAmount: null,
|
|
34102
34214
|
selectedPriceAmount: legacyAmount,
|
|
34103
34215
|
selectedRequiresPayment: legacyAmount > 0,
|
|
34104
34216
|
hasPaidSelection: legacyAmount > 0,
|
|
@@ -34113,6 +34225,8 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
34113
34225
|
selectableOptions: [],
|
|
34114
34226
|
requiresSelection: false,
|
|
34115
34227
|
selectedOption: null,
|
|
34228
|
+
slidingScale: null,
|
|
34229
|
+
selectedSlidingAmount: null,
|
|
34116
34230
|
selectedPriceAmount: 0,
|
|
34117
34231
|
selectedRequiresPayment: false,
|
|
34118
34232
|
hasPaidSelection: false,
|
|
@@ -34126,6 +34240,8 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
34126
34240
|
selectableOptions: [],
|
|
34127
34241
|
requiresSelection: false,
|
|
34128
34242
|
selectedOption: null,
|
|
34243
|
+
slidingScale: null,
|
|
34244
|
+
selectedSlidingAmount: null,
|
|
34129
34245
|
selectedPriceAmount: amount,
|
|
34130
34246
|
selectedRequiresPayment: amount > 0,
|
|
34131
34247
|
hasPaidSelection: amount > 0,
|
|
@@ -34135,7 +34251,7 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
34135
34251
|
case "tiered": {
|
|
34136
34252
|
const selectableOptions = getSelectableCoursePricingOptionsForNow(
|
|
34137
34253
|
course,
|
|
34138
|
-
resolvePlanningDateInput(
|
|
34254
|
+
resolvePlanningDateInput(effectiveNowInput)
|
|
34139
34255
|
);
|
|
34140
34256
|
const selectedOption = (selectedPricingOptionId ? selectableOptions.find((option) => option.id === selectedPricingOptionId) : null) ?? (selectableOptions.length === 1 ? selectableOptions[0] ?? null : null);
|
|
34141
34257
|
const lowestAmount = selectableOptions.reduce((lowest, option) => {
|
|
@@ -34151,12 +34267,51 @@ function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {
|
|
|
34151
34267
|
selectableOptions,
|
|
34152
34268
|
requiresSelection: selectableOptions.length > 1,
|
|
34153
34269
|
selectedOption,
|
|
34270
|
+
slidingScale: null,
|
|
34271
|
+
selectedSlidingAmount: null,
|
|
34154
34272
|
selectedPriceAmount: selectedOption?.priceAmount ?? null,
|
|
34155
34273
|
selectedRequiresPayment: (selectedOption?.priceAmount ?? 0) > 0,
|
|
34156
34274
|
hasPaidSelection: selectableOptions.some((option) => option.priceAmount > 0),
|
|
34157
34275
|
hasFreeSelection: selectableOptions.some((option) => option.priceAmount === 0)
|
|
34158
34276
|
};
|
|
34159
34277
|
}
|
|
34278
|
+
case "sliding_scale": {
|
|
34279
|
+
const minAmount = course.pricing.slidingMinAmount ?? null;
|
|
34280
|
+
const maxAmount = course.pricing.slidingMaxAmount ?? null;
|
|
34281
|
+
if (minAmount === null || maxAmount === null || minAmount < 0 || maxAmount < minAmount) {
|
|
34282
|
+
return {
|
|
34283
|
+
currency,
|
|
34284
|
+
display: { kind: "unavailable", currency },
|
|
34285
|
+
selectableOptions: [],
|
|
34286
|
+
requiresSelection: true,
|
|
34287
|
+
selectedOption: null,
|
|
34288
|
+
slidingScale: null,
|
|
34289
|
+
selectedSlidingAmount: null,
|
|
34290
|
+
selectedPriceAmount: null,
|
|
34291
|
+
selectedRequiresPayment: false,
|
|
34292
|
+
hasPaidSelection: false,
|
|
34293
|
+
hasFreeSelection: false
|
|
34294
|
+
};
|
|
34295
|
+
}
|
|
34296
|
+
const normalizedSelectedAmount = typeof selectedSlidingAmount === "number" && Number.isFinite(selectedSlidingAmount) ? selectedSlidingAmount : null;
|
|
34297
|
+
return {
|
|
34298
|
+
currency,
|
|
34299
|
+
display: { kind: "range", minAmount, maxAmount, currency },
|
|
34300
|
+
selectableOptions: [],
|
|
34301
|
+
requiresSelection: normalizedSelectedAmount === null,
|
|
34302
|
+
selectedOption: null,
|
|
34303
|
+
slidingScale: {
|
|
34304
|
+
minAmount,
|
|
34305
|
+
maxAmount,
|
|
34306
|
+
suggestedAmount: course.pricing.slidingSuggestedAmount ?? null
|
|
34307
|
+
},
|
|
34308
|
+
selectedSlidingAmount: normalizedSelectedAmount,
|
|
34309
|
+
selectedPriceAmount: normalizedSelectedAmount,
|
|
34310
|
+
selectedRequiresPayment: (normalizedSelectedAmount ?? 0) > 0,
|
|
34311
|
+
hasPaidSelection: maxAmount > 0,
|
|
34312
|
+
hasFreeSelection: minAmount === 0
|
|
34313
|
+
};
|
|
34314
|
+
}
|
|
34160
34315
|
}
|
|
34161
34316
|
}
|
|
34162
34317
|
function formatCoursePriceDisplay(display, locale) {
|
|
@@ -35083,7 +35238,7 @@ function formatCalendarTitle(viewDate, view, days, monthNames = MONTH_NAMES) {
|
|
|
35083
35238
|
if (view === "week") {
|
|
35084
35239
|
const weekStart = days[0];
|
|
35085
35240
|
const weekEnd = days[6];
|
|
35086
|
-
if (
|
|
35241
|
+
if (weekStart === void 0 || weekEnd === void 0) {
|
|
35087
35242
|
return `${monthNames[viewDate.getMonth()] ?? ""} ${viewDate.getFullYear()}`;
|
|
35088
35243
|
}
|
|
35089
35244
|
const startMonth = monthNames[weekStart.getMonth()] ?? "";
|
|
@@ -35189,7 +35344,9 @@ function getLocalDateKey(isoTimestamp, timeZone) {
|
|
|
35189
35344
|
const year = parts.find((part) => part.type === "year")?.value;
|
|
35190
35345
|
const month = parts.find((part) => part.type === "month")?.value;
|
|
35191
35346
|
const day = parts.find((part) => part.type === "day")?.value;
|
|
35192
|
-
if (
|
|
35347
|
+
if (year === void 0 || year.length === 0) return null;
|
|
35348
|
+
if (month === void 0 || month.length === 0) return null;
|
|
35349
|
+
if (day === void 0 || day.length === 0) return null;
|
|
35193
35350
|
return `${year}-${month}-${day}`;
|
|
35194
35351
|
}
|
|
35195
35352
|
var validTimeZoneCache = /* @__PURE__ */ new Map();
|
|
@@ -35446,7 +35603,7 @@ function enumerateDateKeys(startDateKey, endDateKey) {
|
|
|
35446
35603
|
}
|
|
35447
35604
|
function parseDateKey(dateKey) {
|
|
35448
35605
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateKey);
|
|
35449
|
-
if (
|
|
35606
|
+
if (match === null) {
|
|
35450
35607
|
throw new Error(`Invalid timetable date key: ${dateKey}`);
|
|
35451
35608
|
}
|
|
35452
35609
|
const [, year, month, day] = match;
|
|
@@ -35466,7 +35623,7 @@ function groupItemsByDate(items, accessors) {
|
|
|
35466
35623
|
const dateKey = getLocalDateKey(startsAt, timeZone);
|
|
35467
35624
|
if (dateKey == null) continue;
|
|
35468
35625
|
const existing = grouped.get(dateKey);
|
|
35469
|
-
if (existing) {
|
|
35626
|
+
if (existing !== void 0) {
|
|
35470
35627
|
existing.push(item);
|
|
35471
35628
|
} else {
|
|
35472
35629
|
grouped.set(dateKey, [item]);
|
|
@@ -44562,11 +44719,11 @@ function extractRouteUpdatedAt(candidate) {
|
|
|
44562
44719
|
}
|
|
44563
44720
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
44564
44721
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
44565
|
-
if (
|
|
44722
|
+
if (routeId === null || routeId.length === 0 || routes === void 0) return null;
|
|
44566
44723
|
const routeEntry = routes[routeId];
|
|
44567
44724
|
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
44568
44725
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
44569
|
-
if (
|
|
44726
|
+
if (href === null) return null;
|
|
44570
44727
|
return {
|
|
44571
44728
|
routeId,
|
|
44572
44729
|
href,
|
|
@@ -46634,6 +46791,7 @@ var bookingServiceSchema = z66.object({
|
|
|
46634
46791
|
title: z66.string(),
|
|
46635
46792
|
description: z66.string().nullable().optional().transform((value) => value ?? void 0),
|
|
46636
46793
|
durationMinutes: z66.number().optional(),
|
|
46794
|
+
pricing: z66.custom().optional(),
|
|
46637
46795
|
priceAmount: z66.number().nullable().optional(),
|
|
46638
46796
|
priceCurrency: z66.string().nullable().optional(),
|
|
46639
46797
|
paymentTerms: blockBookingPaymentTermsSchema.optional(),
|
|
@@ -67806,6 +67964,7 @@ var CANONICAL_REFUND_CONFLICT_CODES = [
|
|
|
67806
67964
|
];
|
|
67807
67965
|
var CANONICAL_REFUND_PLANNER_ERROR_CODES = [
|
|
67808
67966
|
...CANONICAL_REFUND_CONFLICT_CODES,
|
|
67967
|
+
"invalid_amount",
|
|
67809
67968
|
"amount_exceeds_remaining",
|
|
67810
67969
|
"pass_revoke_requires_full_refund",
|
|
67811
67970
|
"refund_failed"
|
|
@@ -67832,6 +67991,7 @@ var CUSTOMER_MEMBERSHIP_PAYMENT_REFUND_FAILED_CODES = [
|
|
|
67832
67991
|
// ../api/src/bookingRefundOutcomes.ts
|
|
67833
67992
|
var STANDARD_LINE_ITEM_REFUND_INVALID_CODES = [
|
|
67834
67993
|
"missing_amount",
|
|
67994
|
+
"invalid_amount",
|
|
67835
67995
|
"amount_exceeds_remaining",
|
|
67836
67996
|
"credit_refunds_disabled",
|
|
67837
67997
|
"missing_credit_customer",
|
|
@@ -67846,6 +68006,7 @@ var EVENT_ATTENDEE_REFUND_INVALID_CODES = [
|
|
|
67846
68006
|
var MANAGED_PRODUCT_REFUND_INVALID_CODES = [
|
|
67847
68007
|
"credit_refunds_disabled",
|
|
67848
68008
|
"not_refundable",
|
|
68009
|
+
"invalid_amount",
|
|
67849
68010
|
"amount_exceeds_remaining"
|
|
67850
68011
|
];
|
|
67851
68012
|
var CUSTOMER_PASS_REFUND_INVALID_CODES = [
|
|
@@ -70877,7 +71038,7 @@ var CircuitOpenError = class extends Error {
|
|
|
70877
71038
|
};
|
|
70878
71039
|
|
|
70879
71040
|
// src/version.ts
|
|
70880
|
-
var SDK_VERSION = "0.
|
|
71041
|
+
var SDK_VERSION = "0.92.0";
|
|
70881
71042
|
|
|
70882
71043
|
// src/next/content-load-failure.ts
|
|
70883
71044
|
var SdkContentLoadError = RiverbankContentLoadError;
|
|
@@ -101,6 +101,7 @@ function publicEventPricingType(pricing) {
|
|
|
101
101
|
return "free";
|
|
102
102
|
case "single_paid":
|
|
103
103
|
case "ticket_types":
|
|
104
|
+
case "sliding_scale":
|
|
104
105
|
case "course":
|
|
105
106
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
106
107
|
case "external":
|
|
@@ -136,11 +137,11 @@ function isValidTimeZone(timeZone) {
|
|
|
136
137
|
}
|
|
137
138
|
function getSafeTimeZone(timeZone) {
|
|
138
139
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
139
|
-
return normalized && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
140
|
+
return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
140
141
|
}
|
|
141
142
|
function parseStrictBookingTimeZone(timeZone) {
|
|
142
143
|
const normalized = timeZone.trim();
|
|
143
|
-
if (
|
|
144
|
+
if (normalized.length === 0 || !isValidTimeZone(normalized)) {
|
|
144
145
|
return null;
|
|
145
146
|
}
|
|
146
147
|
return normalized;
|
|
@@ -214,7 +215,7 @@ function parseScheduledBookingDateTime(input) {
|
|
|
214
215
|
try {
|
|
215
216
|
const startsAt = toUtcIsoDateTimeString(input.startsAt);
|
|
216
217
|
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
217
|
-
if (
|
|
218
|
+
if (timeZone === null) {
|
|
218
219
|
return {
|
|
219
220
|
ok: false,
|
|
220
221
|
field: "timeZone",
|
|
@@ -260,10 +261,10 @@ function normalizeLocationAddressText(value) {
|
|
|
260
261
|
return null;
|
|
261
262
|
}
|
|
262
263
|
const trimmed = value.trim();
|
|
263
|
-
return trimmed ? trimmed : null;
|
|
264
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
264
265
|
}
|
|
265
266
|
function hasLocationCoordinates(value) {
|
|
266
|
-
return typeof value
|
|
267
|
+
return value != null && typeof value.lat === "number" && typeof value.lng === "number";
|
|
267
268
|
}
|
|
268
269
|
function toLocationCoordinates(value) {
|
|
269
270
|
if (!hasLocationCoordinates(value)) {
|
|
@@ -19282,9 +19283,12 @@ var coursePricingOptionSchema = z35.object({
|
|
|
19282
19283
|
});
|
|
19283
19284
|
var coursePricingSchema = z35.object({
|
|
19284
19285
|
bookingRequirement: z35.enum(["none", "required"]),
|
|
19285
|
-
pricingStrategy: z35.enum(["free", "single", "tiered"]),
|
|
19286
|
+
pricingStrategy: z35.enum(["free", "single", "tiered", "sliding_scale"]),
|
|
19286
19287
|
currency: z35.string(),
|
|
19287
19288
|
singlePriceAmount: z35.number().nullable(),
|
|
19289
|
+
slidingMinAmount: z35.number().nullable().optional(),
|
|
19290
|
+
slidingMaxAmount: z35.number().nullable().optional(),
|
|
19291
|
+
slidingSuggestedAmount: z35.number().nullable().optional(),
|
|
19288
19292
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
19289
19293
|
options: z35.array(coursePricingOptionSchema)
|
|
19290
19294
|
});
|
|
@@ -19438,6 +19442,19 @@ var publicEventPricingSchema = z36.discriminatedUnion("kind", [
|
|
|
19438
19442
|
ticketTypes: z36.array(publicEventTicketTypeSchema),
|
|
19439
19443
|
display: publicEventTicketTypePriceDisplaySchema
|
|
19440
19444
|
}),
|
|
19445
|
+
z36.object({
|
|
19446
|
+
kind: z36.literal("sliding_scale"),
|
|
19447
|
+
minAmount: z36.number(),
|
|
19448
|
+
maxAmount: z36.number(),
|
|
19449
|
+
suggestedAmount: z36.number().nullable(),
|
|
19450
|
+
currency: z36.string(),
|
|
19451
|
+
display: z36.object({
|
|
19452
|
+
kind: z36.literal("range"),
|
|
19453
|
+
minAmount: z36.number(),
|
|
19454
|
+
maxAmount: z36.number(),
|
|
19455
|
+
currency: z36.string()
|
|
19456
|
+
})
|
|
19457
|
+
}),
|
|
19441
19458
|
z36.object({
|
|
19442
19459
|
kind: z36.literal("course"),
|
|
19443
19460
|
display: z36.object({ kind: z36.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
@@ -19854,7 +19871,7 @@ function isRecord3(value) {
|
|
|
19854
19871
|
}
|
|
19855
19872
|
function isPublicEventPricing(value) {
|
|
19856
19873
|
if (!isRecord3(value) || typeof value.kind !== "string") return false;
|
|
19857
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
19874
|
+
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";
|
|
19858
19875
|
}
|
|
19859
19876
|
function isPublicEventTicketType(value) {
|
|
19860
19877
|
return isRecord3(value) && typeof value.id === "string";
|