@riverbankcms/sdk 0.148.0 → 0.150.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.
Files changed (250) hide show
  1. package/README.md +1 -1
  2. package/dist/EventEmbeddedCheckoutStep-D00Kc8Zj.mjs +285 -0
  3. package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-7ZhmmnBB.mjs} +103 -66
  4. package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-BIJucTRd.mjs} +3 -6
  5. package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
  6. package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-tj45gmCX.mjs} +96 -67
  7. package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-BFOt0ss-.mjs} +4804 -4161
  8. package/dist/_dts/ai/src/contracts/proposals.d.ts +660 -0
  9. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +510 -0
  10. package/dist/_dts/api/src/billing.d.ts +2 -2
  11. package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
  12. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
  13. package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
  14. package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
  15. package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
  16. package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
  17. package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
  18. package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
  19. package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
  20. package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
  21. package/dist/_dts/api/src/endpoints.d.ts +2 -10
  22. package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
  23. package/dist/_dts/api/src/footerCompositionContracts.d.ts +9 -0
  24. package/dist/_dts/api/src/footerSettings.d.ts +3 -3
  25. package/dist/_dts/api/src/index.d.ts +4 -4
  26. package/dist/_dts/api/src/navigation/bookingPortalLink.d.ts +13 -0
  27. package/dist/_dts/api/src/navigation.d.ts +1 -0
  28. package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
  29. package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
  30. package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +9 -173
  31. package/dist/_dts/api/src/request.d.ts +1 -1
  32. package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
  33. package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
  34. package/dist/_dts/api/src/sdkThemeWire.d.ts +12 -0
  35. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
  36. package/dist/_dts/api/src/siteOperations.d.ts +6 -2
  37. package/dist/_dts/api/src/siteSettings.d.ts +2 -0
  38. package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
  39. package/dist/_dts/blocks/src/client.d.ts +2 -1
  40. package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
  41. package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
  42. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
  43. package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
  44. package/dist/_dts/blocks/src/rendering/server.d.ts +1 -1
  45. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
  46. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
  47. package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
  48. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
  49. package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
  50. package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +30 -3
  51. package/dist/_dts/blocks/src/system/designCapabilities.d.ts +10 -1
  52. package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
  53. package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
  54. package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
  55. package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +38 -18
  56. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
  57. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
  58. package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
  59. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +1 -1
  60. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +6 -0
  61. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
  62. package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
  63. package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
  64. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +13 -0
  65. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +15 -0
  66. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +0 -1
  67. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/FullyBookedStep.d.ts +6 -0
  68. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.d.ts +3 -0
  69. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +4 -0
  70. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +15 -5
  71. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +4 -2
  72. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
  73. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentLocation.d.ts +3 -0
  74. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +72 -0
  75. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +66 -5
  76. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -4
  77. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +13 -5
  78. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +11 -52
  79. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +19 -2
  80. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +7 -42
  81. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +7 -8
  82. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +94 -24
  83. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useGuestRegistrationRecovery.d.ts +30 -0
  84. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +24 -12
  85. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.d.ts +18 -0
  86. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +6 -1
  87. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +1 -1
  88. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
  89. package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
  90. package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
  91. package/dist/_dts/blocks/src/system/runtime/shared/stripe/browserStripe.d.ts +8 -0
  92. package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +8 -0
  93. package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
  94. package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
  95. package/dist/_dts/commerce/src/purchase/checkoutCopy.d.ts +10 -0
  96. package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
  97. package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
  98. package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
  99. package/dist/_dts/commerce/src/purchase/checkoutPresentation.d.ts +49 -0
  100. package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +6 -6
  101. package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +5 -1
  102. package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
  103. package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +9 -0
  104. package/dist/_dts/commerce/src/purchase/index.d.ts +3 -3
  105. package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
  106. package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
  107. package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
  108. package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
  109. package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +4 -1
  110. package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
  111. package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
  112. package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
  113. package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +9 -2
  114. package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
  115. package/dist/_dts/commerce/src/purchase/types.d.ts +7 -7
  116. package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +3 -2
  117. package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
  118. package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +6 -1
  119. package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
  120. package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +7 -0
  121. package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
  122. package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
  123. package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
  124. package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
  125. package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
  126. package/dist/_dts/core/src/branded.d.ts +3 -0
  127. package/dist/_dts/core/src/edit-lease.d.ts +5 -0
  128. package/dist/_dts/core/src/index.d.ts +4 -0
  129. package/dist/_dts/core/src/patch/index.d.ts +30 -0
  130. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +326 -36
  131. package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
  132. package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
  133. package/dist/_dts/media-editor/src/index.d.ts +2 -0
  134. package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
  135. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
  136. package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
  137. package/dist/_dts/preview-next/src/constants.d.ts +4 -0
  138. package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
  139. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -1
  140. package/dist/_dts/sdk/src/bookings/types.d.ts +1 -1
  141. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
  142. package/dist/_dts/sdk/src/version.d.ts +1 -1
  143. package/dist/_dts/theme-core/src/blocks/index.d.ts +1 -0
  144. package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +147 -0
  145. package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +22 -0
  146. package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +22 -0
  147. package/dist/_dts/theme-core/src/cards/roles.d.ts +12 -0
  148. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  149. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +198 -0
  150. package/dist/_dts/theme-core/src/palette/utils/index.d.ts +2 -0
  151. package/dist/_dts/theme-core/src/palette/utils/scrimContrast.d.ts +22 -0
  152. package/dist/_dts/theme-core/src/runtime/bridgeColourTokens.d.ts +10 -0
  153. package/dist/_dts/theme-core/src/schema.d.ts +330 -0
  154. package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +0 -51
  155. package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +0 -51
  156. package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +11 -0
  157. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +7 -1
  158. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +7 -1
  159. package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
  160. package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +12 -6
  161. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +7 -4
  162. package/dist/_dts/theme-core/src/site-styles/sectionSurfaceBackgrounds.d.ts +65 -0
  163. package/dist/_dts/theme-core/src/site-styles/types.d.ts +17 -0
  164. package/dist/_dts/theme-core/src/surfaces/opaqueSurface.d.ts +43 -0
  165. package/dist/_dts/ui/src/color-picker.d.ts +1 -1
  166. package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
  167. package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-CYHOufsI.mjs} +33 -124
  168. package/dist/client/{CheckboxChoice-B33MqoUo.mjs → CheckboxChoice-M-3HycLw.mjs} +1 -1
  169. package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-Cvr9O_ca.mjs} +2 -2
  170. package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-m5UZIobP.mjs} +7 -7
  171. package/dist/client/EventEmbeddedCheckoutStep-DL6zFAkA.mjs +289 -0
  172. package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-DeMfCM04.mjs} +2 -2
  173. package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CvZ3gOdD.mjs} +1 -1
  174. package/dist/client/{checkoutUrls-CXhko2Rv.mjs → RichText-BtfNvQV6.mjs} +2 -29
  175. package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-CUCNEwlH.mjs} +2 -18
  176. package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-C7WhXuRl.mjs} +2 -2
  177. package/dist/client/{accordion-kjvt49rA.mjs → accordion-cQm5mjqs.mjs} +1 -1
  178. package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-BVPJE5RQ.mjs} +15 -11
  179. package/dist/client/bookings.mjs +2860 -1222
  180. package/dist/client/{carousel-f4Zbmicv.mjs → carousel-3vgnY7LC.mjs} +2 -2
  181. package/dist/client/{carousel.client-A2lG-9od.mjs → carousel.client-CISsdZvg.mjs} +1 -1
  182. package/dist/client/{cart-DO20An50.mjs → cart-BGK4oOjm.mjs} +3 -3
  183. package/dist/client/{checkout-Du5amDR_.mjs → checkout-GsBLUNJD.mjs} +3 -3
  184. package/dist/client/checkoutUrls-ChxwaNtO.mjs +28 -0
  185. package/dist/client/client.mjs +3324 -2053
  186. package/dist/client/{colorStyles-j5U9v5JA.mjs → colorStyles-D-32xHZh.mjs} +2 -30
  187. package/dist/client/{context-eW97E945.mjs → context-D_8s12Fp.mjs} +1 -1
  188. package/dist/client/{dates-jPCirRea.mjs → dates-DeJQbQ9T.mjs} +2 -2
  189. package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-cmucD4NR.mjs} +10 -10
  190. package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-ku3E9FTl.mjs} +4 -4
  191. package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-CyKZ61sF.mjs} +5 -5
  192. package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-B7yxGIhX.mjs} +4 -4
  193. package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-BoXfSFgZ.mjs} +1455 -1184
  194. package/dist/client/{form-BvpfbQaT.mjs → form-CNQOWhJo.mjs} +5 -5
  195. package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-DahaBJGQ.mjs} +3 -3
  196. package/dist/client/hooks.mjs +283 -193
  197. package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BoDjqYlW.mjs} +4 -4
  198. package/dist/client/{media-Cl38iOMI.mjs → media-BFY0y2rb.mjs} +2 -1
  199. package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-DtzXDklw.mjs} +4 -4
  200. package/dist/client/{pricing-BES87mrR.mjs → pricing-DXEh2Lhh.mjs} +1 -1
  201. package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-D7cPa-00.mjs} +3 -3
  202. package/dist/client/{productList-DE7ngEZJ.mjs → productList-D1XMap66.mjs} +3 -3
  203. package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DiIeBopB.mjs} +913 -322
  204. package/dist/client/rendering/client.mjs +3913 -2260
  205. package/dist/client/rendering/islands.mjs +19 -19
  206. package/dist/client/rendering.mjs +3302 -2013
  207. package/dist/client/result-DRW7JWXz.mjs +30 -0
  208. package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-wzR4lKAY.mjs} +1 -1
  209. package/dist/client/scrollToBlock-C86BYkyV.mjs +17 -0
  210. package/dist/client/{shop-CJkuySJ3.mjs → shop-CYT5P-S5.mjs} +13 -14
  211. package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-wKhsJQxI.mjs} +1 -1
  212. package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-ypBu_dx4.mjs} +9 -9
  213. package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DFGhYrf2.mjs} +52 -6
  214. package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-blSbN5o7.mjs} +8 -8
  215. package/dist/preview-next/before-render.mjs +15 -22
  216. package/dist/preview-next/client/runtime.mjs +4 -4
  217. package/dist/preview-next/constants.mjs +5 -1
  218. package/dist/preview-next/index.mjs +5 -1
  219. package/dist/preview-next/keepAlive.mjs +149 -82
  220. package/dist/preview-next/middleware.mjs +15 -22
  221. package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
  222. package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-2p8uQk1V.mjs} +2 -2
  223. package/dist/{separator-CuNhBAhS.mjs → separator-Cvvzk0Oo.mjs} +1 -1
  224. package/dist/server/components.mjs +4041 -3704
  225. package/dist/server/config-validation.mjs +345 -255
  226. package/dist/server/config.mjs +345 -255
  227. package/dist/server/data.mjs +283 -193
  228. package/dist/server/index.mjs +20 -27
  229. package/dist/server/next.mjs +788 -469
  230. package/dist/server/page-converter.mjs +245 -121
  231. package/dist/server/prebuild.mjs +1 -1
  232. package/dist/server/rendering/server.mjs +4018 -3690
  233. package/dist/server/rendering.mjs +4044 -3707
  234. package/dist/server/routing.mjs +314 -190
  235. package/dist/server/server.mjs +290 -218
  236. package/dist/server/theme-bridge.mjs +1122 -310
  237. package/dist/server/theme.mjs +126 -116
  238. package/dist/spinner-CDo6AkDz.mjs +658 -0
  239. package/dist/styles/index.css +75 -212
  240. package/package.json +1 -1
  241. package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
  242. package/dist/_dts/billing/src/checkout/platform.d.ts +0 -77
  243. package/dist/_dts/billing/src/config/env.d.ts +0 -29
  244. package/dist/_dts/billing/src/stripe/client.d.ts +0 -29
  245. package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +0 -63
  246. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +0 -9
  247. package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
  248. package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
  249. package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
  250. package/dist/client/urlParams-D71VXFGx.mjs +0 -47
