@riverbankcms/sdk 0.182.0 → 0.184.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/CHANGELOG.md +79 -0
- package/README.md +83 -4
- package/dist/_dts/{BlocksIslandsHydrator-Bvw2bUif.d.ts → BlocksIslandsHydrator-DjBTJYiF.d.ts} +1 -1
- package/dist/_dts/{Page-B2EAT-bE.d.ts → Page-BpXEM2ET.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D0vww6rh.d.ts → SdkPreviewMode-Bb3h7KRE.d.ts} +2 -2
- package/dist/_dts/{client-D6T430bk.d.ts → client-DgTRRtl_.d.ts} +14 -1
- package/dist/_dts/{content-types-wZVWccC6.d.ts → content-types-DZQJp_ak.d.ts} +9 -16
- package/dist/_dts/{contracts-B-vtOcr8.d.ts → contracts-Ww1fmd-c.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CxfwHE6z.d.ts → generatePageMetadata-BGc7dju6.d.ts} +2 -2
- package/dist/_dts/{index-CciRW_w1.d.ts → index-BECaUNYs.d.ts} +2 -2
- package/dist/_dts/{index-CEyYMhLJ.d.ts → index-Cc85KVLW.d.ts} +3 -3
- package/dist/_dts/{index-CQrb3Ccc.d.ts → index-Cni4jykw.d.ts} +4 -4
- package/dist/_dts/{index-DIU-wL1M.d.ts → index-DxxTQ_0V.d.ts} +2 -2
- package/dist/_dts/{index-Cqxis-nv.d.ts → index-W9-7djG3.d.ts} +1 -1
- package/dist/_dts/{index-DqPKdeTk.d.ts → index-ukS-Ffem.d.ts} +1 -1
- package/dist/_dts/{loadContent-D0wrxiSp.d.ts → loadContent-BlSWTlbD.d.ts} +7 -7
- package/dist/_dts/{request-DEwxUSw8.d.ts → request-CZz2BoXJ.d.ts} +89478 -88093
- package/dist/_dts/{resolveBlockData-VaG_MYbN.d.ts → resolveBlockData-D12HXnS3.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DTwklC_v.d.ts → resolvePageContent-BteMsSGP.d.ts} +1 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +7 -7
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/portal/index.d.ts +10 -2
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +126 -2
- package/dist/_dts/{serviceBookingOutline-DtQuFlID.d.ts → serviceBookingOutline-aTlOvO3U.d.ts} +16 -8
- package/dist/_dts/{types-B3RjeBLV.d.ts → types-Bi7R07RX.d.ts} +45 -4
- package/dist/_dts/{types-BvUSGQrw.d.ts → types-CCcQlRBi.d.ts} +22 -12
- package/dist/_dts/{types-CkRFtBqd.d.ts → types-Du4aMnWC.d.ts} +13 -15
- package/dist/_dts/{validation-BZA3DhcV.d.ts → validation-CjCWVmwe.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CQMf0HdN.mjs → BlocksIslandsHydrator-CFLWxjxR.mjs} +22 -18
- package/dist/client/{BookingMailingListNote-7kdvuPow.mjs → BookingMailingListNote-C4LcfwyA.mjs} +8 -8
- package/dist/client/{BookingQuestionFields-BJI7mZuV.mjs → BookingQuestionFields-DdcmoHqQ.mjs} +2 -2
- package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-DYGewmvh.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-DPUD6wjy.mjs → CalendarNavigationChevron-ZfrUiiiI.mjs} +25 -8
- package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-CTMIII37.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-8kwNF9HN.mjs → DemoBookingPortalAccess-pzkGVkgG.mjs} +7 -5
- package/dist/client/{EventCalendar.client-Dhb14bcC.mjs → EventCalendar.client-Ct1B3xI4.mjs} +10 -10
- package/dist/client/{EventCombined.client-C1jEZBN9.mjs → EventCombined.client-DgfNtcgW.mjs} +9 -9
- package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-CjoaG1zy.mjs} +1 -1
- package/dist/client/{EventItem-Bb0ppG2N.mjs → EventItem-KGKkK19N.mjs} +29 -14
- package/dist/client/{EventListWeekNavigation-DMryCaNV.mjs → EventListWeekNavigation-Ba9ezxuC.mjs} +1 -1
- package/dist/client/{EventListing.client-BuH5kKA3.mjs → EventListing.client-xFKRDLwC.mjs} +3 -3
- package/dist/client/{EventListing.view-DsqvuulZ.mjs → EventListing.view-Dy36vWHi.mjs} +84 -7
- package/dist/client/{EventRegistrationPayment-D4FvQSFF.mjs → EventRegistrationPayment-Dth9L00x.mjs} +118 -76
- package/dist/client/{Page-sV6BJkXX.mjs → Page-DB5KODiu.mjs} +4491 -1398
- package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-CY6u5sQa.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-VfSd6JU-.mjs → SiteTermsAgreementField-BDVP_HeK.mjs} +3 -3
- package/dist/client/{StepIndicator-B6o5B7g3.mjs → StepIndicator-CLgDVzCs.mjs} +1 -1
- package/dist/client/{StepIndicator-BTqO7cJl.mjs → StepIndicator-DRyZ8igu.mjs} +7 -7
- package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-C4rCsPCt.mjs} +52 -10
- package/dist/client/{accessibleSurfaces-BogaGutk.mjs → accessibleSurfaces-CqroimVQ.mjs} +1024 -619
- package/dist/client/{accordion-6cuswD_s.mjs → accordion-BQYRP5xV.mjs} +1 -1
- package/dist/client/{booking-form.client-BOMe_SKi.mjs → booking-form.client-B7ckDuOC.mjs} +191 -71
- package/dist/client/{bookingForm-DSCH-VHo.mjs → bookingForm-BeD4650p.mjs} +7 -6
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BFuqZCfz.mjs → boxStyleClassNames-CA7FirMH.mjs} +2 -2
- package/dist/client/buttonParts-C39GC0kz.mjs +1518 -0
- package/dist/client/{carousel-CGyQVV1M.mjs → carousel-DJ9Aa1m3.mjs} +2 -2
- package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DKWqVHHh.mjs} +1 -1
- package/dist/client/{cart-BYOe7MCh.mjs → cart-DdCenbTy.mjs} +3 -3
- package/dist/client/{cart.client-BKFkaXdV.mjs → cart.client-BQm06qNw.mjs} +1 -1
- package/dist/client/{checkout-Dwd7Di77.mjs → checkout-45wPQULN.mjs} +3 -3
- package/dist/client/{checkout.client-C25hpi-z.mjs → checkout.client-bSv4cc5z.mjs} +1 -1
- package/dist/client/{checkoutUrls-tG788sw0.mjs → checkoutUrls-CwlaMl3W.mjs} +1 -1
- package/dist/client/client.mjs +460 -119
- package/dist/client/{constants-DdxFG3Ic.mjs → constants-DXV4KR7l.mjs} +1 -1
- package/dist/client/{context-Hi1RuYEM.mjs → context-lCPfX-xe.mjs} +15 -5
- package/dist/client/{dateFormatting-C8vBCHuo.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BAL5UIDG.mjs → demoPortalMagicLink-Ce3Gyin_.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Dv1Lr9kJ.mjs → enhanceHeaderSection-CGcDE9aE.mjs} +4 -4
- package/dist/client/{event-registration.client-dB_Z7bb-.mjs → event-registration.client-DlPfn4YG.mjs} +52 -29
- package/dist/client/{eventCalendar-CQnRA4Ww.mjs → eventCalendar-CioAdryV.mjs} +4 -4
- package/dist/client/{eventCombined-BDOG1hVp.mjs → eventCombined-Dwt0G6ez.mjs} +4 -4
- package/dist/client/{eventListing-DSVmhy9n.mjs → eventListing-B3H9ifOC.mjs} +4 -4
- package/dist/client/{eventRegistration-CD5mRtEH.mjs → eventRegistration-Do7cAhXb.mjs} +7 -6
- package/dist/client/{form-DWnlEVSK.mjs → form-CsqzgC6v.mjs} +3 -3
- package/dist/client/{form.client-D7zmeqNI.mjs → form.client-DVDB7hY6.mjs} +5 -5
- package/dist/client/{form.parts-C-G6N_MK.mjs → form.parts-1q2rzSYt.mjs} +3 -3
- package/dist/client/gifting/client.mjs +16 -9
- package/dist/client/{gifting-Cn0jidP5.mjs → gifting-BrXQGX-k.mjs} +4 -4
- package/dist/client/{gifting.client-DVo1YFLs.mjs → gifting.client--zAjnY5N.mjs} +155 -85
- package/dist/client/gifting.interactive-CrwHpUJG.mjs +207 -0
- package/dist/client/gifting.parts-CcKdDaQq.mjs +124 -0
- package/dist/client/{headerSection-DjQuj_6v.mjs → headerSection-DlcDH4bi.mjs} +2 -2
- package/dist/client/{noop-jesvJXEE.mjs → islands-dMh0Oxli.mjs} +16103 -7965
- package/dist/client/{newsletter-form.client-rIYPziZC.mjs → newsletter-form.client-BxA1PsdS.mjs} +6 -6
- package/dist/client/{newsletter-form.interactive-DVt3enLr.mjs → newsletter-form.interactive-D0iRg7p2.mjs} +229 -197
- package/dist/client/{newsletter-form.parts-CH6dGfdn.mjs → newsletter-form.parts-Dmuklz0r.mjs} +2 -2
- package/dist/client/{newsletterForm-Cg8cBDHd.mjs → newsletterForm-CBzvgIfg.mjs} +3 -3
- package/dist/client/portal/client.mjs +51 -35
- package/dist/client/{portalOrders-oEoTvzkW.mjs → portalOrders-tCxS04g0.mjs} +3 -2
- package/dist/client/{portalRoutes-ByyVZfVq.mjs → portalRoutes-DiGibcZI.mjs} +31 -9
- package/dist/client/portalSession-0XhXyTxT.mjs +41 -0
- package/dist/client/{product-detail.client-5aHq-vuu.mjs → product-detail.client-D9MP8hvH.mjs} +1 -1
- package/dist/client/{product-list.client-CyAk5rnC.mjs → product-list.client-wCz1qcUY.mjs} +1 -1
- package/dist/client/{productDetail-B8aZ2mqY.mjs → productDetail-D9-fCY6c.mjs} +3 -3
- package/dist/client/{productList-BuLemmod.mjs → productList-PJyxXSac.mjs} +3 -3
- package/dist/client/{propsDecoder-0Unsqn3R.mjs → propsDecoder-B8lrKGPw.mjs} +4 -2
- package/dist/client/{registry.server-DzvtVVD0.mjs → registry.server-CI63JVHW.mjs} +2444 -1078
- package/dist/client/rendering/client.mjs +32 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +5 -5
- package/dist/client/{richText-coerce-Bnng7JFA.mjs → richText-coerce-Jt9hDHdh.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-BGfcc9sk.mjs → routeIslandApiConfig-ZSPcJWx1.mjs} +1 -1
- package/dist/client/runtimeResponse-DlPBWBd9.mjs +3 -0
- package/dist/client/{runtimeResponse-DAPVRToN.mjs → runtimeResponse-_iW9oEYc.mjs} +1 -1
- package/dist/client/{shop-GuMqnDL-.mjs → shop-CbdJlWOw.mjs} +3 -3
- package/dist/client/{shop-commerce-D5bDY1o1.mjs → shop-commerce-BqLbzUUn.mjs} +47 -28
- package/dist/client/{shop-commerce-store-B7sHnLwI.mjs → shop-commerce-store-BT0-zRqN.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-Dos2zdC2.mjs → shop-discount-apply.state-Cws0lnSb.mjs} +2 -2
- package/dist/client/{shop.client-uvj5GDZb.mjs → shop.client-0cNErhJT.mjs} +54 -24
- package/dist/client/{shopShared-3giNWE3H.mjs → shopShared-COuQ2MhQ.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{src-CmXh3JWs.mjs → src-Do_s2lqH.mjs} +11 -18
- package/dist/client/{timetableModel-GA-hn1qM.mjs → timetableModel-DqI6U1BS.mjs} +11 -8
- package/dist/client/{urlParams-C2QHo1Pa.mjs → useAutomaticDiscountPreview-CeVUVzGf.mjs} +44 -1
- package/dist/client/{useAvailableSlots-CBneCxbG.mjs → useAvailableSlots-B0mjVhZr.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-D0kGF0C7.mjs → useDiscountCodeUi-B_hfgdAP.mjs} +6 -2
- package/dist/client/{useEventPagination-xX8n_Tuu.mjs → useEventPagination-Ct4A6iR1.mjs} +14 -16
- package/dist/client/{view-DOyZc-DF.mjs → view-Cj151w4m.mjs} +24 -9
- package/dist/client/{wizardSteps-B952ify5.mjs → wizardSteps-B3gsXNnb.mjs} +283 -222
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-aRJjq4x8.mjs → EventEmbeddedCheckoutStep-CVy9oapv.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-BW3dRFIv.mjs → LocationPickerEnvironment-DuRUwUrK.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Db9BHyXh.mjs → MapLibreEditMap-CdSDYBq9.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-BI3UCdpu.mjs → PageSectionToolbar-Dv4CW0AQ.mjs} +952 -138
- package/dist/preview-next/client/{PreviewEditorSidebar-jkfLVOgY.mjs → PreviewEditorSidebar-B7WW58uE.mjs} +4774 -2040
- package/dist/preview-next/client/{PreviewEditorUI-DwJQs4hM.mjs → PreviewEditorUI-BnJ1ughv.mjs} +71 -47
- package/dist/preview-next/client/{PreviewShell-BAxAkuz8.mjs → PreviewShell-C7qWzAe4.mjs} +72 -40
- package/dist/preview-next/client/{SdkPreviewModeRuntime-0UVB-39f.mjs → SdkPreviewModeRuntime-CYi4UHtG.mjs} +135 -30
- package/dist/preview-next/client/{ThemedButton-CVYz7h68.mjs → ThemedButton-CRgbU75r.mjs} +799 -17
- package/dist/preview-next/client/{lucide-react-00FF_oar.mjs → lucide-react-B4c6U3ZU.mjs} +11 -1
- package/dist/preview-next/client/{previewAssistantSlot-BgiYk3PB.mjs → previewAssistantSlot-DrUoRNu9.mjs} +24203 -9291
- package/dist/preview-next/client/{previewChromeRoot-tieNdF3E.mjs → previewChromeRoot-CEYp90mM.mjs} +3 -90
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DXb_Evl0.mjs → sdk-runtime-DnO2_c0A.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BlN0jt2c.mjs → siteStyleAccess-B3PwHw2z.mjs} +46 -11
- package/dist/preview-next/client/{useAutosaveStatus-BUEPA4oL.mjs → useAutosaveStatus-DrdQ4ier.mjs} +49 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BVfr5P--.mjs → useOpenBlockForSetup-kuGRKaRL.mjs} +2008 -448
- package/dist/preview-next/container-responsive.css +469 -2
- package/dist/preview-next/editor-chrome.css +23 -2
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BHTBA48n.mjs → route-contract-CwrXkLT3.mjs} +177 -43
- package/dist/server/{Block.shared-hGoyEdjJ.mjs → Block.shared-C5ucphCJ.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BfUCTOwj.mjs → ThemeScopeCore-DvbqYXdK.mjs} +46 -10
- package/dist/server/{accessibleSurfaces-Dskni4Xj.mjs → accessibleSurfaces-CAcf1lHT.mjs} +732 -176
- package/dist/server/{accordions-By_0Ykks.mjs → accordions-DjcsqjCK.mjs} +1 -1
- package/dist/server/{bindings-DMJH4bvo.mjs → bindings-CFw4M-gZ.mjs} +69 -248
- package/dist/server/{client-DrwlRNAH.mjs → client-D0XCgITW.mjs} +488 -119
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-CeMywaiD.mjs → constants-BZduY8jG.mjs} +31 -8
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +4 -4
- package/dist/server/{loadContent-D0prFflT.mjs → loadContent-C-qyB8Tq.mjs} +11 -10
- package/dist/server/{loadPage-CBLke9pJ.mjs → loadPage-BpKKmi8E.mjs} +3 -3
- package/dist/server/lookMediaFrame-EFws7tAj.mjs +31835 -0
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-wrcuWmgp.mjs → navigation-DYkuiNXa.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-DUgCEH8z.mjs → overrideResolution-DmZn4xUE.mjs} +1 -1
- package/dist/server/page-converter.mjs +18 -5
- package/dist/server/{pageRenderPlan-BHrmogsW.mjs → pageRenderPlan-DRB7cUZ0.mjs} +674 -298
- package/dist/server/{pageRuntimeSupport-D2-YMRei.mjs → pageRuntimeSupport-Uv1xDieJ.mjs} +13 -6
- package/dist/server/{pageShared-CG8O31Eo.mjs → pageShared-BdQF875z.mjs} +911 -516
- package/dist/server/{parseThemeForPersistence-CrPlbJEN.mjs → parseThemeForPersistence-CwcWZL7u.mjs} +3 -3
- package/dist/server/{portal-pG_uhsI2.mjs → portal-BQ8qiQnk.mjs} +22 -2
- package/dist/server/portal.mjs +3 -3
- package/dist/server/{prebuild-C8Amvzce.mjs → prebuild-B51QZVNe.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-BxUETRIZ.mjs → prefetchBlockData-CppDAfJW.mjs} +4 -4
- package/dist/server/{registry-Cc88-23f.mjs → registry-Bf4W8Qa7.mjs} +7585 -24378
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +10 -10
- package/dist/server/{resolveBlockData-OG3KOkig.mjs → resolveBlockData-DMHAZooQ.mjs} +2 -2
- package/dist/server/{expandPalette-ehuW8r2g.mjs → resolveButtonColourStates-BMtAAPzp.mjs} +1670 -1346
- package/dist/server/{responseMedia-IfH65QAH.mjs → responseMedia-DKYfR518.mjs} +1 -1
- package/dist/server/{schema-CwfxQjc4.mjs → schema-DGaihVwp.mjs} +300 -29
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-BcFuhhD7.mjs → servicePageContent-CRvmreX7.mjs} +40 -16
- package/dist/server/theme-bridge.mjs +5 -4
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-DPaUPTfl.mjs → three-pass-converter-mcy2E1Yd.mjs} +2 -2
- package/dist/server/{titleSourceSchema-NhK6azFS.mjs → titleSourceSchema-B2qFOUwZ.mjs} +4 -5
- package/dist/server/{typeGuards-CTW_9AXq.mjs → typeGuards-DZOaGTEv.mjs} +126 -126
- package/dist/server/{types-BKaBZFjD.mjs → types-C_S0pWbR.mjs} +487 -9
- package/dist/server/{validation-BovmbS8N.mjs → validation-CUtNT_EZ.mjs} +14 -10
- package/dist/server/{version-hws4hgyX.mjs → version-DebJQ4zn.mjs} +1 -1
- package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
- package/dist/styles/index.css +2987 -168
- package/package.json +1 -1
- package/dist/client/gifting.parts-Bak93gD2.mjs +0 -86
- package/dist/client/runtimeResponse-nXT8VAMl.mjs +0 -3
- package/dist/client/types-BEaKfam_.mjs +0 -778
- package/dist/server/customCss-C9kgPHvr.mjs +0 -247
- package/dist/server/lookMediaFrame-H0fi4bJk.mjs +0 -2701
- package/dist/server/media-gvfIw3z8.mjs +0 -216
package/dist/client/client.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { A as materializeEntriesMedia, C as siteBlockRenderContext, F as attachResilienceStatusToError, M as rethrowClientFrameworkSignal, P as RiverbankApiError, R as requireSdkTheme, S as projectRenderablePageOutline, _ as loadContentFromContentResponse, _t as isSupportedLoaderEndpoint, b as buildSiteRenderSupport, gt as encodePublicProductCategorySelector, j as findFrameworkSignal, k as prefetchBlockDataWithFailures, m as isPageContent, t as Page, w as resolveSiteCustomBlocks, x as collectMediaAssetSidecar, y as buildRenderablePageOutline } from "./Page-
|
|
4
|
-
import {
|
|
2
|
+
import { Tc as parseSiteId } from "./wizardSteps-B3gsXNnb.mjs";
|
|
3
|
+
import { A as materializeEntriesMedia, C as siteBlockRenderContext, F as attachResilienceStatusToError, M as rethrowClientFrameworkSignal, P as RiverbankApiError, R as requireSdkTheme, S as projectRenderablePageOutline, _ as loadContentFromContentResponse, _t as isSupportedLoaderEndpoint, b as buildSiteRenderSupport, gt as encodePublicProductCategorySelector, j as findFrameworkSignal, k as prefetchBlockDataWithFailures, m as isPageContent, t as Page, w as resolveSiteCustomBlocks, x as collectMediaAssetSidecar, y as buildRenderablePageOutline } from "./Page-DB5KODiu.mjs";
|
|
4
|
+
import { cr as publicMapLocationParamsSchema } from "./registry.server-CI63JVHW.mjs";
|
|
5
5
|
import { t as BEFORE_BOOKING_QUESTIONS_ROUTE } from "./bookingQuestions-BHq83mzS.mjs";
|
|
6
|
-
import { t as restoreRuntimeResponse } from "./runtimeResponse-
|
|
6
|
+
import { t as restoreRuntimeResponse } from "./runtimeResponse-_iW9oEYc.mjs";
|
|
7
7
|
import { useEffect, useState } from "react";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
/**
|
|
@@ -186,6 +186,13 @@ const PAGE_JOURNAL_ENDPOINT_DEFINITIONS = {
|
|
|
186
186
|
responseKind: "json",
|
|
187
187
|
errors: ["validation:invalid_input", "server:internal_error"]
|
|
188
188
|
},
|
|
189
|
+
getEditorSiteFacts: {
|
|
190
|
+
path: "/sites/{siteId}/editor/site-facts",
|
|
191
|
+
method: "GET",
|
|
192
|
+
auth: "user",
|
|
193
|
+
responseKind: "json",
|
|
194
|
+
errors: ["server:internal_error"]
|
|
195
|
+
},
|
|
189
196
|
replayThemeJournalChange: {
|
|
190
197
|
path: "/sites/{siteId}/theme/journal",
|
|
191
198
|
method: "POST",
|
|
@@ -673,20 +680,38 @@ function buildFetchPolicy(siteId, reads, freshnessSeconds) {
|
|
|
673
680
|
function buildPublicReadBatchFetchPolicy(siteId, reads) {
|
|
674
681
|
return buildFetchPolicy(siteId, reads, publicReadBatchFreshnessSeconds);
|
|
675
682
|
}
|
|
676
|
-
|
|
683
|
+
function availabilityPageReadTags(siteId) {
|
|
684
|
+
return normalizeRevalidateTags([
|
|
685
|
+
...buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
|
|
686
|
+
...buildPublicReadFetchTags("listPublicEvents", { siteId }),
|
|
687
|
+
...buildPublicReadFetchTags("getPublicBookingService", { siteId })
|
|
688
|
+
]);
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* The tags and framework lifetime a complete page read registers. A page may depend on admission even when an
|
|
692
|
+
* ordinary CMS page won precedence. Booking and event writes purge an availability page by its tags, so its
|
|
693
|
+
* lifetime is only the rendered-availability backstop for a failed purge. Caches that no write reaches (the
|
|
694
|
+
* SDK's in-process map and durable runtime rows) keep `PUBLIC_AVAILABILITY_FRESHNESS_SECONDS` instead.
|
|
695
|
+
*/
|
|
677
696
|
function buildPageReadCachePolicy(siteId, dependencies) {
|
|
678
697
|
return dependencies === "availability" ? {
|
|
679
|
-
tags:
|
|
680
|
-
|
|
681
|
-
...buildPublicReadFetchTags("listPublicEvents", { siteId }),
|
|
682
|
-
...buildPublicReadFetchTags("getPublicBookingService", { siteId })
|
|
683
|
-
]),
|
|
684
|
-
revalidate: 60
|
|
698
|
+
tags: availabilityPageReadTags(siteId),
|
|
699
|
+
revalidate: PUBLIC_RENDERED_AVAILABILITY_FRESHNESS_SECONDS
|
|
685
700
|
} : {
|
|
686
701
|
tags: buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
|
|
687
702
|
revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS
|
|
688
703
|
};
|
|
689
704
|
}
|
|
705
|
+
/**
|
|
706
|
+
* What an incomplete or malformed page read registers, so the rendered route is rebuilt within a minute
|
|
707
|
+
* instead of keeping a broken page for a backstop's length. It carries every page tag, so a write still purges it.
|
|
708
|
+
*/
|
|
709
|
+
function buildPageReadRetryPolicy(siteId) {
|
|
710
|
+
return {
|
|
711
|
+
tags: availabilityPageReadTags(siteId),
|
|
712
|
+
revalidate: 60
|
|
713
|
+
};
|
|
714
|
+
}
|
|
690
715
|
function pageReadDependencies(payload) {
|
|
691
716
|
return typeof payload === "object" && payload !== null && "dependencies" in payload && payload.dependencies === "content" ? "content" : "availability";
|
|
692
717
|
}
|
|
@@ -770,20 +795,67 @@ const weekday = z.union([
|
|
|
770
795
|
z.literal(5),
|
|
771
796
|
z.literal(6)
|
|
772
797
|
]);
|
|
773
|
-
const
|
|
798
|
+
const localStart = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/);
|
|
799
|
+
const everyWeeks = z.union([z.literal(1), z.literal(2)]);
|
|
800
|
+
const nth = z.union([
|
|
801
|
+
z.literal(1),
|
|
802
|
+
z.literal(2),
|
|
803
|
+
z.literal(3),
|
|
804
|
+
z.literal(4),
|
|
805
|
+
z.literal("last")
|
|
806
|
+
]);
|
|
807
|
+
/** A recurring day in an arrangement's week, with the id it keeps in every segment. */
|
|
808
|
+
const arrangementSlotSchema = z.object({
|
|
809
|
+
id: z.string().uuid(),
|
|
810
|
+
weekday,
|
|
811
|
+
localStart
|
|
812
|
+
}).strict();
|
|
813
|
+
/** A saved pattern: weekly (several days, counted in weeks from a Monday anchor) or monthly (one day). */
|
|
814
|
+
const arrangementPatternSchema = z.discriminatedUnion("kind", [z.object({
|
|
774
815
|
kind: z.literal("weekly"),
|
|
775
|
-
everyWeeks
|
|
776
|
-
|
|
816
|
+
everyWeeks,
|
|
817
|
+
anchorMonday: localDate,
|
|
818
|
+
slots: z.array(arrangementSlotSchema).min(1).max(7).readonly()
|
|
777
819
|
}).strict(), z.object({
|
|
778
820
|
kind: z.literal("monthly"),
|
|
821
|
+
nth,
|
|
822
|
+
slot: arrangementSlotSchema
|
|
823
|
+
}).strict()]);
|
|
824
|
+
const slotTime = z.object({
|
|
825
|
+
weekday,
|
|
826
|
+
localStart
|
|
827
|
+
}).strict();
|
|
828
|
+
const differentDays = (days) => new Set(days.map((day) => day.weekday)).size === days.length;
|
|
829
|
+
/** What setup asks for: the days and times, with no ids or anchor. The server mints those. */
|
|
830
|
+
const arrangementSetUpScheduleSchema = z.object({
|
|
831
|
+
effectiveFrom: localDate,
|
|
832
|
+
pattern: z.discriminatedUnion("kind", [z.object({
|
|
833
|
+
kind: z.literal("weekly"),
|
|
834
|
+
everyWeeks,
|
|
835
|
+
days: z.array(slotTime).min(1).max(7).refine(differentDays, "Each day can only be picked once.")
|
|
836
|
+
}).strict(), z.object({
|
|
837
|
+
kind: z.literal("monthly"),
|
|
838
|
+
nth,
|
|
839
|
+
day: slotTime
|
|
840
|
+
}).strict()])
|
|
841
|
+
}).strict();
|
|
842
|
+
/**
|
|
843
|
+
* A change to the schedule from a date. `move` changes one day's weekday or time. `add` adds a
|
|
844
|
+
* day (weekly patterns only); the server mints its id from the operation, and it books the new
|
|
845
|
+
* day's next `bookAhead` sessions the way setup does.
|
|
846
|
+
*/
|
|
847
|
+
const arrangementScheduleCommandSchema = z.discriminatedUnion("kind", [z.object({
|
|
848
|
+
kind: z.literal("move"),
|
|
849
|
+
slotId: z.string().uuid(),
|
|
850
|
+
weekday,
|
|
851
|
+
localStart,
|
|
852
|
+
effectiveFrom: localDate
|
|
853
|
+
}).strict(), z.object({
|
|
854
|
+
kind: z.literal("add"),
|
|
779
855
|
weekday,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
z.literal(3),
|
|
784
|
-
z.literal(4),
|
|
785
|
-
z.literal("last")
|
|
786
|
-
])
|
|
856
|
+
localStart,
|
|
857
|
+
effectiveFrom: localDate,
|
|
858
|
+
bookAhead: z.number().int().min(0).max(52)
|
|
787
859
|
}).strict()]);
|
|
788
860
|
const arrangementEndSchema = z.discriminatedUnion("kind", [
|
|
789
861
|
z.object({ kind: z.literal("open") }).strict(),
|
|
@@ -796,21 +868,17 @@ const arrangementEndSchema = z.discriminatedUnion("kind", [
|
|
|
796
868
|
sessions: z.number().int().min(1).max(1e4)
|
|
797
869
|
}).strict()
|
|
798
870
|
]);
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
z.
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
}).strict()
|
|
809
|
-
]);
|
|
810
|
-
const arrangementScheduleSchema = z.object({
|
|
871
|
+
/**
|
|
872
|
+
* How a session no package covers gets chased. What pays for each session isn't chosen: it uses a
|
|
873
|
+
* package the client holds that covers it, soonest-expiring first.
|
|
874
|
+
*/
|
|
875
|
+
const arrangementOwedFollowUpSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("direct") }).strict(), z.object({
|
|
876
|
+
kind: z.literal("payment_link"),
|
|
877
|
+
sendOffsetMinutes: z.number().int().min(1).max(525600)
|
|
878
|
+
}).strict()]);
|
|
879
|
+
z.object({
|
|
811
880
|
effectiveFrom: localDate,
|
|
812
|
-
|
|
813
|
-
localStart: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/)
|
|
881
|
+
pattern: arrangementPatternSchema
|
|
814
882
|
}).strict();
|
|
815
883
|
const recordedReturn = { recordedReturn: z.literal("staff_confirmed").optional() };
|
|
816
884
|
const operation = {
|
|
@@ -825,17 +893,15 @@ const createClientArrangementSchema = z.object({
|
|
|
825
893
|
timezone: z.string().min(1),
|
|
826
894
|
holdsTime: z.boolean(),
|
|
827
895
|
end: arrangementEndSchema,
|
|
828
|
-
|
|
829
|
-
schedule:
|
|
830
|
-
bookAhead: z.number().int().min(0).max(52)
|
|
831
|
-
bookShortfallAsOwed: z.boolean().default(false)
|
|
896
|
+
owedFollowUp: arrangementOwedFollowUpSchema,
|
|
897
|
+
schedule: arrangementSetUpScheduleSchema,
|
|
898
|
+
bookAhead: z.number().int().min(0).max(52)
|
|
832
899
|
}).strict();
|
|
833
900
|
/** The UI selects the next N dates from get.dates, then retains this body for retry. */
|
|
834
901
|
const bookNextArrangementSchema = z.object({
|
|
835
902
|
...operation,
|
|
836
903
|
confirmation: z.string().optional(),
|
|
837
|
-
occurrenceDates: z.array(localDate).min(1).max(52).refine((values) => new Set(values).size === values.length, "Choose each date once.")
|
|
838
|
-
bookShortfallAsOwed: z.boolean().default(false)
|
|
904
|
+
occurrenceDates: z.array(localDate).min(1).max(52).refine((values) => new Set(values).size === values.length, "Choose each date once.")
|
|
839
905
|
}).strict();
|
|
840
906
|
const arrangementAwaySchema = z.object({
|
|
841
907
|
...operation,
|
|
@@ -845,27 +911,38 @@ const arrangementAwaySchema = z.object({
|
|
|
845
911
|
}).strict().refine((value) => value.backOn > value.from, "Choose a return date after the first day away.");
|
|
846
912
|
const arrangementChangeFromSchema = z.object({
|
|
847
913
|
...operation,
|
|
848
|
-
|
|
914
|
+
command: arrangementScheduleCommandSchema
|
|
849
915
|
}).strict();
|
|
850
916
|
const arrangementOneWeekSchema = z.object({
|
|
851
917
|
...operation,
|
|
852
918
|
occurrenceDate: localDate,
|
|
853
|
-
startAt: z.iso.datetime({ offset: true })
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
919
|
+
startAt: z.iso.datetime({ offset: true })
|
|
920
|
+
}).strict();
|
|
921
|
+
/**
|
|
922
|
+
* Ending all of it, or one day: that day stops after `lastDate`, its bookings after then are
|
|
923
|
+
* cancelled, and the other days carry on.
|
|
924
|
+
*/
|
|
925
|
+
const arrangementEndRequestSchema = z.discriminatedUnion("scope", [z.object({
|
|
858
926
|
...operation,
|
|
859
927
|
...recordedReturn,
|
|
928
|
+
scope: z.literal("all"),
|
|
860
929
|
lastDate: localDate
|
|
861
|
-
}).strict()
|
|
930
|
+
}).strict(), z.object({
|
|
931
|
+
...operation,
|
|
932
|
+
...recordedReturn,
|
|
933
|
+
scope: z.literal("day"),
|
|
934
|
+
slotId: z.string().uuid(),
|
|
935
|
+
lastDate: localDate
|
|
936
|
+
}).strict()]);
|
|
862
937
|
/** `expectedUpdatedAt` is the version the dialog was showing, so a save can't overwrite a newer change. */
|
|
938
|
+
/** `confirmation` is the preview's, when booked sessions change with the service. */
|
|
863
939
|
const arrangementEditSchema = z.object({
|
|
864
940
|
...operation,
|
|
941
|
+
confirmation: z.string().optional(),
|
|
865
942
|
expectedUpdatedAt: z.string().min(1),
|
|
866
943
|
serviceId: z.string().uuid(),
|
|
867
944
|
holdsTime: z.boolean(),
|
|
868
|
-
|
|
945
|
+
owedFollowUp: arrangementOwedFollowUpSchema
|
|
869
946
|
}).strict();
|
|
870
947
|
z.discriminatedUnion("kind", [
|
|
871
948
|
z.object({
|
|
@@ -981,6 +1058,19 @@ z.intersection(z.object({ occurrenceDate: localDate }), z.union([
|
|
|
981
1058
|
})
|
|
982
1059
|
])
|
|
983
1060
|
}),
|
|
1061
|
+
z.object({
|
|
1062
|
+
outcome: z.literal("service_changed"),
|
|
1063
|
+
appointmentId: z.string(),
|
|
1064
|
+
startAt: z.string(),
|
|
1065
|
+
endAt: z.string(),
|
|
1066
|
+
previousEndAt: z.string(),
|
|
1067
|
+
price: z.discriminatedUnion("kind", [z.object({
|
|
1068
|
+
kind: z.literal("restated"),
|
|
1069
|
+
fromCents: z.number().int(),
|
|
1070
|
+
toCents: z.number().int(),
|
|
1071
|
+
currency: z.string()
|
|
1072
|
+
}), z.object({ kind: z.literal("kept") })])
|
|
1073
|
+
}),
|
|
984
1074
|
z.object({
|
|
985
1075
|
outcome: z.literal("cancelled"),
|
|
986
1076
|
appointmentId: z.string(),
|
|
@@ -1004,11 +1094,7 @@ z.intersection(z.object({ occurrenceDate: localDate }), z.union([
|
|
|
1004
1094
|
outcome: z.literal("refused"),
|
|
1005
1095
|
appointmentId: z.string().optional()
|
|
1006
1096
|
}), z.discriminatedUnion("code", [
|
|
1007
|
-
z.object({ code: z.enum([
|
|
1008
|
-
"package_shortfall",
|
|
1009
|
-
"not_available",
|
|
1010
|
-
"client_not_found"
|
|
1011
|
-
]) }),
|
|
1097
|
+
z.object({ code: z.enum(["not_available", "client_not_found"]) }),
|
|
1012
1098
|
z.object({
|
|
1013
1099
|
code: z.literal("clash"),
|
|
1014
1100
|
customerFirstName: z.string().nullable(),
|
|
@@ -3404,6 +3490,44 @@ const GIFTING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
3404
3490
|
"server:internal_error"
|
|
3405
3491
|
]
|
|
3406
3492
|
},
|
|
3493
|
+
getGiftRefund: {
|
|
3494
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
3495
|
+
method: "GET",
|
|
3496
|
+
auth: "user",
|
|
3497
|
+
responseKind: "json",
|
|
3498
|
+
errors: [
|
|
3499
|
+
"auth:forbidden",
|
|
3500
|
+
"resource:conflict",
|
|
3501
|
+
"server:internal_error"
|
|
3502
|
+
]
|
|
3503
|
+
},
|
|
3504
|
+
refundGift: {
|
|
3505
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
3506
|
+
method: "POST",
|
|
3507
|
+
auth: "user",
|
|
3508
|
+
responseKind: "json",
|
|
3509
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
3510
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
3511
|
+
errors: [
|
|
3512
|
+
"auth:forbidden",
|
|
3513
|
+
"resource:conflict",
|
|
3514
|
+
"server:internal_error"
|
|
3515
|
+
]
|
|
3516
|
+
},
|
|
3517
|
+
cancelGift: {
|
|
3518
|
+
path: "/sites/{siteId}/gifting/gifts/{giftId}/cancel",
|
|
3519
|
+
method: "POST",
|
|
3520
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
3521
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
3522
|
+
auth: "user",
|
|
3523
|
+
responseKind: "json",
|
|
3524
|
+
errors: [
|
|
3525
|
+
"auth:forbidden",
|
|
3526
|
+
"resource:not_found",
|
|
3527
|
+
"resource:conflict",
|
|
3528
|
+
"server:internal_error"
|
|
3529
|
+
]
|
|
3530
|
+
},
|
|
3407
3531
|
changeGiftExpiry: {
|
|
3408
3532
|
path: "/sites/{siteId}/gifting/gifts/{giftId}/expiry",
|
|
3409
3533
|
method: "POST",
|
|
@@ -5967,6 +6091,22 @@ const API_ENDPOINTS$1 = {
|
|
|
5967
6091
|
auth: "user",
|
|
5968
6092
|
responseKind: "json"
|
|
5969
6093
|
},
|
|
6094
|
+
getRegisteredDomainContact: {
|
|
6095
|
+
errors: [
|
|
6096
|
+
"resource:not_found",
|
|
6097
|
+
"auth:forbidden",
|
|
6098
|
+
"validation:invalid_input"
|
|
6099
|
+
],
|
|
6100
|
+
path: "/domains/{domainId}/registrar/contact",
|
|
6101
|
+
method: "GET",
|
|
6102
|
+
auth: "user",
|
|
6103
|
+
tags: [
|
|
6104
|
+
"domains",
|
|
6105
|
+
"domain-{domainId}",
|
|
6106
|
+
"domain-registrar"
|
|
6107
|
+
],
|
|
6108
|
+
responseKind: "json"
|
|
6109
|
+
},
|
|
5970
6110
|
updateRegisteredDomainContact: {
|
|
5971
6111
|
path: "/domains/{domainId}/registrar/contact",
|
|
5972
6112
|
method: "POST",
|
|
@@ -6051,6 +6191,18 @@ const API_ENDPOINTS$1 = {
|
|
|
6051
6191
|
auth: "user",
|
|
6052
6192
|
responseKind: "json"
|
|
6053
6193
|
},
|
|
6194
|
+
retryDomainEmailSending: {
|
|
6195
|
+
errors: [],
|
|
6196
|
+
path: "/sites/{siteId}/domains/{domainId}/email/retry",
|
|
6197
|
+
method: "POST",
|
|
6198
|
+
tags: [
|
|
6199
|
+
"domains",
|
|
6200
|
+
"domain-{domainId}",
|
|
6201
|
+
"domain-dns"
|
|
6202
|
+
],
|
|
6203
|
+
auth: "user",
|
|
6204
|
+
responseKind: "json"
|
|
6205
|
+
},
|
|
6054
6206
|
retryDomainResend: {
|
|
6055
6207
|
path: "/domains/{domainId}/resend",
|
|
6056
6208
|
method: "POST",
|
|
@@ -10407,6 +10559,9 @@ function resolveApiBaseUrl() {
|
|
|
10407
10559
|
}
|
|
10408
10560
|
//#endregion
|
|
10409
10561
|
//#region ../api/src/pageReadResponseCache.ts
|
|
10562
|
+
function pageReadPolicy(siteId, policy) {
|
|
10563
|
+
return policy === "retry" ? buildPageReadRetryPolicy(siteId) : buildPageReadCachePolicy(siteId, policy);
|
|
10564
|
+
}
|
|
10410
10565
|
function isRecord(value) {
|
|
10411
10566
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10412
10567
|
}
|
|
@@ -10417,8 +10572,20 @@ function isResolvedPage(page) {
|
|
|
10417
10572
|
"system_service"
|
|
10418
10573
|
].includes(String(page.result.kind));
|
|
10419
10574
|
}
|
|
10575
|
+
/**
|
|
10576
|
+
* The key `serializeSurfaceTree` (theme-core) wraps a response in when it carries surface revisions. This package
|
|
10577
|
+
* can't depend on theme-core, so the SDK's tests check the two stay equal.
|
|
10578
|
+
*/
|
|
10579
|
+
const SURFACE_TRANSPORT_ENVELOPE_KEY = "$surfaceTransport";
|
|
10580
|
+
/** A revision-transport body keeps the page's own fields under the envelope's `value`. */
|
|
10581
|
+
function withoutSurfaceTransport(data) {
|
|
10582
|
+
const envelope = data[SURFACE_TRANSPORT_ENVELOPE_KEY];
|
|
10583
|
+
if (envelope === void 0) return data;
|
|
10584
|
+
return isRecord(envelope) && Array.isArray(envelope.revisions) && envelope.revisions.length > 0 && isRecord(envelope.value) ? envelope.value : null;
|
|
10585
|
+
}
|
|
10420
10586
|
function envelopePage(body) {
|
|
10421
|
-
const
|
|
10587
|
+
const raw = isRecord(body) && body.success === true && isRecord(body.data) ? body.data : null;
|
|
10588
|
+
const data = raw ? withoutSurfaceTransport(raw) : null;
|
|
10422
10589
|
return data?.type === "content" && isRecord(data.content) ? data.content : data;
|
|
10423
10590
|
}
|
|
10424
10591
|
function parseBody(body) {
|
|
@@ -10435,40 +10602,44 @@ function admit(snapshot) {
|
|
|
10435
10602
|
if (snapshot.status === 200 && isResolvedPage(page)) {
|
|
10436
10603
|
if (header(snapshot, "x-riverbank-page-storage") === "no-store") return {
|
|
10437
10604
|
kind: "pass-through",
|
|
10438
|
-
|
|
10605
|
+
policy: "retry"
|
|
10439
10606
|
};
|
|
10440
10607
|
return {
|
|
10441
10608
|
kind: "store",
|
|
10442
|
-
|
|
10609
|
+
policy: page.dependencies
|
|
10443
10610
|
};
|
|
10444
10611
|
}
|
|
10612
|
+
if (snapshot.status === 200) return {
|
|
10613
|
+
kind: "pass-through",
|
|
10614
|
+
policy: "retry"
|
|
10615
|
+
};
|
|
10445
10616
|
return {
|
|
10446
10617
|
kind: "pass-through",
|
|
10447
|
-
|
|
10618
|
+
policy: header(snapshot, "x-riverbank-page-dependencies") === "availability" ? "availability" : "content"
|
|
10448
10619
|
};
|
|
10449
10620
|
}
|
|
10450
10621
|
/**
|
|
10451
10622
|
* One cache entry per request, judged by the policy it is looked up with. Content is looked up first, so a
|
|
10452
10623
|
* plain page costs one lookup and never registers the availability policy. A page whose snapshot depends on
|
|
10453
|
-
* availability is looked up again under that policy, which checks its tags and
|
|
10624
|
+
* availability (or must be retried soon) is looked up again under that policy, which checks its tags and budget. A snapshot
|
|
10454
10625
|
* past its own budget is never served: the live read replaces it.
|
|
10455
10626
|
*/
|
|
10456
10627
|
function planPageRead(state, now, budgetSeconds) {
|
|
10457
10628
|
const subject = state.live ?? state.cached;
|
|
10458
10629
|
if (!subject) return {
|
|
10459
10630
|
kind: "lookup",
|
|
10460
|
-
|
|
10631
|
+
policy: "content"
|
|
10461
10632
|
};
|
|
10462
|
-
const {
|
|
10463
|
-
if (!state.lookedUp.includes(
|
|
10633
|
+
const { policy } = admit(subject);
|
|
10634
|
+
if (!state.lookedUp.includes(policy)) return {
|
|
10464
10635
|
kind: "lookup",
|
|
10465
|
-
|
|
10636
|
+
policy
|
|
10466
10637
|
};
|
|
10467
10638
|
if (state.live) return {
|
|
10468
10639
|
kind: "serve",
|
|
10469
10640
|
snapshot: state.live
|
|
10470
10641
|
};
|
|
10471
|
-
return now - subject.cachedAt < budgetSeconds(
|
|
10642
|
+
return now - subject.cachedAt < budgetSeconds(policy) * 1e3 ? {
|
|
10472
10643
|
kind: "serve",
|
|
10473
10644
|
snapshot: subject
|
|
10474
10645
|
} : { kind: "read-live" };
|
|
@@ -10479,12 +10650,21 @@ function planPageRead(state, now, budgetSeconds) {
|
|
|
10479
10650
|
*/
|
|
10480
10651
|
var PassThroughResponse = class extends Error {
|
|
10481
10652
|
constructor(snapshot) {
|
|
10482
|
-
super("
|
|
10653
|
+
super("Read must not be stored");
|
|
10483
10654
|
this.snapshot = snapshot;
|
|
10484
10655
|
}
|
|
10485
10656
|
};
|
|
10486
|
-
|
|
10487
|
-
|
|
10657
|
+
/**
|
|
10658
|
+
* Names this cache's entries. Next keys an entry by these parts plus the callback's source text, and neither
|
|
10659
|
+
* changes when the response contract does, so a contract change bumps this name: otherwise a deploy keeps
|
|
10660
|
+
* serving responses the previous release cached, in the old shape, for up to their whole budget.
|
|
10661
|
+
*
|
|
10662
|
+
* - v4: a resolved page carries its own mailing-list support (`mailingList`); the hosted frontend no longer
|
|
10663
|
+
* asks the site read for it, so a v3 response would leave the page's newsletter forms without their lists.
|
|
10664
|
+
*/
|
|
10665
|
+
const PAGE_READ_RESPONSE_CACHE_NAME = "page-read-envelope-v4";
|
|
10666
|
+
async function lookup(input, policy) {
|
|
10667
|
+
const { tags } = pageReadPolicy(input.siteId, policy);
|
|
10488
10668
|
const load = async () => {
|
|
10489
10669
|
const snapshot = await input.live();
|
|
10490
10670
|
if (admit(snapshot).kind === "pass-through") throw new PassThroughResponse(snapshot);
|
|
@@ -10492,8 +10672,8 @@ async function lookup(input, dependencies) {
|
|
|
10492
10672
|
};
|
|
10493
10673
|
try {
|
|
10494
10674
|
return {
|
|
10495
|
-
cached: await input.cache(load, [
|
|
10496
|
-
revalidate: input.budgetSeconds(
|
|
10675
|
+
cached: await input.cache(load, [PAGE_READ_RESPONSE_CACHE_NAME, input.key], {
|
|
10676
|
+
revalidate: input.budgetSeconds(policy),
|
|
10497
10677
|
tags
|
|
10498
10678
|
})(),
|
|
10499
10679
|
live: null
|
|
@@ -10515,9 +10695,9 @@ async function runPlan(input, state) {
|
|
|
10515
10695
|
live: await input.live()
|
|
10516
10696
|
});
|
|
10517
10697
|
case "lookup": {
|
|
10518
|
-
const found = await lookup(input, step.
|
|
10698
|
+
const found = await lookup(input, step.policy);
|
|
10519
10699
|
return runPlan(input, {
|
|
10520
|
-
lookedUp: [...state.lookedUp, step.
|
|
10700
|
+
lookedUp: [...state.lookedUp, step.policy],
|
|
10521
10701
|
cached: found.cached ?? state.cached,
|
|
10522
10702
|
live: state.live ?? found.live
|
|
10523
10703
|
});
|
|
@@ -10549,9 +10729,9 @@ async function frameworkCacheKey(request) {
|
|
|
10549
10729
|
async function cachePageReadResponse(input) {
|
|
10550
10730
|
if (!input.cache || input.maxAge !== void 0 && input.maxAge <= 0) return input.read();
|
|
10551
10731
|
const maxAge = input.maxAge;
|
|
10552
|
-
const budgetSeconds = (
|
|
10553
|
-
const
|
|
10554
|
-
return maxAge === void 0 ?
|
|
10732
|
+
const budgetSeconds = (policy) => {
|
|
10733
|
+
const revalidate = pageReadPolicy(input.siteId, policy).revalidate;
|
|
10734
|
+
return maxAge === void 0 ? revalidate : Math.min(revalidate, maxAge);
|
|
10555
10735
|
};
|
|
10556
10736
|
const key = await frameworkCacheKey(input.key);
|
|
10557
10737
|
const result = await runPlan({
|
|
@@ -10570,15 +10750,53 @@ async function cachePageReadResponse(input) {
|
|
|
10570
10750
|
headers: result.headers
|
|
10571
10751
|
});
|
|
10572
10752
|
}
|
|
10753
|
+
/**
|
|
10754
|
+
* Names the site read's entries, for the same reason as `PAGE_READ_RESPONSE_CACHE_NAME`. A site read only
|
|
10755
|
+
* enters this cache when the host can answer it from its durable copy; otherwise it stays in Next's fetch cache.
|
|
10756
|
+
*/
|
|
10757
|
+
const SITE_READ_RESPONSE_CACHE_NAME = "site-read-envelope-v1";
|
|
10758
|
+
/**
|
|
10759
|
+
* A site read through the framework cache, with the fetch cache's lifetime and tags, so its fill can come from
|
|
10760
|
+
* the host's durable copy. As in Next's fetch cache, only a 200 is kept: an incomplete site (207) or a failure
|
|
10761
|
+
* passes through and the next read asks again.
|
|
10762
|
+
*/
|
|
10763
|
+
async function cacheSiteReadResponse(input) {
|
|
10764
|
+
const live = sharedRead(input.read);
|
|
10765
|
+
const load = async () => {
|
|
10766
|
+
const snapshot = await live();
|
|
10767
|
+
if (snapshot.status !== 200) throw new PassThroughResponse(snapshot);
|
|
10768
|
+
return snapshot;
|
|
10769
|
+
};
|
|
10770
|
+
const key = await frameworkCacheKey(input.key);
|
|
10771
|
+
const found = await input.cache(load, [SITE_READ_RESPONSE_CACHE_NAME, key], {
|
|
10772
|
+
revalidate: input.policy.revalidate,
|
|
10773
|
+
tags: input.policy.tags
|
|
10774
|
+
})().catch((error) => {
|
|
10775
|
+
if (error instanceof PassThroughResponse) return error.snapshot;
|
|
10776
|
+
throw error;
|
|
10777
|
+
});
|
|
10778
|
+
const snapshot = Date.now() - found.cachedAt < input.policy.revalidate * 1e3 ? found : await live();
|
|
10779
|
+
return new Response(snapshot.body, {
|
|
10780
|
+
status: snapshot.status,
|
|
10781
|
+
headers: snapshot.headers
|
|
10782
|
+
});
|
|
10783
|
+
}
|
|
10573
10784
|
/** Result adapters use this when the SDK served a page without the HTTP transport (memory, durable or prebuild fallback). */
|
|
10574
10785
|
async function observePageReadPolicy(cache, siteId, payload) {
|
|
10575
10786
|
if (!cache) return;
|
|
10576
|
-
const
|
|
10787
|
+
const policy = observedPageReadPolicy(pageReadDependencies(payload));
|
|
10577
10788
|
await cache(async () => true, [
|
|
10578
|
-
"page-read-policy-
|
|
10789
|
+
"page-read-policy-v3",
|
|
10579
10790
|
siteId,
|
|
10580
|
-
|
|
10581
|
-
],
|
|
10791
|
+
policy
|
|
10792
|
+
], pageReadPolicy(siteId, policy))();
|
|
10793
|
+
}
|
|
10794
|
+
/**
|
|
10795
|
+
* A page served without the tagged transport (memory, durable or prebuild) may predate a write's purge, so an
|
|
10796
|
+
* availability page only earns the retry window, not the rendered-availability backstop a purge would end.
|
|
10797
|
+
*/
|
|
10798
|
+
function observedPageReadPolicy(dependency) {
|
|
10799
|
+
return dependency === "availability" ? "retry" : "content";
|
|
10582
10800
|
}
|
|
10583
10801
|
//#endregion
|
|
10584
10802
|
//#region ../api/src/common/operationId.ts
|
|
@@ -10873,19 +11091,88 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
|
|
|
10873
11091
|
function isPublishedPageRead(endpoint, params, options) {
|
|
10874
11092
|
return (endpoint === "getContentByPath" || endpoint === "resolveRouteOutcome") && params?.preview !== true && params?.preview !== "true" && options.cache !== "no-store";
|
|
10875
11093
|
}
|
|
11094
|
+
/** The dashboard's reading of a boolean query flag, so a host never treats `force=1` as unforced. */
|
|
11095
|
+
const isTruthyRequestParam = (value) => value === true || value === "true" || value === 1 || value === "1";
|
|
11096
|
+
/** Forced reads skip every cache, and an id-only lookup is a different response the durable cache never holds. */
|
|
11097
|
+
function isFullSiteRead(params) {
|
|
11098
|
+
return !isTruthyRequestParam(params.force) && (params.scope === void 0 || params.scope === "full");
|
|
11099
|
+
}
|
|
11100
|
+
/** A published, full site read with a lifetime: the host's durable copy may answer it, under the fetch's policy. */
|
|
11101
|
+
function publishedSiteReadPolicy(endpoint, params, plan) {
|
|
11102
|
+
const next = plan.init.cache === "no-store" ? void 0 : plan.init.next;
|
|
11103
|
+
const revalidate = typeof next?.revalidate === "number" && next.revalidate > 0 ? next.revalidate : null;
|
|
11104
|
+
return endpoint === "getSite" && revalidate !== null && isFullSiteRead(params) ? {
|
|
11105
|
+
revalidate,
|
|
11106
|
+
tags: next?.tags ?? []
|
|
11107
|
+
} : null;
|
|
11108
|
+
}
|
|
11109
|
+
/** The dashboard's success envelope around a durable copy, so admission and parsing treat it like a live response. */
|
|
11110
|
+
function freshPublishedResponse(data) {
|
|
11111
|
+
return new Response(JSON.stringify(buildSuccessEnvelope(data, void 0)), {
|
|
11112
|
+
status: 200,
|
|
11113
|
+
headers: {
|
|
11114
|
+
"content-type": "application/json",
|
|
11115
|
+
"x-riverbank-cache": "frontend-hit"
|
|
11116
|
+
}
|
|
11117
|
+
});
|
|
11118
|
+
}
|
|
11119
|
+
/** The cache fill's read: the host's fresh durable copy when it has one, otherwise the dashboard. */
|
|
11120
|
+
function freshPublishedFirst(read, request, live) {
|
|
11121
|
+
if (!read) return live;
|
|
11122
|
+
return async () => {
|
|
11123
|
+
const found = await read(request).catch(() => null);
|
|
11124
|
+
return found ? freshPublishedResponse(found.data) : live();
|
|
11125
|
+
};
|
|
11126
|
+
}
|
|
11127
|
+
function publishedPageResponse(read) {
|
|
11128
|
+
const revalidate = read.plan.init.next?.revalidate;
|
|
11129
|
+
return cachePageReadResponse({
|
|
11130
|
+
cache: read.frameworkCache?.cache ?? null,
|
|
11131
|
+
key: read.key,
|
|
11132
|
+
siteId: typeof read.params.siteId === "string" ? read.params.siteId : "",
|
|
11133
|
+
maxAge: typeof revalidate === "number" ? revalidate : void 0,
|
|
11134
|
+
read: read.endpoint === "getContentByPath" ? freshPublishedFirst(read.frameworkCache?.readFreshPublished, {
|
|
11135
|
+
endpoint: "getContentByPath",
|
|
11136
|
+
params: read.params
|
|
11137
|
+
}, read.uncachedFetch) : read.uncachedFetch
|
|
11138
|
+
});
|
|
11139
|
+
}
|
|
11140
|
+
/** Without a durable reader, a site read stays in Next's fetch cache exactly as before. */
|
|
11141
|
+
function siteOrFetchResponse(read) {
|
|
11142
|
+
const durable = read.frameworkCache?.readFreshPublished;
|
|
11143
|
+
const policy = durable ? publishedSiteReadPolicy(read.endpoint, read.params, read.plan) : null;
|
|
11144
|
+
return read.frameworkCache && policy ? cacheSiteReadResponse({
|
|
11145
|
+
cache: read.frameworkCache.cache,
|
|
11146
|
+
key: read.key,
|
|
11147
|
+
policy,
|
|
11148
|
+
read: freshPublishedFirst(durable, {
|
|
11149
|
+
endpoint: "getSite",
|
|
11150
|
+
params: read.params
|
|
11151
|
+
}, read.uncachedFetch)
|
|
11152
|
+
}) : observedFetch(read.plan, read.endpoint, read.frameworkCache);
|
|
11153
|
+
}
|
|
10876
11154
|
function executeApiRequest(plan, endpoint, params, options, frameworkCache) {
|
|
10877
|
-
const
|
|
10878
|
-
const
|
|
10879
|
-
|
|
10880
|
-
|
|
11155
|
+
const { next: _fetchPolicy, ...uncachedInit } = plan.init;
|
|
11156
|
+
const read = {
|
|
11157
|
+
plan,
|
|
11158
|
+
endpoint,
|
|
11159
|
+
params: params ?? {},
|
|
11160
|
+
frameworkCache,
|
|
10881
11161
|
key: JSON.stringify([plan.url, [...new Headers(plan.init.headers).entries()]]),
|
|
10882
|
-
|
|
10883
|
-
maxAge: typeof fetchPolicy?.revalidate === "number" ? fetchPolicy.revalidate : void 0,
|
|
10884
|
-
read: () => fetch(plan.url, {
|
|
11162
|
+
uncachedFetch: () => fetch(plan.url, {
|
|
10885
11163
|
...uncachedInit,
|
|
10886
11164
|
cache: "no-store"
|
|
10887
11165
|
})
|
|
10888
|
-
}
|
|
11166
|
+
};
|
|
11167
|
+
return isPublishedPageRead(endpoint, params, options) ? publishedPageResponse(read) : siteOrFetchResponse(read);
|
|
11168
|
+
}
|
|
11169
|
+
function observedFetch(plan, endpoint, frameworkCache) {
|
|
11170
|
+
const revalidate = plan.init.next?.revalidate;
|
|
11171
|
+
if (typeof revalidate === "number" && plan.init.cache !== "no-store") frameworkCache?.observeFetchLifetime?.({
|
|
11172
|
+
endpoint: String(endpoint),
|
|
11173
|
+
revalidate
|
|
11174
|
+
});
|
|
11175
|
+
return fetch(plan.url, plan.init);
|
|
10889
11176
|
}
|
|
10890
11177
|
const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
|
|
10891
11178
|
endpoint: z.string(),
|
|
@@ -11667,7 +11954,7 @@ var SimpleCache = class {
|
|
|
11667
11954
|
//#endregion
|
|
11668
11955
|
//#region src/request-options.ts
|
|
11669
11956
|
/** Every API client the SDK creates sends its version as `x-sdk-version`. */
|
|
11670
|
-
const sdkRequestOptions = { sdkVersion: "0.
|
|
11957
|
+
const sdkRequestOptions = { sdkVersion: "0.184.0" };
|
|
11671
11958
|
//#endregion
|
|
11672
11959
|
//#region src/public-api/runtime.ts
|
|
11673
11960
|
const PUBLIC_ENDPOINT_NAMES = [
|
|
@@ -11854,6 +12141,10 @@ function normalizeRuntimePublicPath(value) {
|
|
|
11854
12141
|
const collapsed = (withoutQuery.startsWith("/") ? withoutQuery : `/${withoutQuery}`).replace(/\/{2,}/g, "/");
|
|
11855
12142
|
return (collapsed.length > 1 ? collapsed.replace(/\/+$/g, "") : collapsed) || "/";
|
|
11856
12143
|
}
|
|
12144
|
+
/** The site read's variant: `null` is the site-wide read; a path adds that page's runtime support. */
|
|
12145
|
+
function decideSiteReadPath(currentPath) {
|
|
12146
|
+
return toNonEmptyString(currentPath) === null ? null : normalizeRuntimePublicPath(currentPath);
|
|
12147
|
+
}
|
|
11857
12148
|
function normalizeRuntimeHostname(value) {
|
|
11858
12149
|
const trimmed = value.trim().toLowerCase();
|
|
11859
12150
|
return (/^[a-z][a-z0-9+.-]*:\/\//.test(trimmed) ? new URL(trimmed) : new URL(`http://${trimmed}`)).hostname.replace(/\.$/, "");
|
|
@@ -11889,9 +12180,10 @@ function deriveGetSiteKey(params) {
|
|
|
11889
12180
|
]
|
|
11890
12181
|
}
|
|
11891
12182
|
};
|
|
12183
|
+
const path = decideSiteReadPath(params.currentPath);
|
|
11892
12184
|
const normalizedParams = {
|
|
11893
12185
|
...identity,
|
|
11894
|
-
...
|
|
12186
|
+
...path === null ? {} : { currentPath: path }
|
|
11895
12187
|
};
|
|
11896
12188
|
return {
|
|
11897
12189
|
ok: true,
|
|
@@ -12528,32 +12820,77 @@ var CircuitBreaker = class {
|
|
|
12528
12820
|
}
|
|
12529
12821
|
}
|
|
12530
12822
|
};
|
|
12823
|
+
/** The SDK's read deadline when the caller sets none. */
|
|
12824
|
+
const DEFAULT_READ_DEADLINE_MS = 8e3;
|
|
12825
|
+
function createReadTimeoutError(timeoutMs) {
|
|
12826
|
+
return Object.assign(/* @__PURE__ */ new Error(`Request timed out after ${timeoutMs}ms`), { name: "AbortError" });
|
|
12827
|
+
}
|
|
12828
|
+
/**
|
|
12829
|
+
* One attempt, ended at the read's deadline even when the fetch ignores its signal.
|
|
12830
|
+
*
|
|
12831
|
+
* The signal alone isn't enough: Next drops it when it refreshes stale fetch data
|
|
12832
|
+
* (as an ISR regeneration does), and the read would then wait as long as the
|
|
12833
|
+
* origin takes. The signal is still aborted so a fetch that honours it stops.
|
|
12834
|
+
*/
|
|
12835
|
+
function raceReadDeadline(fetcher, remainingMs, timeoutError) {
|
|
12836
|
+
const controller = new AbortController();
|
|
12837
|
+
return new Promise((resolve, reject) => {
|
|
12838
|
+
const timeoutId = setTimeout(() => {
|
|
12839
|
+
controller.abort();
|
|
12840
|
+
reject(timeoutError());
|
|
12841
|
+
}, remainingMs);
|
|
12842
|
+
fetcher(controller.signal).then((value) => {
|
|
12843
|
+
clearTimeout(timeoutId);
|
|
12844
|
+
resolve(value);
|
|
12845
|
+
}, (error) => {
|
|
12846
|
+
clearTimeout(timeoutId);
|
|
12847
|
+
reject(error);
|
|
12848
|
+
});
|
|
12849
|
+
});
|
|
12850
|
+
}
|
|
12851
|
+
function decideRetry(input) {
|
|
12852
|
+
if (input.attempt >= input.maxAttempts) return { kind: "give_up" };
|
|
12853
|
+
if (!shouldRetryError(input.error, input.config.retryOn)) return { kind: "give_up" };
|
|
12854
|
+
const delayMs = getRetryDelay(input.error, input.attempt, input.config);
|
|
12855
|
+
return delayMs < input.remainingMs ? {
|
|
12856
|
+
kind: "retry",
|
|
12857
|
+
delayMs
|
|
12858
|
+
} : { kind: "give_up" };
|
|
12859
|
+
}
|
|
12531
12860
|
/**
|
|
12532
|
-
* Fetch with
|
|
12861
|
+
* Fetch with one deadline and retry logic
|
|
12862
|
+
*
|
|
12863
|
+
* `requestTimeoutMs` bounds the whole read, so retries share what the first
|
|
12864
|
+
* attempt left rather than each getting a fresh budget. A timeout is never
|
|
12865
|
+
* retried: the deadline has passed.
|
|
12533
12866
|
*
|
|
12534
12867
|
* @param fetcher - Function that performs the fetch, receives AbortSignal for timeout
|
|
12535
12868
|
* @param config - Retry configuration
|
|
12536
12869
|
* @returns Result from successful fetch
|
|
12537
|
-
* @throws
|
|
12870
|
+
* @throws The last attempt's error, or a timeout once the deadline passes
|
|
12538
12871
|
*/
|
|
12539
|
-
|
|
12872
|
+
function fetchWithTimeoutAndRetry(fetcher, config) {
|
|
12540
12873
|
const maxAttempts = config.maxAttempts ?? DEFAULT_RETRY_CONFIG.maxAttempts;
|
|
12541
12874
|
const requestTimeoutMs = config.requestTimeoutMs ?? 8e3;
|
|
12542
|
-
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
const timeoutId = setTimeout(() => controller.abort(), requestTimeoutMs);
|
|
12875
|
+
const deadline = Date.now() + requestTimeoutMs;
|
|
12876
|
+
const timeoutError = () => createReadTimeoutError(requestTimeoutMs);
|
|
12877
|
+
const attemptFrom = async (attempt) => {
|
|
12546
12878
|
try {
|
|
12547
|
-
return await fetcher(
|
|
12548
|
-
}
|
|
12549
|
-
|
|
12879
|
+
return await raceReadDeadline(fetcher, Math.max(0, deadline - Date.now()), timeoutError);
|
|
12880
|
+
} catch (error) {
|
|
12881
|
+
const decision = decideRetry({
|
|
12882
|
+
error,
|
|
12883
|
+
attempt,
|
|
12884
|
+
maxAttempts,
|
|
12885
|
+
remainingMs: deadline - Date.now(),
|
|
12886
|
+
config
|
|
12887
|
+
});
|
|
12888
|
+
if (decision.kind === "give_up") throw error;
|
|
12889
|
+
await sleep(decision.delayMs);
|
|
12890
|
+
return attemptFrom(attempt + 1);
|
|
12550
12891
|
}
|
|
12551
|
-
}
|
|
12552
|
-
|
|
12553
|
-
if (!shouldRetryError(error, config.retryOn)) throw error;
|
|
12554
|
-
if (attempt < maxAttempts) await sleep(getRetryDelay(error, attempt, config));
|
|
12555
|
-
}
|
|
12556
|
-
throw lastError;
|
|
12892
|
+
};
|
|
12893
|
+
return attemptFrom(1);
|
|
12557
12894
|
}
|
|
12558
12895
|
/**
|
|
12559
12896
|
* Check if an error is an AbortError (from AbortController.abort() or timeout)
|
|
@@ -12656,7 +12993,7 @@ function withDefaultHeaders(apiClient, defaultHeaders) {
|
|
|
12656
12993
|
});
|
|
12657
12994
|
}
|
|
12658
12995
|
const DEFAULT_BROWSER_TIMEOUT_MS = 5e3;
|
|
12659
|
-
const DEFAULT_SERVER_TIMEOUT_MS =
|
|
12996
|
+
const DEFAULT_SERVER_TIMEOUT_MS = DEFAULT_READ_DEADLINE_MS;
|
|
12660
12997
|
const MAX_GET_ENTRIES_BY_IDENTIFIERS_REFS = 50;
|
|
12661
12998
|
function isDurableRuntimeCacheTier(cacheTier) {
|
|
12662
12999
|
return cacheTier === "durable-fresh" || cacheTier === "durable-stale";
|
|
@@ -12681,7 +13018,7 @@ function publishedCacheLifetime(plan, payload) {
|
|
|
12681
13018
|
freshTtlSec: plan.freshTtlSec,
|
|
12682
13019
|
staleTtlSec: plan.staleTtlSec
|
|
12683
13020
|
};
|
|
12684
|
-
const ttl =
|
|
13021
|
+
const ttl = 60;
|
|
12685
13022
|
return {
|
|
12686
13023
|
freshTtlSec: ttl,
|
|
12687
13024
|
staleTtlSec: ttl
|
|
@@ -12693,11 +13030,10 @@ function reusableDurablePayload(plan, payload, freshness) {
|
|
|
12693
13030
|
function memoryWritePolicy(pageRead, data, tags, cacheTTL) {
|
|
12694
13031
|
if (!pageRead) return { tags };
|
|
12695
13032
|
const dependency = pageReadDependencies(data);
|
|
12696
|
-
const policy = buildPageReadCachePolicy(pageRead.siteId, dependency);
|
|
12697
13033
|
return {
|
|
12698
|
-
tags:
|
|
13034
|
+
tags: buildPageReadCachePolicy(pageRead.siteId, dependency).tags,
|
|
12699
13035
|
...dependency === "availability" ? {
|
|
12700
|
-
ttl: Math.min(cacheTTL,
|
|
13036
|
+
ttl: Math.min(cacheTTL, 60 * 1e3),
|
|
12701
13037
|
staleTtl: 0
|
|
12702
13038
|
} : {}
|
|
12703
13039
|
};
|
|
@@ -13017,7 +13353,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13017
13353
|
const result = await reader({
|
|
13018
13354
|
cacheKey: plan.cacheKey,
|
|
13019
13355
|
endpoint: plan.endpoint,
|
|
13020
|
-
payloadSchemaVersion:
|
|
13356
|
+
payloadSchemaVersion: 10
|
|
13021
13357
|
});
|
|
13022
13358
|
if (result.kind === "miss") return {
|
|
13023
13359
|
kind: "miss",
|
|
@@ -13066,7 +13402,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13066
13402
|
payload,
|
|
13067
13403
|
siteId: plan.siteId ?? getRuntimePayloadSiteId(payload),
|
|
13068
13404
|
...publishedCacheLifetime(plan, payload),
|
|
13069
|
-
payloadSchemaVersion:
|
|
13405
|
+
payloadSchemaVersion: 10,
|
|
13070
13406
|
writeReason: "live_success"
|
|
13071
13407
|
});
|
|
13072
13408
|
} catch {}
|
|
@@ -13080,6 +13416,11 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13080
13416
|
error: input.error
|
|
13081
13417
|
})) : null;
|
|
13082
13418
|
}
|
|
13419
|
+
/** Every fallback leaves through here, so the caller's hook sees each one. */
|
|
13420
|
+
async function serveFallback(fallback) {
|
|
13421
|
+
await config.resilience?.beforeFallbackServed?.(fallback.resilience);
|
|
13422
|
+
return fallback;
|
|
13423
|
+
}
|
|
13083
13424
|
async function resilientFetch(cacheKey, fetcher, options) {
|
|
13084
13425
|
const requestId = generateRequestId();
|
|
13085
13426
|
const startTime = Date.now();
|
|
@@ -13099,21 +13440,21 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13099
13440
|
if (resilienceEnabled && circuitBreaker.isOpen()) {
|
|
13100
13441
|
if (allowFallbacks && !isPreview && staleIfError) {
|
|
13101
13442
|
const stale = cache.getStale(cacheKey);
|
|
13102
|
-
if (stale) return emitStatus("stale", stale.value, statusDetails({
|
|
13443
|
+
if (stale) return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
13103
13444
|
staleAgeSec: stale.staleAgeSec,
|
|
13104
13445
|
cacheTier: "memory-stale",
|
|
13105
13446
|
error: {
|
|
13106
13447
|
code: "circuit_open",
|
|
13107
13448
|
message: "Circuit breaker is open"
|
|
13108
13449
|
}
|
|
13109
|
-
}));
|
|
13450
|
+
})));
|
|
13110
13451
|
}
|
|
13111
13452
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, {
|
|
13112
13453
|
code: "circuit_open",
|
|
13113
13454
|
message: "Circuit breaker is open"
|
|
13114
13455
|
}) : null;
|
|
13115
13456
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
13116
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
13457
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
13117
13458
|
const prebuild = tryPrebuildFallback({
|
|
13118
13459
|
allowed: allowFallbacks,
|
|
13119
13460
|
preview: isPreview,
|
|
@@ -13125,7 +13466,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13125
13466
|
message: "Circuit breaker is open"
|
|
13126
13467
|
}
|
|
13127
13468
|
});
|
|
13128
|
-
if (prebuild) return prebuild;
|
|
13469
|
+
if (prebuild) return serveFallback(prebuild);
|
|
13129
13470
|
const circuitState = circuitBreaker.getState();
|
|
13130
13471
|
emitStatus("error", null, statusDetails({
|
|
13131
13472
|
durableCache,
|
|
@@ -13173,17 +13514,17 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13173
13514
|
const stale = cache.getStale(cacheKey);
|
|
13174
13515
|
if (stale) {
|
|
13175
13516
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
13176
|
-
return emitStatus("stale", stale.value, statusDetails({
|
|
13517
|
+
return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
13177
13518
|
staleAgeSec: stale.staleAgeSec,
|
|
13178
13519
|
cacheTier: "memory-stale",
|
|
13179
13520
|
error: errorInfo
|
|
13180
|
-
}));
|
|
13521
|
+
})));
|
|
13181
13522
|
}
|
|
13182
13523
|
}
|
|
13183
13524
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
13184
13525
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, errorInfo) : null;
|
|
13185
13526
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
13186
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
13527
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
13187
13528
|
const prebuild = tryPrebuildFallback({
|
|
13188
13529
|
allowed: allowFallbacks,
|
|
13189
13530
|
preview: isPreview,
|
|
@@ -13192,7 +13533,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13192
13533
|
durableCache,
|
|
13193
13534
|
error: errorInfo
|
|
13194
13535
|
});
|
|
13195
|
-
if (prebuild) return prebuild;
|
|
13536
|
+
if (prebuild) return serveFallback(prebuild);
|
|
13196
13537
|
throw attachResilienceStatusToError(error, emitStatus("error", null, statusDetails({
|
|
13197
13538
|
error: errorInfo,
|
|
13198
13539
|
durableCache
|