@riverbankcms/sdk 0.90.0 → 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/dist/{PreviewEditorSidebar-KVXNF3VW.mjs → PreviewEditorSidebar-FNFRVSIM.mjs} +2 -2
- package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-3WXJFQXG.mjs} +2 -2
- package/dist/SdkPreviewModeRuntime-2UCIMKUB.mjs +8 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
- package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
- package/dist/_dts/api/src/index.d.ts +4 -0
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
- package/dist/_dts/api/src/navigation.d.ts +2 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
- package/dist/_dts/api/src/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +12 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
- package/dist/_dts/core/src/event-pricing.d.ts +12 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-PMBB6MQ7.mjs → chunk-CR2VX432.mjs} +297 -117
- package/dist/{chunk-AEOYWPE4.mjs → chunk-FA6LVZ7C.mjs} +5 -5
- package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-H6TT5ZXI.mjs} +1 -1
- package/dist/{chunk-GSPFFUVB.mjs → chunk-SYYJZPKU.mjs} +1 -1
- package/dist/cli/index.mjs +160 -103
- package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-4K7VGZ3I.mjs} +2 -2
- package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-3QXA3CIS.mjs} +5 -5
- package/dist/client/bookings.mjs +1154 -556
- package/dist/client/{carousel-CVRN6EPP.mjs → carousel-BEJKNGQ7.mjs} +3 -3
- package/dist/client/{cart-IYIBA5CL.mjs → cart-44BBM6XG.mjs} +6 -6
- package/dist/client/{checkout-O3BGM4GS.mjs → checkout-THMHEYKF.mjs} +6 -6
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-3H5CLFKT.mjs} +8 -0
- package/dist/client/{chunk-MFPKS6QS.mjs → chunk-4COPESPO.mjs} +5 -5
- package/dist/client/{chunk-4RTFGHZN.mjs → chunk-5AJIMWKS.mjs} +6 -3
- package/dist/client/{chunk-6DPXDOIL.mjs → chunk-B4H6QMPY.mjs} +93 -22
- package/dist/client/{chunk-VFHZLZAC.mjs → chunk-DQIRKNZE.mjs} +1 -1
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-EJBHK74Y.mjs} +1 -1
- package/dist/client/{chunk-DAS5CIER.mjs → chunk-JV7ZNAOU.mjs} +118 -20
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-KNTLBQ3N.mjs} +1 -1
- package/dist/client/{chunk-Z62JYS5O.mjs → chunk-PEDNDLPB.mjs} +2 -2
- package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-SLY6UDAS.mjs} +2 -2
- package/dist/client/{chunk-D3ETC2SU.mjs → chunk-ZIAF2DA4.mjs} +1 -1
- package/dist/client/client.mjs +272 -83
- package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-URX7RCCK.mjs} +5 -5
- package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-GTENOQCE.mjs} +8 -8
- package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-EZVB72MF.mjs} +8 -8
- package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-CH4BJR5Z.mjs} +8 -8
- package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-4BVOI5HS.mjs} +8 -8
- package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-37LPIKIE.mjs} +8 -8
- package/dist/client/{form-ZS6KX4U2.mjs → form-FX3Y54YK.mjs} +2 -2
- package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-UOZZGVYL.mjs} +3 -3
- package/dist/client/hooks.mjs +86 -35
- package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-VSIPKV35.mjs} +3 -3
- package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-6FRJKNAF.mjs} +2 -2
- package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-6AHMLXCO.mjs} +6 -6
- package/dist/client/{productList-NI72Q62Z.mjs → productList-M2CYIZVH.mjs} +6 -6
- package/dist/client/rendering/client.mjs +231 -42
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +273 -84
- package/dist/client/{shop-3ZQPEWYI.mjs → shop-AUOT6GEX.mjs} +6 -6
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-6GPJNLU6.mjs} +4 -4
- package/dist/server/components.mjs +136 -58
- package/dist/server/config-validation.mjs +78 -27
- package/dist/server/config.mjs +78 -27
- package/dist/server/data.mjs +86 -35
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +157 -79
- package/dist/server/page-converter.mjs +72 -21
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +148 -70
- package/dist/server/rendering.mjs +152 -74
- package/dist/server/routing.mjs +121 -44
- package/dist/server/server.mjs +95 -44
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
package/dist/server/server.mjs
CHANGED
|
@@ -7095,7 +7095,7 @@ var SimpleCache = class {
|
|
|
7095
7095
|
};
|
|
7096
7096
|
|
|
7097
7097
|
// src/version.ts
|
|
7098
|
-
var SDK_VERSION = "0.90.
|
|
7098
|
+
var SDK_VERSION = "0.90.1";
|
|
7099
7099
|
|
|
7100
7100
|
// src/client/error.ts
|
|
7101
7101
|
var RiverbankApiError = class _RiverbankApiError extends Error {
|
|
@@ -9274,6 +9274,8 @@ function publicEventPricingType(pricing) {
|
|
|
9274
9274
|
case "ticket_types":
|
|
9275
9275
|
case "course":
|
|
9276
9276
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
9277
|
+
case "external":
|
|
9278
|
+
return "external";
|
|
9277
9279
|
}
|
|
9278
9280
|
}
|
|
9279
9281
|
function isFreePublicEventPriceDisplay(display) {
|
|
@@ -9287,6 +9289,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
9287
9289
|
case "range":
|
|
9288
9290
|
case "mixed":
|
|
9289
9291
|
case "unavailable":
|
|
9292
|
+
case "external":
|
|
9290
9293
|
return false;
|
|
9291
9294
|
}
|
|
9292
9295
|
}
|
|
@@ -30856,6 +30859,18 @@ var publicCoursesArraySchema = z42.array(publicCourseSchema);
|
|
|
30856
30859
|
var eventPresetSchema = z43.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
30857
30860
|
var eventScheduleScopeSchema = z43.enum(["recurring", "oneOff"]);
|
|
30858
30861
|
var eventDestinationModeSchema = z43.enum(["cms-managed", "system-managed"]);
|
|
30862
|
+
var publicEventDestinationSchema = z43.discriminatedUnion("kind", [
|
|
30863
|
+
z43.object({
|
|
30864
|
+
kind: z43.literal("native"),
|
|
30865
|
+
mode: eventDestinationModeSchema,
|
|
30866
|
+
path: z43.string()
|
|
30867
|
+
}),
|
|
30868
|
+
z43.object({
|
|
30869
|
+
kind: z43.literal("external"),
|
|
30870
|
+
url: z43.string(),
|
|
30871
|
+
label: z43.string()
|
|
30872
|
+
})
|
|
30873
|
+
]);
|
|
30859
30874
|
var eventVenueSchema = z43.object({
|
|
30860
30875
|
id: z43.string(),
|
|
30861
30876
|
name: z43.string(),
|
|
@@ -30870,7 +30885,7 @@ var eventCategorySchema = z43.object({
|
|
|
30870
30885
|
name: z43.string(),
|
|
30871
30886
|
color: z43.string().nullable()
|
|
30872
30887
|
});
|
|
30873
|
-
var pricingTypeSchema = z43.enum(["free", "paid"]);
|
|
30888
|
+
var pricingTypeSchema = z43.enum(["free", "paid", "external"]);
|
|
30874
30889
|
var accessRestrictionSchema = z43.enum(["none", "category"]);
|
|
30875
30890
|
var eventPricingModeSchema = z43.enum(["single", "ticket_types"]);
|
|
30876
30891
|
var publicCoursePriceDisplaySchema = z43.discriminatedUnion("kind", [
|
|
@@ -30891,6 +30906,7 @@ var publicEventPriceDisplaySchema = z43.discriminatedUnion("kind", [
|
|
|
30891
30906
|
currency: z43.string()
|
|
30892
30907
|
}),
|
|
30893
30908
|
z43.object({ kind: z43.literal("unavailable"), currency: z43.string() }),
|
|
30909
|
+
z43.object({ kind: z43.literal("external"), label: z43.string() }),
|
|
30894
30910
|
z43.object({ kind: z43.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
30895
30911
|
]);
|
|
30896
30912
|
var publicEventTicketTypePriceDisplaySchema = z43.union([
|
|
@@ -30969,6 +30985,10 @@ var publicEventPricingSchema = z43.discriminatedUnion("kind", [
|
|
|
30969
30985
|
z43.object({
|
|
30970
30986
|
kind: z43.literal("course"),
|
|
30971
30987
|
display: z43.object({ kind: z43.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
30988
|
+
}),
|
|
30989
|
+
z43.object({
|
|
30990
|
+
kind: z43.literal("external"),
|
|
30991
|
+
display: z43.object({ kind: z43.literal("external"), label: z43.string() })
|
|
30972
30992
|
})
|
|
30973
30993
|
]);
|
|
30974
30994
|
var publicTeamMemberSummarySchema = z43.object({
|
|
@@ -30997,7 +31017,8 @@ var publicEventSchema = z43.object({
|
|
|
30997
31017
|
image: mediaSchema2.nullable().optional()
|
|
30998
31018
|
}).optional(),
|
|
30999
31019
|
slug: z43.string(),
|
|
31000
|
-
path: z43.string(),
|
|
31020
|
+
path: z43.string().nullable(),
|
|
31021
|
+
destination: publicEventDestinationSchema,
|
|
31001
31022
|
requiresRegistration: z43.boolean(),
|
|
31002
31023
|
deliveryMode: z43.enum(["in_person", "online", "hybrid"]),
|
|
31003
31024
|
attendanceModes: z43.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -31301,12 +31322,41 @@ function isEventContentType(slug) {
|
|
|
31301
31322
|
return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
|
|
31302
31323
|
}
|
|
31303
31324
|
|
|
31325
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
31326
|
+
function isRecord3(value) {
|
|
31327
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31328
|
+
}
|
|
31329
|
+
function isRuntimeEventDestination(value) {
|
|
31330
|
+
if (!isRecord3(value) || typeof value.kind !== "string") return false;
|
|
31331
|
+
if (value.kind === "native") {
|
|
31332
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
31333
|
+
}
|
|
31334
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
31335
|
+
}
|
|
31336
|
+
function resolveRuntimeEventDestination(event) {
|
|
31337
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
31338
|
+
return event.destination;
|
|
31339
|
+
}
|
|
31340
|
+
return {
|
|
31341
|
+
kind: "native",
|
|
31342
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
31343
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
31344
|
+
};
|
|
31345
|
+
}
|
|
31346
|
+
|
|
31304
31347
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
31305
31348
|
var DEFAULT_EVENT_CURRENCY = "USD";
|
|
31306
31349
|
function resolveRuntimeEventPricing(event) {
|
|
31307
31350
|
if (isPublicEventPricing(event.pricing)) {
|
|
31308
31351
|
return event.pricing;
|
|
31309
31352
|
}
|
|
31353
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
31354
|
+
if (destination.kind === "external") {
|
|
31355
|
+
return {
|
|
31356
|
+
kind: "external",
|
|
31357
|
+
display: { kind: "external", label: "External registration" }
|
|
31358
|
+
};
|
|
31359
|
+
}
|
|
31310
31360
|
const legacy = event;
|
|
31311
31361
|
const currency = readCurrency(legacy.currency);
|
|
31312
31362
|
if (event.requiresRegistration === false) {
|
|
@@ -31343,22 +31393,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
31343
31393
|
function readCurrency(value) {
|
|
31344
31394
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
31345
31395
|
}
|
|
31346
|
-
function
|
|
31396
|
+
function isRecord4(value) {
|
|
31347
31397
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31348
31398
|
}
|
|
31349
31399
|
function isPublicEventPricing(value) {
|
|
31350
|
-
if (!
|
|
31351
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
31400
|
+
if (!isRecord4(value) || typeof value.kind !== "string") return false;
|
|
31401
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
31352
31402
|
}
|
|
31353
31403
|
function isPublicEventTicketType(value) {
|
|
31354
|
-
return
|
|
31404
|
+
return isRecord4(value) && typeof value.id === "string";
|
|
31355
31405
|
}
|
|
31356
31406
|
function readTicketTypePriceDisplay(value, currency) {
|
|
31357
31407
|
const display = readLegacyPriceDisplay(value, currency);
|
|
31358
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
31408
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
31359
31409
|
}
|
|
31360
31410
|
function readLegacyPriceDisplay(value, currency) {
|
|
31361
|
-
if (!
|
|
31411
|
+
if (!isRecord4(value) || typeof value.kind !== "string") {
|
|
31362
31412
|
return { kind: "unavailable", currency };
|
|
31363
31413
|
}
|
|
31364
31414
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -31397,7 +31447,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
31397
31447
|
case "unavailable":
|
|
31398
31448
|
return { kind: "unavailable", currency: displayCurrency };
|
|
31399
31449
|
case "course":
|
|
31400
|
-
return
|
|
31450
|
+
return isRecord4(value.display) ? {
|
|
31401
31451
|
kind: "course",
|
|
31402
31452
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
31403
31453
|
} : {
|
|
@@ -31484,7 +31534,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
31484
31534
|
if (!input.event) {
|
|
31485
31535
|
return false;
|
|
31486
31536
|
}
|
|
31487
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
31537
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
31488
31538
|
}
|
|
31489
31539
|
|
|
31490
31540
|
// ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
|
|
@@ -31681,15 +31731,16 @@ var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
31681
31731
|
})
|
|
31682
31732
|
});
|
|
31683
31733
|
function normalizeEventRegistrationEventInput(value) {
|
|
31684
|
-
if (!
|
|
31734
|
+
if (!isRecord5(value)) {
|
|
31685
31735
|
return value;
|
|
31686
31736
|
}
|
|
31687
31737
|
return {
|
|
31688
31738
|
...value,
|
|
31739
|
+
destination: resolveRuntimeEventDestination(value),
|
|
31689
31740
|
pricing: resolveRuntimeEventPricing(value)
|
|
31690
31741
|
};
|
|
31691
31742
|
}
|
|
31692
|
-
function
|
|
31743
|
+
function isRecord5(value) {
|
|
31693
31744
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31694
31745
|
}
|
|
31695
31746
|
var eventRegistrationInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
@@ -34251,7 +34302,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
34251
34302
|
return keys.length >= 2 ? keys : [];
|
|
34252
34303
|
}
|
|
34253
34304
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
34254
|
-
if (!
|
|
34305
|
+
if (!isRecord6(value)) return null;
|
|
34255
34306
|
const groupOrderValue = value.groupOrder;
|
|
34256
34307
|
if (Array.isArray(groupOrderValue)) {
|
|
34257
34308
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -34264,7 +34315,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
34264
34315
|
return { ...value, groupOrder: [] };
|
|
34265
34316
|
}
|
|
34266
34317
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
34267
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
34318
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord6) : []
|
|
34268
34319
|
);
|
|
34269
34320
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
34270
34321
|
}
|
|
@@ -34278,7 +34329,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
34278
34329
|
}
|
|
34279
34330
|
return keys;
|
|
34280
34331
|
}
|
|
34281
|
-
function
|
|
34332
|
+
function isRecord6(value) {
|
|
34282
34333
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
34283
34334
|
}
|
|
34284
34335
|
|
|
@@ -34645,7 +34696,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
34645
34696
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
34646
34697
|
}
|
|
34647
34698
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
34648
|
-
if (!
|
|
34699
|
+
if (!isRecord7(value)) return [];
|
|
34649
34700
|
const override = {};
|
|
34650
34701
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
34651
34702
|
override.sourceKey = value.sourceKey;
|
|
@@ -34677,12 +34728,12 @@ function isButtonVariant(value) {
|
|
|
34677
34728
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
34678
34729
|
}
|
|
34679
34730
|
function normalizeCardStylesContent(value) {
|
|
34680
|
-
return
|
|
34731
|
+
return isRecord7(value) || value === null ? value : void 0;
|
|
34681
34732
|
}
|
|
34682
34733
|
function normalizeSectionStylesContent(value) {
|
|
34683
|
-
return
|
|
34734
|
+
return isRecord7(value) || value === null ? value : void 0;
|
|
34684
34735
|
}
|
|
34685
|
-
function
|
|
34736
|
+
function isRecord7(value) {
|
|
34686
34737
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
34687
34738
|
}
|
|
34688
34739
|
|
|
@@ -37762,7 +37813,7 @@ function deriveNewsletterSignupRuntimeSource(values) {
|
|
|
37762
37813
|
};
|
|
37763
37814
|
}
|
|
37764
37815
|
function sanitizeNewsletterSignupPublicContent(content) {
|
|
37765
|
-
if (!
|
|
37816
|
+
if (!isRecord8(content)) return content;
|
|
37766
37817
|
const provider = parseNewsletterSignupDestinationProvider(content.destinationProvider) ?? getProviderFromExplicitDestination(content.destination);
|
|
37767
37818
|
const {
|
|
37768
37819
|
destination: _destination,
|
|
@@ -37781,7 +37832,7 @@ function sanitizeNewsletterSignupPublicContent(content) {
|
|
|
37781
37832
|
return mutablePublicContent;
|
|
37782
37833
|
}
|
|
37783
37834
|
function getProviderFromExplicitDestination(destination) {
|
|
37784
|
-
if (!
|
|
37835
|
+
if (!isRecord8(destination) || typeof destination.tag !== "string") return null;
|
|
37785
37836
|
if (destination.tag === "riverbank_list") return "riverbank";
|
|
37786
37837
|
if (destination.tag === "mailchimp_audience") return "mailchimp";
|
|
37787
37838
|
return null;
|
|
@@ -37793,7 +37844,7 @@ function parseTrimmedString(value) {
|
|
|
37793
37844
|
const trimmed = value.trim();
|
|
37794
37845
|
return trimmed.length > 0 ? trimmed : null;
|
|
37795
37846
|
}
|
|
37796
|
-
function
|
|
37847
|
+
function isRecord8(value) {
|
|
37797
37848
|
return typeof value === "object" && value !== null;
|
|
37798
37849
|
}
|
|
37799
37850
|
|
|
@@ -39950,7 +40001,7 @@ var defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
|
|
|
39950
40001
|
// ../blocks/src/system/data/linkedContentEntries.ts
|
|
39951
40002
|
var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
39952
40003
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
39953
|
-
if (!
|
|
40004
|
+
if (!isRecord9(payload)) return payload;
|
|
39954
40005
|
const response = payload;
|
|
39955
40006
|
if (!Array.isArray(response.entries)) return payload;
|
|
39956
40007
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -39958,12 +40009,12 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
39958
40009
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
39959
40010
|
}
|
|
39960
40011
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
39961
|
-
if (!
|
|
40012
|
+
if (!isRecord9(entry)) return entry;
|
|
39962
40013
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
39963
40014
|
if (!entryId) return entry;
|
|
39964
40015
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
39965
40016
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
39966
|
-
const content =
|
|
40017
|
+
const content = isRecord9(entry.content) ? entry.content : {};
|
|
39967
40018
|
const meta = {
|
|
39968
40019
|
kind: "linked-content-entry",
|
|
39969
40020
|
entryId,
|
|
@@ -40056,7 +40107,7 @@ function capitalize(value) {
|
|
|
40056
40107
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
40057
40108
|
}
|
|
40058
40109
|
function parsePublicContentTypeMeta(value) {
|
|
40059
|
-
if (!
|
|
40110
|
+
if (!isRecord9(value)) return null;
|
|
40060
40111
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
40061
40112
|
return {
|
|
40062
40113
|
key: value.key,
|
|
@@ -40066,7 +40117,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
40066
40117
|
};
|
|
40067
40118
|
}
|
|
40068
40119
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
40069
|
-
if (!
|
|
40120
|
+
if (!isRecord9(value) || typeof value.kind !== "string") return null;
|
|
40070
40121
|
switch (value.kind) {
|
|
40071
40122
|
case "generic":
|
|
40072
40123
|
return { kind: "generic" };
|
|
@@ -40080,7 +40131,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
40080
40131
|
}
|
|
40081
40132
|
}
|
|
40082
40133
|
function parsePublicContentTypeFieldMeta(value) {
|
|
40083
|
-
if (!
|
|
40134
|
+
if (!isRecord9(value)) return [];
|
|
40084
40135
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
40085
40136
|
return [{
|
|
40086
40137
|
id: value.id,
|
|
@@ -40094,7 +40145,7 @@ function parseStringArray(value) {
|
|
|
40094
40145
|
if (!Array.isArray(value)) return null;
|
|
40095
40146
|
return value.filter((item) => typeof item === "string");
|
|
40096
40147
|
}
|
|
40097
|
-
function
|
|
40148
|
+
function isRecord9(value) {
|
|
40098
40149
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
40099
40150
|
}
|
|
40100
40151
|
|
|
@@ -41862,7 +41913,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
|
|
|
41862
41913
|
}
|
|
41863
41914
|
|
|
41864
41915
|
// ../api/src/utils/isRecord.ts
|
|
41865
|
-
function
|
|
41916
|
+
function isRecord10(value) {
|
|
41866
41917
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41867
41918
|
}
|
|
41868
41919
|
|
|
@@ -42169,7 +42220,7 @@ function sanitizeMarks(marks) {
|
|
|
42169
42220
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
42170
42221
|
return [{ type: mark.type }];
|
|
42171
42222
|
}
|
|
42172
|
-
if (mark.type === "link" &&
|
|
42223
|
+
if (mark.type === "link" && isRecord10(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
42173
42224
|
const attrs = { href: mark.attrs.href };
|
|
42174
42225
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
42175
42226
|
attrs.target = mark.attrs.target;
|
|
@@ -42184,10 +42235,10 @@ function sanitizeMarks(marks) {
|
|
|
42184
42235
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
42185
42236
|
}
|
|
42186
42237
|
function unwrapRichTextValue(value) {
|
|
42187
|
-
if (
|
|
42238
|
+
if (isRecord10(value) && isRecord10(value.doc)) {
|
|
42188
42239
|
return unwrapRichTextValue(value.doc);
|
|
42189
42240
|
}
|
|
42190
|
-
if (
|
|
42241
|
+
if (isRecord10(value) && value.type === "doc") {
|
|
42191
42242
|
return {
|
|
42192
42243
|
type: "doc",
|
|
42193
42244
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -42196,7 +42247,7 @@ function unwrapRichTextValue(value) {
|
|
|
42196
42247
|
return EMPTY_SITE_BANNER_BODY;
|
|
42197
42248
|
}
|
|
42198
42249
|
function isTipTapNodeLike(value) {
|
|
42199
|
-
return
|
|
42250
|
+
return isRecord10(value) && typeof value.type === "string";
|
|
42200
42251
|
}
|
|
42201
42252
|
function coerceTipTapNode(value) {
|
|
42202
42253
|
return {
|
|
@@ -42204,9 +42255,9 @@ function coerceTipTapNode(value) {
|
|
|
42204
42255
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
42205
42256
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
42206
42257
|
...Array.isArray(value.marks) ? {
|
|
42207
|
-
marks: value.marks.filter((mark) =>
|
|
42258
|
+
marks: value.marks.filter((mark) => isRecord10(mark) && typeof mark.type === "string").map((mark) => ({
|
|
42208
42259
|
type: mark.type,
|
|
42209
|
-
...
|
|
42260
|
+
...isRecord10(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
42210
42261
|
}))
|
|
42211
42262
|
} : {}
|
|
42212
42263
|
};
|
|
@@ -42341,7 +42392,7 @@ var ENTRY_REF_KEYS = [
|
|
|
42341
42392
|
"entryId",
|
|
42342
42393
|
"slug"
|
|
42343
42394
|
];
|
|
42344
|
-
function
|
|
42395
|
+
function isRecord11(value) {
|
|
42345
42396
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
42346
42397
|
}
|
|
42347
42398
|
function extractManualEntryRef(item) {
|
|
@@ -42349,7 +42400,7 @@ function extractManualEntryRef(item) {
|
|
|
42349
42400
|
const trimmed = item.trim();
|
|
42350
42401
|
return trimmed.length > 0 ? trimmed : null;
|
|
42351
42402
|
}
|
|
42352
|
-
if (!
|
|
42403
|
+
if (!isRecord11(item)) return null;
|
|
42353
42404
|
for (const key of ENTRY_REF_KEYS) {
|
|
42354
42405
|
const raw = item[key];
|
|
42355
42406
|
if (typeof raw === "string" && raw.trim().length > 0) {
|
|
@@ -42706,7 +42757,7 @@ function collectMediaAssetSidecar(mediaAssets) {
|
|
|
42706
42757
|
return Array.isArray(mediaAssets) && mediaAssets.length > 0 ? mediaAssets : void 0;
|
|
42707
42758
|
}
|
|
42708
42759
|
function convertPageResponseBlock(block) {
|
|
42709
|
-
if (!
|
|
42760
|
+
if (!isRecord12(block)) {
|
|
42710
42761
|
throw new Error("Invalid block format in page API response");
|
|
42711
42762
|
}
|
|
42712
42763
|
if (typeof block.id !== "string" && block.id !== null) {
|
|
@@ -42737,20 +42788,20 @@ function buildPageOutline(input) {
|
|
|
42737
42788
|
blocks: input.blocks.map(convertPageResponseBlock)
|
|
42738
42789
|
};
|
|
42739
42790
|
}
|
|
42740
|
-
function
|
|
42791
|
+
function isRecord12(value) {
|
|
42741
42792
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
42742
42793
|
}
|
|
42743
42794
|
function readContentRecord(value) {
|
|
42744
|
-
return
|
|
42795
|
+
return isRecord12(value) ? value : void 0;
|
|
42745
42796
|
}
|
|
42746
42797
|
function readNestedContentRecord(value) {
|
|
42747
|
-
if (!
|
|
42798
|
+
if (!isRecord12(value)) return null;
|
|
42748
42799
|
return readContentRecord(value.data) ?? null;
|
|
42749
42800
|
}
|
|
42750
42801
|
function sanitizeSdkRuntimeBlockContent(blockKind, content) {
|
|
42751
42802
|
if (blockKind !== "block.newsletter-signup") return content;
|
|
42752
42803
|
const sanitized = sanitizeNewsletterSignupPublicContent(content);
|
|
42753
|
-
return
|
|
42804
|
+
return isRecord12(sanitized) ? sanitized : {};
|
|
42754
42805
|
}
|
|
42755
42806
|
function sanitizeNullableSdkRuntimeBlockContent(blockKind, content) {
|
|
42756
42807
|
return content ? sanitizeSdkRuntimeBlockContent(blockKind, content) : null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riverbankcms/sdk",
|
|
3
|
-
"version": "0.90.
|
|
3
|
+
"version": "0.90.1",
|
|
4
4
|
"description": "Riverbank CMS SDK for headless content consumption",
|
|
5
5
|
"main": "./dist/server/index.mjs",
|
|
6
6
|
"module": "./dist/server/index.mjs",
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
"clean:dist": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
223
223
|
"build": "pnpm clean:dist && node --max-old-space-size=4096 node_modules/tsup/dist/cli-default.js && node --max-old-space-size=4096 scripts/generate-types.mjs",
|
|
224
224
|
"dev": "pnpm clean:dist && node --max-old-space-size=4096 node_modules/tsup/dist/cli-default.js --watch",
|
|
225
|
-
"typecheck": "
|
|
225
|
+
"typecheck": "tsgo --noEmit",
|
|
226
226
|
"check:declaration-hygiene": "node scripts/check-declaration-hygiene.mjs",
|
|
227
227
|
"check:packed-exports": "node scripts/check-packed-exports.mjs",
|
|
228
228
|
"measure:public-bundles": "node scripts/measure-public-bundles.mjs --pretty",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
export { SdkPreviewModeRuntime } from './chunk-AEOYWPE4.mjs';
|
|
3
|
-
import './chunk-UG7I7S7W.mjs';
|
|
4
|
-
import './chunk-RQ3XZ4SJ.mjs';
|
|
5
|
-
import './chunk-GSPFFUVB.mjs';
|
|
6
|
-
import './chunk-PMBB6MQ7.mjs';
|
|
7
|
-
import './chunk-BOQXMCSP.mjs';
|
|
8
|
-
import './chunk-R7POPVJR.mjs';
|