@@ -1,10 +1,10 @@
1
- import { type NonEmptyArray, type Result } from '../../../core/src/index';
1
+ import { type BookingInstalmentPlanConfig, type NonEmptyArray, type Result } from '../../../core/src/index';
2
2
  import { type CurrencyCode, type Money } from './settlement';
3
3
  import type { CartCheckout } from './types';
4
4
  import type { OrderPaymentMethod, OrderStatus } from './orderTypes';
5
5
  export type CheckoutPlanningError = {
6
6
  _tag: 'CheckoutPlanningError';
7
- code: 'empty_cart';
7
+ code: 'empty_cart' | 'instalment_charge_mismatch';
8
8
  message: string;
9
9
  };
10
10
  type CheckoutPlanningSettledCart = Readonly<{
@@ -33,10 +33,13 @@ export type DeferredManualCheckoutPaymentPlan = CheckoutPaymentPlanBase & Readon
33
33
  }>;
34
34
  export type InstalmentCheckoutPaymentPlan = CheckoutPaymentPlanBase & Readonly<{
35
35
  kind: 'instalment_plan';
36
+ planDefinition: BookingInstalmentPlanConfig;
37
+ /** Charged now; has to be the plan's first instalment of the settled total. */
38
+ chargeNowCents: number;
36
39
  }>;
