@riverbankcms/sdk 0.182.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-Bvw2bUif.d.ts → BlocksIslandsHydrator-X1_G96iN.d.ts} +1 -1
- package/dist/_dts/{Page-B2EAT-bE.d.ts → Page-CEqZJZEE.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D0vww6rh.d.ts → SdkPreviewMode-DQejfbXL.d.ts} +2 -2
- package/dist/_dts/{client-D6T430bk.d.ts → client-B_B_amKD.d.ts} +2 -1
- package/dist/_dts/{content-types-wZVWccC6.d.ts → content-types-Dhx5Ocvx.d.ts} +9 -16
- package/dist/_dts/{contracts-B-vtOcr8.d.ts → contracts-FeOnfoa1.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CxfwHE6z.d.ts → generatePageMetadata-m70J6tit.d.ts} +2 -2
- package/dist/_dts/{index-CEyYMhLJ.d.ts → index-BOpUh8kO.d.ts} +1 -1
- package/dist/_dts/{index-DIU-wL1M.d.ts → index-Bizdaxji.d.ts} +2 -2
- package/dist/_dts/{index-Cqxis-nv.d.ts → index-BxCmCit0.d.ts} +1 -1
- package/dist/_dts/{index-CQrb3Ccc.d.ts → index-CjAkEWAp.d.ts} +4 -4
- package/dist/_dts/{index-DqPKdeTk.d.ts → index-iuFrbIjt.d.ts} +1 -1
- package/dist/_dts/{index-CciRW_w1.d.ts → index-liuhlOX7.d.ts} +2 -2
- package/dist/_dts/{loadContent-D0wrxiSp.d.ts → loadContent-D4wrTIIw.d.ts} +7 -7
- package/dist/_dts/{request-DEwxUSw8.d.ts → request-Gn0O1blj.d.ts} +24912 -23733
- package/dist/_dts/{resolveBlockData-VaG_MYbN.d.ts → resolveBlockData-D5duwuqS.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DTwklC_v.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-DtQuFlID.d.ts → serviceBookingOutline-B1gyJon_.d.ts} +7 -7
- package/dist/_dts/{types-B3RjeBLV.d.ts → types-BoITy0rA.d.ts} +41 -4
- package/dist/_dts/{types-BvUSGQrw.d.ts → types-DBNuMtSk.d.ts} +16 -5
- package/dist/_dts/{types-CkRFtBqd.d.ts → types-DHMcuoeQ.d.ts} +7 -7
- package/dist/_dts/{validation-BZA3DhcV.d.ts → validation-BIPO-XlE.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CQMf0HdN.mjs → BlocksIslandsHydrator-Ct8slgRk.mjs} +22 -18
- package/dist/client/{BookingMailingListNote-7kdvuPow.mjs → BookingMailingListNote-qqTxGGS4.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-BJI7mZuV.mjs → BookingQuestionFields-DCh9MUIF.mjs} +2 -2
- package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-RcdaStG7.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-DPUD6wjy.mjs → CalendarNavigationChevron-D7Wt-Oaa.mjs} +25 -8
- package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-BdGxZWeg.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-8kwNF9HN.mjs → DemoBookingPortalAccess-HFVkoOac.mjs} +5 -5
- package/dist/client/{EventCalendar.client-Dhb14bcC.mjs → EventCalendar.client-BtkJW8bA.mjs} +10 -10
- package/dist/client/{EventCombined.client-C1jEZBN9.mjs → EventCombined.client-DxaGjFFS.mjs} +9 -9
- package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-B2c5dR49.mjs} +1 -1
- package/dist/client/{EventItem-Bb0ppG2N.mjs → EventItem-Fr2qi2C2.mjs} +29 -14
- package/dist/client/{EventListWeekNavigation-DMryCaNV.mjs → EventListWeekNavigation-BRMaq0ky.mjs} +1 -1
- package/dist/client/{EventListing.client-BuH5kKA3.mjs → EventListing.client-BhGxfbjt.mjs} +3 -3
- package/dist/client/{EventListing.view-DsqvuulZ.mjs → EventListing.view-COuEJzbO.mjs} +6 -6
- package/dist/client/{EventRegistrationPayment-D4FvQSFF.mjs → EventRegistrationPayment-BTLYhVxD.mjs} +21 -42
- package/dist/client/{Page-sV6BJkXX.mjs → Page-CgbQZP5g.mjs} +2786 -927
- package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-BG7my0Qf.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-VfSd6JU-.mjs → SiteTermsAgreementField-DQNkfNLA.mjs} +3 -3
- package/dist/client/{StepIndicator-B6o5B7g3.mjs → StepIndicator-DvPekKeM.mjs} +1 -1
- package/dist/client/{StepIndicator-BTqO7cJl.mjs → StepIndicator-DyXoI3ob.mjs} +7 -7
- package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-Bc9DBbVp.mjs} +42 -9
- package/dist/client/{accessibleSurfaces-BogaGutk.mjs → accessibleSurfaces-wj4Rloo5.mjs} +336 -119
- package/dist/client/{accordion-6cuswD_s.mjs → accordion-BVXfjnh-.mjs} +1 -1
- package/dist/client/{booking-form.client-BOMe_SKi.mjs → booking-form.client-DycPGtke.mjs} +191 -71
- package/dist/client/{bookingForm-DSCH-VHo.mjs → bookingForm-DrWSUqL3.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BFuqZCfz.mjs → boxStyleClassNames-CduDRcIk.mjs} +2 -2
- package/dist/client/buttonParts-CJEtVOUy.mjs +1511 -0
- package/dist/client/{carousel-CGyQVV1M.mjs → carousel-DyCLMP8s.mjs} +2 -2
- package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DffP_Nv0.mjs} +1 -1
- package/dist/client/{cart-BYOe7MCh.mjs → cart-BuEp_cj4.mjs} +3 -3
- package/dist/client/{cart.client-BKFkaXdV.mjs → cart.client-CAO39uDG.mjs} +1 -1
- package/dist/client/{checkout-Dwd7Di77.mjs → checkout-BoxzT64s.mjs} +3 -3
- package/dist/client/{checkout.client-C25hpi-z.mjs → checkout.client-IGUy7XOx.mjs} +1 -1
- package/dist/client/{checkoutUrls-tG788sw0.mjs → checkoutUrls-D0UsiFmm.mjs} +1 -1
- package/dist/client/client.mjs +446 -93
- package/dist/client/{constants-DdxFG3Ic.mjs → constants-C_8AxMdm.mjs} +1 -1
- package/dist/client/{context-Hi1RuYEM.mjs → context-D1L0pe__.mjs} +2 -2
- package/dist/client/{dateFormatting-C8vBCHuo.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BAL5UIDG.mjs → demoPortalMagicLink-BunFTnIq.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Dv1Lr9kJ.mjs → enhanceHeaderSection-CtLAG651.mjs} +4 -4
- package/dist/client/{event-registration.client-dB_Z7bb-.mjs → event-registration.client-DiSxkBUP.mjs} +15 -15
- package/dist/client/{eventCalendar-CQnRA4Ww.mjs → eventCalendar-DUnhwZ1o.mjs} +4 -4
- package/dist/client/{eventCombined-BDOG1hVp.mjs → eventCombined-BvBQo0nF.mjs} +4 -4
- package/dist/client/{eventListing-DSVmhy9n.mjs → eventListing-aTLifOX7.mjs} +4 -4
- package/dist/client/{eventRegistration-CD5mRtEH.mjs → eventRegistration-DFd7pr09.mjs} +4 -4
- package/dist/client/{form-DWnlEVSK.mjs → form-Dikmc2AO.mjs} +3 -3
- package/dist/client/{form.client-D7zmeqNI.mjs → form.client-zHaQK5I9.mjs} +5 -5
- package/dist/client/{form.parts-C-G6N_MK.mjs → form.parts-BLl9n8TH.mjs} +3 -3
- package/dist/client/gifting/client.mjs +16 -9
- package/dist/client/{gifting-Cn0jidP5.mjs → gifting-CufPM38H.mjs} +4 -4
- package/dist/client/{gifting.client-DVo1YFLs.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-DjQuj_6v.mjs → headerSection-BIaBpmk3.mjs} +2 -2
- package/dist/client/{noop-jesvJXEE.mjs → islands-DJDLGQEm.mjs} +14007 -6685
- package/dist/client/{newsletter-form.client-rIYPziZC.mjs → newsletter-form.client-wg_JHTxm.mjs} +6 -6
- package/dist/client/{newsletter-form.interactive-DVt3enLr.mjs → newsletter-form.interactive-hzpkW9NQ.mjs} +226 -195
- package/dist/client/{newsletter-form.parts-CH6dGfdn.mjs → newsletter-form.parts-CgzpSv9p.mjs} +2 -2
- package/dist/client/{newsletterForm-Cg8cBDHd.mjs → newsletterForm-CvxLiEBT.mjs} +3 -3
- package/dist/client/portal/client.mjs +31 -27
- package/dist/client/{portalOrders-oEoTvzkW.mjs → portalOrders-tCxS04g0.mjs} +3 -2
- package/dist/client/{portalRoutes-ByyVZfVq.mjs → portalRoutes-DTHlWg_F.mjs} +22 -7
- package/dist/client/{product-detail.client-5aHq-vuu.mjs → product-detail.client-22Q7zgjN.mjs} +1 -1
- package/dist/client/{product-list.client-CyAk5rnC.mjs → product-list.client-DFWYvK8z.mjs} +1 -1
- package/dist/client/{productDetail-B8aZ2mqY.mjs → productDetail-DhZAwo60.mjs} +3 -3
- package/dist/client/{productList-BuLemmod.mjs → productList-BiVpbZK2.mjs} +3 -3
- package/dist/client/{propsDecoder-0Unsqn3R.mjs → propsDecoder-DFYqKnLy.mjs} +4 -2
- package/dist/client/{registry.server-DzvtVVD0.mjs → registry.server-C3OBRg7x.mjs} +2027 -781
- 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-Bnng7JFA.mjs → richText-coerce-ms477Z08.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-BGfcc9sk.mjs → routeIslandApiConfig-B6nQeqvH.mjs} +1 -1
- package/dist/client/{runtimeResponse-DAPVRToN.mjs → runtimeResponse-BYqsV1Kb.mjs} +1 -1
- package/dist/client/runtimeResponse-CUX_lldL.mjs +3 -0
- package/dist/client/{shop-commerce-D5bDY1o1.mjs → shop-commerce-DVsIcPaI.mjs} +16 -15
- package/dist/client/{shop-commerce-store-B7sHnLwI.mjs → shop-commerce-store-7mO6KY7_.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-Dos2zdC2.mjs → shop-discount-apply.state-L1Vge8tG.mjs} +2 -2
- package/dist/client/{shop-GuMqnDL-.mjs → shop-xt4dQ3HH.mjs} +3 -3
- package/dist/client/{shop.client-uvj5GDZb.mjs → shop.client-DNJfD3VQ.mjs} +28 -17
- package/dist/client/{shopShared-3giNWE3H.mjs → shopShared-DS8t6749.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-Dy3nNfTG.mjs} +11 -8
- package/dist/client/{useAvailableSlots-CBneCxbG.mjs → useAvailableSlots-DcjtDpUu.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-D0kGF0C7.mjs → useDiscountCodeUi-DvdFFWOT.mjs} +1 -1
- package/dist/client/{useEventPagination-xX8n_Tuu.mjs → useEventPagination-Cq-7sU5_.mjs} +8 -8
- package/dist/client/{view-DOyZc-DF.mjs → view-4gnPcpWJ.mjs} +24 -9
- package/dist/client/{wizardSteps-B952ify5.mjs → wizardSteps-DDvL3iza.mjs} +76 -159
- 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-BI3UCdpu.mjs → PageSectionToolbar-D8srnz9R.mjs} +445 -18
- package/dist/preview-next/client/{PreviewEditorSidebar-jkfLVOgY.mjs → PreviewEditorSidebar-DVpk5cqp.mjs} +3864 -1943
- package/dist/preview-next/client/{PreviewEditorUI-DwJQs4hM.mjs → PreviewEditorUI-XoTtHSFH.mjs} +11 -36
- package/dist/preview-next/client/{PreviewShell-BAxAkuz8.mjs → PreviewShell-VQHsRg2u.mjs} +40 -35
- package/dist/preview-next/client/{SdkPreviewModeRuntime-0UVB-39f.mjs → SdkPreviewModeRuntime-CLdF9f6o.mjs} +12 -8
- 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-BgiYk3PB.mjs → previewAssistantSlot-CqH91EwA.mjs} +17988 -6757
- package/dist/preview-next/client/{previewChromeRoot-tieNdF3E.mjs → previewChromeRoot-B3ySEu6p.mjs} +3 -90
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DXb_Evl0.mjs → sdk-runtime-CdpSupcr.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BlN0jt2c.mjs → siteStyleAccess-C6eOP6QW.mjs} +35 -6
- package/dist/preview-next/client/{useAutosaveStatus-BUEPA4oL.mjs → useAutosaveStatus-BhPg4e-r.mjs} +49 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BVfr5P--.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-BHTBA48n.mjs → route-contract-Ch0X99vE.mjs} +163 -17
- package/dist/server/{Block.shared-hGoyEdjJ.mjs → Block.shared-B2FmczLO.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BfUCTOwj.mjs → ThemeScopeCore-DtAyv9qA.mjs} +17 -7
- package/dist/server/{accessibleSurfaces-Dskni4Xj.mjs → accessibleSurfaces-BtPqb76u.mjs} +418 -31
- package/dist/server/{accordions-By_0Ykks.mjs → accordions-vzdZ2Wt1.mjs} +1 -1
- package/dist/server/{bindings-DMJH4bvo.mjs → bindings-B_9JuU66.mjs} +7 -7
- package/dist/server/{client-DrwlRNAH.mjs → client-DC7cjiSw.mjs} +469 -92
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-CeMywaiD.mjs → constants-d6nPNJpe.mjs} +22 -6
- package/dist/server/{customCss-C9kgPHvr.mjs → customCss-rtIfEYwQ.mjs} +1 -18
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{expandPalette-ehuW8r2g.mjs → expandPalette-DxPrNOAB.mjs} +182 -90
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-D0prFflT.mjs → loadContent-hb27HYic.mjs} +11 -10
- package/dist/server/{loadPage-CBLke9pJ.mjs → loadPage-JToD8wDD.mjs} +3 -3
- package/dist/server/{lookMediaFrame-H0fi4bJk.mjs → lookMediaFrame-CTsycLLK.mjs} +94 -39
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-wrcuWmgp.mjs → navigation-B2WhGofA.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +8 -8
- package/dist/server/{overrideResolution-DUgCEH8z.mjs → overrideResolution-vD5KTClL.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-BHrmogsW.mjs → pageRenderPlan-CdqJ1NQZ.mjs} +86 -97
- package/dist/server/{pageRuntimeSupport-D2-YMRei.mjs → pageRuntimeSupport-CAhr4oOf.mjs} +3 -3
- package/dist/server/{pageShared-CG8O31Eo.mjs → pageShared-m80Xu2pd.mjs} +429 -247
- package/dist/server/{parseThemeForPersistence-CrPlbJEN.mjs → parseThemeForPersistence-CRwOZfpa.mjs} +3 -3
- package/dist/server/{portal-pG_uhsI2.mjs → portal-B2wCQno_.mjs} +1 -1
- package/dist/server/portal.mjs +2 -2
- package/dist/server/{prebuild-C8Amvzce.mjs → prebuild-BWIkFaXq.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-BxUETRIZ.mjs → prefetchBlockData-D1PHU-K9.mjs} +3 -3
- package/dist/server/{registry-Cc88-23f.mjs → registry-KtsOsAzY.mjs} +20113 -9774
- 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-OG3KOkig.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-BcFuhhD7.mjs → servicePageContent-ChEZDRwU.mjs} +37 -14
- package/dist/server/theme-bridge.mjs +3 -3
- 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-BovmbS8N.mjs → validation-Cvi-1TZZ.mjs} +13 -9
- package/dist/server/{version-hws4hgyX.mjs → version-B-icAIV1.mjs} +1 -1
- package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
- package/dist/styles/index.css +2482 -108
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as parseSurfaceTree } from "./accessibleSurfaces-
|
|
1
|
+
import { n as parseSurfaceTree } from "./accessibleSurfaces-BtPqb76u.mjs";
|
|
2
2
|
import { i as rethrowClientFrameworkSignal, l as isSupportedLoaderEndpoint, o as encodePublicProductCategorySelector, r as findFrameworkSignal, t as materializeEntriesMedia } from "./responseMedia-IfH65QAH.mjs";
|
|
3
3
|
import { f as parseSiteId, t as publicMapLocationParamsSchema } from "./mapLocation-MDDSubTp.mjs";
|
|
4
4
|
import { a as ApiEnvelopeError, c as unwrapResponse, i as ApiRequestError, l as CLIENT_ERROR_REPORT_ENDPOINT_DEFINITIONS, n as attachResilienceStatusToError, o as extractApiEnvelopeErrorDetails, s as isApiError, t as RiverbankApiError, u as defineEndpointDefinitions } from "./error-f4g44bKx.mjs";
|
|
5
|
-
import { t as SDK_VERSION } from "./version-
|
|
5
|
+
import { t as SDK_VERSION } from "./version-B-icAIV1.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
/**
|
|
8
8
|
* How long a rendered page may hold availability it read through the batch
|
|
@@ -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,44 @@ 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
|
+
},
|
|
3407
3543
|
changeGiftExpiry: {
|
|
3408
3544
|
path: "/sites/{siteId}/gifting/gifts/{giftId}/expiry",
|
|
3409
3545
|
method: "POST",
|
|
@@ -5921,6 +6057,22 @@ const API_ENDPOINTS$1 = {
|
|
|
5921
6057
|
auth: "user",
|
|
5922
6058
|
responseKind: "json"
|
|
5923
6059
|
},
|
|
6060
|
+
getRegisteredDomainContact: {
|
|
6061
|
+
errors: [
|
|
6062
|
+
"resource:not_found",
|
|
6063
|
+
"auth:forbidden",
|
|
6064
|
+
"validation:invalid_input"
|
|
6065
|
+
],
|
|
6066
|
+
path: "/domains/{domainId}/registrar/contact",
|
|
6067
|
+
method: "GET",
|
|
6068
|
+
auth: "user",
|
|
6069
|
+
tags: [
|
|
6070
|
+
"domains",
|
|
6071
|
+
"domain-{domainId}",
|
|
6072
|
+
"domain-registrar"
|
|
6073
|
+
],
|
|
6074
|
+
responseKind: "json"
|
|
6075
|
+
},
|
|
5924
6076
|
updateRegisteredDomainContact: {
|
|
5925
6077
|
path: "/domains/{domainId}/registrar/contact",
|
|
5926
6078
|
method: "POST",
|
|
@@ -6005,6 +6157,18 @@ const API_ENDPOINTS$1 = {
|
|
|
6005
6157
|
auth: "user",
|
|
6006
6158
|
responseKind: "json"
|
|
6007
6159
|
},
|
|
6160
|
+
retryDomainEmailSending: {
|
|
6161
|
+
errors: [],
|
|
6162
|
+
path: "/sites/{siteId}/domains/{domainId}/email/retry",
|
|
6163
|
+
method: "POST",
|
|
6164
|
+
tags: [
|
|
6165
|
+
"domains",
|
|
6166
|
+
"domain-{domainId}",
|
|
6167
|
+
"domain-dns"
|
|
6168
|
+
],
|
|
6169
|
+
auth: "user",
|
|
6170
|
+
responseKind: "json"
|
|
6171
|
+
},
|
|
6008
6172
|
retryDomainResend: {
|
|
6009
6173
|
path: "/domains/{domainId}/resend",
|
|
6010
6174
|
method: "POST",
|
|
@@ -10220,6 +10384,9 @@ function resolveApiBaseUrl() {
|
|
|
10220
10384
|
}
|
|
10221
10385
|
//#endregion
|
|
10222
10386
|
//#region ../api/src/pageReadResponseCache.ts
|
|
10387
|
+
function pageReadPolicy(siteId, policy) {
|
|
10388
|
+
return policy === "retry" ? buildPageReadRetryPolicy(siteId) : buildPageReadCachePolicy(siteId, policy);
|
|
10389
|
+
}
|
|
10223
10390
|
function isRecord(value) {
|
|
10224
10391
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10225
10392
|
}
|
|
@@ -10230,8 +10397,20 @@ function isResolvedPage(page) {
|
|
|
10230
10397
|
"system_service"
|
|
10231
10398
|
].includes(String(page.result.kind));
|
|
10232
10399
|
}
|
|
10400
|
+
/**
|
|
10401
|
+
* The key `serializeSurfaceTree` (theme-core) wraps a response in when it carries surface revisions. This package
|
|
10402
|
+
* can't depend on theme-core, so the SDK's tests check the two stay equal.
|
|
10403
|
+
*/
|
|
10404
|
+
const SURFACE_TRANSPORT_ENVELOPE_KEY = "$surfaceTransport";
|
|
10405
|
+
/** A revision-transport body keeps the page's own fields under the envelope's `value`. */
|
|
10406
|
+
function withoutSurfaceTransport(data) {
|
|
10407
|
+
const envelope = data[SURFACE_TRANSPORT_ENVELOPE_KEY];
|
|
10408
|
+
if (envelope === void 0) return data;
|
|
10409
|
+
return isRecord(envelope) && Array.isArray(envelope.revisions) && envelope.revisions.length > 0 && isRecord(envelope.value) ? envelope.value : null;
|
|
10410
|
+
}
|
|
10233
10411
|
function envelopePage(body) {
|
|
10234
|
-
const
|
|
10412
|
+
const raw = isRecord(body) && body.success === true && isRecord(body.data) ? body.data : null;
|
|
10413
|
+
const data = raw ? withoutSurfaceTransport(raw) : null;
|
|
10235
10414
|
return data?.type === "content" && isRecord(data.content) ? data.content : data;
|
|
10236
10415
|
}
|
|
10237
10416
|
function parseBody(body) {
|
|
@@ -10248,40 +10427,44 @@ function admit(snapshot) {
|
|
|
10248
10427
|
if (snapshot.status === 200 && isResolvedPage(page)) {
|
|
10249
10428
|
if (header(snapshot, "x-riverbank-page-storage") === "no-store") return {
|
|
10250
10429
|
kind: "pass-through",
|
|
10251
|
-
|
|
10430
|
+
policy: "retry"
|
|
10252
10431
|
};
|
|
10253
10432
|
return {
|
|
10254
10433
|
kind: "store",
|
|
10255
|
-
|
|
10434
|
+
policy: page.dependencies
|
|
10256
10435
|
};
|
|
10257
10436
|
}
|
|
10437
|
+
if (snapshot.status === 200) return {
|
|
10438
|
+
kind: "pass-through",
|
|
10439
|
+
policy: "retry"
|
|
10440
|
+
};
|
|
10258
10441
|
return {
|
|
10259
10442
|
kind: "pass-through",
|
|
10260
|
-
|
|
10443
|
+
policy: header(snapshot, "x-riverbank-page-dependencies") === "availability" ? "availability" : "content"
|
|
10261
10444
|
};
|
|
10262
10445
|
}
|
|
10263
10446
|
/**
|
|
10264
10447
|
* One cache entry per request, judged by the policy it is looked up with. Content is looked up first, so a
|
|
10265
10448
|
* plain page costs one lookup and never registers the availability policy. A page whose snapshot depends on
|
|
10266
|
-
* availability is looked up again under that policy, which checks its tags and
|
|
10449
|
+
* availability (or must be retried soon) is looked up again under that policy, which checks its tags and budget. A snapshot
|
|
10267
10450
|
* past its own budget is never served: the live read replaces it.
|
|
10268
10451
|
*/
|
|
10269
10452
|
function planPageRead(state, now, budgetSeconds) {
|
|
10270
10453
|
const subject = state.live ?? state.cached;
|
|
10271
10454
|
if (!subject) return {
|
|
10272
10455
|
kind: "lookup",
|
|
10273
|
-
|
|
10456
|
+
policy: "content"
|
|
10274
10457
|
};
|
|
10275
|
-
const {
|
|
10276
|
-
if (!state.lookedUp.includes(
|
|
10458
|
+
const { policy } = admit(subject);
|
|
10459
|
+
if (!state.lookedUp.includes(policy)) return {
|
|
10277
10460
|
kind: "lookup",
|
|
10278
|
-
|
|
10461
|
+
policy
|
|
10279
10462
|
};
|
|
10280
10463
|
if (state.live) return {
|
|
10281
10464
|
kind: "serve",
|
|
10282
10465
|
snapshot: state.live
|
|
10283
10466
|
};
|
|
10284
|
-
return now - subject.cachedAt < budgetSeconds(
|
|
10467
|
+
return now - subject.cachedAt < budgetSeconds(policy) * 1e3 ? {
|
|
10285
10468
|
kind: "serve",
|
|
10286
10469
|
snapshot: subject
|
|
10287
10470
|
} : { kind: "read-live" };
|
|
@@ -10292,12 +10475,21 @@ function planPageRead(state, now, budgetSeconds) {
|
|
|
10292
10475
|
*/
|
|
10293
10476
|
var PassThroughResponse = class extends Error {
|
|
10294
10477
|
constructor(snapshot) {
|
|
10295
|
-
super("
|
|
10478
|
+
super("Read must not be stored");
|
|
10296
10479
|
this.snapshot = snapshot;
|
|
10297
10480
|
}
|
|
10298
10481
|
};
|
|
10299
|
-
|
|
10300
|
-
|
|
10482
|
+
/**
|
|
10483
|
+
* Names this cache's entries. Next keys an entry by these parts plus the callback's source text, and neither
|
|
10484
|
+
* changes when the response contract does, so a contract change bumps this name: otherwise a deploy keeps
|
|
10485
|
+
* serving responses the previous release cached, in the old shape, for up to their whole budget.
|
|
10486
|
+
*
|
|
10487
|
+
* - v4: a resolved page carries its own mailing-list support (`mailingList`); the hosted frontend no longer
|
|
10488
|
+
* asks the site read for it, so a v3 response would leave the page's newsletter forms without their lists.
|
|
10489
|
+
*/
|
|
10490
|
+
const PAGE_READ_RESPONSE_CACHE_NAME = "page-read-envelope-v4";
|
|
10491
|
+
async function lookup(input, policy) {
|
|
10492
|
+
const { tags } = pageReadPolicy(input.siteId, policy);
|
|
10301
10493
|
const load = async () => {
|
|
10302
10494
|
const snapshot = await input.live();
|
|
10303
10495
|
if (admit(snapshot).kind === "pass-through") throw new PassThroughResponse(snapshot);
|
|
@@ -10305,8 +10497,8 @@ async function lookup(input, dependencies) {
|
|
|
10305
10497
|
};
|
|
10306
10498
|
try {
|
|
10307
10499
|
return {
|
|
10308
|
-
cached: await input.cache(load, [
|
|
10309
|
-
revalidate: input.budgetSeconds(
|
|
10500
|
+
cached: await input.cache(load, [PAGE_READ_RESPONSE_CACHE_NAME, input.key], {
|
|
10501
|
+
revalidate: input.budgetSeconds(policy),
|
|
10310
10502
|
tags
|
|
10311
10503
|
})(),
|
|
10312
10504
|
live: null
|
|
@@ -10328,9 +10520,9 @@ async function runPlan(input, state) {
|
|
|
10328
10520
|
live: await input.live()
|
|
10329
10521
|
});
|
|
10330
10522
|
case "lookup": {
|
|
10331
|
-
const found = await lookup(input, step.
|
|
10523
|
+
const found = await lookup(input, step.policy);
|
|
10332
10524
|
return runPlan(input, {
|
|
10333
|
-
lookedUp: [...state.lookedUp, step.
|
|
10525
|
+
lookedUp: [...state.lookedUp, step.policy],
|
|
10334
10526
|
cached: found.cached ?? state.cached,
|
|
10335
10527
|
live: state.live ?? found.live
|
|
10336
10528
|
});
|
|
@@ -10362,9 +10554,9 @@ async function frameworkCacheKey(request) {
|
|
|
10362
10554
|
async function cachePageReadResponse(input) {
|
|
10363
10555
|
if (!input.cache || input.maxAge !== void 0 && input.maxAge <= 0) return input.read();
|
|
10364
10556
|
const maxAge = input.maxAge;
|
|
10365
|
-
const budgetSeconds = (
|
|
10366
|
-
const
|
|
10367
|
-
return maxAge === void 0 ?
|
|
10557
|
+
const budgetSeconds = (policy) => {
|
|
10558
|
+
const revalidate = pageReadPolicy(input.siteId, policy).revalidate;
|
|
10559
|
+
return maxAge === void 0 ? revalidate : Math.min(revalidate, maxAge);
|
|
10368
10560
|
};
|
|
10369
10561
|
const key = await frameworkCacheKey(input.key);
|
|
10370
10562
|
const result = await runPlan({
|
|
@@ -10383,15 +10575,53 @@ async function cachePageReadResponse(input) {
|
|
|
10383
10575
|
headers: result.headers
|
|
10384
10576
|
});
|
|
10385
10577
|
}
|
|
10578
|
+
/**
|
|
10579
|
+
* Names the site read's entries, for the same reason as `PAGE_READ_RESPONSE_CACHE_NAME`. A site read only
|
|
10580
|
+
* enters this cache when the host can answer it from its durable copy; otherwise it stays in Next's fetch cache.
|
|
10581
|
+
*/
|
|
10582
|
+
const SITE_READ_RESPONSE_CACHE_NAME = "site-read-envelope-v1";
|
|
10583
|
+
/**
|
|
10584
|
+
* A site read through the framework cache, with the fetch cache's lifetime and tags, so its fill can come from
|
|
10585
|
+
* the host's durable copy. As in Next's fetch cache, only a 200 is kept: an incomplete site (207) or a failure
|
|
10586
|
+
* passes through and the next read asks again.
|
|
10587
|
+
*/
|
|
10588
|
+
async function cacheSiteReadResponse(input) {
|
|
10589
|
+
const live = sharedRead(input.read);
|
|
10590
|
+
const load = async () => {
|
|
10591
|
+
const snapshot = await live();
|
|
10592
|
+
if (snapshot.status !== 200) throw new PassThroughResponse(snapshot);
|
|
10593
|
+
return snapshot;
|
|
10594
|
+
};
|
|
10595
|
+
const key = await frameworkCacheKey(input.key);
|
|
10596
|
+
const found = await input.cache(load, [SITE_READ_RESPONSE_CACHE_NAME, key], {
|
|
10597
|
+
revalidate: input.policy.revalidate,
|
|
10598
|
+
tags: input.policy.tags
|
|
10599
|
+
})().catch((error) => {
|
|
10600
|
+
if (error instanceof PassThroughResponse) return error.snapshot;
|
|
10601
|
+
throw error;
|
|
10602
|
+
});
|
|
10603
|
+
const snapshot = Date.now() - found.cachedAt < input.policy.revalidate * 1e3 ? found : await live();
|
|
10604
|
+
return new Response(snapshot.body, {
|
|
10605
|
+
status: snapshot.status,
|
|
10606
|
+
headers: snapshot.headers
|
|
10607
|
+
});
|
|
10608
|
+
}
|
|
10386
10609
|
/** Result adapters use this when the SDK served a page without the HTTP transport (memory, durable or prebuild fallback). */
|
|
10387
10610
|
async function observePageReadPolicy(cache, siteId, payload) {
|
|
10388
10611
|
if (!cache) return;
|
|
10389
|
-
const
|
|
10612
|
+
const policy = observedPageReadPolicy(pageReadDependencies(payload));
|
|
10390
10613
|
await cache(async () => true, [
|
|
10391
|
-
"page-read-policy-
|
|
10614
|
+
"page-read-policy-v3",
|
|
10392
10615
|
siteId,
|
|
10393
|
-
|
|
10394
|
-
],
|
|
10616
|
+
policy
|
|
10617
|
+
], pageReadPolicy(siteId, policy))();
|
|
10618
|
+
}
|
|
10619
|
+
/**
|
|
10620
|
+
* A page served without the tagged transport (memory, durable or prebuild) may predate a write's purge, so an
|
|
10621
|
+
* availability page only earns the retry window, not the rendered-availability backstop a purge would end.
|
|
10622
|
+
*/
|
|
10623
|
+
function observedPageReadPolicy(dependency) {
|
|
10624
|
+
return dependency === "availability" ? "retry" : "content";
|
|
10395
10625
|
}
|
|
10396
10626
|
//#endregion
|
|
10397
10627
|
//#region ../api/src/common/operationId.ts
|
|
@@ -10690,19 +10920,88 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
|
|
|
10690
10920
|
function isPublishedPageRead(endpoint, params, options) {
|
|
10691
10921
|
return (endpoint === "getContentByPath" || endpoint === "resolveRouteOutcome") && params?.preview !== true && params?.preview !== "true" && options.cache !== "no-store";
|
|
10692
10922
|
}
|
|
10923
|
+
/** The dashboard's reading of a boolean query flag, so a host never treats `force=1` as unforced. */
|
|
10924
|
+
const isTruthyRequestParam = (value) => value === true || value === "true" || value === 1 || value === "1";
|
|
10925
|
+
/** Forced reads skip every cache, and an id-only lookup is a different response the durable cache never holds. */
|
|
10926
|
+
function isFullSiteRead(params) {
|
|
10927
|
+
return !isTruthyRequestParam(params.force) && (params.scope === void 0 || params.scope === "full");
|
|
10928
|
+
}
|
|
10929
|
+
/** A published, full site read with a lifetime: the host's durable copy may answer it, under the fetch's policy. */
|
|
10930
|
+
function publishedSiteReadPolicy(endpoint, params, plan) {
|
|
10931
|
+
const next = plan.init.cache === "no-store" ? void 0 : plan.init.next;
|
|
10932
|
+
const revalidate = typeof next?.revalidate === "number" && next.revalidate > 0 ? next.revalidate : null;
|
|
10933
|
+
return endpoint === "getSite" && revalidate !== null && isFullSiteRead(params) ? {
|
|
10934
|
+
revalidate,
|
|
10935
|
+
tags: next?.tags ?? []
|
|
10936
|
+
} : null;
|
|
10937
|
+
}
|
|
10938
|
+
/** The dashboard's success envelope around a durable copy, so admission and parsing treat it like a live response. */
|
|
10939
|
+
function freshPublishedResponse(data) {
|
|
10940
|
+
return new Response(JSON.stringify(buildSuccessEnvelope(data, void 0)), {
|
|
10941
|
+
status: 200,
|
|
10942
|
+
headers: {
|
|
10943
|
+
"content-type": "application/json",
|
|
10944
|
+
"x-riverbank-cache": "frontend-hit"
|
|
10945
|
+
}
|
|
10946
|
+
});
|
|
10947
|
+
}
|
|
10948
|
+
/** The cache fill's read: the host's fresh durable copy when it has one, otherwise the dashboard. */
|
|
10949
|
+
function freshPublishedFirst(read, request, live) {
|
|
10950
|
+
if (!read) return live;
|
|
10951
|
+
return async () => {
|
|
10952
|
+
const found = await read(request).catch(() => null);
|
|
10953
|
+
return found ? freshPublishedResponse(found.data) : live();
|
|
10954
|
+
};
|
|
10955
|
+
}
|
|
10956
|
+
function publishedPageResponse(read) {
|
|
10957
|
+
const revalidate = read.plan.init.next?.revalidate;
|
|
10958
|
+
return cachePageReadResponse({
|
|
10959
|
+
cache: read.frameworkCache?.cache ?? null,
|
|
10960
|
+
key: read.key,
|
|
10961
|
+
siteId: typeof read.params.siteId === "string" ? read.params.siteId : "",
|
|
10962
|
+
maxAge: typeof revalidate === "number" ? revalidate : void 0,
|
|
10963
|
+
read: read.endpoint === "getContentByPath" ? freshPublishedFirst(read.frameworkCache?.readFreshPublished, {
|
|
10964
|
+
endpoint: "getContentByPath",
|
|
10965
|
+
params: read.params
|
|
10966
|
+
}, read.uncachedFetch) : read.uncachedFetch
|
|
10967
|
+
});
|
|
10968
|
+
}
|
|
10969
|
+
/** Without a durable reader, a site read stays in Next's fetch cache exactly as before. */
|
|
10970
|
+
function siteOrFetchResponse(read) {
|
|
10971
|
+
const durable = read.frameworkCache?.readFreshPublished;
|
|
10972
|
+
const policy = durable ? publishedSiteReadPolicy(read.endpoint, read.params, read.plan) : null;
|
|
10973
|
+
return read.frameworkCache && policy ? cacheSiteReadResponse({
|
|
10974
|
+
cache: read.frameworkCache.cache,
|
|
10975
|
+
key: read.key,
|
|
10976
|
+
policy,
|
|
10977
|
+
read: freshPublishedFirst(durable, {
|
|
10978
|
+
endpoint: "getSite",
|
|
10979
|
+
params: read.params
|
|
10980
|
+
}, read.uncachedFetch)
|
|
10981
|
+
}) : observedFetch(read.plan, read.endpoint, read.frameworkCache);
|
|
10982
|
+
}
|
|
10693
10983
|
function executeApiRequest(plan, endpoint, params, options, frameworkCache) {
|
|
10694
|
-
const
|
|
10695
|
-
const
|
|
10696
|
-
|
|
10697
|
-
|
|
10984
|
+
const { next: _fetchPolicy, ...uncachedInit } = plan.init;
|
|
10985
|
+
const read = {
|
|
10986
|
+
plan,
|
|
10987
|
+
endpoint,
|
|
10988
|
+
params: params ?? {},
|
|
10989
|
+
frameworkCache,
|
|
10698
10990
|
key: JSON.stringify([plan.url, [...new Headers(plan.init.headers).entries()]]),
|
|
10699
|
-
|
|
10700
|
-
maxAge: typeof fetchPolicy?.revalidate === "number" ? fetchPolicy.revalidate : void 0,
|
|
10701
|
-
read: () => fetch(plan.url, {
|
|
10991
|
+
uncachedFetch: () => fetch(plan.url, {
|
|
10702
10992
|
...uncachedInit,
|
|
10703
10993
|
cache: "no-store"
|
|
10704
10994
|
})
|
|
10705
|
-
}
|
|
10995
|
+
};
|
|
10996
|
+
return isPublishedPageRead(endpoint, params, options) ? publishedPageResponse(read) : siteOrFetchResponse(read);
|
|
10997
|
+
}
|
|
10998
|
+
function observedFetch(plan, endpoint, frameworkCache) {
|
|
10999
|
+
const revalidate = plan.init.next?.revalidate;
|
|
11000
|
+
if (typeof revalidate === "number" && plan.init.cache !== "no-store") frameworkCache?.observeFetchLifetime?.({
|
|
11001
|
+
endpoint: String(endpoint),
|
|
11002
|
+
revalidate
|
|
11003
|
+
});
|
|
11004
|
+
return fetch(plan.url, plan.init);
|
|
10706
11005
|
}
|
|
10707
11006
|
const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
|
|
10708
11007
|
endpoint: z.string(),
|
|
@@ -11060,32 +11359,77 @@ var CircuitBreaker = class {
|
|
|
11060
11359
|
}
|
|
11061
11360
|
}
|
|
11062
11361
|
};
|
|
11362
|
+
/** The SDK's read deadline when the caller sets none. */
|
|
11363
|
+
const DEFAULT_READ_DEADLINE_MS = 8e3;
|
|
11364
|
+
function createReadTimeoutError(timeoutMs) {
|
|
11365
|
+
return Object.assign(/* @__PURE__ */ new Error(`Request timed out after ${timeoutMs}ms`), { name: "AbortError" });
|
|
11366
|
+
}
|
|
11063
11367
|
/**
|
|
11064
|
-
*
|
|
11368
|
+
* One attempt, ended at the read's deadline even when the fetch ignores its signal.
|
|
11369
|
+
*
|
|
11370
|
+
* The signal alone isn't enough: Next drops it when it refreshes stale fetch data
|
|
11371
|
+
* (as an ISR regeneration does), and the read would then wait as long as the
|
|
11372
|
+
* origin takes. The signal is still aborted so a fetch that honours it stops.
|
|
11373
|
+
*/
|
|
11374
|
+
function raceReadDeadline(fetcher, remainingMs, timeoutError) {
|
|
11375
|
+
const controller = new AbortController();
|
|
11376
|
+
return new Promise((resolve, reject) => {
|
|
11377
|
+
const timeoutId = setTimeout(() => {
|
|
11378
|
+
controller.abort();
|
|
11379
|
+
reject(timeoutError());
|
|
11380
|
+
}, remainingMs);
|
|
11381
|
+
fetcher(controller.signal).then((value) => {
|
|
11382
|
+
clearTimeout(timeoutId);
|
|
11383
|
+
resolve(value);
|
|
11384
|
+
}, (error) => {
|
|
11385
|
+
clearTimeout(timeoutId);
|
|
11386
|
+
reject(error);
|
|
11387
|
+
});
|
|
11388
|
+
});
|
|
11389
|
+
}
|
|
11390
|
+
function decideRetry(input) {
|
|
11391
|
+
if (input.attempt >= input.maxAttempts) return { kind: "give_up" };
|
|
11392
|
+
if (!shouldRetryError(input.error, input.config.retryOn)) return { kind: "give_up" };
|
|
11393
|
+
const delayMs = getRetryDelay(input.error, input.attempt, input.config);
|
|
11394
|
+
return delayMs < input.remainingMs ? {
|
|
11395
|
+
kind: "retry",
|
|
11396
|
+
delayMs
|
|
11397
|
+
} : { kind: "give_up" };
|
|
11398
|
+
}
|
|
11399
|
+
/**
|
|
11400
|
+
* Fetch with one deadline and retry logic
|
|
11401
|
+
*
|
|
11402
|
+
* `requestTimeoutMs` bounds the whole read, so retries share what the first
|
|
11403
|
+
* attempt left rather than each getting a fresh budget. A timeout is never
|
|
11404
|
+
* retried: the deadline has passed.
|
|
11065
11405
|
*
|
|
11066
11406
|
* @param fetcher - Function that performs the fetch, receives AbortSignal for timeout
|
|
11067
11407
|
* @param config - Retry configuration
|
|
11068
11408
|
* @returns Result from successful fetch
|
|
11069
|
-
* @throws
|
|
11409
|
+
* @throws The last attempt's error, or a timeout once the deadline passes
|
|
11070
11410
|
*/
|
|
11071
|
-
|
|
11411
|
+
function fetchWithTimeoutAndRetry(fetcher, config) {
|
|
11072
11412
|
const maxAttempts = config.maxAttempts ?? DEFAULT_RETRY_CONFIG.maxAttempts;
|
|
11073
11413
|
const requestTimeoutMs = config.requestTimeoutMs ?? 8e3;
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
const timeoutId = setTimeout(() => controller.abort(), requestTimeoutMs);
|
|
11414
|
+
const deadline = Date.now() + requestTimeoutMs;
|
|
11415
|
+
const timeoutError = () => createReadTimeoutError(requestTimeoutMs);
|
|
11416
|
+
const attemptFrom = async (attempt) => {
|
|
11078
11417
|
try {
|
|
11079
|
-
return await fetcher(
|
|
11080
|
-
}
|
|
11081
|
-
|
|
11418
|
+
return await raceReadDeadline(fetcher, Math.max(0, deadline - Date.now()), timeoutError);
|
|
11419
|
+
} catch (error) {
|
|
11420
|
+
const decision = decideRetry({
|
|
11421
|
+
error,
|
|
11422
|
+
attempt,
|
|
11423
|
+
maxAttempts,
|
|
11424
|
+
remainingMs: deadline - Date.now(),
|
|
11425
|
+
config
|
|
11426
|
+
});
|
|
11427
|
+
if (decision.kind === "give_up") throw error;
|
|
11428
|
+
await sleep(decision.delayMs);
|
|
11429
|
+
return attemptFrom(attempt + 1);
|
|
11082
11430
|
}
|
|
11083
|
-
}
|
|
11084
|
-
|
|
11085
|
-
if (!shouldRetryError(error, config.retryOn)) throw error;
|
|
11086
|
-
if (attempt < maxAttempts) await sleep(getRetryDelay(error, attempt, config));
|
|
11087
|
-
}
|
|
11088
|
-
throw lastError;
|
|
11431
|
+
};
|
|
11432
|
+
return attemptFrom(1);
|
|
11089
11433
|
}
|
|
11090
11434
|
/**
|
|
11091
11435
|
* Check if an error is an AbortError (from AbortController.abort() or timeout)
|
|
@@ -11494,13 +11838,14 @@ function publicSiteReadDefinition(definition) {
|
|
|
11494
11838
|
* entries written in the old shape until publish or a live success rewrites
|
|
11495
11839
|
* them.
|
|
11496
11840
|
*
|
|
11841
|
+
* - 6: resolved page reads carry their own mailing-list projection (`mailingList`).
|
|
11497
11842
|
* - 5: page reads carry the admitted destination envelope and availability dependencies.
|
|
11498
11843
|
* - 4: owned surface inputs use the shared revision transport envelope (#1627).
|
|
11499
11844
|
* - 3: hidden business-source maps and private locations are removed before public projection (#1611).
|
|
11500
11845
|
* - 2: pages carry intent-only `runtimeJoins` in place of compiled
|
|
11501
11846
|
* `runtimeBoundaries` (issue 1422).
|
|
11502
11847
|
*/
|
|
11503
|
-
const DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION =
|
|
11848
|
+
const DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION = 6;
|
|
11504
11849
|
function toNonEmptyString(value) {
|
|
11505
11850
|
if (value === null || value === void 0) return null;
|
|
11506
11851
|
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") return null;
|
|
@@ -11512,6 +11857,24 @@ function normalizeRuntimePublicPath(value) {
|
|
|
11512
11857
|
const collapsed = (withoutQuery.startsWith("/") ? withoutQuery : `/${withoutQuery}`).replace(/\/{2,}/g, "/");
|
|
11513
11858
|
return (collapsed.length > 1 ? collapsed.replace(/\/+$/g, "") : collapsed) || "/";
|
|
11514
11859
|
}
|
|
11860
|
+
/** The site read's variant: `null` is the site-wide read; a path adds that page's runtime support. */
|
|
11861
|
+
function decideSiteReadPath(currentPath) {
|
|
11862
|
+
return toNonEmptyString(currentPath) === null ? null : normalizeRuntimePublicPath(currentPath);
|
|
11863
|
+
}
|
|
11864
|
+
const SITE_TERMS_READ_PATH = "/terms";
|
|
11865
|
+
/** Only the terms page reads the site's terms history. */
|
|
11866
|
+
function siteReadIncludesTermsHistory(path) {
|
|
11867
|
+
return path === SITE_TERMS_READ_PATH;
|
|
11868
|
+
}
|
|
11869
|
+
/**
|
|
11870
|
+
* The path to send on a site read when page content takes its mailing-list support from the page
|
|
11871
|
+
* read (the hosted frontend): none, except the terms page, which needs terms history. Callers that
|
|
11872
|
+
* send every path (deployed SDK sites) keep a site read per page with that page's support.
|
|
11873
|
+
*/
|
|
11874
|
+
function siteWideReadPath(currentPath) {
|
|
11875
|
+
const path = decideSiteReadPath(currentPath);
|
|
11876
|
+
return siteReadIncludesTermsHistory(path) ? path : null;
|
|
11877
|
+
}
|
|
11515
11878
|
function normalizeRuntimeHostname(value) {
|
|
11516
11879
|
const trimmed = value.trim().toLowerCase();
|
|
11517
11880
|
return (/^[a-z][a-z0-9+.-]*:\/\//.test(trimmed) ? new URL(trimmed) : new URL(`http://${trimmed}`)).hostname.replace(/\.$/, "");
|
|
@@ -11547,9 +11910,10 @@ function deriveGetSiteKey(params) {
|
|
|
11547
11910
|
]
|
|
11548
11911
|
}
|
|
11549
11912
|
};
|
|
11913
|
+
const path = decideSiteReadPath(params.currentPath);
|
|
11550
11914
|
const normalizedParams = {
|
|
11551
11915
|
...identity,
|
|
11552
|
-
...
|
|
11916
|
+
...path === null ? {} : { currentPath: path }
|
|
11553
11917
|
};
|
|
11554
11918
|
return {
|
|
11555
11919
|
ok: true,
|
|
@@ -11586,6 +11950,15 @@ function deriveDurableRuntimeCacheKey(input) {
|
|
|
11586
11950
|
case "getContentByPath": return deriveGetContentByPathKey(input.params);
|
|
11587
11951
|
}
|
|
11588
11952
|
}
|
|
11953
|
+
/**
|
|
11954
|
+
* Keys normalise a path, but builds read the path as sent: `/about/` is a 404 and `/terms/` skips
|
|
11955
|
+
* terms history. A variant must neither fill the canonical row nor be answered from it, so the
|
|
11956
|
+
* dashboard's writer and every reader (dashboard and hosted frontend) ask this first.
|
|
11957
|
+
*/
|
|
11958
|
+
function readsCanonicalPath(input) {
|
|
11959
|
+
const path = input.endpoint === "getSite" ? input.params.currentPath : input.params.path;
|
|
11960
|
+
return !path || normalizeRuntimePublicPath(path) === path;
|
|
11961
|
+
}
|
|
11589
11962
|
function isPublishedRuntimeCacheKeyEndpoint(value) {
|
|
11590
11963
|
return value === "getSite" || value === "getContentByPath";
|
|
11591
11964
|
}
|
|
@@ -12146,7 +12519,7 @@ function withDefaultHeaders(apiClient, defaultHeaders) {
|
|
|
12146
12519
|
});
|
|
12147
12520
|
}
|
|
12148
12521
|
const DEFAULT_BROWSER_TIMEOUT_MS = 5e3;
|
|
12149
|
-
const DEFAULT_SERVER_TIMEOUT_MS =
|
|
12522
|
+
const DEFAULT_SERVER_TIMEOUT_MS = DEFAULT_READ_DEADLINE_MS;
|
|
12150
12523
|
const MAX_GET_ENTRIES_BY_IDENTIFIERS_REFS = 50;
|
|
12151
12524
|
function isDurableRuntimeCacheTier(cacheTier) {
|
|
12152
12525
|
return cacheTier === "durable-fresh" || cacheTier === "durable-stale";
|
|
@@ -12171,7 +12544,7 @@ function publishedCacheLifetime(plan, payload) {
|
|
|
12171
12544
|
freshTtlSec: plan.freshTtlSec,
|
|
12172
12545
|
staleTtlSec: plan.staleTtlSec
|
|
12173
12546
|
};
|
|
12174
|
-
const ttl =
|
|
12547
|
+
const ttl = 60;
|
|
12175
12548
|
return {
|
|
12176
12549
|
freshTtlSec: ttl,
|
|
12177
12550
|
staleTtlSec: ttl
|
|
@@ -12183,11 +12556,10 @@ function reusableDurablePayload(plan, payload, freshness) {
|
|
|
12183
12556
|
function memoryWritePolicy(pageRead, data, tags, cacheTTL) {
|
|
12184
12557
|
if (!pageRead) return { tags };
|
|
12185
12558
|
const dependency = pageReadDependencies(data);
|
|
12186
|
-
const policy = buildPageReadCachePolicy(pageRead.siteId, dependency);
|
|
12187
12559
|
return {
|
|
12188
|
-
tags:
|
|
12560
|
+
tags: buildPageReadCachePolicy(pageRead.siteId, dependency).tags,
|
|
12189
12561
|
...dependency === "availability" ? {
|
|
12190
|
-
ttl: Math.min(cacheTTL,
|
|
12562
|
+
ttl: Math.min(cacheTTL, 60 * 1e3),
|
|
12191
12563
|
staleTtl: 0
|
|
12192
12564
|
} : {}
|
|
12193
12565
|
};
|
|
@@ -12507,7 +12879,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12507
12879
|
const result = await reader({
|
|
12508
12880
|
cacheKey: plan.cacheKey,
|
|
12509
12881
|
endpoint: plan.endpoint,
|
|
12510
|
-
payloadSchemaVersion:
|
|
12882
|
+
payloadSchemaVersion: 6
|
|
12511
12883
|
});
|
|
12512
12884
|
if (result.kind === "miss") return {
|
|
12513
12885
|
kind: "miss",
|
|
@@ -12556,7 +12928,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12556
12928
|
payload,
|
|
12557
12929
|
siteId: plan.siteId ?? getRuntimePayloadSiteId(payload),
|
|
12558
12930
|
...publishedCacheLifetime(plan, payload),
|
|
12559
|
-
payloadSchemaVersion:
|
|
12931
|
+
payloadSchemaVersion: 6,
|
|
12560
12932
|
writeReason: "live_success"
|
|
12561
12933
|
});
|
|
12562
12934
|
} catch {}
|
|
@@ -12570,6 +12942,11 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12570
12942
|
error: input.error
|
|
12571
12943
|
})) : null;
|
|
12572
12944
|
}
|
|
12945
|
+
/** Every fallback leaves through here, so the caller's hook sees each one. */
|
|
12946
|
+
async function serveFallback(fallback) {
|
|
12947
|
+
await config.resilience?.beforeFallbackServed?.(fallback.resilience);
|
|
12948
|
+
return fallback;
|
|
12949
|
+
}
|
|
12573
12950
|
async function resilientFetch(cacheKey, fetcher, options) {
|
|
12574
12951
|
const requestId = generateRequestId();
|
|
12575
12952
|
const startTime = Date.now();
|
|
@@ -12589,21 +12966,21 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12589
12966
|
if (resilienceEnabled && circuitBreaker.isOpen()) {
|
|
12590
12967
|
if (allowFallbacks && !isPreview && staleIfError) {
|
|
12591
12968
|
const stale = cache.getStale(cacheKey);
|
|
12592
|
-
if (stale) return emitStatus("stale", stale.value, statusDetails({
|
|
12969
|
+
if (stale) return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
12593
12970
|
staleAgeSec: stale.staleAgeSec,
|
|
12594
12971
|
cacheTier: "memory-stale",
|
|
12595
12972
|
error: {
|
|
12596
12973
|
code: "circuit_open",
|
|
12597
12974
|
message: "Circuit breaker is open"
|
|
12598
12975
|
}
|
|
12599
|
-
}));
|
|
12976
|
+
})));
|
|
12600
12977
|
}
|
|
12601
12978
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, {
|
|
12602
12979
|
code: "circuit_open",
|
|
12603
12980
|
message: "Circuit breaker is open"
|
|
12604
12981
|
}) : null;
|
|
12605
12982
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
12606
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
12983
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
12607
12984
|
const prebuild = tryPrebuildFallback({
|
|
12608
12985
|
allowed: allowFallbacks,
|
|
12609
12986
|
preview: isPreview,
|
|
@@ -12615,7 +12992,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12615
12992
|
message: "Circuit breaker is open"
|
|
12616
12993
|
}
|
|
12617
12994
|
});
|
|
12618
|
-
if (prebuild) return prebuild;
|
|
12995
|
+
if (prebuild) return serveFallback(prebuild);
|
|
12619
12996
|
const circuitState = circuitBreaker.getState();
|
|
12620
12997
|
emitStatus("error", null, statusDetails({
|
|
12621
12998
|
durableCache,
|
|
@@ -12663,17 +13040,17 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12663
13040
|
const stale = cache.getStale(cacheKey);
|
|
12664
13041
|
if (stale) {
|
|
12665
13042
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
12666
|
-
return emitStatus("stale", stale.value, statusDetails({
|
|
13043
|
+
return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
12667
13044
|
staleAgeSec: stale.staleAgeSec,
|
|
12668
13045
|
cacheTier: "memory-stale",
|
|
12669
13046
|
error: errorInfo
|
|
12670
|
-
}));
|
|
13047
|
+
})));
|
|
12671
13048
|
}
|
|
12672
13049
|
}
|
|
12673
13050
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
12674
13051
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, errorInfo) : null;
|
|
12675
13052
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
12676
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
13053
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
12677
13054
|
const prebuild = tryPrebuildFallback({
|
|
12678
13055
|
allowed: allowFallbacks,
|
|
12679
13056
|
preview: isPreview,
|
|
@@ -12682,7 +13059,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12682
13059
|
durableCache,
|
|
12683
13060
|
error: errorInfo
|
|
12684
13061
|
});
|
|
12685
|
-
if (prebuild) return prebuild;
|
|
13062
|
+
if (prebuild) return serveFallback(prebuild);
|
|
12686
13063
|
throw attachResilienceStatusToError(error, emitStatus("error", null, statusDetails({
|
|
12687
13064
|
error: errorInfo,
|
|
12688
13065
|
durableCache
|
|
@@ -13092,4 +13469,4 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13092
13469
|
};
|
|
13093
13470
|
}
|
|
13094
13471
|
//#endregion
|
|
13095
|
-
export { DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION as a,
|
|
13472
|
+
export { sdkRequestOptions as _, DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION as a, normalizeRuntimePublicPath as c, parsePublishedRuntimeCachePayloadSchemaVersion as d, readsCanonicalPath as f, buildEndpointURL as g, API_ENDPOINTS as h, resolveRuntimeCachePolicy as i, parsePublishedRuntimeCacheKey as l, siteWideReadPath as m, classifyPublishedRuntimeCacheFreshness as n, decideSiteReadPath as o, siteReadIncludesTermsHistory as p, derivePublishedRuntimeCacheKey as r, isPublishedRuntimeCacheKeyEndpoint as s, createRiverbankClient as t, parsePublishedRuntimeCacheKeyDetails as u, CircuitOpenError as v, createBearerAPIClient as y };
|