@riverbankcms/sdk 0.148.0 → 0.150.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/README.md +1 -1
- package/dist/EventEmbeddedCheckoutStep-D00Kc8Zj.mjs +285 -0
- package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-7ZhmmnBB.mjs} +103 -66
- package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-BIJucTRd.mjs} +3 -6
- package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-tj45gmCX.mjs} +96 -67
- package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-BFOt0ss-.mjs} +4804 -4161
- package/dist/_dts/ai/src/contracts/proposals.d.ts +660 -0
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +510 -0
- package/dist/_dts/api/src/billing.d.ts +2 -2
- package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
- package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
- package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
- package/dist/_dts/api/src/endpoints.d.ts +2 -10
- package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +9 -0
- package/dist/_dts/api/src/footerSettings.d.ts +3 -3
- package/dist/_dts/api/src/index.d.ts +4 -4
- package/dist/_dts/api/src/navigation/bookingPortalLink.d.ts +13 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -0
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +9 -173
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +12 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/siteOperations.d.ts +6 -2
- package/dist/_dts/api/src/siteSettings.d.ts +2 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +2 -1
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
- package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
- package/dist/_dts/blocks/src/rendering/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +30 -3
- package/dist/_dts/blocks/src/system/designCapabilities.d.ts +10 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +38 -18
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/FullyBookedStep.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +15 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentLocation.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +72 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +66 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +13 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +11 -52
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +19 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +7 -42
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +7 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +94 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useGuestRegistrationRecovery.d.ts +30 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +24 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.d.ts +18 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
- package/dist/_dts/blocks/src/system/runtime/shared/stripe/browserStripe.d.ts +8 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
- package/dist/_dts/commerce/src/purchase/checkoutCopy.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
- package/dist/_dts/commerce/src/purchase/checkoutPresentation.d.ts +49 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +6 -6
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +5 -1
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +9 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +3 -3
- package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +4 -1
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +9 -2
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +7 -7
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +3 -2
- package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +6 -1
- package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +7 -0
- package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
- package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
- package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
- package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
- package/dist/_dts/core/src/branded.d.ts +3 -0
- package/dist/_dts/core/src/edit-lease.d.ts +5 -0
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/patch/index.d.ts +30 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +326 -36
- package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
- package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
- package/dist/_dts/media-editor/src/index.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
- package/dist/_dts/preview-next/src/constants.d.ts +4 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +147 -0
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +22 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +22 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +198 -0
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/palette/utils/scrimContrast.d.ts +22 -0
- package/dist/_dts/theme-core/src/runtime/bridgeColourTokens.d.ts +10 -0
- package/dist/_dts/theme-core/src/schema.d.ts +330 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +11 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +12 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +7 -4
- package/dist/_dts/theme-core/src/site-styles/sectionSurfaceBackgrounds.d.ts +65 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +17 -0
- package/dist/_dts/theme-core/src/surfaces/opaqueSurface.d.ts +43 -0
- package/dist/_dts/ui/src/color-picker.d.ts +1 -1
- package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
- package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-CYHOufsI.mjs} +33 -124
- package/dist/client/{CheckboxChoice-B33MqoUo.mjs → CheckboxChoice-M-3HycLw.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-Cvr9O_ca.mjs} +2 -2
- package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-m5UZIobP.mjs} +7 -7
- package/dist/client/EventEmbeddedCheckoutStep-DL6zFAkA.mjs +289 -0
- package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-DeMfCM04.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CvZ3gOdD.mjs} +1 -1
- package/dist/client/{checkoutUrls-CXhko2Rv.mjs → RichText-BtfNvQV6.mjs} +2 -29
- package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-CUCNEwlH.mjs} +2 -18
- package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-C7WhXuRl.mjs} +2 -2
- package/dist/client/{accordion-kjvt49rA.mjs → accordion-cQm5mjqs.mjs} +1 -1
- package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-BVPJE5RQ.mjs} +15 -11
- package/dist/client/bookings.mjs +2860 -1222
- package/dist/client/{carousel-f4Zbmicv.mjs → carousel-3vgnY7LC.mjs} +2 -2
- package/dist/client/{carousel.client-A2lG-9od.mjs → carousel.client-CISsdZvg.mjs} +1 -1
- package/dist/client/{cart-DO20An50.mjs → cart-BGK4oOjm.mjs} +3 -3
- package/dist/client/{checkout-Du5amDR_.mjs → checkout-GsBLUNJD.mjs} +3 -3
- package/dist/client/checkoutUrls-ChxwaNtO.mjs +28 -0
- package/dist/client/client.mjs +3324 -2053
- package/dist/client/{colorStyles-j5U9v5JA.mjs → colorStyles-D-32xHZh.mjs} +2 -30
- package/dist/client/{context-eW97E945.mjs → context-D_8s12Fp.mjs} +1 -1
- package/dist/client/{dates-jPCirRea.mjs → dates-DeJQbQ9T.mjs} +2 -2
- package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-cmucD4NR.mjs} +10 -10
- package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-ku3E9FTl.mjs} +4 -4
- package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-CyKZ61sF.mjs} +5 -5
- package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-B7yxGIhX.mjs} +4 -4
- package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-BoXfSFgZ.mjs} +1455 -1184
- package/dist/client/{form-BvpfbQaT.mjs → form-CNQOWhJo.mjs} +5 -5
- package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-DahaBJGQ.mjs} +3 -3
- package/dist/client/hooks.mjs +283 -193
- package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BoDjqYlW.mjs} +4 -4
- package/dist/client/{media-Cl38iOMI.mjs → media-BFY0y2rb.mjs} +2 -1
- package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-DtzXDklw.mjs} +4 -4
- package/dist/client/{pricing-BES87mrR.mjs → pricing-DXEh2Lhh.mjs} +1 -1
- package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-D7cPa-00.mjs} +3 -3
- package/dist/client/{productList-DE7ngEZJ.mjs → productList-D1XMap66.mjs} +3 -3
- package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DiIeBopB.mjs} +913 -322
- package/dist/client/rendering/client.mjs +3913 -2260
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3302 -2013
- package/dist/client/result-DRW7JWXz.mjs +30 -0
- package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-wzR4lKAY.mjs} +1 -1
- package/dist/client/scrollToBlock-C86BYkyV.mjs +17 -0
- package/dist/client/{shop-CJkuySJ3.mjs → shop-CYT5P-S5.mjs} +13 -14
- package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-wKhsJQxI.mjs} +1 -1
- package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-ypBu_dx4.mjs} +9 -9
- package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DFGhYrf2.mjs} +52 -6
- package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-blSbN5o7.mjs} +8 -8
- package/dist/preview-next/before-render.mjs +15 -22
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/constants.mjs +5 -1
- package/dist/preview-next/index.mjs +5 -1
- package/dist/preview-next/keepAlive.mjs +149 -82
- package/dist/preview-next/middleware.mjs +15 -22
- package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
- package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-2p8uQk1V.mjs} +2 -2
- package/dist/{separator-CuNhBAhS.mjs → separator-Cvvzk0Oo.mjs} +1 -1
- package/dist/server/components.mjs +4041 -3704
- package/dist/server/config-validation.mjs +345 -255
- package/dist/server/config.mjs +345 -255
- package/dist/server/data.mjs +283 -193
- package/dist/server/index.mjs +20 -27
- package/dist/server/next.mjs +788 -469
- package/dist/server/page-converter.mjs +245 -121
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4018 -3690
- package/dist/server/rendering.mjs +4044 -3707
- package/dist/server/routing.mjs +314 -190
- package/dist/server/server.mjs +290 -218
- package/dist/server/theme-bridge.mjs +1122 -310
- package/dist/server/theme.mjs +126 -116
- package/dist/spinner-CDo6AkDz.mjs +658 -0
- package/dist/styles/index.css +75 -212
- package/package.json +1 -1
- package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
- package/dist/_dts/billing/src/checkout/platform.d.ts +0 -77
- package/dist/_dts/billing/src/config/env.d.ts +0 -29
- package/dist/_dts/billing/src/stripe/client.d.ts +0 -29
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +0 -63
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +0 -9
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
- package/dist/client/urlParams-D71VXFGx.mjs +0 -47
|
@@ -30,11 +30,6 @@ function setPreviewAuthCookies(res, { accessToken, refreshToken }, options) {
|
|
|
30
30
|
if (refreshToken) setPreviewRefreshCookie(res, refreshToken, options);
|
|
31
31
|
return res;
|
|
32
32
|
}
|
|
33
|
-
function clearPreviewCookies(res) {
|
|
34
|
-
res.cookies.delete(PREVIEW_COOKIE_NAME);
|
|
35
|
-
res.cookies.delete(PREVIEW_REFRESH_COOKIE_NAME);
|
|
36
|
-
return res;
|
|
37
|
-
}
|
|
38
33
|
//#endregion
|
|
39
34
|
//#region ../preview-next/src/jwt.ts
|
|
40
35
|
function base64UrlDecodeToString(value) {
|
|
@@ -2806,7 +2801,8 @@ const CLIENT_ERROR_REPORT_LIMITS = {
|
|
|
2806
2801
|
stack: 8e3,
|
|
2807
2802
|
digest: 128,
|
|
2808
2803
|
componentStack: 8e3,
|
|
2809
|
-
sourceLocation: 1024
|
|
2804
|
+
sourceLocation: 1024,
|
|
2805
|
+
navigationAgeMs: 6e4
|
|
2810
2806
|
};
|
|
2811
2807
|
const clientErrorEventSchema = z.enum([
|
|
2812
2808
|
"dashboard:route-error",
|
|
@@ -2823,7 +2819,17 @@ z.object({
|
|
|
2823
2819
|
stack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.stack).nullable(),
|
|
2824
2820
|
digest: z.string().max(CLIENT_ERROR_REPORT_LIMITS.digest).nullable(),
|
|
2825
2821
|
componentStack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.componentStack).nullable(),
|
|
2826
|
-
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable()
|
|
2822
|
+
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable(),
|
|
2823
|
+
navigation: z.object({
|
|
2824
|
+
fromPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
2825
|
+
toPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
2826
|
+
type: z.enum([
|
|
2827
|
+
"push",
|
|
2828
|
+
"replace",
|
|
2829
|
+
"traverse"
|
|
2830
|
+
]),
|
|
2831
|
+
ageMs: z.number().int().min(0).max(CLIENT_ERROR_REPORT_LIMITS.navigationAgeMs)
|
|
2832
|
+
}).strict().nullable().optional()
|
|
2827
2833
|
}).strict();
|
|
2828
2834
|
const API_ENDPOINTS = {
|
|
2829
2835
|
...SITE_LIFECYCLE_ENDPOINT_DEFINITIONS,
|
|
@@ -6580,24 +6586,6 @@ const API_ENDPOINTS = {
|
|
|
6580
6586
|
"server:internal_error"
|
|
6581
6587
|
]
|
|
6582
6588
|
},
|
|
6583
|
-
syncBookingPassWithStripe: {
|
|
6584
|
-
path: "/sites/{siteId}/bookings/passes/{passId}/sync-stripe",
|
|
6585
|
-
method: "POST",
|
|
6586
|
-
tags: [
|
|
6587
|
-
"site-{siteId}",
|
|
6588
|
-
"passes-{siteId}",
|
|
6589
|
-
"pass-{passId}"
|
|
6590
|
-
],
|
|
6591
|
-
auth: "user",
|
|
6592
|
-
responseKind: "json",
|
|
6593
|
-
errors: [
|
|
6594
|
-
"validation:invalid_input",
|
|
6595
|
-
"auth:forbidden",
|
|
6596
|
-
"resource:not_found",
|
|
6597
|
-
"resource:conflict",
|
|
6598
|
-
"server:internal_error"
|
|
6599
|
-
]
|
|
6600
|
-
},
|
|
6601
6589
|
refundCustomerPass: {
|
|
6602
6590
|
path: "/sites/{siteId}/bookings/customer-passes/{customerPassId}/refund",
|
|
6603
6591
|
method: "POST",
|
|
@@ -8061,7 +8049,7 @@ const API_ENDPOINTS = {
|
|
|
8061
8049
|
]
|
|
8062
8050
|
},
|
|
8063
8051
|
cancelFlexibleBalanceBookingDueToNonPayment: {
|
|
8064
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
8052
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/cancel-due-to-non-payment",
|
|
8065
8053
|
method: "POST",
|
|
8066
8054
|
auth: "user",
|
|
8067
8055
|
responseKind: "json",
|
|
@@ -8072,7 +8060,7 @@ const API_ENDPOINTS = {
|
|
|
8072
8060
|
]
|
|
8073
8061
|
},
|
|
8074
8062
|
reopenFlexibleBalanceBookingAfterNonPaymentCancellation: {
|
|
8075
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
8063
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/reopen",
|
|
8076
8064
|
method: "POST",
|
|
8077
8065
|
auth: "user",
|
|
8078
8066
|
responseKind: "json",
|
|
@@ -8186,52 +8174,138 @@ function parsePreviewRefreshResponse(value) {
|
|
|
8186
8174
|
}
|
|
8187
8175
|
//#endregion
|
|
8188
8176
|
//#region ../preview-next/src/keepAlive.ts
|
|
8189
|
-
function
|
|
8190
|
-
if (!accessToken) return
|
|
8177
|
+
function inspectAccessToken(accessToken, nowSeconds) {
|
|
8178
|
+
if (!accessToken) return { kind: "missing" };
|
|
8191
8179
|
try {
|
|
8192
8180
|
const exp = decodeJwtPayload(accessToken)?.exp;
|
|
8193
|
-
|
|
8194
|
-
|
|
8181
|
+
return typeof exp === "number" ? {
|
|
8182
|
+
kind: "known",
|
|
8183
|
+
expiresInSeconds: exp - nowSeconds
|
|
8184
|
+
} : { kind: "unreadable" };
|
|
8195
8185
|
} catch {
|
|
8196
|
-
return
|
|
8186
|
+
return { kind: "unreadable" };
|
|
8197
8187
|
}
|
|
8198
8188
|
}
|
|
8189
|
+
function tokenTtlBucket(lifetime) {
|
|
8190
|
+
if (lifetime.kind !== "known") return lifetime.kind;
|
|
8191
|
+
if (lifetime.expiresInSeconds <= 0) return "expired";
|
|
8192
|
+
if (lifetime.expiresInSeconds < 300) return "under_5m";
|
|
8193
|
+
if (lifetime.expiresInSeconds < 900) return "under_15m";
|
|
8194
|
+
return "at_least_15m";
|
|
8195
|
+
}
|
|
8196
|
+
function isCurrentToken(lifetime, thresholdSeconds) {
|
|
8197
|
+
return lifetime.kind === "known" && lifetime.expiresInSeconds >= thresholdSeconds;
|
|
8198
|
+
}
|
|
8199
|
+
function planPreviewTokens(accessToken, refreshToken, refreshThresholdSeconds, lifetime) {
|
|
8200
|
+
if (!refreshToken) return accessToken && isCurrentToken(lifetime, 1) ? {
|
|
8201
|
+
kind: "current",
|
|
8202
|
+
accessToken
|
|
8203
|
+
} : { kind: "unavailable" };
|
|
8204
|
+
return accessToken && isCurrentToken(lifetime, refreshThresholdSeconds) ? {
|
|
8205
|
+
kind: "current",
|
|
8206
|
+
accessToken
|
|
8207
|
+
} : {
|
|
8208
|
+
kind: "refresh",
|
|
8209
|
+
refreshToken
|
|
8210
|
+
};
|
|
8211
|
+
}
|
|
8199
8212
|
async function refreshAccessToken(params) {
|
|
8200
|
-
const { refreshToken, dashboardUrl,
|
|
8213
|
+
const { refreshToken, dashboardUrl, correlationId, fetcher } = params;
|
|
8201
8214
|
try {
|
|
8202
8215
|
const request = { refreshToken };
|
|
8203
8216
|
const response = await fetcher(buildPreviewAuthRefreshUrl({ dashboardBaseUrl: dashboardUrl }), {
|
|
8204
8217
|
method: "POST",
|
|
8205
8218
|
headers: {
|
|
8206
8219
|
"Content-Type": "application/json",
|
|
8207
|
-
Accept: "application/json"
|
|
8220
|
+
Accept: "application/json",
|
|
8221
|
+
"x-correlation-id": correlationId
|
|
8208
8222
|
},
|
|
8209
8223
|
cache: "no-store",
|
|
8210
8224
|
credentials: "omit",
|
|
8211
8225
|
body: JSON.stringify(request)
|
|
8212
8226
|
});
|
|
8213
|
-
if (!response.ok) {
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
}
|
|
8227
|
+
if (!response.ok) return {
|
|
8228
|
+
kind: "dashboard_rejected",
|
|
8229
|
+
dashboardStatus: response.status
|
|
8230
|
+
};
|
|
8217
8231
|
const envelope = await response.json().catch(() => null);
|
|
8218
8232
|
const data = parsePreviewRefreshResponse(isSuccessfulResponseEnvelope(envelope) ? envelope.data : null);
|
|
8219
|
-
if (!data.success) {
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
}
|
|
8223
|
-
return
|
|
8233
|
+
if (!data.success) return {
|
|
8234
|
+
kind: "malformed_response",
|
|
8235
|
+
dashboardStatus: response.status
|
|
8236
|
+
};
|
|
8237
|
+
return {
|
|
8238
|
+
kind: "refreshed",
|
|
8239
|
+
tokens: data.data,
|
|
8240
|
+
dashboardStatus: response.status
|
|
8241
|
+
};
|
|
8224
8242
|
} catch {
|
|
8225
|
-
|
|
8226
|
-
|
|
8243
|
+
return {
|
|
8244
|
+
kind: "network_error",
|
|
8245
|
+
dashboardStatus: null
|
|
8246
|
+
};
|
|
8227
8247
|
}
|
|
8228
8248
|
}
|
|
8249
|
+
function logKeepAliveOutcome({ logger, fields, previewOutcome, status, previewDashboardStatus = null }) {
|
|
8250
|
+
const meta = {
|
|
8251
|
+
...fields,
|
|
8252
|
+
previewOutcome,
|
|
8253
|
+
status,
|
|
8254
|
+
previewDashboardStatus
|
|
8255
|
+
};
|
|
8256
|
+
if (status >= 400) logger?.warn?.("preview-keepalive:outcome", meta);
|
|
8257
|
+
else logger?.info?.("preview-keepalive:outcome", meta);
|
|
8258
|
+
}
|
|
8259
|
+
async function respondToRefresh(params) {
|
|
8260
|
+
const { dashboardUrl, tokenPlan, correlationId, logFields, logger, fetcher, maxAge, secure } = params;
|
|
8261
|
+
if (!dashboardUrl) {
|
|
8262
|
+
logKeepAliveOutcome({
|
|
8263
|
+
logger,
|
|
8264
|
+
fields: logFields,
|
|
8265
|
+
previewOutcome: "dashboard_url_missing",
|
|
8266
|
+
status: 401
|
|
8267
|
+
});
|
|
8268
|
+
return NextResponse.json({ error: "Preview refresh is unavailable" }, { status: 401 });
|
|
8269
|
+
}
|
|
8270
|
+
const outcome = await refreshAccessToken({
|
|
8271
|
+
refreshToken: tokenPlan.refreshToken,
|
|
8272
|
+
dashboardUrl,
|
|
8273
|
+
correlationId,
|
|
8274
|
+
fetcher
|
|
8275
|
+
});
|
|
8276
|
+
if (outcome.kind !== "refreshed") {
|
|
8277
|
+
logKeepAliveOutcome({
|
|
8278
|
+
logger,
|
|
8279
|
+
fields: logFields,
|
|
8280
|
+
previewOutcome: outcome.kind,
|
|
8281
|
+
status: 401,
|
|
8282
|
+
previewDashboardStatus: outcome.dashboardStatus
|
|
8283
|
+
});
|
|
8284
|
+
return NextResponse.json({ error: "Unable to refresh preview session" }, { status: 401 });
|
|
8285
|
+
}
|
|
8286
|
+
logKeepAliveOutcome({
|
|
8287
|
+
logger,
|
|
8288
|
+
fields: logFields,
|
|
8289
|
+
previewOutcome: "refreshed",
|
|
8290
|
+
status: 200,
|
|
8291
|
+
previewDashboardStatus: outcome.dashboardStatus
|
|
8292
|
+
});
|
|
8293
|
+
const response = responseWithAccessToken(outcome.tokens.accessToken);
|
|
8294
|
+
setPreviewAuthCookies(response, outcome.tokens, {
|
|
8295
|
+
maxAge,
|
|
8296
|
+
secure
|
|
8297
|
+
});
|
|
8298
|
+
return response;
|
|
8299
|
+
}
|
|
8229
8300
|
function isSuccessfulResponseEnvelope(value) {
|
|
8230
8301
|
return typeof value === "object" && value !== null && !Array.isArray(value) && "success" in value && value.success === true && "data" in value;
|
|
8231
8302
|
}
|
|
8303
|
+
function responseWithAccessToken(accessToken) {
|
|
8304
|
+
return NextResponse.json({ accessToken }, { headers: { "Cache-Control": "no-store" } });
|
|
8305
|
+
}
|
|
8232
8306
|
function createPreviewKeepAliveRouteHandler(options = {}) {
|
|
8233
8307
|
const maxAge = options.maxAge ?? 43200;
|
|
8234
|
-
const refreshThresholdSeconds = options.refreshThresholdSeconds ??
|
|
8308
|
+
const refreshThresholdSeconds = options.refreshThresholdSeconds ?? 900;
|
|
8235
8309
|
const logger = options.logger;
|
|
8236
8310
|
const getCookies = options.getCookies ?? (async () => {
|
|
8237
8311
|
const store = await cookies();
|
|
@@ -8239,56 +8313,49 @@ function createPreviewKeepAliveRouteHandler(options = {}) {
|
|
|
8239
8313
|
});
|
|
8240
8314
|
const fetcher = options.fetcher ?? fetch;
|
|
8241
8315
|
return async function previewKeepAliveHandler(request) {
|
|
8242
|
-
const res = new NextResponse(null, { status: 204 });
|
|
8243
8316
|
const cookieStore = await getCookies();
|
|
8244
8317
|
const accessToken = cookieStore.get(PREVIEW_COOKIE_NAME)?.value;
|
|
8245
8318
|
const refreshToken = cookieStore.get(PREVIEW_REFRESH_COOKIE_NAME)?.value;
|
|
8246
8319
|
const url = new URL(request.url);
|
|
8320
|
+
const correlationId = crypto.randomUUID();
|
|
8247
8321
|
const isSecure = ((request.headers.get("x-forwarded-proto") ?? "").split(",")[0]?.trim() || url.protocol.replace(":", "")) === "https";
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8322
|
+
const lifetime = inspectAccessToken(accessToken, Math.floor(Date.now() / 1e3));
|
|
8323
|
+
const tokenPlan = planPreviewTokens(accessToken, refreshToken, refreshThresholdSeconds, lifetime);
|
|
8324
|
+
const logFields = {
|
|
8325
|
+
host: url.host,
|
|
8326
|
+
correlationId,
|
|
8327
|
+
previewDecision: tokenPlan.kind,
|
|
8328
|
+
previewTokenTtlBucket: tokenTtlBucket(lifetime),
|
|
8329
|
+
previewRefreshCookiePresent: Boolean(refreshToken)
|
|
8330
|
+
};
|
|
8331
|
+
if (tokenPlan.kind === "unavailable") {
|
|
8332
|
+
logKeepAliveOutcome({
|
|
8333
|
+
logger,
|
|
8334
|
+
fields: logFields,
|
|
8335
|
+
previewOutcome: "session_unavailable",
|
|
8336
|
+
status: 401
|
|
8255
8337
|
});
|
|
8256
|
-
return
|
|
8338
|
+
return NextResponse.json({ error: "Preview session is unavailable" }, { status: 401 });
|
|
8257
8339
|
}
|
|
8258
|
-
if (
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
secure: isSecure
|
|
8340
|
+
if (tokenPlan.kind === "current") {
|
|
8341
|
+
logKeepAliveOutcome({
|
|
8342
|
+
logger,
|
|
8343
|
+
fields: logFields,
|
|
8344
|
+
previewOutcome: "current",
|
|
8345
|
+
status: 200
|
|
8265
8346
|
});
|
|
8266
|
-
return
|
|
8267
|
-
}
|
|
8268
|
-
if (!options.dashboardUrl) {
|
|
8269
|
-
logger?.warn?.("preview-keepalive:missing-dashboard-url");
|
|
8270
|
-
const failure = NextResponse.json({ error: "Preview refresh is unavailable" }, { status: 401 });
|
|
8271
|
-
clearPreviewCookies(failure);
|
|
8272
|
-
return failure;
|
|
8347
|
+
return responseWithAccessToken(tokenPlan.accessToken);
|
|
8273
8348
|
}
|
|
8274
|
-
|
|
8275
|
-
const refreshed = await refreshAccessToken({
|
|
8276
|
-
refreshToken,
|
|
8349
|
+
return respondToRefresh({
|
|
8277
8350
|
dashboardUrl: options.dashboardUrl,
|
|
8351
|
+
tokenPlan,
|
|
8352
|
+
correlationId,
|
|
8353
|
+
logFields,
|
|
8278
8354
|
logger,
|
|
8279
|
-
fetcher
|
|
8280
|
-
});
|
|
8281
|
-
if (!refreshed) {
|
|
8282
|
-
logger?.warn?.("preview-keepalive:cleared-cookies");
|
|
8283
|
-
const failure = NextResponse.json({ error: "Unable to refresh preview session" }, { status: 401 });
|
|
8284
|
-
clearPreviewCookies(failure);
|
|
8285
|
-
return failure;
|
|
8286
|
-
}
|
|
8287
|
-
setPreviewAuthCookies(res, refreshed, {
|
|
8355
|
+
fetcher,
|
|
8288
8356
|
maxAge,
|
|
8289
8357
|
secure: isSecure
|
|
8290
8358
|
});
|
|
8291
|
-
return res;
|
|
8292
8359
|
};
|
|
8293
8360
|
}
|
|
8294
8361
|
//#endregion
|
|
@@ -2778,7 +2778,8 @@ const CLIENT_ERROR_REPORT_LIMITS = {
|
|
|
2778
2778
|
stack: 8e3,
|
|
2779
2779
|
digest: 128,
|
|
2780
2780
|
componentStack: 8e3,
|
|
2781
|
-
sourceLocation: 1024
|
|
2781
|
+
sourceLocation: 1024,
|
|
2782
|
+
navigationAgeMs: 6e4
|
|
2782
2783
|
};
|
|
2783
2784
|
const clientErrorEventSchema = z.enum([
|
|
2784
2785
|
"dashboard:route-error",
|
|
@@ -2795,7 +2796,17 @@ z.object({
|
|
|
2795
2796
|
stack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.stack).nullable(),
|
|
2796
2797
|
digest: z.string().max(CLIENT_ERROR_REPORT_LIMITS.digest).nullable(),
|
|
2797
2798
|
componentStack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.componentStack).nullable(),
|
|
2798
|
-
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable()
|
|
2799
|
+
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable(),
|
|
2800
|
+
navigation: z.object({
|
|
2801
|
+
fromPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
2802
|
+
toPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
2803
|
+
type: z.enum([
|
|
2804
|
+
"push",
|
|
2805
|
+
"replace",
|
|
2806
|
+
"traverse"
|
|
2807
|
+
]),
|
|
2808
|
+
ageMs: z.number().int().min(0).max(CLIENT_ERROR_REPORT_LIMITS.navigationAgeMs)
|
|
2809
|
+
}).strict().nullable().optional()
|
|
2799
2810
|
}).strict();
|
|
2800
2811
|
const API_ENDPOINTS = {
|
|
2801
2812
|
...SITE_LIFECYCLE_ENDPOINT_DEFINITIONS,
|
|
@@ -6552,24 +6563,6 @@ const API_ENDPOINTS = {
|
|
|
6552
6563
|
"server:internal_error"
|
|
6553
6564
|
]
|
|
6554
6565
|
},
|
|
6555
|
-
syncBookingPassWithStripe: {
|
|
6556
|
-
path: "/sites/{siteId}/bookings/passes/{passId}/sync-stripe",
|
|
6557
|
-
method: "POST",
|
|
6558
|
-
tags: [
|
|
6559
|
-
"site-{siteId}",
|
|
6560
|
-
"passes-{siteId}",
|
|
6561
|
-
"pass-{passId}"
|
|
6562
|
-
],
|
|
6563
|
-
auth: "user",
|
|
6564
|
-
responseKind: "json",
|
|
6565
|
-
errors: [
|
|
6566
|
-
"validation:invalid_input",
|
|
6567
|
-
"auth:forbidden",
|
|
6568
|
-
"resource:not_found",
|
|
6569
|
-
"resource:conflict",
|
|
6570
|
-
"server:internal_error"
|
|
6571
|
-
]
|
|
6572
|
-
},
|
|
6573
6566
|
refundCustomerPass: {
|
|
6574
6567
|
path: "/sites/{siteId}/bookings/customer-passes/{customerPassId}/refund",
|
|
6575
6568
|
method: "POST",
|
|
@@ -8033,7 +8026,7 @@ const API_ENDPOINTS = {
|
|
|
8033
8026
|
]
|
|
8034
8027
|
},
|
|
8035
8028
|
cancelFlexibleBalanceBookingDueToNonPayment: {
|
|
8036
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
8029
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/cancel-due-to-non-payment",
|
|
8037
8030
|
method: "POST",
|
|
8038
8031
|
auth: "user",
|
|
8039
8032
|
responseKind: "json",
|
|
@@ -8044,7 +8037,7 @@ const API_ENDPOINTS = {
|
|
|
8044
8037
|
]
|
|
8045
8038
|
},
|
|
8046
8039
|
reopenFlexibleBalanceBookingAfterNonPaymentCancellation: {
|
|
8047
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
8040
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/reopen",
|
|
8048
8041
|
method: "POST",
|
|
8049
8042
|
auth: "user",
|
|
8050
8043
|
responseKind: "json",
|
|
@@ -2749,7 +2749,8 @@ const CLIENT_ERROR_REPORT_LIMITS = {
|
|
|
2749
2749
|
stack: 8e3,
|
|
2750
2750
|
digest: 128,
|
|
2751
2751
|
componentStack: 8e3,
|
|
2752
|
-
sourceLocation: 1024
|
|
2752
|
+
sourceLocation: 1024,
|
|
2753
|
+
navigationAgeMs: 6e4
|
|
2753
2754
|
};
|
|
2754
2755
|
const clientErrorEventSchema = z.enum([
|
|
2755
2756
|
"dashboard:route-error",
|
|
@@ -2766,7 +2767,17 @@ z.object({
|
|
|
2766
2767
|
stack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.stack).nullable(),
|
|
2767
2768
|
digest: z.string().max(CLIENT_ERROR_REPORT_LIMITS.digest).nullable(),
|
|
2768
2769
|
componentStack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.componentStack).nullable(),
|
|
2769
|
-
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable()
|
|
2770
|
+
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable(),
|
|
2771
|
+
navigation: z.object({
|
|
2772
|
+
fromPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
2773
|
+
toPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
2774
|
+
type: z.enum([
|
|
2775
|
+
"push",
|
|
2776
|
+
"replace",
|
|
2777
|
+
"traverse"
|
|
2778
|
+
]),
|
|
2779
|
+
ageMs: z.number().int().min(0).max(CLIENT_ERROR_REPORT_LIMITS.navigationAgeMs)
|
|
2780
|
+
}).strict().nullable().optional()
|
|
2770
2781
|
}).strict();
|
|
2771
2782
|
const API_ENDPOINTS = {
|
|
2772
2783
|
...SITE_LIFECYCLE_ENDPOINT_DEFINITIONS,
|
|
@@ -6523,24 +6534,6 @@ const API_ENDPOINTS = {
|
|
|
6523
6534
|
"server:internal_error"
|
|
6524
6535
|
]
|
|
6525
6536
|
},
|
|
6526
|
-
syncBookingPassWithStripe: {
|
|
6527
|
-
path: "/sites/{siteId}/bookings/passes/{passId}/sync-stripe",
|
|
6528
|
-
method: "POST",
|
|
6529
|
-
tags: [
|
|
6530
|
-
"site-{siteId}",
|
|
6531
|
-
"passes-{siteId}",
|
|
6532
|
-
"pass-{passId}"
|
|
6533
|
-
],
|
|
6534
|
-
auth: "user",
|
|
6535
|
-
responseKind: "json",
|
|
6536
|
-
errors: [
|
|
6537
|
-
"validation:invalid_input",
|
|
6538
|
-
"auth:forbidden",
|
|
6539
|
-
"resource:not_found",
|
|
6540
|
-
"resource:conflict",
|
|
6541
|
-
"server:internal_error"
|
|
6542
|
-
]
|
|
6543
|
-
},
|
|
6544
6537
|
refundCustomerPass: {
|
|
6545
6538
|
path: "/sites/{siteId}/bookings/customer-passes/{customerPassId}/refund",
|
|
6546
6539
|
method: "POST",
|
|
@@ -8004,7 +7997,7 @@ const API_ENDPOINTS = {
|
|
|
8004
7997
|
]
|
|
8005
7998
|
},
|
|
8006
7999
|
cancelFlexibleBalanceBookingDueToNonPayment: {
|
|
8007
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
8000
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/cancel-due-to-non-payment",
|
|
8008
8001
|
method: "POST",
|
|
8009
8002
|
auth: "user",
|
|
8010
8003
|
responseKind: "json",
|
|
@@ -8015,7 +8008,7 @@ const API_ENDPOINTS = {
|
|
|
8015
8008
|
]
|
|
8016
8009
|
},
|
|
8017
8010
|
reopenFlexibleBalanceBookingAfterNonPaymentCancellation: {
|
|
8018
|
-
path: "/sites/{siteId}/shop/orders/{orderId}/
|
|
8011
|
+
path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/reopen",
|
|
8019
8012
|
method: "POST",
|
|
8020
8013
|
auth: "user",
|
|
8021
8014
|
responseKind: "json",
|
|
@@ -8646,14 +8639,14 @@ async function parseSuccessResponse(endpoint, response, config) {
|
|
|
8646
8639
|
default: return buildSuccessEnvelope(void 0, requestId);
|
|
8647
8640
|
}
|
|
8648
8641
|
}
|
|
8649
|
-
function createRawCMSClient(
|
|
8642
|
+
function createRawCMSClient(getHeaders = () => ({}), baseUrl) {
|
|
8650
8643
|
return ({ endpoint, body, params, options = {} }) => {
|
|
8651
8644
|
const plan = buildApiRequestPlan({
|
|
8652
8645
|
endpoint,
|
|
8653
8646
|
body,
|
|
8654
8647
|
params,
|
|
8655
8648
|
options,
|
|
8656
|
-
headers,
|
|
8649
|
+
headers: getHeaders(),
|
|
8657
8650
|
baseUrl: normalizeCmsApiBaseUrl(baseUrl ?? resolveApiBaseUrl()),
|
|
8658
8651
|
sdkVersion
|
|
8659
8652
|
});
|
|
@@ -8758,11 +8751,8 @@ function createParsedClient(rawClient) {
|
|
|
8758
8751
|
return parseSuccessResponse(endpoint, response, config);
|
|
8759
8752
|
};
|
|
8760
8753
|
}
|
|
8761
|
-
function createCMSClient(headers = {}, baseUrl) {
|
|
8762
|
-
return createParsedClient(createRawCMSClient(headers, baseUrl));
|
|
8763
|
-
}
|
|
8764
8754
|
function createBearerAPIClient(token, baseUrl) {
|
|
8765
|
-
return
|
|
8755
|
+
return createParsedClient(createRawCMSClient(() => ({ Authorization: `Bearer ${typeof token === "function" ? token() : token}` }), baseUrl));
|
|
8766
8756
|
}
|
|
8767
8757
|
//#endregion
|
|
8768
8758
|
//#region ../preview-next/src/auth-contract.ts
|
|
@@ -8788,6 +8778,7 @@ function getPreviewRuntimeSessionAuthMode(session) {
|
|
|
8788
8778
|
//#endregion
|
|
8789
8779
|
//#region ../preview-next/src/client/previewAuthStore.ts
|
|
8790
8780
|
const listeners = /* @__PURE__ */ new Set();
|
|
8781
|
+
const handledApiAuthErrors = /* @__PURE__ */ new WeakSet();
|
|
8791
8782
|
let internal = {
|
|
8792
8783
|
state: "expired",
|
|
8793
8784
|
session: null,
|
|
@@ -8832,6 +8823,15 @@ function usePreviewAuth() {
|
|
|
8832
8823
|
function usePreviewToken() {
|
|
8833
8824
|
return useSyncExternalStore(subscribe, getState, getState).token;
|
|
8834
8825
|
}
|
|
8826
|
+
function getPreviewAccessToken() {
|
|
8827
|
+
const { token, state } = getState();
|
|
8828
|
+
if (token && state === "ok") return token;
|
|
8829
|
+
markPreviewAuthExpired("query");
|
|
8830
|
+
throw new Error("Preview access token is unavailable");
|
|
8831
|
+
}
|
|
8832
|
+
function setPreviewAccessToken(token) {
|
|
8833
|
+
if (getState().state === "ok") setState({ token });
|
|
8834
|
+
}
|
|
8835
8835
|
function normalizePreviewRuntimeSession(input) {
|
|
8836
8836
|
if ("session" in input) return input.session;
|
|
8837
8837
|
return resolvePreviewRuntimeSession({
|
|
@@ -8860,6 +8860,26 @@ function markPreviewAuthExpired(source) {
|
|
|
8860
8860
|
token: null
|
|
8861
8861
|
});
|
|
8862
8862
|
}
|
|
8863
|
+
/** Handle bearer 401s at the request boundary, including calls outside the query cache. */
|
|
8864
|
+
function createGuardedPreviewApiClient(baseUrl) {
|
|
8865
|
+
return async (params) => {
|
|
8866
|
+
const requestToken = getPreviewAccessToken();
|
|
8867
|
+
try {
|
|
8868
|
+
return await createBearerAPIClient(requestToken, baseUrl)(params);
|
|
8869
|
+
} catch (error) {
|
|
8870
|
+
if (error instanceof ApiRequestError && error.status === 401) {
|
|
8871
|
+
handledApiAuthErrors.add(error);
|
|
8872
|
+
const current = getState();
|
|
8873
|
+
if (current.state === "ok" && current.token === requestToken) markPreviewAuthExpired("query");
|
|
8874
|
+
}
|
|
8875
|
+
throw error;
|
|
8876
|
+
}
|
|
8877
|
+
};
|
|
8878
|
+
}
|
|
8879
|
+
/** Query callbacks receive the same error after the request guard has decided auth state. */
|
|
8880
|
+
function wasPreviewApiAuthErrorHandled(error) {
|
|
8881
|
+
return error instanceof ApiRequestError && handledApiAuthErrors.has(error);
|
|
8882
|
+
}
|
|
8863
8883
|
function usePreviewAuthFetch(baseFetch) {
|
|
8864
8884
|
return React$1.useCallback(async (input, init, source) => {
|
|
8865
8885
|
if (getState().state === "expired") {
|
|
@@ -8883,4 +8903,4 @@ function usePreviewAuthFetch(baseFetch) {
|
|
|
8883
8903
|
}, [baseFetch]);
|
|
8884
8904
|
}
|
|
8885
8905
|
//#endregion
|
|
8886
|
-
export {
|
|
8906
|
+
export { SURFACE_IDS as _, usePreviewAuth as a, wasPreviewApiAuthErrorHandled as c, ApiEnvelopeError as d, extractApiEnvelopeErrorDetails as f, SURFACE_DOCUMENT_DATA_ATTRIBUTE as g, DEFAULT_SURFACE_ID as h, setPreviewAccessToken as i, isPreviewRuntimeSessionEditable as l, getDashboardUrl as m, initPreviewAuth as n, usePreviewAuthFetch as o, unwrapResponse as p, markPreviewAuthExpired as r, usePreviewToken as s, createGuardedPreviewApiClient as t, ApiRequestError as u, resolveSurfaceDocumentAttributes as v, API_ENDPOINTS as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "./PreviewQueryProvider-
|
|
3
|
-
import { i as PreviewShellLayout, r as PreviewShell } from "./SdkPreviewModeRuntime-
|
|
2
|
+
import "./PreviewQueryProvider-C0mndwHB.mjs";
|
|
3
|
+
import { i as PreviewShellLayout, r as PreviewShell } from "./SdkPreviewModeRuntime-tj45gmCX.mjs";
|
|
4
4
|
export { PreviewShell, PreviewShellLayout };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { fo as Primitive, zo as cn } from "./SiteChromeCustomizeContext-
|
|
2
|
+
import { fo as Primitive, zo as cn } from "./SiteChromeCustomizeContext-BFOt0ss-.mjs";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region ../../node_modules/.pnpm/@radix-ui+react-separator@1.1.10_@types+react-dom@19.2.3_@types+react@19.2.17__@types+r_adfab47c9055efb8b0c4b77a2b96b053/node_modules/@radix-ui/react-separator/dist/index.mjs
|