37
40
  export type FlexibleBalanceCheckoutPaymentPlan = CheckoutPaymentPlanBase & Readonly<{
38
41
  kind: 'flexible_balance';
39
- initialPaymentCents: number;
42
+ chargeNowCents: number;
40
43
  }>;
41
44
  export type OneTimeCheckoutPlanningPaymentPlan = StripeCheckoutPaymentPlan | BypassCheckoutPaymentPlan | DeferredManualCheckoutPaymentPlan | InstalmentCheckoutPaymentPlan | FlexibleBalanceCheckoutPaymentPlan;
42
45
  type CheckoutPlanningContext = Readonly<Record<string, unknown>>;
@@ -56,9 +59,11 @@ export type OrderSettlementPlan<TItem, TDiscount, TDiscountApplication> = Readon
56
59
  discount: TDiscount;
57
60
  discountApplication: TDiscountApplication;
58
61
  }>;
62
+ /** The ways a one-time checkout's order can be paid; passes, memberships and waivers never check out here. */
63
+ export type OneTimeCheckoutOrderPaymentMethod = Extract<OrderPaymentMethod, 'free' | 'store_credit' | 'manual' | 'stripe' | 'mixed'>;
59
64
  export type OrderDraftPlan = Readonly<{
60
65
  status: OrderStatus;
61
- paymentMethod: OrderPaymentMethod;
66
+ paymentMethod: OneTimeCheckoutOrderPaymentMethod;
62
67
  paidTotal: Money<CurrencyCode>;
63
68
  }>;
