@riverbankcms/sdk 0.179.0 → 0.181.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 +2 -2
- package/dist/_dts/{BlocksIslandsHydrator-DKwgs95u.d.ts → BlocksIslandsHydrator-CVCasDPz.d.ts} +1 -1
- package/dist/_dts/{Page-lWenra5i.d.ts → Page-Dtj2Ui3S.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-BRxhRw4I.d.ts → SdkPreviewMode-D1f_60WW.d.ts} +3 -2
- package/dist/_dts/{client-qWn7xAwJ.d.ts → client-Chr9pNVW.d.ts} +288 -121
- package/dist/_dts/{content-types-DL6GIvTm.d.ts → content-types-kjccgopX.d.ts} +2 -2
- package/dist/_dts/{contracts-CzWyAiJj.d.ts → contracts-BodaiS00.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CBKd0cJ4.d.ts → generatePageMetadata-BS6kaJFp.d.ts} +2 -2
- package/dist/_dts/{index-DCiSHd-C.d.ts → index-Brl6_I2j.d.ts} +5 -4
- package/dist/_dts/{index-CaCum9mM.d.ts → index-CJkefwYh.d.ts} +2 -2
- package/dist/_dts/{index-7CDBZGb-.d.ts → index-D1WpKwQe.d.ts} +1 -1
- package/dist/_dts/{index-BU9uAkHB.d.ts → index-DG0OvBs0.d.ts} +8 -8
- package/dist/_dts/{index-BYnG_vF5.d.ts → index-Diqt0PvG.d.ts} +1 -1
- package/dist/_dts/{index-CZgJrhzT.d.ts → index-Dy50xUMK.d.ts} +2 -2
- package/dist/_dts/{loadContent-CPKbFQyq.d.ts → loadContent-BgxshKrA.d.ts} +7 -7
- package/dist/_dts/{request-BjKBCS7t.d.ts → request-CA0izds5.d.ts} +4561 -1390
- package/dist/_dts/{resolveBlockData-DupbMCup.d.ts → resolveBlockData-ChQmwEd3.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-BqNyCHi8.d.ts → resolvePageContent-BvGyvblj.d.ts} +1 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +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 +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
- package/dist/_dts/sdk/src/index.d.ts +104 -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 +84 -53
- 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 +43 -56
- package/dist/_dts/sdk/src/portal/index.d.ts +3 -18
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{serviceBookingOutline-YcsIjvn1.d.ts → serviceBookingOutline-BgFbJQhU.d.ts} +8 -7
- package/dist/_dts/{types-B7e6Lmo5.d.ts → types-CQrsP1x_.d.ts} +3 -3
- package/dist/_dts/{types-CT-KOxl_.d.ts → types-CgS3xLk8.d.ts} +7 -2
- package/dist/_dts/{types-BOxSq-Bq.d.ts → types-R65DKjPn.d.ts} +9 -8
- package/dist/_dts/{validation-Dz6qccue.d.ts → validation-6LTIbuBA.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-1XifJg6V.mjs → BlocksIslandsHydrator-DqZPz6oW.mjs} +19 -19
- package/dist/client/{BookingMailingListNote-BsbEgagJ.mjs → BookingMailingListNote-uWfR2kaG.mjs} +177 -70
- package/dist/client/{BookingQuestionFields-C8IbeLHj.mjs → BookingQuestionFields-CyNIKw6k.mjs} +23 -82
- package/dist/client/CalendarAction-D_Glwvz2.mjs +105 -0
- package/dist/client/{CalendarNavigationChevron-Bbqij1XQ.mjs → CalendarNavigationChevron-BGCX3zwG.mjs} +6 -6
- package/dist/client/{CheckboxChoice-BZPLCgTU.mjs → CheckboxChoice-C8i4NraK.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-uA9H8LIL.mjs → DemoBookingPortalAccess-DFLPyuqe.mjs} +18 -10
- package/dist/client/{EventCalendar.client-yoSI77ov.mjs → EventCalendar.client-zDL4-t-B.mjs} +10 -10
- package/dist/client/{EventCombined.client-HeCNlliq.mjs → EventCombined.client-uciDKLID.mjs} +60 -10
- package/dist/client/{EventEmbeddedCheckoutStep-BDnicDM6.mjs → EventEmbeddedCheckoutStep-BGkbUhuw.mjs} +1 -1
- package/dist/client/{EventItem-Duhk1vnF.mjs → EventItem-CwzrjcRw.mjs} +8 -7
- package/dist/client/{EventListWeekNavigation-BiutEqPK.mjs → EventListWeekNavigation-ChvcnPma.mjs} +1 -1
- package/dist/client/{EventListing.client-B5ln77jG.mjs → EventListing.client-DA57Qoyx.mjs} +3 -3
- package/dist/client/{EventListing.view-hUDhNtMv.mjs → EventListing.view-DZ0qMFF4.mjs} +8 -211
- package/dist/client/{EventRegistrationPayment-DqtX1vB2.mjs → EventRegistrationPayment-DSqCJL8E.mjs} +1657 -403
- package/dist/client/{Page-ChJ2TGVk.mjs → Page-C7mygH_f.mjs} +536 -287
- package/dist/client/{ProtectedSubmitButton-De6AzhE6.mjs → ProtectedSubmitButton-BNnKuir8.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-CDBU31xW.mjs → SiteTermsAgreementField-B4z-e4Wq.mjs} +27 -24
- package/dist/client/{StepIndicator-JQA-VuEH.mjs → StepIndicator-Dn_DY4oY.mjs} +1 -1
- package/dist/client/{StepIndicator-2Dl9zon2.mjs → StepIndicator-atfDU82W.mjs} +21 -13
- package/dist/client/{ThemedButton-CnSa7o-I.mjs → ThemedButton-PFOhXktM.mjs} +1 -33
- package/dist/client/{accessibleSurfaces-Wl8-_OVJ.mjs → accessibleSurfaces-n6kS6Hct.mjs} +77 -1
- package/dist/client/{accordion-B6SqU49k.mjs → accordion-CsW8U3ff.mjs} +1 -1
- package/dist/client/{booking-form.client-DrEOjQ3N.mjs → booking-form.client-cBWM392H.mjs} +442 -86
- package/dist/client/bookingCalendar--aWnqFDn.mjs +180 -0
- package/dist/client/{bookingForm-drZBwEZW.mjs → bookingForm-DgySpp6C.mjs} +4 -4
- package/dist/client/bookings.mjs +51 -15
- package/dist/client/{boxStyleClassNames-DEh45w16.mjs → boxStyleClassNames-BpGVdLFD.mjs} +2 -2
- package/dist/client/{carousel-C-YJliD-.mjs → carousel-DJoleFV3.mjs} +2 -2
- package/dist/client/{carousel.client-DMtGYTTM.mjs → carousel.client-BtLwHefX.mjs} +1 -1
- package/dist/client/{cart-acGFWK9R.mjs → cart-EO5o6uPH.mjs} +3 -3
- package/dist/client/{cart.client-BzlOGP2j.mjs → cart.client-D_gPw45z.mjs} +1 -1
- package/dist/client/{checkout-SEontwhy.mjs → checkout-NVfZW0kR.mjs} +3 -3
- package/dist/client/{checkout.client-C0Qvh-d4.mjs → checkout.client-DD3JuqOy.mjs} +1 -1
- package/dist/client/{checkoutUrls-yUKeq1N9.mjs → checkoutUrls-z2gXvlGw.mjs} +1 -1
- package/dist/client/client.mjs +306 -196
- package/dist/client/constants-CoOkvw__.mjs +100 -0
- package/dist/client/{context-DTrwaQtg.mjs → context-CRhn9qzS.mjs} +922 -388
- package/dist/client/{dateFormatting-Cg8E1r9l.mjs → dateFormatting-BnWB4L1s.mjs} +15 -25
- package/dist/client/{demoPortalMagicLink-D0kOJYOX.mjs → demoPortalMagicLink-CWDGSTBu.mjs} +2 -3
- package/dist/client/{enhanceHeaderSection-DyrpZ7ks.mjs → enhanceHeaderSection-tdP_-Z9o.mjs} +4 -5
- package/dist/client/{event-registration.client-RLZQWi2V.mjs → event-registration.client-D7YYKySQ.mjs} +2084 -1640
- package/dist/client/{eventCalendar-CphYnImh.mjs → eventCalendar-CsAfu5d0.mjs} +4 -4
- package/dist/client/{eventCombined-BvqjASB_.mjs → eventCombined-VXJB5CoS.mjs} +4 -4
- package/dist/client/{eventListing-BaNAoC_M.mjs → eventListing-B3KIZNfY.mjs} +4 -4
- package/dist/client/{eventRegistration-COMHoRl6.mjs → eventRegistration-BP-dEk1c.mjs} +4 -4
- package/dist/client/{form-DyH2juYT.mjs → form-DM8Zbxbv.mjs} +3 -3
- package/dist/client/{form.client-DBwzkB0M.mjs → form.client-e2z_Tlgk.mjs} +5 -5
- package/dist/client/{form.parts-CY4kX3mh.mjs → form.parts-Ctljy1a3.mjs} +3 -3
- package/dist/client/gifting/client.mjs +32 -29
- package/dist/client/{gifting-CIx4V378.mjs → gifting-DWIsqQru.mjs} +4 -4
- package/dist/client/{gifting.client-BEVPpzJM.mjs → gifting.client-QsSWF0uA.mjs} +5 -5
- package/dist/client/{gifting.parts-VnORjnZK.mjs → gifting.parts-CedLgwa_.mjs} +2 -2
- package/dist/client/{headerSection-DGcJfRS8.mjs → headerSection-DAkRkwb-.mjs} +2 -2
- package/dist/client/{mediaAssets-B99AP7ai.mjs → mediaAssets-COfQolI3.mjs} +1 -1
- package/dist/client/{mediaContext-Fusweriw.mjs → mediaContext-DzvnjYXm.mjs} +1 -1
- package/dist/client/{newsletter-form.client-BvEDkjiD.mjs → newsletter-form.client-WYja9-WN.mjs} +7 -7
- package/dist/client/{newsletter-form.interactive-DCO1lErD.mjs → newsletter-form.interactive-RuM86VAv.mjs} +37 -44
- package/dist/client/{newsletter-form.parts-BIy4IUT3.mjs → newsletter-form.parts-2petDnWv.mjs} +2 -2
- package/dist/client/{newsletterForm-CoTXDNFS.mjs → newsletterForm-BUbXdA_e.mjs} +3 -3
- package/dist/client/{lookSurfaces-IqT_SVnX.mjs → noop-Dl4mZ-rr.mjs} +257 -49
- package/dist/client/portal/client.mjs +11779 -6745
- package/dist/client/portalOrders-COGn4BKG.mjs +596 -0
- package/dist/client/portalRoutes-D72yvtDh.mjs +862 -0
- package/dist/client/{product-detail.client-YHQ2aKX1.mjs → product-detail.client-pOAryevt.mjs} +1 -1
- package/dist/client/{product-list.client-DxoZw1vF.mjs → product-list.client-CcUpUiud.mjs} +1 -1
- package/dist/client/{productDetail-DjuFvkey.mjs → productDetail-BZJCfqat.mjs} +3 -3
- package/dist/client/{productList-DE9GEFoZ.mjs → productList-CiRs3mNb.mjs} +3 -3
- package/dist/client/{propsDecoder-Cyag_HOs.mjs → propsDecoder--uHW4tFM.mjs} +2 -2
- package/dist/client/{registry.server-BPwV-0Pp.mjs → registry.server-CDNNd8wC.mjs} +318 -235
- package/dist/client/{renderableMediaAssetAdmission-BlfqYLJW.mjs → renderableMediaAssetAdmission-BsOWd9lf.mjs} +1 -1
- package/dist/client/rendering/client.mjs +26 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +16 -8
- package/dist/client/{richText-coerce-NrRqDeOg.mjs → richText-coerce-CQGE_wHV.mjs} +2 -1
- package/dist/client/{routeIslandApiConfig-BWq5gKFK.mjs → routeIslandApiConfig-BtCg87-N.mjs} +1 -1
- package/dist/client/{runtimeResponse-D2j2-mOk.mjs → runtimeResponse-DL_ARBpa.mjs} +1 -1
- package/dist/client/{runtimeResponse-DtWSfWSZ.mjs → runtimeResponse-Ds9cmBUf.mjs} +1 -1
- package/dist/client/{shop-C3wM0Hr4.mjs → shop-Rx_gEMK8.mjs} +3 -3
- package/dist/client/{shop-commerce-34YvcpbX.mjs → shop-commerce-D8evQnMT.mjs} +53 -16
- package/dist/client/{shop-commerce-store-B7xHksOs.mjs → shop-commerce-store-C9PcsSTj.mjs} +22 -5
- package/dist/client/{shop-discount-apply.state-BiBnozfO.mjs → shop-discount-apply.state-D5CtGfJI.mjs} +2 -2
- package/dist/client/{shop.client-C0v88nLd.mjs → shop.client-D4lzQ9oY.mjs} +17 -39
- package/dist/client/{shopShared-Ct-BRNez.mjs → shopShared-BVbq7Nm-.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/src-Al4ooTl_.mjs +164 -0
- package/dist/client/{src-CCtanNlD.mjs → src-ZSqRK3dD.mjs} +345 -92
- package/dist/client/{timetableModel-lhE29TNT.mjs → timetableModel-BQJrSK0K.mjs} +205 -80
- package/dist/client/{shop-add-feedback-DvC2kP1K.mjs → urlParams-C2QHo1Pa.mjs} +1 -42
- package/dist/client/{useAvailableSlots-BelJviOT.mjs → useAvailableSlots-Dm3lKJKR.mjs} +3 -24
- package/dist/client/{useDiscountCodeUi-rQRE1-Ho.mjs → useDiscountCodeUi-klgfGn7f.mjs} +1 -1
- package/dist/client/{useEventPagination-C4rS2Xxl.mjs → useEventPagination-Jnjt7_ly.mjs} +8 -8
- package/dist/client/{view-LJVHVqsy.mjs → view-CC_yQLSA.mjs} +4 -4
- package/dist/client/{wizardSteps-CNDsxeJH.mjs → wizardSteps-BliJOzEX.mjs} +2512 -675
- package/dist/preview-next/before-render.mjs +1 -0
- package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-C4TtBPN-.mjs → PageSectionToolbar-BhL0uADo.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-D6fkE59-.mjs → PreviewEditorSidebar-Ct8eIm0i.mjs} +8 -7
- package/dist/preview-next/client/{PreviewEditorUI-amcDlj0O.mjs → PreviewEditorUI-BS32G4V9.mjs} +5 -5
- package/dist/preview-next/client/{PreviewShell-DeQjx4zk.mjs → PreviewShell-RL0WfZXD.mjs} +7 -7
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Cx0SXnoX.mjs → SdkPreviewModeRuntime-MK_gHeGy.mjs} +39 -7
- package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
- package/dist/preview-next/client/{previewAssistantSlot-aqpU34WI.mjs → previewAssistantSlot-CQyS8pcq.mjs} +10318 -3719
- package/dist/preview-next/client/{previewChromeRoot-D3Gy_Rs0.mjs → previewChromeRoot-BSxp3Mfu.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-Dzx_RrN7.mjs → sdk-runtime-DKnTzy74.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-LHedw83e.mjs → siteStyleAccess-BlmbvbLN.mjs} +37 -25
- package/dist/preview-next/client/{useAutosaveStatus-DpSd9aVk.mjs → useAutosaveStatus-D-7GwZOQ.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-BGZn5AT1.mjs → useOpenBlockForSetup-BNZtGM5g.mjs} +2 -2
- package/dist/preview-next/container-responsive.css +292 -170
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-DnL-FgSV.mjs → route-contract-R3PcMmax.mjs} +114 -37
- package/dist/server/{Block.shared-BEbq6EwO.mjs → Block.shared-CniF9tSu.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQWsnGT6.mjs} +133 -120
- package/dist/server/{accessibleSurfaces-CM3QANtw.mjs → accessibleSurfaces-WPzUAHp4.mjs} +33 -2
- package/dist/server/accordions-By_0Ykks.mjs +111 -0
- package/dist/server/{bindings-Bly0dRs7.mjs → bindings-DxojjtK3.mjs} +7 -7
- package/dist/server/{client-CGJ2ztYp.mjs → client-CDndhbYO.mjs} +1412 -1307
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/constants-VyF5nEhL.mjs +1474 -0
- package/dist/server/{customCss-BZ8YSrQg.mjs → customCss-C9kgPHvr.mjs} +41 -5
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BkK1w3QQ.mjs → loadContent-BKstMBmX.mjs} +7 -4
- package/dist/server/{loadPage-DTLe0FEs.mjs → loadPage-IgNnZaqr.mjs} +3 -3
- package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-TFjgNG61.mjs} +74 -18
- package/dist/server/manifest.mjs +36 -25
- package/dist/server/{mapLocation-BM5WX7FY.mjs → mapLocation-MDDSubTp.mjs} +1 -1
- package/dist/server/media-BRmYrnzb.mjs +31 -0
- package/dist/server/{media-luf7RF22.mjs → media-gvfIw3z8.mjs} +2 -31
- package/dist/server/{navigation-BcNfYYuu.mjs → navigation-quBYlSKD.mjs} +2 -2
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +170 -104
- package/dist/server/{overrideResolution-Uy9Zp2Ks.mjs → overrideResolution-CCaAPpIa.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-JzxBnqfV.mjs → pageRenderPlan-B7iULvKe.mjs} +15 -12
- package/dist/server/{pageRuntimeSupport-DyNSd2Yj.mjs → pageRuntimeSupport-BytMroxn.mjs} +9 -5
- package/dist/server/{pageShared-DU4ETFPS.mjs → pageShared-Dcs_XTIO.mjs} +836 -624
- package/dist/server/{parseThemeForPersistence-DOsfofCy.mjs → parseThemeForPersistence-Bihl4W5K.mjs} +3 -2
- package/dist/server/{portal-B4JVkdjc.mjs → portal-CMW_b9mG.mjs} +62 -46
- package/dist/server/portal.mjs +3 -3
- package/dist/server/portalQuestions-oUyohgL9.mjs +225 -0
- package/dist/server/{prebuild-8jNtDXmS.mjs → prebuild-agaH-vZV.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-xeMG42aw.mjs → prefetchBlockData-DwpRjqw4.mjs} +5 -3
- package/dist/server/{registry-DH1VrsCl.mjs → registry-DM9dHfDC.mjs} +582 -526
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +10 -9
- package/dist/server/{resolveBlockData-BN8tweTx.mjs → resolveBlockData-CinHGf8l.mjs} +39 -31
- package/dist/server/{resolveButtonColourStates--6yJp9Tq.mjs → resolveButtonColourStates-B0O1IM16.mjs} +2 -1028
- package/dist/server/{resolvePageContent-DnM16_f9.mjs → resolvePageContent-BWKUZUIn.mjs} +1 -1
- package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-IfH65QAH.mjs} +57 -2
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-BpsqaSSU.mjs → schema-CwfxQjc4.mjs} +10 -113
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-B-FezJmH.mjs → servicePageContent-BBBhOtdE.mjs} +31 -26
- package/dist/server/theme-bridge.mjs +3 -2
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-39SXCCnh.mjs → three-pass-converter-DPaUPTfl.mjs} +34 -16
- package/dist/server/titleSourceSchema-NhK6azFS.mjs +2018 -0
- package/dist/server/typeGuards-CTW_9AXq.mjs +413 -0
- package/dist/server/types-BKaBZFjD.mjs +1085 -0
- package/dist/server/{validation-3jOzYdPL.mjs → validation-DG5jX3jH.mjs} +70 -17
- package/dist/server/{version-8t0o6_jd.mjs → version-CipbxPHL.mjs} +1 -1
- package/dist/server/video-Cdr3wh-q.mjs +272 -0
- package/dist/styles/index.css +3446 -3796
- package/package.json +2 -1
- package/dist/_dts/index-DVSipdrT.d.ts +0 -101
- package/dist/client/TabBarFragment-DlKQRhP4.mjs +0 -56
- package/dist/client/checkoutRoute-DKlZRNZD.mjs +0 -22
- package/dist/client/constants-4o4_hl34.mjs +0 -6
- package/dist/client/creditProducts-BQ1t1erI.mjs +0 -266
- package/dist/client/formatDate-CTEN7gxW.mjs +0 -26
- package/dist/server/constants-Cj7hfbrA.mjs +0 -41
- package/dist/server/richTextSchema-QLaQrbII.mjs +0 -212
- package/dist/server/titleSourceSchema-Cu-3PRvv.mjs +0 -122
|
@@ -1,12 +1,114 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { m as ok, p as err } from "./renderableMediaAssetAdmission-BsOWd9lf.mjs";
|
|
3
|
+
import { Dn as parsePositiveCents, Tt as normalizeCurrencyCode, _t as unknownKind, c as blockSiteTermsSchema, ft as bookingQuestionsDocumentAnswerValueSchema, gt as exactSchema, ht as evolvingSchema, k as beforeBookingQuestionsPresentationSchema, kn as toNonNegativeCents, m as calendarWindowPageSchema, pt as bookingQuestionsTaskDetailSchema, v as publicPassProductCollectionSchema } from "./src-ZSqRK3dD.mjs";
|
|
3
4
|
import { t as stableJsonStringify } from "./stable-json-D0XAEIXc.mjs";
|
|
5
|
+
import { C as customerProfileSchema, E as eventTicketBreakdownLineSchema, S as portalCreditSchema, T as eventGuestSchema, b as customerPassSchema, d as verifiedSiteTermsAcceptanceSchema, n as customerOrderSchema, s as cancelledMoneySchema, v as customerMembershipSchema, w as enabledModulesSchema } from "./portalOrders-COGn4BKG.mjs";
|
|
4
6
|
import { t as BEFORE_BOOKING_QUESTIONS_ROUTE } from "./bookingQuestions-BHq83mzS.mjs";
|
|
5
7
|
import { t as EVENT_BOOKING_RESPONSE_QUERY } from "./events-9LPvwbWp.mjs";
|
|
6
8
|
import { n as submissionProof } from "./protection-C0PoH1lT.mjs";
|
|
7
9
|
import { createContext, useContext, useMemo } from "react";
|
|
8
10
|
import { jsx } from "react/jsx-runtime";
|
|
9
11
|
import { z } from "zod";
|
|
12
|
+
//#region ../site-contracts/src/siteData/eventSelectionFunding.ts
|
|
13
|
+
/**
|
|
14
|
+
* How a date booking can be paid: money alone, or one pass or membership covering the dates it can,
|
|
15
|
+
* with money for the rest. The server plans it (`planSelectionFunding` in @riverbankcms/bookings) and
|
|
16
|
+
* the block renders what it's sent. One date is the one-date case.
|
|
17
|
+
*/
|
|
18
|
+
const id = z.string().min(1);
|
|
19
|
+
const ids = z.tuple([id]).rest(id).readonly();
|
|
20
|
+
const eventFundingSourceSchema = z.discriminatedUnion("kind", [
|
|
21
|
+
z.object({
|
|
22
|
+
kind: z.literal("ownedPass"),
|
|
23
|
+
passId: id
|
|
24
|
+
}),
|
|
25
|
+
z.object({
|
|
26
|
+
kind: z.literal("ownedMembership"),
|
|
27
|
+
membershipId: id
|
|
28
|
+
}),
|
|
29
|
+
z.object({
|
|
30
|
+
kind: z.literal("buyPass"),
|
|
31
|
+
productId: id
|
|
32
|
+
}),
|
|
33
|
+
z.object({
|
|
34
|
+
kind: z.literal("buyMembership"),
|
|
35
|
+
productId: id
|
|
36
|
+
})
|
|
37
|
+
]);
|
|
38
|
+
const eventSelectionFundingPickSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("money") }), z.object({
|
|
39
|
+
kind: z.literal("entitlement"),
|
|
40
|
+
source: eventFundingSourceSchema
|
|
41
|
+
})]);
|
|
42
|
+
const uncoveredReason = z.enum([
|
|
43
|
+
"not_started",
|
|
44
|
+
"ends_before",
|
|
45
|
+
"membership_ended",
|
|
46
|
+
"already_used_on_date",
|
|
47
|
+
"no_credits_left"
|
|
48
|
+
]);
|
|
49
|
+
const cents$1 = z.number().int().nonnegative();
|
|
50
|
+
const credits = z.object({
|
|
51
|
+
used: z.number().int().nonnegative(),
|
|
52
|
+
leftAfter: z.number().int().nonnegative()
|
|
53
|
+
});
|
|
54
|
+
const entitlementSchema = z.discriminatedUnion("kind", [
|
|
55
|
+
z.object({
|
|
56
|
+
kind: z.literal("ownedPass"),
|
|
57
|
+
passId: id,
|
|
58
|
+
name: z.string(),
|
|
59
|
+
credits,
|
|
60
|
+
expiresAt: z.string().nullable()
|
|
61
|
+
}),
|
|
62
|
+
z.object({
|
|
63
|
+
kind: z.literal("ownedMembership"),
|
|
64
|
+
membershipId: id,
|
|
65
|
+
name: z.string(),
|
|
66
|
+
endsAt: z.string().nullable()
|
|
67
|
+
}),
|
|
68
|
+
z.object({
|
|
69
|
+
kind: z.literal("buyPass"),
|
|
70
|
+
productId: id,
|
|
71
|
+
name: z.string(),
|
|
72
|
+
priceCents: cents$1,
|
|
73
|
+
credits: credits.extend({ total: z.number().int().positive() }),
|
|
74
|
+
expiresAt: z.string().nullable()
|
|
75
|
+
}),
|
|
76
|
+
z.object({
|
|
77
|
+
kind: z.literal("buyMembership"),
|
|
78
|
+
productId: id,
|
|
79
|
+
name: z.string(),
|
|
80
|
+
priceCents: cents$1,
|
|
81
|
+
interval: z.enum(["month", "year"])
|
|
82
|
+
})
|
|
83
|
+
]);
|
|
84
|
+
const moneySchema = z.object({
|
|
85
|
+
totalCents: cents$1,
|
|
86
|
+
currency: z.string().min(1)
|
|
87
|
+
});
|
|
88
|
+
const optionSchema$1 = z.discriminatedUnion("kind", [z.object({
|
|
89
|
+
kind: z.literal("money"),
|
|
90
|
+
moneyDates: ids,
|
|
91
|
+
money: moneySchema
|
|
92
|
+
}), z.object({
|
|
93
|
+
kind: z.literal("entitlement"),
|
|
94
|
+
entitlement: entitlementSchema,
|
|
95
|
+
covered: ids,
|
|
96
|
+
/** The option's money dates, earliest first. */
|
|
97
|
+
uncovered: z.array(z.object({
|
|
98
|
+
occurrenceId: id,
|
|
99
|
+
reason: uncoveredReason
|
|
100
|
+
})).readonly(),
|
|
101
|
+
money: moneySchema
|
|
102
|
+
})]);
|
|
103
|
+
const eventSelectionFundingSchema = z.object({
|
|
104
|
+
/** Money first, then passes and memberships in the order to show them. */
|
|
105
|
+
options: z.tuple([optionSchema$1]).rest(optionSchema$1).readonly(),
|
|
106
|
+
/** The option to select: the first pass or membership, or money; after a refusal, the nearest to the customer's pick. */
|
|
107
|
+
selected: eventSelectionFundingPickSchema,
|
|
108
|
+
/** `severalPlaces` when passes and memberships are left out because more than one place is booked. */
|
|
109
|
+
entitlementNote: z.enum(["none", "severalPlaces"])
|
|
110
|
+
});
|
|
111
|
+
//#endregion
|
|
10
112
|
//#region ../commerce/src/purchase/confirmationPaymentSchema.ts
|
|
11
113
|
const settledBalanceSchema = z.object({ kind: z.literal("settled") });
|
|
12
114
|
const dueBalanceSchema = z.object({
|
|
@@ -83,6 +185,18 @@ const confirmationPaymentSchema = z.discriminatedUnion("kind", [
|
|
|
83
185
|
balance: paymentBalanceSchema
|
|
84
186
|
})
|
|
85
187
|
]);
|
|
188
|
+
/** What the order took, by card and account credit, independently of which bookings used an entitlement. */
|
|
189
|
+
const submissionPaymentSchema = z.object({
|
|
190
|
+
amountPaidCents: moneyFields.amountPaidCents,
|
|
191
|
+
/** The part of amountPaidCents that came from account credit. */
|
|
192
|
+
creditCents: z.number().int().nonnegative().transform(toNonNegativeCents),
|
|
193
|
+
currency: currencySchema,
|
|
194
|
+
purchasedItems: z.array(z.object({
|
|
195
|
+
kind: z.enum(["pass", "membership"]),
|
|
196
|
+
name: z.string().min(1),
|
|
197
|
+
priceCents: z.number().int().nonnegative().transform(toNonNegativeCents)
|
|
198
|
+
})).readonly()
|
|
199
|
+
});
|
|
86
200
|
//#endregion
|
|
87
201
|
//#region ../site-contracts/src/siteData/eventCheckout.ts
|
|
88
202
|
/**
|
|
@@ -100,6 +214,7 @@ const eventRegistrationStatusReferenceSchema = z.discriminatedUnion("scope", [z.
|
|
|
100
214
|
})]);
|
|
101
215
|
const eventRegistrationPaymentSubjectSchema = z.discriminatedUnion("scope", [z.object({
|
|
102
216
|
scope: z.literal("occurrence"),
|
|
217
|
+
/** Carries the client's registration command ID for occurrence scope, not the durable submission ID. */
|
|
103
218
|
submissionId: uuid,
|
|
104
219
|
attendeeId: uuid
|
|
105
220
|
}), z.object({
|
|
@@ -172,6 +287,7 @@ const registrationIdsSchema = z.tuple([uuid]).rest(uuid).readonly().refine((ids)
|
|
|
172
287
|
const eventRegisterResponseSchema = z.discriminatedUnion("kind", [
|
|
173
288
|
z.object({
|
|
174
289
|
kind: z.literal("bookingComplete"),
|
|
290
|
+
submissionPayment: submissionPaymentSchema.nullable().optional(),
|
|
175
291
|
outcome: eventBookingOutcomeSchema,
|
|
176
292
|
outcomes: bookingOutcomesSchema.optional(),
|
|
177
293
|
summary: eventRegistrationSummarySchema,
|
|
@@ -205,6 +321,13 @@ const eventRegisterResponseSchema = z.discriminatedUnion("kind", [
|
|
|
205
321
|
emailFollowupMessage: z.string().optional()
|
|
206
322
|
}),
|
|
207
323
|
...decorations
|
|
324
|
+
}),
|
|
325
|
+
z.object({
|
|
326
|
+
kind: z.literal("fundingChanged"),
|
|
327
|
+
entitlementKind: z.enum(["pass", "membership"]),
|
|
328
|
+
message: z.string(),
|
|
329
|
+
funding: eventSelectionFundingSchema,
|
|
330
|
+
...decorations
|
|
208
331
|
})
|
|
209
332
|
]).superRefine((response, ctx) => {
|
|
210
333
|
if (response.kind === "bookingComplete") validateOutcomeList(response, ctx);
|
|
@@ -213,6 +336,7 @@ const eventRegisterResponseSchema = z.discriminatedUnion("kind", [
|
|
|
213
336
|
const checkoutStatusArms = [
|
|
214
337
|
z.object({
|
|
215
338
|
kind: z.literal("resolved"),
|
|
339
|
+
submissionPayment: submissionPaymentSchema.nullable().optional(),
|
|
216
340
|
outcome: eventBookingOutcomeSchema,
|
|
217
341
|
outcomes: bookingOutcomesSchema.optional()
|
|
218
342
|
}).superRefine(validateOutcomeList),
|
|
@@ -362,126 +486,371 @@ function identityMatchesSubject(identity, subject) {
|
|
|
362
486
|
return identity.scope === subject.scope && identity.submissionId === subject.submissionId && (identity.scope !== "occurrence" || subject.scope !== "occurrence" || identity.attendeeId === subject.attendeeId);
|
|
363
487
|
}
|
|
364
488
|
//#endregion
|
|
365
|
-
//#region ../
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}).refine((value) => value.seatCount === value.ticketSelections.reduce((total, line) => total + line.quantity, 0), { message: "Seat count must match the reserved selection" })]);
|
|
383
|
-
const identity = {
|
|
384
|
-
email: z.string().email(),
|
|
385
|
-
name: z.string(),
|
|
386
|
-
phone: z.string().nullable()
|
|
489
|
+
//#region ../site-contracts/src/siteData/portalDigitalProducts.ts
|
|
490
|
+
const jsonValueSchema = z.lazy(() => z.union([
|
|
491
|
+
z.string(),
|
|
492
|
+
z.number(),
|
|
493
|
+
z.boolean(),
|
|
494
|
+
z.null(),
|
|
495
|
+
z.array(jsonValueSchema),
|
|
496
|
+
z.record(z.string(), z.optional(jsonValueSchema))
|
|
497
|
+
]));
|
|
498
|
+
const digitalProductBase = {
|
|
499
|
+
entitlementId: z.string(),
|
|
500
|
+
productId: z.string(),
|
|
501
|
+
productTitle: z.string(),
|
|
502
|
+
productDescription: z.nullable(jsonValueSchema),
|
|
503
|
+
accessState: z.enum(["active", "revoked"]),
|
|
504
|
+
revokedReason: z.string().nullable(),
|
|
505
|
+
lastEmailSentAt: z.string().nullable()
|
|
387
506
|
};
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
507
|
+
const digitalProductFileSchema = exactSchema()(z.object({
|
|
508
|
+
assetId: z.string(),
|
|
509
|
+
label: z.string(),
|
|
510
|
+
filename: z.string(),
|
|
511
|
+
bytes: z.number().nullable(),
|
|
512
|
+
downloadPath: z.string()
|
|
513
|
+
}));
|
|
514
|
+
const portalDigitalProductSchema = exactSchema()(z.discriminatedUnion("fulfillmentMode", [
|
|
515
|
+
z.object({
|
|
516
|
+
...digitalProductBase,
|
|
517
|
+
fulfillmentMode: z.literal("email")
|
|
518
|
+
}),
|
|
519
|
+
z.object({
|
|
520
|
+
...digitalProductBase,
|
|
521
|
+
fulfillmentMode: z.literal("guarded_url"),
|
|
522
|
+
accessPath: z.string()
|
|
523
|
+
}),
|
|
524
|
+
z.object({
|
|
525
|
+
...digitalProductBase,
|
|
526
|
+
fulfillmentMode: z.literal("file_download"),
|
|
527
|
+
accessPath: z.string(),
|
|
528
|
+
files: z.array(digitalProductFileSchema)
|
|
401
529
|
})
|
|
402
|
-
|
|
530
|
+
]));
|
|
403
531
|
//#endregion
|
|
404
|
-
//#region ../
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
532
|
+
//#region ../site-contracts/src/siteData/portalOccurrenceBookings.ts
|
|
533
|
+
const portalOccurrenceBookingSchema = exactSchema()(z.object({
|
|
534
|
+
id: z.string(),
|
|
535
|
+
occurrenceId: z.string(),
|
|
536
|
+
ticketsCount: z.number().int().nonnegative(),
|
|
537
|
+
ticketBreakdown: z.string().nullable()
|
|
538
|
+
}));
|
|
539
|
+
const portalOccurrenceBookingsResponseSchema = exactSchema()(z.object({ bookings: z.array(portalOccurrenceBookingSchema).readonly() }));
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region ../site-contracts/src/siteData/portalActions.ts
|
|
542
|
+
const portalMeResponseSchema = exactSchema()(z.object({
|
|
543
|
+
siteTermsAcceptance: verifiedSiteTermsAcceptanceSchema.nullable(),
|
|
544
|
+
profile: customerProfileSchema,
|
|
545
|
+
modules: enabledModulesSchema
|
|
546
|
+
}));
|
|
547
|
+
/** What asking for a sign-in link answers: sent by email, or (on a demo site) the link itself. */
|
|
548
|
+
const magicLinkResponseSchema = exactSchema()(z.union([z.object({ demoSignInUrl: z.string() }), z.object({ message: z.string() })]));
|
|
549
|
+
const portalMeUpdateResponseSchema = exactSchema()(z.object({
|
|
550
|
+
profile: customerProfileSchema,
|
|
551
|
+
modules: enabledModulesSchema
|
|
552
|
+
}));
|
|
553
|
+
exactSchema()(z.object({ credit: portalCreditSchema.nullable() }));
|
|
554
|
+
exactSchema()(z.object({ passes: z.array(customerPassSchema) }));
|
|
555
|
+
exactSchema()(z.object({ memberships: z.array(customerMembershipSchema) }));
|
|
556
|
+
exactSchema()(z.object({ orders: z.array(customerOrderSchema) }));
|
|
557
|
+
const portalOrderCheckoutResponseSchema = exactSchema()(z.object({
|
|
558
|
+
checkoutUrl: z.string(),
|
|
559
|
+
sessionId: z.string()
|
|
560
|
+
}));
|
|
561
|
+
const portalEventGuestsResponseSchema = exactSchema()(z.object({ guests: z.array(eventGuestSchema) }));
|
|
562
|
+
const portalEventTicketSchema = exactSchema()(z.object({
|
|
563
|
+
ticketUrl: z.string(),
|
|
564
|
+
qrImageUrl: z.string(),
|
|
565
|
+
fallbackCode: z.string(),
|
|
566
|
+
registration: z.object({
|
|
567
|
+
id: z.string(),
|
|
568
|
+
eventTitle: z.string(),
|
|
569
|
+
seriesName: z.string().nullable(),
|
|
570
|
+
startsAt: z.string(),
|
|
571
|
+
endsAt: z.string(),
|
|
572
|
+
timeZone: z.string(),
|
|
573
|
+
isOnline: z.boolean(),
|
|
574
|
+
venueName: z.string().nullable(),
|
|
575
|
+
venueAddress: z.string().nullable(),
|
|
576
|
+
ticketsCount: z.number(),
|
|
577
|
+
ticketLines: z.array(eventTicketBreakdownLineSchema),
|
|
578
|
+
ticketBreakdown: z.string().nullable()
|
|
579
|
+
})
|
|
580
|
+
}));
|
|
581
|
+
const portalEventTicketResponseSchema = exactSchema()(z.object({ ticket: portalEventTicketSchema }));
|
|
582
|
+
const portalDigitalProductsResponseSchema = exactSchema()(z.object({
|
|
583
|
+
tabLabel: z.string(),
|
|
584
|
+
products: z.array(portalDigitalProductSchema)
|
|
585
|
+
}));
|
|
586
|
+
const portalDigitalProductAccessResponseSchema = exactSchema()(z.object({
|
|
587
|
+
product: portalDigitalProductSchema,
|
|
588
|
+
guardedHref: z.string().nullable()
|
|
589
|
+
}));
|
|
590
|
+
const portalDigitalProductDownloadUrlResponseSchema = exactSchema()(z.object({
|
|
591
|
+
signedUrl: z.string(),
|
|
592
|
+
filename: z.string()
|
|
593
|
+
}));
|
|
594
|
+
const portalBookingQuestionsTaskResponseSchema = evolvingSchema()(z.object({ task: bookingQuestionsTaskDetailSchema }));
|
|
595
|
+
const portalBookingQuestionsUploadUrlResponseSchema = exactSchema()(z.object({
|
|
596
|
+
uploadId: z.string(),
|
|
597
|
+
signedUrl: z.string()
|
|
598
|
+
}));
|
|
599
|
+
const portalBookingQuestionsFinalizeUploadResponseSchema = exactSchema()(z.object({ answer: bookingQuestionsDocumentAnswerValueSchema }));
|
|
600
|
+
const portalRefundInfoSchema = exactSchema()(z.object({
|
|
601
|
+
status: z.enum([
|
|
602
|
+
"succeeded",
|
|
603
|
+
"failed",
|
|
604
|
+
"skipped"
|
|
605
|
+
]),
|
|
606
|
+
amountCents: z.number().nullable(),
|
|
607
|
+
currency: z.string().nullable(),
|
|
608
|
+
paymentLast4: z.string().nullable(),
|
|
609
|
+
stripeRefundId: z.string().nullable(),
|
|
610
|
+
errorMessage: z.string().optional(),
|
|
611
|
+
errorCode: z.string().optional()
|
|
612
|
+
}));
|
|
613
|
+
const portalCancelledMoneySchema = evolvingSchema()(z.union([cancelledMoneySchema, unknownKind([
|
|
614
|
+
"refunded",
|
|
615
|
+
"credit_restored",
|
|
616
|
+
"refund_failed",
|
|
617
|
+
"none"
|
|
618
|
+
]).transform(() => ({ kind: "unsupported" }))]));
|
|
619
|
+
const cancelResultFields = {
|
|
620
|
+
cancelled: z.boolean(),
|
|
621
|
+
refunded: z.boolean(),
|
|
622
|
+
refund: portalRefundInfoSchema.optional(),
|
|
623
|
+
requiresCancelWithoutRefundConfirmation: z.boolean().optional(),
|
|
624
|
+
followUp: z.string().nullable(),
|
|
625
|
+
message: z.string()
|
|
626
|
+
};
|
|
627
|
+
/** The fields of every kind's cancel answer that the new portal reads, money decoded with its fallback. */
|
|
628
|
+
const cancelAnswerSchema = z.object({
|
|
629
|
+
cancelled: z.boolean(),
|
|
630
|
+
requiresCancelWithoutRefundConfirmation: z.boolean().optional(),
|
|
631
|
+
money: portalCancelledMoneySchema,
|
|
632
|
+
followUp: z.string().nullable(),
|
|
633
|
+
message: z.string()
|
|
634
|
+
});
|
|
635
|
+
exactSchema()(z.object({
|
|
636
|
+
...cancelResultFields,
|
|
637
|
+
money: cancelledMoneySchema
|
|
638
|
+
}));
|
|
639
|
+
exactSchema()(z.object({
|
|
640
|
+
...cancelResultFields,
|
|
641
|
+
money: cancelledMoneySchema
|
|
642
|
+
}));
|
|
643
|
+
exactSchema()(z.object({
|
|
644
|
+
...cancelResultFields,
|
|
645
|
+
money: cancelledMoneySchema
|
|
646
|
+
}));
|
|
647
|
+
function portalCancelOutcome(answer) {
|
|
648
|
+
if (answer.requiresCancelWithoutRefundConfirmation) return {
|
|
649
|
+
kind: "needs_confirmation",
|
|
650
|
+
message: answer.message
|
|
651
|
+
};
|
|
652
|
+
if (!answer.cancelled) return {
|
|
653
|
+
kind: "not_cancelled",
|
|
654
|
+
message: answer.message
|
|
655
|
+
};
|
|
478
656
|
return {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
657
|
+
kind: "cancelled",
|
|
658
|
+
money: answer.money,
|
|
659
|
+
followUp: answer.followUp,
|
|
660
|
+
message: answer.message
|
|
483
661
|
};
|
|
484
662
|
}
|
|
663
|
+
/** Any kind's cancel answer, read as a `PortalCancelOutcome`. */
|
|
664
|
+
const portalCancelOutcomeSchema = z.object({ result: cancelAnswerSchema }).transform(({ result }) => portalCancelOutcome(result));
|
|
665
|
+
const portalRescheduleAppointmentResponseSchema = exactSchema()(z.object({ appointment: z.object({
|
|
666
|
+
id: z.string(),
|
|
667
|
+
status: z.string(),
|
|
668
|
+
startAt: z.string(),
|
|
669
|
+
endAt: z.string(),
|
|
670
|
+
resourceId: z.string()
|
|
671
|
+
}) }));
|
|
672
|
+
const portalTransferEventRegistrationResultSchema = exactSchema()(z.object({
|
|
673
|
+
transferred: z.boolean(),
|
|
674
|
+
message: z.string(),
|
|
675
|
+
transferId: z.string().optional()
|
|
676
|
+
}));
|
|
677
|
+
const portalCancelMembershipAtPeriodEndResultSchema = exactSchema()(z.object({
|
|
678
|
+
cancelled: z.boolean(),
|
|
679
|
+
message: z.string(),
|
|
680
|
+
outcome: z.discriminatedUnion("kind", [
|
|
681
|
+
z.object({ kind: z.literal("changed") }),
|
|
682
|
+
z.object({
|
|
683
|
+
kind: z.literal("unchanged"),
|
|
684
|
+
reason: z.enum([
|
|
685
|
+
"already_so",
|
|
686
|
+
"already_ended",
|
|
687
|
+
"does_not_renew",
|
|
688
|
+
"cannot_change_online"
|
|
689
|
+
])
|
|
690
|
+
}),
|
|
691
|
+
z.object({ kind: z.literal("settling") })
|
|
692
|
+
])
|
|
693
|
+
}));
|
|
694
|
+
exactSchema()(z.object({ outcome: z.enum([
|
|
695
|
+
"cancelled",
|
|
696
|
+
"alreadyClosed",
|
|
697
|
+
"notFound"
|
|
698
|
+
]) }));
|
|
699
|
+
const attendanceModeSchema = z.enum(["in_person", "online"]);
|
|
700
|
+
const rescheduleBookingSchema = exactSchema()(z.object({
|
|
701
|
+
customerId: z.string(),
|
|
702
|
+
ticketLines: z.array(z.object({
|
|
703
|
+
ticketLineId: z.string(),
|
|
704
|
+
pricingOptionId: z.string().nullable(),
|
|
705
|
+
quantity: z.number(),
|
|
706
|
+
unitPriceCents: z.number(),
|
|
707
|
+
currency: z.string()
|
|
708
|
+
})).readonly()
|
|
709
|
+
}));
|
|
710
|
+
const rescheduleNoticeSchema = exactSchema()(z.discriminatedUnion("kind", [z.object({
|
|
711
|
+
kind: z.literal("attendance_mode_changed"),
|
|
712
|
+
from: attendanceModeSchema,
|
|
713
|
+
to: attendanceModeSchema
|
|
714
|
+
}), z.object({
|
|
715
|
+
kind: z.literal("venue_changed"),
|
|
716
|
+
from: z.string().nullable(),
|
|
717
|
+
to: z.string().nullable()
|
|
718
|
+
})]));
|
|
719
|
+
const rescheduleAssessmentSchema = exactSchema()(z.discriminatedUnion("kind", [
|
|
720
|
+
z.object({
|
|
721
|
+
kind: z.literal("selectable"),
|
|
722
|
+
notices: z.array(rescheduleNoticeSchema).readonly()
|
|
723
|
+
}),
|
|
724
|
+
z.object({
|
|
725
|
+
kind: z.literal("needs_ticket_choice"),
|
|
726
|
+
ticketLineIds: z.array(z.string()).readonly()
|
|
727
|
+
}),
|
|
728
|
+
z.object({
|
|
729
|
+
kind: z.literal("needs_capacity_override"),
|
|
730
|
+
booked: z.number(),
|
|
731
|
+
capacity: z.number()
|
|
732
|
+
}),
|
|
733
|
+
z.object({
|
|
734
|
+
kind: z.literal("blocked"),
|
|
735
|
+
reason: z.enum([
|
|
736
|
+
"full",
|
|
737
|
+
"not_enough_room",
|
|
738
|
+
"ticket_not_usable",
|
|
739
|
+
"tickets_collide",
|
|
740
|
+
"pass_not_accepted",
|
|
741
|
+
"already_booked",
|
|
742
|
+
"not_bookable"
|
|
743
|
+
])
|
|
744
|
+
})
|
|
745
|
+
]));
|
|
746
|
+
const rescheduleDateSchema = exactSchema()(z.object({
|
|
747
|
+
occurrenceId: z.string(),
|
|
748
|
+
title: z.string(),
|
|
749
|
+
startsAt: z.string(),
|
|
750
|
+
endsAt: z.string(),
|
|
751
|
+
timeZone: z.string(),
|
|
752
|
+
venueId: z.string().nullable(),
|
|
753
|
+
venueName: z.string().nullable(),
|
|
754
|
+
attendanceMode: attendanceModeSchema,
|
|
755
|
+
assessment: rescheduleAssessmentSchema,
|
|
756
|
+
capacity: z.discriminatedUnion("kind", [z.object({ kind: z.literal("unbounded") }), z.object({
|
|
757
|
+
kind: z.literal("bounded"),
|
|
758
|
+
booked: z.number(),
|
|
759
|
+
capacity: z.number(),
|
|
760
|
+
availableSeats: z.number()
|
|
761
|
+
})])
|
|
762
|
+
}));
|
|
763
|
+
const portalEventRescheduleDatesSchema = exactSchema()(z.object({
|
|
764
|
+
source: z.discriminatedUnion("kind", [
|
|
765
|
+
z.object({
|
|
766
|
+
kind: z.literal("available"),
|
|
767
|
+
until: z.string().nullable()
|
|
768
|
+
}),
|
|
769
|
+
z.object({
|
|
770
|
+
kind: z.literal("closed"),
|
|
771
|
+
closedAt: z.string()
|
|
772
|
+
}),
|
|
773
|
+
z.object({
|
|
774
|
+
kind: z.literal("not_offered"),
|
|
775
|
+
reason: z.enum([
|
|
776
|
+
"switched_off",
|
|
777
|
+
"course_booking",
|
|
778
|
+
"checked_in",
|
|
779
|
+
"cancelled",
|
|
780
|
+
"waitlisted",
|
|
781
|
+
"past",
|
|
782
|
+
"date_missing",
|
|
783
|
+
"payment_pending",
|
|
784
|
+
"not_owner",
|
|
785
|
+
"has_room"
|
|
786
|
+
])
|
|
787
|
+
})
|
|
788
|
+
]),
|
|
789
|
+
booking: rescheduleBookingSchema.nullable(),
|
|
790
|
+
dates: z.array(rescheduleDateSchema).readonly(),
|
|
791
|
+
nextPage: z.object({
|
|
792
|
+
afterStartsAt: z.string(),
|
|
793
|
+
afterId: z.string()
|
|
794
|
+
}).nullable()
|
|
795
|
+
}));
|
|
796
|
+
const portalEventRescheduleResultSchema = exactSchema()(z.union([z.object({
|
|
797
|
+
moved: z.literal(true),
|
|
798
|
+
moveId: z.string(),
|
|
799
|
+
effects: z.enum(["settled", "pending"])
|
|
800
|
+
}), z.object({
|
|
801
|
+
moved: z.literal(false),
|
|
802
|
+
reason: z.enum([
|
|
803
|
+
"not_found",
|
|
804
|
+
"source_changed",
|
|
805
|
+
"source_unavailable",
|
|
806
|
+
"target_full",
|
|
807
|
+
"target_not_bookable",
|
|
808
|
+
"target_changed",
|
|
809
|
+
"already_booked_on_target",
|
|
810
|
+
"ticket_not_usable",
|
|
811
|
+
"has_room"
|
|
812
|
+
]),
|
|
813
|
+
message: z.string()
|
|
814
|
+
})]));
|
|
815
|
+
//#endregion
|
|
816
|
+
//#region ../site-contracts/src/siteData/eventSelectionPayment.ts
|
|
817
|
+
const cents = z.number().int().nonnegative();
|
|
818
|
+
const collectionSchema = z.object({
|
|
819
|
+
kind: z.enum([
|
|
820
|
+
"upfront",
|
|
821
|
+
"deferred_manual",
|
|
822
|
+
"instalment_plan",
|
|
823
|
+
"flexible_balance"
|
|
824
|
+
]),
|
|
825
|
+
amountCents: cents,
|
|
826
|
+
currency: z.string().min(1),
|
|
827
|
+
bookings: z.array(z.object({
|
|
828
|
+
itemId: z.string().min(1),
|
|
829
|
+
amountCents: cents
|
|
830
|
+
}).readonly()).readonly().optional()
|
|
831
|
+
}).readonly();
|
|
832
|
+
const optionSchema = z.object({
|
|
833
|
+
funding: eventSelectionFundingPickSchema,
|
|
834
|
+
collect: z.discriminatedUnion("kind", [z.object({ kind: z.literal("nothing") }), z.object({
|
|
835
|
+
kind: z.literal("money"),
|
|
836
|
+
collections: z.tuple([collectionSchema]).rest(collectionSchema).readonly()
|
|
837
|
+
})])
|
|
838
|
+
});
|
|
839
|
+
const eventSelectionPaymentSchema = z.discriminatedUnion("kind", [
|
|
840
|
+
z.object({
|
|
841
|
+
kind: z.literal("bookable"),
|
|
842
|
+
options: z.tuple([optionSchema]).rest(optionSchema).readonly()
|
|
843
|
+
}),
|
|
844
|
+
z.object({ kind: z.literal("bookSeparately") }),
|
|
845
|
+
z.object({
|
|
846
|
+
kind: z.literal("cannotBookOnline"),
|
|
847
|
+
organiserContact: z.object({
|
|
848
|
+
email: z.string().nullable(),
|
|
849
|
+
phone: z.string().nullable()
|
|
850
|
+
}).nullable()
|
|
851
|
+
}),
|
|
852
|
+
z.object({ kind: z.literal("noPaymentOption") })
|
|
853
|
+
]);
|
|
485
854
|
//#endregion
|
|
486
855
|
//#region ../blocks/src/system/runtime/api/endpoints.ts
|
|
487
856
|
/**
|
|
@@ -510,11 +879,13 @@ function appendQuery(path, params) {
|
|
|
510
879
|
const FORMS = {
|
|
511
880
|
submit: {
|
|
512
881
|
path: "/forms/submit",
|
|
513
|
-
method: "POST"
|
|
882
|
+
method: "POST",
|
|
883
|
+
authScope: "default"
|
|
514
884
|
},
|
|
515
885
|
get: {
|
|
516
886
|
path: "/public/forms/{formId}",
|
|
517
|
-
method: "GET"
|
|
887
|
+
method: "GET",
|
|
888
|
+
authScope: "default"
|
|
518
889
|
}
|
|
519
890
|
};
|
|
520
891
|
const BOOKINGS = {
|
|
@@ -535,31 +906,38 @@ const BOOKINGS = {
|
|
|
535
906
|
},
|
|
536
907
|
appointmentStatus: {
|
|
537
908
|
path: "/public/sites/{siteId}/bookings/appointments/status",
|
|
538
|
-
method: "GET"
|
|
909
|
+
method: "GET",
|
|
910
|
+
authScope: "default"
|
|
539
911
|
},
|
|
540
912
|
getAvailableSlots: {
|
|
541
913
|
path: "/public/bookings/availability/slots",
|
|
542
|
-
method: "GET"
|
|
914
|
+
method: "GET",
|
|
915
|
+
authScope: "default"
|
|
543
916
|
},
|
|
544
917
|
getWeeklySlotAvailability: {
|
|
545
918
|
path: "/public/bookings/weekly-slot-availability",
|
|
546
|
-
method: "GET"
|
|
919
|
+
method: "GET",
|
|
920
|
+
authScope: "default"
|
|
547
921
|
},
|
|
548
922
|
getAvailableDates: {
|
|
549
923
|
path: "/public/bookings/availability/dates",
|
|
550
|
-
method: "GET"
|
|
924
|
+
method: "GET",
|
|
925
|
+
authScope: "default"
|
|
551
926
|
},
|
|
552
927
|
getServices: {
|
|
553
928
|
path: "/public/bookings/services",
|
|
554
|
-
method: "GET"
|
|
929
|
+
method: "GET",
|
|
930
|
+
authScope: "default"
|
|
555
931
|
},
|
|
556
932
|
getService: {
|
|
557
933
|
path: "/public/bookings/services/{serviceId}",
|
|
558
|
-
method: "GET"
|
|
934
|
+
method: "GET",
|
|
935
|
+
authScope: "default"
|
|
559
936
|
},
|
|
560
937
|
getResources: {
|
|
561
938
|
path: "/public/bookings/resources/reference",
|
|
562
|
-
method: "GET"
|
|
939
|
+
method: "GET",
|
|
940
|
+
authScope: "default"
|
|
563
941
|
},
|
|
564
942
|
/** Identity-aware: a portal session can turn "ask" into "prefill" or "already answered". */
|
|
565
943
|
getBeforeBookingQuestions: {
|
|
@@ -571,16 +949,19 @@ const EVENTS = {
|
|
|
571
949
|
calendarWindow: {
|
|
572
950
|
path: "/public/sites/{siteId}/events/calendar-window",
|
|
573
951
|
method: "GET",
|
|
952
|
+
authScope: "default",
|
|
574
953
|
previewRead: true
|
|
575
954
|
},
|
|
576
955
|
list: {
|
|
577
956
|
path: "/public/sites/{siteId}/events",
|
|
578
957
|
method: "GET",
|
|
958
|
+
authScope: "default",
|
|
579
959
|
previewRead: true
|
|
580
960
|
},
|
|
581
961
|
filters: {
|
|
582
962
|
path: "/public/sites/{siteId}/events/filters",
|
|
583
963
|
method: "GET",
|
|
964
|
+
authScope: "default",
|
|
584
965
|
previewRead: true
|
|
585
966
|
},
|
|
586
967
|
register: {
|
|
@@ -591,7 +972,8 @@ const EVENTS = {
|
|
|
591
972
|
},
|
|
592
973
|
checkout: {
|
|
593
974
|
path: "/public/sites/{siteId}/events/checkout",
|
|
594
|
-
method: "POST"
|
|
975
|
+
method: "POST",
|
|
976
|
+
authScope: "portal"
|
|
595
977
|
},
|
|
596
978
|
registrationOptions: {
|
|
597
979
|
path: "/public/sites/{siteId}/events/registration-options",
|
|
@@ -600,15 +982,18 @@ const EVENTS = {
|
|
|
600
982
|
},
|
|
601
983
|
registrationNextStep: {
|
|
602
984
|
path: "/public/sites/{siteId}/events/registration-next-step",
|
|
603
|
-
method: "POST"
|
|
985
|
+
method: "POST",
|
|
986
|
+
authScope: "default"
|
|
604
987
|
},
|
|
605
988
|
registrationStatus: {
|
|
606
989
|
path: "/public/sites/{siteId}/events/registration-status",
|
|
607
|
-
method: "GET"
|
|
990
|
+
method: "GET",
|
|
991
|
+
authScope: "default"
|
|
608
992
|
},
|
|
609
993
|
checkoutReturn: {
|
|
610
994
|
path: "/public/sites/{siteId}/events/checkout-return",
|
|
611
|
-
method: "POST"
|
|
995
|
+
method: "POST",
|
|
996
|
+
authScope: "default"
|
|
612
997
|
}
|
|
613
998
|
};
|
|
614
999
|
const WHOLE_SERIES = { waitlistClaimResolve: {
|
|
@@ -625,48 +1010,58 @@ const SHOP = {
|
|
|
625
1010
|
listProducts: {
|
|
626
1011
|
path: "/public/sites/{siteId}/products",
|
|
627
1012
|
method: "GET",
|
|
1013
|
+
authScope: "default",
|
|
628
1014
|
previewRead: true
|
|
629
1015
|
},
|
|
630
1016
|
checkout: {
|
|
631
1017
|
path: "/public/sites/{siteId}/bookings/checkout",
|
|
632
|
-
method: "POST"
|
|
1018
|
+
method: "POST",
|
|
1019
|
+
authScope: "portal"
|
|
633
1020
|
},
|
|
634
1021
|
unifiedCheckout: {
|
|
635
1022
|
path: "/public/sites/{siteId}/checkout",
|
|
636
|
-
method: "POST"
|
|
1023
|
+
method: "POST",
|
|
1024
|
+
authScope: "portal"
|
|
637
1025
|
}
|
|
638
1026
|
};
|
|
639
1027
|
const GIFTING = {
|
|
640
1028
|
previewClaim: {
|
|
641
1029
|
path: "/public/sites/{siteId}/gifting/claim",
|
|
642
|
-
method: "GET"
|
|
1030
|
+
method: "GET",
|
|
1031
|
+
authScope: "default"
|
|
643
1032
|
},
|
|
644
1033
|
offers: {
|
|
645
1034
|
path: "/public/sites/{siteId}/gifting/offers",
|
|
646
|
-
method: "GET"
|
|
1035
|
+
method: "GET",
|
|
1036
|
+
authScope: "default"
|
|
647
1037
|
},
|
|
648
1038
|
checkout: {
|
|
649
1039
|
path: "/public/sites/{siteId}/gifting/checkout",
|
|
650
|
-
method: "POST"
|
|
1040
|
+
method: "POST",
|
|
1041
|
+
authScope: "portal"
|
|
651
1042
|
},
|
|
652
1043
|
claim: {
|
|
653
1044
|
path: "/public/sites/{siteId}/gifting/claim",
|
|
654
|
-
method: "POST"
|
|
1045
|
+
method: "POST",
|
|
1046
|
+
authScope: "default"
|
|
655
1047
|
}
|
|
656
1048
|
};
|
|
657
1049
|
const DISCOUNTS = {
|
|
658
1050
|
available: {
|
|
659
1051
|
path: "/public/sites/{siteId}/bookings/discounts/available",
|
|
660
|
-
method: "POST"
|
|
1052
|
+
method: "POST",
|
|
1053
|
+
authScope: "default"
|
|
661
1054
|
},
|
|
662
1055
|
apply: {
|
|
663
1056
|
path: "/public/sites/{siteId}/bookings/discounts/apply",
|
|
664
|
-
method: "POST"
|
|
1057
|
+
method: "POST",
|
|
1058
|
+
authScope: "portal"
|
|
665
1059
|
}
|
|
666
1060
|
};
|
|
667
1061
|
const NEWSLETTER = { subscribe: {
|
|
668
1062
|
path: "/public/sites/{siteId}/newsletter/subscribe",
|
|
669
|
-
method: "POST"
|
|
1063
|
+
method: "POST",
|
|
1064
|
+
authScope: "default"
|
|
670
1065
|
} };
|
|
671
1066
|
const PORTAL = {
|
|
672
1067
|
createAppointmentBookingQuestionsUploadUrl: {
|
|
@@ -717,18 +1112,24 @@ const PORTAL = {
|
|
|
717
1112
|
authScope: "portal",
|
|
718
1113
|
skipPreviewStage: true
|
|
719
1114
|
},
|
|
720
|
-
|
|
721
|
-
path: "/portal/
|
|
1115
|
+
getOccurrenceBookings: {
|
|
1116
|
+
path: "/portal/occurrences/{occurrenceId}/bookings",
|
|
722
1117
|
method: "GET",
|
|
723
1118
|
authScope: "portal",
|
|
724
1119
|
skipPreviewStage: true
|
|
725
1120
|
},
|
|
726
|
-
|
|
727
|
-
path: "/portal/
|
|
1121
|
+
getDetails: {
|
|
1122
|
+
path: "/portal/details",
|
|
728
1123
|
method: "GET",
|
|
729
1124
|
authScope: "portal",
|
|
730
1125
|
skipPreviewStage: true
|
|
731
1126
|
},
|
|
1127
|
+
updateNewsletter: {
|
|
1128
|
+
path: "/portal/details/newsletter",
|
|
1129
|
+
method: "PATCH",
|
|
1130
|
+
authScope: "portal",
|
|
1131
|
+
skipPreviewStage: true
|
|
1132
|
+
},
|
|
732
1133
|
createOrderCheckout: {
|
|
733
1134
|
path: "/portal/orders/{orderId}/checkout",
|
|
734
1135
|
method: "POST",
|
|
@@ -765,50 +1166,68 @@ const PORTAL = {
|
|
|
765
1166
|
authScope: "portal",
|
|
766
1167
|
skipPreviewStage: true
|
|
767
1168
|
},
|
|
768
|
-
|
|
769
|
-
path: "/portal/
|
|
1169
|
+
getEventTicket: {
|
|
1170
|
+
path: "/portal/events/{registrationId}/ticket",
|
|
1171
|
+
method: "GET",
|
|
1172
|
+
authScope: "portal",
|
|
1173
|
+
skipPreviewStage: true
|
|
1174
|
+
},
|
|
1175
|
+
getEventBookingQuestions: {
|
|
1176
|
+
path: "/portal/events/{registrationId}/booking-questions",
|
|
1177
|
+
method: "GET",
|
|
1178
|
+
authScope: "portal",
|
|
1179
|
+
skipPreviewStage: true
|
|
1180
|
+
},
|
|
1181
|
+
updateEventBookingQuestions: {
|
|
1182
|
+
path: "/portal/events/{registrationId}/booking-questions",
|
|
1183
|
+
method: "PUT",
|
|
1184
|
+
authScope: "portal",
|
|
1185
|
+
skipPreviewStage: true
|
|
1186
|
+
},
|
|
1187
|
+
getRegularSessions: {
|
|
1188
|
+
path: "/portal/appointments/regular-sessions",
|
|
770
1189
|
method: "GET",
|
|
771
1190
|
authScope: "portal",
|
|
772
1191
|
skipPreviewStage: true
|
|
773
1192
|
},
|
|
774
|
-
|
|
775
|
-
path: "/portal/
|
|
1193
|
+
getBookings: {
|
|
1194
|
+
path: "/portal/bookings",
|
|
776
1195
|
method: "GET",
|
|
777
1196
|
authScope: "portal",
|
|
778
1197
|
skipPreviewStage: true
|
|
779
1198
|
},
|
|
780
|
-
|
|
781
|
-
path: "/portal/
|
|
1199
|
+
getHome: {
|
|
1200
|
+
path: "/portal/home",
|
|
782
1201
|
method: "GET",
|
|
783
1202
|
authScope: "portal",
|
|
784
1203
|
skipPreviewStage: true
|
|
785
1204
|
},
|
|
786
|
-
|
|
787
|
-
path: "/portal/
|
|
1205
|
+
getHoldings: {
|
|
1206
|
+
path: "/portal/holdings",
|
|
788
1207
|
method: "GET",
|
|
789
1208
|
authScope: "portal",
|
|
790
1209
|
skipPreviewStage: true
|
|
791
1210
|
},
|
|
792
|
-
|
|
793
|
-
path: "/portal/
|
|
1211
|
+
getPayments: {
|
|
1212
|
+
path: "/portal/payments",
|
|
794
1213
|
method: "GET",
|
|
795
1214
|
authScope: "portal",
|
|
796
1215
|
skipPreviewStage: true
|
|
797
1216
|
},
|
|
798
|
-
|
|
799
|
-
path: "/portal/
|
|
800
|
-
method: "
|
|
1217
|
+
getReceipt: {
|
|
1218
|
+
path: "/portal/payments/receipts/{receiptId}",
|
|
1219
|
+
method: "GET",
|
|
801
1220
|
authScope: "portal",
|
|
802
1221
|
skipPreviewStage: true
|
|
803
1222
|
},
|
|
804
|
-
|
|
805
|
-
path: "/portal/
|
|
1223
|
+
getOrder: {
|
|
1224
|
+
path: "/portal/orders/{orderId}",
|
|
806
1225
|
method: "GET",
|
|
807
1226
|
authScope: "portal",
|
|
808
1227
|
skipPreviewStage: true
|
|
809
1228
|
},
|
|
810
|
-
|
|
811
|
-
path: "/portal/
|
|
1229
|
+
getBooking: {
|
|
1230
|
+
path: "/portal/bookings/{kind}/{bookingId}",
|
|
812
1231
|
method: "GET",
|
|
813
1232
|
authScope: "portal",
|
|
814
1233
|
skipPreviewStage: true
|
|
@@ -825,12 +1244,6 @@ const PORTAL = {
|
|
|
825
1244
|
authScope: "portal",
|
|
826
1245
|
skipPreviewStage: true
|
|
827
1246
|
},
|
|
828
|
-
getWholeSeriesRegistrations: {
|
|
829
|
-
path: "/portal/dated-offerings/whole-series",
|
|
830
|
-
method: "GET",
|
|
831
|
-
authScope: "portal",
|
|
832
|
-
skipPreviewStage: true
|
|
833
|
-
},
|
|
834
1247
|
getWholeSeriesBookingQuestions: {
|
|
835
1248
|
path: "/portal/dated-offerings/whole-series/{registrationId}/booking-questions",
|
|
836
1249
|
method: "GET",
|
|
@@ -867,12 +1280,6 @@ const PORTAL = {
|
|
|
867
1280
|
authScope: "portal",
|
|
868
1281
|
skipPreviewStage: true
|
|
869
1282
|
},
|
|
870
|
-
getEventGuests: {
|
|
871
|
-
path: "/portal/events/{registrationId}/guests",
|
|
872
|
-
method: "GET",
|
|
873
|
-
authScope: "portal",
|
|
874
|
-
skipPreviewStage: true
|
|
875
|
-
},
|
|
876
1283
|
updateEventGuests: {
|
|
877
1284
|
path: "/portal/events/{registrationId}/guests",
|
|
878
1285
|
method: "PUT",
|
|
@@ -925,12 +1332,297 @@ const PORTAL = {
|
|
|
925
1332
|
/** Existing public site runtime read, used to refresh a stale checkout projection. */
|
|
926
1333
|
const SITES = { runtime: {
|
|
927
1334
|
path: "/sites",
|
|
928
|
-
method: "GET"
|
|
1335
|
+
method: "GET",
|
|
1336
|
+
authScope: "default"
|
|
929
1337
|
} };
|
|
930
1338
|
//#endregion
|
|
931
|
-
//#region ../blocks/src/
|
|
932
|
-
|
|
933
|
-
|
|
1339
|
+
//#region ../blocks/src/portal/api/portalApiError.ts
|
|
1340
|
+
function isUncertainPortalFailure(error) {
|
|
1341
|
+
switch (error.kind) {
|
|
1342
|
+
case "network":
|
|
1343
|
+
case "unreadable":
|
|
1344
|
+
case "unavailable": return true;
|
|
1345
|
+
case "signed_out":
|
|
1346
|
+
case "not_found":
|
|
1347
|
+
case "conflict":
|
|
1348
|
+
case "rejected": return false;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
const fieldErrorSchema = z.object({
|
|
1352
|
+
field: z.string(),
|
|
1353
|
+
code: z.string(),
|
|
1354
|
+
message: z.string()
|
|
1355
|
+
});
|
|
1356
|
+
/** The error envelope as the dashboard sends it, read loosely: any part may be missing. */
|
|
1357
|
+
const errorEnvelopeSchema = z.object({
|
|
1358
|
+
message: z.string().optional(),
|
|
1359
|
+
code: z.string().optional(),
|
|
1360
|
+
error: z.object({
|
|
1361
|
+
message: z.string().optional(),
|
|
1362
|
+
code: z.string().optional(),
|
|
1363
|
+
fieldErrors: z.array(fieldErrorSchema).optional()
|
|
1364
|
+
}).optional()
|
|
1365
|
+
});
|
|
1366
|
+
/** What a failed HTTP answer means for the portal, from its status and whatever body came with it. */
|
|
1367
|
+
function portalApiErrorFor(status, body, retryAfter = null) {
|
|
1368
|
+
const { message, code, fieldErrors } = readErrorEnvelope(status, body);
|
|
1369
|
+
if (status === 401) return { kind: "signed_out" };
|
|
1370
|
+
if (status === 404) return {
|
|
1371
|
+
kind: "not_found",
|
|
1372
|
+
message
|
|
1373
|
+
};
|
|
1374
|
+
if (status === 409) return {
|
|
1375
|
+
kind: "conflict",
|
|
1376
|
+
code,
|
|
1377
|
+
message
|
|
1378
|
+
};
|
|
1379
|
+
if (status >= 500 || status < 400) return {
|
|
1380
|
+
kind: "unavailable",
|
|
1381
|
+
status,
|
|
1382
|
+
message
|
|
1383
|
+
};
|
|
1384
|
+
return {
|
|
1385
|
+
kind: "rejected",
|
|
1386
|
+
status,
|
|
1387
|
+
code,
|
|
1388
|
+
message,
|
|
1389
|
+
fieldErrors,
|
|
1390
|
+
retryAfterSeconds: retryAfterSeconds(retryAfter)
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
/** Retry-After in whole seconds; the HTTP-date form isn't sent by our server, so it reads as unknown. */
|
|
1394
|
+
function retryAfterSeconds(header) {
|
|
1395
|
+
if (header === null || !/^\d+$/.test(header.trim())) return null;
|
|
1396
|
+
return Number(header.trim());
|
|
1397
|
+
}
|
|
1398
|
+
function readErrorEnvelope(status, body) {
|
|
1399
|
+
const parsed = errorEnvelopeSchema.safeParse(body);
|
|
1400
|
+
const envelope = parsed.success ? parsed.data : {};
|
|
1401
|
+
return {
|
|
1402
|
+
message: envelope.error?.message ?? envelope.message ?? fallbackMessage(status),
|
|
1403
|
+
code: envelope.error?.code ?? envelope.code ?? null,
|
|
1404
|
+
fieldErrors: envelope.error?.fieldErrors ?? []
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
function fallbackMessage(status) {
|
|
1408
|
+
return status >= 500 ? "Something went wrong on our side. Please try again in a moment." : "We couldn’t do that just now. Please try again.";
|
|
1409
|
+
}
|
|
1410
|
+
//#endregion
|
|
1411
|
+
//#region ../blocks/src/portal/api/portalTransport.ts
|
|
1412
|
+
function createPortalTransport(config) {
|
|
1413
|
+
const fetchImpl = config.fetch ?? globalThis.fetch;
|
|
1414
|
+
return async (endpoint, schema, options = {}) => {
|
|
1415
|
+
const sent = await send(fetchImpl, portalRequest(config, endpoint, options));
|
|
1416
|
+
if (!sent.ok) return sent;
|
|
1417
|
+
const body = await readJson(sent.value);
|
|
1418
|
+
if (!sent.value.ok) return err(portalApiErrorFor(sent.value.status, body.kind === "json" ? body.value : null, sent.value.headers.get("Retry-After")));
|
|
1419
|
+
if (body.kind === "unreadable") return err({
|
|
1420
|
+
kind: "unreadable",
|
|
1421
|
+
endpoint: endpoint.path,
|
|
1422
|
+
issues: [body.reason]
|
|
1423
|
+
});
|
|
1424
|
+
return decodePortalResponse(endpoint.path, schema, body.value);
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
function portalRequest(config, endpoint, options) {
|
|
1428
|
+
const path = options.params ? buildPath(endpoint.path, options.params) : endpoint.path;
|
|
1429
|
+
const hasBody = options.body !== void 0;
|
|
1430
|
+
return {
|
|
1431
|
+
url: `${config.baseUrl}${options.query ? appendQuery(path, options.query) : path}`,
|
|
1432
|
+
init: {
|
|
1433
|
+
method: endpoint.method,
|
|
1434
|
+
headers: {
|
|
1435
|
+
Accept: "application/json",
|
|
1436
|
+
...config.sessionToken ? { Authorization: `Bearer ${config.sessionToken}` } : {},
|
|
1437
|
+
...hasBody ? { "Content-Type": "application/json" } : {}
|
|
1438
|
+
},
|
|
1439
|
+
body: hasBody ? JSON.stringify(options.body) : void 0
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
}
|
|
1443
|
+
async function send(fetchImpl, request) {
|
|
1444
|
+
try {
|
|
1445
|
+
return ok(await fetchImpl(request.url, request.init));
|
|
1446
|
+
} catch (cause) {
|
|
1447
|
+
return err({
|
|
1448
|
+
kind: "network",
|
|
1449
|
+
message: cause instanceof Error ? cause.message : "The request failed."
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
async function readJson(response) {
|
|
1454
|
+
const text = await response.text().catch(() => null);
|
|
1455
|
+
if (text === null) return {
|
|
1456
|
+
kind: "unreadable",
|
|
1457
|
+
reason: "body could not be read"
|
|
1458
|
+
};
|
|
1459
|
+
if (text.trim() === "") return {
|
|
1460
|
+
kind: "unreadable",
|
|
1461
|
+
reason: "empty body"
|
|
1462
|
+
};
|
|
1463
|
+
try {
|
|
1464
|
+
return {
|
|
1465
|
+
kind: "json",
|
|
1466
|
+
value: JSON.parse(text)
|
|
1467
|
+
};
|
|
1468
|
+
} catch {
|
|
1469
|
+
return {
|
|
1470
|
+
kind: "unreadable",
|
|
1471
|
+
reason: "body is not JSON"
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
const successEnvelopeSchema = z.object({
|
|
1476
|
+
success: z.literal(true),
|
|
1477
|
+
data: z.unknown()
|
|
1478
|
+
});
|
|
1479
|
+
/** Unwraps the success envelope and decodes its data against the contract, once. */
|
|
1480
|
+
function decodePortalResponse(endpoint, schema, json) {
|
|
1481
|
+
const envelope = successEnvelopeSchema.safeParse(json);
|
|
1482
|
+
const decoded = schema.safeParse(envelope.success ? envelope.data.data : json);
|
|
1483
|
+
if (decoded.success) return ok(decoded.data);
|
|
1484
|
+
return err({
|
|
1485
|
+
kind: "unreadable",
|
|
1486
|
+
endpoint,
|
|
1487
|
+
issues: decoded.error.issues.slice(0, 5).map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`)
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
/** Narrows a decoded envelope to one of its fields. */
|
|
1491
|
+
const field = (key) => (result) => result.ok ? ok(result.value[key]) : result;
|
|
1492
|
+
//#endregion
|
|
1493
|
+
//#region ../blocks/src/portal/api/portalVisitor.ts
|
|
1494
|
+
function createPortalVisitorApi(config) {
|
|
1495
|
+
const call = createPortalTransport(config);
|
|
1496
|
+
return {
|
|
1497
|
+
profile: () => call(PORTAL.getProfile, portalMeResponseSchema),
|
|
1498
|
+
occurrenceBookings: (occurrenceId) => call(PORTAL.getOccurrenceBookings, portalOccurrenceBookingsResponseSchema, { params: { occurrenceId } }).then(field("bookings"))
|
|
1499
|
+
};
|
|
1500
|
+
}
|
|
1501
|
+
//#endregion
|
|
1502
|
+
//#region ../blocks/src/system/runtime/api/schemas/waitlist-claims.ts
|
|
1503
|
+
const attendanceMode = z.enum(["in_person", "online"]);
|
|
1504
|
+
const ticketSelection = z.object({
|
|
1505
|
+
pricingOptionId: z.string().uuid().nullable(),
|
|
1506
|
+
quantity: z.number().int().positive()
|
|
1507
|
+
});
|
|
1508
|
+
const subject = z.discriminatedUnion("kind", [z.object({
|
|
1509
|
+
kind: z.literal("event_occurrence"),
|
|
1510
|
+
occurrenceId: z.string().uuid(),
|
|
1511
|
+
attendanceMode
|
|
1512
|
+
}), z.object({
|
|
1513
|
+
kind: z.literal("whole_series"),
|
|
1514
|
+
eventSeriesId: z.string().uuid(),
|
|
1515
|
+
attendanceMode,
|
|
1516
|
+
ticketSelections: z.array(ticketSelection).nonempty().readonly(),
|
|
1517
|
+
seatCount: z.number().int().positive(),
|
|
1518
|
+
selectedSlidingAmount: z.number().int().nonnegative().nullable()
|
|
1519
|
+
}).refine((value) => value.seatCount === value.ticketSelections.reduce((total, line) => total + line.quantity, 0), { message: "Seat count must match the reserved selection" })]);
|
|
1520
|
+
const identity = {
|
|
1521
|
+
email: z.string().email(),
|
|
1522
|
+
name: z.string(),
|
|
1523
|
+
phone: z.string().nullable()
|
|
1524
|
+
};
|
|
1525
|
+
/** Decode once before invitation restoration or admission consumes the response. */
|
|
1526
|
+
const waitlistClaimResponseSchema = z.object({
|
|
1527
|
+
subject,
|
|
1528
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
1529
|
+
customer: z.object(identity),
|
|
1530
|
+
prefill: z.object({
|
|
1531
|
+
...identity,
|
|
1532
|
+
notes: z.string().nullable(),
|
|
1533
|
+
guests: z.array(z.object({
|
|
1534
|
+
name: z.string(),
|
|
1535
|
+
email: z.string().nullable().optional(),
|
|
1536
|
+
phone: z.string().nullable()
|
|
1537
|
+
})).readonly()
|
|
1538
|
+
})
|
|
1539
|
+
});
|
|
1540
|
+
//#endregion
|
|
1541
|
+
//#region ../blocks/src/system/runtime/api/deduplication.ts
|
|
1542
|
+
/**
|
|
1543
|
+
* Create a request deduplication cache.
|
|
1544
|
+
*
|
|
1545
|
+
* Concurrent identical GET requests share a single network request.
|
|
1546
|
+
* Results are cached briefly to handle rapid re-renders.
|
|
1547
|
+
*
|
|
1548
|
+
* @example
|
|
1549
|
+
* ```ts
|
|
1550
|
+
* const dedup = createDeduplicationCache({ ttl: 100 });
|
|
1551
|
+
*
|
|
1552
|
+
* // These will share one network request
|
|
1553
|
+
* const [result1, result2] = await Promise.all([
|
|
1554
|
+
* dedup.dedupe('/api/events', () => fetch('/api/events')),
|
|
1555
|
+
* dedup.dedupe('/api/events', () => fetch('/api/events')),
|
|
1556
|
+
* ]);
|
|
1557
|
+
* ```
|
|
1558
|
+
*/
|
|
1559
|
+
function createDeduplicationCache(options = {}) {
|
|
1560
|
+
const { ttl = 100 } = options;
|
|
1561
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1562
|
+
/**
|
|
1563
|
+
* Generate a cache key from method, URL, and params
|
|
1564
|
+
*/
|
|
1565
|
+
function getCacheKey(method, url, params) {
|
|
1566
|
+
return `${method}:${url}:${params ? JSON.stringify(params) : ""}`;
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Deduplicate a request.
|
|
1570
|
+
*
|
|
1571
|
+
* For GET requests, if an identical request is already in-flight or
|
|
1572
|
+
* recently completed, returns the existing promise instead of making
|
|
1573
|
+
* a new request.
|
|
1574
|
+
*
|
|
1575
|
+
* - In-flight requests are always shared (regardless of TTL)
|
|
1576
|
+
* - Settled requests are shared if within TTL of settlement time
|
|
1577
|
+
*
|
|
1578
|
+
* @param key - Unique cache key for this request
|
|
1579
|
+
* @param fetcher - Function that performs the actual fetch
|
|
1580
|
+
* @returns Promise with the response
|
|
1581
|
+
*/
|
|
1582
|
+
async function dedupe(key, fetcher) {
|
|
1583
|
+
const now = Date.now();
|
|
1584
|
+
const existing = cache.get(key);
|
|
1585
|
+
if (existing) {
|
|
1586
|
+
if (!existing.settled) return existing.promise;
|
|
1587
|
+
if (existing.settledTime && now - existing.settledTime < ttl) return existing.promise;
|
|
1588
|
+
}
|
|
1589
|
+
const entry = {
|
|
1590
|
+
promise: fetcher().finally(() => {
|
|
1591
|
+
entry.settled = true;
|
|
1592
|
+
entry.settledTime = Date.now();
|
|
1593
|
+
setTimeout(() => {
|
|
1594
|
+
if (cache.get(key)?.promise === entry.promise) cache.delete(key);
|
|
1595
|
+
}, ttl);
|
|
1596
|
+
}),
|
|
1597
|
+
startTime: now,
|
|
1598
|
+
settled: false
|
|
1599
|
+
};
|
|
1600
|
+
cache.set(key, entry);
|
|
1601
|
+
return entry.promise;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Clear all cached requests
|
|
1605
|
+
*/
|
|
1606
|
+
function clear() {
|
|
1607
|
+
cache.clear();
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Get the number of cached entries (for testing)
|
|
1611
|
+
*/
|
|
1612
|
+
function size() {
|
|
1613
|
+
return cache.size;
|
|
1614
|
+
}
|
|
1615
|
+
return {
|
|
1616
|
+
getCacheKey,
|
|
1617
|
+
dedupe,
|
|
1618
|
+
clear,
|
|
1619
|
+
size
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
//#endregion
|
|
1623
|
+
//#region ../blocks/src/system/runtime/api/client.ts
|
|
1624
|
+
/**
|
|
1625
|
+
* Block API Client
|
|
934
1626
|
*
|
|
935
1627
|
* Factory function for creating a typed API client for block client-side API calls.
|
|
936
1628
|
*/
|
|
@@ -1120,6 +1812,16 @@ function isApiSuccessResponse(json) {
|
|
|
1120
1812
|
function publicEventsQuery(params) {
|
|
1121
1813
|
return { ...params ?? {} };
|
|
1122
1814
|
}
|
|
1815
|
+
/** A portal session is a bearer token, given for portal endpoints or as the client's own auth. */
|
|
1816
|
+
function portalVisitorFor(config) {
|
|
1817
|
+
const auth = config.authOverrides?.portal ?? config.auth;
|
|
1818
|
+
if (auth.type !== "bearer") return null;
|
|
1819
|
+
return createPortalVisitorApi({
|
|
1820
|
+
baseUrl: config.baseUrl,
|
|
1821
|
+
siteId: config.siteId ?? "",
|
|
1822
|
+
sessionToken: auth.token
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1123
1825
|
function createBlockApi(config) {
|
|
1124
1826
|
const { baseUrl, authOverrides, siteId, isPreview, readAuthority } = config;
|
|
1125
1827
|
const auth = readAuthority ? readAuthority.kind === "preview" ? {
|
|
@@ -1187,6 +1889,7 @@ function createBlockApi(config) {
|
|
|
1187
1889
|
}
|
|
1188
1890
|
return {
|
|
1189
1891
|
config,
|
|
1892
|
+
portalVisitor: portalVisitorFor(config),
|
|
1190
1893
|
async submitForm(data) {
|
|
1191
1894
|
return request(FORMS.submit, { body: protectedFormBody(data) });
|
|
1192
1895
|
},
|
|
@@ -1343,10 +2046,30 @@ function createBlockApi(config) {
|
|
|
1343
2046
|
async getRegistrationOptions(data) {
|
|
1344
2047
|
const sid = requireSiteId();
|
|
1345
2048
|
const path = buildPath(EVENTS.registrationOptions.path, { siteId: sid });
|
|
1346
|
-
|
|
2049
|
+
const response = await request(EVENTS.registrationOptions, {
|
|
1347
2050
|
path,
|
|
1348
2051
|
body: data
|
|
1349
2052
|
});
|
|
2053
|
+
if (!isSingleRegistrationOptions(response)) throw new Error("Registration options came back for a selection instead of one booking.");
|
|
2054
|
+
return response;
|
|
2055
|
+
},
|
|
2056
|
+
async getSelectionFunding(data) {
|
|
2057
|
+
const sid = requireSiteId();
|
|
2058
|
+
const path = buildPath(EVENTS.registrationOptions.path, { siteId: sid });
|
|
2059
|
+
return request(EVENTS.registrationOptions, {
|
|
2060
|
+
path,
|
|
2061
|
+
body: data,
|
|
2062
|
+
decoder: selectionFundingResponseSchema
|
|
2063
|
+
});
|
|
2064
|
+
},
|
|
2065
|
+
async getRunsSelectionPayment(data) {
|
|
2066
|
+
const sid = requireSiteId();
|
|
2067
|
+
const path = buildPath(EVENTS.registrationOptions.path, { siteId: sid });
|
|
2068
|
+
return request(EVENTS.registrationOptions, {
|
|
2069
|
+
path,
|
|
2070
|
+
body: data,
|
|
2071
|
+
decoder: runsSelectionPaymentResponseSchema
|
|
2072
|
+
});
|
|
1350
2073
|
},
|
|
1351
2074
|
async checkRegistrationNextStep(data) {
|
|
1352
2075
|
const path = buildPath(EVENTS.registrationNextStep.path, { siteId: requireSiteId() });
|
|
@@ -1485,218 +2208,6 @@ function createBlockApi(config) {
|
|
|
1485
2208
|
decoder: schema
|
|
1486
2209
|
})).siteTerms ?? { kind: "none" };
|
|
1487
2210
|
},
|
|
1488
|
-
async getPortalProfile() {
|
|
1489
|
-
return request(PORTAL.getProfile, { skipDedup: true });
|
|
1490
|
-
},
|
|
1491
|
-
async getPortalCredit() {
|
|
1492
|
-
return (await request(PORTAL.getCredit)).credit;
|
|
1493
|
-
},
|
|
1494
|
-
async getPortalOrders() {
|
|
1495
|
-
return (await request(PORTAL.getOrders)).orders;
|
|
1496
|
-
},
|
|
1497
|
-
async createPortalOrderCheckout(orderId, data) {
|
|
1498
|
-
const path = buildPath(PORTAL.createOrderCheckout.path, { orderId });
|
|
1499
|
-
return request(PORTAL.createOrderCheckout, {
|
|
1500
|
-
path,
|
|
1501
|
-
body: data
|
|
1502
|
-
});
|
|
1503
|
-
},
|
|
1504
|
-
async getPortalDigitalProducts() {
|
|
1505
|
-
return request(PORTAL.getDigitalProducts);
|
|
1506
|
-
},
|
|
1507
|
-
async getPortalDigitalProduct(entitlementId) {
|
|
1508
|
-
const path = buildPath(PORTAL.getDigitalProduct.path, { entitlementId });
|
|
1509
|
-
return request(PORTAL.getDigitalProduct, { path });
|
|
1510
|
-
},
|
|
1511
|
-
async resendPortalDigitalProduct(entitlementId) {
|
|
1512
|
-
const path = buildPath(PORTAL.resendDigitalProduct.path, { entitlementId });
|
|
1513
|
-
await request(PORTAL.resendDigitalProduct, { path });
|
|
1514
|
-
},
|
|
1515
|
-
async getPortalDigitalProductDownloadUrl(entitlementId, assetId) {
|
|
1516
|
-
const path = buildPath(PORTAL.getDigitalProductDownloadUrl.path, {
|
|
1517
|
-
entitlementId,
|
|
1518
|
-
assetId
|
|
1519
|
-
});
|
|
1520
|
-
return request(PORTAL.getDigitalProductDownloadUrl, { path });
|
|
1521
|
-
},
|
|
1522
|
-
async updatePortalProfile(data) {
|
|
1523
|
-
return (await request(PORTAL.updateProfile, { body: data })).profile;
|
|
1524
|
-
},
|
|
1525
|
-
async getPortalPasses() {
|
|
1526
|
-
return (await request(PORTAL.getPasses)).passes;
|
|
1527
|
-
},
|
|
1528
|
-
async getPortalMemberships() {
|
|
1529
|
-
return (await request(PORTAL.getMemberships)).memberships;
|
|
1530
|
-
},
|
|
1531
|
-
getPortalEvents(params) {
|
|
1532
|
-
return request(PORTAL.getEvents, { query: params });
|
|
1533
|
-
},
|
|
1534
|
-
async cancelPortalWaitlist(entryId) {
|
|
1535
|
-
try {
|
|
1536
|
-
return await request(PORTAL.cancelWaitlist, { path: buildPath(PORTAL.cancelWaitlist.path, { entryId }) });
|
|
1537
|
-
} catch (error) {
|
|
1538
|
-
if (error instanceof BlockApiError && error.status === 409) return { outcome: "alreadyClosed" };
|
|
1539
|
-
if (error instanceof BlockApiError && error.status === 404) return { outcome: "notFound" };
|
|
1540
|
-
throw error;
|
|
1541
|
-
}
|
|
1542
|
-
},
|
|
1543
|
-
createPortalAppointmentBookingQuestionsUploadUrl(appointmentId, data) {
|
|
1544
|
-
return request(PORTAL.createAppointmentBookingQuestionsUploadUrl, {
|
|
1545
|
-
path: buildPath(PORTAL.createAppointmentBookingQuestionsUploadUrl.path, { appointmentId }),
|
|
1546
|
-
body: data
|
|
1547
|
-
});
|
|
1548
|
-
},
|
|
1549
|
-
async finalizePortalAppointmentBookingQuestionsUpload(appointmentId, data) {
|
|
1550
|
-
return (await request(PORTAL.finalizeAppointmentBookingQuestionsUpload, {
|
|
1551
|
-
path: buildPath(PORTAL.finalizeAppointmentBookingQuestionsUpload.path, { appointmentId }),
|
|
1552
|
-
body: data
|
|
1553
|
-
})).answer;
|
|
1554
|
-
},
|
|
1555
|
-
createPortalEventBookingQuestionsUploadUrl(registrationId, data) {
|
|
1556
|
-
return request(PORTAL.createEventBookingQuestionsUploadUrl, {
|
|
1557
|
-
path: buildPath(PORTAL.createEventBookingQuestionsUploadUrl.path, { registrationId }),
|
|
1558
|
-
body: data
|
|
1559
|
-
});
|
|
1560
|
-
},
|
|
1561
|
-
async finalizePortalEventBookingQuestionsUpload(registrationId, data) {
|
|
1562
|
-
return (await request(PORTAL.finalizeEventBookingQuestionsUpload, {
|
|
1563
|
-
path: buildPath(PORTAL.finalizeEventBookingQuestionsUpload.path, { registrationId }),
|
|
1564
|
-
body: data
|
|
1565
|
-
})).answer;
|
|
1566
|
-
},
|
|
1567
|
-
createPortalWholeSeriesBookingQuestionsUploadUrl(registrationId, data) {
|
|
1568
|
-
return request(PORTAL.createWholeSeriesBookingQuestionsUploadUrl, {
|
|
1569
|
-
path: buildPath(PORTAL.createWholeSeriesBookingQuestionsUploadUrl.path, { registrationId }),
|
|
1570
|
-
body: data
|
|
1571
|
-
});
|
|
1572
|
-
},
|
|
1573
|
-
async finalizePortalWholeSeriesBookingQuestionsUpload(registrationId, data) {
|
|
1574
|
-
return (await request(PORTAL.finalizeWholeSeriesBookingQuestionsUpload, {
|
|
1575
|
-
path: buildPath(PORTAL.finalizeWholeSeriesBookingQuestionsUpload.path, { registrationId }),
|
|
1576
|
-
body: data
|
|
1577
|
-
})).answer;
|
|
1578
|
-
},
|
|
1579
|
-
async getPortalEventTicket(registrationId) {
|
|
1580
|
-
const path = buildPath(PORTAL.getEventTicket.path, { registrationId });
|
|
1581
|
-
return (await request(PORTAL.getEventTicket, { path })).ticket;
|
|
1582
|
-
},
|
|
1583
|
-
async getPortalAppointments() {
|
|
1584
|
-
return (await request(PORTAL.getAppointments)).appointments;
|
|
1585
|
-
},
|
|
1586
|
-
async getPortalRegularSessions() {
|
|
1587
|
-
return (await request(PORTAL.getRegularSessions)).arrangements;
|
|
1588
|
-
},
|
|
1589
|
-
async getPortalAppointmentBookingQuestions(appointmentId) {
|
|
1590
|
-
const path = buildPath(PORTAL.getAppointmentBookingQuestions.path, { appointmentId });
|
|
1591
|
-
return (await request(PORTAL.getAppointmentBookingQuestions, { path })).task;
|
|
1592
|
-
},
|
|
1593
|
-
async updatePortalAppointmentBookingQuestions(appointmentId, data) {
|
|
1594
|
-
const path = buildPath(PORTAL.updateAppointmentBookingQuestions.path, { appointmentId });
|
|
1595
|
-
return (await request(PORTAL.updateAppointmentBookingQuestions, {
|
|
1596
|
-
path,
|
|
1597
|
-
body: data
|
|
1598
|
-
})).task;
|
|
1599
|
-
},
|
|
1600
|
-
async getPortalEventBookingQuestions(registrationId) {
|
|
1601
|
-
const path = buildPath(PORTAL.getEventBookingQuestions.path, { registrationId });
|
|
1602
|
-
return (await request(PORTAL.getEventBookingQuestions, { path })).task;
|
|
1603
|
-
},
|
|
1604
|
-
async updatePortalEventBookingQuestions(registrationId, data) {
|
|
1605
|
-
const path = buildPath(PORTAL.updateEventBookingQuestions.path, { registrationId });
|
|
1606
|
-
return (await request(PORTAL.updateEventBookingQuestions, {
|
|
1607
|
-
path,
|
|
1608
|
-
body: data
|
|
1609
|
-
})).task;
|
|
1610
|
-
},
|
|
1611
|
-
async getPortalWholeSeriesRegistrations() {
|
|
1612
|
-
return (await request(PORTAL.getWholeSeriesRegistrations)).enrollments;
|
|
1613
|
-
},
|
|
1614
|
-
async getPortalWholeSeriesBookingQuestions(registrationId) {
|
|
1615
|
-
const path = buildPath(PORTAL.getWholeSeriesBookingQuestions.path, { registrationId });
|
|
1616
|
-
return (await request(PORTAL.getWholeSeriesBookingQuestions, { path })).task;
|
|
1617
|
-
},
|
|
1618
|
-
async updatePortalWholeSeriesBookingQuestions(registrationId, data) {
|
|
1619
|
-
const path = buildPath(PORTAL.updateWholeSeriesBookingQuestions.path, { registrationId });
|
|
1620
|
-
return (await request(PORTAL.updateWholeSeriesBookingQuestions, {
|
|
1621
|
-
path,
|
|
1622
|
-
body: data
|
|
1623
|
-
})).task;
|
|
1624
|
-
},
|
|
1625
|
-
async cancelWholeSeriesRegistration(registrationId, options) {
|
|
1626
|
-
const path = buildPath(PORTAL.cancelWholeSeriesRegistration.path, { registrationId });
|
|
1627
|
-
return (await request(PORTAL.cancelWholeSeriesRegistration, {
|
|
1628
|
-
path,
|
|
1629
|
-
body: options ?? {}
|
|
1630
|
-
})).result;
|
|
1631
|
-
},
|
|
1632
|
-
async cancelAppointment(appointmentId, options) {
|
|
1633
|
-
const path = buildPath(PORTAL.cancelAppointment.path, { appointmentId });
|
|
1634
|
-
return (await request(PORTAL.cancelAppointment, {
|
|
1635
|
-
path,
|
|
1636
|
-
body: options ?? {}
|
|
1637
|
-
})).result;
|
|
1638
|
-
},
|
|
1639
|
-
async rescheduleAppointment(appointmentId, data) {
|
|
1640
|
-
const path = buildPath(PORTAL.rescheduleAppointment.path, { appointmentId });
|
|
1641
|
-
return request(PORTAL.rescheduleAppointment, {
|
|
1642
|
-
path,
|
|
1643
|
-
body: data
|
|
1644
|
-
});
|
|
1645
|
-
},
|
|
1646
|
-
async cancelEventRegistration(registrationId, options) {
|
|
1647
|
-
const path = buildPath(PORTAL.cancelEventRegistration.path, { registrationId });
|
|
1648
|
-
return (await request(PORTAL.cancelEventRegistration, {
|
|
1649
|
-
path,
|
|
1650
|
-
body: options ?? {}
|
|
1651
|
-
})).result;
|
|
1652
|
-
},
|
|
1653
|
-
async transferEventRegistration(registrationId, data) {
|
|
1654
|
-
const path = buildPath(PORTAL.transferEventRegistration.path, { registrationId });
|
|
1655
|
-
return (await request(PORTAL.transferEventRegistration, {
|
|
1656
|
-
path,
|
|
1657
|
-
body: data
|
|
1658
|
-
})).result;
|
|
1659
|
-
},
|
|
1660
|
-
async cancelMembershipAtPeriodEnd(customerMembershipId) {
|
|
1661
|
-
const path = buildPath(PORTAL.cancelMembershipAtPeriodEnd.path, { customerMembershipId });
|
|
1662
|
-
return (await request(PORTAL.cancelMembershipAtPeriodEnd, {
|
|
1663
|
-
path,
|
|
1664
|
-
body: {}
|
|
1665
|
-
})).result;
|
|
1666
|
-
},
|
|
1667
|
-
async resumeMembership(customerMembershipId) {
|
|
1668
|
-
const path = buildPath(PORTAL.resumeMembership.path, { customerMembershipId });
|
|
1669
|
-
return (await request(PORTAL.resumeMembership, {
|
|
1670
|
-
path,
|
|
1671
|
-
body: {}
|
|
1672
|
-
})).result;
|
|
1673
|
-
},
|
|
1674
|
-
async listEventRescheduleDates(registrationId, query) {
|
|
1675
|
-
const path = buildPath(PORTAL.listEventRescheduleDates.path, { registrationId });
|
|
1676
|
-
return request(PORTAL.listEventRescheduleDates, {
|
|
1677
|
-
path,
|
|
1678
|
-
query: { ...query },
|
|
1679
|
-
skipDedup: true
|
|
1680
|
-
});
|
|
1681
|
-
},
|
|
1682
|
-
async rescheduleEventRegistration(registrationId, data) {
|
|
1683
|
-
const path = buildPath(PORTAL.rescheduleEventRegistration.path, { registrationId });
|
|
1684
|
-
return (await request(PORTAL.rescheduleEventRegistration, {
|
|
1685
|
-
path,
|
|
1686
|
-
body: data
|
|
1687
|
-
})).result;
|
|
1688
|
-
},
|
|
1689
|
-
async getEventGuests(registrationId) {
|
|
1690
|
-
const path = buildPath(PORTAL.getEventGuests.path, { registrationId });
|
|
1691
|
-
return (await request(PORTAL.getEventGuests, { path })).guests;
|
|
1692
|
-
},
|
|
1693
|
-
async updateEventGuests(registrationId, data) {
|
|
1694
|
-
const path = buildPath(PORTAL.updateEventGuests.path, { registrationId });
|
|
1695
|
-
return (await request(PORTAL.updateEventGuests, {
|
|
1696
|
-
path,
|
|
1697
|
-
body: data
|
|
1698
|
-
})).guests;
|
|
1699
|
-
},
|
|
1700
2211
|
async sendMagicLink(data) {
|
|
1701
2212
|
const sid = requireSiteId();
|
|
1702
2213
|
return request(PORTAL.sendMagicLink, { body: {
|
|
@@ -1721,6 +2232,29 @@ function protectedFormBody({ authorization, ...data }) {
|
|
|
1721
2232
|
}
|
|
1722
2233
|
};
|
|
1723
2234
|
}
|
|
2235
|
+
const occurrenceId = z.string().min(1);
|
|
2236
|
+
/** The same endpoint answers a dates subject with the server's funding plan; the block renders it as sent. */
|
|
2237
|
+
const selectionFundingResponseSchema = z.object({
|
|
2238
|
+
subject: z.object({
|
|
2239
|
+
kind: z.literal("dates"),
|
|
2240
|
+
occurrenceIds: z.tuple([occurrenceId]).rest(occurrenceId).readonly()
|
|
2241
|
+
}),
|
|
2242
|
+
funding: eventSelectionFundingSchema,
|
|
2243
|
+
/** How each way to fund the dates collects its money; older servers don't send it. */
|
|
2244
|
+
payment: eventSelectionPaymentSchema.optional()
|
|
2245
|
+
});
|
|
2246
|
+
const eventSeriesId = z.string().min(1);
|
|
2247
|
+
/** And a runs subject with how those runs can be paid. */
|
|
2248
|
+
const runsSelectionPaymentResponseSchema = z.object({
|
|
2249
|
+
subject: z.object({
|
|
2250
|
+
kind: z.literal("runs"),
|
|
2251
|
+
eventSeriesIds: z.tuple([eventSeriesId]).rest(eventSeriesId).readonly()
|
|
2252
|
+
}),
|
|
2253
|
+
payment: eventSelectionPaymentSchema
|
|
2254
|
+
});
|
|
2255
|
+
function isSingleRegistrationOptions(response) {
|
|
2256
|
+
return response.subject.kind !== "dates" && response.subject.kind !== "runs";
|
|
2257
|
+
}
|
|
1724
2258
|
//#endregion
|
|
1725
2259
|
//#region ../blocks/src/system/runtime/api/blockApiContext.ts
|
|
1726
2260
|
function getGlobalContext() {
|
|
@@ -1800,4 +2334,4 @@ function useBlockApiOptional() {
|
|
|
1800
2334
|
return useContext(BlockApiContext);
|
|
1801
2335
|
}
|
|
1802
2336
|
//#endregion
|
|
1803
|
-
export {
|
|
2337
|
+
export { portalMeUpdateResponseSchema as C, portalTransferEventRegistrationResultSchema as E, portalMeResponseSchema as S, portalRescheduleAppointmentResponseSchema as T, portalDigitalProductsResponseSchema as _, createPortalTransport as a, portalEventRescheduleResultSchema as b, PORTAL as c, portalBookingQuestionsTaskResponseSchema as d, portalBookingQuestionsUploadUrlResponseSchema as f, portalDigitalProductDownloadUrlResponseSchema as g, portalDigitalProductAccessResponseSchema as h, BlockApiError as i, magicLinkResponseSchema as l, portalCancelOutcomeSchema as m, useBlockApi as n, field as o, portalCancelMembershipAtPeriodEndResultSchema as p, useBlockApiOptional as r, isUncertainPortalFailure as s, BlockApiProvider as t, portalBookingQuestionsFinalizeUploadResponseSchema as u, portalEventGuestsResponseSchema as v, portalOrderCheckoutResponseSchema as w, portalEventTicketResponseSchema as x, portalEventRescheduleDatesSchema as y };
|