@riverbankcms/sdk 0.149.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.
- package/dist/EventEmbeddedCheckoutStep-D00Kc8Zj.mjs +285 -0
- package/dist/{PreviewEditorSidebar-DBKln68M.mjs → PreviewEditorSidebar-7ZhmmnBB.mjs} +3 -3
- package/dist/{PreviewEditorUI-DpRX4Mum.mjs → PreviewEditorUI-BIJucTRd.mjs} +2 -2
- package/dist/{SdkPreviewModeRuntime-DJPmPY-r.mjs → SdkPreviewModeRuntime-tj45gmCX.mjs} +4 -3
- package/dist/{SiteChromeCustomizeContext-JYA0cJ_Z.mjs → SiteChromeCustomizeContext-BFOt0ss-.mjs} +4454 -4059
- package/dist/_dts/ai/src/contracts/proposals.d.ts +660 -0
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +510 -0
- package/dist/_dts/api/src/billing.d.ts +2 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +9 -0
- package/dist/_dts/api/src/footerSettings.d.ts +3 -3
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/navigation/bookingPortalLink.d.ts +13 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +9 -173
- package/dist/_dts/api/src/sdkThemeWire.d.ts +12 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/siteSettings.d.ts +2 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +2 -1
- package/dist/_dts/blocks/src/rendering/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +30 -3
- package/dist/_dts/blocks/src/system/designCapabilities.d.ts +10 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +38 -18
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/FullyBookedStep.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +15 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentLocation.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +72 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +66 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +13 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +11 -52
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +19 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +7 -42
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +7 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +90 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useGuestRegistrationRecovery.d.ts +30 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +24 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.d.ts +18 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/stripe/browserStripe.d.ts +8 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/checkoutCopy.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutPresentation.d.ts +49 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +4 -4
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +5 -1
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +9 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +9 -2
- package/dist/_dts/commerce/src/purchase/types.d.ts +5 -6
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +3 -2
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +6 -1
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +7 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/core/src/patch/index.d.ts +30 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +30 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +147 -0
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +22 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +22 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +198 -0
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/palette/utils/scrimContrast.d.ts +22 -0
- package/dist/_dts/theme-core/src/runtime/bridgeColourTokens.d.ts +10 -0
- package/dist/_dts/theme-core/src/schema.d.ts +330 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +11 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +12 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +7 -4
- package/dist/_dts/theme-core/src/site-styles/sectionSurfaceBackgrounds.d.ts +65 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +17 -0
- package/dist/_dts/theme-core/src/surfaces/opaqueSurface.d.ts +43 -0
- package/dist/client/{BookingMailingListNote-Cr3EeTP5.mjs → BookingMailingListNote-CYHOufsI.mjs} +10 -440
- package/dist/client/{CheckboxChoice-B33MqoUo.mjs → CheckboxChoice-M-3HycLw.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-BFGB1Fay.mjs → DemoBookingPortalAccess-Cvr9O_ca.mjs} +2 -2
- package/dist/client/{EventCombined.client-DKYV0_ft.mjs → EventCombined.client-m5UZIobP.mjs} +7 -7
- package/dist/client/EventEmbeddedCheckoutStep-DL6zFAkA.mjs +289 -0
- package/dist/client/{EventListing.client-B9UIcEYc.mjs → EventListing.client-DeMfCM04.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CFLPkP0K.mjs → LeafletStaticMap-CvZ3gOdD.mjs} +1 -1
- package/dist/client/{checkoutUrls-CXhko2Rv.mjs → RichText-BtfNvQV6.mjs} +2 -29
- package/dist/client/{TerminalPanel-JjmgxEsR.mjs → TerminalPanel-CUCNEwlH.mjs} +2 -18
- package/dist/client/{ThemedButton-CKV1Jh2m.mjs → ThemedButton-C7WhXuRl.mjs} +2 -2
- package/dist/client/{accordion-DXWIfT3T.mjs → accordion-cQm5mjqs.mjs} +1 -1
- package/dist/client/{bookingForm-CjZgHNvv.mjs → bookingForm-BVPJE5RQ.mjs} +11 -10
- package/dist/client/bookings.mjs +2668 -1134
- package/dist/client/{carousel-DSLikmvZ.mjs → carousel-3vgnY7LC.mjs} +2 -2
- package/dist/client/{carousel.client-A2lG-9od.mjs → carousel.client-CISsdZvg.mjs} +1 -1
- package/dist/client/{cart-HDjWReFt.mjs → cart-BGK4oOjm.mjs} +3 -3
- package/dist/client/{checkout-CUvRZA3W.mjs → checkout-GsBLUNJD.mjs} +3 -3
- package/dist/client/checkoutUrls-ChxwaNtO.mjs +28 -0
- package/dist/client/client.mjs +3042 -1868
- package/dist/client/{colorStyles-j5U9v5JA.mjs → colorStyles-D-32xHZh.mjs} +2 -30
- package/dist/client/{context-DFmaZa-Q.mjs → context-D_8s12Fp.mjs} +1 -1
- package/dist/client/{dates-BBep1JnF.mjs → dates-DeJQbQ9T.mjs} +2 -2
- package/dist/client/{eventCalendar-zEobhxo4.mjs → eventCalendar-cmucD4NR.mjs} +10 -10
- package/dist/client/{eventCombined-Dp7bz5k-.mjs → eventCombined-ku3E9FTl.mjs} +4 -4
- package/dist/client/{eventDetails-FE-zqTt7.mjs → eventDetails-CyKZ61sF.mjs} +5 -5
- package/dist/client/{eventListing-BMt5snal.mjs → eventListing-B7yxGIhX.mjs} +4 -4
- package/dist/client/{eventRegistration-O6ZxHfOb.mjs → eventRegistration-BoXfSFgZ.mjs} +1403 -857
- package/dist/client/{form-DFa1D8vt.mjs → form-CNQOWhJo.mjs} +5 -5
- package/dist/client/{headerSection-CmjHLR-N.mjs → headerSection-DahaBJGQ.mjs} +3 -3
- package/dist/client/hooks.mjs +123 -64
- package/dist/client/{locationMap-BXKP_lGh.mjs → locationMap-BoDjqYlW.mjs} +4 -4
- package/dist/client/{media-Cl38iOMI.mjs → media-BFY0y2rb.mjs} +2 -1
- package/dist/client/{newsletterForm-CU-HmxGx.mjs → newsletterForm-DtzXDklw.mjs} +4 -4
- package/dist/client/{pricing-KEAEsibq.mjs → pricing-DXEh2Lhh.mjs} +1 -1
- package/dist/client/{productDetail-Ckp7MGnt.mjs → productDetail-D7cPa-00.mjs} +3 -3
- package/dist/client/{productList-D91V0sYa.mjs → productList-D1XMap66.mjs} +3 -3
- package/dist/client/{propsDecoder-DZd6RJeA.mjs → propsDecoder-DiIeBopB.mjs} +758 -245
- package/dist/client/rendering/client.mjs +4381 -2892
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3026 -1852
- package/dist/client/result-DRW7JWXz.mjs +30 -0
- package/dist/client/{routeIslandApiConfig-E1EkhhYY.mjs → routeIslandApiConfig-wzR4lKAY.mjs} +1 -1
- package/dist/client/scrollToBlock-C86BYkyV.mjs +17 -0
- package/dist/client/{shop-4F2jLQPI.mjs → shop-CYT5P-S5.mjs} +8 -8
- package/dist/client/{shop-commerce-store-vicweP2K.mjs → shop-commerce-store-wKhsJQxI.mjs} +1 -1
- package/dist/client/{shop-commerce-BbfCJjB3.mjs → shop-commerce-ypBu_dx4.mjs} +9 -9
- package/dist/client/{shopShared-DlONJt0T.mjs → shopShared-DFGhYrf2.mjs} +52 -6
- package/dist/client/{useEventFilters-COYyL3m7.mjs → useEventFilters-blSbN5o7.mjs} +8 -8
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-CwvFFjB-.mjs → sdk-runtime-2p8uQk1V.mjs} +1 -1
- package/dist/{separator-ByL72zUT.mjs → separator-Cvvzk0Oo.mjs} +1 -1
- package/dist/server/components.mjs +4066 -3765
- package/dist/server/config-validation.mjs +185 -126
- package/dist/server/config.mjs +185 -126
- package/dist/server/data.mjs +123 -64
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +615 -314
- package/dist/server/page-converter.mjs +100 -56
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4041 -3751
- package/dist/server/rendering.mjs +4069 -3768
- package/dist/server/routing.mjs +149 -72
- package/dist/server/server.mjs +124 -65
- package/dist/server/theme-bridge.mjs +1122 -310
- package/dist/server/theme.mjs +126 -116
- package/dist/spinner-CDo6AkDz.mjs +658 -0
- package/dist/styles/index.css +75 -212
- package/package.json +1 -1
- package/dist/_dts/billing/src/checkout/platform.d.ts +0 -77
- package/dist/_dts/billing/src/config/env.d.ts +0 -29
- package/dist/_dts/billing/src/stripe/client.d.ts +0 -29
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +0 -63
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +0 -9
- package/dist/client/urlParams-D71VXFGx.mjs +0 -47
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform Checkout for subscription setup.
|
|
3
|
-
*
|
|
4
|
-
* Creates Stripe Checkout sessions for users who need to set up a subscription
|
|
5
|
-
* to cover their platform costs (site fees, etc.). One builder serves both
|
|
6
|
-
* presentations: hosted Checkout, where the customer is redirected to Stripe's
|
|
7
|
-
* page, and embedded Checkout, mounted in our own page with a client secret.
|
|
8
|
-
*/
|
|
9
|
-
import { getStripeClient } from '../stripe/client';
|
|
10
|
-
export type PlatformCheckoutStripeDeps = {
|
|
11
|
-
getStripeClient: typeof getStripeClient;
|
|
12
|
-
};
|
|
13
|
-
type PlatformCheckoutPresentationFields = {
|
|
14
|
-
/** Stripe's own page: the customer leaves our site and comes back to one of these. */
|
|
15
|
-
hosted: Readonly<{
|
|
16
|
-
successUrl: string;
|
|
17
|
-
cancelUrl: string;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Mounted in our page. Stripe forbids success and cancel URLs here, and
|
|
21
|
-
* comes back to `returnUrl` with the session id appended.
|
|
22
|
-
*/
|
|
23
|
-
embedded: Readonly<{
|
|
24
|
-
returnUrl: string;
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
type PlatformCheckoutSessionHandles = {
|
|
28
|
-
hosted: Readonly<{
|
|
29
|
-
checkoutUrl: string;
|
|
30
|
-
}>;
|
|
31
|
-
/** `livemode` says which publishable key can mount the session. */
|
|
32
|
-
embedded: Readonly<{
|
|
33
|
-
clientSecret: string;
|
|
34
|
-
livemode: boolean;
|
|
35
|
-
}>;
|
|
36
|
-
};
|
|
37
|
-
export type PlatformCheckoutMode = keyof PlatformCheckoutPresentationFields;
|
|
38
|
-
export type PlatformCheckoutPresentation<M extends PlatformCheckoutMode = PlatformCheckoutMode> = {
|
|
39
|
-
[K in M]: Readonly<{
|
|
40
|
-
mode: K;
|
|
41
|
-
}> & PlatformCheckoutPresentationFields[K];
|
|
42
|
-
}[M];
|
|
43
|
-
export type PlatformCheckoutSession<M extends PlatformCheckoutMode = PlatformCheckoutMode> = {
|
|
44
|
-
[K in M]: Readonly<{
|
|
45
|
-
kind: K;
|
|
46
|
-
sessionId: string;
|
|
47
|
-
}> & PlatformCheckoutSessionHandles[K];
|
|
48
|
-
}[M];
|
|
49
|
-
export type CreatePlatformCheckoutOptions<M extends PlatformCheckoutMode = PlatformCheckoutMode> = Readonly<{
|
|
50
|
-
/** Stable for one checkout attempt and safe to pass to Stripe retries. */
|
|
51
|
-
idempotencyKey: string;
|
|
52
|
-
/** Stripe customer ID */
|
|
53
|
-
customerId: string;
|
|
54
|
-
/** Total price in cents */
|
|
55
|
-
priceAmountCents: number;
|
|
56
|
-
/** Currency code (e.g., 'gbp') */
|
|
57
|
-
currency: string;
|
|
58
|
-
/** Stripe product ID for platform subscriptions */
|
|
59
|
-
productId: string;
|
|
60
|
-
/** Hosted or embedded, with the URLs each one allows. */
|
|
61
|
-
presentation: PlatformCheckoutPresentation<M>;
|
|
62
|
-
/** Trial period in days (optional) */
|
|
63
|
-
trialDays?: number;
|
|
64
|
-
/** Additional metadata */
|
|
65
|
-
metadata?: Record<string, string>;
|
|
66
|
-
}>;
|
|
67
|
-
export declare function withCheckoutSessionIdReturn(returnUrl: string): string;
|
|
68
|
-
/**
|
|
69
|
-
* Create a Stripe Checkout session for platform subscription setup.
|
|
70
|
-
*
|
|
71
|
-
* Uses inline price_data so the database remains the source of truth for pricing.
|
|
72
|
-
* The result matches the requested presentation: a URL to redirect to for
|
|
73
|
-
* hosted Checkout, or a client secret to mount for embedded Checkout.
|
|
74
|
-
*/
|
|
75
|
-
export declare function createPlatformCheckoutSession<M extends PlatformCheckoutMode>(options: CreatePlatformCheckoutOptions<M>): Promise<PlatformCheckoutSession<M>>;
|
|
76
|
-
export declare function createPlatformCheckoutSessionWithDeps<M extends PlatformCheckoutMode>(deps: PlatformCheckoutStripeDeps, options: CreatePlatformCheckoutOptions<M>): Promise<PlatformCheckoutSession<M>>;
|
|
77
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
type StripeEnv = {
|
|
2
|
-
apiKey: string;
|
|
3
|
-
webhookSecret?: string;
|
|
4
|
-
/** Webhook secret for Connect account-status events (account.updated, etc.) */
|
|
5
|
-
webhookSecretConnectStatus?: string;
|
|
6
|
-
/** Webhook secret for Connect booking/payment events. */
|
|
7
|
-
webhookSecretConnectBookings?: string;
|
|
8
|
-
/** Optional direct-account API key for emergency non-Connect site payments. */
|
|
9
|
-
directApiKey?: string;
|
|
10
|
-
/** Optional webhook secret paired with directApiKey. */
|
|
11
|
-
directWebhookSecret?: string;
|
|
12
|
-
/** Optional site allowlist (comma-separated UUIDs) for direct-account mode. */
|
|
13
|
-
directSiteIds?: string;
|
|
14
|
-
/** Optional stable account reference used for direct-account records. */
|
|
15
|
-
directAccountReference?: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Check if Stripe is properly configured for basic operations.
|
|
19
|
-
* Only requires STRIPE_API_KEY - sufficient for Account Links flow.
|
|
20
|
-
*
|
|
21
|
-
* Use this before attempting Stripe operations to provide helpful error messages.
|
|
22
|
-
*/
|
|
23
|
-
export declare function isStripeConfigured(): {
|
|
24
|
-
configured: boolean;
|
|
25
|
-
missing: string[];
|
|
26
|
-
};
|
|
27
|
-
export declare function getStripeEnv(): StripeEnv;
|
|
28
|
-
export declare function resetStripeEnvCache(): void;
|
|
29
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import Stripe from 'stripe';
|
|
2
|
-
export declare function isDirectStripeAccountReference(stripeAccountId: string): boolean;
|
|
3
|
-
export declare function createDirectStripeAccountReference(siteId: string): string;
|
|
4
|
-
export declare function getStripeClientForApiKey(apiKey: string): Stripe;
|
|
5
|
-
export declare function getStripeClient(): Stripe;
|
|
6
|
-
/**
|
|
7
|
-
* Resolve a Stripe client for a payment-account reference.
|
|
8
|
-
*
|
|
9
|
-
* - Connect refs (acct_*) use the platform key + Stripe-Account header.
|
|
10
|
-
* - Direct refs (direct:*) use STRIPE_DIRECT_API_KEY and no Stripe-Account header.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getStripeClientForAccountReference(stripeAccountId?: string): Stripe;
|
|
13
|
-
export declare function resetStripeClient(): void;
|
|
14
|
-
/**
|
|
15
|
-
* Get Stripe request options for Connect accounts.
|
|
16
|
-
* Use this when making API calls on behalf of a connected account.
|
|
17
|
-
*
|
|
18
|
-
* @param stripeAccountId - The connected account ID (acct_xxx)
|
|
19
|
-
* @returns Stripe request options with stripeAccount header
|
|
20
|
-
*/
|
|
21
|
-
export declare function getConnectRequestOptions(stripeAccountId: string): Stripe.RequestOptions;
|
|
22
|
-
/**
|
|
23
|
-
* Get request options for Stripe API calls.
|
|
24
|
-
* Returns Connect options if stripeAccountId is provided, undefined otherwise.
|
|
25
|
-
*
|
|
26
|
-
* @param stripeAccountId - Optional connected account ID
|
|
27
|
-
* @returns Request options or undefined for platform calls
|
|
28
|
-
*/
|
|
29
|
-
export declare function getStripeRequestOptions(stripeAccountId?: string): Stripe.RequestOptions | undefined;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook for polling payment status after Stripe redirects.
|
|
3
|
-
*
|
|
4
|
-
* Built on top of the generic usePolling hook, this provides
|
|
5
|
-
* a specialized interface for verifying event registration payments.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* const verification = usePaymentVerification(
|
|
10
|
-
* step === 'verifying-payment' && attendeeId
|
|
11
|
-
* ? { transactionId: attendeeId }
|
|
12
|
-
* : null
|
|
13
|
-
* );
|
|
14
|
-
*
|
|
15
|
-
* useEffect(() => {
|
|
16
|
-
* if (verification.status === 'completed') {
|
|
17
|
-
* setStep('success');
|
|
18
|
-
* } else if (verification.status === 'failed') {
|
|
19
|
-
* setStep('payment-failed');
|
|
20
|
-
* } else if (verification.status === 'timeout') {
|
|
21
|
-
* setStep('verifying-timeout');
|
|
22
|
-
* }
|
|
23
|
-
* }, [verification.status]);
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
import { useBlockApi } from '../api';
|
|
27
|
-
import type { PaymentStatus, AttendeeStatus, EventRegistrationStatusReference } from '../api/types';
|
|
28
|
-
export type PaymentVerificationConfig = {
|
|
29
|
-
reference: EventRegistrationStatusReference;
|
|
30
|
-
/** Max polling attempts (default: 10) */
|
|
31
|
-
maxAttempts?: number;
|
|
32
|
-
/** Interval between polls in ms (default: 1000) */
|
|
33
|
-
pollInterval?: number;
|
|
34
|
-
};
|
|
35
|
-
export type PaymentVerificationResult = {
|
|
36
|
-
/** Current verification status */
|
|
37
|
-
status: 'idle' | 'polling' | 'completed' | 'failed' | 'timeout';
|
|
38
|
-
/** Payment status from backend (null while polling or on timeout) */
|
|
39
|
-
paymentStatus: PaymentStatus | null;
|
|
40
|
-
/** Attendee status from backend (null while polling or on timeout) */
|
|
41
|
-
attendeeStatus: AttendeeStatus | null;
|
|
42
|
-
/** Waitlist position if applicable */
|
|
43
|
-
waitlistPosition: number | null;
|
|
44
|
-
/** Error message if failed or timed out */
|
|
45
|
-
error: string | null;
|
|
46
|
-
/** Manually trigger a poll (useful for retry after timeout) */
|
|
47
|
-
retry: () => void;
|
|
48
|
-
};
|
|
49
|
-
export type PaymentVerificationDeps = Readonly<{
|
|
50
|
-
useBlockApi: typeof useBlockApi;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Hook for polling payment status after Stripe redirects.
|
|
54
|
-
*
|
|
55
|
-
* Pass config to start polling, or null to stop/idle.
|
|
56
|
-
* The hook handles cleanup on unmount and starts a new cycle when the status
|
|
57
|
-
* reference changes.
|
|
58
|
-
*
|
|
59
|
-
* @param config - Configuration for polling, or null to stop
|
|
60
|
-
* @returns Verification result with status, data, and retry function
|
|
61
|
-
*/
|
|
62
|
-
export declare function usePaymentVerification(config: PaymentVerificationConfig | null): PaymentVerificationResult;
|
|
63
|
-
export declare function usePaymentVerificationWithDeps(config: PaymentVerificationConfig | null, deps: PaymentVerificationDeps): PaymentVerificationResult;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type CheckoutHandoffRestoreDeps = Readonly<{
|
|
2
|
-
addPageShowListener: (listener: (event: PageTransitionEvent) => void) => void;
|
|
3
|
-
removePageShowListener: (listener: (event: PageTransitionEvent) => void) => void;
|
|
4
|
-
reloadAtRegistration: () => void;
|
|
5
|
-
}>;
|
|
6
|
-
export declare function eventRegistrationReloadTarget(location: Pick<Location, 'pathname' | 'search'>): string;
|
|
7
|
-
export declare function useEventCheckoutHandoffRestore(active: boolean): void;
|
|
8
|
-
export declare function useEventCheckoutHandoffRestoreWithDeps(active: boolean, deps: CheckoutHandoffRestoreDeps): void;
|
|
9
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region ../blocks/src/system/runtime/shared/utils/urlParams.ts
|
|
2
|
-
/**
|
|
3
|
-
* URL param helpers for client-side "return from redirect" flows.
|
|
4
|
-
*
|
|
5
|
-
* Used for flows like magic-link login or Stripe checkout return URLs where
|
|
6
|
-
* we want to:
|
|
7
|
-
* - read a query param once
|
|
8
|
-
* - remove it from the URL (so refresh doesn't re-trigger)
|
|
9
|
-
* - preserve hash fragments
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Consume a query param from the current URL's search string.
|
|
13
|
-
*
|
|
14
|
-
* Returns the param value (if present) and removes it from the URL via
|
|
15
|
-
* history.replaceState, preserving hash.
|
|
16
|
-
*/
|
|
17
|
-
function consumeSearchParam(paramName) {
|
|
18
|
-
const url = new URL(window.location.href);
|
|
19
|
-
const value = url.searchParams.get(paramName);
|
|
20
|
-
if (value === null) return null;
|
|
21
|
-
url.searchParams.delete(paramName);
|
|
22
|
-
const newUrl = url.pathname + (url.search ? url.search : "") + url.hash;
|
|
23
|
-
window.history.replaceState({}, "", newUrl);
|
|
24
|
-
return value;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Consume multiple query params from the current URL's search string.
|
|
28
|
-
*
|
|
29
|
-
* Returns a record of consumed values (missing params are null) and removes
|
|
30
|
-
* all provided params from the URL in a single replaceState call.
|
|
31
|
-
*/
|
|
32
|
-
function consumeSearchParams(paramNames) {
|
|
33
|
-
const url = new URL(window.location.href);
|
|
34
|
-
const values = Object.fromEntries(paramNames.map((name) => [name, url.searchParams.get(name)]));
|
|
35
|
-
let changed = false;
|
|
36
|
-
for (const name of paramNames) if (url.searchParams.has(name)) {
|
|
37
|
-
url.searchParams.delete(name);
|
|
38
|
-
changed = true;
|
|
39
|
-
}
|
|
40
|
-
if (changed) {
|
|
41
|
-
const newUrl = url.pathname + (url.search ? url.search : "") + url.hash;
|
|
42
|
-
window.history.replaceState({}, "", newUrl);
|
|
43
|
-
}
|
|
44
|
-
return values;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { consumeSearchParams as n, consumeSearchParam as t };
|