64
69
  export type OneTimeCheckoutPlan<TContext extends CheckoutPlanningContext, TSettledCart extends CheckoutPlanningSettledCart> = Readonly<{
@@ -1,6 +1,6 @@
1
1
  import { type NonNegativeCents } from '../../../core/src/index';
2
2
  import type { OrderInstalmentPlanStatus, OrderInstalmentStatus } from './orderInstalmentPlan';
3
- type InstalmentClosureReason = 'cancelled' | 'refunded';
3
+ export type InstalmentClosureReason = 'cancelled' | 'refunded';
4
4
  type InstalmentClosurePlanSnapshot = Readonly<{
5
5
  status: OrderInstalmentPlanStatus;
6
6
  remainingBalanceCents: NonNegativeCents;
@@ -15,12 +15,24 @@ type InstalmentStatusUpdate = Readonly<{
15
15
  }>;
16
16
  export type OrderInstalmentClosurePlan = Readonly<{
17
17
  kind: 'already_applied';
18
+ }> | Readonly<{
19
+ kind: 'conflict';
18
20
  }> | Readonly<{
19
21
  kind: 'apply';
20
22
  nextPlanStatus: Extract<OrderInstalmentPlanStatus, 'cancelled' | 'refunded'>;
21
23
  nextRemainingBalanceCents: NonNegativeCents;
22
24
  instalmentUpdates: readonly InstalmentStatusUpdate[];
23
25
  }>;
26
+ /**
27
+ * Whether closing the plan for this reason has nothing to do: it already has
28
+ * that status, or (for a cancel) it isn't live or has nothing left to
29
+ * collect. This only describes local accounting; it never proves that provider
30
+ * collection has stopped.
31
+ */
32
+ export declare function isOrderInstalmentClosureAlreadyApplied(input: Readonly<{
33
+ paymentPlan: InstalmentClosurePlanSnapshot;
34
+ reason: InstalmentClosureReason;
35
+ }>): boolean;
24
36
  export declare function planOrderInstalmentClosure(input: Readonly<{
25
37
  paymentPlan: InstalmentClosurePlanSnapshot;
26
38
  instalments: readonly InstalmentClosureRowSnapshot[];
@@ -25,6 +25,10 @@ export type ApplyRecurringInstalmentPaymentPlan = Readonly<{
25
25
  export type ApplyRecurringInstalmentFailurePlan = Readonly<{
26
26
  kind: 'already_applied';
27
27
  instalmentId: string;
28
+ }>
29
+ /** The plan is finished or closed: a late failed invoice changes nothing. */
30
+ | Readonly<{
31
+ kind: 'plan_closed';
28
32
  }> | Readonly<{
29
33
  kind: 'apply_failure';
30
34
  instalmentId: string;
@@ -38,6 +42,7 @@ export declare function planRecurringInstalmentInvoicePaid(input: Readonly<{
38
42
  amountPaidCents: NonNegativeCents;
39
43
  }>): ApplyRecurringInstalmentPaymentPlan;
40
44
  export declare function planRecurringInstalmentInvoiceFailed(input: Readonly<{
45
+ planStatus: OrderInstalmentPlanStatus;
41
46
  instalments: readonly InstalmentLifecycleRowSnapshot[];
42
47
  stripeInvoiceId: string;
43
48
  }>): ApplyRecurringInstalmentFailurePlan;
@@ -1,6 +1,6 @@
1
1
  import { type StripeBookingCommissionOrderItemMetadata } from './stripeCommissionMetadata';
2
2
  export { parseStripeBookingCommissionMetadata, type StripeBookingCommissionOrderItemMetadata } from './stripeCommissionMetadata';
3
- import { type BrandedIdParseError, type CheckoutLineId, type RetiredCourseId, type CustomerId, type DatedOfferingCapacityHoldAuditRef, type DatedOfferingCapacityHoldId, type EventSeriesId, type EventInstanceId, type OccurrenceId, type PassId, type PricingOptionId, type Result } from '../../../core/src/index';
3
+ import { type BrandedIdParseError, type CheckoutLineId, type RetiredCourseId, type CustomerId, type DatedOfferingCapacityHoldAuditRef, type DatedOfferingCapacityHoldId, type EventSeriesId, type MembershipId, type EventInstanceId, type OccurrenceId, type PassId, type PricingOptionId, type Result } from '../../../core/src/index';
4
4
  import type { OrderItemKind } from './orderTypes';
5
5
  export type CheckoutLineMetadata = Readonly<{
6
6
  checkoutLineId?: CheckoutLineId;
@@ -150,6 +150,9 @@ export type MembershipBundleFulfillmentMetadata = Readonly<{
150
150
  membershipName: string;
151
151
  }>;
152
152
  export type MembershipOrderItemMetadata = CheckoutLineMetadata & StripeBookingCommissionOrderItemMetadata & Readonly<{
153
+ /** Written by checkout; identifies a standalone purchase. Older rows and renewals lack it. */
154
+ membershipId?: MembershipId;
155
+ billingInterval?: 'month' | 'year';
153
156
  bundleFulfillment?: MembershipBundleFulfillmentMetadata;
154
157
  }>;
155
158
  export type OrderItemMetadataByKind = {
@@ -1,6 +1,12 @@
1
1
  export declare const ORDER_STATUSES: readonly ["pending", "paid", "partially_refunded", "refunded", "failed", "cancelled"];
2
2
  export type OrderStatus = (typeof ORDER_STATUSES)[number];
3
3
  export declare function isOrderStatus(value: string): value is OrderStatus;
4
+ /**
5
+ * Orders that ended without being paid: a failed checkout or a cancellation.
6
+ * Nothing is collected or chased against them.
7
+ */
8
+ export declare const CLOSED_ORDER_STATUSES: readonly ["failed", "cancelled"];
9
+ export declare function isClosedOrderStatus(status: string): status is (typeof CLOSED_ORDER_STATUSES)[number];
4
10
  export declare const ORDER_PAYMENT_METHODS: readonly ["stripe", "store_credit", "mixed", "pass_redemption", "membership_access", "free", "manual", "waived"];
5
11
  export type OrderPaymentMethod = (typeof ORDER_PAYMENT_METHODS)[number];
6
12
  export declare function isOrderPaymentMethod(value: string): value is OrderPaymentMethod;
@@ -20,7 +26,7 @@ export declare const RESERVATION_FINALIZATION_STATES: readonly ["not_applicable"
20
26
  export type ReservationFinalizationState = (typeof RESERVATION_FINALIZATION_STATES)[number];
21
27
  export declare function isReservationFinalizationState(value: string): value is ReservationFinalizationState;
22
28
  export type CheckoutPaymentRail = 'bypass' | 'stripe';
23
- export type CheckoutCommitFailureStep = 'credit_consumption' | 'membership_provision' | 'fulfillment' | 'discount_redemption' | 'payment_record';
29
+ export type CheckoutCommitFailureStep = 'credit_consumption' | 'membership_provision' | 'fulfillment' | 'discount_redemption';
24
30
  export type CheckoutCompensationDecision = Readonly<{
25
31
  kind: 'release_reservations';
26
32
  reason: string;
@@ -34,7 +34,7 @@ export declare function computeRailAwareRefundSplit(originalCashCents: NonNegati
34
34
  *
35
35
  * Pure function — just array reduction.
36
36
  */
37
- export declare function summarizePriorRefundsByRail(refunds: ReadonlyArray<RefundWithAllocations>, orderItemId: string): Result<RefundRailSplit, Readonly<{
37
+ export declare function summarizePriorRefundsByRail(refunds: ReadonlyArray<RefundWithAllocations>, orderItemIds: readonly string[]): Result<RefundRailSplit, Readonly<{
38
38
  kind: 'mixed_rail_attribution_missing';
39
39
  }>>;
40
40
  export {};
@@ -1,13 +1,13 @@
1
1
  import { type Result } from '../../../core/src/index';
2
2
  import type { CheckoutCommitFailureStep, CheckoutCompensationDecision, CheckoutPaymentRail, DiscountRedemptionStatus, OrderStatus } from './orderTypes';
3
+ import type { CheckoutCommitProgress } from './checkoutCommitPlan';
3
4
  export type OrderStatusEvent = 'checkout_failed' | 'stripe_payment_completed' | 'cancel' | 'partial_refund' | 'full_refund';
4
5
  export declare function advanceOrderStatus(from: OrderStatus, event: OrderStatusEvent): Result<OrderStatus, string>;
5
6
  export declare function transitionOrderStatusTo(from: OrderStatus, to: OrderStatus): Result<OrderStatus, string>;
6
7
  export declare function classifyCheckoutCompensationDecision(input: {
7
8
  paymentRail: CheckoutPaymentRail;
8
9
  failedStep: CheckoutCommitFailureStep;
9
- reservationsConsumed: boolean;
10
- fulfillmentCommitted: boolean;
10
+ progress: CheckoutCommitProgress;
11
11
  }): CheckoutCompensationDecision;
12
12
  export type DiscountRedemptionEvent = 'redeem' | 'release' | 'expire';
13
13
  export declare function advanceDiscountRedemptionStatus(from: DiscountRedemptionStatus, event: DiscountRedemptionEvent): Result<DiscountRedemptionStatus, string>;
@@ -1,8 +1,15 @@
1
+ import type { CheckoutPresentation } from './checkoutPresentation';
1
2
  export declare const STRIPE_CHECKOUT_SESSION_ID_PLACEHOLDER = "{CHECKOUT_SESSION_ID}";
2
3
  /**
3
- * Completes a Stripe success URL with the session correlation parameter.
4
+ * Completes a Stripe return URL with the session correlation parameter.
4
5
  *
5
6
  * URL owns the query/fragment boundary so the parameter can never be appended
6
7
  * inside a hash fragment. Stripe requires its placeholder to remain literal.
7
8
  */
8
- export declare function ensureStripeCheckoutSessionIdInSuccessUrl(successUrl: string): string;
9
+ export declare function ensureStripeCheckoutSessionIdInReturnUrl(returnUrl: string): string;
10
+ /**
11
+ * The page Stripe returns a completed session to: the checkout's own success
12
+ * (hosted) or return (embedded) URL, with the session filled in where Stripe
13
+ * would have put it.
14
+ */
15
+ export declare function completedStripeCheckoutReturnUrl(presentation: CheckoutPresentation, sessionId: string): string;
@@ -8,3 +8,9 @@ export declare function isStripeChargeBelowMinimum(options: Readonly<{
8
8
  amountCents: number;
9
9
  currency: string;
10
10
  }>): boolean;
11
+ /**
12
+ * The smallest deposit a plan that starts with one may ask for: the card
13
+ * minimum for the currency, or any positive amount for a currency Stripe has
14
+ * no minimum on record for.
15
+ */
16
+ export declare function getInstalmentDepositMinimumCents(currency: string): number;
@@ -1,3 +1,4 @@
1
+ import type { CheckoutMode, CheckoutPresentation } from './checkoutPresentation';
1
2
  /**
2
3
  * Purchase domain types — the unified model for all customer acquisitions.
3
4
  *
@@ -5,6 +6,7 @@
5
6
  * course, membership), it's a Purchase. Payment method is an attribute
6
7
  * of the purchase, not a separate concept (Model B: unified).
7
8
  */
9
+ import type { BookingPaymentCollectionOptionKind } from '../../../core/src/index';
8
10
  import type { OccurrenceId, PricingOptionId, ProductId, ProductVariantId, PassId, MembershipId, CustomerId, OrderId, AttendeeId, CustomerPassId, CustomerMembershipId, EventSeriesRegistrationId, AppointmentId, NonEmptyArray, SiteId, EventSeriesId } from '../../../core/src/index';
9
11
  import type { PositiveCheckoutQuantity } from './checkoutQuantity';
10
12
  export type CheckoutItem = EventTicketItem | ProductItem | PassItem | EventSeriesRegistrationItem | AppointmentItem;
@@ -61,24 +63,22 @@ export type AttendeeInfo = Readonly<{
61
63
  }>;
62
64
  export type AttendeeBearingCheckoutItem = EventTicketItem | EventSeriesRegistrationItem;
63
65
  export type Checkout = CartCheckout | MembershipCheckout;
64
- export type CartCheckout = {
66
+ export type CartCheckout<M extends CheckoutMode = CheckoutMode> = {
65
67
  mode: 'one_time';
66
68
  siteId: SiteId;
67
69
  items: NonEmptyArray<CheckoutItem>;
68
70
  customer: CustomerInfo;
69
71
  discountCode?: string;
70
- collectionOptionKind?: 'upfront' | 'deferred_manual' | 'instalment_plan' | 'flexible_balance';
71
- successUrl: string;
72
- cancelUrl: string;
72
+ collectionOptionKind?: BookingPaymentCollectionOptionKind;
73
+ presentation: CheckoutPresentation<M>;
73
74
  };
74
- export type MembershipCheckout = {
75
+ export type MembershipCheckout<M extends CheckoutMode = CheckoutMode> = {
75
76
  mode: 'subscription';
76
77
  siteId: SiteId;
77
78
  membership: MembershipItem;
78
79
  customer: CustomerInfo;
79
80
  discountCode?: string;
80
- successUrl: string;
81
- cancelUrl: string;
81
+ presentation: CheckoutPresentation<M>;
82
82
  };
83
83
  export type CustomerInfo = {
84
84
  email: string;
@@ -1,5 +1,5 @@
1
1
  import { type FooterCompositionV1, type FooterNavigationLayout } from '../../core/src/index';
2
- import type { FooterRuntimeViewModel } from '../../blocks/src/client/site-chrome';
2
+ import type { FooterAttribution, FooterRuntimeViewModel } from '../../blocks/src/client/site-chrome';
3
3
  import { type FooterEditorTarget, type planFooterEditorView } from './footerComposer';
4
4
  import type { SaveState } from './useFooterComposerState';
5
5
  type FooterPlan = ReturnType<typeof planFooterEditorView>;
@@ -9,7 +9,8 @@ export declare function SaveBadge({ state }: {
9
9
  export declare function FooterPreview({ runtime, }: {
10
10
  runtime: FooterRuntimeViewModel;
11
11
  }): import("react").JSX.Element;
12
- export declare function FooterOverview({ plan, composition, onTarget, onChange, manageLinksHref, manageSettingsHref, navigationLayout, onEngagement, onNavigationLayoutChange, }: {
12
+ export declare function FooterOverview({ attribution, plan, composition, onTarget, onChange, manageLinksHref, manageSettingsHref, navigationLayout, onEngagement, onNavigationLayoutChange, }: {
13
+ attribution: FooterAttribution | null;
13
14
  plan: FooterPlan;
14
15
  composition: FooterCompositionV1;
15
16
  onTarget: (target: FooterEditorTarget) => void;
@@ -0,0 +1,30 @@
1
+ import { type EditorClientId } from '../../../core/src/index';
2
+ /** After the lease TTL, the departed document's lease has expired anyway. */
3
+ export declare const EDIT_LEASE_HANDOVER_TTL_MS: number;
4
+ export type EditLeaseHandover = Readonly<{
5
+ clientId: EditorClientId;
6
+ savedAt: number;
7
+ }>;
8
+ export declare function parseEditLeaseHandover(raw: string | null): EditLeaseHandover | null;
9
+ /** Checked when each acquire is sent, not only when the entry is read. */
10
+ export declare function freshHandover(handover: EditLeaseHandover | null, now: number): EditLeaseHandover | null;
11
+ export type EditLeaseHandoverPort = Readonly<{
12
+ storage: () => Storage | null;
13
+ clientId: () => string;
14
+ now: () => number;
15
+ onPageTransition: (type: 'pagehide' | 'pageshow', listener: (event: PageTransitionEvent) => void) => void;
16
+ }>;
17
+ export type DocumentEditLeaseHandover = Readonly<{
18
+ /** Called by each lease session; only documents that edited hand over. */
19
+ markParticipant: () => void;
20
+ previousClientIdForAcquire: () => EditorClientId | null;
21
+ }>;
22
+ /**
23
+ * One handover per document: it's taken once so lease sessions in the document can't
24
+ * race for it, and it's written from a document listener so it survives the editor
25
+ * unmounting before the page is left. A document that never edited passes on the
26
+ * handover it took, unchanged, so editor → other page → editor still hands over.
27
+ */
28
+ export declare function createDocumentEditLeaseHandover(port: EditLeaseHandoverPort): DocumentEditLeaseHandover;
29
+ export declare function markEditLeaseParticipant(): void;
30
+ export declare function previousEditorClientIdForAcquire(): EditorClientId | null;
@@ -1,4 +1,4 @@
1
- import { type FooterResolvedEngagement, type FooterRuntimeViewModel } from '../../blocks/src/client/site-chrome';
1
+ import { type FooterAttribution, type FooterResolvedEngagement, type FooterRuntimeViewModel } from '../../blocks/src/client/site-chrome';
2
2
  import type { FooterCompositionV1, FooterNavigationLayout, PublicProfile } from '../../core/src/index';
3
3
  export type FooterPreviewRuntimeInput = Readonly<{
4
4
  composition: FooterCompositionV1;
@@ -10,5 +10,10 @@ export type FooterPreviewRuntimeInput = Readonly<{
10
10
  legalRegion: 'integrated' | 'separate';
11
11
  navigationLayout: FooterNavigationLayout;
12
12
  engagement: FooterResolvedEngagement;
13
+ /**
14
+ * The plan's attribution line, from the composition read. The preview adds
15
+ * it the same way the served footer does, so the two match.
16
+ */
17
+ attribution: FooterAttribution | null;
13
18
  }>;
14
19
  export declare function buildFooterPreviewRuntime(input: FooterPreviewRuntimeInput): FooterRuntimeViewModel;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The browser's storage, or null during server rendering or when the browser blocks
3
+ * access (privacy settings, sandboxed frames).
4
+ */
5
+ export declare function browserStorage(kind: 'local' | 'session'): Storage | null;
@@ -29,6 +29,13 @@ export declare function useFooterComposerState({ apiClient, canEdit, initialTarg
29
29
  siteId: import("../../core/src/index").SiteId;
30
30
  target: FooterEditorTarget;
31
31
  setTarget: import("react").Dispatch<import("react").SetStateAction<FooterEditorTarget>>;
32
+ attribution: Readonly<{
33
+ lead: string;
34
+ link: Readonly<{
35
+ href: string;
36
+ label: string;
37
+ }>;
38
+ }> | null;
32
39
  compositionSnapshot: FooterCompositionSnapshot | null;
33
40
  engagementOptions: Readonly<{
34
41
  forms: readonly import("../../api/src/footerSettings").FooterFormSummary[];
@@ -11,7 +11,7 @@ export type BookingFlexibleBalanceConfig = Readonly<{
11
11
  dueDateRule: BookingFlexibleBalanceDueDateRule;
12
12
  depositRefundability: BookingDepositRefundPolicy;
13
13
  }>;
14
- export type BookingFlexibleBalanceContractStatus = 'active' | 'payment_pending' | 'overdue' | 'completed' | 'waived' | 'cancelled_due_to_non_payment' | 'refunded';
14
+ export type BookingFlexibleBalanceContractStatus = 'active' | 'payment_pending' | 'overdue' | 'completed' | 'waived' | 'cancelled_due_to_non_payment' | 'refunded' | 'closed_order_failed';
15
15
  export type BookingFlexibleBalanceReminderKind = 'due_7_days' | 'due_1_day' | 'overdue_1_day';
16
16
  export declare const DEFAULT_FLEXIBLE_BALANCE_STRIPE_MINIMUM_CHARGE_CENTS = 50;
17
17
  export type BookingFlexibleBalanceReminderState = Readonly<{
@@ -30,7 +30,7 @@ export type FlexibleBalancePaymentEligibility = Readonly<{
30
30
  reason: 'overdue' | 'dust_balance';
31
31
  }> | Readonly<{
32
32
  kind: 'unavailable';
33
- reason: 'already_settled' | 'payment_pending' | 'cancelled_due_to_non_payment' | 'refunded' | 'waived';
33
+ reason: 'already_settled' | 'payment_pending' | 'cancelled_due_to_non_payment' | 'refunded' | 'waived' | 'order_failed';
34
34
  }>;
35
35
  export declare function resolveFlexibleBalanceInitialPaymentCents(input: Readonly<{
36
36
  totalAmountCents: number;
@@ -0,0 +1,20 @@
1
+ import { type Result } from './result';
2
+ import { type BookingInstalmentPlanConfig } from './booking-instalments';
3
+ import type { BookingPaymentCollectionOption } from './booking-payment-options';
4
+ /** A plan that starts with a deposit whose deposit is below the card minimum. */
5
+ export type InstalmentDepositBelowMinimum = Readonly<{
6
+ kind: 'instalment_deposit_below_minimum';
7
+ minimumCents: number;
8
+ }>;
9
+ /**
10
+ * A plan that starts with a deposit takes it by card when the customer books
11
+ * and saves the card for the later payments, so the deposit must be at least
12
+ * the card minimum for the site's currency. Plans without a deposit step
13
+ * (equal instalments) charge their first instalment instead and are not
14
+ * checked here.
15
+ */
16
+ export declare function checkInstalmentPlanDeposit(plan: BookingInstalmentPlanConfig, minimumCents: number): Result<void, InstalmentDepositBelowMinimum>;
17
+ /** The deposit check for whichever instalment option a set of payment options offers. */
18
+ export declare function checkPaymentOptionsInstalmentDeposit(allowedOptions: readonly BookingPaymentCollectionOption[], minimumCents: number): Result<void, InstalmentDepositBelowMinimum>;
19
+ /** The one message for a deposit below the minimum, shown in the editor and returned by the server. */
20
+ export declare function describeInstalmentDepositBelowMinimum(failure: InstalmentDepositBelowMinimum, currency: string): string;
@@ -0,0 +1,72 @@
1
+ import type { BookingFlexibleBalanceContractStatus } from './booking-flexible-balance';
2
+ import type { OrderInstalmentPlanStatus } from './booking-instalments';
3
+ /**
4
+ * Whether an order still has payment terms being collected: an instalment plan
5
+ * or a flexible-balance contract that hasn't been settled, closed or cancelled.
6
+ *
7
+ * Both tables are total over their status unions, so a new status is a compile
8
+ * error here until someone decides whether it counts as live.
9
+ */
10
+ declare const LIVE_PLAN_STATUSES: {
11
+ readonly pending_initial_payment: true;
12
+ readonly active: true;
13
+ readonly payment_failed: true;
14
+ readonly reconciliation_required: true;
15
+ readonly completed: false;
16
+ readonly cancelled: false;
17
+ readonly cancelled_as_paid_early: false;
18
+ readonly refunded: false;
19
+ };
20
+ declare const LIVE_CONTRACT_STATUSES: {
21
+ readonly active: true;
22
+ readonly payment_pending: true;
23
+ readonly overdue: true;
24
+ readonly completed: false;
25
+ readonly waived: false;
26
+ readonly refunded: false;
27
+ readonly cancelled_due_to_non_payment: false;
28
+ readonly closed_order_failed: false;
29
+ };
30
+ type LiveKeys<TTable extends Record<string, boolean>> = {
31
+ [K in keyof TTable]: TTable[K] extends true ? K : never;
32
+ }[keyof TTable];
33
+ /** The plan statuses in which instalments are still being collected. */
34
+ export type LiveOrderInstalmentPlanStatus = LiveKeys<typeof LIVE_PLAN_STATUSES>;
35
+ export declare function isLiveOrderInstalmentPlanStatus(status: OrderInstalmentPlanStatus): status is LiveOrderInstalmentPlanStatus;
36
+ /** The contract statuses in which a balance is still being collected. */
37
+ export type LiveFlexibleBalanceContractStatus = LiveKeys<typeof LIVE_CONTRACT_STATUSES>;
38
+ export declare function isLiveFlexibleBalanceContractStatus(status: BookingFlexibleBalanceContractStatus): status is LiveFlexibleBalanceContractStatus;
39
+ export type LivePaymentTermsInput = Readonly<{
40
+ plan: Readonly<{
41
+ status: OrderInstalmentPlanStatus;
42
+ }> | null;
43
+ contract: Readonly<{
44
+ status: BookingFlexibleBalanceContractStatus;
45
+ }> | null;
46
+ }>;
47
+ export declare function hasLivePaymentTerms(input: LivePaymentTermsInput): boolean;
48
+ /** Partial refunds must also protect a cancelled contract that staff can reopen. */
49
+ export declare function paymentTermsBlockPartialRefund(input: LivePaymentTermsInput): boolean;
50
+ /**
51
+ * Whether an instalment plan's remaining balance can take a payment now, by
52
+ * hand or online: it's live and no collection is in flight.
53
+ */
54
+ export declare function isSettleableOrderInstalmentPlanStatus(status: OrderInstalmentPlanStatus): boolean;
55
+ /**
56
+ * Whether a flexible-balance contract's remaining balance can take a payment
57
+ * now, by hand or online: it's live and no collection is in flight.
58
+ */
59
+ export declare function isSettleableFlexibleBalanceContractStatus(status: BookingFlexibleBalanceContractStatus): boolean;
60
+ /**
61
+ * What happens to a flexible-balance contract when its order fails or is
62
+ * retired before it completes. Only a live contract is closed; one that was
63
+ * already settled, waived, refunded, cancelled or closed keeps its status.
64
+ */
65
+ export type FailedOrderContractClosure = Readonly<{
66
+ kind: 'close';
67
+ from: LiveFlexibleBalanceContractStatus;
68
+ }> | Readonly<{
69
+ kind: 'keep';
70
+ }>;
71
+ export declare function decideContractClosureForFailedOrder(status: BookingFlexibleBalanceContractStatus): FailedOrderContractClosure;
72
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { BookingFlexibleBalanceConfig } from './booking-flexible-balance';
2
+ import type { BookingInstalmentPlanConfig } from './booking-instalments';
3
+ import { type Result } from './result';
4
+ /**
5
+ * One way a customer may pay for a booking. This is the single definition of
6
+ * the option type; `booking-payment-schemas.typetest.ts` keeps it equal to the
7
+ * schema's output in both directions.
8
+ */
9
+ export type BookingPaymentCollectionOption = Readonly<{
10
+ kind: 'upfront';
11
+ }> | Readonly<{
12
+ kind: 'deferred_manual';
13
+ }> | Readonly<{
14
+ kind: 'instalment_plan';
15
+ plan: BookingInstalmentPlanConfig;
16
+ }> | Readonly<{
17
+ kind: 'flexible_balance';
18
+ config: BookingFlexibleBalanceConfig;
19
+ }>;
20
+ /** The ways a customer may pay for a booking: the one kind set. */
21
+ export type BookingPaymentCollectionOptionKind = BookingPaymentCollectionOption['kind'];
22
+ export type BookingPaymentOptionKindsError = 'no_options' | 'duplicate_kind' | 'incompatible_collection_options';
23
+ /** Automatic instalments and a flexible balance cannot share one booking offer. */
24
+ export declare function validateBookingPaymentOptionKinds(kinds: readonly BookingPaymentCollectionOptionKind[]): Result<void, BookingPaymentOptionKindsError>;