@riverbankcms/sdk 0.153.0 → 0.154.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/{EventEmbeddedCheckoutStep-veN-QiAE.mjs → EventEmbeddedCheckoutStep-ba9npQtb.mjs} +1 -1
- package/dist/{PreviewEditorSidebar-jI_4DTZY.mjs → PreviewEditorSidebar-C7FiaxlF.mjs} +194 -22
- package/dist/{PreviewEditorUI-ORkVZhfu.mjs → PreviewEditorUI-DFst50q1.mjs} +20 -44
- package/dist/{SdkPreviewModeRuntime-DaNqevI1.mjs → SdkPreviewModeRuntime-BUNV_YHZ.mjs} +49 -32
- package/dist/{SiteChromeCustomizeContext-CgNuBHC0.mjs → SiteChromeCustomizeContext-DEj7qppF.mjs} +3558 -2321
- package/dist/{ThemedButton-X2UxhW6F.mjs → ThemedButton-C8kzu0hY.mjs} +400 -81
- package/dist/_dts/ai/src/contracts/proposals.d.ts +364 -130
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +1035 -477
- package/dist/_dts/api/src/billing.d.ts +2 -0
- package/dist/_dts/api/src/billingEndpointDefinitions.d.ts +78 -0
- package/dist/_dts/api/src/bookingAdjustments.d.ts +3 -2
- package/dist/_dts/api/src/bookingOperations.d.ts +7 -2
- package/dist/_dts/api/src/bookingPeople.d.ts +19 -0
- package/dist/_dts/api/src/bookingPeopleEndpointDefinitions.d.ts +8 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +4 -106
- package/dist/_dts/api/src/bookings.d.ts +2 -3
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
- package/dist/_dts/api/src/endpoints.d.ts +88 -43
- package/dist/_dts/api/src/index.d.ts +4 -2
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
- package/dist/_dts/api/src/moneyPayments.d.ts +116 -0
- package/dist/_dts/api/src/onboarding/surfaceData.d.ts +2 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +2 -2
- package/dist/_dts/api/src/sdkThemeWire.d.ts +162 -103
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +18 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +17 -16
- package/dist/_dts/api/src/siteSettings.d.ts +1 -0
- package/dist/_dts/api/src/stripeConnectSetup.d.ts +90 -0
- package/dist/_dts/api/src/types.d.ts +11 -31
- package/dist/_dts/api/src/wholeSeriesRuns.d.ts +2 -4
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +8 -96
- package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +1 -1
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -1
- package/dist/_dts/blocks/src/primitives/layout/Section.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/fields.d.ts +0 -4
- package/dist/_dts/blocks/src/system/blocks/events/shared/index.d.ts +0 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/form.d.ts +10 -0
- package/dist/_dts/blocks/src/system/blocks/image-gallery/fields.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +6 -1
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +47 -45
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +12 -0
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime-layout.d.ts +23 -0
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime-profile.d.ts +20 -0
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +17 -16
- package/dist/_dts/blocks/src/system/blocks/site-footer.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/facets.d.ts +75 -9
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +24 -24
- package/dist/_dts/blocks/src/system/node/fragments/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/node/fragments/lookSlot.d.ts +1 -1
- package/dist/_dts/blocks/src/system/node/fragments/responsiveTwoColumn.d.ts +3 -1
- package/dist/_dts/blocks/src/system/node/fragments/sectionHead.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +18 -198
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +9 -99
- package/dist/_dts/blocks/src/system/runtime/lookSurfaces.d.ts +16 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/lookPresentation.d.ts +10 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +29 -17
- package/dist/_dts/blocks/src/system/runtime/nodes/form.fields.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/form.interactive.d.ts +11 -79
- package/dist/_dts/blocks/src/system/runtime/nodes/form.parts.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/form.server.d.ts +2 -13
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +8 -72
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.parts.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +2 -2
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/surfaceForegroundStyles.d.ts +3 -0
- package/dist/_dts/blocks/src/system/transforms/registry/footerArrangement.d.ts +6 -0
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +0 -11
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -10
- package/dist/_dts/commerce/src/purchase/orderConfirmationPlanning.d.ts +1 -0
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +5 -2
- package/dist/_dts/content-editor/src/FooterComposerPanel.d.ts +1 -1
- package/dist/_dts/content-editor/src/FooterNavigationLayoutControl.d.ts +6 -3
- package/dist/_dts/content-editor/src/controller/editorLeaseParticipation.d.ts +1 -1
- package/dist/_dts/content-editor/src/footerComposer.d.ts +2 -1
- package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +3 -1
- package/dist/_dts/content-editor/src/footerNavigationLayoutState.d.ts +56 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +2 -1
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +3 -4
- package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +11 -8
- package/dist/_dts/core/src/booking-refunds.d.ts +2 -0
- package/dist/_dts/core/src/date-display.d.ts +85 -0
- package/dist/_dts/core/src/date-time-formatter.d.ts +2 -0
- package/dist/_dts/core/src/footer-arrangement.d.ts +8 -1
- package/dist/_dts/core/src/footer-composition-types.d.ts +6 -1
- package/dist/_dts/core/src/footer-composition.d.ts +1 -1
- package/dist/_dts/core/src/footer-navigation-layout.d.ts +3 -0
- package/dist/_dts/core/src/index.d.ts +2 -0
- package/dist/_dts/core/src/mailing-list-setup.d.ts +3 -0
- package/dist/_dts/core/src/mailing-list-submission.d.ts +6 -1
- package/dist/_dts/core/src/public-profile.d.ts +3 -1
- package/dist/_dts/core/src/scheduled-date-time.d.ts +69 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +50 -9
- package/dist/_dts/db/src/schemas/forms.d.ts +16 -16
- package/dist/_dts/preview-next/src/client/blocks/ArrangementBlockToolbar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -1
- package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +27 -5
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/useConfirmedPreferenceRecord.d.ts +12 -0
- package/dist/_dts/preview-next/src/client/preview/usePersistedFooterPreferences.d.ts +26 -0
- package/dist/_dts/preview-next/src/client/preview/usePersistedHeaderPreferences.d.ts +40 -2
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -3
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +4 -46
- package/dist/_dts/sdk/src/date-time/index.d.ts +2 -68
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +2 -0
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +2 -0
- package/dist/_dts/theme-core/src/buttons/styles/recipes/lanternRecipes.d.ts +60 -0
- package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +57 -0
- package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +10 -1
- package/dist/_dts/theme-core/src/buttons/types.d.ts +358 -46
- package/dist/_dts/theme-core/src/buttons/typography.d.ts +24 -0
- package/dist/_dts/theme-core/src/cards/types.d.ts +8 -8
- package/dist/_dts/theme-core/src/footer/effectiveNavLinkStyle.d.ts +1 -1
- package/dist/_dts/theme-core/src/footer/generateFooterCss.d.ts +4 -1
- package/dist/_dts/theme-core/src/footer/mode.d.ts +2 -11
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +234 -147
- package/dist/_dts/theme-core/src/navigation/types.d.ts +4 -4
- package/dist/_dts/theme-core/src/schema.d.ts +300 -192
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +23 -7
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +4 -6
- package/dist/_dts/theme-core/src/site-styles/compileFooterAgainstRow.d.ts +121 -0
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +25 -0
- package/dist/_dts/theme-core/src/site-styles/footerLookDefaults.d.ts +45 -0
- package/dist/_dts/theme-core/src/site-styles/footerLookRecipe.d.ts +50 -0
- package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +9 -35
- package/dist/_dts/theme-core/src/site-styles/footerPreferences.d.ts +29 -0
- package/dist/_dts/theme-core/src/site-styles/headerPreferencesPersistence.d.ts +2 -3
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +4 -0
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/siteChromeBackgrounds.d.ts +8 -0
- package/dist/_dts/theme-core/src/site-styles/themeParity.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
- package/dist/_dts/ui/src/card.d.ts +1 -1
- package/dist/client/{BookingMailingListNote-DrchYW1m.mjs → BookingMailingListNote-CNoSqFtf.mjs} +2 -2
- package/dist/client/{CardListItem-CC_GVmF6.mjs → CardListItem-BkTkqBkh.mjs} +3 -3
- package/dist/client/{CheckboxChoice-Dq30m3DO.mjs → CheckboxChoice-CHJpsty4.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-ojwbVUmx.mjs → DemoBookingPortalAccess-C7KQKFNt.mjs} +2 -2
- package/dist/client/{EventCombined.client-DyN0v0Xk.mjs → EventCombined.client-BgeYMjHJ.mjs} +5 -5
- package/dist/client/{EventEmbeddedCheckoutStep-CgfpKc3n.mjs → EventEmbeddedCheckoutStep-BTc_lTkM.mjs} +2 -2
- package/dist/client/{EventListing.client-CuOuvYMz.mjs → EventListing.client-ChRs9Hl2.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-B0WhRr3j.mjs → LeafletStaticMap-C_dNQgd0.mjs} +1 -1
- package/dist/client/{RichText-C1fIXBzA.mjs → RichText-BI9bzbjo.mjs} +75 -42
- package/dist/client/{ThemedButton-B7HFqFBg.mjs → ThemedButton-wl3Z3wkH.mjs} +1 -1
- package/dist/client/{accordion-DCDVWSye.mjs → accordion-6Yz8Wd83.mjs} +1 -1
- package/dist/client/{bookingForm-BJ3C4GlM.mjs → bookingForm-i_pKIGiY.mjs} +8 -8
- package/dist/client/bookings.mjs +12565 -11839
- package/dist/client/{carousel-BSCBhfHY.mjs → carousel-DNqd_PjC.mjs} +2 -2
- package/dist/client/{carousel.client-GEtOGsxo.mjs → carousel.client-BUgjPbb6.mjs} +1 -1
- package/dist/client/{cart-Yv-aAtck.mjs → cart-D8OBHuF4.mjs} +3 -3
- package/dist/client/{checkout-B9xDkl30.mjs → checkout-F3-9IGLU.mjs} +3 -3
- package/dist/client/client.mjs +6109 -4778
- package/dist/client/{context-BOGe3rIA.mjs → context-Dg4ZrxDD.mjs} +1 -1
- package/dist/client/{eventCalendar-D6M0T9hs.mjs → eventCalendar-BUc7YIBM.mjs} +8 -8
- package/dist/client/{eventCombined-NM4UFBq8.mjs → eventCombined-BwfShk2a.mjs} +4 -4
- package/dist/client/{eventDetails-f_FhV4O8.mjs → eventDetails-BMOVC3go.mjs} +3 -3
- package/dist/client/{eventListing-WLkfAROh.mjs → eventListing-BwE9PM-t.mjs} +4 -4
- package/dist/client/{eventRegistration-D3ejfLvW.mjs → eventRegistration-CCWPYDc7.mjs} +9 -9
- package/dist/client/{form-D5Or2Jyu.mjs → form-CXFr0Gd5.mjs} +115 -51
- package/dist/client/{headerSection-hWgnv27V.mjs → headerSection-BX8qw8kH.mjs} +3 -3
- package/dist/client/hooks.mjs +2041 -1193
- package/dist/client/{locationMap-Di1K0O2S.mjs → locationMap-B3La71m0.mjs} +3 -3
- package/dist/client/{media-D29-F1u_.mjs → media-B1Cbv721.mjs} +1 -1
- package/dist/client/{newsletterForm-CwxcwTNO.mjs → newsletterForm-DnGyR0x7.mjs} +50 -14
- package/dist/client/{productDetail-BLSnhPdA.mjs → productDetail-BVgTqvkb.mjs} +3 -3
- package/dist/client/{productList-oGytONOX.mjs → productList-CcO7kUQw.mjs} +3 -3
- package/dist/client/{propsDecoder-lf_dTeZS.mjs → propsDecoder-B1OeWavE.mjs} +706 -229
- package/dist/client/rendering/client.mjs +11868 -11098
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +6058 -4676
- package/dist/client/{routeIslandApiConfig-Bc_WVPS8.mjs → routeIslandApiConfig-Dl4vglJm.mjs} +1 -1
- package/dist/client/{shop-BQ3bR7fA.mjs → shop-P72nX5Fs.mjs} +7 -7
- package/dist/client/{shop-commerce-DDPll6ZC.mjs → shop-commerce-Bt7uraDx.mjs} +8 -8
- package/dist/client/{shop-commerce-store-DO-e1pTe.mjs → shop-commerce-store-C1-mxSye.mjs} +1 -1
- package/dist/client/{shopShared-BylM9jh1.mjs → shopShared-Db-cRGu3.mjs} +4 -4
- package/dist/client/{useDiscountCodeUi-B1Puub2v.mjs → useDiscountCodeUi-jvAiUoUX.mjs} +1 -1
- package/dist/client/{useEventPagination-BBhkmQaT.mjs → useEventPagination-BdWpCniq.mjs} +6 -6
- package/dist/preview-next/before-render.mjs +133 -51
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/editor-chrome.css +5 -2
- package/dist/preview-next/keepAlive.mjs +133 -51
- package/dist/preview-next/middleware.mjs +133 -51
- package/dist/{sdk-runtime-DWCvhJGu.mjs → sdk-runtime-DLhjF2Nw.mjs} +1 -1
- package/dist/server/components.mjs +11284 -10014
- package/dist/server/config-validation.mjs +2016 -1188
- package/dist/server/config.mjs +2016 -1188
- package/dist/server/data.mjs +2041 -1193
- package/dist/server/date-time.mjs +258 -116
- package/dist/server/index.mjs +134 -52
- package/dist/server/next.mjs +10571 -9350
- package/dist/server/page-converter.mjs +1629 -941
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +11156 -9872
- package/dist/server/rendering.mjs +11284 -10014
- package/dist/server/routing.mjs +2204 -1283
- package/dist/server/server.mjs +2369 -1570
- package/dist/server/theme-bridge.mjs +838 -124
- package/dist/server/theme.mjs +348 -64
- package/dist/{spinner-BYM-Y81w.mjs → spinner-MTooKfck.mjs} +1 -1
- package/dist/styles/index.css +254 -1
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/layout.d.ts +0 -12
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
//#region ../core/src/date-time-formatter.ts
|
|
2
|
+
/** Shared Intl engine, internal to core's date presentation owners. */
|
|
3
|
+
const FORMATTER_CACHE_LIMIT$1 = 100;
|
|
4
|
+
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
5
|
+
function getDateTimeFormatter(locale, timeZone, format) {
|
|
6
|
+
const key = `${locale}\u0000${timeZone}\u0000${JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)))}`;
|
|
7
|
+
const cached = dateTimeFormatterCache.get(key);
|
|
8
|
+
if (cached !== void 0) return cached;
|
|
9
|
+
if (typeof locale !== "string" || Intl.DateTimeFormat.supportedLocalesOf([locale]).length === 0) throw new RangeError("An explicit supported locale is required");
|
|
10
|
+
if (typeof timeZone !== "string" || timeZone.length === 0) throw new RangeError("An explicit time zone is required");
|
|
11
|
+
const formatter = new Intl.DateTimeFormat(locale, {
|
|
12
|
+
...format,
|
|
13
|
+
timeZone
|
|
14
|
+
});
|
|
15
|
+
if (dateTimeFormatterCache.size >= FORMATTER_CACHE_LIMIT$1) dateTimeFormatterCache.clear();
|
|
16
|
+
dateTimeFormatterCache.set(key, formatter);
|
|
17
|
+
return formatter;
|
|
18
|
+
}
|
|
19
|
+
function formatIntlRange(formatter, start, end) {
|
|
20
|
+
const nativeFormatRange = Reflect.get(formatter, "formatRange");
|
|
21
|
+
if (typeof nativeFormatRange !== "function") throw new Error("Intl.DateTimeFormat.formatRange is required");
|
|
22
|
+
const output = Reflect.apply(nativeFormatRange, formatter, [start, end]);
|
|
23
|
+
if (typeof output !== "string") throw new Error("Intl.DateTimeFormat.formatRange returned a non-string value");
|
|
24
|
+
return output;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
1
27
|
//#region ../core/src/result.ts
|
|
2
28
|
function ok(value) {
|
|
3
29
|
return {
|
|
@@ -40,26 +66,37 @@ function parseBookingTimeZone(timeZone) {
|
|
|
40
66
|
}
|
|
41
67
|
//#endregion
|
|
42
68
|
//#region ../core/src/booking-date-time.ts
|
|
43
|
-
const
|
|
44
|
-
|
|
69
|
+
const FALLBACK_TIMEZONE = "UTC";
|
|
70
|
+
function getSafeTimeZone(timeZone) {
|
|
71
|
+
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
72
|
+
return normalized.length > 0 && isValidBookingTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
73
|
+
}
|
|
45
74
|
function parseStrictBookingTimeZone(timeZone) {
|
|
46
75
|
const parsed = parseBookingTimeZone(timeZone);
|
|
47
76
|
return parsed.ok ? parsed.value : null;
|
|
48
77
|
}
|
|
49
78
|
function formatToPartsLookup(date, locale, timeZone, format) {
|
|
50
|
-
return new Map(
|
|
79
|
+
return new Map(getDateTimeFormatter(locale, timeZone, format).formatToParts(date).map((part) => [part.type, part.value]));
|
|
51
80
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
function getZonedDateTimeParts(date, timeZone) {
|
|
82
|
+
const parts = formatToPartsLookup(date, "en-GB", timeZone, {
|
|
83
|
+
year: "numeric",
|
|
84
|
+
month: "2-digit",
|
|
85
|
+
day: "2-digit",
|
|
86
|
+
hour: "2-digit",
|
|
87
|
+
minute: "2-digit",
|
|
88
|
+
second: "2-digit",
|
|
89
|
+
hour12: false
|
|
59
90
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
91
|
+
const read = (type) => Number(parts.get(type) ?? "");
|
|
92
|
+
return {
|
|
93
|
+
year: read("year"),
|
|
94
|
+
month: read("month"),
|
|
95
|
+
day: read("day"),
|
|
96
|
+
hour: read("hour"),
|
|
97
|
+
minute: read("minute"),
|
|
98
|
+
second: read("second")
|
|
99
|
+
};
|
|
63
100
|
}
|
|
64
101
|
function parseUtcIsoDateTimeString(value) {
|
|
65
102
|
const normalized = value.trim();
|
|
@@ -151,10 +188,172 @@ function formatBookingCompactEnglishTime(input) {
|
|
|
151
188
|
if (hour === void 0 || minute === void 0 || dayPeriod === void 0) return input.startsAt;
|
|
152
189
|
return `${minute === "00" ? hour : `${hour}:${minute}`}${dayPeriod.toLowerCase()}`;
|
|
153
190
|
}
|
|
191
|
+
function compareLocalScheduleDates(left, right) {
|
|
192
|
+
return Date.UTC(left.year, left.month - 1, left.day) - Date.UTC(right.year, right.month - 1, right.day);
|
|
193
|
+
}
|
|
194
|
+
function getLocalScheduleDate(date, timeZone) {
|
|
195
|
+
const parts = getZonedDateTimeParts(date, getSafeTimeZone(timeZone));
|
|
196
|
+
return {
|
|
197
|
+
year: parts.year,
|
|
198
|
+
month: parts.month,
|
|
199
|
+
day: parts.day
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region ../core/src/date-display.ts
|
|
204
|
+
const SDK_STANDARD_TIME_FORMAT = {
|
|
205
|
+
hour: "numeric",
|
|
206
|
+
minute: "2-digit"
|
|
207
|
+
};
|
|
208
|
+
/** Public SDK option policy lives beside the display profile, never in its adapter. */
|
|
209
|
+
function sdkPresentationProfile(context, dateFormat, time = {}) {
|
|
210
|
+
const compact = time.timePresentation !== "standard" && new Intl.Locale(context.locale).language === "en";
|
|
211
|
+
const standard = time.timePresentation === "standard" ? time.format ?? SDK_STANDARD_TIME_FORMAT : SDK_STANDARD_TIME_FORMAT;
|
|
212
|
+
return {
|
|
213
|
+
kind: "sdk",
|
|
214
|
+
dateFormat,
|
|
215
|
+
clock: compact ? {
|
|
216
|
+
kind: "compact",
|
|
217
|
+
localeSource: "context"
|
|
218
|
+
} : {
|
|
219
|
+
kind: "intl",
|
|
220
|
+
format: standard
|
|
221
|
+
},
|
|
222
|
+
zone: "omit"
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/** Sole date projection/typography owner, used by display and scheduled adapters. */
|
|
226
|
+
function presentDate(value, context, profile) {
|
|
227
|
+
const date = dateCarrier(value);
|
|
228
|
+
const zone = value.kind === "civil" ? "UTC" : context.timeZone;
|
|
229
|
+
const output = getDateTimeFormatter(context.locale, zone, profile.dateFormat).format(date);
|
|
230
|
+
if (profile.kind === "sdk") return output;
|
|
231
|
+
const normalized = normalizeDisplay(output);
|
|
232
|
+
return profile.dateFormat.weekday && new Intl.Locale(context.locale).language === "en" ? normalized.replace(/^([^,]+), /u, "$1 ") : normalized;
|
|
233
|
+
}
|
|
234
|
+
function presentDateRange(start, end, context, profile) {
|
|
235
|
+
if (dateCarrier(end).getTime() < dateCarrier(start).getTime()) throw new RangeError("Date range end must be on or after its start");
|
|
236
|
+
if (profile.kind === "display" && compareLocalScheduleDates(projectDate(start, context), projectDate(end, context)) === 0) return presentDate(start, context, profile);
|
|
237
|
+
const output = formatIntlRange(getDateTimeFormatter(context.locale, start.kind === "civil" ? "UTC" : context.timeZone, profile.dateFormat), dateCarrier(start), dateCarrier(end));
|
|
238
|
+
if (profile.kind === "sdk") return output;
|
|
239
|
+
const startDate = projectDate(start, context);
|
|
240
|
+
const endDate = projectDate(end, context);
|
|
241
|
+
const separator = startDate.month === endDate.month && startDate.year === endDate.year ? "–" : " – ";
|
|
242
|
+
return normalizeDisplay(output).replace(/\s*–\s*/gu, separator);
|
|
243
|
+
}
|
|
244
|
+
function presentTime(value, context, profile) {
|
|
245
|
+
const clock = presentClock(value, context, profile.clock);
|
|
246
|
+
return profile.zone === "always" ? `${clock} ${zoneLabel(value, context)}` : clock;
|
|
247
|
+
}
|
|
248
|
+
function presentDateTime(value, context, profile) {
|
|
249
|
+
if (profile.clock.kind === "intl") return getDateTimeFormatter(context.locale, context.timeZone, combinedFormat(profile.dateFormat, profile.clock)).format(new Date(value));
|
|
250
|
+
return `${presentDate({
|
|
251
|
+
kind: "instant",
|
|
252
|
+
value
|
|
253
|
+
}, context, profile)}, ${presentTime(value, context, profile)}`;
|
|
254
|
+
}
|
|
255
|
+
function presentTimeRange(span, context, profile) {
|
|
256
|
+
assertOrdered(span.start, span.end);
|
|
257
|
+
if (profile.clock.kind === "intl") return presentNativeRange(span, context, profile.clock.format);
|
|
258
|
+
const startClock = presentClock(span.start, context, profile.clock);
|
|
259
|
+
const endClock = presentClock(span.end, context, profile.clock);
|
|
260
|
+
const clocks = (profile.kind === "sdk" ? startClock === endClock : span.start === span.end) ? startClock : `${startClock}–${endClock}`;
|
|
261
|
+
const labels = decideRangeLabels(span, context, profile);
|
|
262
|
+
switch (labels.kind) {
|
|
263
|
+
case "omit": return clocks;
|
|
264
|
+
case "shared": return `${clocks} ${labels.label}`;
|
|
265
|
+
case "endpoints": return `${startClock} ${labels.start} – ${endClock} ${labels.end}`;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function presentDateTimeRange(span, context, profile) {
|
|
269
|
+
assertOrdered(span.start, span.end);
|
|
270
|
+
if (profile.clock.kind === "intl") return presentNativeRange(span, context, combinedFormat(profile.dateFormat, profile.clock));
|
|
271
|
+
const startDate = getLocalScheduleDate(new Date(span.start), context.timeZone);
|
|
272
|
+
const endDate = getLocalScheduleDate(new Date(span.end), context.timeZone);
|
|
273
|
+
if (compareLocalScheduleDates(startDate, endDate) === 0) return `${presentDate({
|
|
274
|
+
kind: "instant",
|
|
275
|
+
value: span.start
|
|
276
|
+
}, context, profile)}, ${presentTimeRange(span, context, profile)}`;
|
|
277
|
+
const labels = decideRangeLabels(span, context, profile);
|
|
278
|
+
const startProfile = profile.kind === "display" && startDate.year === endDate.year ? {
|
|
279
|
+
...profile,
|
|
280
|
+
dateFormat: {
|
|
281
|
+
...profile.dateFormat,
|
|
282
|
+
year: void 0
|
|
283
|
+
}
|
|
284
|
+
} : profile;
|
|
285
|
+
const start = presentRangeEndpoint(span.start, context, startProfile, labels.kind === "endpoints" ? labels.start : void 0);
|
|
286
|
+
const end = presentRangeEndpoint(span.end, context, profile, labels.kind === "endpoints" ? labels.end : void 0);
|
|
287
|
+
const separator = profile.kind === "sdk" ? "–" : " – ";
|
|
288
|
+
return profile.kind === "sdk" && start === end ? start : `${start}${separator}${end}`;
|
|
289
|
+
}
|
|
290
|
+
/** Offset changes override ordinary venue omission for the approved display profile. */
|
|
291
|
+
function decideRangeLabels(span, context, profile) {
|
|
292
|
+
if (profile.kind === "sdk") return { kind: "omit" };
|
|
293
|
+
const offsetsDiffer = offsetToken(span.start, context) !== offsetToken(span.end, context);
|
|
294
|
+
if (!offsetsDiffer && profile.zone === "omit") return { kind: "omit" };
|
|
295
|
+
const start = zoneLabel(span.start, context);
|
|
296
|
+
const end = zoneLabel(span.end, context);
|
|
297
|
+
return offsetsDiffer || start !== end ? {
|
|
298
|
+
kind: "endpoints",
|
|
299
|
+
start,
|
|
300
|
+
end
|
|
301
|
+
} : {
|
|
302
|
+
kind: "shared",
|
|
303
|
+
label: start
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
function presentRangeEndpoint(value, context, profile, label) {
|
|
307
|
+
return `${presentDate({
|
|
308
|
+
kind: "instant",
|
|
309
|
+
value
|
|
310
|
+
}, context, profile)}, ${label === void 0 ? presentTime(value, context, profile) : `${presentClock(value, context, profile.clock)} ${label}`}`;
|
|
311
|
+
}
|
|
312
|
+
function presentNativeRange(span, context, format) {
|
|
313
|
+
return formatIntlRange(getDateTimeFormatter(context.locale, context.timeZone, format), new Date(span.start), new Date(span.end));
|
|
314
|
+
}
|
|
315
|
+
function combinedFormat(date, clock) {
|
|
316
|
+
return {
|
|
317
|
+
...date,
|
|
318
|
+
...clock.format
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
function dateCarrier(value) {
|
|
322
|
+
return value.kind === "civil" ? civilCarrier(value.value) : new Date(value.value);
|
|
323
|
+
}
|
|
324
|
+
function presentClock(value, context, clock) {
|
|
325
|
+
return clock.kind === "compact" ? formatBookingCompactEnglishTime({
|
|
326
|
+
startsAt: value,
|
|
327
|
+
timeZone: context.timeZone,
|
|
328
|
+
locale: clock.localeSource === "product" ? "en-GB" : context.locale
|
|
329
|
+
}) : getDateTimeFormatter(context.locale, context.timeZone, clock.format).format(new Date(value));
|
|
330
|
+
}
|
|
331
|
+
function offsetToken(value, context) {
|
|
332
|
+
return getDateTimeFormatter("en-GB", context.timeZone, { timeZoneName: "longOffset" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
|
|
333
|
+
}
|
|
334
|
+
function civilCarrier(value) {
|
|
335
|
+
return new Date(Date.UTC(value.year, value.month - 1, value.day, 12));
|
|
336
|
+
}
|
|
337
|
+
function projectDate(value, context) {
|
|
338
|
+
return value.kind === "civil" ? value.value : getLocalScheduleDate(new Date(value.value), context.timeZone);
|
|
339
|
+
}
|
|
340
|
+
function normalizeDisplay(value) {
|
|
341
|
+
return value.replace(/[\u00a0\u202f]/gu, " ");
|
|
342
|
+
}
|
|
343
|
+
function zoneToken(value, context, locale) {
|
|
344
|
+
return getDateTimeFormatter(locale, context.timeZone, { timeZoneName: "short" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
|
|
345
|
+
}
|
|
346
|
+
function zoneLabel(value, context) {
|
|
347
|
+
const abbreviation = [zoneToken(value, context, "en-GB"), zoneToken(value, context, "en-US")].find((token) => /^[A-Z]{2,6}$/u.test(token));
|
|
348
|
+
const fallback = context.timeZone.startsWith("Etc/") ? "local time" : `${context.timeZone.split("/").slice(-1)[0]?.replace(/_/gu, " ") ?? context.timeZone} time`;
|
|
349
|
+
return abbreviation ?? fallback;
|
|
350
|
+
}
|
|
351
|
+
function assertOrdered(start, end) {
|
|
352
|
+
if (new Date(end).getTime() < new Date(start).getTime()) throw new RangeError("Date/time range end must be on or after its start");
|
|
353
|
+
}
|
|
154
354
|
//#endregion
|
|
155
|
-
//#region src/date-time
|
|
355
|
+
//#region ../core/src/scheduled-date-time.ts
|
|
156
356
|
const DEFAULT_LOCALE = "en-GB";
|
|
157
|
-
const COMPACT_ENGLISH_RANGE_SEPARATOR = "–";
|
|
158
357
|
const FORMATTER_CACHE_LIMIT = 100;
|
|
159
358
|
const DEFAULT_DATE_FORMAT = {
|
|
160
359
|
weekday: "long",
|
|
@@ -168,11 +367,6 @@ const DEFAULT_RANGE_DATE_FORMAT = {
|
|
|
168
367
|
month: "short",
|
|
169
368
|
day: "numeric"
|
|
170
369
|
};
|
|
171
|
-
const DEFAULT_STANDARD_TIME_FORMAT = {
|
|
172
|
-
hour: "numeric",
|
|
173
|
-
minute: "2-digit"
|
|
174
|
-
};
|
|
175
|
-
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
176
370
|
const parsedLocaleCache = /* @__PURE__ */ new Map();
|
|
177
371
|
var RiverbankDateTimeFormatError = class extends Error {
|
|
178
372
|
constructor(details) {
|
|
@@ -183,40 +377,51 @@ var RiverbankDateTimeFormatError = class extends Error {
|
|
|
183
377
|
this.value = details.value;
|
|
184
378
|
}
|
|
185
379
|
};
|
|
380
|
+
/** Public contract adapters: admission/options here, all presentation in date-display. */
|
|
186
381
|
function formatScheduledDate(input, options = {}) {
|
|
187
|
-
|
|
382
|
+
const parsed = parseDateTime(input);
|
|
383
|
+
return presentDate({
|
|
384
|
+
kind: "instant",
|
|
385
|
+
value: parsed.startsAt
|
|
386
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.format ?? DEFAULT_DATE_FORMAT));
|
|
188
387
|
}
|
|
189
388
|
function formatScheduledTime(input, options = {}) {
|
|
190
|
-
|
|
389
|
+
const parsed = parseDateTime(input);
|
|
390
|
+
return presentTime(parsed.startsAt, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), {}, options));
|
|
191
391
|
}
|
|
192
392
|
function formatScheduledDateTime(input, options = {}) {
|
|
193
|
-
|
|
393
|
+
const parsed = parseDateTime(input);
|
|
394
|
+
return presentDateTime(parsed.startsAt, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.dateFormat ?? DEFAULT_DATE_FORMAT, options.time));
|
|
194
395
|
}
|
|
195
396
|
function formatScheduledDateRange(input, options = {}) {
|
|
196
|
-
const
|
|
197
|
-
return
|
|
397
|
+
const parsed = parseDateRange(input);
|
|
398
|
+
return presentDateRange({
|
|
399
|
+
kind: "instant",
|
|
400
|
+
value: parsed.startsAt
|
|
401
|
+
}, {
|
|
402
|
+
kind: "instant",
|
|
403
|
+
value: parsed.endsAt
|
|
404
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.format ?? DEFAULT_RANGE_DATE_FORMAT));
|
|
198
405
|
}
|
|
199
406
|
function formatScheduledTimeRange(input, options = {}) {
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const endTime = formatTime(end, options);
|
|
206
|
-
return startTime === endTime ? startTime : `${startTime}${COMPACT_ENGLISH_RANGE_SEPARATOR}${endTime}`;
|
|
407
|
+
const parsed = parseDateRange(input);
|
|
408
|
+
return presentTimeRange({
|
|
409
|
+
start: parsed.startsAt,
|
|
410
|
+
end: parsed.endsAt
|
|
411
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), {}, options));
|
|
207
412
|
}
|
|
208
413
|
function formatScheduledDateTimeRange(input, options = {}) {
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
414
|
+
const parsed = parseDateRange(input);
|
|
415
|
+
return presentDateTimeRange({
|
|
416
|
+
start: parsed.startsAt,
|
|
417
|
+
end: parsed.endsAt
|
|
418
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.dateFormat ?? DEFAULT_RANGE_DATE_FORMAT, options.time));
|
|
419
|
+
}
|
|
420
|
+
function scheduledContext(input) {
|
|
421
|
+
return {
|
|
422
|
+
locale: input.locale,
|
|
423
|
+
timeZone: input.timeZone
|
|
424
|
+
};
|
|
220
425
|
}
|
|
221
426
|
function parseDateTime(input) {
|
|
222
427
|
const locale = parseLocale(input.locale);
|
|
@@ -234,11 +439,7 @@ function parseDateTime(input) {
|
|
|
234
439
|
function parseDateRange(input) {
|
|
235
440
|
const locale = parseLocale(input.locale);
|
|
236
441
|
assertStringTimeZone(input.timeZone);
|
|
237
|
-
|
|
238
|
-
code: "missing_ends_at",
|
|
239
|
-
field: "endsAt",
|
|
240
|
-
value: ""
|
|
241
|
-
});
|
|
442
|
+
assertRequiredEnd(input.endsAt);
|
|
242
443
|
const result = parseScheduledBookingDateRange({
|
|
243
444
|
...input,
|
|
244
445
|
locale: locale.locale
|
|
@@ -260,6 +461,13 @@ function parseDateRange(input) {
|
|
|
260
461
|
locale: locale.locale
|
|
261
462
|
};
|
|
262
463
|
}
|
|
464
|
+
function assertRequiredEnd(value) {
|
|
465
|
+
if (value === null || value === void 0) throw new RiverbankDateTimeFormatError({
|
|
466
|
+
code: "missing_ends_at",
|
|
467
|
+
field: "endsAt",
|
|
468
|
+
value: ""
|
|
469
|
+
});
|
|
470
|
+
}
|
|
263
471
|
function parseLocale(value) {
|
|
264
472
|
const locale = value === void 0 ? DEFAULT_LOCALE : value;
|
|
265
473
|
if (typeof locale !== "string") throw new RiverbankDateTimeFormatError({
|
|
@@ -270,13 +478,9 @@ function parseLocale(value) {
|
|
|
270
478
|
const cached = parsedLocaleCache.get(locale);
|
|
271
479
|
if (cached !== void 0) return cached;
|
|
272
480
|
try {
|
|
273
|
-
const
|
|
274
|
-
const canonical = parsed.toString();
|
|
481
|
+
const canonical = new Intl.Locale(locale).toString();
|
|
275
482
|
if (Intl.DateTimeFormat.supportedLocalesOf([canonical]).length === 0) throw new RangeError("Unsupported locale");
|
|
276
|
-
const result = {
|
|
277
|
-
locale: canonical,
|
|
278
|
-
language: parsed.language
|
|
279
|
-
};
|
|
483
|
+
const result = { locale: canonical };
|
|
280
484
|
if (parsedLocaleCache.size >= FORMATTER_CACHE_LIMIT) parsedLocaleCache.clear();
|
|
281
485
|
parsedLocaleCache.set(locale, result);
|
|
282
486
|
return result;
|
|
@@ -326,68 +530,6 @@ function formatErrorMessage(details) {
|
|
|
326
530
|
default: return assertNever(details);
|
|
327
531
|
}
|
|
328
532
|
}
|
|
329
|
-
function formatDateTime(input, options, defaultDateFormat) {
|
|
330
|
-
if (!usesCompactEnglishTime(input, options.time ?? {})) return formatInstant(input, resolveCombinedFormat(options, defaultDateFormat));
|
|
331
|
-
return `${formatInstant(input, options.dateFormat ?? defaultDateFormat)}, ${formatTime(input, options.time ?? {})}`;
|
|
332
|
-
}
|
|
333
|
-
function formatTime(input, options) {
|
|
334
|
-
if (usesCompactEnglishTime(input, options)) return formatBookingCompactEnglishTime(input);
|
|
335
|
-
return formatInstant(input, resolveStandardTimeFormat(options));
|
|
336
|
-
}
|
|
337
|
-
function usesCompactEnglishTime(input, options) {
|
|
338
|
-
return options.timePresentation !== "standard" && parseLocale(input.locale).language === "en";
|
|
339
|
-
}
|
|
340
|
-
function resolveStandardTimeFormat(options) {
|
|
341
|
-
return options.timePresentation === "standard" ? options.format ?? DEFAULT_STANDARD_TIME_FORMAT : DEFAULT_STANDARD_TIME_FORMAT;
|
|
342
|
-
}
|
|
343
|
-
function resolveCombinedFormat(options, defaultDateFormat) {
|
|
344
|
-
return {
|
|
345
|
-
...options.dateFormat ?? defaultDateFormat,
|
|
346
|
-
...resolveStandardTimeFormat(options.time ?? {})
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
function formatInstant(input, format) {
|
|
350
|
-
return getFormatter(input, format).format(new Date(input.startsAt));
|
|
351
|
-
}
|
|
352
|
-
function formatRange(start, end, format) {
|
|
353
|
-
const formatter = getFormatter(start, format);
|
|
354
|
-
const nativeFormatRange = Reflect.get(formatter, "formatRange");
|
|
355
|
-
if (typeof nativeFormatRange !== "function") throw new Error("Intl.DateTimeFormat.formatRange is required");
|
|
356
|
-
const output = Reflect.apply(nativeFormatRange, formatter, [new Date(start.startsAt), new Date(end.startsAt)]);
|
|
357
|
-
if (typeof output !== "string") throw new Error("Intl.DateTimeFormat.formatRange returned a non-string value");
|
|
358
|
-
return output;
|
|
359
|
-
}
|
|
360
|
-
function getFormatter(input, format) {
|
|
361
|
-
const formatKey = JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)));
|
|
362
|
-
const key = `${input.locale}\u0000${input.timeZone}\u0000${formatKey}`;
|
|
363
|
-
const cached = dateTimeFormatterCache.get(key);
|
|
364
|
-
if (cached !== void 0) return cached;
|
|
365
|
-
const formatter = new Intl.DateTimeFormat(input.locale, {
|
|
366
|
-
...format,
|
|
367
|
-
timeZone: input.timeZone
|
|
368
|
-
});
|
|
369
|
-
if (dateTimeFormatterCache.size >= FORMATTER_CACHE_LIMIT) dateTimeFormatterCache.clear();
|
|
370
|
-
dateTimeFormatterCache.set(key, formatter);
|
|
371
|
-
return formatter;
|
|
372
|
-
}
|
|
373
|
-
function rangeStart(range) {
|
|
374
|
-
return range;
|
|
375
|
-
}
|
|
376
|
-
function rangeEnd(range) {
|
|
377
|
-
return {
|
|
378
|
-
startsAt: range.endsAt,
|
|
379
|
-
timeZone: range.timeZone,
|
|
380
|
-
locale: range.locale
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
function sameLocalDate(start, end) {
|
|
384
|
-
const format = {
|
|
385
|
-
year: "numeric",
|
|
386
|
-
month: "2-digit",
|
|
387
|
-
day: "2-digit"
|
|
388
|
-
};
|
|
389
|
-
return formatInstant(start, format) === formatInstant(end, format);
|
|
390
|
-
}
|
|
391
533
|
function assertNever(value) {
|
|
392
534
|
throw new Error(`Unhandled date-time variant: ${String(value)}`);
|
|
393
535
|
}
|
package/dist/server/index.mjs
CHANGED
|
@@ -2652,6 +2652,129 @@ const BILLING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
2652
2652
|
tags: ["billing"],
|
|
2653
2653
|
auth: "user",
|
|
2654
2654
|
responseKind: "json"
|
|
2655
|
+
},
|
|
2656
|
+
stripeConnectSetupStart: {
|
|
2657
|
+
path: "/sites/{siteId}/billing/connect/setup",
|
|
2658
|
+
method: "POST",
|
|
2659
|
+
tags: ["site-{siteId}", "stripe-connect"],
|
|
2660
|
+
auth: "user",
|
|
2661
|
+
responseKind: "json",
|
|
2662
|
+
errors: [
|
|
2663
|
+
"validation:invalid_input",
|
|
2664
|
+
"auth:forbidden",
|
|
2665
|
+
"resource:conflict",
|
|
2666
|
+
"server:internal_error"
|
|
2667
|
+
]
|
|
2668
|
+
},
|
|
2669
|
+
stripeConnectSetupDiscard: {
|
|
2670
|
+
path: "/sites/{siteId}/billing/connect/setup",
|
|
2671
|
+
method: "DELETE",
|
|
2672
|
+
tags: ["site-{siteId}", "stripe-connect"],
|
|
2673
|
+
auth: "user",
|
|
2674
|
+
responseKind: "json",
|
|
2675
|
+
errors: [
|
|
2676
|
+
"validation:invalid_input",
|
|
2677
|
+
"auth:forbidden",
|
|
2678
|
+
"resource:conflict",
|
|
2679
|
+
"server:internal_error"
|
|
2680
|
+
]
|
|
2681
|
+
},
|
|
2682
|
+
stripeConnectSetupSave: {
|
|
2683
|
+
path: "/sites/{siteId}/billing/connect/setup/save",
|
|
2684
|
+
method: "POST",
|
|
2685
|
+
tags: ["site-{siteId}", "stripe-connect"],
|
|
2686
|
+
auth: "user",
|
|
2687
|
+
responseKind: "json",
|
|
2688
|
+
errors: [
|
|
2689
|
+
"validation:invalid_input",
|
|
2690
|
+
"auth:forbidden",
|
|
2691
|
+
"resource:conflict",
|
|
2692
|
+
"server:internal_error"
|
|
2693
|
+
]
|
|
2694
|
+
},
|
|
2695
|
+
stripeConnectAccountSession: {
|
|
2696
|
+
path: "/sites/{siteId}/billing/connect/session",
|
|
2697
|
+
method: "POST",
|
|
2698
|
+
tags: ["site-{siteId}", "stripe-connect"],
|
|
2699
|
+
auth: "user",
|
|
2700
|
+
responseKind: "json",
|
|
2701
|
+
errors: [
|
|
2702
|
+
"validation:invalid_input",
|
|
2703
|
+
"auth:forbidden",
|
|
2704
|
+
"resource:conflict",
|
|
2705
|
+
"server:internal_error"
|
|
2706
|
+
]
|
|
2707
|
+
},
|
|
2708
|
+
stripeConnectStart: {
|
|
2709
|
+
path: "/sites/{siteId}/billing/connect/start",
|
|
2710
|
+
method: "POST",
|
|
2711
|
+
tags: ["site-{siteId}", "stripe-connect"],
|
|
2712
|
+
auth: "user",
|
|
2713
|
+
responseKind: "json",
|
|
2714
|
+
errors: [
|
|
2715
|
+
"validation:invalid_input",
|
|
2716
|
+
"auth:forbidden",
|
|
2717
|
+
"resource:conflict",
|
|
2718
|
+
"server:internal_error"
|
|
2719
|
+
]
|
|
2720
|
+
},
|
|
2721
|
+
stripeConnectStatus: {
|
|
2722
|
+
path: "/sites/{siteId}/billing/connect/status",
|
|
2723
|
+
method: "GET",
|
|
2724
|
+
tags: ["site-{siteId}", "stripe-connect"],
|
|
2725
|
+
auth: "user",
|
|
2726
|
+
responseKind: "json",
|
|
2727
|
+
errors: [
|
|
2728
|
+
"validation:invalid_input",
|
|
2729
|
+
"auth:forbidden",
|
|
2730
|
+
"resource:conflict",
|
|
2731
|
+
"server:internal_error"
|
|
2732
|
+
]
|
|
2733
|
+
},
|
|
2734
|
+
stripeAutomaticTaxUpdate: {
|
|
2735
|
+
path: "/sites/{siteId}/billing/automatic-tax",
|
|
2736
|
+
method: "POST",
|
|
2737
|
+
tags: [
|
|
2738
|
+
"site-{siteId}",
|
|
2739
|
+
"billing",
|
|
2740
|
+
"stripe-tax"
|
|
2741
|
+
],
|
|
2742
|
+
auth: "user",
|
|
2743
|
+
responseKind: "json",
|
|
2744
|
+
errors: [
|
|
2745
|
+
"validation:invalid_input",
|
|
2746
|
+
"auth:forbidden",
|
|
2747
|
+
"resource:not_found",
|
|
2748
|
+
"server:unavailable",
|
|
2749
|
+
"server:internal_error"
|
|
2750
|
+
]
|
|
2751
|
+
},
|
|
2752
|
+
stripeConnectDisconnect: {
|
|
2753
|
+
path: "/sites/{siteId}/billing/connect/disconnect",
|
|
2754
|
+
method: "DELETE",
|
|
2755
|
+
tags: ["site-{siteId}", "stripe-connect"],
|
|
2756
|
+
auth: "user",
|
|
2757
|
+
responseKind: "json",
|
|
2758
|
+
errors: [
|
|
2759
|
+
"validation:invalid_input",
|
|
2760
|
+
"auth:forbidden",
|
|
2761
|
+
"resource:conflict",
|
|
2762
|
+
"server:internal_error"
|
|
2763
|
+
]
|
|
2764
|
+
},
|
|
2765
|
+
billingConnectReturn: {
|
|
2766
|
+
path: "/billing/connect/return",
|
|
2767
|
+
method: "GET",
|
|
2768
|
+
auth: "user",
|
|
2769
|
+
responseKind: "void",
|
|
2770
|
+
errors: []
|
|
2771
|
+
},
|
|
2772
|
+
billingConnectRefresh: {
|
|
2773
|
+
path: "/billing/connect/refresh",
|
|
2774
|
+
method: "GET",
|
|
2775
|
+
auth: "user",
|
|
2776
|
+
responseKind: "void",
|
|
2777
|
+
errors: []
|
|
2655
2778
|
}
|
|
2656
2779
|
});
|
|
2657
2780
|
//#endregion
|
|
@@ -2816,6 +2939,14 @@ const PAGE_SURFACE_EDITOR_ENDPOINT_DEFINITIONS = {
|
|
|
2816
2939
|
* person when nothing is attached to them.
|
|
2817
2940
|
*/
|
|
2818
2941
|
const BOOKING_PEOPLE_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
2942
|
+
getBookingPerson: {
|
|
2943
|
+
path: "/sites/{siteId}/bookings/people/{personId}",
|
|
2944
|
+
method: "GET",
|
|
2945
|
+
tags: ["site-{siteId}", "customers-{siteId}"],
|
|
2946
|
+
auth: "user",
|
|
2947
|
+
responseKind: "json",
|
|
2948
|
+
errors: ["resource:not_found", "server:internal_error"]
|
|
2949
|
+
},
|
|
2819
2950
|
listPeople: {
|
|
2820
2951
|
path: "/sites/{siteId}/bookings/people",
|
|
2821
2952
|
method: "GET",
|
|
@@ -6051,57 +6182,6 @@ const API_ENDPOINTS$1 = {
|
|
|
6051
6182
|
errors: [],
|
|
6052
6183
|
responseKind: "json"
|
|
6053
6184
|
},
|
|
6054
|
-
stripeConnectStart: {
|
|
6055
|
-
path: "/sites/{siteId}/billing/connect/start",
|
|
6056
|
-
method: "POST",
|
|
6057
|
-
tags: ["site-{siteId}", "stripe-connect"],
|
|
6058
|
-
auth: "user",
|
|
6059
|
-
responseKind: "json"
|
|
6060
|
-
},
|
|
6061
|
-
stripeConnectStatus: {
|
|
6062
|
-
path: "/sites/{siteId}/billing/connect/status",
|
|
6063
|
-
method: "GET",
|
|
6064
|
-
tags: ["site-{siteId}", "stripe-connect"],
|
|
6065
|
-
auth: "user",
|
|
6066
|
-
responseKind: "json"
|
|
6067
|
-
},
|
|
6068
|
-
stripeAutomaticTaxUpdate: {
|
|
6069
|
-
path: "/sites/{siteId}/billing/automatic-tax",
|
|
6070
|
-
method: "POST",
|
|
6071
|
-
tags: [
|
|
6072
|
-
"site-{siteId}",
|
|
6073
|
-
"billing",
|
|
6074
|
-
"stripe-tax"
|
|
6075
|
-
],
|
|
6076
|
-
auth: "user",
|
|
6077
|
-
responseKind: "json",
|
|
6078
|
-
errors: [
|
|
6079
|
-
"validation:invalid_input",
|
|
6080
|
-
"auth:forbidden",
|
|
6081
|
-
"resource:not_found",
|
|
6082
|
-
"server:unavailable",
|
|
6083
|
-
"server:internal_error"
|
|
6084
|
-
]
|
|
6085
|
-
},
|
|
6086
|
-
stripeConnectDisconnect: {
|
|
6087
|
-
path: "/sites/{siteId}/billing/connect/disconnect",
|
|
6088
|
-
method: "DELETE",
|
|
6089
|
-
tags: ["site-{siteId}", "stripe-connect"],
|
|
6090
|
-
auth: "user",
|
|
6091
|
-
responseKind: "json"
|
|
6092
|
-
},
|
|
6093
|
-
billingConnectReturn: {
|
|
6094
|
-
path: "/billing/connect/return",
|
|
6095
|
-
method: "GET",
|
|
6096
|
-
auth: "user",
|
|
6097
|
-
responseKind: "void"
|
|
6098
|
-
},
|
|
6099
|
-
billingConnectRefresh: {
|
|
6100
|
-
path: "/billing/connect/refresh",
|
|
6101
|
-
method: "GET",
|
|
6102
|
-
auth: "user",
|
|
6103
|
-
responseKind: "void"
|
|
6104
|
-
},
|
|
6105
6185
|
importSiteBackup: {
|
|
6106
6186
|
path: "/sites/{siteId}/backup/import",
|
|
6107
6187
|
method: "POST",
|
|
@@ -7007,6 +7087,7 @@ const API_ENDPOINTS$1 = {
|
|
|
7007
7087
|
errors: [
|
|
7008
7088
|
"validation:invalid_input",
|
|
7009
7089
|
"resource:not_found",
|
|
7090
|
+
"resource:conflict",
|
|
7010
7091
|
"server:internal_error"
|
|
7011
7092
|
]
|
|
7012
7093
|
},
|
|
@@ -7032,6 +7113,7 @@ const API_ENDPOINTS$1 = {
|
|
|
7032
7113
|
errors: [
|
|
7033
7114
|
"validation:invalid_input",
|
|
7034
7115
|
"resource:not_found",
|
|
7116
|
+
"resource:conflict",
|
|
7035
7117
|
"server:internal_error"
|
|
7036
7118
|
]
|
|
7037
7119
|
},
|
|
@@ -8955,7 +9037,7 @@ var SimpleCache = class {
|
|
|
8955
9037
|
* 1. This constant
|
|
8956
9038
|
* 2. The "version" field in package.json
|
|
8957
9039
|
*/
|
|
8958
|
-
const SDK_VERSION = "0.
|
|
9040
|
+
const SDK_VERSION = "0.154.0";
|
|
8959
9041
|
//#endregion
|
|
8960
9042
|
//#region src/client/error.ts
|
|
8961
9043
|
let _Symbol$for;
|