@riverbankcms/sdk 0.181.0 → 0.183.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 +49 -3
- package/dist/_dts/{BlocksIslandsHydrator-CVCasDPz.d.ts → BlocksIslandsHydrator-X1_G96iN.d.ts} +1 -1
- package/dist/_dts/{Page-Dtj2Ui3S.d.ts → Page-CEqZJZEE.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D1f_60WW.d.ts → SdkPreviewMode-DQejfbXL.d.ts} +2 -2
- package/dist/_dts/{client-Chr9pNVW.d.ts → client-B_B_amKD.d.ts} +2 -3
- package/dist/_dts/{content-types-kjccgopX.d.ts → content-types-Dhx5Ocvx.d.ts} +9 -16
- package/dist/_dts/{contracts-BodaiS00.d.ts → contracts-FeOnfoa1.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-BS6kaJFp.d.ts → generatePageMetadata-m70J6tit.d.ts} +2 -2
- package/dist/_dts/{index-Brl6_I2j.d.ts → index-BOpUh8kO.d.ts} +1 -1
- package/dist/_dts/{index-CJkefwYh.d.ts → index-Bizdaxji.d.ts} +2 -2
- package/dist/_dts/{index-Diqt0PvG.d.ts → index-BxCmCit0.d.ts} +1 -1
- package/dist/_dts/{index-DG0OvBs0.d.ts → index-CjAkEWAp.d.ts} +4 -4
- package/dist/_dts/{index-D1WpKwQe.d.ts → index-iuFrbIjt.d.ts} +1 -1
- package/dist/_dts/{index-Dy50xUMK.d.ts → index-liuhlOX7.d.ts} +2 -2
- package/dist/_dts/{loadContent-BgxshKrA.d.ts → loadContent-D4wrTIIw.d.ts} +7 -7
- package/dist/_dts/{request-CA0izds5.d.ts → request-Gn0O1blj.d.ts} +25042 -23761
- package/dist/_dts/{resolveBlockData-ChQmwEd3.d.ts → resolveBlockData-D5duwuqS.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-BvGyvblj.d.ts → resolvePageContent-xzJ3c9Na.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 +1 -1
- 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 +91 -2
- package/dist/_dts/{serviceBookingOutline-BgFbJQhU.d.ts → serviceBookingOutline-B1gyJon_.d.ts} +7 -7
- package/dist/_dts/{types-CgS3xLk8.d.ts → types-BoITy0rA.d.ts} +41 -4
- package/dist/_dts/{types-CQrsP1x_.d.ts → types-DBNuMtSk.d.ts} +16 -5
- package/dist/_dts/{types-R65DKjPn.d.ts → types-DHMcuoeQ.d.ts} +7 -7
- package/dist/_dts/{validation-6LTIbuBA.d.ts → validation-BIPO-XlE.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DqZPz6oW.mjs → BlocksIslandsHydrator-Ct8slgRk.mjs} +22 -18
- package/dist/client/{BookingMailingListNote-uWfR2kaG.mjs → BookingMailingListNote-qqTxGGS4.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-CyNIKw6k.mjs → BookingQuestionFields-DCh9MUIF.mjs} +2 -2
- package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-RcdaStG7.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-BGCX3zwG.mjs → CalendarNavigationChevron-D7Wt-Oaa.mjs} +27 -10
- package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-BdGxZWeg.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-DFLPyuqe.mjs → DemoBookingPortalAccess-HFVkoOac.mjs} +5 -5
- package/dist/client/{EventCalendar.client-zDL4-t-B.mjs → EventCalendar.client-BtkJW8bA.mjs} +10 -10
- package/dist/client/{EventCombined.client-uciDKLID.mjs → EventCombined.client-DxaGjFFS.mjs} +9 -9
- package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-B2c5dR49.mjs} +1 -1
- package/dist/client/{EventItem-CwzrjcRw.mjs → EventItem-Fr2qi2C2.mjs} +33 -186
- package/dist/client/{EventListWeekNavigation-ChvcnPma.mjs → EventListWeekNavigation-BRMaq0ky.mjs} +1 -1
- package/dist/client/{EventListing.client-DA57Qoyx.mjs → EventListing.client-BhGxfbjt.mjs} +3 -3
- package/dist/client/{EventListing.view-DZ0qMFF4.mjs → EventListing.view-COuEJzbO.mjs} +8 -8
- package/dist/client/{EventRegistrationPayment-DSqCJL8E.mjs → EventRegistrationPayment-BTLYhVxD.mjs} +41 -195
- package/dist/client/{Page-C7mygH_f.mjs → Page-CgbQZP5g.mjs} +2947 -1018
- package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-BG7my0Qf.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-B4z-e4Wq.mjs → SiteTermsAgreementField-DQNkfNLA.mjs} +3 -3
- package/dist/client/{StepIndicator-Dn_DY4oY.mjs → StepIndicator-DvPekKeM.mjs} +1 -1
- package/dist/client/{StepIndicator-atfDU82W.mjs → StepIndicator-DyXoI3ob.mjs} +221 -20
- package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-Bc9DBbVp.mjs} +42 -9
- package/dist/client/{accessibleSurfaces-n6kS6Hct.mjs → accessibleSurfaces-wj4Rloo5.mjs} +1214 -724
- package/dist/client/{accordion-CsW8U3ff.mjs → accordion-BVXfjnh-.mjs} +1 -1
- package/dist/client/{booking-form.client-cBWM392H.mjs → booking-form.client-DycPGtke.mjs} +191 -71
- package/dist/client/{bookingForm-DgySpp6C.mjs → bookingForm-DrWSUqL3.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BpGVdLFD.mjs → boxStyleClassNames-CduDRcIk.mjs} +2 -2
- package/dist/client/buttonParts-CJEtVOUy.mjs +1511 -0
- package/dist/client/{carousel-DJoleFV3.mjs → carousel-DyCLMP8s.mjs} +2 -2
- package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DffP_Nv0.mjs} +1 -1
- package/dist/client/{cart-EO5o6uPH.mjs → cart-BuEp_cj4.mjs} +3 -3
- package/dist/client/{cart.client-D_gPw45z.mjs → cart.client-CAO39uDG.mjs} +1 -1
- package/dist/client/{checkout-NVfZW0kR.mjs → checkout-BoxzT64s.mjs} +3 -3
- package/dist/client/{checkout.client-DD3JuqOy.mjs → checkout.client-IGUy7XOx.mjs} +1 -1
- package/dist/client/{checkoutUrls-z2gXvlGw.mjs → checkoutUrls-D0UsiFmm.mjs} +1 -1
- package/dist/client/client.mjs +466 -94
- package/dist/client/{constants-CoOkvw__.mjs → constants-C_8AxMdm.mjs} +1 -1
- package/dist/client/{context-CRhn9qzS.mjs → context-D1L0pe__.mjs} +23 -5
- package/dist/client/{dateFormatting-BnWB4L1s.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-CWDGSTBu.mjs → demoPortalMagicLink-BunFTnIq.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-tdP_-Z9o.mjs → enhanceHeaderSection-CtLAG651.mjs} +4 -4
- package/dist/client/{event-registration.client-D7YYKySQ.mjs → event-registration.client-DiSxkBUP.mjs} +15 -15
- package/dist/client/{eventCalendar-CsAfu5d0.mjs → eventCalendar-DUnhwZ1o.mjs} +4 -4
- package/dist/client/{eventCombined-VXJB5CoS.mjs → eventCombined-BvBQo0nF.mjs} +4 -4
- package/dist/client/{eventListing-B3KIZNfY.mjs → eventListing-aTLifOX7.mjs} +4 -4
- package/dist/client/{eventRegistration-BP-dEk1c.mjs → eventRegistration-DFd7pr09.mjs} +4 -4
- package/dist/client/{form-DM8Zbxbv.mjs → form-Dikmc2AO.mjs} +3 -3
- package/dist/client/{form.client-e2z_Tlgk.mjs → form.client-zHaQK5I9.mjs} +5 -5
- package/dist/client/{form.parts-Ctljy1a3.mjs → form.parts-BLl9n8TH.mjs} +3 -3
- package/dist/client/gifting/client.mjs +16 -9
- package/dist/client/{gifting-DWIsqQru.mjs → gifting-CufPM38H.mjs} +4 -4
- package/dist/client/{gifting.client-QsSWF0uA.mjs → gifting.client--N1GaSY8.mjs} +155 -84
- package/dist/client/gifting.interactive-D9MK4HkV.mjs +157 -0
- package/dist/client/gifting.parts-CRtiRzo-.mjs +119 -0
- package/dist/client/{headerSection-DAkRkwb-.mjs → headerSection-BIaBpmk3.mjs} +2 -2
- package/dist/client/{noop-Dl4mZ-rr.mjs → islands-DJDLGQEm.mjs} +16008 -8676
- package/dist/client/{newsletter-form.client-WYja9-WN.mjs → newsletter-form.client-wg_JHTxm.mjs} +6 -6
- package/dist/client/{newsletter-form.interactive-RuM86VAv.mjs → newsletter-form.interactive-hzpkW9NQ.mjs} +384 -326
- package/dist/client/{newsletter-form.parts-2petDnWv.mjs → newsletter-form.parts-CgzpSv9p.mjs} +2 -2
- package/dist/client/{newsletterForm-BUbXdA_e.mjs → newsletterForm-CvxLiEBT.mjs} +3 -3
- package/dist/client/portal/client.mjs +291 -101
- package/dist/client/{portalOrders-COGn4BKG.mjs → portalOrders-tCxS04g0.mjs} +3 -2
- package/dist/client/{portalRoutes-D72yvtDh.mjs → portalRoutes-DTHlWg_F.mjs} +33 -7
- package/dist/client/{product-detail.client-pOAryevt.mjs → product-detail.client-22Q7zgjN.mjs} +1 -1
- package/dist/client/{product-list.client-CcUpUiud.mjs → product-list.client-DFWYvK8z.mjs} +1 -1
- package/dist/client/{productDetail-BZJCfqat.mjs → productDetail-DhZAwo60.mjs} +3 -3
- package/dist/client/{productList-CiRs3mNb.mjs → productList-BiVpbZK2.mjs} +3 -3
- package/dist/client/{propsDecoder--uHW4tFM.mjs → propsDecoder-DFYqKnLy.mjs} +4 -2
- package/dist/client/{registry.server-CDNNd8wC.mjs → registry.server-C3OBRg7x.mjs} +2305 -873
- package/dist/client/rendering/client.mjs +29 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +5 -5
- package/dist/client/{richText-coerce-CQGE_wHV.mjs → richText-coerce-ms477Z08.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-BtCg87-N.mjs → routeIslandApiConfig-B6nQeqvH.mjs} +1 -1
- package/dist/client/{runtimeResponse-Ds9cmBUf.mjs → runtimeResponse-BYqsV1Kb.mjs} +1 -1
- package/dist/client/runtimeResponse-CUX_lldL.mjs +3 -0
- package/dist/client/{shop-commerce-D8evQnMT.mjs → shop-commerce-DVsIcPaI.mjs} +16 -15
- package/dist/client/{shop-commerce-store-C9PcsSTj.mjs → shop-commerce-store-7mO6KY7_.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-D5CtGfJI.mjs → shop-discount-apply.state-L1Vge8tG.mjs} +2 -2
- package/dist/client/{shop-Rx_gEMK8.mjs → shop-xt4dQ3HH.mjs} +3 -3
- package/dist/client/{shop.client-D4lzQ9oY.mjs → shop.client-DNJfD3VQ.mjs} +28 -17
- package/dist/client/{shopShared-BVbq7Nm-.mjs → shopShared-DS8t6749.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{src-ZSqRK3dD.mjs → src-Do_s2lqH.mjs} +16 -19
- package/dist/client/{timetableModel-BQJrSK0K.mjs → timetableModel-Dy3nNfTG.mjs} +13 -17
- package/dist/client/{useAvailableSlots-Dm3lKJKR.mjs → useAvailableSlots-DcjtDpUu.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-klgfGn7f.mjs → useDiscountCodeUi-DvdFFWOT.mjs} +1 -1
- package/dist/client/{useEventPagination-Jnjt7_ly.mjs → useEventPagination-Cq-7sU5_.mjs} +8 -8
- package/dist/client/{view-CC_yQLSA.mjs → view-4gnPcpWJ.mjs} +24 -9
- package/dist/client/{wizardSteps-BliJOzEX.mjs → wizardSteps-DDvL3iza.mjs} +375 -186
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-aRJjq4x8.mjs → EventEmbeddedCheckoutStep-CLqSRUpt.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-BW3dRFIv.mjs → LocationPickerEnvironment-CIdAg-Tm.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Db9BHyXh.mjs → MapLibreEditMap-Bm85jX35.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-BhL0uADo.mjs → PageSectionToolbar-D8srnz9R.mjs} +445 -18
- package/dist/preview-next/client/{PreviewEditorSidebar-Ct8eIm0i.mjs → PreviewEditorSidebar-DVpk5cqp.mjs} +3871 -1947
- package/dist/preview-next/client/{PreviewEditorUI-BS32G4V9.mjs → PreviewEditorUI-XoTtHSFH.mjs} +11 -36
- package/dist/preview-next/client/{PreviewShell-RL0WfZXD.mjs → PreviewShell-VQHsRg2u.mjs} +40 -35
- package/dist/preview-next/client/{SdkPreviewModeRuntime-MK_gHeGy.mjs → SdkPreviewModeRuntime-CLdF9f6o.mjs} +51 -20
- package/dist/preview-next/client/{ThemedButton-CVYz7h68.mjs → ThemedButton-ORNN4x-3.mjs} +782 -16
- package/dist/preview-next/client/{lucide-react-00FF_oar.mjs → lucide-react-eAi3tDAr.mjs} +11 -1
- package/dist/preview-next/client/{previewAssistantSlot-CQyS8pcq.mjs → previewAssistantSlot-CqH91EwA.mjs} +20687 -8562
- package/dist/preview-next/client/{previewChromeRoot-BSxp3Mfu.mjs → previewChromeRoot-B3ySEu6p.mjs} +3 -90
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DKnTzy74.mjs → sdk-runtime-CdpSupcr.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BlmbvbLN.mjs → siteStyleAccess-C6eOP6QW.mjs} +35 -6
- package/dist/preview-next/client/{useAutosaveStatus-D-7GwZOQ.mjs → useAutosaveStatus-BhPg4e-r.mjs} +49 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BNZtGM5g.mjs → useOpenBlockForSetup-BaWUF9D7.mjs} +2007 -448
- package/dist/preview-next/container-responsive.css +320 -0
- 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-R3PcMmax.mjs → route-contract-Ch0X99vE.mjs} +183 -18
- package/dist/server/{Block.shared-CniF9tSu.mjs → Block.shared-B2FmczLO.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BQWsnGT6.mjs → ThemeScopeCore-DtAyv9qA.mjs} +51 -29
- package/dist/server/{accessibleSurfaces-WPzUAHp4.mjs → accessibleSurfaces-BtPqb76u.mjs} +509 -389
- package/dist/server/{accordions-By_0Ykks.mjs → accordions-vzdZ2Wt1.mjs} +1 -1
- package/dist/server/{bindings-DxojjtK3.mjs → bindings-B_9JuU66.mjs} +7 -7
- package/dist/server/{client-CDndhbYO.mjs → client-DC7cjiSw.mjs} +489 -93
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-VyF5nEhL.mjs → constants-d6nPNJpe.mjs} +33 -6
- package/dist/server/{customCss-C9kgPHvr.mjs → customCss-rtIfEYwQ.mjs} +1 -18
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{resolveButtonColourStates-B0O1IM16.mjs → expandPalette-DxPrNOAB.mjs} +950 -316
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BKstMBmX.mjs → loadContent-hb27HYic.mjs} +11 -10
- package/dist/server/{loadPage-IgNnZaqr.mjs → loadPage-JToD8wDD.mjs} +3 -3
- package/dist/server/{lookMediaFrame-TFjgNG61.mjs → lookMediaFrame-CTsycLLK.mjs} +94 -39
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-quBYlSKD.mjs → navigation-B2WhGofA.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +8 -8
- package/dist/server/{overrideResolution-CCaAPpIa.mjs → overrideResolution-vD5KTClL.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-B7iULvKe.mjs → pageRenderPlan-CdqJ1NQZ.mjs} +242 -336
- package/dist/server/{pageRuntimeSupport-BytMroxn.mjs → pageRuntimeSupport-CAhr4oOf.mjs} +3 -3
- package/dist/server/{pageShared-Dcs_XTIO.mjs → pageShared-m80Xu2pd.mjs} +1292 -877
- package/dist/server/{parseThemeForPersistence-Bihl4W5K.mjs → parseThemeForPersistence-CRwOZfpa.mjs} +3 -3
- package/dist/server/{portal-CMW_b9mG.mjs → portal-B2wCQno_.mjs} +1 -1
- package/dist/server/portal.mjs +2 -2
- package/dist/server/{prebuild-agaH-vZV.mjs → prebuild-BWIkFaXq.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-DwpRjqw4.mjs → prefetchBlockData-D1PHU-K9.mjs} +3 -3
- package/dist/server/{registry-DM9dHfDC.mjs → registry-KtsOsAzY.mjs} +21703 -10936
- 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 +9 -9
- package/dist/server/{resolveBlockData-CinHGf8l.mjs → resolveBlockData-sjIDJYl7.mjs} +1 -1
- package/dist/server/{schema-CwfxQjc4.mjs → schema-BBEqquBM.mjs} +44 -28
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-BBBhOtdE.mjs → servicePageContent-ChEZDRwU.mjs} +38 -15
- package/dist/server/theme-bridge.mjs +34 -9
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-DPaUPTfl.mjs → three-pass-converter-DKCIBeb1.mjs} +2 -2
- package/dist/server/{titleSourceSchema-NhK6azFS.mjs → titleSourceSchema-DybHErxH.mjs} +4 -4
- package/dist/server/{typeGuards-CTW_9AXq.mjs → typeGuards-DZOaGTEv.mjs} +126 -126
- package/dist/server/{types-BKaBZFjD.mjs → types-vyz09w64.mjs} +479 -8
- package/dist/server/{validation-DG5jX3jH.mjs → validation-Cvi-1TZZ.mjs} +13 -9
- package/dist/server/{version-CipbxPHL.mjs → version-B-icAIV1.mjs} +1 -1
- package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
- package/dist/styles/index.css +2568 -154
- package/package.json +1 -1
- package/dist/client/gifting.parts-CedLgwa_.mjs +0 -86
- package/dist/client/runtimeResponse-DL_ARBpa.mjs +0 -3
- package/dist/client/types-BEaKfam_.mjs +0 -778
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 { wc as parseSiteId } from "./wizardSteps-DDvL3iza.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-CgbQZP5g.mjs";
|
|
4
|
+
import { cr as publicMapLocationParamsSchema } from "./registry.server-C3OBRg7x.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-BYqsV1Kb.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,68 @@ 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
|
-
|
|
784
|
-
z.literal(4),
|
|
785
|
-
z.literal("last")
|
|
786
|
-
])
|
|
856
|
+
localStart,
|
|
857
|
+
effectiveFrom: localDate,
|
|
858
|
+
bookAhead: z.number().int().min(0).max(52),
|
|
859
|
+
bookShortfallAsOwed: z.boolean().default(false)
|
|
787
860
|
}).strict()]);
|
|
788
861
|
const arrangementEndSchema = z.discriminatedUnion("kind", [
|
|
789
862
|
z.object({ kind: z.literal("open") }).strict(),
|
|
@@ -807,10 +880,9 @@ const arrangementPaymentSchema = z.discriminatedUnion("kind", [
|
|
|
807
880
|
sendOffsetMinutes: z.number().int().min(1).max(525600)
|
|
808
881
|
}).strict()
|
|
809
882
|
]);
|
|
810
|
-
|
|
883
|
+
z.object({
|
|
811
884
|
effectiveFrom: localDate,
|
|
812
|
-
|
|
813
|
-
localStart: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/)
|
|
885
|
+
pattern: arrangementPatternSchema
|
|
814
886
|
}).strict();
|
|
815
887
|
const recordedReturn = { recordedReturn: z.literal("staff_confirmed").optional() };
|
|
816
888
|
const operation = {
|
|
@@ -826,7 +898,7 @@ const createClientArrangementSchema = z.object({
|
|
|
826
898
|
holdsTime: z.boolean(),
|
|
827
899
|
end: arrangementEndSchema,
|
|
828
900
|
payment: arrangementPaymentSchema,
|
|
829
|
-
schedule:
|
|
901
|
+
schedule: arrangementSetUpScheduleSchema,
|
|
830
902
|
bookAhead: z.number().int().min(0).max(52),
|
|
831
903
|
bookShortfallAsOwed: z.boolean().default(false)
|
|
832
904
|
}).strict();
|
|
@@ -845,7 +917,7 @@ const arrangementAwaySchema = z.object({
|
|
|
845
917
|
}).strict().refine((value) => value.backOn > value.from, "Choose a return date after the first day away.");
|
|
846
918
|
const arrangementChangeFromSchema = z.object({
|
|
847
919
|
...operation,
|
|
848
|
-
|
|
920
|
+
command: arrangementScheduleCommandSchema
|
|
849
921
|
}).strict();
|
|
850
922
|
const arrangementOneWeekSchema = z.object({
|
|
851
923
|
...operation,
|
|
@@ -854,14 +926,27 @@ const arrangementOneWeekSchema = z.object({
|
|
|
854
926
|
endAt: z.iso.datetime({ offset: true }),
|
|
855
927
|
bookShortfallAsOwed: z.boolean().default(false)
|
|
856
928
|
}).strict().refine((value) => Date.parse(value.endAt) > Date.parse(value.startAt), "Choose an end after the start.");
|
|
857
|
-
|
|
929
|
+
/**
|
|
930
|
+
* Ending all of it, or one day: that day stops after `lastDate`, its bookings after then are
|
|
931
|
+
* cancelled, and the other days carry on.
|
|
932
|
+
*/
|
|
933
|
+
const arrangementEndRequestSchema = z.discriminatedUnion("scope", [z.object({
|
|
858
934
|
...operation,
|
|
859
935
|
...recordedReturn,
|
|
936
|
+
scope: z.literal("all"),
|
|
860
937
|
lastDate: localDate
|
|
861
|
-
}).strict()
|
|
938
|
+
}).strict(), z.object({
|
|
939
|
+
...operation,
|
|
940
|
+
...recordedReturn,
|
|
941
|
+
scope: z.literal("day"),
|
|
942
|
+
slotId: z.string().uuid(),
|
|
943
|
+
lastDate: localDate
|
|
944
|
+
}).strict()]);
|
|
862
945
|
/** `expectedUpdatedAt` is the version the dialog was showing, so a save can't overwrite a newer change. */
|
|
946
|
+
/** `confirmation` is the preview's, when booked sessions change with the service. */
|
|
863
947
|
const arrangementEditSchema = z.object({
|
|
864
948
|
...operation,
|
|
949
|
+
confirmation: z.string().optional(),
|
|
865
950
|
expectedUpdatedAt: z.string().min(1),
|
|
866
951
|
serviceId: z.string().uuid(),
|
|
867
952
|
holdsTime: z.boolean(),
|
|
@@ -981,6 +1066,19 @@ z.intersection(z.object({ occurrenceDate: localDate }), z.union([
|
|
|
981
1066
|
})
|
|
982
1067
|
])
|
|
983
1068
|
}),
|
|
1069
|
+
z.object({
|
|
1070
|
+
outcome: z.literal("service_changed"),
|
|
1071
|
+
appointmentId: z.string(),
|
|
1072
|
+
startAt: z.string(),
|
|
1073
|
+
endAt: z.string(),
|
|
1074
|
+
previousEndAt: z.string(),
|
|
1075
|
+
price: z.discriminatedUnion("kind", [z.object({
|
|
1076
|
+
kind: z.literal("restated"),
|
|
1077
|
+
fromCents: z.number().int(),
|
|
1078
|
+
toCents: z.number().int(),
|
|
1079
|
+
currency: z.string()
|
|
1080
|
+
}), z.object({ kind: z.literal("kept") })])
|
|
1081
|
+
}),
|
|
984
1082
|
z.object({
|
|
985
1083
|
outcome: z.literal("cancelled"),
|
|
986
1084
|
appointmentId: z.string(),
|
|
@@ -3404,6 +3502,59 @@ const GIFTING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
3404
3502
|
"server:internal_error"
|
|
3405
3503
|
]
|
|
3406
3504
|
},
|
|
3505
|
+
getGiftRefund: {
|
|
3506
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
3507
|
+
method: "GET",
|
|
3508
|
+
auth: "user",
|
|
3509
|
+
responseKind: "json",
|
|
3510
|
+
errors: [
|
|
3511
|
+
"auth:forbidden",
|
|
3512
|
+
"resource:conflict",
|
|
3513
|
+
"server:internal_error"
|
|
3514
|
+
]
|
|
3515
|
+
},
|
|
3516
|
+
refundGift: {
|
|
3517
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
3518
|
+
method: "POST",
|
|
3519
|
+
auth: "user",
|
|
3520
|
+
responseKind: "json",
|
|
3521
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
3522
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
3523
|
+
errors: [
|
|
3524
|
+
"auth:forbidden",
|
|
3525
|
+
"resource:conflict",
|
|
3526
|
+
"server:internal_error"
|
|
3527
|
+
]
|
|
3528
|
+
},
|
|
3529
|
+
cancelGift: {
|
|
3530
|
+
path: "/sites/{siteId}/gifting/gifts/{giftId}/cancel",
|
|
3531
|
+
method: "POST",
|
|
3532
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
3533
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
3534
|
+
auth: "user",
|
|
3535
|
+
responseKind: "json",
|
|
3536
|
+
errors: [
|
|
3537
|
+
"auth:forbidden",
|
|
3538
|
+
"resource:not_found",
|
|
3539
|
+
"resource:conflict",
|
|
3540
|
+
"server:internal_error"
|
|
3541
|
+
]
|
|
3542
|
+
},
|
|
3543
|
+
changeGiftExpiry: {
|
|
3544
|
+
path: "/sites/{siteId}/gifting/gifts/{giftId}/expiry",
|
|
3545
|
+
method: "POST",
|
|
3546
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
3547
|
+
auth: "user",
|
|
3548
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
3549
|
+
responseKind: "json",
|
|
3550
|
+
errors: [
|
|
3551
|
+
"validation:invalid_input",
|
|
3552
|
+
"auth:forbidden",
|
|
3553
|
+
"resource:not_found",
|
|
3554
|
+
"resource:conflict",
|
|
3555
|
+
"server:internal_error"
|
|
3556
|
+
]
|
|
3557
|
+
},
|
|
3407
3558
|
updateGiftingSettings: {
|
|
3408
3559
|
path: "/sites/{siteId}/gifting/settings",
|
|
3409
3560
|
method: "PATCH",
|
|
@@ -5952,6 +6103,22 @@ const API_ENDPOINTS$1 = {
|
|
|
5952
6103
|
auth: "user",
|
|
5953
6104
|
responseKind: "json"
|
|
5954
6105
|
},
|
|
6106
|
+
getRegisteredDomainContact: {
|
|
6107
|
+
errors: [
|
|
6108
|
+
"resource:not_found",
|
|
6109
|
+
"auth:forbidden",
|
|
6110
|
+
"validation:invalid_input"
|
|
6111
|
+
],
|
|
6112
|
+
path: "/domains/{domainId}/registrar/contact",
|
|
6113
|
+
method: "GET",
|
|
6114
|
+
auth: "user",
|
|
6115
|
+
tags: [
|
|
6116
|
+
"domains",
|
|
6117
|
+
"domain-{domainId}",
|
|
6118
|
+
"domain-registrar"
|
|
6119
|
+
],
|
|
6120
|
+
responseKind: "json"
|
|
6121
|
+
},
|
|
5955
6122
|
updateRegisteredDomainContact: {
|
|
5956
6123
|
path: "/domains/{domainId}/registrar/contact",
|
|
5957
6124
|
method: "POST",
|
|
@@ -6036,6 +6203,18 @@ const API_ENDPOINTS$1 = {
|
|
|
6036
6203
|
auth: "user",
|
|
6037
6204
|
responseKind: "json"
|
|
6038
6205
|
},
|
|
6206
|
+
retryDomainEmailSending: {
|
|
6207
|
+
errors: [],
|
|
6208
|
+
path: "/sites/{siteId}/domains/{domainId}/email/retry",
|
|
6209
|
+
method: "POST",
|
|
6210
|
+
tags: [
|
|
6211
|
+
"domains",
|
|
6212
|
+
"domain-{domainId}",
|
|
6213
|
+
"domain-dns"
|
|
6214
|
+
],
|
|
6215
|
+
auth: "user",
|
|
6216
|
+
responseKind: "json"
|
|
6217
|
+
},
|
|
6039
6218
|
retryDomainResend: {
|
|
6040
6219
|
path: "/domains/{domainId}/resend",
|
|
6041
6220
|
method: "POST",
|
|
@@ -9786,7 +9965,11 @@ const API_ENDPOINTS$1 = {
|
|
|
9786
9965
|
method: "GET",
|
|
9787
9966
|
auth: "public",
|
|
9788
9967
|
responseKind: "json",
|
|
9789
|
-
errors: [
|
|
9968
|
+
errors: [
|
|
9969
|
+
"resource:not_found",
|
|
9970
|
+
"resource:gone",
|
|
9971
|
+
"server:internal_error"
|
|
9972
|
+
]
|
|
9790
9973
|
},
|
|
9791
9974
|
portalGetBooking: {
|
|
9792
9975
|
path: "/portal/bookings/{kind}/{bookingId}",
|
|
@@ -10388,6 +10571,9 @@ function resolveApiBaseUrl() {
|
|
|
10388
10571
|
}
|
|
10389
10572
|
//#endregion
|
|
10390
10573
|
//#region ../api/src/pageReadResponseCache.ts
|
|
10574
|
+
function pageReadPolicy(siteId, policy) {
|
|
10575
|
+
return policy === "retry" ? buildPageReadRetryPolicy(siteId) : buildPageReadCachePolicy(siteId, policy);
|
|
10576
|
+
}
|
|
10391
10577
|
function isRecord(value) {
|
|
10392
10578
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10393
10579
|
}
|
|
@@ -10398,8 +10584,20 @@ function isResolvedPage(page) {
|
|
|
10398
10584
|
"system_service"
|
|
10399
10585
|
].includes(String(page.result.kind));
|
|
10400
10586
|
}
|
|
10587
|
+
/**
|
|
10588
|
+
* The key `serializeSurfaceTree` (theme-core) wraps a response in when it carries surface revisions. This package
|
|
10589
|
+
* can't depend on theme-core, so the SDK's tests check the two stay equal.
|
|
10590
|
+
*/
|
|
10591
|
+
const SURFACE_TRANSPORT_ENVELOPE_KEY = "$surfaceTransport";
|
|
10592
|
+
/** A revision-transport body keeps the page's own fields under the envelope's `value`. */
|
|
10593
|
+
function withoutSurfaceTransport(data) {
|
|
10594
|
+
const envelope = data[SURFACE_TRANSPORT_ENVELOPE_KEY];
|
|
10595
|
+
if (envelope === void 0) return data;
|
|
10596
|
+
return isRecord(envelope) && Array.isArray(envelope.revisions) && envelope.revisions.length > 0 && isRecord(envelope.value) ? envelope.value : null;
|
|
10597
|
+
}
|
|
10401
10598
|
function envelopePage(body) {
|
|
10402
|
-
const
|
|
10599
|
+
const raw = isRecord(body) && body.success === true && isRecord(body.data) ? body.data : null;
|
|
10600
|
+
const data = raw ? withoutSurfaceTransport(raw) : null;
|
|
10403
10601
|
return data?.type === "content" && isRecord(data.content) ? data.content : data;
|
|
10404
10602
|
}
|
|
10405
10603
|
function parseBody(body) {
|
|
@@ -10416,40 +10614,44 @@ function admit(snapshot) {
|
|
|
10416
10614
|
if (snapshot.status === 200 && isResolvedPage(page)) {
|
|
10417
10615
|
if (header(snapshot, "x-riverbank-page-storage") === "no-store") return {
|
|
10418
10616
|
kind: "pass-through",
|
|
10419
|
-
|
|
10617
|
+
policy: "retry"
|
|
10420
10618
|
};
|
|
10421
10619
|
return {
|
|
10422
10620
|
kind: "store",
|
|
10423
|
-
|
|
10621
|
+
policy: page.dependencies
|
|
10424
10622
|
};
|
|
10425
10623
|
}
|
|
10624
|
+
if (snapshot.status === 200) return {
|
|
10625
|
+
kind: "pass-through",
|
|
10626
|
+
policy: "retry"
|
|
10627
|
+
};
|
|
10426
10628
|
return {
|
|
10427
10629
|
kind: "pass-through",
|
|
10428
|
-
|
|
10630
|
+
policy: header(snapshot, "x-riverbank-page-dependencies") === "availability" ? "availability" : "content"
|
|
10429
10631
|
};
|
|
10430
10632
|
}
|
|
10431
10633
|
/**
|
|
10432
10634
|
* One cache entry per request, judged by the policy it is looked up with. Content is looked up first, so a
|
|
10433
10635
|
* plain page costs one lookup and never registers the availability policy. A page whose snapshot depends on
|
|
10434
|
-
* availability is looked up again under that policy, which checks its tags and
|
|
10636
|
+
* availability (or must be retried soon) is looked up again under that policy, which checks its tags and budget. A snapshot
|
|
10435
10637
|
* past its own budget is never served: the live read replaces it.
|
|
10436
10638
|
*/
|
|
10437
10639
|
function planPageRead(state, now, budgetSeconds) {
|
|
10438
10640
|
const subject = state.live ?? state.cached;
|
|
10439
10641
|
if (!subject) return {
|
|
10440
10642
|
kind: "lookup",
|
|
10441
|
-
|
|
10643
|
+
policy: "content"
|
|
10442
10644
|
};
|
|
10443
|
-
const {
|
|
10444
|
-
if (!state.lookedUp.includes(
|
|
10645
|
+
const { policy } = admit(subject);
|
|
10646
|
+
if (!state.lookedUp.includes(policy)) return {
|
|
10445
10647
|
kind: "lookup",
|
|
10446
|
-
|
|
10648
|
+
policy
|
|
10447
10649
|
};
|
|
10448
10650
|
if (state.live) return {
|
|
10449
10651
|
kind: "serve",
|
|
10450
10652
|
snapshot: state.live
|
|
10451
10653
|
};
|
|
10452
|
-
return now - subject.cachedAt < budgetSeconds(
|
|
10654
|
+
return now - subject.cachedAt < budgetSeconds(policy) * 1e3 ? {
|
|
10453
10655
|
kind: "serve",
|
|
10454
10656
|
snapshot: subject
|
|
10455
10657
|
} : { kind: "read-live" };
|
|
@@ -10460,12 +10662,21 @@ function planPageRead(state, now, budgetSeconds) {
|
|
|
10460
10662
|
*/
|
|
10461
10663
|
var PassThroughResponse = class extends Error {
|
|
10462
10664
|
constructor(snapshot) {
|
|
10463
|
-
super("
|
|
10665
|
+
super("Read must not be stored");
|
|
10464
10666
|
this.snapshot = snapshot;
|
|
10465
10667
|
}
|
|
10466
10668
|
};
|
|
10467
|
-
|
|
10468
|
-
|
|
10669
|
+
/**
|
|
10670
|
+
* Names this cache's entries. Next keys an entry by these parts plus the callback's source text, and neither
|
|
10671
|
+
* changes when the response contract does, so a contract change bumps this name: otherwise a deploy keeps
|
|
10672
|
+
* serving responses the previous release cached, in the old shape, for up to their whole budget.
|
|
10673
|
+
*
|
|
10674
|
+
* - v4: a resolved page carries its own mailing-list support (`mailingList`); the hosted frontend no longer
|
|
10675
|
+
* asks the site read for it, so a v3 response would leave the page's newsletter forms without their lists.
|
|
10676
|
+
*/
|
|
10677
|
+
const PAGE_READ_RESPONSE_CACHE_NAME = "page-read-envelope-v4";
|
|
10678
|
+
async function lookup(input, policy) {
|
|
10679
|
+
const { tags } = pageReadPolicy(input.siteId, policy);
|
|
10469
10680
|
const load = async () => {
|
|
10470
10681
|
const snapshot = await input.live();
|
|
10471
10682
|
if (admit(snapshot).kind === "pass-through") throw new PassThroughResponse(snapshot);
|
|
@@ -10473,8 +10684,8 @@ async function lookup(input, dependencies) {
|
|
|
10473
10684
|
};
|
|
10474
10685
|
try {
|
|
10475
10686
|
return {
|
|
10476
|
-
cached: await input.cache(load, [
|
|
10477
|
-
revalidate: input.budgetSeconds(
|
|
10687
|
+
cached: await input.cache(load, [PAGE_READ_RESPONSE_CACHE_NAME, input.key], {
|
|
10688
|
+
revalidate: input.budgetSeconds(policy),
|
|
10478
10689
|
tags
|
|
10479
10690
|
})(),
|
|
10480
10691
|
live: null
|
|
@@ -10496,9 +10707,9 @@ async function runPlan(input, state) {
|
|
|
10496
10707
|
live: await input.live()
|
|
10497
10708
|
});
|
|
10498
10709
|
case "lookup": {
|
|
10499
|
-
const found = await lookup(input, step.
|
|
10710
|
+
const found = await lookup(input, step.policy);
|
|
10500
10711
|
return runPlan(input, {
|
|
10501
|
-
lookedUp: [...state.lookedUp, step.
|
|
10712
|
+
lookedUp: [...state.lookedUp, step.policy],
|
|
10502
10713
|
cached: found.cached ?? state.cached,
|
|
10503
10714
|
live: state.live ?? found.live
|
|
10504
10715
|
});
|
|
@@ -10530,9 +10741,9 @@ async function frameworkCacheKey(request) {
|
|
|
10530
10741
|
async function cachePageReadResponse(input) {
|
|
10531
10742
|
if (!input.cache || input.maxAge !== void 0 && input.maxAge <= 0) return input.read();
|
|
10532
10743
|
const maxAge = input.maxAge;
|
|
10533
|
-
const budgetSeconds = (
|
|
10534
|
-
const
|
|
10535
|
-
return maxAge === void 0 ?
|
|
10744
|
+
const budgetSeconds = (policy) => {
|
|
10745
|
+
const revalidate = pageReadPolicy(input.siteId, policy).revalidate;
|
|
10746
|
+
return maxAge === void 0 ? revalidate : Math.min(revalidate, maxAge);
|
|
10536
10747
|
};
|
|
10537
10748
|
const key = await frameworkCacheKey(input.key);
|
|
10538
10749
|
const result = await runPlan({
|
|
@@ -10551,15 +10762,53 @@ async function cachePageReadResponse(input) {
|
|
|
10551
10762
|
headers: result.headers
|
|
10552
10763
|
});
|
|
10553
10764
|
}
|
|
10765
|
+
/**
|
|
10766
|
+
* Names the site read's entries, for the same reason as `PAGE_READ_RESPONSE_CACHE_NAME`. A site read only
|
|
10767
|
+
* enters this cache when the host can answer it from its durable copy; otherwise it stays in Next's fetch cache.
|
|
10768
|
+
*/
|
|
10769
|
+
const SITE_READ_RESPONSE_CACHE_NAME = "site-read-envelope-v1";
|
|
10770
|
+
/**
|
|
10771
|
+
* A site read through the framework cache, with the fetch cache's lifetime and tags, so its fill can come from
|
|
10772
|
+
* the host's durable copy. As in Next's fetch cache, only a 200 is kept: an incomplete site (207) or a failure
|
|
10773
|
+
* passes through and the next read asks again.
|
|
10774
|
+
*/
|
|
10775
|
+
async function cacheSiteReadResponse(input) {
|
|
10776
|
+
const live = sharedRead(input.read);
|
|
10777
|
+
const load = async () => {
|
|
10778
|
+
const snapshot = await live();
|
|
10779
|
+
if (snapshot.status !== 200) throw new PassThroughResponse(snapshot);
|
|
10780
|
+
return snapshot;
|
|
10781
|
+
};
|
|
10782
|
+
const key = await frameworkCacheKey(input.key);
|
|
10783
|
+
const found = await input.cache(load, [SITE_READ_RESPONSE_CACHE_NAME, key], {
|
|
10784
|
+
revalidate: input.policy.revalidate,
|
|
10785
|
+
tags: input.policy.tags
|
|
10786
|
+
})().catch((error) => {
|
|
10787
|
+
if (error instanceof PassThroughResponse) return error.snapshot;
|
|
10788
|
+
throw error;
|
|
10789
|
+
});
|
|
10790
|
+
const snapshot = Date.now() - found.cachedAt < input.policy.revalidate * 1e3 ? found : await live();
|
|
10791
|
+
return new Response(snapshot.body, {
|
|
10792
|
+
status: snapshot.status,
|
|
10793
|
+
headers: snapshot.headers
|
|
10794
|
+
});
|
|
10795
|
+
}
|
|
10554
10796
|
/** Result adapters use this when the SDK served a page without the HTTP transport (memory, durable or prebuild fallback). */
|
|
10555
10797
|
async function observePageReadPolicy(cache, siteId, payload) {
|
|
10556
10798
|
if (!cache) return;
|
|
10557
|
-
const
|
|
10799
|
+
const policy = observedPageReadPolicy(pageReadDependencies(payload));
|
|
10558
10800
|
await cache(async () => true, [
|
|
10559
|
-
"page-read-policy-
|
|
10801
|
+
"page-read-policy-v3",
|
|
10560
10802
|
siteId,
|
|
10561
|
-
|
|
10562
|
-
],
|
|
10803
|
+
policy
|
|
10804
|
+
], pageReadPolicy(siteId, policy))();
|
|
10805
|
+
}
|
|
10806
|
+
/**
|
|
10807
|
+
* A page served without the tagged transport (memory, durable or prebuild) may predate a write's purge, so an
|
|
10808
|
+
* availability page only earns the retry window, not the rendered-availability backstop a purge would end.
|
|
10809
|
+
*/
|
|
10810
|
+
function observedPageReadPolicy(dependency) {
|
|
10811
|
+
return dependency === "availability" ? "retry" : "content";
|
|
10563
10812
|
}
|
|
10564
10813
|
//#endregion
|
|
10565
10814
|
//#region ../api/src/common/operationId.ts
|
|
@@ -10854,19 +11103,88 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
|
|
|
10854
11103
|
function isPublishedPageRead(endpoint, params, options) {
|
|
10855
11104
|
return (endpoint === "getContentByPath" || endpoint === "resolveRouteOutcome") && params?.preview !== true && params?.preview !== "true" && options.cache !== "no-store";
|
|
10856
11105
|
}
|
|
11106
|
+
/** The dashboard's reading of a boolean query flag, so a host never treats `force=1` as unforced. */
|
|
11107
|
+
const isTruthyRequestParam = (value) => value === true || value === "true" || value === 1 || value === "1";
|
|
11108
|
+
/** Forced reads skip every cache, and an id-only lookup is a different response the durable cache never holds. */
|
|
11109
|
+
function isFullSiteRead(params) {
|
|
11110
|
+
return !isTruthyRequestParam(params.force) && (params.scope === void 0 || params.scope === "full");
|
|
11111
|
+
}
|
|
11112
|
+
/** A published, full site read with a lifetime: the host's durable copy may answer it, under the fetch's policy. */
|
|
11113
|
+
function publishedSiteReadPolicy(endpoint, params, plan) {
|
|
11114
|
+
const next = plan.init.cache === "no-store" ? void 0 : plan.init.next;
|
|
11115
|
+
const revalidate = typeof next?.revalidate === "number" && next.revalidate > 0 ? next.revalidate : null;
|
|
11116
|
+
return endpoint === "getSite" && revalidate !== null && isFullSiteRead(params) ? {
|
|
11117
|
+
revalidate,
|
|
11118
|
+
tags: next?.tags ?? []
|
|
11119
|
+
} : null;
|
|
11120
|
+
}
|
|
11121
|
+
/** The dashboard's success envelope around a durable copy, so admission and parsing treat it like a live response. */
|
|
11122
|
+
function freshPublishedResponse(data) {
|
|
11123
|
+
return new Response(JSON.stringify(buildSuccessEnvelope(data, void 0)), {
|
|
11124
|
+
status: 200,
|
|
11125
|
+
headers: {
|
|
11126
|
+
"content-type": "application/json",
|
|
11127
|
+
"x-riverbank-cache": "frontend-hit"
|
|
11128
|
+
}
|
|
11129
|
+
});
|
|
11130
|
+
}
|
|
11131
|
+
/** The cache fill's read: the host's fresh durable copy when it has one, otherwise the dashboard. */
|
|
11132
|
+
function freshPublishedFirst(read, request, live) {
|
|
11133
|
+
if (!read) return live;
|
|
11134
|
+
return async () => {
|
|
11135
|
+
const found = await read(request).catch(() => null);
|
|
11136
|
+
return found ? freshPublishedResponse(found.data) : live();
|
|
11137
|
+
};
|
|
11138
|
+
}
|
|
11139
|
+
function publishedPageResponse(read) {
|
|
11140
|
+
const revalidate = read.plan.init.next?.revalidate;
|
|
11141
|
+
return cachePageReadResponse({
|
|
11142
|
+
cache: read.frameworkCache?.cache ?? null,
|
|
11143
|
+
key: read.key,
|
|
11144
|
+
siteId: typeof read.params.siteId === "string" ? read.params.siteId : "",
|
|
11145
|
+
maxAge: typeof revalidate === "number" ? revalidate : void 0,
|
|
11146
|
+
read: read.endpoint === "getContentByPath" ? freshPublishedFirst(read.frameworkCache?.readFreshPublished, {
|
|
11147
|
+
endpoint: "getContentByPath",
|
|
11148
|
+
params: read.params
|
|
11149
|
+
}, read.uncachedFetch) : read.uncachedFetch
|
|
11150
|
+
});
|
|
11151
|
+
}
|
|
11152
|
+
/** Without a durable reader, a site read stays in Next's fetch cache exactly as before. */
|
|
11153
|
+
function siteOrFetchResponse(read) {
|
|
11154
|
+
const durable = read.frameworkCache?.readFreshPublished;
|
|
11155
|
+
const policy = durable ? publishedSiteReadPolicy(read.endpoint, read.params, read.plan) : null;
|
|
11156
|
+
return read.frameworkCache && policy ? cacheSiteReadResponse({
|
|
11157
|
+
cache: read.frameworkCache.cache,
|
|
11158
|
+
key: read.key,
|
|
11159
|
+
policy,
|
|
11160
|
+
read: freshPublishedFirst(durable, {
|
|
11161
|
+
endpoint: "getSite",
|
|
11162
|
+
params: read.params
|
|
11163
|
+
}, read.uncachedFetch)
|
|
11164
|
+
}) : observedFetch(read.plan, read.endpoint, read.frameworkCache);
|
|
11165
|
+
}
|
|
10857
11166
|
function executeApiRequest(plan, endpoint, params, options, frameworkCache) {
|
|
10858
|
-
const
|
|
10859
|
-
const
|
|
10860
|
-
|
|
10861
|
-
|
|
11167
|
+
const { next: _fetchPolicy, ...uncachedInit } = plan.init;
|
|
11168
|
+
const read = {
|
|
11169
|
+
plan,
|
|
11170
|
+
endpoint,
|
|
11171
|
+
params: params ?? {},
|
|
11172
|
+
frameworkCache,
|
|
10862
11173
|
key: JSON.stringify([plan.url, [...new Headers(plan.init.headers).entries()]]),
|
|
10863
|
-
|
|
10864
|
-
maxAge: typeof fetchPolicy?.revalidate === "number" ? fetchPolicy.revalidate : void 0,
|
|
10865
|
-
read: () => fetch(plan.url, {
|
|
11174
|
+
uncachedFetch: () => fetch(plan.url, {
|
|
10866
11175
|
...uncachedInit,
|
|
10867
11176
|
cache: "no-store"
|
|
10868
11177
|
})
|
|
10869
|
-
}
|
|
11178
|
+
};
|
|
11179
|
+
return isPublishedPageRead(endpoint, params, options) ? publishedPageResponse(read) : siteOrFetchResponse(read);
|
|
11180
|
+
}
|
|
11181
|
+
function observedFetch(plan, endpoint, frameworkCache) {
|
|
11182
|
+
const revalidate = plan.init.next?.revalidate;
|
|
11183
|
+
if (typeof revalidate === "number" && plan.init.cache !== "no-store") frameworkCache?.observeFetchLifetime?.({
|
|
11184
|
+
endpoint: String(endpoint),
|
|
11185
|
+
revalidate
|
|
11186
|
+
});
|
|
11187
|
+
return fetch(plan.url, plan.init);
|
|
10870
11188
|
}
|
|
10871
11189
|
const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
|
|
10872
11190
|
endpoint: z.string(),
|
|
@@ -11648,7 +11966,7 @@ var SimpleCache = class {
|
|
|
11648
11966
|
//#endregion
|
|
11649
11967
|
//#region src/request-options.ts
|
|
11650
11968
|
/** Every API client the SDK creates sends its version as `x-sdk-version`. */
|
|
11651
|
-
const sdkRequestOptions = { sdkVersion: "0.
|
|
11969
|
+
const sdkRequestOptions = { sdkVersion: "0.183.0" };
|
|
11652
11970
|
//#endregion
|
|
11653
11971
|
//#region src/public-api/runtime.ts
|
|
11654
11972
|
const PUBLIC_ENDPOINT_NAMES = [
|
|
@@ -11835,6 +12153,10 @@ function normalizeRuntimePublicPath(value) {
|
|
|
11835
12153
|
const collapsed = (withoutQuery.startsWith("/") ? withoutQuery : `/${withoutQuery}`).replace(/\/{2,}/g, "/");
|
|
11836
12154
|
return (collapsed.length > 1 ? collapsed.replace(/\/+$/g, "") : collapsed) || "/";
|
|
11837
12155
|
}
|
|
12156
|
+
/** The site read's variant: `null` is the site-wide read; a path adds that page's runtime support. */
|
|
12157
|
+
function decideSiteReadPath(currentPath) {
|
|
12158
|
+
return toNonEmptyString(currentPath) === null ? null : normalizeRuntimePublicPath(currentPath);
|
|
12159
|
+
}
|
|
11838
12160
|
function normalizeRuntimeHostname(value) {
|
|
11839
12161
|
const trimmed = value.trim().toLowerCase();
|
|
11840
12162
|
return (/^[a-z][a-z0-9+.-]*:\/\//.test(trimmed) ? new URL(trimmed) : new URL(`http://${trimmed}`)).hostname.replace(/\.$/, "");
|
|
@@ -11870,9 +12192,10 @@ function deriveGetSiteKey(params) {
|
|
|
11870
12192
|
]
|
|
11871
12193
|
}
|
|
11872
12194
|
};
|
|
12195
|
+
const path = decideSiteReadPath(params.currentPath);
|
|
11873
12196
|
const normalizedParams = {
|
|
11874
12197
|
...identity,
|
|
11875
|
-
...
|
|
12198
|
+
...path === null ? {} : { currentPath: path }
|
|
11876
12199
|
};
|
|
11877
12200
|
return {
|
|
11878
12201
|
ok: true,
|
|
@@ -12509,32 +12832,77 @@ var CircuitBreaker = class {
|
|
|
12509
12832
|
}
|
|
12510
12833
|
}
|
|
12511
12834
|
};
|
|
12835
|
+
/** The SDK's read deadline when the caller sets none. */
|
|
12836
|
+
const DEFAULT_READ_DEADLINE_MS = 8e3;
|
|
12837
|
+
function createReadTimeoutError(timeoutMs) {
|
|
12838
|
+
return Object.assign(/* @__PURE__ */ new Error(`Request timed out after ${timeoutMs}ms`), { name: "AbortError" });
|
|
12839
|
+
}
|
|
12512
12840
|
/**
|
|
12513
|
-
*
|
|
12841
|
+
* One attempt, ended at the read's deadline even when the fetch ignores its signal.
|
|
12842
|
+
*
|
|
12843
|
+
* The signal alone isn't enough: Next drops it when it refreshes stale fetch data
|
|
12844
|
+
* (as an ISR regeneration does), and the read would then wait as long as the
|
|
12845
|
+
* origin takes. The signal is still aborted so a fetch that honours it stops.
|
|
12846
|
+
*/
|
|
12847
|
+
function raceReadDeadline(fetcher, remainingMs, timeoutError) {
|
|
12848
|
+
const controller = new AbortController();
|
|
12849
|
+
return new Promise((resolve, reject) => {
|
|
12850
|
+
const timeoutId = setTimeout(() => {
|
|
12851
|
+
controller.abort();
|
|
12852
|
+
reject(timeoutError());
|
|
12853
|
+
}, remainingMs);
|
|
12854
|
+
fetcher(controller.signal).then((value) => {
|
|
12855
|
+
clearTimeout(timeoutId);
|
|
12856
|
+
resolve(value);
|
|
12857
|
+
}, (error) => {
|
|
12858
|
+
clearTimeout(timeoutId);
|
|
12859
|
+
reject(error);
|
|
12860
|
+
});
|
|
12861
|
+
});
|
|
12862
|
+
}
|
|
12863
|
+
function decideRetry(input) {
|
|
12864
|
+
if (input.attempt >= input.maxAttempts) return { kind: "give_up" };
|
|
12865
|
+
if (!shouldRetryError(input.error, input.config.retryOn)) return { kind: "give_up" };
|
|
12866
|
+
const delayMs = getRetryDelay(input.error, input.attempt, input.config);
|
|
12867
|
+
return delayMs < input.remainingMs ? {
|
|
12868
|
+
kind: "retry",
|
|
12869
|
+
delayMs
|
|
12870
|
+
} : { kind: "give_up" };
|
|
12871
|
+
}
|
|
12872
|
+
/**
|
|
12873
|
+
* Fetch with one deadline and retry logic
|
|
12874
|
+
*
|
|
12875
|
+
* `requestTimeoutMs` bounds the whole read, so retries share what the first
|
|
12876
|
+
* attempt left rather than each getting a fresh budget. A timeout is never
|
|
12877
|
+
* retried: the deadline has passed.
|
|
12514
12878
|
*
|
|
12515
12879
|
* @param fetcher - Function that performs the fetch, receives AbortSignal for timeout
|
|
12516
12880
|
* @param config - Retry configuration
|
|
12517
12881
|
* @returns Result from successful fetch
|
|
12518
|
-
* @throws
|
|
12882
|
+
* @throws The last attempt's error, or a timeout once the deadline passes
|
|
12519
12883
|
*/
|
|
12520
|
-
|
|
12884
|
+
function fetchWithTimeoutAndRetry(fetcher, config) {
|
|
12521
12885
|
const maxAttempts = config.maxAttempts ?? DEFAULT_RETRY_CONFIG.maxAttempts;
|
|
12522
12886
|
const requestTimeoutMs = config.requestTimeoutMs ?? 8e3;
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
const timeoutId = setTimeout(() => controller.abort(), requestTimeoutMs);
|
|
12887
|
+
const deadline = Date.now() + requestTimeoutMs;
|
|
12888
|
+
const timeoutError = () => createReadTimeoutError(requestTimeoutMs);
|
|
12889
|
+
const attemptFrom = async (attempt) => {
|
|
12527
12890
|
try {
|
|
12528
|
-
return await fetcher(
|
|
12529
|
-
}
|
|
12530
|
-
|
|
12891
|
+
return await raceReadDeadline(fetcher, Math.max(0, deadline - Date.now()), timeoutError);
|
|
12892
|
+
} catch (error) {
|
|
12893
|
+
const decision = decideRetry({
|
|
12894
|
+
error,
|
|
12895
|
+
attempt,
|
|
12896
|
+
maxAttempts,
|
|
12897
|
+
remainingMs: deadline - Date.now(),
|
|
12898
|
+
config
|
|
12899
|
+
});
|
|
12900
|
+
if (decision.kind === "give_up") throw error;
|
|
12901
|
+
await sleep(decision.delayMs);
|
|
12902
|
+
return attemptFrom(attempt + 1);
|
|
12531
12903
|
}
|
|
12532
|
-
}
|
|
12533
|
-
|
|
12534
|
-
if (!shouldRetryError(error, config.retryOn)) throw error;
|
|
12535
|
-
if (attempt < maxAttempts) await sleep(getRetryDelay(error, attempt, config));
|
|
12536
|
-
}
|
|
12537
|
-
throw lastError;
|
|
12904
|
+
};
|
|
12905
|
+
return attemptFrom(1);
|
|
12538
12906
|
}
|
|
12539
12907
|
/**
|
|
12540
12908
|
* Check if an error is an AbortError (from AbortController.abort() or timeout)
|
|
@@ -12637,7 +13005,7 @@ function withDefaultHeaders(apiClient, defaultHeaders) {
|
|
|
12637
13005
|
});
|
|
12638
13006
|
}
|
|
12639
13007
|
const DEFAULT_BROWSER_TIMEOUT_MS = 5e3;
|
|
12640
|
-
const DEFAULT_SERVER_TIMEOUT_MS =
|
|
13008
|
+
const DEFAULT_SERVER_TIMEOUT_MS = DEFAULT_READ_DEADLINE_MS;
|
|
12641
13009
|
const MAX_GET_ENTRIES_BY_IDENTIFIERS_REFS = 50;
|
|
12642
13010
|
function isDurableRuntimeCacheTier(cacheTier) {
|
|
12643
13011
|
return cacheTier === "durable-fresh" || cacheTier === "durable-stale";
|
|
@@ -12662,7 +13030,7 @@ function publishedCacheLifetime(plan, payload) {
|
|
|
12662
13030
|
freshTtlSec: plan.freshTtlSec,
|
|
12663
13031
|
staleTtlSec: plan.staleTtlSec
|
|
12664
13032
|
};
|
|
12665
|
-
const ttl =
|
|
13033
|
+
const ttl = 60;
|
|
12666
13034
|
return {
|
|
12667
13035
|
freshTtlSec: ttl,
|
|
12668
13036
|
staleTtlSec: ttl
|
|
@@ -12674,11 +13042,10 @@ function reusableDurablePayload(plan, payload, freshness) {
|
|
|
12674
13042
|
function memoryWritePolicy(pageRead, data, tags, cacheTTL) {
|
|
12675
13043
|
if (!pageRead) return { tags };
|
|
12676
13044
|
const dependency = pageReadDependencies(data);
|
|
12677
|
-
const policy = buildPageReadCachePolicy(pageRead.siteId, dependency);
|
|
12678
13045
|
return {
|
|
12679
|
-
tags:
|
|
13046
|
+
tags: buildPageReadCachePolicy(pageRead.siteId, dependency).tags,
|
|
12680
13047
|
...dependency === "availability" ? {
|
|
12681
|
-
ttl: Math.min(cacheTTL,
|
|
13048
|
+
ttl: Math.min(cacheTTL, 60 * 1e3),
|
|
12682
13049
|
staleTtl: 0
|
|
12683
13050
|
} : {}
|
|
12684
13051
|
};
|
|
@@ -12998,7 +13365,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12998
13365
|
const result = await reader({
|
|
12999
13366
|
cacheKey: plan.cacheKey,
|
|
13000
13367
|
endpoint: plan.endpoint,
|
|
13001
|
-
payloadSchemaVersion:
|
|
13368
|
+
payloadSchemaVersion: 6
|
|
13002
13369
|
});
|
|
13003
13370
|
if (result.kind === "miss") return {
|
|
13004
13371
|
kind: "miss",
|
|
@@ -13047,7 +13414,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13047
13414
|
payload,
|
|
13048
13415
|
siteId: plan.siteId ?? getRuntimePayloadSiteId(payload),
|
|
13049
13416
|
...publishedCacheLifetime(plan, payload),
|
|
13050
|
-
payloadSchemaVersion:
|
|
13417
|
+
payloadSchemaVersion: 6,
|
|
13051
13418
|
writeReason: "live_success"
|
|
13052
13419
|
});
|
|
13053
13420
|
} catch {}
|
|
@@ -13061,6 +13428,11 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13061
13428
|
error: input.error
|
|
13062
13429
|
})) : null;
|
|
13063
13430
|
}
|
|
13431
|
+
/** Every fallback leaves through here, so the caller's hook sees each one. */
|
|
13432
|
+
async function serveFallback(fallback) {
|
|
13433
|
+
await config.resilience?.beforeFallbackServed?.(fallback.resilience);
|
|
13434
|
+
return fallback;
|
|
13435
|
+
}
|
|
13064
13436
|
async function resilientFetch(cacheKey, fetcher, options) {
|
|
13065
13437
|
const requestId = generateRequestId();
|
|
13066
13438
|
const startTime = Date.now();
|
|
@@ -13080,21 +13452,21 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13080
13452
|
if (resilienceEnabled && circuitBreaker.isOpen()) {
|
|
13081
13453
|
if (allowFallbacks && !isPreview && staleIfError) {
|
|
13082
13454
|
const stale = cache.getStale(cacheKey);
|
|
13083
|
-
if (stale) return emitStatus("stale", stale.value, statusDetails({
|
|
13455
|
+
if (stale) return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
13084
13456
|
staleAgeSec: stale.staleAgeSec,
|
|
13085
13457
|
cacheTier: "memory-stale",
|
|
13086
13458
|
error: {
|
|
13087
13459
|
code: "circuit_open",
|
|
13088
13460
|
message: "Circuit breaker is open"
|
|
13089
13461
|
}
|
|
13090
|
-
}));
|
|
13462
|
+
})));
|
|
13091
13463
|
}
|
|
13092
13464
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, {
|
|
13093
13465
|
code: "circuit_open",
|
|
13094
13466
|
message: "Circuit breaker is open"
|
|
13095
13467
|
}) : null;
|
|
13096
13468
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
13097
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
13469
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
13098
13470
|
const prebuild = tryPrebuildFallback({
|
|
13099
13471
|
allowed: allowFallbacks,
|
|
13100
13472
|
preview: isPreview,
|
|
@@ -13106,7 +13478,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13106
13478
|
message: "Circuit breaker is open"
|
|
13107
13479
|
}
|
|
13108
13480
|
});
|
|
13109
|
-
if (prebuild) return prebuild;
|
|
13481
|
+
if (prebuild) return serveFallback(prebuild);
|
|
13110
13482
|
const circuitState = circuitBreaker.getState();
|
|
13111
13483
|
emitStatus("error", null, statusDetails({
|
|
13112
13484
|
durableCache,
|
|
@@ -13154,17 +13526,17 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13154
13526
|
const stale = cache.getStale(cacheKey);
|
|
13155
13527
|
if (stale) {
|
|
13156
13528
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
13157
|
-
return emitStatus("stale", stale.value, statusDetails({
|
|
13529
|
+
return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
13158
13530
|
staleAgeSec: stale.staleAgeSec,
|
|
13159
13531
|
cacheTier: "memory-stale",
|
|
13160
13532
|
error: errorInfo
|
|
13161
|
-
}));
|
|
13533
|
+
})));
|
|
13162
13534
|
}
|
|
13163
13535
|
}
|
|
13164
13536
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
13165
13537
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, errorInfo) : null;
|
|
13166
13538
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
13167
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
13539
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
13168
13540
|
const prebuild = tryPrebuildFallback({
|
|
13169
13541
|
allowed: allowFallbacks,
|
|
13170
13542
|
preview: isPreview,
|
|
@@ -13173,7 +13545,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13173
13545
|
durableCache,
|
|
13174
13546
|
error: errorInfo
|
|
13175
13547
|
});
|
|
13176
|
-
if (prebuild) return prebuild;
|
|
13548
|
+
if (prebuild) return serveFallback(prebuild);
|
|
13177
13549
|
throw attachResilienceStatusToError(error, emitStatus("error", null, statusDetails({
|
|
13178
13550
|
error: errorInfo,
|
|
13179
13551
|
durableCache
|