@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/server/routing.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as pageReadMissReason, i as contentNotFound, n as contentFound, o as pageReadMissReasonFromError, r as contentLoadFailed, s as resolvePageContent, t as RiverbankContentLoadError } from "./resolvePageContent-DnM16_f9.mjs";
|
|
2
|
+
import { n as getRouteTemplatePrefix, r as parseRouteTemplate } from "./routeTemplate-AsKQwa47.mjs";
|
|
3
|
+
import { t as toRoutingInfo } from "./contentTypeResolver-B9vy8BrF.mjs";
|
|
2
4
|
//#region src/routing/checkRedirect.ts
|
|
3
5
|
/**
|
|
4
6
|
* Check if a path has a configured redirect rule
|
|
@@ -35,36 +37,24 @@ import { _ as toRoutingInfo, a as resolvePageContent, c as extractPotentialEntry
|
|
|
35
37
|
*/
|
|
36
38
|
async function checkRedirectForPath(params) {
|
|
37
39
|
const { client, siteId, path } = params;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const isPermanent = response.status === 301 || response.status === 308;
|
|
45
|
-
return {
|
|
46
|
-
hasRedirect: true,
|
|
47
|
-
redirect: {
|
|
48
|
-
destination: response.redirectTo,
|
|
49
|
-
permanent: isPermanent
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
hasRedirect: false,
|
|
55
|
-
redirect: null
|
|
56
|
-
};
|
|
57
|
-
} catch (error) {
|
|
58
|
-
console.warn("[checkRedirectForPath] Failed to check redirect", {
|
|
59
|
-
siteId,
|
|
60
|
-
path,
|
|
61
|
-
error: error instanceof Error ? error.message : String(error)
|
|
62
|
-
});
|
|
40
|
+
const response = await client.checkRedirect({
|
|
41
|
+
siteId,
|
|
42
|
+
path
|
|
43
|
+
});
|
|
44
|
+
if (response.redirectTo) {
|
|
45
|
+
const isPermanent = response.status === 301 || response.status === 308;
|
|
63
46
|
return {
|
|
64
|
-
hasRedirect:
|
|
65
|
-
redirect:
|
|
47
|
+
hasRedirect: true,
|
|
48
|
+
redirect: {
|
|
49
|
+
destination: response.redirectTo,
|
|
50
|
+
permanent: isPermanent
|
|
51
|
+
}
|
|
66
52
|
};
|
|
67
53
|
}
|
|
54
|
+
return {
|
|
55
|
+
hasRedirect: false,
|
|
56
|
+
redirect: null
|
|
57
|
+
};
|
|
68
58
|
}
|
|
69
59
|
//#endregion
|
|
70
60
|
//#region src/routing/resolveRoute.ts
|
|
@@ -115,11 +105,7 @@ async function resolveRoute(params) {
|
|
|
115
105
|
async function resolveRouteWithDeps(deps, params) {
|
|
116
106
|
const { client, siteId, path, preview = false } = params;
|
|
117
107
|
try {
|
|
118
|
-
|
|
119
|
-
siteId,
|
|
120
|
-
path,
|
|
121
|
-
preview
|
|
122
|
-
})) return {
|
|
108
|
+
return {
|
|
123
109
|
type: "page",
|
|
124
110
|
pageData: await deps.loadPage({
|
|
125
111
|
client,
|
|
@@ -129,30 +115,20 @@ async function resolveRouteWithDeps(deps, params) {
|
|
|
129
115
|
})
|
|
130
116
|
};
|
|
131
117
|
} catch (error) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
error: error instanceof Error ? error.message : String(error)
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
try {
|
|
139
|
-
const redirectResult = await checkRedirectForPath({
|
|
140
|
-
client,
|
|
141
|
-
siteId,
|
|
142
|
-
path
|
|
143
|
-
});
|
|
144
|
-
if (redirectResult.hasRedirect) return {
|
|
145
|
-
type: "redirect",
|
|
146
|
-
destination: redirectResult.redirect.destination,
|
|
147
|
-
permanent: redirectResult.redirect.permanent
|
|
148
|
-
};
|
|
149
|
-
} catch (redirectError) {
|
|
150
|
-
console.debug("[resolveRoute] Redirect check failed", {
|
|
151
|
-
path,
|
|
152
|
-
error: redirectError instanceof Error ? redirectError.message : String(redirectError)
|
|
153
|
-
});
|
|
118
|
+
const miss = pageReadMissReasonFromError(error);
|
|
119
|
+
if (miss === null) throw error;
|
|
120
|
+
if (miss !== "not_found" || preview) return { type: "not-found" };
|
|
154
121
|
}
|
|
155
|
-
|
|
122
|
+
const redirect = await checkRedirectForPath({
|
|
123
|
+
client,
|
|
124
|
+
siteId,
|
|
125
|
+
path
|
|
126
|
+
});
|
|
127
|
+
return redirect.hasRedirect ? {
|
|
128
|
+
type: "redirect",
|
|
129
|
+
destination: redirect.redirect.destination,
|
|
130
|
+
permanent: redirect.redirect.permanent
|
|
131
|
+
} : { type: "not-found" };
|
|
156
132
|
}
|
|
157
133
|
/**
|
|
158
134
|
* Batch resolve multiple routes in parallel
|
|
@@ -196,4 +172,242 @@ async function resolveRoutesWithDeps(paramsDeps, params) {
|
|
|
196
172
|
}));
|
|
197
173
|
}
|
|
198
174
|
//#endregion
|
|
199
|
-
|
|
175
|
+
//#region src/routing/contentRoutes.ts
|
|
176
|
+
/**
|
|
177
|
+
* Content route matching utilities.
|
|
178
|
+
*
|
|
179
|
+
* Derive route matching from SDK config to determine whether a URL path
|
|
180
|
+
* is a CMS page or a content entry, without duplicating route patterns.
|
|
181
|
+
*/
|
|
182
|
+
/**
|
|
183
|
+
* Extract the first path segment from each routable content type's routePattern.
|
|
184
|
+
*
|
|
185
|
+
* Use this when you already have a content type array and want the same prefix
|
|
186
|
+
* derivation behavior used by runtime routing helpers and generated config files.
|
|
187
|
+
*/
|
|
188
|
+
function getContentEntryPrefixesFromContentTypes(contentTypes) {
|
|
189
|
+
return contentTypes.filter((ct) => ct.hasPages && typeof ct.routePattern === "string").map((ct) => getRouteTemplatePrefix(parseRouteTemplate(ct.routePattern))).filter((prefix) => typeof prefix === "string");
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Extract the first path segment from each routable content type's routePattern.
|
|
193
|
+
*
|
|
194
|
+
* Useful for simple prefix-based routing decisions. For more precise matching
|
|
195
|
+
* that handles nested patterns, use `isContentEntryPath` instead.
|
|
196
|
+
*
|
|
197
|
+
* @param config - The SDK config object from defineConfig()
|
|
198
|
+
* @returns Array of first path segments from content type routePatterns
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* import { getContentEntryPrefixes } from '@riverbankcms/sdk/routing';
|
|
203
|
+
* import config from '../riverbank.config';
|
|
204
|
+
*
|
|
205
|
+
* // Config with routePatterns: '/blog/{slug}', '/work/projects/{slug}'
|
|
206
|
+
* const prefixes = getContentEntryPrefixes(config);
|
|
207
|
+
* // Returns ['blog', 'work']
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
function getContentEntryPrefixes(config) {
|
|
211
|
+
return getContentEntryPrefixesFromContentTypes(config.content?.contentTypes ?? []);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Check if a URL path matches any content entry route pattern.
|
|
215
|
+
*
|
|
216
|
+
* This is the core matching function that works with ContentTypeRoutingInfo[].
|
|
217
|
+
* Use this when you have resolved content types from the API or merged sources.
|
|
218
|
+
*
|
|
219
|
+
* **Note:** Content types are checked in array order. If multiple patterns
|
|
220
|
+
* could match a path, the first matching content type wins.
|
|
221
|
+
*
|
|
222
|
+
* @param contentTypes - Array of content type routing info
|
|
223
|
+
* @param path - URL path as string ('/blog/my-post') or segments ['blog', 'my-post']
|
|
224
|
+
* @returns Match result with content type and slug if matched
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* import { matchContentEntryPath } from '@riverbankcms/sdk/routing';
|
|
229
|
+
*
|
|
230
|
+
* const contentTypes = [
|
|
231
|
+
* { key: 'blog-post', hasPages: true, routePattern: '/blog/{slug}' },
|
|
232
|
+
* { key: 'project', hasPages: true, routePattern: '/work/projects/{slug}' },
|
|
233
|
+
* ];
|
|
234
|
+
*
|
|
235
|
+
* matchContentEntryPath(contentTypes, '/blog/my-post');
|
|
236
|
+
* // Returns { isEntry: true, contentType: 'blog-post', slug: 'my-post' }
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
function matchContentEntryPath(contentTypes, path) {
|
|
240
|
+
const segments = typeof path === "string" ? path.split("/").filter(Boolean) : path;
|
|
241
|
+
for (const ct of contentTypes) {
|
|
242
|
+
if (!ct.hasPages || !ct.routePattern) continue;
|
|
243
|
+
const match = matchRouteTemplate(segments, parseRouteTemplate(ct.routePattern));
|
|
244
|
+
if (match.matches) return {
|
|
245
|
+
isEntry: true,
|
|
246
|
+
contentType: ct.key,
|
|
247
|
+
slug: match.slug
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return { isEntry: false };
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Check if a URL path matches any content entry route pattern.
|
|
254
|
+
*
|
|
255
|
+
* Supports nested patterns like '/work/projects/{slug}'. Returns the matched
|
|
256
|
+
* content type key and extracted slug, useful for routing decisions.
|
|
257
|
+
*
|
|
258
|
+
* **Note:** Content types are checked in array order. If multiple patterns
|
|
259
|
+
* could match a path, the first matching content type wins. Order more specific
|
|
260
|
+
* patterns before generic ones in your config.
|
|
261
|
+
*
|
|
262
|
+
* @param config - The SDK config object from defineConfig()
|
|
263
|
+
* @param path - URL path as string ('/blog/my-post') or segments ['blog', 'my-post']
|
|
264
|
+
* @returns Match result with content type and slug if matched
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* import { isContentEntryPath } from '@riverbankcms/sdk/routing';
|
|
269
|
+
* import config from '../riverbank.config';
|
|
270
|
+
*
|
|
271
|
+
* // Simple pattern: '/blog/{slug}'
|
|
272
|
+
* isContentEntryPath(config, '/blog/my-post');
|
|
273
|
+
* // Returns { isEntry: true, contentType: 'blog-post', slug: 'my-post' }
|
|
274
|
+
*
|
|
275
|
+
* // Nested pattern: '/work/projects/{slug}'
|
|
276
|
+
* isContentEntryPath(config, '/work/projects/website-redesign');
|
|
277
|
+
* // Returns { isEntry: true, contentType: 'project', slug: 'website-redesign' }
|
|
278
|
+
*
|
|
279
|
+
* // Non-matching path
|
|
280
|
+
* isContentEntryPath(config, '/about');
|
|
281
|
+
* // Returns { isEntry: false }
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
function isContentEntryPath(config, path) {
|
|
285
|
+
return matchContentEntryPath((config.content?.contentTypes ?? []).map(toRoutingInfo), path);
|
|
286
|
+
}
|
|
287
|
+
function matchRouteTemplate(pathSegments, routeTemplate) {
|
|
288
|
+
switch (routeTemplate.kind) {
|
|
289
|
+
case "fixed-path": {
|
|
290
|
+
const fixedSegments = routeTemplate.path.split("/").filter(Boolean);
|
|
291
|
+
return { matches: fixedSegments.length === pathSegments.length && fixedSegments.every((segment, index) => pathSegments[index] === segment) };
|
|
292
|
+
}
|
|
293
|
+
case "fallback-slug":
|
|
294
|
+
if (pathSegments.length === 0) return { matches: false };
|
|
295
|
+
return {
|
|
296
|
+
matches: true,
|
|
297
|
+
slug: pathSegments.join("/")
|
|
298
|
+
};
|
|
299
|
+
case "slug-template": {
|
|
300
|
+
const { prefixSegments, suffixSegments } = routeTemplate;
|
|
301
|
+
const minimumSegments = prefixSegments.length + suffixSegments.length + 1;
|
|
302
|
+
if (pathSegments.length < minimumSegments) return { matches: false };
|
|
303
|
+
if (!prefixSegments.every((segment, index) => pathSegments[index] === segment)) return { matches: false };
|
|
304
|
+
const suffixOffset = pathSegments.length - suffixSegments.length;
|
|
305
|
+
if (!suffixSegments.every((segment, index) => pathSegments[suffixOffset + index] === segment)) return { matches: false };
|
|
306
|
+
const slugSegments = pathSegments.slice(prefixSegments.length, suffixOffset);
|
|
307
|
+
if (slugSegments.length === 0) return { matches: false };
|
|
308
|
+
return {
|
|
309
|
+
matches: true,
|
|
310
|
+
slug: slugSegments.join("/")
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/routing/segmentValidators.ts
|
|
317
|
+
/**
|
|
318
|
+
* Shared URL segment validators used by routing/subroute detection.
|
|
319
|
+
*/
|
|
320
|
+
/**
|
|
321
|
+
* Check if a string is a valid ISO date (YYYY-MM-DD)
|
|
322
|
+
*/
|
|
323
|
+
function isISODateString(str) {
|
|
324
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(str);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Check if a string is a valid UUID
|
|
328
|
+
*/
|
|
329
|
+
function isUUID(str) {
|
|
330
|
+
return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(str);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Check if a segment is a valid event occurrence segment (ISO date or UUID)
|
|
334
|
+
*/
|
|
335
|
+
function isValidSegment(segment) {
|
|
336
|
+
return isISODateString(segment) || isUUID(segment);
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/routing/entrySubroutes.ts
|
|
340
|
+
/**
|
|
341
|
+
* Parse a path into parent path and last segment.
|
|
342
|
+
* Returns null when no parent/segment split exists.
|
|
343
|
+
*/
|
|
344
|
+
function extractPotentialEntrySubroute(path) {
|
|
345
|
+
const lastSlash = path.lastIndexOf("/");
|
|
346
|
+
if (lastSlash <= 0) return null;
|
|
347
|
+
const segment = path.slice(lastSlash + 1);
|
|
348
|
+
const parentPath = path.slice(0, lastSlash);
|
|
349
|
+
if (!segment || !parentPath) return null;
|
|
350
|
+
return {
|
|
351
|
+
parentPath,
|
|
352
|
+
segment
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Detect entry subroute candidate using content type routing info (no API calls).
|
|
357
|
+
*
|
|
358
|
+
* This lets callers avoid loading parent content when the parent path doesn't match
|
|
359
|
+
* any content entry route pattern.
|
|
360
|
+
*/
|
|
361
|
+
function detectEntrySubrouteFromTypes(contentTypes, path) {
|
|
362
|
+
const parsed = extractPotentialEntrySubroute(path);
|
|
363
|
+
if (!parsed) return null;
|
|
364
|
+
const match = matchContentEntryPath(contentTypes, parsed.parentPath);
|
|
365
|
+
if (!match.isEntry || !match.contentType) return null;
|
|
366
|
+
const subroutes = contentTypes.find((ct) => ct.key === match.contentType)?.subroutes ?? [];
|
|
367
|
+
if (subroutes.length === 0) return null;
|
|
368
|
+
const matchedSubroute = subroutes.find((subroute) => isSegmentTypeMatch(parsed.segment, subroute.segmentType));
|
|
369
|
+
if (!matchedSubroute) return null;
|
|
370
|
+
return {
|
|
371
|
+
parentPath: parsed.parentPath,
|
|
372
|
+
segment: parsed.segment,
|
|
373
|
+
contentTypeKey: match.contentType,
|
|
374
|
+
kind: matchedSubroute.kind,
|
|
375
|
+
segmentType: matchedSubroute.segmentType,
|
|
376
|
+
precedence: matchedSubroute.precedence ?? "subroute-first"
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function isSegmentTypeMatch(segment, segmentType) {
|
|
380
|
+
if (segmentType === "uuid") return isUUID(segment);
|
|
381
|
+
if (segmentType === "iso-date") return isISODateString(segment);
|
|
382
|
+
if (segmentType === "uuid-or-date") return isValidSegment(segment);
|
|
383
|
+
return isSubrouteSlugSegment(segment);
|
|
384
|
+
}
|
|
385
|
+
function isSubrouteSlugSegment(segment) {
|
|
386
|
+
return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(segment);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Default eligibility predicate for entry subroute resolution.
|
|
390
|
+
*
|
|
391
|
+
* - `event`: segment must be event-like (date or UUID)
|
|
392
|
+
* - `null`: used by fallback probing; keep it strict and only allow event-like segments
|
|
393
|
+
* - others: not subroute-eligible
|
|
394
|
+
*/
|
|
395
|
+
function defaultShouldAttemptEntrySubroute(args) {
|
|
396
|
+
if (args.entryTypeKey === "event") return isValidSegment(args.segment) || isSubrouteSlugSegment(args.segment);
|
|
397
|
+
if (args.entryTypeKey === null) return isValidSegment(args.segment);
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Infer a known subroute kind when explicit routing metadata is unavailable.
|
|
402
|
+
*
|
|
403
|
+
* This is primarily used by SDK catch-all routing when local config does not
|
|
404
|
+
* yet expose `routing.subroutes`, allowing generic resolver usage without
|
|
405
|
+
* duplicating event-specific API calls.
|
|
406
|
+
*/
|
|
407
|
+
function inferKnownEntrySubrouteKind(args) {
|
|
408
|
+
if (args.entryTypeKey === "event" && isValidSegment(args.segment)) return "event-occurrence";
|
|
409
|
+
if (args.entryTypeKey === null && isValidSegment(args.segment)) return "event-occurrence";
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
//#endregion
|
|
413
|
+
export { RiverbankContentLoadError, checkRedirectForPath, contentFound, contentLoadFailed, contentNotFound, defaultShouldAttemptEntrySubroute, detectEntrySubrouteFromTypes, extractPotentialEntrySubroute, getContentEntryPrefixes, getContentEntryPrefixesFromContentTypes, inferKnownEntrySubrouteKind, isContentEntryPath, isISODateString, isUUID, isValidSegment, matchContentEntryPath, pageReadMissReason, pageReadMissReasonFromError, resolvePageContent, resolveRoute, resolveRoutes, toRoutingInfo };
|
package/dist/server/server.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createRiverbankClient } from "./client-
|
|
2
|
-
import { i as loadContent, n as isPageContent, r as isPageSurfaceContent, t as isEntryContent } from "./loadContent-
|
|
3
|
-
import { t as loadPage } from "./loadPage-
|
|
1
|
+
import { t as createRiverbankClient } from "./client-CGJ2ztYp.mjs";
|
|
2
|
+
import { i as loadContent, n as isPageContent, r as isPageSurfaceContent, t as isEntryContent } from "./loadContent-BkK1w3QQ.mjs";
|
|
3
|
+
import { t as loadPage } from "./loadPage-DTLe0FEs.mjs";
|
|
4
4
|
export { createRiverbankClient, isEntryContent, isPageContent, isPageSurfaceContent, loadContent, loadPage };
|