@riverbankcms/sdk 0.182.0 → 0.184.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/README.md +83 -4
- package/dist/_dts/{BlocksIslandsHydrator-Bvw2bUif.d.ts → BlocksIslandsHydrator-DjBTJYiF.d.ts} +1 -1
- package/dist/_dts/{Page-B2EAT-bE.d.ts → Page-BpXEM2ET.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D0vww6rh.d.ts → SdkPreviewMode-Bb3h7KRE.d.ts} +2 -2
- package/dist/_dts/{client-D6T430bk.d.ts → client-DgTRRtl_.d.ts} +14 -1
- package/dist/_dts/{content-types-wZVWccC6.d.ts → content-types-DZQJp_ak.d.ts} +9 -16
- package/dist/_dts/{contracts-B-vtOcr8.d.ts → contracts-Ww1fmd-c.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CxfwHE6z.d.ts → generatePageMetadata-BGc7dju6.d.ts} +2 -2
- package/dist/_dts/{index-CciRW_w1.d.ts → index-BECaUNYs.d.ts} +2 -2
- package/dist/_dts/{index-CEyYMhLJ.d.ts → index-Cc85KVLW.d.ts} +3 -3
- package/dist/_dts/{index-CQrb3Ccc.d.ts → index-Cni4jykw.d.ts} +4 -4
- package/dist/_dts/{index-DIU-wL1M.d.ts → index-DxxTQ_0V.d.ts} +2 -2
- package/dist/_dts/{index-Cqxis-nv.d.ts → index-W9-7djG3.d.ts} +1 -1
- package/dist/_dts/{index-DqPKdeTk.d.ts → index-ukS-Ffem.d.ts} +1 -1
- package/dist/_dts/{loadContent-D0wrxiSp.d.ts → loadContent-BlSWTlbD.d.ts} +7 -7
- package/dist/_dts/{request-DEwxUSw8.d.ts → request-CZz2BoXJ.d.ts} +89478 -88093
- package/dist/_dts/{resolveBlockData-VaG_MYbN.d.ts → resolveBlockData-D12HXnS3.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DTwklC_v.d.ts → resolvePageContent-BteMsSGP.d.ts} +1 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +7 -7
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/portal/index.d.ts +10 -2
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +126 -2
- package/dist/_dts/{serviceBookingOutline-DtQuFlID.d.ts → serviceBookingOutline-aTlOvO3U.d.ts} +16 -8
- package/dist/_dts/{types-B3RjeBLV.d.ts → types-Bi7R07RX.d.ts} +45 -4
- package/dist/_dts/{types-BvUSGQrw.d.ts → types-CCcQlRBi.d.ts} +22 -12
- package/dist/_dts/{types-CkRFtBqd.d.ts → types-Du4aMnWC.d.ts} +13 -15
- package/dist/_dts/{validation-BZA3DhcV.d.ts → validation-CjCWVmwe.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CQMf0HdN.mjs → BlocksIslandsHydrator-CFLWxjxR.mjs} +22 -18
- package/dist/client/{BookingMailingListNote-7kdvuPow.mjs → BookingMailingListNote-C4LcfwyA.mjs} +8 -8
- package/dist/client/{BookingQuestionFields-BJI7mZuV.mjs → BookingQuestionFields-DdcmoHqQ.mjs} +2 -2
- package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-DYGewmvh.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-DPUD6wjy.mjs → CalendarNavigationChevron-ZfrUiiiI.mjs} +25 -8
- package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-CTMIII37.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-8kwNF9HN.mjs → DemoBookingPortalAccess-pzkGVkgG.mjs} +7 -5
- package/dist/client/{EventCalendar.client-Dhb14bcC.mjs → EventCalendar.client-Ct1B3xI4.mjs} +10 -10
- package/dist/client/{EventCombined.client-C1jEZBN9.mjs → EventCombined.client-DgfNtcgW.mjs} +9 -9
- package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-CjoaG1zy.mjs} +1 -1
- package/dist/client/{EventItem-Bb0ppG2N.mjs → EventItem-KGKkK19N.mjs} +29 -14
- package/dist/client/{EventListWeekNavigation-DMryCaNV.mjs → EventListWeekNavigation-Ba9ezxuC.mjs} +1 -1
- package/dist/client/{EventListing.client-BuH5kKA3.mjs → EventListing.client-xFKRDLwC.mjs} +3 -3
- package/dist/client/{EventListing.view-DsqvuulZ.mjs → EventListing.view-Dy36vWHi.mjs} +84 -7
- package/dist/client/{EventRegistrationPayment-D4FvQSFF.mjs → EventRegistrationPayment-Dth9L00x.mjs} +118 -76
- package/dist/client/{Page-sV6BJkXX.mjs → Page-DB5KODiu.mjs} +4491 -1398
- package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-CY6u5sQa.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-VfSd6JU-.mjs → SiteTermsAgreementField-BDVP_HeK.mjs} +3 -3
- package/dist/client/{StepIndicator-B6o5B7g3.mjs → StepIndicator-CLgDVzCs.mjs} +1 -1
- package/dist/client/{StepIndicator-BTqO7cJl.mjs → StepIndicator-DRyZ8igu.mjs} +7 -7
- package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-C4rCsPCt.mjs} +52 -10
- package/dist/client/{accessibleSurfaces-BogaGutk.mjs → accessibleSurfaces-CqroimVQ.mjs} +1024 -619
- package/dist/client/{accordion-6cuswD_s.mjs → accordion-BQYRP5xV.mjs} +1 -1
- package/dist/client/{booking-form.client-BOMe_SKi.mjs → booking-form.client-B7ckDuOC.mjs} +191 -71
- package/dist/client/{bookingForm-DSCH-VHo.mjs → bookingForm-BeD4650p.mjs} +7 -6
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BFuqZCfz.mjs → boxStyleClassNames-CA7FirMH.mjs} +2 -2
- package/dist/client/buttonParts-C39GC0kz.mjs +1518 -0
- package/dist/client/{carousel-CGyQVV1M.mjs → carousel-DJ9Aa1m3.mjs} +2 -2
- package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DKWqVHHh.mjs} +1 -1
- package/dist/client/{cart-BYOe7MCh.mjs → cart-DdCenbTy.mjs} +3 -3
- package/dist/client/{cart.client-BKFkaXdV.mjs → cart.client-BQm06qNw.mjs} +1 -1
- package/dist/client/{checkout-Dwd7Di77.mjs → checkout-45wPQULN.mjs} +3 -3
- package/dist/client/{checkout.client-C25hpi-z.mjs → checkout.client-bSv4cc5z.mjs} +1 -1
- package/dist/client/{checkoutUrls-tG788sw0.mjs → checkoutUrls-CwlaMl3W.mjs} +1 -1
- package/dist/client/client.mjs +460 -119
- package/dist/client/{constants-DdxFG3Ic.mjs → constants-DXV4KR7l.mjs} +1 -1
- package/dist/client/{context-Hi1RuYEM.mjs → context-lCPfX-xe.mjs} +15 -5
- package/dist/client/{dateFormatting-C8vBCHuo.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BAL5UIDG.mjs → demoPortalMagicLink-Ce3Gyin_.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Dv1Lr9kJ.mjs → enhanceHeaderSection-CGcDE9aE.mjs} +4 -4
- package/dist/client/{event-registration.client-dB_Z7bb-.mjs → event-registration.client-DlPfn4YG.mjs} +52 -29
- package/dist/client/{eventCalendar-CQnRA4Ww.mjs → eventCalendar-CioAdryV.mjs} +4 -4
- package/dist/client/{eventCombined-BDOG1hVp.mjs → eventCombined-Dwt0G6ez.mjs} +4 -4
- package/dist/client/{eventListing-DSVmhy9n.mjs → eventListing-B3H9ifOC.mjs} +4 -4
- package/dist/client/{eventRegistration-CD5mRtEH.mjs → eventRegistration-Do7cAhXb.mjs} +7 -6
- package/dist/client/{form-DWnlEVSK.mjs → form-CsqzgC6v.mjs} +3 -3
- package/dist/client/{form.client-D7zmeqNI.mjs → form.client-DVDB7hY6.mjs} +5 -5
- package/dist/client/{form.parts-C-G6N_MK.mjs → form.parts-1q2rzSYt.mjs} +3 -3
- package/dist/client/gifting/client.mjs +16 -9
- package/dist/client/{gifting-Cn0jidP5.mjs → gifting-BrXQGX-k.mjs} +4 -4
- package/dist/client/{gifting.client-DVo1YFLs.mjs → gifting.client--zAjnY5N.mjs} +155 -85
- package/dist/client/gifting.interactive-CrwHpUJG.mjs +207 -0
- package/dist/client/gifting.parts-CcKdDaQq.mjs +124 -0
- package/dist/client/{headerSection-DjQuj_6v.mjs → headerSection-DlcDH4bi.mjs} +2 -2
- package/dist/client/{noop-jesvJXEE.mjs → islands-dMh0Oxli.mjs} +16103 -7965
- package/dist/client/{newsletter-form.client-rIYPziZC.mjs → newsletter-form.client-BxA1PsdS.mjs} +6 -6
- package/dist/client/{newsletter-form.interactive-DVt3enLr.mjs → newsletter-form.interactive-D0iRg7p2.mjs} +229 -197
- package/dist/client/{newsletter-form.parts-CH6dGfdn.mjs → newsletter-form.parts-Dmuklz0r.mjs} +2 -2
- package/dist/client/{newsletterForm-Cg8cBDHd.mjs → newsletterForm-CBzvgIfg.mjs} +3 -3
- package/dist/client/portal/client.mjs +51 -35
- package/dist/client/{portalOrders-oEoTvzkW.mjs → portalOrders-tCxS04g0.mjs} +3 -2
- package/dist/client/{portalRoutes-ByyVZfVq.mjs → portalRoutes-DiGibcZI.mjs} +31 -9
- package/dist/client/portalSession-0XhXyTxT.mjs +41 -0
- package/dist/client/{product-detail.client-5aHq-vuu.mjs → product-detail.client-D9MP8hvH.mjs} +1 -1
- package/dist/client/{product-list.client-CyAk5rnC.mjs → product-list.client-wCz1qcUY.mjs} +1 -1
- package/dist/client/{productDetail-B8aZ2mqY.mjs → productDetail-D9-fCY6c.mjs} +3 -3
- package/dist/client/{productList-BuLemmod.mjs → productList-PJyxXSac.mjs} +3 -3
- package/dist/client/{propsDecoder-0Unsqn3R.mjs → propsDecoder-B8lrKGPw.mjs} +4 -2
- package/dist/client/{registry.server-DzvtVVD0.mjs → registry.server-CI63JVHW.mjs} +2444 -1078
- package/dist/client/rendering/client.mjs +32 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +5 -5
- package/dist/client/{richText-coerce-Bnng7JFA.mjs → richText-coerce-Jt9hDHdh.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-BGfcc9sk.mjs → routeIslandApiConfig-ZSPcJWx1.mjs} +1 -1
- package/dist/client/runtimeResponse-DlPBWBd9.mjs +3 -0
- package/dist/client/{runtimeResponse-DAPVRToN.mjs → runtimeResponse-_iW9oEYc.mjs} +1 -1
- package/dist/client/{shop-GuMqnDL-.mjs → shop-CbdJlWOw.mjs} +3 -3
- package/dist/client/{shop-commerce-D5bDY1o1.mjs → shop-commerce-BqLbzUUn.mjs} +47 -28
- package/dist/client/{shop-commerce-store-B7sHnLwI.mjs → shop-commerce-store-BT0-zRqN.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-Dos2zdC2.mjs → shop-discount-apply.state-Cws0lnSb.mjs} +2 -2
- package/dist/client/{shop.client-uvj5GDZb.mjs → shop.client-0cNErhJT.mjs} +54 -24
- package/dist/client/{shopShared-3giNWE3H.mjs → shopShared-COuQ2MhQ.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{src-CmXh3JWs.mjs → src-Do_s2lqH.mjs} +11 -18
- package/dist/client/{timetableModel-GA-hn1qM.mjs → timetableModel-DqI6U1BS.mjs} +11 -8
- package/dist/client/{urlParams-C2QHo1Pa.mjs → useAutomaticDiscountPreview-CeVUVzGf.mjs} +44 -1
- package/dist/client/{useAvailableSlots-CBneCxbG.mjs → useAvailableSlots-B0mjVhZr.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-D0kGF0C7.mjs → useDiscountCodeUi-B_hfgdAP.mjs} +6 -2
- package/dist/client/{useEventPagination-xX8n_Tuu.mjs → useEventPagination-Ct4A6iR1.mjs} +14 -16
- package/dist/client/{view-DOyZc-DF.mjs → view-Cj151w4m.mjs} +24 -9
- package/dist/client/{wizardSteps-B952ify5.mjs → wizardSteps-B3gsXNnb.mjs} +283 -222
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-aRJjq4x8.mjs → EventEmbeddedCheckoutStep-CVy9oapv.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-BW3dRFIv.mjs → LocationPickerEnvironment-DuRUwUrK.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Db9BHyXh.mjs → MapLibreEditMap-CdSDYBq9.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-BI3UCdpu.mjs → PageSectionToolbar-Dv4CW0AQ.mjs} +952 -138
- package/dist/preview-next/client/{PreviewEditorSidebar-jkfLVOgY.mjs → PreviewEditorSidebar-B7WW58uE.mjs} +4774 -2040
- package/dist/preview-next/client/{PreviewEditorUI-DwJQs4hM.mjs → PreviewEditorUI-BnJ1ughv.mjs} +71 -47
- package/dist/preview-next/client/{PreviewShell-BAxAkuz8.mjs → PreviewShell-C7qWzAe4.mjs} +72 -40
- package/dist/preview-next/client/{SdkPreviewModeRuntime-0UVB-39f.mjs → SdkPreviewModeRuntime-CYi4UHtG.mjs} +135 -30
- package/dist/preview-next/client/{ThemedButton-CVYz7h68.mjs → ThemedButton-CRgbU75r.mjs} +799 -17
- package/dist/preview-next/client/{lucide-react-00FF_oar.mjs → lucide-react-B4c6U3ZU.mjs} +11 -1
- package/dist/preview-next/client/{previewAssistantSlot-BgiYk3PB.mjs → previewAssistantSlot-DrUoRNu9.mjs} +24203 -9291
- package/dist/preview-next/client/{previewChromeRoot-tieNdF3E.mjs → previewChromeRoot-CEYp90mM.mjs} +3 -90
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DXb_Evl0.mjs → sdk-runtime-DnO2_c0A.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BlN0jt2c.mjs → siteStyleAccess-B3PwHw2z.mjs} +46 -11
- package/dist/preview-next/client/{useAutosaveStatus-BUEPA4oL.mjs → useAutosaveStatus-DrdQ4ier.mjs} +49 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BVfr5P--.mjs → useOpenBlockForSetup-kuGRKaRL.mjs} +2008 -448
- package/dist/preview-next/container-responsive.css +469 -2
- package/dist/preview-next/editor-chrome.css +23 -2
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BHTBA48n.mjs → route-contract-CwrXkLT3.mjs} +177 -43
- package/dist/server/{Block.shared-hGoyEdjJ.mjs → Block.shared-C5ucphCJ.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BfUCTOwj.mjs → ThemeScopeCore-DvbqYXdK.mjs} +46 -10
- package/dist/server/{accessibleSurfaces-Dskni4Xj.mjs → accessibleSurfaces-CAcf1lHT.mjs} +732 -176
- package/dist/server/{accordions-By_0Ykks.mjs → accordions-DjcsqjCK.mjs} +1 -1
- package/dist/server/{bindings-DMJH4bvo.mjs → bindings-CFw4M-gZ.mjs} +69 -248
- package/dist/server/{client-DrwlRNAH.mjs → client-D0XCgITW.mjs} +488 -119
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-CeMywaiD.mjs → constants-BZduY8jG.mjs} +31 -8
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +4 -4
- package/dist/server/{loadContent-D0prFflT.mjs → loadContent-C-qyB8Tq.mjs} +11 -10
- package/dist/server/{loadPage-CBLke9pJ.mjs → loadPage-BpKKmi8E.mjs} +3 -3
- package/dist/server/lookMediaFrame-EFws7tAj.mjs +31835 -0
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-wrcuWmgp.mjs → navigation-DYkuiNXa.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-DUgCEH8z.mjs → overrideResolution-DmZn4xUE.mjs} +1 -1
- package/dist/server/page-converter.mjs +18 -5
- package/dist/server/{pageRenderPlan-BHrmogsW.mjs → pageRenderPlan-DRB7cUZ0.mjs} +674 -298
- package/dist/server/{pageRuntimeSupport-D2-YMRei.mjs → pageRuntimeSupport-Uv1xDieJ.mjs} +13 -6
- package/dist/server/{pageShared-CG8O31Eo.mjs → pageShared-BdQF875z.mjs} +911 -516
- package/dist/server/{parseThemeForPersistence-CrPlbJEN.mjs → parseThemeForPersistence-CwcWZL7u.mjs} +3 -3
- package/dist/server/{portal-pG_uhsI2.mjs → portal-BQ8qiQnk.mjs} +22 -2
- package/dist/server/portal.mjs +3 -3
- package/dist/server/{prebuild-C8Amvzce.mjs → prebuild-B51QZVNe.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-BxUETRIZ.mjs → prefetchBlockData-CppDAfJW.mjs} +4 -4
- package/dist/server/{registry-Cc88-23f.mjs → registry-Bf4W8Qa7.mjs} +7585 -24378
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +10 -10
- package/dist/server/{resolveBlockData-OG3KOkig.mjs → resolveBlockData-DMHAZooQ.mjs} +2 -2
- package/dist/server/{expandPalette-ehuW8r2g.mjs → resolveButtonColourStates-BMtAAPzp.mjs} +1670 -1346
- package/dist/server/{responseMedia-IfH65QAH.mjs → responseMedia-DKYfR518.mjs} +1 -1
- package/dist/server/{schema-CwfxQjc4.mjs → schema-DGaihVwp.mjs} +300 -29
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-BcFuhhD7.mjs → servicePageContent-CRvmreX7.mjs} +40 -16
- package/dist/server/theme-bridge.mjs +5 -4
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-DPaUPTfl.mjs → three-pass-converter-mcy2E1Yd.mjs} +2 -2
- package/dist/server/{titleSourceSchema-NhK6azFS.mjs → titleSourceSchema-B2qFOUwZ.mjs} +4 -5
- package/dist/server/{typeGuards-CTW_9AXq.mjs → typeGuards-DZOaGTEv.mjs} +126 -126
- package/dist/server/{types-BKaBZFjD.mjs → types-C_S0pWbR.mjs} +487 -9
- package/dist/server/{validation-BovmbS8N.mjs → validation-CUtNT_EZ.mjs} +14 -10
- package/dist/server/{version-hws4hgyX.mjs → version-DebJQ4zn.mjs} +1 -1
- package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
- package/dist/styles/index.css +2987 -168
- package/package.json +1 -1
- package/dist/client/gifting.parts-Bak93gD2.mjs +0 -86
- package/dist/client/runtimeResponse-nXT8VAMl.mjs +0 -3
- package/dist/client/types-BEaKfam_.mjs +0 -778
- package/dist/server/customCss-C9kgPHvr.mjs +0 -247
- package/dist/server/lookMediaFrame-H0fi4bJk.mjs +0 -2701
- package/dist/server/media-gvfIw3z8.mjs +0 -216
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as rethrowClientFrameworkSignal, l as isSupportedLoaderEndpoint, o as encodePublicProductCategorySelector, r as findFrameworkSignal, t as materializeEntriesMedia } from "./responseMedia-
|
|
1
|
+
import { r as parseSurfaceTree } from "./accessibleSurfaces-CAcf1lHT.mjs";
|
|
2
|
+
import { i as rethrowClientFrameworkSignal, l as isSupportedLoaderEndpoint, o as encodePublicProductCategorySelector, r as findFrameworkSignal, t as materializeEntriesMedia } from "./responseMedia-DKYfR518.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-DebJQ4zn.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,67 @@ const weekday = z.union([
|
|
|
770
795
|
z.literal(5),
|
|
771
796
|
z.literal(6)
|
|
772
797
|
]);
|
|
773
|
-
const
|
|
798
|
+
const localStart = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/);
|
|
799
|
+
const everyWeeks = z.union([z.literal(1), z.literal(2)]);
|
|
800
|
+
const nth = z.union([
|
|
801
|
+
z.literal(1),
|
|
802
|
+
z.literal(2),
|
|
803
|
+
z.literal(3),
|
|
804
|
+
z.literal(4),
|
|
805
|
+
z.literal("last")
|
|
806
|
+
]);
|
|
807
|
+
/** A recurring day in an arrangement's week, with the id it keeps in every segment. */
|
|
808
|
+
const arrangementSlotSchema = z.object({
|
|
809
|
+
id: z.string().uuid(),
|
|
810
|
+
weekday,
|
|
811
|
+
localStart
|
|
812
|
+
}).strict();
|
|
813
|
+
/** A saved pattern: weekly (several days, counted in weeks from a Monday anchor) or monthly (one day). */
|
|
814
|
+
const arrangementPatternSchema = z.discriminatedUnion("kind", [z.object({
|
|
774
815
|
kind: z.literal("weekly"),
|
|
775
|
-
everyWeeks
|
|
776
|
-
|
|
816
|
+
everyWeeks,
|
|
817
|
+
anchorMonday: localDate,
|
|
818
|
+
slots: z.array(arrangementSlotSchema).min(1).max(7).readonly()
|
|
777
819
|
}).strict(), z.object({
|
|
778
820
|
kind: z.literal("monthly"),
|
|
821
|
+
nth,
|
|
822
|
+
slot: arrangementSlotSchema
|
|
823
|
+
}).strict()]);
|
|
824
|
+
const slotTime = z.object({
|
|
825
|
+
weekday,
|
|
826
|
+
localStart
|
|
827
|
+
}).strict();
|
|
828
|
+
const differentDays = (days) => new Set(days.map((day) => day.weekday)).size === days.length;
|
|
829
|
+
/** What setup asks for: the days and times, with no ids or anchor. The server mints those. */
|
|
830
|
+
const arrangementSetUpScheduleSchema = z.object({
|
|
831
|
+
effectiveFrom: localDate,
|
|
832
|
+
pattern: z.discriminatedUnion("kind", [z.object({
|
|
833
|
+
kind: z.literal("weekly"),
|
|
834
|
+
everyWeeks,
|
|
835
|
+
days: z.array(slotTime).min(1).max(7).refine(differentDays, "Each day can only be picked once.")
|
|
836
|
+
}).strict(), z.object({
|
|
837
|
+
kind: z.literal("monthly"),
|
|
838
|
+
nth,
|
|
839
|
+
day: slotTime
|
|
840
|
+
}).strict()])
|
|
841
|
+
}).strict();
|
|
842
|
+
/**
|
|
843
|
+
* A change to the schedule from a date. `move` changes one day's weekday or time. `add` adds a
|
|
844
|
+
* day (weekly patterns only); the server mints its id from the operation, and it books the new
|
|
845
|
+
* day's next `bookAhead` sessions the way setup does.
|
|
846
|
+
*/
|
|
847
|
+
const arrangementScheduleCommandSchema = z.discriminatedUnion("kind", [z.object({
|
|
848
|
+
kind: z.literal("move"),
|
|
849
|
+
slotId: z.string().uuid(),
|
|
779
850
|
weekday,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
851
|
+
localStart,
|
|
852
|
+
effectiveFrom: localDate
|
|
853
|
+
}).strict(), z.object({
|
|
854
|
+
kind: z.literal("add"),
|
|
855
|
+
weekday,
|
|
856
|
+
localStart,
|
|
857
|
+
effectiveFrom: localDate,
|
|
858
|
+
bookAhead: z.number().int().min(0).max(52)
|
|
787
859
|
}).strict()]);
|
|
788
860
|
const arrangementEndSchema = z.discriminatedUnion("kind", [
|
|
789
861
|
z.object({ kind: z.literal("open") }).strict(),
|
|
@@ -796,21 +868,17 @@ const arrangementEndSchema = z.discriminatedUnion("kind", [
|
|
|
796
868
|
sessions: z.number().int().min(1).max(1e4)
|
|
797
869
|
}).strict()
|
|
798
870
|
]);
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
z.
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
}).strict()
|
|
809
|
-
]);
|
|
810
|
-
const arrangementScheduleSchema = z.object({
|
|
871
|
+
/**
|
|
872
|
+
* How a session no package covers gets chased. What pays for each session isn't chosen: it uses a
|
|
873
|
+
* package the client holds that covers it, soonest-expiring first.
|
|
874
|
+
*/
|
|
875
|
+
const arrangementOwedFollowUpSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("direct") }).strict(), z.object({
|
|
876
|
+
kind: z.literal("payment_link"),
|
|
877
|
+
sendOffsetMinutes: z.number().int().min(1).max(525600)
|
|
878
|
+
}).strict()]);
|
|
879
|
+
z.object({
|
|
811
880
|
effectiveFrom: localDate,
|
|
812
|
-
|
|
813
|
-
localStart: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/)
|
|
881
|
+
pattern: arrangementPatternSchema
|
|
814
882
|
}).strict();
|
|
815
883
|
const recordedReturn = { recordedReturn: z.literal("staff_confirmed").optional() };
|
|
816
884
|
const operation = {
|
|
@@ -825,17 +893,15 @@ const createClientArrangementSchema = z.object({
|
|
|
825
893
|
timezone: z.string().min(1),
|
|
826
894
|
holdsTime: z.boolean(),
|
|
827
895
|
end: arrangementEndSchema,
|
|
828
|
-
|
|
829
|
-
schedule:
|
|
830
|
-
bookAhead: z.number().int().min(0).max(52)
|
|
831
|
-
bookShortfallAsOwed: z.boolean().default(false)
|
|
896
|
+
owedFollowUp: arrangementOwedFollowUpSchema,
|
|
897
|
+
schedule: arrangementSetUpScheduleSchema,
|
|
898
|
+
bookAhead: z.number().int().min(0).max(52)
|
|
832
899
|
}).strict();
|
|
833
900
|
/** The UI selects the next N dates from get.dates, then retains this body for retry. */
|
|
834
901
|
const bookNextArrangementSchema = z.object({
|
|
835
902
|
...operation,
|
|
836
903
|
confirmation: z.string().optional(),
|
|
837
|
-
occurrenceDates: z.array(localDate).min(1).max(52).refine((values) => new Set(values).size === values.length, "Choose each date once.")
|
|
838
|
-
bookShortfallAsOwed: z.boolean().default(false)
|
|
904
|
+
occurrenceDates: z.array(localDate).min(1).max(52).refine((values) => new Set(values).size === values.length, "Choose each date once.")
|
|
839
905
|
}).strict();
|
|
840
906
|
const arrangementAwaySchema = z.object({
|
|
841
907
|
...operation,
|
|
@@ -845,27 +911,38 @@ const arrangementAwaySchema = z.object({
|
|
|
845
911
|
}).strict().refine((value) => value.backOn > value.from, "Choose a return date after the first day away.");
|
|
846
912
|
const arrangementChangeFromSchema = z.object({
|
|
847
913
|
...operation,
|
|
848
|
-
|
|
914
|
+
command: arrangementScheduleCommandSchema
|
|
849
915
|
}).strict();
|
|
850
916
|
const arrangementOneWeekSchema = z.object({
|
|
851
917
|
...operation,
|
|
852
918
|
occurrenceDate: localDate,
|
|
853
|
-
startAt: z.iso.datetime({ offset: true })
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
919
|
+
startAt: z.iso.datetime({ offset: true })
|
|
920
|
+
}).strict();
|
|
921
|
+
/**
|
|
922
|
+
* Ending all of it, or one day: that day stops after `lastDate`, its bookings after then are
|
|
923
|
+
* cancelled, and the other days carry on.
|
|
924
|
+
*/
|
|
925
|
+
const arrangementEndRequestSchema = z.discriminatedUnion("scope", [z.object({
|
|
858
926
|
...operation,
|
|
859
927
|
...recordedReturn,
|
|
928
|
+
scope: z.literal("all"),
|
|
860
929
|
lastDate: localDate
|
|
861
|
-
}).strict()
|
|
930
|
+
}).strict(), z.object({
|
|
931
|
+
...operation,
|
|
932
|
+
...recordedReturn,
|
|
933
|
+
scope: z.literal("day"),
|
|
934
|
+
slotId: z.string().uuid(),
|
|
935
|
+
lastDate: localDate
|
|
936
|
+
}).strict()]);
|
|
862
937
|
/** `expectedUpdatedAt` is the version the dialog was showing, so a save can't overwrite a newer change. */
|
|
938
|
+
/** `confirmation` is the preview's, when booked sessions change with the service. */
|
|
863
939
|
const arrangementEditSchema = z.object({
|
|
864
940
|
...operation,
|
|
941
|
+
confirmation: z.string().optional(),
|
|
865
942
|
expectedUpdatedAt: z.string().min(1),
|
|
866
943
|
serviceId: z.string().uuid(),
|
|
867
944
|
holdsTime: z.boolean(),
|
|
868
|
-
|
|
945
|
+
owedFollowUp: arrangementOwedFollowUpSchema
|
|
869
946
|
}).strict();
|
|
870
947
|
z.discriminatedUnion("kind", [
|
|
871
948
|
z.object({
|
|
@@ -981,6 +1058,19 @@ z.intersection(z.object({ occurrenceDate: localDate }), z.union([
|
|
|
981
1058
|
})
|
|
982
1059
|
])
|
|
983
1060
|
}),
|
|
1061
|
+
z.object({
|
|
1062
|
+
outcome: z.literal("service_changed"),
|
|
1063
|
+
appointmentId: z.string(),
|
|
1064
|
+
startAt: z.string(),
|
|
1065
|
+
endAt: z.string(),
|
|
1066
|
+
previousEndAt: z.string(),
|
|
1067
|
+
price: z.discriminatedUnion("kind", [z.object({
|
|
1068
|
+
kind: z.literal("restated"),
|
|
1069
|
+
fromCents: z.number().int(),
|
|
1070
|
+
toCents: z.number().int(),
|
|
1071
|
+
currency: z.string()
|
|
1072
|
+
}), z.object({ kind: z.literal("kept") })])
|
|
1073
|
+
}),
|
|
984
1074
|
z.object({
|
|
985
1075
|
outcome: z.literal("cancelled"),
|
|
986
1076
|
appointmentId: z.string(),
|
|
@@ -1004,11 +1094,7 @@ z.intersection(z.object({ occurrenceDate: localDate }), z.union([
|
|
|
1004
1094
|
outcome: z.literal("refused"),
|
|
1005
1095
|
appointmentId: z.string().optional()
|
|
1006
1096
|
}), z.discriminatedUnion("code", [
|
|
1007
|
-
z.object({ code: z.enum([
|
|
1008
|
-
"package_shortfall",
|
|
1009
|
-
"not_available",
|
|
1010
|
-
"client_not_found"
|
|
1011
|
-
]) }),
|
|
1097
|
+
z.object({ code: z.enum(["not_available", "client_not_found"]) }),
|
|
1012
1098
|
z.object({
|
|
1013
1099
|
code: z.literal("clash"),
|
|
1014
1100
|
customerFirstName: z.string().nullable(),
|
|
@@ -3404,6 +3490,44 @@ const GIFTING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
3404
3490
|
"server:internal_error"
|
|
3405
3491
|
]
|
|
3406
3492
|
},
|
|
3493
|
+
getGiftRefund: {
|
|
3494
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
3495
|
+
method: "GET",
|
|
3496
|
+
auth: "user",
|
|
3497
|
+
responseKind: "json",
|
|
3498
|
+
errors: [
|
|
3499
|
+
"auth:forbidden",
|
|
3500
|
+
"resource:conflict",
|
|
3501
|
+
"server:internal_error"
|
|
3502
|
+
]
|
|
3503
|
+
},
|
|
3504
|
+
refundGift: {
|
|
3505
|
+
path: "/sites/{siteId}/gifting/refunds/{orderItemId}",
|
|
3506
|
+
method: "POST",
|
|
3507
|
+
auth: "user",
|
|
3508
|
+
responseKind: "json",
|
|
3509
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
3510
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
3511
|
+
errors: [
|
|
3512
|
+
"auth:forbidden",
|
|
3513
|
+
"resource:conflict",
|
|
3514
|
+
"server:internal_error"
|
|
3515
|
+
]
|
|
3516
|
+
},
|
|
3517
|
+
cancelGift: {
|
|
3518
|
+
path: "/sites/{siteId}/gifting/gifts/{giftId}/cancel",
|
|
3519
|
+
method: "POST",
|
|
3520
|
+
tags: ["site-{siteId}", "gifting-gifts-{siteId}"],
|
|
3521
|
+
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN,
|
|
3522
|
+
auth: "user",
|
|
3523
|
+
responseKind: "json",
|
|
3524
|
+
errors: [
|
|
3525
|
+
"auth:forbidden",
|
|
3526
|
+
"resource:not_found",
|
|
3527
|
+
"resource:conflict",
|
|
3528
|
+
"server:internal_error"
|
|
3529
|
+
]
|
|
3530
|
+
},
|
|
3407
3531
|
changeGiftExpiry: {
|
|
3408
3532
|
path: "/sites/{siteId}/gifting/gifts/{giftId}/expiry",
|
|
3409
3533
|
method: "POST",
|
|
@@ -5921,6 +6045,22 @@ const API_ENDPOINTS$1 = {
|
|
|
5921
6045
|
auth: "user",
|
|
5922
6046
|
responseKind: "json"
|
|
5923
6047
|
},
|
|
6048
|
+
getRegisteredDomainContact: {
|
|
6049
|
+
errors: [
|
|
6050
|
+
"resource:not_found",
|
|
6051
|
+
"auth:forbidden",
|
|
6052
|
+
"validation:invalid_input"
|
|
6053
|
+
],
|
|
6054
|
+
path: "/domains/{domainId}/registrar/contact",
|
|
6055
|
+
method: "GET",
|
|
6056
|
+
auth: "user",
|
|
6057
|
+
tags: [
|
|
6058
|
+
"domains",
|
|
6059
|
+
"domain-{domainId}",
|
|
6060
|
+
"domain-registrar"
|
|
6061
|
+
],
|
|
6062
|
+
responseKind: "json"
|
|
6063
|
+
},
|
|
5924
6064
|
updateRegisteredDomainContact: {
|
|
5925
6065
|
path: "/domains/{domainId}/registrar/contact",
|
|
5926
6066
|
method: "POST",
|
|
@@ -6005,6 +6145,18 @@ const API_ENDPOINTS$1 = {
|
|
|
6005
6145
|
auth: "user",
|
|
6006
6146
|
responseKind: "json"
|
|
6007
6147
|
},
|
|
6148
|
+
retryDomainEmailSending: {
|
|
6149
|
+
errors: [],
|
|
6150
|
+
path: "/sites/{siteId}/domains/{domainId}/email/retry",
|
|
6151
|
+
method: "POST",
|
|
6152
|
+
tags: [
|
|
6153
|
+
"domains",
|
|
6154
|
+
"domain-{domainId}",
|
|
6155
|
+
"domain-dns"
|
|
6156
|
+
],
|
|
6157
|
+
auth: "user",
|
|
6158
|
+
responseKind: "json"
|
|
6159
|
+
},
|
|
6008
6160
|
retryDomainResend: {
|
|
6009
6161
|
path: "/domains/{domainId}/resend",
|
|
6010
6162
|
method: "POST",
|
|
@@ -10220,6 +10372,9 @@ function resolveApiBaseUrl() {
|
|
|
10220
10372
|
}
|
|
10221
10373
|
//#endregion
|
|
10222
10374
|
//#region ../api/src/pageReadResponseCache.ts
|
|
10375
|
+
function pageReadPolicy(siteId, policy) {
|
|
10376
|
+
return policy === "retry" ? buildPageReadRetryPolicy(siteId) : buildPageReadCachePolicy(siteId, policy);
|
|
10377
|
+
}
|
|
10223
10378
|
function isRecord(value) {
|
|
10224
10379
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10225
10380
|
}
|
|
@@ -10230,8 +10385,20 @@ function isResolvedPage(page) {
|
|
|
10230
10385
|
"system_service"
|
|
10231
10386
|
].includes(String(page.result.kind));
|
|
10232
10387
|
}
|
|
10388
|
+
/**
|
|
10389
|
+
* The key `serializeSurfaceTree` (theme-core) wraps a response in when it carries surface revisions. This package
|
|
10390
|
+
* can't depend on theme-core, so the SDK's tests check the two stay equal.
|
|
10391
|
+
*/
|
|
10392
|
+
const SURFACE_TRANSPORT_ENVELOPE_KEY = "$surfaceTransport";
|
|
10393
|
+
/** A revision-transport body keeps the page's own fields under the envelope's `value`. */
|
|
10394
|
+
function withoutSurfaceTransport(data) {
|
|
10395
|
+
const envelope = data[SURFACE_TRANSPORT_ENVELOPE_KEY];
|
|
10396
|
+
if (envelope === void 0) return data;
|
|
10397
|
+
return isRecord(envelope) && Array.isArray(envelope.revisions) && envelope.revisions.length > 0 && isRecord(envelope.value) ? envelope.value : null;
|
|
10398
|
+
}
|
|
10233
10399
|
function envelopePage(body) {
|
|
10234
|
-
const
|
|
10400
|
+
const raw = isRecord(body) && body.success === true && isRecord(body.data) ? body.data : null;
|
|
10401
|
+
const data = raw ? withoutSurfaceTransport(raw) : null;
|
|
10235
10402
|
return data?.type === "content" && isRecord(data.content) ? data.content : data;
|
|
10236
10403
|
}
|
|
10237
10404
|
function parseBody(body) {
|
|
@@ -10248,40 +10415,44 @@ function admit(snapshot) {
|
|
|
10248
10415
|
if (snapshot.status === 200 && isResolvedPage(page)) {
|
|
10249
10416
|
if (header(snapshot, "x-riverbank-page-storage") === "no-store") return {
|
|
10250
10417
|
kind: "pass-through",
|
|
10251
|
-
|
|
10418
|
+
policy: "retry"
|
|
10252
10419
|
};
|
|
10253
10420
|
return {
|
|
10254
10421
|
kind: "store",
|
|
10255
|
-
|
|
10422
|
+
policy: page.dependencies
|
|
10256
10423
|
};
|
|
10257
10424
|
}
|
|
10425
|
+
if (snapshot.status === 200) return {
|
|
10426
|
+
kind: "pass-through",
|
|
10427
|
+
policy: "retry"
|
|
10428
|
+
};
|
|
10258
10429
|
return {
|
|
10259
10430
|
kind: "pass-through",
|
|
10260
|
-
|
|
10431
|
+
policy: header(snapshot, "x-riverbank-page-dependencies") === "availability" ? "availability" : "content"
|
|
10261
10432
|
};
|
|
10262
10433
|
}
|
|
10263
10434
|
/**
|
|
10264
10435
|
* One cache entry per request, judged by the policy it is looked up with. Content is looked up first, so a
|
|
10265
10436
|
* 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
|
|
10437
|
+
* availability (or must be retried soon) is looked up again under that policy, which checks its tags and budget. A snapshot
|
|
10267
10438
|
* past its own budget is never served: the live read replaces it.
|
|
10268
10439
|
*/
|
|
10269
10440
|
function planPageRead(state, now, budgetSeconds) {
|
|
10270
10441
|
const subject = state.live ?? state.cached;
|
|
10271
10442
|
if (!subject) return {
|
|
10272
10443
|
kind: "lookup",
|
|
10273
|
-
|
|
10444
|
+
policy: "content"
|
|
10274
10445
|
};
|
|
10275
|
-
const {
|
|
10276
|
-
if (!state.lookedUp.includes(
|
|
10446
|
+
const { policy } = admit(subject);
|
|
10447
|
+
if (!state.lookedUp.includes(policy)) return {
|
|
10277
10448
|
kind: "lookup",
|
|
10278
|
-
|
|
10449
|
+
policy
|
|
10279
10450
|
};
|
|
10280
10451
|
if (state.live) return {
|
|
10281
10452
|
kind: "serve",
|
|
10282
10453
|
snapshot: state.live
|
|
10283
10454
|
};
|
|
10284
|
-
return now - subject.cachedAt < budgetSeconds(
|
|
10455
|
+
return now - subject.cachedAt < budgetSeconds(policy) * 1e3 ? {
|
|
10285
10456
|
kind: "serve",
|
|
10286
10457
|
snapshot: subject
|
|
10287
10458
|
} : { kind: "read-live" };
|
|
@@ -10292,12 +10463,21 @@ function planPageRead(state, now, budgetSeconds) {
|
|
|
10292
10463
|
*/
|
|
10293
10464
|
var PassThroughResponse = class extends Error {
|
|
10294
10465
|
constructor(snapshot) {
|
|
10295
|
-
super("
|
|
10466
|
+
super("Read must not be stored");
|
|
10296
10467
|
this.snapshot = snapshot;
|
|
10297
10468
|
}
|
|
10298
10469
|
};
|
|
10299
|
-
|
|
10300
|
-
|
|
10470
|
+
/**
|
|
10471
|
+
* Names this cache's entries. Next keys an entry by these parts plus the callback's source text, and neither
|
|
10472
|
+
* changes when the response contract does, so a contract change bumps this name: otherwise a deploy keeps
|
|
10473
|
+
* serving responses the previous release cached, in the old shape, for up to their whole budget.
|
|
10474
|
+
*
|
|
10475
|
+
* - v4: a resolved page carries its own mailing-list support (`mailingList`); the hosted frontend no longer
|
|
10476
|
+
* asks the site read for it, so a v3 response would leave the page's newsletter forms without their lists.
|
|
10477
|
+
*/
|
|
10478
|
+
const PAGE_READ_RESPONSE_CACHE_NAME = "page-read-envelope-v4";
|
|
10479
|
+
async function lookup(input, policy) {
|
|
10480
|
+
const { tags } = pageReadPolicy(input.siteId, policy);
|
|
10301
10481
|
const load = async () => {
|
|
10302
10482
|
const snapshot = await input.live();
|
|
10303
10483
|
if (admit(snapshot).kind === "pass-through") throw new PassThroughResponse(snapshot);
|
|
@@ -10305,8 +10485,8 @@ async function lookup(input, dependencies) {
|
|
|
10305
10485
|
};
|
|
10306
10486
|
try {
|
|
10307
10487
|
return {
|
|
10308
|
-
cached: await input.cache(load, [
|
|
10309
|
-
revalidate: input.budgetSeconds(
|
|
10488
|
+
cached: await input.cache(load, [PAGE_READ_RESPONSE_CACHE_NAME, input.key], {
|
|
10489
|
+
revalidate: input.budgetSeconds(policy),
|
|
10310
10490
|
tags
|
|
10311
10491
|
})(),
|
|
10312
10492
|
live: null
|
|
@@ -10328,9 +10508,9 @@ async function runPlan(input, state) {
|
|
|
10328
10508
|
live: await input.live()
|
|
10329
10509
|
});
|
|
10330
10510
|
case "lookup": {
|
|
10331
|
-
const found = await lookup(input, step.
|
|
10511
|
+
const found = await lookup(input, step.policy);
|
|
10332
10512
|
return runPlan(input, {
|
|
10333
|
-
lookedUp: [...state.lookedUp, step.
|
|
10513
|
+
lookedUp: [...state.lookedUp, step.policy],
|
|
10334
10514
|
cached: found.cached ?? state.cached,
|
|
10335
10515
|
live: state.live ?? found.live
|
|
10336
10516
|
});
|
|
@@ -10362,9 +10542,9 @@ async function frameworkCacheKey(request) {
|
|
|
10362
10542
|
async function cachePageReadResponse(input) {
|
|
10363
10543
|
if (!input.cache || input.maxAge !== void 0 && input.maxAge <= 0) return input.read();
|
|
10364
10544
|
const maxAge = input.maxAge;
|
|
10365
|
-
const budgetSeconds = (
|
|
10366
|
-
const
|
|
10367
|
-
return maxAge === void 0 ?
|
|
10545
|
+
const budgetSeconds = (policy) => {
|
|
10546
|
+
const revalidate = pageReadPolicy(input.siteId, policy).revalidate;
|
|
10547
|
+
return maxAge === void 0 ? revalidate : Math.min(revalidate, maxAge);
|
|
10368
10548
|
};
|
|
10369
10549
|
const key = await frameworkCacheKey(input.key);
|
|
10370
10550
|
const result = await runPlan({
|
|
@@ -10383,15 +10563,53 @@ async function cachePageReadResponse(input) {
|
|
|
10383
10563
|
headers: result.headers
|
|
10384
10564
|
});
|
|
10385
10565
|
}
|
|
10566
|
+
/**
|
|
10567
|
+
* Names the site read's entries, for the same reason as `PAGE_READ_RESPONSE_CACHE_NAME`. A site read only
|
|
10568
|
+
* enters this cache when the host can answer it from its durable copy; otherwise it stays in Next's fetch cache.
|
|
10569
|
+
*/
|
|
10570
|
+
const SITE_READ_RESPONSE_CACHE_NAME = "site-read-envelope-v1";
|
|
10571
|
+
/**
|
|
10572
|
+
* A site read through the framework cache, with the fetch cache's lifetime and tags, so its fill can come from
|
|
10573
|
+
* the host's durable copy. As in Next's fetch cache, only a 200 is kept: an incomplete site (207) or a failure
|
|
10574
|
+
* passes through and the next read asks again.
|
|
10575
|
+
*/
|
|
10576
|
+
async function cacheSiteReadResponse(input) {
|
|
10577
|
+
const live = sharedRead(input.read);
|
|
10578
|
+
const load = async () => {
|
|
10579
|
+
const snapshot = await live();
|
|
10580
|
+
if (snapshot.status !== 200) throw new PassThroughResponse(snapshot);
|
|
10581
|
+
return snapshot;
|
|
10582
|
+
};
|
|
10583
|
+
const key = await frameworkCacheKey(input.key);
|
|
10584
|
+
const found = await input.cache(load, [SITE_READ_RESPONSE_CACHE_NAME, key], {
|
|
10585
|
+
revalidate: input.policy.revalidate,
|
|
10586
|
+
tags: input.policy.tags
|
|
10587
|
+
})().catch((error) => {
|
|
10588
|
+
if (error instanceof PassThroughResponse) return error.snapshot;
|
|
10589
|
+
throw error;
|
|
10590
|
+
});
|
|
10591
|
+
const snapshot = Date.now() - found.cachedAt < input.policy.revalidate * 1e3 ? found : await live();
|
|
10592
|
+
return new Response(snapshot.body, {
|
|
10593
|
+
status: snapshot.status,
|
|
10594
|
+
headers: snapshot.headers
|
|
10595
|
+
});
|
|
10596
|
+
}
|
|
10386
10597
|
/** Result adapters use this when the SDK served a page without the HTTP transport (memory, durable or prebuild fallback). */
|
|
10387
10598
|
async function observePageReadPolicy(cache, siteId, payload) {
|
|
10388
10599
|
if (!cache) return;
|
|
10389
|
-
const
|
|
10600
|
+
const policy = observedPageReadPolicy(pageReadDependencies(payload));
|
|
10390
10601
|
await cache(async () => true, [
|
|
10391
|
-
"page-read-policy-
|
|
10602
|
+
"page-read-policy-v3",
|
|
10392
10603
|
siteId,
|
|
10393
|
-
|
|
10394
|
-
],
|
|
10604
|
+
policy
|
|
10605
|
+
], pageReadPolicy(siteId, policy))();
|
|
10606
|
+
}
|
|
10607
|
+
/**
|
|
10608
|
+
* A page served without the tagged transport (memory, durable or prebuild) may predate a write's purge, so an
|
|
10609
|
+
* availability page only earns the retry window, not the rendered-availability backstop a purge would end.
|
|
10610
|
+
*/
|
|
10611
|
+
function observedPageReadPolicy(dependency) {
|
|
10612
|
+
return dependency === "availability" ? "retry" : "content";
|
|
10395
10613
|
}
|
|
10396
10614
|
//#endregion
|
|
10397
10615
|
//#region ../api/src/common/operationId.ts
|
|
@@ -10690,19 +10908,88 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
|
|
|
10690
10908
|
function isPublishedPageRead(endpoint, params, options) {
|
|
10691
10909
|
return (endpoint === "getContentByPath" || endpoint === "resolveRouteOutcome") && params?.preview !== true && params?.preview !== "true" && options.cache !== "no-store";
|
|
10692
10910
|
}
|
|
10911
|
+
/** The dashboard's reading of a boolean query flag, so a host never treats `force=1` as unforced. */
|
|
10912
|
+
const isTruthyRequestParam = (value) => value === true || value === "true" || value === 1 || value === "1";
|
|
10913
|
+
/** Forced reads skip every cache, and an id-only lookup is a different response the durable cache never holds. */
|
|
10914
|
+
function isFullSiteRead(params) {
|
|
10915
|
+
return !isTruthyRequestParam(params.force) && (params.scope === void 0 || params.scope === "full");
|
|
10916
|
+
}
|
|
10917
|
+
/** A published, full site read with a lifetime: the host's durable copy may answer it, under the fetch's policy. */
|
|
10918
|
+
function publishedSiteReadPolicy(endpoint, params, plan) {
|
|
10919
|
+
const next = plan.init.cache === "no-store" ? void 0 : plan.init.next;
|
|
10920
|
+
const revalidate = typeof next?.revalidate === "number" && next.revalidate > 0 ? next.revalidate : null;
|
|
10921
|
+
return endpoint === "getSite" && revalidate !== null && isFullSiteRead(params) ? {
|
|
10922
|
+
revalidate,
|
|
10923
|
+
tags: next?.tags ?? []
|
|
10924
|
+
} : null;
|
|
10925
|
+
}
|
|
10926
|
+
/** The dashboard's success envelope around a durable copy, so admission and parsing treat it like a live response. */
|
|
10927
|
+
function freshPublishedResponse(data) {
|
|
10928
|
+
return new Response(JSON.stringify(buildSuccessEnvelope(data, void 0)), {
|
|
10929
|
+
status: 200,
|
|
10930
|
+
headers: {
|
|
10931
|
+
"content-type": "application/json",
|
|
10932
|
+
"x-riverbank-cache": "frontend-hit"
|
|
10933
|
+
}
|
|
10934
|
+
});
|
|
10935
|
+
}
|
|
10936
|
+
/** The cache fill's read: the host's fresh durable copy when it has one, otherwise the dashboard. */
|
|
10937
|
+
function freshPublishedFirst(read, request, live) {
|
|
10938
|
+
if (!read) return live;
|
|
10939
|
+
return async () => {
|
|
10940
|
+
const found = await read(request).catch(() => null);
|
|
10941
|
+
return found ? freshPublishedResponse(found.data) : live();
|
|
10942
|
+
};
|
|
10943
|
+
}
|
|
10944
|
+
function publishedPageResponse(read) {
|
|
10945
|
+
const revalidate = read.plan.init.next?.revalidate;
|
|
10946
|
+
return cachePageReadResponse({
|
|
10947
|
+
cache: read.frameworkCache?.cache ?? null,
|
|
10948
|
+
key: read.key,
|
|
10949
|
+
siteId: typeof read.params.siteId === "string" ? read.params.siteId : "",
|
|
10950
|
+
maxAge: typeof revalidate === "number" ? revalidate : void 0,
|
|
10951
|
+
read: read.endpoint === "getContentByPath" ? freshPublishedFirst(read.frameworkCache?.readFreshPublished, {
|
|
10952
|
+
endpoint: "getContentByPath",
|
|
10953
|
+
params: read.params
|
|
10954
|
+
}, read.uncachedFetch) : read.uncachedFetch
|
|
10955
|
+
});
|
|
10956
|
+
}
|
|
10957
|
+
/** Without a durable reader, a site read stays in Next's fetch cache exactly as before. */
|
|
10958
|
+
function siteOrFetchResponse(read) {
|
|
10959
|
+
const durable = read.frameworkCache?.readFreshPublished;
|
|
10960
|
+
const policy = durable ? publishedSiteReadPolicy(read.endpoint, read.params, read.plan) : null;
|
|
10961
|
+
return read.frameworkCache && policy ? cacheSiteReadResponse({
|
|
10962
|
+
cache: read.frameworkCache.cache,
|
|
10963
|
+
key: read.key,
|
|
10964
|
+
policy,
|
|
10965
|
+
read: freshPublishedFirst(durable, {
|
|
10966
|
+
endpoint: "getSite",
|
|
10967
|
+
params: read.params
|
|
10968
|
+
}, read.uncachedFetch)
|
|
10969
|
+
}) : observedFetch(read.plan, read.endpoint, read.frameworkCache);
|
|
10970
|
+
}
|
|
10693
10971
|
function executeApiRequest(plan, endpoint, params, options, frameworkCache) {
|
|
10694
|
-
const
|
|
10695
|
-
const
|
|
10696
|
-
|
|
10697
|
-
|
|
10972
|
+
const { next: _fetchPolicy, ...uncachedInit } = plan.init;
|
|
10973
|
+
const read = {
|
|
10974
|
+
plan,
|
|
10975
|
+
endpoint,
|
|
10976
|
+
params: params ?? {},
|
|
10977
|
+
frameworkCache,
|
|
10698
10978
|
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, {
|
|
10979
|
+
uncachedFetch: () => fetch(plan.url, {
|
|
10702
10980
|
...uncachedInit,
|
|
10703
10981
|
cache: "no-store"
|
|
10704
10982
|
})
|
|
10705
|
-
}
|
|
10983
|
+
};
|
|
10984
|
+
return isPublishedPageRead(endpoint, params, options) ? publishedPageResponse(read) : siteOrFetchResponse(read);
|
|
10985
|
+
}
|
|
10986
|
+
function observedFetch(plan, endpoint, frameworkCache) {
|
|
10987
|
+
const revalidate = plan.init.next?.revalidate;
|
|
10988
|
+
if (typeof revalidate === "number" && plan.init.cache !== "no-store") frameworkCache?.observeFetchLifetime?.({
|
|
10989
|
+
endpoint: String(endpoint),
|
|
10990
|
+
revalidate
|
|
10991
|
+
});
|
|
10992
|
+
return fetch(plan.url, plan.init);
|
|
10706
10993
|
}
|
|
10707
10994
|
const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
|
|
10708
10995
|
endpoint: z.string(),
|
|
@@ -11060,32 +11347,77 @@ var CircuitBreaker = class {
|
|
|
11060
11347
|
}
|
|
11061
11348
|
}
|
|
11062
11349
|
};
|
|
11350
|
+
/** The SDK's read deadline when the caller sets none. */
|
|
11351
|
+
const DEFAULT_READ_DEADLINE_MS = 8e3;
|
|
11352
|
+
function createReadTimeoutError(timeoutMs) {
|
|
11353
|
+
return Object.assign(/* @__PURE__ */ new Error(`Request timed out after ${timeoutMs}ms`), { name: "AbortError" });
|
|
11354
|
+
}
|
|
11063
11355
|
/**
|
|
11064
|
-
*
|
|
11356
|
+
* One attempt, ended at the read's deadline even when the fetch ignores its signal.
|
|
11357
|
+
*
|
|
11358
|
+
* The signal alone isn't enough: Next drops it when it refreshes stale fetch data
|
|
11359
|
+
* (as an ISR regeneration does), and the read would then wait as long as the
|
|
11360
|
+
* origin takes. The signal is still aborted so a fetch that honours it stops.
|
|
11361
|
+
*/
|
|
11362
|
+
function raceReadDeadline(fetcher, remainingMs, timeoutError) {
|
|
11363
|
+
const controller = new AbortController();
|
|
11364
|
+
return new Promise((resolve, reject) => {
|
|
11365
|
+
const timeoutId = setTimeout(() => {
|
|
11366
|
+
controller.abort();
|
|
11367
|
+
reject(timeoutError());
|
|
11368
|
+
}, remainingMs);
|
|
11369
|
+
fetcher(controller.signal).then((value) => {
|
|
11370
|
+
clearTimeout(timeoutId);
|
|
11371
|
+
resolve(value);
|
|
11372
|
+
}, (error) => {
|
|
11373
|
+
clearTimeout(timeoutId);
|
|
11374
|
+
reject(error);
|
|
11375
|
+
});
|
|
11376
|
+
});
|
|
11377
|
+
}
|
|
11378
|
+
function decideRetry(input) {
|
|
11379
|
+
if (input.attempt >= input.maxAttempts) return { kind: "give_up" };
|
|
11380
|
+
if (!shouldRetryError(input.error, input.config.retryOn)) return { kind: "give_up" };
|
|
11381
|
+
const delayMs = getRetryDelay(input.error, input.attempt, input.config);
|
|
11382
|
+
return delayMs < input.remainingMs ? {
|
|
11383
|
+
kind: "retry",
|
|
11384
|
+
delayMs
|
|
11385
|
+
} : { kind: "give_up" };
|
|
11386
|
+
}
|
|
11387
|
+
/**
|
|
11388
|
+
* Fetch with one deadline and retry logic
|
|
11389
|
+
*
|
|
11390
|
+
* `requestTimeoutMs` bounds the whole read, so retries share what the first
|
|
11391
|
+
* attempt left rather than each getting a fresh budget. A timeout is never
|
|
11392
|
+
* retried: the deadline has passed.
|
|
11065
11393
|
*
|
|
11066
11394
|
* @param fetcher - Function that performs the fetch, receives AbortSignal for timeout
|
|
11067
11395
|
* @param config - Retry configuration
|
|
11068
11396
|
* @returns Result from successful fetch
|
|
11069
|
-
* @throws
|
|
11397
|
+
* @throws The last attempt's error, or a timeout once the deadline passes
|
|
11070
11398
|
*/
|
|
11071
|
-
|
|
11399
|
+
function fetchWithTimeoutAndRetry(fetcher, config) {
|
|
11072
11400
|
const maxAttempts = config.maxAttempts ?? DEFAULT_RETRY_CONFIG.maxAttempts;
|
|
11073
11401
|
const requestTimeoutMs = config.requestTimeoutMs ?? 8e3;
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
const timeoutId = setTimeout(() => controller.abort(), requestTimeoutMs);
|
|
11402
|
+
const deadline = Date.now() + requestTimeoutMs;
|
|
11403
|
+
const timeoutError = () => createReadTimeoutError(requestTimeoutMs);
|
|
11404
|
+
const attemptFrom = async (attempt) => {
|
|
11078
11405
|
try {
|
|
11079
|
-
return await fetcher(
|
|
11080
|
-
}
|
|
11081
|
-
|
|
11406
|
+
return await raceReadDeadline(fetcher, Math.max(0, deadline - Date.now()), timeoutError);
|
|
11407
|
+
} catch (error) {
|
|
11408
|
+
const decision = decideRetry({
|
|
11409
|
+
error,
|
|
11410
|
+
attempt,
|
|
11411
|
+
maxAttempts,
|
|
11412
|
+
remainingMs: deadline - Date.now(),
|
|
11413
|
+
config
|
|
11414
|
+
});
|
|
11415
|
+
if (decision.kind === "give_up") throw error;
|
|
11416
|
+
await sleep(decision.delayMs);
|
|
11417
|
+
return attemptFrom(attempt + 1);
|
|
11082
11418
|
}
|
|
11083
|
-
}
|
|
11084
|
-
|
|
11085
|
-
if (!shouldRetryError(error, config.retryOn)) throw error;
|
|
11086
|
-
if (attempt < maxAttempts) await sleep(getRetryDelay(error, attempt, config));
|
|
11087
|
-
}
|
|
11088
|
-
throw lastError;
|
|
11419
|
+
};
|
|
11420
|
+
return attemptFrom(1);
|
|
11089
11421
|
}
|
|
11090
11422
|
/**
|
|
11091
11423
|
* Check if an error is an AbortError (from AbortController.abort() or timeout)
|
|
@@ -11494,13 +11826,18 @@ function publicSiteReadDefinition(definition) {
|
|
|
11494
11826
|
* entries written in the old shape until publish or a live success rewrites
|
|
11495
11827
|
* them.
|
|
11496
11828
|
*
|
|
11829
|
+
* - 10: compiled arrangement runtimes declare rhythm progression (#1872 strata).
|
|
11830
|
+
* - 9: edge pins use family, variant, layers and colourPreset (#1872).
|
|
11831
|
+
* - 8: section decisions resolve stored ground identity and independent owner treatments (#1872).
|
|
11832
|
+
* - 7: compiled arrangement runtimes carry named grounds (`grounds`, `rhythm` as ResolvedGround) (#1872).
|
|
11833
|
+
* - 6: resolved page reads carry their own mailing-list projection (`mailingList`).
|
|
11497
11834
|
* - 5: page reads carry the admitted destination envelope and availability dependencies.
|
|
11498
11835
|
* - 4: owned surface inputs use the shared revision transport envelope (#1627).
|
|
11499
11836
|
* - 3: hidden business-source maps and private locations are removed before public projection (#1611).
|
|
11500
11837
|
* - 2: pages carry intent-only `runtimeJoins` in place of compiled
|
|
11501
11838
|
* `runtimeBoundaries` (issue 1422).
|
|
11502
11839
|
*/
|
|
11503
|
-
const DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION =
|
|
11840
|
+
const DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION = 10;
|
|
11504
11841
|
function toNonEmptyString(value) {
|
|
11505
11842
|
if (value === null || value === void 0) return null;
|
|
11506
11843
|
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") return null;
|
|
@@ -11512,6 +11849,24 @@ function normalizeRuntimePublicPath(value) {
|
|
|
11512
11849
|
const collapsed = (withoutQuery.startsWith("/") ? withoutQuery : `/${withoutQuery}`).replace(/\/{2,}/g, "/");
|
|
11513
11850
|
return (collapsed.length > 1 ? collapsed.replace(/\/+$/g, "") : collapsed) || "/";
|
|
11514
11851
|
}
|
|
11852
|
+
/** The site read's variant: `null` is the site-wide read; a path adds that page's runtime support. */
|
|
11853
|
+
function decideSiteReadPath(currentPath) {
|
|
11854
|
+
return toNonEmptyString(currentPath) === null ? null : normalizeRuntimePublicPath(currentPath);
|
|
11855
|
+
}
|
|
11856
|
+
const SITE_TERMS_READ_PATH = "/terms";
|
|
11857
|
+
/** Only the terms page reads the site's terms history. */
|
|
11858
|
+
function siteReadIncludesTermsHistory(path) {
|
|
11859
|
+
return path === SITE_TERMS_READ_PATH;
|
|
11860
|
+
}
|
|
11861
|
+
/**
|
|
11862
|
+
* The path to send on a site read when page content takes its mailing-list support from the page
|
|
11863
|
+
* read (the hosted frontend): none, except the terms page, which needs terms history. Callers that
|
|
11864
|
+
* send every path (deployed SDK sites) keep a site read per page with that page's support.
|
|
11865
|
+
*/
|
|
11866
|
+
function siteWideReadPath(currentPath) {
|
|
11867
|
+
const path = decideSiteReadPath(currentPath);
|
|
11868
|
+
return siteReadIncludesTermsHistory(path) ? path : null;
|
|
11869
|
+
}
|
|
11515
11870
|
function normalizeRuntimeHostname(value) {
|
|
11516
11871
|
const trimmed = value.trim().toLowerCase();
|
|
11517
11872
|
return (/^[a-z][a-z0-9+.-]*:\/\//.test(trimmed) ? new URL(trimmed) : new URL(`http://${trimmed}`)).hostname.replace(/\.$/, "");
|
|
@@ -11547,9 +11902,10 @@ function deriveGetSiteKey(params) {
|
|
|
11547
11902
|
]
|
|
11548
11903
|
}
|
|
11549
11904
|
};
|
|
11905
|
+
const path = decideSiteReadPath(params.currentPath);
|
|
11550
11906
|
const normalizedParams = {
|
|
11551
11907
|
...identity,
|
|
11552
|
-
...
|
|
11908
|
+
...path === null ? {} : { currentPath: path }
|
|
11553
11909
|
};
|
|
11554
11910
|
return {
|
|
11555
11911
|
ok: true,
|
|
@@ -11586,6 +11942,15 @@ function deriveDurableRuntimeCacheKey(input) {
|
|
|
11586
11942
|
case "getContentByPath": return deriveGetContentByPathKey(input.params);
|
|
11587
11943
|
}
|
|
11588
11944
|
}
|
|
11945
|
+
/**
|
|
11946
|
+
* Keys normalise a path, but builds read the path as sent: `/about/` is a 404 and `/terms/` skips
|
|
11947
|
+
* terms history. A variant must neither fill the canonical row nor be answered from it, so the
|
|
11948
|
+
* dashboard's writer and every reader (dashboard and hosted frontend) ask this first.
|
|
11949
|
+
*/
|
|
11950
|
+
function readsCanonicalPath(input) {
|
|
11951
|
+
const path = input.endpoint === "getSite" ? input.params.currentPath : input.params.path;
|
|
11952
|
+
return !path || normalizeRuntimePublicPath(path) === path;
|
|
11953
|
+
}
|
|
11589
11954
|
function isPublishedRuntimeCacheKeyEndpoint(value) {
|
|
11590
11955
|
return value === "getSite" || value === "getContentByPath";
|
|
11591
11956
|
}
|
|
@@ -12146,7 +12511,7 @@ function withDefaultHeaders(apiClient, defaultHeaders) {
|
|
|
12146
12511
|
});
|
|
12147
12512
|
}
|
|
12148
12513
|
const DEFAULT_BROWSER_TIMEOUT_MS = 5e3;
|
|
12149
|
-
const DEFAULT_SERVER_TIMEOUT_MS =
|
|
12514
|
+
const DEFAULT_SERVER_TIMEOUT_MS = DEFAULT_READ_DEADLINE_MS;
|
|
12150
12515
|
const MAX_GET_ENTRIES_BY_IDENTIFIERS_REFS = 50;
|
|
12151
12516
|
function isDurableRuntimeCacheTier(cacheTier) {
|
|
12152
12517
|
return cacheTier === "durable-fresh" || cacheTier === "durable-stale";
|
|
@@ -12171,7 +12536,7 @@ function publishedCacheLifetime(plan, payload) {
|
|
|
12171
12536
|
freshTtlSec: plan.freshTtlSec,
|
|
12172
12537
|
staleTtlSec: plan.staleTtlSec
|
|
12173
12538
|
};
|
|
12174
|
-
const ttl =
|
|
12539
|
+
const ttl = 60;
|
|
12175
12540
|
return {
|
|
12176
12541
|
freshTtlSec: ttl,
|
|
12177
12542
|
staleTtlSec: ttl
|
|
@@ -12183,11 +12548,10 @@ function reusableDurablePayload(plan, payload, freshness) {
|
|
|
12183
12548
|
function memoryWritePolicy(pageRead, data, tags, cacheTTL) {
|
|
12184
12549
|
if (!pageRead) return { tags };
|
|
12185
12550
|
const dependency = pageReadDependencies(data);
|
|
12186
|
-
const policy = buildPageReadCachePolicy(pageRead.siteId, dependency);
|
|
12187
12551
|
return {
|
|
12188
|
-
tags:
|
|
12552
|
+
tags: buildPageReadCachePolicy(pageRead.siteId, dependency).tags,
|
|
12189
12553
|
...dependency === "availability" ? {
|
|
12190
|
-
ttl: Math.min(cacheTTL,
|
|
12554
|
+
ttl: Math.min(cacheTTL, 60 * 1e3),
|
|
12191
12555
|
staleTtl: 0
|
|
12192
12556
|
} : {}
|
|
12193
12557
|
};
|
|
@@ -12507,7 +12871,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12507
12871
|
const result = await reader({
|
|
12508
12872
|
cacheKey: plan.cacheKey,
|
|
12509
12873
|
endpoint: plan.endpoint,
|
|
12510
|
-
payloadSchemaVersion:
|
|
12874
|
+
payloadSchemaVersion: 10
|
|
12511
12875
|
});
|
|
12512
12876
|
if (result.kind === "miss") return {
|
|
12513
12877
|
kind: "miss",
|
|
@@ -12556,7 +12920,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12556
12920
|
payload,
|
|
12557
12921
|
siteId: plan.siteId ?? getRuntimePayloadSiteId(payload),
|
|
12558
12922
|
...publishedCacheLifetime(plan, payload),
|
|
12559
|
-
payloadSchemaVersion:
|
|
12923
|
+
payloadSchemaVersion: 10,
|
|
12560
12924
|
writeReason: "live_success"
|
|
12561
12925
|
});
|
|
12562
12926
|
} catch {}
|
|
@@ -12570,6 +12934,11 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12570
12934
|
error: input.error
|
|
12571
12935
|
})) : null;
|
|
12572
12936
|
}
|
|
12937
|
+
/** Every fallback leaves through here, so the caller's hook sees each one. */
|
|
12938
|
+
async function serveFallback(fallback) {
|
|
12939
|
+
await config.resilience?.beforeFallbackServed?.(fallback.resilience);
|
|
12940
|
+
return fallback;
|
|
12941
|
+
}
|
|
12573
12942
|
async function resilientFetch(cacheKey, fetcher, options) {
|
|
12574
12943
|
const requestId = generateRequestId();
|
|
12575
12944
|
const startTime = Date.now();
|
|
@@ -12589,21 +12958,21 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12589
12958
|
if (resilienceEnabled && circuitBreaker.isOpen()) {
|
|
12590
12959
|
if (allowFallbacks && !isPreview && staleIfError) {
|
|
12591
12960
|
const stale = cache.getStale(cacheKey);
|
|
12592
|
-
if (stale) return emitStatus("stale", stale.value, statusDetails({
|
|
12961
|
+
if (stale) return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
12593
12962
|
staleAgeSec: stale.staleAgeSec,
|
|
12594
12963
|
cacheTier: "memory-stale",
|
|
12595
12964
|
error: {
|
|
12596
12965
|
code: "circuit_open",
|
|
12597
12966
|
message: "Circuit breaker is open"
|
|
12598
12967
|
}
|
|
12599
|
-
}));
|
|
12968
|
+
})));
|
|
12600
12969
|
}
|
|
12601
12970
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, {
|
|
12602
12971
|
code: "circuit_open",
|
|
12603
12972
|
message: "Circuit breaker is open"
|
|
12604
12973
|
}) : null;
|
|
12605
12974
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
12606
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
12975
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
12607
12976
|
const prebuild = tryPrebuildFallback({
|
|
12608
12977
|
allowed: allowFallbacks,
|
|
12609
12978
|
preview: isPreview,
|
|
@@ -12615,7 +12984,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12615
12984
|
message: "Circuit breaker is open"
|
|
12616
12985
|
}
|
|
12617
12986
|
});
|
|
12618
|
-
if (prebuild) return prebuild;
|
|
12987
|
+
if (prebuild) return serveFallback(prebuild);
|
|
12619
12988
|
const circuitState = circuitBreaker.getState();
|
|
12620
12989
|
emitStatus("error", null, statusDetails({
|
|
12621
12990
|
durableCache,
|
|
@@ -12663,17 +13032,17 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12663
13032
|
const stale = cache.getStale(cacheKey);
|
|
12664
13033
|
if (stale) {
|
|
12665
13034
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
12666
|
-
return emitStatus("stale", stale.value, statusDetails({
|
|
13035
|
+
return serveFallback(emitStatus("stale", stale.value, statusDetails({
|
|
12667
13036
|
staleAgeSec: stale.staleAgeSec,
|
|
12668
13037
|
cacheTier: "memory-stale",
|
|
12669
13038
|
error: errorInfo
|
|
12670
|
-
}));
|
|
13039
|
+
})));
|
|
12671
13040
|
}
|
|
12672
13041
|
}
|
|
12673
13042
|
const errorInfo = getRiverbankErrorInfo(error);
|
|
12674
13043
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, errorInfo) : null;
|
|
12675
13044
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
12676
|
-
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
13045
|
+
if (durableFallback?.kind === "hit") return serveFallback(durableFallback.result);
|
|
12677
13046
|
const prebuild = tryPrebuildFallback({
|
|
12678
13047
|
allowed: allowFallbacks,
|
|
12679
13048
|
preview: isPreview,
|
|
@@ -12682,7 +13051,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12682
13051
|
durableCache,
|
|
12683
13052
|
error: errorInfo
|
|
12684
13053
|
});
|
|
12685
|
-
if (prebuild) return prebuild;
|
|
13054
|
+
if (prebuild) return serveFallback(prebuild);
|
|
12686
13055
|
throw attachResilienceStatusToError(error, emitStatus("error", null, statusDetails({
|
|
12687
13056
|
error: errorInfo,
|
|
12688
13057
|
durableCache
|
|
@@ -13092,4 +13461,4 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13092
13461
|
};
|
|
13093
13462
|
}
|
|
13094
13463
|
//#endregion
|
|
13095
|
-
export { DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION as a,
|
|
13464
|
+
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 };
|