@riverbankcms/sdk 0.178.0 → 0.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/dist/_dts/{BlocksIslandsHydrator-CrKsXtpD.d.ts → BlocksIslandsHydrator-DKwgs95u.d.ts} +1 -1
- package/dist/_dts/{Page-C9i27wZA.d.ts → Page-lWenra5i.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DzGSR3jh.d.ts → SdkPreviewMode-BRxhRw4I.d.ts} +2 -2
- package/dist/_dts/{client-BnYN6XsH.d.ts → client-qWn7xAwJ.d.ts} +47 -17
- package/dist/_dts/{content-types-CXj6lp3d.d.ts → content-types-DL6GIvTm.d.ts} +2 -2
- package/dist/_dts/{contracts-BZLwkTwL.d.ts → contracts-CzWyAiJj.d.ts} +6 -116
- package/dist/_dts/{generatePageMetadata-ByEWwe9j.d.ts → generatePageMetadata-CBKd0cJ4.d.ts} +2 -2
- package/dist/_dts/{index-DCa-8TEY.d.ts → index-7CDBZGb-.d.ts} +1 -1
- package/dist/_dts/{index-CKDRr54L.d.ts → index-BU9uAkHB.d.ts} +4 -4
- package/dist/_dts/{index-D9-N1d9v.d.ts → index-BYnG_vF5.d.ts} +1 -1
- package/dist/_dts/{index-nnEdgc3Z.d.ts → index-CZgJrhzT.d.ts} +4 -2
- package/dist/_dts/{index-cTpvQg_Q.d.ts → index-CaCum9mM.d.ts} +2 -2
- package/dist/_dts/{index-0HFgCnGz.d.ts → index-DCiSHd-C.d.ts} +1 -1
- package/dist/_dts/{index-BE9dWIsr.d.ts → index-DVSipdrT.d.ts} +3 -3
- package/dist/_dts/{loadContent-DYkVV6w4.d.ts → loadContent-CPKbFQyq.d.ts} +15 -13
- package/dist/_dts/{request-B20VRWHH.d.ts → request-BjKBCS7t.d.ts} +1201 -335
- package/dist/_dts/{resolveBlockData-C_aK5GIS.d.ts → resolveBlockData-DupbMCup.d.ts} +8 -5
- package/dist/_dts/resolvePageContent-BqNyCHi8.d.ts +61 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +3 -3
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- 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 +7 -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 +16 -8
- 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/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 +7 -7
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +19 -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 +1 -1
- package/dist/_dts/serviceBookingOutline-YcsIjvn1.d.ts +582 -0
- package/dist/_dts/{types-rm2M4LGx.d.ts → types-B7e6Lmo5.d.ts} +3 -3
- package/dist/_dts/{types-CYcd15BQ.d.ts → types-BOxSq-Bq.d.ts} +8 -7
- package/dist/_dts/{types-CMZ5mkpv.d.ts → types-CT-KOxl_.d.ts} +5 -39
- package/dist/_dts/{validation-BSxnRhyy.d.ts → validation-Dz6qccue.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-D1n09bu-.mjs → BlocksIslandsHydrator-1XifJg6V.mjs} +17 -18
- package/dist/client/{BookingMailingListNote-DSD4gS96.mjs → BookingMailingListNote-BsbEgagJ.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-B57oGPcj.mjs → BookingQuestionFields-C8IbeLHj.mjs} +4 -4
- package/dist/client/{CalendarNavigationChevron-qXvsFYOg.mjs → CalendarNavigationChevron-Bbqij1XQ.mjs} +42 -9
- package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-Olvrwi3Z.mjs → DemoBookingPortalAccess-uA9H8LIL.mjs} +4 -4
- package/dist/client/{EventCalendar.client-DwFNFb-0.mjs → EventCalendar.client-yoSI77ov.mjs} +10 -10
- package/dist/client/{EventCombined.client-Ffu-aVOb.mjs → EventCombined.client-HeCNlliq.mjs} +10 -10
- package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
- package/dist/client/{EventItem-b8tVkNHA.mjs → EventItem-Duhk1vnF.mjs} +247 -7
- package/dist/client/{EventListWeekNavigation-BxnJW_Gf.mjs → EventListWeekNavigation-BiutEqPK.mjs} +1 -1
- package/dist/client/{EventListing.client-ViCnrNg4.mjs → EventListing.client-B5ln77jG.mjs} +3 -3
- package/dist/client/{EventListing.view-CdjiepMf.mjs → EventListing.view-hUDhNtMv.mjs} +203 -9
- package/dist/client/{EventRegistrationPayment-BVd70XkH.mjs → EventRegistrationPayment-DqtX1vB2.mjs} +189 -111
- package/dist/client/{Page-DqETUt-U.mjs → Page-ChJ2TGVk.mjs} +24314 -20226
- package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-DkFnbzf_.mjs → SiteTermsAgreementField-CDBU31xW.mjs} +3 -3
- package/dist/client/{StepIndicator-JO2PS03n.mjs → StepIndicator-2Dl9zon2.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement--EkA1ZQd.mjs → StepIndicator-JQA-VuEH.mjs} +12 -12
- package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
- package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
- package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
- package/dist/client/{accordion-XgNxl0Wg.mjs → accordion-B6SqU49k.mjs} +1 -1
- package/dist/client/{booking-form.client-ljJoDwuI.mjs → booking-form.client-DrEOjQ3N.mjs} +15 -15
- package/dist/client/{bookingForm-DtEHwY4W.mjs → bookingForm-drZBwEZW.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BHoMAcun.mjs → boxStyleClassNames-DEh45w16.mjs} +19 -19
- package/dist/client/{carousel-B3UhbFu7.mjs → carousel-C-YJliD-.mjs} +2 -2
- package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
- package/dist/client/{cart-DzOJfYOR.mjs → cart-acGFWK9R.mjs} +3 -3
- package/dist/client/{cart.client-DBG77v-5.mjs → cart.client-BzlOGP2j.mjs} +1 -1
- package/dist/client/{checkout-LmePoEgM.mjs → checkout-SEontwhy.mjs} +3 -3
- package/dist/client/{checkout.client-DmgZuLBT.mjs → checkout.client-C0Qvh-d4.mjs} +1 -1
- package/dist/client/{checkoutUrls-CMZI8o_V.mjs → checkoutUrls-yUKeq1N9.mjs} +1 -1
- package/dist/client/client.mjs +414 -319
- package/dist/client/{context-CJIz4FdL.mjs → context-DTrwaQtg.mjs} +2 -1
- package/dist/client/{dateFormatting-UoXqBh10.mjs → dateFormatting-Cg8E1r9l.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-6CgFZNvu.mjs → demoPortalMagicLink-D0kOJYOX.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-DaMo6len.mjs → enhanceHeaderSection-DyrpZ7ks.mjs} +4 -4
- package/dist/client/{event-registration.client-b6APrFQe.mjs → event-registration.client-RLZQWi2V.mjs} +13 -13
- package/dist/client/{eventCalendar-DJYz7yZf.mjs → eventCalendar-CphYnImh.mjs} +4 -4
- package/dist/client/{eventCombined-j9VCVgMW.mjs → eventCombined-BvqjASB_.mjs} +4 -4
- package/dist/client/{eventListing-DWgpGuFM.mjs → eventListing-BaNAoC_M.mjs} +4 -4
- package/dist/client/{eventRegistration-DCinRot3.mjs → eventRegistration-COMHoRl6.mjs} +4 -4
- package/dist/client/events-9LPvwbWp.mjs +28 -0
- package/dist/client/{form-BBBtRwvy.mjs → form-DyH2juYT.mjs} +3 -3
- package/dist/client/{form.client-CZeRQLGF.mjs → form.client-DBwzkB0M.mjs} +5 -5
- package/dist/client/{form.parts-DhGGv4_L.mjs → form.parts-CY4kX3mh.mjs} +3 -3
- package/dist/client/{formatDate-DVFVDcDW.mjs → formatDate-CTEN7gxW.mjs} +1 -1
- package/dist/client/gifting/client.mjs +6 -6
- package/dist/client/{gifting-Di9-SpwW.mjs → gifting-CIx4V378.mjs} +4 -4
- package/dist/client/{gifting.client-CjT5PrAZ.mjs → gifting.client-BEVPpzJM.mjs} +5 -5
- package/dist/client/{gifting.parts-ffP6mjMd.mjs → gifting.parts-VnORjnZK.mjs} +2 -2
- package/dist/client/{headerSection-jjAvtSZk.mjs → headerSection-DGcJfRS8.mjs} +2 -2
- package/dist/client/{lookSurfaces-C2VzJfyG.mjs → lookSurfaces-IqT_SVnX.mjs} +167 -85
- package/dist/client/{newsletter-form.client-D45frHoa.mjs → newsletter-form.client-BvEDkjiD.mjs} +6 -6
- package/dist/client/{shop.interactive-D7wky1GL.mjs → newsletter-form.interactive-DCO1lErD.mjs} +3975 -3975
- package/dist/client/{newsletter-form.parts-CHdg82ct.mjs → newsletter-form.parts-BIy4IUT3.mjs} +2 -2
- package/dist/client/{newsletterForm-tS465_vl.mjs → newsletterForm-CoTXDNFS.mjs} +3 -3
- package/dist/client/portal/client.mjs +9 -9
- package/dist/client/{product-detail.client-DIWSeW7P.mjs → product-detail.client-YHQ2aKX1.mjs} +1 -1
- package/dist/client/{product-list.client-BRf14h_e.mjs → product-list.client-DxoZw1vF.mjs} +1 -1
- package/dist/client/{productDetail-gxF5whea.mjs → productDetail-DjuFvkey.mjs} +3 -3
- package/dist/client/{productList-B9t0XJrN.mjs → productList-DE9GEFoZ.mjs} +3 -3
- package/dist/client/{propsDecoder-Db8wAmgr.mjs → propsDecoder-Cyag_HOs.mjs} +2 -48
- package/dist/client/{registry.server-Bn0gE0uP.mjs → registry.server-BPwV-0Pp.mjs} +10420 -9108
- package/dist/client/rendering/client.mjs +41 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +23 -2836
- package/dist/client/{richText-coerce-COnKrLO7.mjs → richText-coerce-NrRqDeOg.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-Bok1Oy50.mjs → routeIslandApiConfig-BWq5gKFK.mjs} +1 -1
- package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
- package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
- package/dist/client/{shop-D1oTPDxm.mjs → shop-C3wM0Hr4.mjs} +3 -3
- package/dist/client/{shop-commerce-DyMZLC0a.mjs → shop-commerce-34YvcpbX.mjs} +14 -14
- package/dist/client/{shop-commerce-store-FODNS63D.mjs → shop-commerce-store-B7xHksOs.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-C4xcmFzZ.mjs → shop-discount-apply.state-BiBnozfO.mjs} +2 -2
- package/dist/client/{shop.client-CRgRulfI.mjs → shop.client-C0v88nLd.mjs} +14 -14
- package/dist/client/{shopShared-Bd_hy9ZO.mjs → shopShared-Ct-BRNez.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{noop-D11X-B6n.mjs → src-CCtanNlD.mjs} +317 -342
- package/dist/client/{timetableModel-UlWfP1gh.mjs → timetableModel-lhE29TNT.mjs} +65 -11
- package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
- package/dist/client/{useAvailableSlots-D-qoooLy.mjs → useAvailableSlots-BelJviOT.mjs} +2 -2
- package/dist/client/useDiscountCodeUi-rQRE1-Ho.mjs +196 -0
- package/dist/client/{useEventPagination-CQH2e9sQ.mjs → useEventPagination-C4rS2Xxl.mjs} +8 -8
- package/dist/client/{view-bGU1ws-m.mjs → view-LJVHVqsy.mjs} +4 -4
- package/dist/client/{display-D1oVR5Eh.mjs → wizardSteps-CNDsxeJH.mjs} +8935 -8913
- package/dist/preview-next/before-render.mjs +4 -3
- package/dist/preview-next/client/{PageSectionToolbar-D-Le7O3o.mjs → PageSectionToolbar-C4TtBPN-.mjs} +3 -3
- package/dist/preview-next/client/{PreviewEditorSidebar-DNy5j_ce.mjs → PreviewEditorSidebar-D6fkE59-.mjs} +5 -5
- package/dist/preview-next/client/{PreviewEditorUI-CzJvgbqt.mjs → PreviewEditorUI-amcDlj0O.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-xhJ6ca1i.mjs → PreviewShell-DeQjx4zk.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BmYO1TdT.mjs → SdkPreviewModeRuntime-Cx0SXnoX.mjs} +5 -5
- package/dist/preview-next/client/{previewAssistantSlot-BN93X9o1.mjs → previewAssistantSlot-aqpU34WI.mjs} +627 -498
- package/dist/preview-next/client/{previewChromeRoot-C51RQseo.mjs → previewChromeRoot-D3Gy_Rs0.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-oeGquJM-.mjs → sdk-runtime-Dzx_RrN7.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BGTAcPud.mjs → siteStyleAccess-LHedw83e.mjs} +1 -1
- package/dist/preview-next/client/{useAutosaveStatus-BMGXjGZq.mjs → useAutosaveStatus-DpSd9aVk.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-CTDoR_gQ.mjs → useOpenBlockForSetup-BGZn5AT1.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BtdzkSUg.mjs → route-contract-DnL-FgSV.mjs} +28 -10
- package/dist/server/{Block.shared-Bp3OlOjj.mjs → Block.shared-BEbq6EwO.mjs} +4 -4
- package/dist/server/{bindings-DrbJuftt.mjs → bindings-Bly0dRs7.mjs} +36 -5
- package/dist/server/{client-Bf06n9oj.mjs → client-CGJ2ztYp.mjs} +1449 -1600
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
- package/dist/server/data/dataLoaderContext.mjs +1 -1
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
- package/dist/server/error-f4g44bKx.mjs +387 -0
- package/dist/server/index.mjs +3 -2
- package/dist/server/loadContent-BkK1w3QQ.mjs +692 -0
- package/dist/server/{loadPage-5iZefzDd.mjs → loadPage-DTLe0FEs.mjs} +22 -4
- package/dist/server/next.mjs +54 -94
- package/dist/server/{overrideResolution-CUHtm7tW.mjs → overrideResolution-Uy9Zp2Ks.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-GmPXForc.mjs → pageRenderPlan-JzxBnqfV.mjs} +7 -2
- package/dist/server/{pageRuntimeSupport-Dd8LFzfa.mjs → pageRuntimeSupport-DyNSd2Yj.mjs} +50 -2
- package/dist/server/{pageShared-tz-GVWft.mjs → pageShared-DU4ETFPS.mjs} +8 -50
- package/dist/server/{prebuild-JmsuYCIH.mjs → prebuild-8jNtDXmS.mjs} +5 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Ce9DDwON.mjs → prefetchBlockData-xeMG42aw.mjs} +3 -2
- package/dist/server/{registry-D12XF_h1.mjs → registry-DH1VrsCl.mjs} +122 -19
- 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 +5 -4
- package/dist/server/rendering.mjs +9 -8
- package/dist/server/{resolveBlockData-D9yZIN3V.mjs → resolveBlockData-BN8tweTx.mjs} +24 -5
- package/dist/server/resolvePageContent-DnM16_f9.mjs +89 -0
- package/dist/server/routing.mjs +271 -57
- package/dist/server/server.mjs +3 -3
- package/dist/server/{loadContent-eaTY7RPg.mjs → servicePageContent-B-FezJmH.mjs} +709 -453
- package/dist/server/{validation-CLq5cw6M.mjs → validation-3jOzYdPL.mjs} +3 -3
- package/dist/server/{version-oPbhAx8E.mjs → version-8t0o6_jd.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_dts/footerPageOutline-D_XbQW_o.d.ts +0 -256
- package/dist/_dts/resolvePageContent-YT6ndha1.d.ts +0 -162
- package/dist/client/LocationMapActions-CiMtl1Ha.mjs +0 -62
- package/dist/client/MapDrawingSvg-BCZa3dpf.mjs +0 -200
- package/dist/client/course-DBEU9IA9.mjs +0 -244
- package/dist/client/duration-Q6_QNgiv.mjs +0 -37
- package/dist/client/event-details.client-BwASwKIq.mjs +0 -53
- package/dist/client/eventDetails-BzGOVDI-.mjs +0 -13
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
- package/dist/client/useDiscountCodeUi-B9DODAkj.mjs +0 -237
- package/dist/client/view-DNX59QwM.mjs +0 -1372
- package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
package/dist/client/client.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { gs as parseSiteId } from "./wizardSteps-CNDsxeJH.mjs";
|
|
3
|
+
import { A as materializeEntriesMedia, C as siteBlockRenderContext, I as requireSdkTheme, M as RiverbankApiError, N as attachResilienceStatusToError, S as projectRenderablePageOutline, _ as loadContentFromContentResponse, b as buildSiteRenderSupport, ht as isSupportedLoaderEndpoint, k as prefetchBlockDataWithFailures, m as isPageContent, mt as encodePublicProductCategorySelector, t as Page, w as resolveSiteCustomBlocks, x as collectMediaAssetSidecar, y as buildRenderablePageOutline } from "./Page-ChJ2TGVk.mjs";
|
|
4
|
+
import { Jn as publicMapLocationParamsSchema } from "./registry.server-BPwV-0Pp.mjs";
|
|
5
5
|
import { t as BEFORE_BOOKING_QUESTIONS_ROUTE } from "./bookingQuestions-BHq83mzS.mjs";
|
|
6
|
-
import { t as restoreRuntimeResponse } from "./runtimeResponse-
|
|
6
|
+
import { t as restoreRuntimeResponse } from "./runtimeResponse-DtWSfWSZ.mjs";
|
|
7
7
|
import { useEffect, useState } from "react";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
/**
|
|
@@ -46,7 +46,6 @@ const PUBLIC_READ_CACHE_POLICIES = {
|
|
|
46
46
|
"public_memberships"
|
|
47
47
|
], "batch_only"),
|
|
48
48
|
getPublicMapLocation: availability(["public_events", "public_event_filters"], "batch_only"),
|
|
49
|
-
resolveEventSubroute: availability(["public_events", "public_event_filters"], "direct"),
|
|
50
49
|
listPublicRouteCandidates: content(["published_content"], "batch_only"),
|
|
51
50
|
listPublicTeamMembers: content(["public_team_members"]),
|
|
52
51
|
listPublicProducts: availability(["public_products"], "direct"),
|
|
@@ -674,6 +673,23 @@ function buildFetchPolicy(siteId, reads, freshnessSeconds) {
|
|
|
674
673
|
function buildPublicReadBatchFetchPolicy(siteId, reads) {
|
|
675
674
|
return buildFetchPolicy(siteId, reads, publicReadBatchFreshnessSeconds);
|
|
676
675
|
}
|
|
676
|
+
/** A page may depend on admission even when an ordinary CMS page won precedence. */
|
|
677
|
+
function buildPageReadCachePolicy(siteId, dependencies) {
|
|
678
|
+
return dependencies === "availability" ? {
|
|
679
|
+
tags: normalizeRevalidateTags([
|
|
680
|
+
...buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
|
|
681
|
+
...buildPublicReadFetchTags("listPublicEvents", { siteId }),
|
|
682
|
+
...buildPublicReadFetchTags("getPublicBookingService", { siteId })
|
|
683
|
+
]),
|
|
684
|
+
revalidate: 60
|
|
685
|
+
} : {
|
|
686
|
+
tags: buildCacheReadTags([TAG_TEMPLATES.siteRoutableContent], { siteId }),
|
|
687
|
+
revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
function pageReadDependencies(payload) {
|
|
691
|
+
return typeof payload === "object" && payload !== null && "dependencies" in payload && payload.dependencies === "content" ? "content" : "availability";
|
|
692
|
+
}
|
|
677
693
|
//#endregion
|
|
678
694
|
//#region ../api/src/sdkEntryReadEndpoints.ts
|
|
679
695
|
const SDK_ENTRY_READ_ENDPOINTS = {
|
|
@@ -2887,15 +2903,6 @@ const PUBLIC_EVENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
2887
2903
|
"resource:conflict",
|
|
2888
2904
|
"server:internal_error"
|
|
2889
2905
|
]
|
|
2890
|
-
},
|
|
2891
|
-
resolveEventSubroute: {
|
|
2892
|
-
path: "/public/sites/{siteId}/events/subroutes/resolve",
|
|
2893
|
-
method: "GET",
|
|
2894
|
-
revalidate: publicReadFreshnessSeconds("resolveEventSubroute"),
|
|
2895
|
-
tags: [TAG_TEMPLATES.publicEvents, "event-subroute"],
|
|
2896
|
-
auth: "public",
|
|
2897
|
-
responseKind: "json",
|
|
2898
|
-
errors: []
|
|
2899
2906
|
}
|
|
2900
2907
|
});
|
|
2901
2908
|
//#endregion
|
|
@@ -6101,6 +6108,14 @@ const API_ENDPOINTS$1 = {
|
|
|
6101
6108
|
responseKind: "json",
|
|
6102
6109
|
errors: []
|
|
6103
6110
|
},
|
|
6111
|
+
adminDeleteSupportTicketScreenshot: {
|
|
6112
|
+
path: "/admin/support/tickets/screenshot/delete",
|
|
6113
|
+
method: "POST",
|
|
6114
|
+
tags: ["admin", "support"],
|
|
6115
|
+
auth: "admin",
|
|
6116
|
+
responseKind: "json",
|
|
6117
|
+
errors: []
|
|
6118
|
+
},
|
|
6104
6119
|
mfaTotpEnroll: {
|
|
6105
6120
|
path: "/auth/mfa/totp/enroll",
|
|
6106
6121
|
method: "POST",
|
|
@@ -7102,6 +7117,7 @@ const API_ENDPOINTS$1 = {
|
|
|
7102
7117
|
responseKind: "json"
|
|
7103
7118
|
},
|
|
7104
7119
|
resolveRouteOutcome: {
|
|
7120
|
+
revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS,
|
|
7105
7121
|
path: "/sites/{siteId}/route-outcome",
|
|
7106
7122
|
method: "GET",
|
|
7107
7123
|
tags: [
|
|
@@ -8029,6 +8045,25 @@ const API_ENDPOINTS$1 = {
|
|
|
8029
8045
|
"bookings"
|
|
8030
8046
|
]
|
|
8031
8047
|
},
|
|
8048
|
+
listEventBookingTicketChoices: {
|
|
8049
|
+
errors: [],
|
|
8050
|
+
path: "/sites/{siteId}/bookings/event-attendees/{attendeeId}/ticket-choices",
|
|
8051
|
+
method: "GET",
|
|
8052
|
+
auth: "user",
|
|
8053
|
+
responseKind: "json"
|
|
8054
|
+
},
|
|
8055
|
+
changeEventBookingTickets: {
|
|
8056
|
+
errors: [],
|
|
8057
|
+
path: "/sites/{siteId}/bookings/event-attendees/{attendeeId}/change-tickets",
|
|
8058
|
+
method: "POST",
|
|
8059
|
+
auth: "user",
|
|
8060
|
+
responseKind: "json",
|
|
8061
|
+
tags: [
|
|
8062
|
+
"site-{siteId}",
|
|
8063
|
+
"event-attendee-{attendeeId}",
|
|
8064
|
+
"bookings"
|
|
8065
|
+
]
|
|
8066
|
+
},
|
|
8032
8067
|
restoreEventBooking: {
|
|
8033
8068
|
errors: [],
|
|
8034
8069
|
path: "/sites/{siteId}/bookings/event-attendees/{attendeeId}/restore",
|
|
@@ -10138,20 +10173,20 @@ function isApiError(result) {
|
|
|
10138
10173
|
function isApiSuccess(result) {
|
|
10139
10174
|
return result.success === true;
|
|
10140
10175
|
}
|
|
10141
|
-
function isRecord(value) {
|
|
10176
|
+
function isRecord$1(value) {
|
|
10142
10177
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10143
10178
|
}
|
|
10144
10179
|
function isFieldError(value) {
|
|
10145
|
-
return isRecord(value) && typeof value.field === "string" && typeof value.code === "string" && typeof value.message === "string" && (value.capacityOverride === void 0 || isCapacityOverrideRefusal(value.capacityOverride));
|
|
10180
|
+
return isRecord$1(value) && typeof value.field === "string" && typeof value.code === "string" && typeof value.message === "string" && (value.capacityOverride === void 0 || isCapacityOverrideRefusal(value.capacityOverride));
|
|
10146
10181
|
}
|
|
10147
10182
|
function fieldErrorsFromUnknown(value) {
|
|
10148
10183
|
if (!Array.isArray(value)) return null;
|
|
10149
10184
|
return value.every(isFieldError) ? value : null;
|
|
10150
10185
|
}
|
|
10151
10186
|
function extractEnvelopeErrorObject(body) {
|
|
10152
|
-
if (!isRecord(body)) return null;
|
|
10187
|
+
if (!isRecord$1(body)) return null;
|
|
10153
10188
|
const error = body.error;
|
|
10154
|
-
if (!isRecord(error)) return null;
|
|
10189
|
+
if (!isRecord$1(error)) return null;
|
|
10155
10190
|
if ("success" in body && body.success !== false) return null;
|
|
10156
10191
|
return error;
|
|
10157
10192
|
}
|
|
@@ -10275,6 +10310,163 @@ function resolveApiBaseUrl() {
|
|
|
10275
10310
|
return getCmsApiUrl();
|
|
10276
10311
|
}
|
|
10277
10312
|
//#endregion
|
|
10313
|
+
//#region ../api/src/pageReadResponseCache.ts
|
|
10314
|
+
var CacheProbeMiss = class extends Error {};
|
|
10315
|
+
/** Next has no response-dependent fetch TTL. Only the matching policy may store a page read. */
|
|
10316
|
+
var UncachedPageRead = class extends Error {
|
|
10317
|
+
constructor(snapshot) {
|
|
10318
|
+
super("Page read belongs to another cache policy");
|
|
10319
|
+
this.snapshot = snapshot;
|
|
10320
|
+
}
|
|
10321
|
+
};
|
|
10322
|
+
function isRecord(value) {
|
|
10323
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10324
|
+
}
|
|
10325
|
+
function isResolvedPage(page) {
|
|
10326
|
+
return page?.kind === "resolved" && typeof page.requestedPath === "string" && (page.dependencies === "content" || page.dependencies === "availability") && isRecord(page.result) && [
|
|
10327
|
+
"cms",
|
|
10328
|
+
"system_event",
|
|
10329
|
+
"system_service"
|
|
10330
|
+
].includes(String(page.result.kind));
|
|
10331
|
+
}
|
|
10332
|
+
function envelopePage(body) {
|
|
10333
|
+
const data = isRecord(body) && body.success === true && isRecord(body.data) ? body.data : null;
|
|
10334
|
+
return data?.type === "content" && isRecord(data.content) ? data.content : data;
|
|
10335
|
+
}
|
|
10336
|
+
function admit(snapshot) {
|
|
10337
|
+
try {
|
|
10338
|
+
const page = envelopePage(JSON.parse(snapshot.body));
|
|
10339
|
+
if (snapshot.status === 200 && isResolvedPage(page)) return {
|
|
10340
|
+
resolved: true,
|
|
10341
|
+
dependencies: page.dependencies
|
|
10342
|
+
};
|
|
10343
|
+
} catch {}
|
|
10344
|
+
return {
|
|
10345
|
+
resolved: false,
|
|
10346
|
+
dependencies: snapshot.status === 200 || snapshot.headers.some(([key, value]) => key === "x-riverbank-page-dependencies" && value === "availability") ? "availability" : "content"
|
|
10347
|
+
};
|
|
10348
|
+
}
|
|
10349
|
+
/** A scoped transport read is shared with Next's background refresh, never across requests. */
|
|
10350
|
+
function liveResponse(read) {
|
|
10351
|
+
const pending = /* @__PURE__ */ new Map();
|
|
10352
|
+
return () => {
|
|
10353
|
+
const existing = pending.get("response");
|
|
10354
|
+
if (existing) return existing;
|
|
10355
|
+
const response = read().then(async (value) => ({
|
|
10356
|
+
body: await value.text(),
|
|
10357
|
+
status: value.status,
|
|
10358
|
+
headers: [...value.headers.entries()],
|
|
10359
|
+
cachedAt: Date.now()
|
|
10360
|
+
}));
|
|
10361
|
+
pending.set("response", response);
|
|
10362
|
+
return response;
|
|
10363
|
+
};
|
|
10364
|
+
}
|
|
10365
|
+
/** Neutral probes do not register a policy; the chosen entry is then checked with its real tags. */
|
|
10366
|
+
async function readPolicy(input, probe = false) {
|
|
10367
|
+
const policy = buildPageReadCachePolicy(input.siteId, input.dependency);
|
|
10368
|
+
const revalidate = Math.min(policy.revalidate, input.maxAge ?? policy.revalidate);
|
|
10369
|
+
const snapshot = await input.cache(async () => {
|
|
10370
|
+
const snapshot = await input.read();
|
|
10371
|
+
const admission = admit(snapshot);
|
|
10372
|
+
if (!admission.resolved || admission.dependencies !== input.dependency) throw new UncachedPageRead(snapshot);
|
|
10373
|
+
return snapshot;
|
|
10374
|
+
}, [
|
|
10375
|
+
"page-read-envelope-v2",
|
|
10376
|
+
input.key,
|
|
10377
|
+
input.dependency
|
|
10378
|
+
], probe ? {
|
|
10379
|
+
revalidate: false,
|
|
10380
|
+
tags: []
|
|
10381
|
+
} : {
|
|
10382
|
+
...policy,
|
|
10383
|
+
revalidate
|
|
10384
|
+
})();
|
|
10385
|
+
if (Date.now() - snapshot.cachedAt < revalidate * 1e3) return snapshot;
|
|
10386
|
+
return probe ? null : input.read();
|
|
10387
|
+
}
|
|
10388
|
+
async function probePolicy(input) {
|
|
10389
|
+
return readPolicy({
|
|
10390
|
+
...input,
|
|
10391
|
+
read: async () => {
|
|
10392
|
+
throw new CacheProbeMiss();
|
|
10393
|
+
}
|
|
10394
|
+
}, true).catch((error) => {
|
|
10395
|
+
if (error instanceof CacheProbeMiss) return null;
|
|
10396
|
+
throw error;
|
|
10397
|
+
});
|
|
10398
|
+
}
|
|
10399
|
+
/** Read in a framework cache scope, but never store an unclassified or failed response. */
|
|
10400
|
+
async function readInCacheScope(cache, key, read) {
|
|
10401
|
+
try {
|
|
10402
|
+
return await cache(async () => {
|
|
10403
|
+
throw new UncachedPageRead(await read());
|
|
10404
|
+
}, ["page-read-live-v2", key], {
|
|
10405
|
+
revalidate: false,
|
|
10406
|
+
tags: []
|
|
10407
|
+
})();
|
|
10408
|
+
} catch (error) {
|
|
10409
|
+
if (error instanceof UncachedPageRead) return error.snapshot;
|
|
10410
|
+
throw error;
|
|
10411
|
+
}
|
|
10412
|
+
}
|
|
10413
|
+
async function selectResponse(input) {
|
|
10414
|
+
const candidate = await probePolicy({
|
|
10415
|
+
...input,
|
|
10416
|
+
dependency: "content"
|
|
10417
|
+
}) ?? await probePolicy({
|
|
10418
|
+
...input,
|
|
10419
|
+
dependency: "availability"
|
|
10420
|
+
});
|
|
10421
|
+
if (candidate) try {
|
|
10422
|
+
const checked = await readPolicy({
|
|
10423
|
+
...input,
|
|
10424
|
+
dependency: admit(candidate).dependencies
|
|
10425
|
+
});
|
|
10426
|
+
if (checked) return checked;
|
|
10427
|
+
} catch (error) {
|
|
10428
|
+
if (error instanceof UncachedPageRead) return storeResponse(input, error.snapshot);
|
|
10429
|
+
throw error;
|
|
10430
|
+
}
|
|
10431
|
+
return storeResponse(input, await readInCacheScope(input.cache, input.key, input.read));
|
|
10432
|
+
}
|
|
10433
|
+
async function storeResponse(input, snapshot) {
|
|
10434
|
+
const admission = admit(snapshot);
|
|
10435
|
+
try {
|
|
10436
|
+
return await readPolicy({
|
|
10437
|
+
...input,
|
|
10438
|
+
key: admission.resolved ? input.key : `${input.key}:refusal:${snapshot.status}`,
|
|
10439
|
+
dependency: admission.dependencies,
|
|
10440
|
+
read: async () => snapshot
|
|
10441
|
+
}) ?? snapshot;
|
|
10442
|
+
} catch (error) {
|
|
10443
|
+
if (error instanceof UncachedPageRead) return error.snapshot;
|
|
10444
|
+
throw error;
|
|
10445
|
+
}
|
|
10446
|
+
}
|
|
10447
|
+
async function cachePageReadResponse(input) {
|
|
10448
|
+
if (!input.cache) return input.read();
|
|
10449
|
+
const result = await selectResponse({
|
|
10450
|
+
...input,
|
|
10451
|
+
cache: input.cache,
|
|
10452
|
+
read: liveResponse(input.read)
|
|
10453
|
+
});
|
|
10454
|
+
return new Response(result.body, {
|
|
10455
|
+
status: result.status,
|
|
10456
|
+
headers: result.headers
|
|
10457
|
+
});
|
|
10458
|
+
}
|
|
10459
|
+
/** Result adapters use this for cache fallbacks that did not return through the HTTP transport. */
|
|
10460
|
+
async function observePageReadPolicy(cache, siteId, payload) {
|
|
10461
|
+
if (!cache) return;
|
|
10462
|
+
const dependency = pageReadDependencies(payload);
|
|
10463
|
+
await cache(async () => true, [
|
|
10464
|
+
"page-read-policy-v2",
|
|
10465
|
+
siteId,
|
|
10466
|
+
dependency
|
|
10467
|
+
], buildPageReadCachePolicy(siteId, dependency))();
|
|
10468
|
+
}
|
|
10469
|
+
//#endregion
|
|
10278
10470
|
//#region ../api/src/common/operationId.ts
|
|
10279
10471
|
const OPERATION_ID_HEADER = "X-Riverbank-Operation-Id";
|
|
10280
10472
|
z.uuid();
|
|
@@ -10345,18 +10537,9 @@ z.enum([
|
|
|
10345
10537
|
]);
|
|
10346
10538
|
//#endregion
|
|
10347
10539
|
//#region ../api/src/request.ts
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
if (revalidateTagResolved) return revalidateTag;
|
|
10352
|
-
revalidateTagResolved = true;
|
|
10353
|
-
if (typeof window !== "undefined") return null;
|
|
10354
|
-
try {
|
|
10355
|
-
revalidateTag = new Function("modulePath", "return require(modulePath)")("next/cache").revalidateTag ?? null;
|
|
10356
|
-
} catch {
|
|
10357
|
-
revalidateTag = null;
|
|
10358
|
-
}
|
|
10359
|
-
return revalidateTag;
|
|
10540
|
+
/** Preserve the returned dependency even when the SDK served a durable fallback. */
|
|
10541
|
+
function observePageReadResponse(adapter, siteId, payload) {
|
|
10542
|
+
return observePageReadPolicy(adapter?.cache ?? null, siteId, payload);
|
|
10360
10543
|
}
|
|
10361
10544
|
/**
|
|
10362
10545
|
* Generate a UUID, with fallback for environments where crypto.randomUUID isn't available.
|
|
@@ -10442,8 +10625,8 @@ function serializePathParam(endpoint, key, value) {
|
|
|
10442
10625
|
if (typeof value === "string") return value;
|
|
10443
10626
|
throw new Error(`Invalid path param for endpoint ${String(endpoint)}: ${key} must be a string`);
|
|
10444
10627
|
}
|
|
10445
|
-
function invalidateCacheTags(tags, params) {
|
|
10446
|
-
const resolved =
|
|
10628
|
+
function invalidateCacheTags(adapter, tags, params) {
|
|
10629
|
+
const resolved = adapter?.invalidateTag;
|
|
10447
10630
|
if (typeof window !== "undefined" || !resolved || !tags) return;
|
|
10448
10631
|
tags.forEach((tag) => {
|
|
10449
10632
|
let processedTag = tag;
|
|
@@ -10451,7 +10634,7 @@ function invalidateCacheTags(tags, params) {
|
|
|
10451
10634
|
processedTag = processedTag.replace(`{${key}}`, String(value));
|
|
10452
10635
|
});
|
|
10453
10636
|
try {
|
|
10454
|
-
resolved(processedTag
|
|
10637
|
+
resolved(processedTag);
|
|
10455
10638
|
} catch {}
|
|
10456
10639
|
});
|
|
10457
10640
|
}
|
|
@@ -10544,7 +10727,7 @@ function successJsonEnvelope(parsed, requestId) {
|
|
|
10544
10727
|
if (parsed && typeof parsed === "object" && "success" in parsed && typeof parsed.success === "boolean") return parsed;
|
|
10545
10728
|
return buildSuccessEnvelope(coerceResponse(parsed), requestId);
|
|
10546
10729
|
}
|
|
10547
|
-
function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersion } = {}) {
|
|
10730
|
+
function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersion, frameworkCache } = {}) {
|
|
10548
10731
|
return ({ endpoint, body, params, options = {} }) => {
|
|
10549
10732
|
const plan = buildApiRequestPlan({
|
|
10550
10733
|
endpoint,
|
|
@@ -10558,14 +10741,31 @@ function createApiResponseTransport(getHeaders = () => ({}), baseUrl, { sdkVersi
|
|
|
10558
10741
|
baseUrl: normalizeCmsApiBaseUrl(baseUrl ?? resolveApiBaseUrl()),
|
|
10559
10742
|
sdkVersion
|
|
10560
10743
|
});
|
|
10561
|
-
const fetchPromise =
|
|
10744
|
+
const fetchPromise = executeApiRequest(plan, endpoint, params, options, frameworkCache);
|
|
10562
10745
|
if (plan.cacheInvalidationTags) return fetchPromise.then((response) => {
|
|
10563
|
-
if (response.ok) invalidateCacheTags(plan.cacheInvalidationTags, params);
|
|
10746
|
+
if (response.ok) invalidateCacheTags(frameworkCache, plan.cacheInvalidationTags, params);
|
|
10564
10747
|
return response;
|
|
10565
10748
|
});
|
|
10566
10749
|
return fetchPromise;
|
|
10567
10750
|
};
|
|
10568
10751
|
}
|
|
10752
|
+
function isPublishedPageRead(endpoint, params, options) {
|
|
10753
|
+
return (endpoint === "getContentByPath" || endpoint === "resolveRouteOutcome") && params?.preview !== true && params?.preview !== "true" && options.cache !== "no-store";
|
|
10754
|
+
}
|
|
10755
|
+
function executeApiRequest(plan, endpoint, params, options, frameworkCache) {
|
|
10756
|
+
const inputParams = params;
|
|
10757
|
+
const { next: fetchPolicy, ...uncachedInit } = plan.init;
|
|
10758
|
+
return isPublishedPageRead(endpoint, inputParams, options) ? cachePageReadResponse({
|
|
10759
|
+
cache: frameworkCache?.cache ?? null,
|
|
10760
|
+
key: JSON.stringify([plan.url, [...new Headers(plan.init.headers).entries()]]),
|
|
10761
|
+
siteId: typeof inputParams?.siteId === "string" ? inputParams.siteId : "",
|
|
10762
|
+
maxAge: typeof fetchPolicy?.revalidate === "number" ? fetchPolicy.revalidate : void 0,
|
|
10763
|
+
read: () => fetch(plan.url, {
|
|
10764
|
+
...uncachedInit,
|
|
10765
|
+
cache: "no-store"
|
|
10766
|
+
})
|
|
10767
|
+
}) : fetch(plan.url, plan.init);
|
|
10768
|
+
}
|
|
10569
10769
|
const batchReadPolicyBodySchema = z.object({ requests: z.array(z.object({
|
|
10570
10770
|
endpoint: z.string(),
|
|
10571
10771
|
params: z.record(z.string(), z.unknown()).optional()
|
|
@@ -10599,10 +10799,12 @@ function batchReadRequestOptions(params, body, options) {
|
|
|
10599
10799
|
function publicReadRequestOptions(endpoint, params, body, options) {
|
|
10600
10800
|
if (endpoint === "batchBlockLoaders") return batchReadRequestOptions(params, body, options);
|
|
10601
10801
|
const preview = params?.preview === true || params?.preview === "true";
|
|
10602
|
-
|
|
10802
|
+
if (endpoint !== "getContentByPath" && endpoint !== "resolveRouteOutcome") return options;
|
|
10803
|
+
if (preview) return {
|
|
10603
10804
|
...options,
|
|
10604
10805
|
cache: "no-store"
|
|
10605
|
-
}
|
|
10806
|
+
};
|
|
10807
|
+
return options;
|
|
10606
10808
|
}
|
|
10607
10809
|
function assertResolvedEndpointPath(endpoint, url) {
|
|
10608
10810
|
const tokens = [...url.match(/\{[^}]+\}/g) ?? [], ...url.match(/(^|\/):([A-Za-z][A-Za-z0-9_]*)\b/g) ?? []];
|
|
@@ -10702,6 +10904,28 @@ function requireUsableCommitProjection(response, parsed) {
|
|
|
10702
10904
|
throw new ApiCommittedWriteNotice(pageCommitConfirmationEnvelopeSchema.parse(parsed).data);
|
|
10703
10905
|
}
|
|
10704
10906
|
//#endregion
|
|
10907
|
+
//#region src/rendering/hooks/loadHookSystemPage.ts
|
|
10908
|
+
/** Both client hooks use the admitted destination and require a renderable page. */
|
|
10909
|
+
async function loadHookSystemPage(params) {
|
|
10910
|
+
const content = await loadContentFromContentResponse(params);
|
|
10911
|
+
if (!isPageContent(content)) throw new Error("Expected a selected system page");
|
|
10912
|
+
return {
|
|
10913
|
+
...content,
|
|
10914
|
+
theme: requireSdkTheme(content.theme, params.siteId)
|
|
10915
|
+
};
|
|
10916
|
+
}
|
|
10917
|
+
function readHookPage(input) {
|
|
10918
|
+
const { client, siteId, path, preview } = input;
|
|
10919
|
+
return Promise.all([client.getSite({
|
|
10920
|
+
id: siteId,
|
|
10921
|
+
currentPath: path
|
|
10922
|
+
}), client.getPage({
|
|
10923
|
+
siteId,
|
|
10924
|
+
path,
|
|
10925
|
+
preview
|
|
10926
|
+
})]);
|
|
10927
|
+
}
|
|
10928
|
+
//#endregion
|
|
10705
10929
|
//#region src/rendering/hooks/usePage.ts
|
|
10706
10930
|
/**
|
|
10707
10931
|
* Client-side React hook to fetch page data.
|
|
@@ -10832,15 +11056,30 @@ function usePage(params) {
|
|
|
10832
11056
|
let cancelled = false;
|
|
10833
11057
|
async function fetchPage() {
|
|
10834
11058
|
try {
|
|
10835
|
-
const [site,
|
|
10836
|
-
|
|
10837
|
-
currentPath: path
|
|
10838
|
-
}), client.getPage({
|
|
11059
|
+
const [site, pageRead] = await readHookPage({
|
|
11060
|
+
client,
|
|
10839
11061
|
siteId,
|
|
10840
11062
|
path,
|
|
10841
11063
|
preview
|
|
10842
|
-
})
|
|
11064
|
+
});
|
|
10843
11065
|
if (cancelled) return;
|
|
11066
|
+
if (pageRead.result.kind !== "cms") {
|
|
11067
|
+
const content = await loadHookSystemPage({
|
|
11068
|
+
client,
|
|
11069
|
+
siteId,
|
|
11070
|
+
site,
|
|
11071
|
+
contentResponse: pageRead,
|
|
11072
|
+
preview
|
|
11073
|
+
});
|
|
11074
|
+
if (!cancelled) setResult({
|
|
11075
|
+
...content,
|
|
11076
|
+
loading: false,
|
|
11077
|
+
error: null,
|
|
11078
|
+
theme: content.theme
|
|
11079
|
+
});
|
|
11080
|
+
return;
|
|
11081
|
+
}
|
|
11082
|
+
const pageResponse = pageRead.result.content;
|
|
10844
11083
|
if ("entry" in pageResponse) throw new Error("This path resolves to a content entry, not a page. Use useContent() instead, which handles both pages and entries. For entries, useContent() returns the raw entry data for custom rendering.");
|
|
10845
11084
|
if ("pageSurface" in pageResponse) throw new Error("This path resolves to a page surface, not a page. Use useContent() instead, which handles pages, entries, and page surfaces.");
|
|
10846
11085
|
const success = await loadUsePageSuccess({
|
|
@@ -11062,15 +11301,31 @@ function useContent(params) {
|
|
|
11062
11301
|
let cancelled = false;
|
|
11063
11302
|
async function fetchContent() {
|
|
11064
11303
|
try {
|
|
11065
|
-
const [site,
|
|
11066
|
-
|
|
11067
|
-
currentPath: path
|
|
11068
|
-
}), client.getPage({
|
|
11304
|
+
const [site, pageRead] = await readHookPage({
|
|
11305
|
+
client,
|
|
11069
11306
|
siteId,
|
|
11070
11307
|
path,
|
|
11071
11308
|
preview
|
|
11072
|
-
})
|
|
11309
|
+
});
|
|
11073
11310
|
if (cancelled) return;
|
|
11311
|
+
if (pageRead.result.kind !== "cms") {
|
|
11312
|
+
const content = await loadHookSystemPage({
|
|
11313
|
+
client,
|
|
11314
|
+
siteId,
|
|
11315
|
+
site,
|
|
11316
|
+
contentResponse: pageRead,
|
|
11317
|
+
preview
|
|
11318
|
+
});
|
|
11319
|
+
if (!cancelled) setResult({
|
|
11320
|
+
...content,
|
|
11321
|
+
loading: false,
|
|
11322
|
+
error: null,
|
|
11323
|
+
entry: null,
|
|
11324
|
+
theme: content.theme
|
|
11325
|
+
});
|
|
11326
|
+
return;
|
|
11327
|
+
}
|
|
11328
|
+
const contentResponse = pageRead.result.content;
|
|
11074
11329
|
if (isEntryResponse(contentResponse)) {
|
|
11075
11330
|
setResult(projectEntrySuccess({
|
|
11076
11331
|
response: contentResponse,
|
|
@@ -11291,191 +11546,7 @@ var SimpleCache = class {
|
|
|
11291
11546
|
//#endregion
|
|
11292
11547
|
//#region src/request-options.ts
|
|
11293
11548
|
/** Every API client the SDK creates sends its version as `x-sdk-version`. */
|
|
11294
|
-
const sdkRequestOptions = { sdkVersion: "0.
|
|
11295
|
-
//#endregion
|
|
11296
|
-
//#region src/client/error.ts
|
|
11297
|
-
let _Symbol$for;
|
|
11298
|
-
_Symbol$for = Symbol.for("nodejs.util.inspect.custom");
|
|
11299
|
-
/**
|
|
11300
|
-
* Error thrown by SDK when API returns an error response
|
|
11301
|
-
*
|
|
11302
|
-
* @example
|
|
11303
|
-
* ```ts
|
|
11304
|
-
* try {
|
|
11305
|
-
* await client.getSite({ slug: 'my-site' });
|
|
11306
|
-
* } catch (error) {
|
|
11307
|
-
* if (error instanceof RiverbankApiError) {
|
|
11308
|
-
* console.log('Error code:', error.code);
|
|
11309
|
-
* console.log('Request ID:', error.requestId);
|
|
11310
|
-
*
|
|
11311
|
-
* if (error.isAuthError()) {
|
|
11312
|
-
* // Handle authentication error
|
|
11313
|
-
* }
|
|
11314
|
-
*
|
|
11315
|
-
* if (error.isValidationError() && error.fieldErrors) {
|
|
11316
|
-
* // Handle field-level validation errors
|
|
11317
|
-
* error.fieldErrors.forEach(fe => {
|
|
11318
|
-
* console.log(`${fe.field}: ${fe.message}`);
|
|
11319
|
-
* });
|
|
11320
|
-
* }
|
|
11321
|
-
*
|
|
11322
|
-
* // Check if error can be retried
|
|
11323
|
-
* if (error.isRetryable) {
|
|
11324
|
-
* const delay = error.retryAfterMs ?? 1000;
|
|
11325
|
-
* console.log(`Retrying after ${delay}ms...`);
|
|
11326
|
-
* }
|
|
11327
|
-
* }
|
|
11328
|
-
* }
|
|
11329
|
-
* ```
|
|
11330
|
-
*/
|
|
11331
|
-
var RiverbankApiError = class RiverbankApiError extends Error {
|
|
11332
|
-
constructor(apiError) {
|
|
11333
|
-
super(apiError.message);
|
|
11334
|
-
this.name = "RiverbankApiError";
|
|
11335
|
-
if ("cause" in apiError && apiError.cause) this.cause = apiError.cause;
|
|
11336
|
-
this.code = apiError.code;
|
|
11337
|
-
this.requestId = apiError.requestId;
|
|
11338
|
-
this.status = apiError.status;
|
|
11339
|
-
this.fieldErrors = apiError.fieldErrors;
|
|
11340
|
-
this.timestamp = apiError.timestamp;
|
|
11341
|
-
this.retryAfterMs = "retryAfterMs" in apiError ? apiError.retryAfterMs : void 0;
|
|
11342
|
-
this.isRetryable = this.computeRetryable();
|
|
11343
|
-
Object.setPrototypeOf(this, RiverbankApiError.prototype);
|
|
11344
|
-
}
|
|
11345
|
-
/**
|
|
11346
|
-
* Compute whether this error is retryable based on HTTP status code.
|
|
11347
|
-
* - 0 (network errors - no HTTP response): retryable
|
|
11348
|
-
* - 429 (rate limit): retryable
|
|
11349
|
-
* - 5xx (server errors): retryable
|
|
11350
|
-
* - 4xx (client errors, except 429): NOT retryable
|
|
11351
|
-
*/
|
|
11352
|
-
computeRetryable() {
|
|
11353
|
-
if (this.status === 0) return true;
|
|
11354
|
-
if (this.status === 429) return true;
|
|
11355
|
-
if (this.status >= 500) return true;
|
|
11356
|
-
return false;
|
|
11357
|
-
}
|
|
11358
|
-
/**
|
|
11359
|
-
* Check if this is a network error (no HTTP response received)
|
|
11360
|
-
*
|
|
11361
|
-
* Matches: network:connection_error, network:timeout, network:dns_error
|
|
11362
|
-
*/
|
|
11363
|
-
isNetworkError() {
|
|
11364
|
-
return this.code.startsWith("network:");
|
|
11365
|
-
}
|
|
11366
|
-
/**
|
|
11367
|
-
* Check if this error matches a specific error code
|
|
11368
|
-
*
|
|
11369
|
-
* @example
|
|
11370
|
-
* ```ts
|
|
11371
|
-
* if (error.is('auth:unauthenticated')) {
|
|
11372
|
-
* // Redirect to login
|
|
11373
|
-
* }
|
|
11374
|
-
* ```
|
|
11375
|
-
*/
|
|
11376
|
-
is(code) {
|
|
11377
|
-
return this.code === code;
|
|
11378
|
-
}
|
|
11379
|
-
/**
|
|
11380
|
-
* Check if this is an authentication or authorization error
|
|
11381
|
-
*
|
|
11382
|
-
* Matches: auth:unauthenticated, auth:token_expired, auth:token_invalid,
|
|
11383
|
-
* auth:forbidden, auth:mfa_required, auth:insufficient_permissions
|
|
11384
|
-
*/
|
|
11385
|
-
isAuthError() {
|
|
11386
|
-
return this.code.startsWith("auth:");
|
|
11387
|
-
}
|
|
11388
|
-
/**
|
|
11389
|
-
* Check if this is a validation error
|
|
11390
|
-
*
|
|
11391
|
-
* Matches: validation:invalid_input, validation:missing_field, validation:invalid_format
|
|
11392
|
-
*/
|
|
11393
|
-
isValidationError() {
|
|
11394
|
-
return this.code.startsWith("validation:");
|
|
11395
|
-
}
|
|
11396
|
-
/**
|
|
11397
|
-
* Check if this is a resource error (not found, conflict, etc.)
|
|
11398
|
-
*
|
|
11399
|
-
* Matches: resource:not_found, resource:already_exists, resource:conflict, resource:gone
|
|
11400
|
-
*/
|
|
11401
|
-
isResourceError() {
|
|
11402
|
-
return this.code.startsWith("resource:");
|
|
11403
|
-
}
|
|
11404
|
-
/**
|
|
11405
|
-
* Check if this is a rate limiting error
|
|
11406
|
-
*/
|
|
11407
|
-
isRateLimitError() {
|
|
11408
|
-
return this.code.startsWith("rate_limit:");
|
|
11409
|
-
}
|
|
11410
|
-
/**
|
|
11411
|
-
* Check if this is a billing/payment error
|
|
11412
|
-
*/
|
|
11413
|
-
isBillingError() {
|
|
11414
|
-
return this.code.startsWith("billing:");
|
|
11415
|
-
}
|
|
11416
|
-
/**
|
|
11417
|
-
* Check if this is a server error
|
|
11418
|
-
*/
|
|
11419
|
-
isServerError() {
|
|
11420
|
-
return this.code.startsWith("server:");
|
|
11421
|
-
}
|
|
11422
|
-
/**
|
|
11423
|
-
* Returns a human-readable string representation of the error.
|
|
11424
|
-
* Includes all key details for debugging.
|
|
11425
|
-
*
|
|
11426
|
-
* @example
|
|
11427
|
-
* "RiverbankApiError: Content keys cannot access preview content | Code: auth:forbidden | Status: 401 | RequestId: req-abc123"
|
|
11428
|
-
*/
|
|
11429
|
-
toString() {
|
|
11430
|
-
const parts = [`RiverbankApiError: ${this.message}`];
|
|
11431
|
-
if (this.code) parts.push(`Code: ${this.code}`);
|
|
11432
|
-
if (this.status) parts.push(`Status: ${this.status}`);
|
|
11433
|
-
if (this.requestId) parts.push(`RequestId: ${this.requestId}`);
|
|
11434
|
-
return parts.join(" | ");
|
|
11435
|
-
}
|
|
11436
|
-
/**
|
|
11437
|
-
* Custom Node.js inspect output for better console.log display.
|
|
11438
|
-
* This ensures that console.log(error) shows all relevant details
|
|
11439
|
-
* instead of just "[Object]" for nested properties.
|
|
11440
|
-
*/
|
|
11441
|
-
[_Symbol$for]() {
|
|
11442
|
-
return this.toDetailedString();
|
|
11443
|
-
}
|
|
11444
|
-
/**
|
|
11445
|
-
* Returns a detailed multi-line string for debugging.
|
|
11446
|
-
* Used by the Node.js inspect symbol for console output.
|
|
11447
|
-
*/
|
|
11448
|
-
toDetailedString() {
|
|
11449
|
-
const lines = [
|
|
11450
|
-
`RiverbankApiError: ${this.message}`,
|
|
11451
|
-
` Code: ${this.code}`,
|
|
11452
|
-
` Status: ${this.status}`,
|
|
11453
|
-
` RequestId: ${this.requestId}`,
|
|
11454
|
-
` Timestamp: ${this.timestamp}`
|
|
11455
|
-
];
|
|
11456
|
-
if (this.isRetryable) {
|
|
11457
|
-
lines.push(` Retryable: true`);
|
|
11458
|
-
if (this.retryAfterMs) lines.push(` RetryAfter: ${this.retryAfterMs}ms`);
|
|
11459
|
-
}
|
|
11460
|
-
if (this.fieldErrors && this.fieldErrors.length > 0) {
|
|
11461
|
-
lines.push(" FieldErrors:");
|
|
11462
|
-
this.fieldErrors.forEach((fe) => {
|
|
11463
|
-
lines.push(` - ${fe.field}: ${fe.message}`);
|
|
11464
|
-
});
|
|
11465
|
-
}
|
|
11466
|
-
return lines.join("\n");
|
|
11467
|
-
}
|
|
11468
|
-
};
|
|
11469
|
-
const resilienceStatusSymbol = Symbol.for("riverbankcms.sdk.resilienceStatus");
|
|
11470
|
-
function attachResilienceStatusToError(error, resilienceStatus) {
|
|
11471
|
-
const target = error !== null && (typeof error === "object" || typeof error === "function") ? error : new Error(typeof error === "string" || typeof error === "number" || typeof error === "boolean" || typeof error === "bigint" ? String(error) : "Unknown error");
|
|
11472
|
-
Object.defineProperty(target, resilienceStatusSymbol, {
|
|
11473
|
-
configurable: true,
|
|
11474
|
-
enumerable: false,
|
|
11475
|
-
value: resilienceStatus
|
|
11476
|
-
});
|
|
11477
|
-
return target;
|
|
11478
|
-
}
|
|
11549
|
+
const sdkRequestOptions = { sdkVersion: "0.179.0" };
|
|
11479
11550
|
//#endregion
|
|
11480
11551
|
//#region src/public-api/runtime.ts
|
|
11481
11552
|
const PUBLIC_ENDPOINT_NAMES = [
|
|
@@ -11496,7 +11567,6 @@ const PUBLIC_ENDPOINT_NAMES = [
|
|
|
11496
11567
|
"listPublicProducts",
|
|
11497
11568
|
"listPublicPasses",
|
|
11498
11569
|
"listPublicMemberships",
|
|
11499
|
-
"resolveEventSubroute",
|
|
11500
11570
|
"checkRedirect",
|
|
11501
11571
|
"getRoutableContent",
|
|
11502
11572
|
"getPublicRoutableContent",
|
|
@@ -11516,6 +11586,7 @@ const API_ENDPOINTS = Object.freeze({
|
|
|
11516
11586
|
responseKind: "json"
|
|
11517
11587
|
},
|
|
11518
11588
|
resolveRouteOutcome: {
|
|
11589
|
+
revalidate: PUBLIC_CONTENT_FRESHNESS_SECONDS,
|
|
11519
11590
|
path: "/sites/{siteId}/route-outcome",
|
|
11520
11591
|
method: "GET",
|
|
11521
11592
|
tags: [
|
|
@@ -11637,14 +11708,6 @@ const API_ENDPOINTS = Object.freeze({
|
|
|
11637
11708
|
auth: "public",
|
|
11638
11709
|
responseKind: "json"
|
|
11639
11710
|
},
|
|
11640
|
-
resolveEventSubroute: {
|
|
11641
|
-
path: "/public/sites/{siteId}/events/subroutes/resolve",
|
|
11642
|
-
method: "GET",
|
|
11643
|
-
revalidate: 60,
|
|
11644
|
-
tags: [TAG_TEMPLATES.publicEvents, "event-subroute"],
|
|
11645
|
-
auth: "public",
|
|
11646
|
-
responseKind: "json"
|
|
11647
|
-
},
|
|
11648
11711
|
checkRedirect: publicSiteReadDefinition(PUBLIC_READ_ENDPOINT_DEFINITIONS.checkRedirect)
|
|
11649
11712
|
});
|
|
11650
11713
|
function publicSiteReadDefinition(definition) {
|
|
@@ -11817,10 +11880,6 @@ const RUNTIME_CACHE_DURABILITY_OVERRIDES = {
|
|
|
11817
11880
|
kind: "live-only",
|
|
11818
11881
|
reason: "safety_sensitive_booking"
|
|
11819
11882
|
},
|
|
11820
|
-
resolveEventSubroute: {
|
|
11821
|
-
kind: "memory-only",
|
|
11822
|
-
reason: "durable_rollout_pending"
|
|
11823
|
-
},
|
|
11824
11883
|
checkRedirect: {
|
|
11825
11884
|
kind: "memory-only",
|
|
11826
11885
|
reason: "durable_rollout_pending"
|
|
@@ -11847,7 +11906,7 @@ function isTruthyParam(value) {
|
|
|
11847
11906
|
}
|
|
11848
11907
|
function isPreviewRequest(endpoint, params) {
|
|
11849
11908
|
if (endpoint === "getContentByPath") return isTruthyParam(params.preview);
|
|
11850
|
-
if (endpoint === "listPublishedEntries"
|
|
11909
|
+
if (endpoint === "listPublishedEntries") return params.stage === "preview";
|
|
11851
11910
|
return false;
|
|
11852
11911
|
}
|
|
11853
11912
|
function getEndpointFreshTtlSec(endpoint) {
|
|
@@ -12022,7 +12081,7 @@ async function readPageWithResilience(input, params) {
|
|
|
12022
12081
|
siteId
|
|
12023
12082
|
});
|
|
12024
12083
|
const cacheKey = publishedRuntimeCache?.cacheKey ?? `page:${siteId}:${path}:${preview}`;
|
|
12025
|
-
|
|
12084
|
+
const result = await input.resilientFetch(cacheKey, (requestSignal) => input.apiClient({
|
|
12026
12085
|
endpoint: "getContentByPath",
|
|
12027
12086
|
params: {
|
|
12028
12087
|
siteId,
|
|
@@ -12031,12 +12090,15 @@ async function readPageWithResilience(input, params) {
|
|
|
12031
12090
|
},
|
|
12032
12091
|
options: { signal: requestSignal }
|
|
12033
12092
|
}), {
|
|
12093
|
+
pageRead: { siteId },
|
|
12034
12094
|
preview,
|
|
12035
12095
|
signal,
|
|
12036
12096
|
publishedRuntimeCache,
|
|
12037
12097
|
cacheTags: buildSiteReadTags({ siteId }),
|
|
12038
12098
|
prebuildFallback: void 0
|
|
12039
12099
|
});
|
|
12100
|
+
if (!preview) await observePageReadResponse(input.frameworkCache, siteId, result.data);
|
|
12101
|
+
return result;
|
|
12040
12102
|
}
|
|
12041
12103
|
function createContentReadOperations(input) {
|
|
12042
12104
|
return {
|
|
@@ -12101,50 +12163,19 @@ function createPublicAppointmentReadOperations(deps) {
|
|
|
12101
12163
|
//#endregion
|
|
12102
12164
|
//#region src/client/publicEventReadOperations.ts
|
|
12103
12165
|
function createPublicEventReadOperations(deps) {
|
|
12104
|
-
async
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
const subjectId = subject.kind === "eventOffering" ? subject.eventOfferingId : subject.eventSeriesId;
|
|
12108
|
-
return deps.resilientFetchData("resolveEventSubroute", `${kind}:${siteId}:${subject.kind}:${subjectId}:${segment}:${preview ? "preview" : "published"}`, (requestSignal) => deps.apiClient({
|
|
12109
|
-
endpoint: "resolveEventSubroute",
|
|
12166
|
+
return { async listPublicEventCalendarWindow({ signal, ...params }) {
|
|
12167
|
+
return deps.resilientFetchData("listPublicEventCalendarWindow", `public-calendar-window:${JSON.stringify(params)}`, (requestSignal) => deps.apiClient({
|
|
12168
|
+
endpoint: "listPublicEventCalendarWindow",
|
|
12110
12169
|
params: {
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
subjectKind: subject.kind,
|
|
12114
|
-
subjectId,
|
|
12115
|
-
segment,
|
|
12116
|
-
stage: preview ? "preview" : "published"
|
|
12170
|
+
...params,
|
|
12171
|
+
limit: params.limit === void 0 ? void 0 : String(params.limit)
|
|
12117
12172
|
},
|
|
12118
12173
|
options: { signal: requestSignal }
|
|
12119
12174
|
}), {
|
|
12120
12175
|
signal,
|
|
12121
|
-
|
|
12122
|
-
cacheTags: buildPublicReadMemoryCacheTags("resolveEventSubroute", { siteId })
|
|
12176
|
+
cacheTags: buildPublicReadMemoryCacheTags("listPublicEventCalendarWindow", { siteId: params.siteId })
|
|
12123
12177
|
});
|
|
12124
|
-
}
|
|
12125
|
-
return {
|
|
12126
|
-
async listPublicEventCalendarWindow({ signal, ...params }) {
|
|
12127
|
-
return deps.resilientFetchData("listPublicEventCalendarWindow", `public-calendar-window:${JSON.stringify(params)}`, (requestSignal) => deps.apiClient({
|
|
12128
|
-
endpoint: "listPublicEventCalendarWindow",
|
|
12129
|
-
params: {
|
|
12130
|
-
...params,
|
|
12131
|
-
limit: params.limit === void 0 ? void 0 : String(params.limit)
|
|
12132
|
-
},
|
|
12133
|
-
options: { signal: requestSignal }
|
|
12134
|
-
}), {
|
|
12135
|
-
signal,
|
|
12136
|
-
cacheTags: buildPublicReadMemoryCacheTags("listPublicEventCalendarWindow", { siteId: params.siteId })
|
|
12137
|
-
});
|
|
12138
|
-
},
|
|
12139
|
-
async resolveEventOccurrence(params) {
|
|
12140
|
-
const response = await resolveEventSubroute(params, "event-occurrence");
|
|
12141
|
-
return { occurrence: response.subroute?.kind === "event-occurrence" ? response.subroute.occurrence : null };
|
|
12142
|
-
},
|
|
12143
|
-
async resolveEventRun(params) {
|
|
12144
|
-
const response = await resolveEventSubroute(params, "event-run");
|
|
12145
|
-
return { run: response.subroute?.kind === "event-run" ? response.subroute.run : null };
|
|
12146
|
-
}
|
|
12147
|
-
};
|
|
12178
|
+
} };
|
|
12148
12179
|
}
|
|
12149
12180
|
//#endregion
|
|
12150
12181
|
//#region src/client/combineAbortSignals.ts
|
|
@@ -12520,6 +12551,38 @@ function generateRequestId() {
|
|
|
12520
12551
|
function toRecord(value) {
|
|
12521
12552
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
12522
12553
|
}
|
|
12554
|
+
function adapterExceptionMessage(error) {
|
|
12555
|
+
return error instanceof Error ? error.message : String(error);
|
|
12556
|
+
}
|
|
12557
|
+
function publishedCacheLifetime(plan, payload) {
|
|
12558
|
+
if (plan.endpoint !== "getContentByPath" || pageReadDependencies(payload) !== "availability") return {
|
|
12559
|
+
freshTtlSec: plan.freshTtlSec,
|
|
12560
|
+
staleTtlSec: plan.staleTtlSec
|
|
12561
|
+
};
|
|
12562
|
+
const ttl = buildPageReadCachePolicy(plan.siteId ?? "", "availability").revalidate;
|
|
12563
|
+
return {
|
|
12564
|
+
freshTtlSec: ttl,
|
|
12565
|
+
staleTtlSec: ttl
|
|
12566
|
+
};
|
|
12567
|
+
}
|
|
12568
|
+
function reusableDurablePayload(plan, payload, freshness) {
|
|
12569
|
+
return plan.endpoint !== "getContentByPath" || pageReadDependencies(payload) !== "availability" || freshness === "fresh";
|
|
12570
|
+
}
|
|
12571
|
+
function memoryWritePolicy(pageRead, data, tags, cacheTTL) {
|
|
12572
|
+
if (!pageRead) return { tags };
|
|
12573
|
+
const dependency = pageReadDependencies(data);
|
|
12574
|
+
const policy = buildPageReadCachePolicy(pageRead.siteId, dependency);
|
|
12575
|
+
return {
|
|
12576
|
+
tags: policy.tags,
|
|
12577
|
+
...dependency === "availability" ? {
|
|
12578
|
+
ttl: Math.min(cacheTTL, policy.revalidate * 1e3),
|
|
12579
|
+
staleTtl: 0
|
|
12580
|
+
} : {}
|
|
12581
|
+
};
|
|
12582
|
+
}
|
|
12583
|
+
function isPageReadRefusal(pageRead, error) {
|
|
12584
|
+
return Boolean(pageRead) && error instanceof RiverbankApiError && error.status === 404;
|
|
12585
|
+
}
|
|
12523
12586
|
function getRuntimePayloadSiteId(value) {
|
|
12524
12587
|
const site = toRecord(value).site;
|
|
12525
12588
|
if (!site || typeof site !== "object" || Array.isArray(site)) return null;
|
|
@@ -12644,7 +12707,8 @@ function convertToTypedError(error) {
|
|
|
12644
12707
|
requestId: error.requestId,
|
|
12645
12708
|
timestamp: error.timestamp,
|
|
12646
12709
|
status: error.status,
|
|
12647
|
-
fieldErrors: error.fieldErrors
|
|
12710
|
+
fieldErrors: error.fieldErrors,
|
|
12711
|
+
tag: error.tag
|
|
12648
12712
|
});
|
|
12649
12713
|
if (error instanceof ApiRequestError && error.body && typeof error.body === "object") {
|
|
12650
12714
|
const body = error.body;
|
|
@@ -12711,8 +12775,8 @@ const defaultRiverbankClientDeps = {
|
|
|
12711
12775
|
* ```
|
|
12712
12776
|
*/
|
|
12713
12777
|
/**
|
|
12714
|
-
*
|
|
12715
|
-
*
|
|
12778
|
+
* Next's tagged cache owns normal reads; SDK memory remains an outage fallback by default.
|
|
12779
|
+
* Explicitly enabled admitted-page memory hits also register their returned framework policy.
|
|
12716
12780
|
*/
|
|
12717
12781
|
function isRunningInNextServer() {
|
|
12718
12782
|
return typeof window === "undefined" && typeof process !== "undefined" && Boolean(process.env.NEXT_RUNTIME);
|
|
@@ -12724,6 +12788,7 @@ function resolveMemoryCachePolicy(config) {
|
|
|
12724
12788
|
servesFreshMemoryHits: enabled ?? !isRunningInNextServer()
|
|
12725
12789
|
};
|
|
12726
12790
|
}
|
|
12791
|
+
const frameworkCacheInstallers = /* @__PURE__ */ new WeakMap();
|
|
12727
12792
|
function createRiverbankClient(config) {
|
|
12728
12793
|
return createRiverbankClientWithDeps(defaultRiverbankClientDeps, config);
|
|
12729
12794
|
}
|
|
@@ -12762,7 +12827,18 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12762
12827
|
keyType = "preview";
|
|
12763
12828
|
break;
|
|
12764
12829
|
}
|
|
12765
|
-
|
|
12830
|
+
function createApiClient(frameworkCache) {
|
|
12831
|
+
const requestOptions = frameworkCache ? {
|
|
12832
|
+
...sdkRequestOptions,
|
|
12833
|
+
frameworkCache
|
|
12834
|
+
} : sdkRequestOptions;
|
|
12835
|
+
return withDefaultHeaders(authConfig.type === "none" ? deps.createInternalAPIClient(config.baseUrl, requestOptions) : deps.createBearerAPIClient(authConfig.type === "api-key" ? authConfig.key : authConfig.token, config.baseUrl, requestOptions), config.defaultHeaders);
|
|
12836
|
+
}
|
|
12837
|
+
const framework = {
|
|
12838
|
+
adapter: config.frameworkCache,
|
|
12839
|
+
apiClient: createApiClient(config.frameworkCache)
|
|
12840
|
+
};
|
|
12841
|
+
const apiClient = (params) => framework.apiClient(params);
|
|
12766
12842
|
const cache = new SimpleCache({
|
|
12767
12843
|
maxSize: cacheMaxSize,
|
|
12768
12844
|
ttl: cacheTTL,
|
|
@@ -12813,7 +12889,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12813
12889
|
const result = await reader({
|
|
12814
12890
|
cacheKey: plan.cacheKey,
|
|
12815
12891
|
endpoint: plan.endpoint,
|
|
12816
|
-
payloadSchemaVersion:
|
|
12892
|
+
payloadSchemaVersion: 5
|
|
12817
12893
|
});
|
|
12818
12894
|
if (result.kind === "miss") return {
|
|
12819
12895
|
kind: "miss",
|
|
@@ -12829,6 +12905,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12829
12905
|
error: result.error
|
|
12830
12906
|
}
|
|
12831
12907
|
};
|
|
12908
|
+
if (!reusableDurablePayload(plan, result.payload, result.freshness)) return null;
|
|
12832
12909
|
return {
|
|
12833
12910
|
kind: "hit",
|
|
12834
12911
|
result: emitStatus(result.freshness === "fresh" ? "cache" : "stale", result.payload, statusDetails({
|
|
@@ -12844,7 +12921,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12844
12921
|
outcome: "error",
|
|
12845
12922
|
error: {
|
|
12846
12923
|
kind: "adapter_exception",
|
|
12847
|
-
message:
|
|
12924
|
+
message: adapterExceptionMessage(error)
|
|
12848
12925
|
}
|
|
12849
12926
|
}
|
|
12850
12927
|
};
|
|
@@ -12860,13 +12937,21 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12860
12937
|
normalizedParams: plan.normalizedParams,
|
|
12861
12938
|
payload,
|
|
12862
12939
|
siteId: plan.siteId ?? getRuntimePayloadSiteId(payload),
|
|
12863
|
-
|
|
12864
|
-
|
|
12865
|
-
payloadSchemaVersion: 4,
|
|
12940
|
+
...publishedCacheLifetime(plan, payload),
|
|
12941
|
+
payloadSchemaVersion: 5,
|
|
12866
12942
|
writeReason: "live_success"
|
|
12867
12943
|
});
|
|
12868
12944
|
} catch {}
|
|
12869
12945
|
}
|
|
12946
|
+
function tryPrebuildFallback(input) {
|
|
12947
|
+
const prebuild = input.allowed && !input.preview && input.fallback ? input.fallback() : null;
|
|
12948
|
+
return prebuild ? emitStatus("prebuild", prebuild.data, input.statusDetails({
|
|
12949
|
+
prebuildAgeSec: prebuild.prebuildAgeSec,
|
|
12950
|
+
cacheTier: "prebuild",
|
|
12951
|
+
durableCache: input.durableCache,
|
|
12952
|
+
error: input.error
|
|
12953
|
+
})) : null;
|
|
12954
|
+
}
|
|
12870
12955
|
async function resilientFetch(cacheKey, fetcher, options) {
|
|
12871
12956
|
const requestId = generateRequestId();
|
|
12872
12957
|
const startTime = Date.now();
|
|
@@ -12901,18 +12986,18 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12901
12986
|
}) : null;
|
|
12902
12987
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
12903
12988
|
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
|
|
12989
|
+
const prebuild = tryPrebuildFallback({
|
|
12990
|
+
allowed: allowFallbacks,
|
|
12991
|
+
preview: isPreview,
|
|
12992
|
+
fallback: options.prebuildFallback,
|
|
12993
|
+
statusDetails,
|
|
12994
|
+
durableCache,
|
|
12995
|
+
error: {
|
|
12996
|
+
code: "circuit_open",
|
|
12997
|
+
message: "Circuit breaker is open"
|
|
12998
|
+
}
|
|
12999
|
+
});
|
|
13000
|
+
if (prebuild) return prebuild;
|
|
12916
13001
|
const circuitState = circuitBreaker.getState();
|
|
12917
13002
|
emitStatus("error", null, statusDetails({
|
|
12918
13003
|
durableCache,
|
|
@@ -12944,10 +13029,11 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12944
13029
|
} catch (error) {
|
|
12945
13030
|
convertToTypedError(error);
|
|
12946
13031
|
}
|
|
12947
|
-
if (shouldWrite(cacheEnabled, options.force)) cache.set(cacheKey, data,
|
|
13032
|
+
if (shouldWrite(cacheEnabled, options.force)) cache.set(cacheKey, data, memoryWritePolicy(options.pageRead, data, options.cacheTags, cacheTTL));
|
|
12948
13033
|
if (allowFallbacks && !isPreview) await writePublishedRuntimeCache(options.publishedRuntimeCache, data);
|
|
12949
13034
|
return emitStatus("live", data, statusDetails());
|
|
12950
13035
|
} catch (error) {
|
|
13036
|
+
if (isPageReadRefusal(options.pageRead, error)) throw attachResilienceStatusToError(error, emitStatus("error", null, statusDetails({ error: getRiverbankErrorInfo(error) })).resilience);
|
|
12951
13037
|
if (resilienceEnabled && error instanceof Error) circuitBreaker.recordFailure(error);
|
|
12952
13038
|
if (allowFallbacks && !isPreview && staleIfError && cacheEnabled) {
|
|
12953
13039
|
const stale = cache.getStale(cacheKey);
|
|
@@ -12964,15 +13050,15 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12964
13050
|
const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(options.publishedRuntimeCache, statusDetails, errorInfo) : null;
|
|
12965
13051
|
const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
|
|
12966
13052
|
if (durableFallback?.kind === "hit") return durableFallback.result;
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
13053
|
+
const prebuild = tryPrebuildFallback({
|
|
13054
|
+
allowed: allowFallbacks,
|
|
13055
|
+
preview: isPreview,
|
|
13056
|
+
fallback: options.prebuildFallback,
|
|
13057
|
+
statusDetails,
|
|
13058
|
+
durableCache,
|
|
13059
|
+
error: errorInfo
|
|
13060
|
+
});
|
|
13061
|
+
if (prebuild) return prebuild;
|
|
12976
13062
|
throw attachResilienceStatusToError(error, emitStatus("error", null, statusDetails({
|
|
12977
13063
|
error: errorInfo,
|
|
12978
13064
|
durableCache
|
|
@@ -12985,7 +13071,10 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
12985
13071
|
const contentReads = createContentReadOperations({
|
|
12986
13072
|
apiClient,
|
|
12987
13073
|
resilientFetch,
|
|
12988
|
-
prebuildLoader
|
|
13074
|
+
prebuildLoader,
|
|
13075
|
+
get frameworkCache() {
|
|
13076
|
+
return framework.adapter;
|
|
13077
|
+
}
|
|
12989
13078
|
});
|
|
12990
13079
|
const eventReads = createPublicEventReadOperations({
|
|
12991
13080
|
apiClient,
|
|
@@ -13009,7 +13098,7 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13009
13098
|
prebuildFallback: prebuildLoader && !preview ? () => prebuildLoader.loadEntries(siteId, params) : void 0
|
|
13010
13099
|
}));
|
|
13011
13100
|
}
|
|
13012
|
-
|
|
13101
|
+
const client = {
|
|
13013
13102
|
async getSite(params) {
|
|
13014
13103
|
return (await contentReads.getSiteWithResilience(params)).data;
|
|
13015
13104
|
},
|
|
@@ -13376,6 +13465,12 @@ function createRiverbankClientWithDeps(deps, config) {
|
|
|
13376
13465
|
return config.baseUrl;
|
|
13377
13466
|
}
|
|
13378
13467
|
};
|
|
13468
|
+
frameworkCacheInstallers.set(client, (adapter) => {
|
|
13469
|
+
if (framework.adapter) return;
|
|
13470
|
+
framework.apiClient = createApiClient(adapter);
|
|
13471
|
+
framework.adapter = adapter;
|
|
13472
|
+
});
|
|
13473
|
+
return client;
|
|
13379
13474
|
}
|
|
13380
13475
|
//#endregion
|
|
13381
13476
|
export { Page, createRiverbankClient, isContentError, isContentLoading, isEntryContentResult, isPageContentResult, useContent, usePage };
|