@riverbankcms/sdk 0.64.0 → 0.68.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 +21 -11
- package/dist/_dts/api/src/aiPlayground.d.ts +75 -20
- package/dist/_dts/api/src/apiEndpointTypes.d.ts +12 -0
- package/dist/_dts/api/src/billing.d.ts +7 -40
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +4 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +33 -2
- package/dist/_dts/api/src/endpoints.d.ts +32 -0
- package/dist/_dts/api/src/public/types.d.ts +1 -1
- package/dist/_dts/api/src/sdkConfig/contracts.d.ts +0 -40
- package/dist/_dts/api/src/sdkContracts.d.ts +1 -1
- package/dist/_dts/api/src/siteMembers.d.ts +1 -1
- package/dist/_dts/api/src/siteOperations.d.ts +1 -1
- package/dist/_dts/billing/src/components/index.d.ts +426 -0
- package/dist/_dts/billing/src/plans/types.d.ts +1 -1
- package/dist/_dts/blocks/src/PageRenderer.d.ts +4 -0
- package/dist/_dts/blocks/src/bindings/index.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +6 -0
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableDates.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +140 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useVisibleTabPolling.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.default-ui.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +484 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +5 -2
- package/dist/_dts/blocks/src/system/transforms/registry/formatting.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +2 -1
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +81 -0
- package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +7 -3
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +5 -2
- package/dist/_dts/sdk/src/bookings/types.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/commands/push/execute/footer.d.ts +33 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +32 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +5 -1
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/env.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/site-commands/commandKeys.d.ts +13 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +144 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntimeCompat.d.ts +21 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +27 -0
- package/dist/_dts/sdk/src/cli/site-commands/datedOfferingCommands.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/site-commands/entryCommands.d.ts +29 -49
- package/dist/_dts/sdk/src/cli/site-commands/footerCommands.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/site-commands/formCommands.d.ts +53 -0
- package/dist/_dts/sdk/src/cli/site-commands/index.d.ts +6 -0
- package/dist/_dts/sdk/src/cli/site-commands/navigationCommands.d.ts +53 -0
- package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +79 -0
- package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +19 -20
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionPlan.d.ts +8 -0
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionTypes.d.ts +97 -0
- package/dist/_dts/sdk/src/cli/site-commands/residualSettingsTrimming.d.ts +15 -0
- package/dist/_dts/sdk/src/cli/sync/executor.d.ts +10 -28
- package/dist/_dts/sdk/src/cli/sync/index.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/sync/syncResultAggregation.d.ts +4 -0
- package/dist/_dts/sdk/src/config/dashboard-validation.d.ts +0 -48
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +2 -0
- package/dist/_dts/sdk/src/theme-bridge/ThemeBridgeProvider.d.ts +4 -4
- package/dist/_dts/sdk/src/theme-bridge/generateCssVars.d.ts +4 -12
- package/dist/_dts/sdk/src/theme-bridge/index.d.ts +1 -1
- package/dist/_dts/sdk/src/theme-bridge/types.d.ts +17 -9
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/adapter.d.ts +2 -2
- package/dist/_dts/site-commands/src/commands.d.ts +637 -13
- package/dist/_dts/site-commands/src/domain.d.ts +3 -3
- package/dist/_dts/site-commands/src/exposure.d.ts +41 -0
- package/dist/_dts/site-commands/src/index.d.ts +2 -0
- package/dist/_dts/site-commands/src/metadata.d.ts +159 -3
- package/dist/_dts/site-commands/src/planner.d.ts +13 -6
- package/dist/_dts/site-commands/src/refContributions.d.ts +1 -0
- package/dist/_dts/site-commands/src/refs.d.ts +19 -1
- package/dist/_dts/{sdk/src/cli/merge-remote → site-commands/src}/stableJson.d.ts +2 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/index.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/palette/utils/onColor.d.ts +2 -0
- package/dist/_dts/theme-core/src/runtime/buildThemeRuntimeFromBridge.d.ts +30 -23
- package/dist/_dts/theme-core/src/site-styles/accessibleSurfaces.d.ts +83 -0
- package/dist/_dts/theme-core/src/site-styles/contentTemplateRuntimeCompiler.d.ts +2 -1
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +89 -12
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +8 -2
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +3 -2
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +9 -6
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/cli/index.mjs +4736 -2026
- package/dist/client/bookings.mjs +5107 -3348
- package/dist/client/client.mjs +4579 -3871
- package/dist/client/hooks.mjs +325 -123
- package/dist/client/rendering/client.mjs +4474 -3869
- package/dist/client/rendering/islands.mjs +4234 -3639
- package/dist/client/rendering.mjs +4508 -3798
- package/dist/preview-next/before-render.mjs +75 -13
- package/dist/preview-next/client/runtime.mjs +3700 -2644
- package/dist/preview-next/middleware.mjs +75 -13
- package/dist/server/components.mjs +698 -383
- package/dist/server/config-validation.mjs +327 -125
- package/dist/server/config.mjs +327 -125
- package/dist/server/data.mjs +325 -123
- package/dist/server/index.mjs +92 -16
- package/dist/server/next.mjs +692 -377
- package/dist/server/page-converter.mjs +159 -41
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +700 -383
- package/dist/server/rendering.mjs +700 -383
- package/dist/server/routing.mjs +406 -131
- package/dist/server/server.mjs +326 -124
- package/dist/server/theme-bridge.mjs +1226 -4697
- package/dist/styles/index.css +38 -38
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/runtime/components/booking/DateTimeSelectionStep.d.ts +0 -18
- package/dist/_dts/blocks/src/system/runtime/components/booking/PaymentOptionSelectionStep.d.ts +0 -9
- package/dist/_dts/blocks/src/system/runtime/components/booking/ServiceResourceSelector.d.ts +0 -44
- package/dist/_dts/blocks/src/system/runtime/components/booking/ServiceResourceSelector.state.d.ts +0 -23
- package/dist/_dts/blocks/src/system/runtime/components/booking/ServiceSelectionStep.d.ts +0 -18
- package/dist/_dts/blocks/src/system/runtime/components/booking/slotDisplay.d.ts +0 -2
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/MultiStepForm.d.ts +0 -21
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/useMultiStep.d.ts +0 -15
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/useMultiStep.state.d.ts +0 -51
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingSteps.d.ts +0 -22
- package/dist/_dts/path-utils/src/index.d.ts +0 -8
- package/dist/_dts/path-utils/src/redirectPaths.d.ts +0 -26
- package/dist/_dts/path-utils/src/safeAppPath.d.ts +0 -26
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type BlockApiConfig } from "../api";
|
|
3
|
+
import type { AutoAppliedDiscountPreview } from "../api/types";
|
|
4
|
+
import type { BookingFormConfig, BookingFormData, BookingFormService, BookingSelectedCollectionOptionKind } from "../nodes/booking-form.state";
|
|
5
|
+
import { type BookingPaymentSelectionViewModel } from "../shared/bookingPaymentOptions";
|
|
6
|
+
import { createBookingBlockApiConfig, type BookingAppointmentPackagesModel, type BookingFieldValue, type BookingFieldView, type BookingFlowActionResult, type BookingFlowFeedback, type BookingFlowStatus, type BookingFlowView, type BookingResourceView, type BookingFlowStep, type BookingFlowStepId, type BookingSlotView, type BookingSubmitActionResult, type BookingSubmitOptions, type LoadState } from "./useHeadlessBookingFlow.state";
|
|
7
|
+
export type { BlockApiConfig };
|
|
8
|
+
export type { BookingAppointmentPackagesModel };
|
|
9
|
+
export { createBookingBlockApiConfig };
|
|
10
|
+
export type HeadlessBookingFlowOptions = Readonly<{
|
|
11
|
+
siteId: string;
|
|
12
|
+
formId: string;
|
|
13
|
+
form: BookingFormConfig | null;
|
|
14
|
+
services: readonly BookingFormService[];
|
|
15
|
+
initialServiceId?: string;
|
|
16
|
+
initialResourceId?: string;
|
|
17
|
+
initialData?: Partial<BookingFormData>;
|
|
18
|
+
requiresServiceSelection?: boolean;
|
|
19
|
+
requiresResourceSelection?: boolean;
|
|
20
|
+
shouldAutoSelectSingleResource?: boolean;
|
|
21
|
+
enableAppointmentPackages?: boolean;
|
|
22
|
+
spamProtectionEnabled?: boolean;
|
|
23
|
+
successMessage?: string;
|
|
24
|
+
anchorId?: string;
|
|
25
|
+
viewerTimeZone?: string;
|
|
26
|
+
navigateToCheckout?: (checkoutUrl: string) => void;
|
|
27
|
+
}>;
|
|
28
|
+
export type BookingServicesModel = Readonly<{
|
|
29
|
+
items: readonly BookingFormService[];
|
|
30
|
+
selected: BookingFormService | null;
|
|
31
|
+
defaultServiceId?: string;
|
|
32
|
+
requiresSelection: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
export type BookingResourcesModel = Readonly<{
|
|
35
|
+
items: readonly BookingResourceView[];
|
|
36
|
+
selected: BookingResourceView | null;
|
|
37
|
+
selectedResourceId?: string;
|
|
38
|
+
state: LoadState<readonly BookingResourceView[]>;
|
|
39
|
+
requiresSelection: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
export type BookingAvailabilityModel = Readonly<{
|
|
42
|
+
selectedDate?: string;
|
|
43
|
+
availableDates: readonly string[];
|
|
44
|
+
selectedSlot: BookingSlotView | null;
|
|
45
|
+
slots: readonly BookingSlotView[];
|
|
46
|
+
datesState: LoadState<readonly string[]>;
|
|
47
|
+
slotsState: LoadState<readonly BookingSlotView[]>;
|
|
48
|
+
timezone: string;
|
|
49
|
+
hasMoreDates: boolean;
|
|
50
|
+
loadMoreDates: () => void;
|
|
51
|
+
}>;
|
|
52
|
+
export type BookingFieldsModel = Readonly<{
|
|
53
|
+
items: readonly BookingFieldView[];
|
|
54
|
+
values: Readonly<Record<string, BookingFieldValue>>;
|
|
55
|
+
errors: Readonly<Record<string, string>>;
|
|
56
|
+
touched: Readonly<Record<string, boolean>>;
|
|
57
|
+
}>;
|
|
58
|
+
export type BookingPaymentModel = Readonly<{
|
|
59
|
+
kind: "unsupported";
|
|
60
|
+
mode: "unsupported";
|
|
61
|
+
selection: null;
|
|
62
|
+
selectedCollectionOptionKind?: BookingSelectedCollectionOptionKind;
|
|
63
|
+
selectedAppointmentPackageId?: string;
|
|
64
|
+
appointmentPackages: BookingAppointmentPackagesModel;
|
|
65
|
+
errorMessage: string;
|
|
66
|
+
}> | Readonly<{
|
|
67
|
+
kind: "ok";
|
|
68
|
+
mode: "hidden" | "disclosure_only" | "choice_required";
|
|
69
|
+
selection: BookingPaymentSelectionViewModel | null;
|
|
70
|
+
selectedCollectionOptionKind?: BookingSelectedCollectionOptionKind;
|
|
71
|
+
selectedAppointmentPackageId?: string;
|
|
72
|
+
appointmentPackages: BookingAppointmentPackagesModel;
|
|
73
|
+
}>;
|
|
74
|
+
export type BookingDiscountModel = Readonly<{
|
|
75
|
+
code: string;
|
|
76
|
+
isOpen: boolean;
|
|
77
|
+
manualCodeEntryAllowed: boolean;
|
|
78
|
+
loading: boolean;
|
|
79
|
+
autoAppliedDiscount: AutoAppliedDiscountPreview | null;
|
|
80
|
+
setCode: (code: string) => void;
|
|
81
|
+
setOpen: (isOpen: boolean) => void;
|
|
82
|
+
clear: () => void;
|
|
83
|
+
}>;
|
|
84
|
+
export type BookingSpamProtectionModel = Readonly<{
|
|
85
|
+
enabled: false;
|
|
86
|
+
}> | Readonly<{
|
|
87
|
+
enabled: true;
|
|
88
|
+
provider: "altcha";
|
|
89
|
+
challenge: {
|
|
90
|
+
url: string;
|
|
91
|
+
auto: "onfocus";
|
|
92
|
+
};
|
|
93
|
+
solution: string | null;
|
|
94
|
+
}>;
|
|
95
|
+
export type BookingFlowActions = Readonly<{
|
|
96
|
+
selectService: (serviceId: string) => void;
|
|
97
|
+
selectResource: (resourceId: string | null) => void;
|
|
98
|
+
selectDate: (date: string | null) => void;
|
|
99
|
+
selectSlot: (slot: BookingSlotView | null) => void;
|
|
100
|
+
updateField: (fieldId: string, value: BookingFieldValue) => void;
|
|
101
|
+
markFieldTouched: (fieldId: string) => void;
|
|
102
|
+
selectPaymentOption: (kind: BookingSelectedCollectionOptionKind | null) => void;
|
|
103
|
+
selectAppointmentPackage: (packageId: string | null) => void;
|
|
104
|
+
setDiscountCode: (code: string) => void;
|
|
105
|
+
clearDiscountCode: () => void;
|
|
106
|
+
setAltchaSolution: (solution: string | null) => void;
|
|
107
|
+
invalidateSpamProtection: () => void;
|
|
108
|
+
next: () => Promise<BookingFlowActionResult>;
|
|
109
|
+
back: () => void;
|
|
110
|
+
/**
|
|
111
|
+
* Moves to a visible step without validating previous steps. Consumers that
|
|
112
|
+
* want linear progression should consult `steps[].canEnter` or call `next()`.
|
|
113
|
+
*/
|
|
114
|
+
goToStep: (stepId: BookingFlowStepId) => Promise<BookingFlowActionResult>;
|
|
115
|
+
submit: (options?: BookingSubmitOptions) => Promise<BookingSubmitActionResult>;
|
|
116
|
+
reset: () => void;
|
|
117
|
+
clearFeedback: () => void;
|
|
118
|
+
}>;
|
|
119
|
+
export type HeadlessBookingFlow = Readonly<{
|
|
120
|
+
status: BookingFlowStatus;
|
|
121
|
+
view: BookingFlowView;
|
|
122
|
+
steps: readonly BookingFlowStep[];
|
|
123
|
+
currentStep: BookingFlowStep | null;
|
|
124
|
+
data: Partial<BookingFormData>;
|
|
125
|
+
services: BookingServicesModel;
|
|
126
|
+
resources: BookingResourcesModel;
|
|
127
|
+
availability: BookingAvailabilityModel;
|
|
128
|
+
fields: BookingFieldsModel;
|
|
129
|
+
payment: BookingPaymentModel;
|
|
130
|
+
discount: BookingDiscountModel;
|
|
131
|
+
spamProtection: BookingSpamProtectionModel;
|
|
132
|
+
feedback: BookingFlowFeedback;
|
|
133
|
+
actions: BookingFlowActions;
|
|
134
|
+
}>;
|
|
135
|
+
export type HeadlessBookingProviderProps = Readonly<{
|
|
136
|
+
config: BlockApiConfig;
|
|
137
|
+
children?: React.ReactNode;
|
|
138
|
+
}>;
|
|
139
|
+
export declare function HeadlessBookingProvider({ config, children, }: HeadlessBookingProviderProps): React.ReactElement;
|
|
140
|
+
export declare function useHeadlessBookingFlow(options: HeadlessBookingFlowOptions): HeadlessBookingFlow;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { bookingFlowReducer, buildBookingAvailabilityQuery, buildBookingStepPlan, buildBookingSubmitPlan, createBookingBlockApiConfig, createEmptyBookingValidationErrors, createFieldBookingValidationErrors, createFormBookingValidationError, createInitialBookingFlowReducerState, describeUnknownError, deriveBookingFieldViews, deriveBookingFlowSteps, getAppointmentBookingOverrideInput, hasBookingValidationErrors, resolveAppointmentPackagesModel, resolveAvailabilitySelectionInvalidation, resolveHeadlessBookingStatus, resolveHeadlessBookingView, toBookingFormData, toBookingSlotView, toBookingSlotViews, validateBookingField, validateBookingFields, validateBookingStep, } from "../nodes/booking-form.headless.state";
|
|
2
|
+
export type { AppointmentBookingOverrideData, AppointmentBookingOverrideInput, AppointmentBookingOverrideInputResult, AppointmentBookingOverridePropsLike, BookingAvailabilityQuery, BookingAppointmentPackagesModel, BookingAppointmentPackagesUnavailableReason, BookingFieldValue, BookingFieldView, BookingFlowActionResult, BookingFlowFeedback, BookingFlowStatus, BookingFlowStep, BookingFlowStepId, BookingFlowView, BookingResourceView, BookingSlotView, BookingSubmitActionResult, BookingSubmitOptions, BookingValidationErrors, DerivedBookingFlowSteps, DeriveBookingFlowStepsInput, LoadState, } from "../nodes/booking-form.headless.state";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const MIN_AVAILABILITY_REFRESH_INTERVAL_MS = 15000;
|
|
2
|
+
type UseVisibleTabPollingOptions = {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
intervalMs: number;
|
|
5
|
+
jitterMs: number;
|
|
6
|
+
minVisibleRefreshIntervalMs?: number;
|
|
7
|
+
onPoll: () => Promise<void> | void;
|
|
8
|
+
};
|
|
9
|
+
export declare function useVisibleTabPolling({ enabled, intervalMs, jitterMs, minVisibleRefreshIntervalMs, onPoll, }: UseVisibleTabPollingOptions): void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HeadlessBookingFlow } from "../hooks/useHeadlessBookingFlow";
|
|
3
|
+
type HeadlessBookingDefaultFormProps = Readonly<{
|
|
4
|
+
booking: HeadlessBookingFlow;
|
|
5
|
+
onSubmit: () => Promise<void>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function HeadlessBookingDefaultForm({ booking, onSubmit, }: HeadlessBookingDefaultFormProps): React.ReactElement;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
import type { BlockApiConfig, EligibleAppointmentPackage } from "../api/types";
|
|
2
|
+
import type { TimeSlot } from "../api/types";
|
|
3
|
+
import type { BookingFormConfig, BookingFormData, BookingFormField, BookingPaymentStepResolution, BookingFormServicesSource, BookingFormService, BookingSelectedCollectionOptionKind, BookingSubmissionData } from "./booking-form.state";
|
|
4
|
+
export type LoadState<T> = Readonly<{
|
|
5
|
+
tag: "idle";
|
|
6
|
+
}> | Readonly<{
|
|
7
|
+
tag: "loading";
|
|
8
|
+
}> | Readonly<{
|
|
9
|
+
tag: "loaded";
|
|
10
|
+
value: T;
|
|
11
|
+
}> | Readonly<{
|
|
12
|
+
tag: "error";
|
|
13
|
+
message: string;
|
|
14
|
+
}>;
|
|
15
|
+
export type BookingFlowStepId = "service-selection" | "datetime-selection" | "payment-selection" | "custom-fields";
|
|
16
|
+
export type BookingFlowStepState = "complete" | "active" | "available" | "blocked" | "hidden";
|
|
17
|
+
export type BookingFlowStep = Readonly<{
|
|
18
|
+
id: BookingFlowStepId;
|
|
19
|
+
label: string;
|
|
20
|
+
state: BookingFlowStepState;
|
|
21
|
+
index: number;
|
|
22
|
+
visibleIndex: number | null;
|
|
23
|
+
errors: BookingValidationErrors;
|
|
24
|
+
canEnter: boolean;
|
|
25
|
+
canLeave: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
export type BookingValidationErrors = Readonly<{
|
|
28
|
+
formError: string | null;
|
|
29
|
+
fieldErrors: Readonly<Record<string, string>>;
|
|
30
|
+
}>;
|
|
31
|
+
export type BookingFieldValue = string | number | boolean | readonly string[] | null;
|
|
32
|
+
export type BookingSlotView = Readonly<{
|
|
33
|
+
key: string;
|
|
34
|
+
startAt: string;
|
|
35
|
+
endAt: string;
|
|
36
|
+
resourceId: string;
|
|
37
|
+
resourceName?: string;
|
|
38
|
+
label?: string;
|
|
39
|
+
}>;
|
|
40
|
+
export type BookingResourceView = Readonly<{
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
}>;
|
|
44
|
+
export type BookingFlowFeedback = Readonly<{
|
|
45
|
+
kind: "none";
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
kind: "success";
|
|
48
|
+
message: string;
|
|
49
|
+
resourceName: string | null;
|
|
50
|
+
}> | Readonly<{
|
|
51
|
+
kind: "error";
|
|
52
|
+
scope: "submission" | "verification" | "discount" | "altcha" | "availability" | "payment";
|
|
53
|
+
message: string;
|
|
54
|
+
}> | Readonly<{
|
|
55
|
+
kind: "info";
|
|
56
|
+
scope: "verification" | "payment";
|
|
57
|
+
message: string;
|
|
58
|
+
}>;
|
|
59
|
+
export type AvailabilitySelectionInvalidation = Readonly<{
|
|
60
|
+
kind: "preserve";
|
|
61
|
+
}> | Readonly<{
|
|
62
|
+
kind: "date_unavailable";
|
|
63
|
+
message: string;
|
|
64
|
+
}> | Readonly<{
|
|
65
|
+
kind: "slot_unavailable";
|
|
66
|
+
message: string;
|
|
67
|
+
}>;
|
|
68
|
+
export type BookingFlowStatus = Readonly<{
|
|
69
|
+
tag: "ready";
|
|
70
|
+
}> | Readonly<{
|
|
71
|
+
tag: "submitting";
|
|
72
|
+
}> | Readonly<{
|
|
73
|
+
tag: "success";
|
|
74
|
+
resourceName: string | null;
|
|
75
|
+
}> | Readonly<{
|
|
76
|
+
tag: "error";
|
|
77
|
+
message: string;
|
|
78
|
+
}>;
|
|
79
|
+
export type BookingFlowView = Readonly<{
|
|
80
|
+
kind: "missing";
|
|
81
|
+
message: string;
|
|
82
|
+
}> | Readonly<{
|
|
83
|
+
kind: "form";
|
|
84
|
+
}> | Readonly<{
|
|
85
|
+
kind: "success";
|
|
86
|
+
message: string;
|
|
87
|
+
resourceName: string | null;
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
kind: "error";
|
|
90
|
+
message: string;
|
|
91
|
+
}>;
|
|
92
|
+
export type BookingFlowActionResult = Readonly<{
|
|
93
|
+
ok: true;
|
|
94
|
+
}> | Readonly<{
|
|
95
|
+
ok: false;
|
|
96
|
+
reason: "validation-failed";
|
|
97
|
+
errors: BookingValidationErrors;
|
|
98
|
+
}> | Readonly<{
|
|
99
|
+
ok: false;
|
|
100
|
+
reason: "blocked";
|
|
101
|
+
message: string;
|
|
102
|
+
}> | Readonly<{
|
|
103
|
+
ok: false;
|
|
104
|
+
reason: "submission-failed";
|
|
105
|
+
message: string;
|
|
106
|
+
}>;
|
|
107
|
+
export type BookingSubmitOptions = Readonly<{
|
|
108
|
+
/**
|
|
109
|
+
* Checkout return URLs apply only to standard paid bookings. Appointment
|
|
110
|
+
* package submissions complete directly through the portal booking API and
|
|
111
|
+
* intentionally ignore these URLs.
|
|
112
|
+
*/
|
|
113
|
+
redirect?: "manual" | "auto";
|
|
114
|
+
successUrl?: string;
|
|
115
|
+
cancelUrl?: string;
|
|
116
|
+
}>;
|
|
117
|
+
export type BookingSubmitActionResult = Readonly<{
|
|
118
|
+
ok: true;
|
|
119
|
+
outcome: {
|
|
120
|
+
kind: "booked";
|
|
121
|
+
appointmentId: string;
|
|
122
|
+
resourceName: string | null;
|
|
123
|
+
};
|
|
124
|
+
}> | Readonly<{
|
|
125
|
+
ok: true;
|
|
126
|
+
outcome: {
|
|
127
|
+
kind: "checkout_redirect";
|
|
128
|
+
checkoutUrl: string;
|
|
129
|
+
};
|
|
130
|
+
}> | Exclude<BookingFlowActionResult, Readonly<{
|
|
131
|
+
ok: true;
|
|
132
|
+
}>>;
|
|
133
|
+
export type BookingFieldView = Readonly<{
|
|
134
|
+
field: BookingFormField;
|
|
135
|
+
id: string;
|
|
136
|
+
label: string;
|
|
137
|
+
type: BookingFormField["type"];
|
|
138
|
+
value: BookingFieldValue;
|
|
139
|
+
required: boolean;
|
|
140
|
+
error: string | null;
|
|
141
|
+
helpText: string | null;
|
|
142
|
+
inputId: string;
|
|
143
|
+
labelId: string;
|
|
144
|
+
helpTextId: string | null;
|
|
145
|
+
errorId: string | null;
|
|
146
|
+
describedBy: string | undefined;
|
|
147
|
+
ariaInvalid: boolean;
|
|
148
|
+
}>;
|
|
149
|
+
export type BookingFlowReducerState = Readonly<{
|
|
150
|
+
currentStepId: BookingFlowStepId;
|
|
151
|
+
selectedServiceId?: string;
|
|
152
|
+
selectedResourceId?: string;
|
|
153
|
+
selectedDate?: string;
|
|
154
|
+
selectedSlot: BookingSlotView | null;
|
|
155
|
+
fieldValues: Readonly<Record<string, BookingFieldValue>>;
|
|
156
|
+
touchedFields: Readonly<Record<string, boolean>>;
|
|
157
|
+
discountCode: string;
|
|
158
|
+
selectedCollectionOptionKind?: BookingSelectedCollectionOptionKind;
|
|
159
|
+
selectedAppointmentPackageId?: string;
|
|
160
|
+
altchaSolution: string | null;
|
|
161
|
+
validationErrors: BookingValidationErrors;
|
|
162
|
+
feedback: BookingFlowFeedback;
|
|
163
|
+
isSubmitting: boolean;
|
|
164
|
+
}>;
|
|
165
|
+
export type BookingFlowEvent = Readonly<{
|
|
166
|
+
type: "service-selected";
|
|
167
|
+
serviceId: string;
|
|
168
|
+
}> | Readonly<{
|
|
169
|
+
type: "resource-selected";
|
|
170
|
+
resourceId: string | null;
|
|
171
|
+
}> | Readonly<{
|
|
172
|
+
type: "date-selected";
|
|
173
|
+
date: string | null;
|
|
174
|
+
}> | Readonly<{
|
|
175
|
+
type: "slot-selected";
|
|
176
|
+
slot: BookingSlotView | null;
|
|
177
|
+
}> | Readonly<{
|
|
178
|
+
type: "field-updated";
|
|
179
|
+
fieldId: string;
|
|
180
|
+
value: BookingFieldValue;
|
|
181
|
+
}> | Readonly<{
|
|
182
|
+
type: "field-touched";
|
|
183
|
+
fieldId: string;
|
|
184
|
+
}> | Readonly<{
|
|
185
|
+
type: "payment-option-selected";
|
|
186
|
+
kind: BookingSelectedCollectionOptionKind | null;
|
|
187
|
+
}> | Readonly<{
|
|
188
|
+
type: "appointment-package-selected";
|
|
189
|
+
packageId: string | null;
|
|
190
|
+
}> | Readonly<{
|
|
191
|
+
type: "discount-code-changed";
|
|
192
|
+
code: string;
|
|
193
|
+
}> | Readonly<{
|
|
194
|
+
type: "altcha-solution-set";
|
|
195
|
+
solution: string | null;
|
|
196
|
+
}> | Readonly<{
|
|
197
|
+
type: "altcha-solution-invalidated";
|
|
198
|
+
}> | Readonly<{
|
|
199
|
+
type: "step-changed";
|
|
200
|
+
stepId: BookingFlowStepId;
|
|
201
|
+
}> | Readonly<{
|
|
202
|
+
type: "validation-errors-set";
|
|
203
|
+
errors: BookingValidationErrors;
|
|
204
|
+
}> | Readonly<{
|
|
205
|
+
type: "feedback-set";
|
|
206
|
+
feedback: BookingFlowFeedback;
|
|
207
|
+
}> | Readonly<{
|
|
208
|
+
type: "availability-selection-invalidated";
|
|
209
|
+
invalidation: Exclude<AvailabilitySelectionInvalidation, {
|
|
210
|
+
kind: "preserve";
|
|
211
|
+
}>;
|
|
212
|
+
}> | Readonly<{
|
|
213
|
+
type: "feedback-cleared";
|
|
214
|
+
}> | Readonly<{
|
|
215
|
+
type: "submission-started";
|
|
216
|
+
}> | Readonly<{
|
|
217
|
+
type: "submission-finished";
|
|
218
|
+
}> | Readonly<{
|
|
219
|
+
type: "reset";
|
|
220
|
+
initial: BookingFlowReducerState;
|
|
221
|
+
}>;
|
|
222
|
+
export type BuildBookingStepPlanInput = Readonly<{
|
|
223
|
+
form: BookingFormConfig | null;
|
|
224
|
+
services: readonly BookingFormService[];
|
|
225
|
+
data: Partial<BookingFormData>;
|
|
226
|
+
defaultServiceId?: string;
|
|
227
|
+
defaultResourceId?: string;
|
|
228
|
+
requiresServiceSelection?: boolean;
|
|
229
|
+
requiresResourceSelection?: boolean;
|
|
230
|
+
enableAppointmentPackages?: boolean;
|
|
231
|
+
}>;
|
|
232
|
+
export type BookingStepPlanItem = Readonly<{
|
|
233
|
+
id: BookingFlowStepId;
|
|
234
|
+
label: string;
|
|
235
|
+
visible: boolean;
|
|
236
|
+
}>;
|
|
237
|
+
export type BookingStepValidationResult = Readonly<{
|
|
238
|
+
ok: true;
|
|
239
|
+
}> | Readonly<{
|
|
240
|
+
ok: false;
|
|
241
|
+
errors: BookingValidationErrors;
|
|
242
|
+
}>;
|
|
243
|
+
export type DeriveBookingFlowStepsInput = Readonly<{
|
|
244
|
+
form: BookingFormConfig | null;
|
|
245
|
+
services: readonly BookingFormService[];
|
|
246
|
+
data: Partial<BookingFormData>;
|
|
247
|
+
defaultServiceId?: string;
|
|
248
|
+
defaultResourceId?: string;
|
|
249
|
+
currentStepId: BookingFlowStepId;
|
|
250
|
+
requiresServiceSelection?: boolean;
|
|
251
|
+
requiresResourceSelection?: boolean;
|
|
252
|
+
enableAppointmentPackages?: boolean;
|
|
253
|
+
}>;
|
|
254
|
+
export type DerivedBookingFlowSteps = Readonly<{
|
|
255
|
+
steps: readonly BookingFlowStep[];
|
|
256
|
+
currentStepIndex: number;
|
|
257
|
+
currentStep: BookingFlowStep | null;
|
|
258
|
+
stepIds: readonly BookingFlowStepId[];
|
|
259
|
+
validations: ReadonlyMap<BookingFlowStepId, BookingStepValidationResult>;
|
|
260
|
+
}>;
|
|
261
|
+
export type BookingAvailabilityQuery = Readonly<{
|
|
262
|
+
ok: true;
|
|
263
|
+
key: string;
|
|
264
|
+
serviceId: string;
|
|
265
|
+
resourceId?: string;
|
|
266
|
+
selectedDate?: string;
|
|
267
|
+
timezone: string;
|
|
268
|
+
}> | Readonly<{
|
|
269
|
+
ok: false;
|
|
270
|
+
reason: "missing-service" | "missing-date";
|
|
271
|
+
key: string;
|
|
272
|
+
}>;
|
|
273
|
+
export type BookingSubmitRedirectMode = "manual" | "auto";
|
|
274
|
+
export type BookingSubmitPlan = Readonly<{
|
|
275
|
+
ok: true;
|
|
276
|
+
redirect: BookingSubmitRedirectMode;
|
|
277
|
+
value: BookingSubmissionData;
|
|
278
|
+
}> | Readonly<{
|
|
279
|
+
ok: false;
|
|
280
|
+
errors: BookingValidationErrors;
|
|
281
|
+
message: string;
|
|
282
|
+
}>;
|
|
283
|
+
export type BookingAppointmentPackagesModel = Readonly<{
|
|
284
|
+
kind: "disabled";
|
|
285
|
+
enabled: false;
|
|
286
|
+
canLoad: false;
|
|
287
|
+
unavailableReason: "disabled";
|
|
288
|
+
state: Readonly<{
|
|
289
|
+
tag: "idle";
|
|
290
|
+
}>;
|
|
291
|
+
items: readonly [];
|
|
292
|
+
selected: null;
|
|
293
|
+
}> | Readonly<{
|
|
294
|
+
kind: "unavailable";
|
|
295
|
+
enabled: true;
|
|
296
|
+
canLoad: false;
|
|
297
|
+
unavailableReason: "missing-portal-auth" | "missing-priced-service";
|
|
298
|
+
state: Readonly<{
|
|
299
|
+
tag: "idle";
|
|
300
|
+
}>;
|
|
301
|
+
items: readonly [];
|
|
302
|
+
selected: null;
|
|
303
|
+
}> | Readonly<{
|
|
304
|
+
kind: "idle";
|
|
305
|
+
enabled: true;
|
|
306
|
+
canLoad: true;
|
|
307
|
+
unavailableReason: null;
|
|
308
|
+
state: Readonly<{
|
|
309
|
+
tag: "idle";
|
|
310
|
+
}>;
|
|
311
|
+
items: readonly [];
|
|
312
|
+
selected: null;
|
|
313
|
+
}> | Readonly<{
|
|
314
|
+
kind: "loading";
|
|
315
|
+
enabled: true;
|
|
316
|
+
canLoad: true;
|
|
317
|
+
unavailableReason: null;
|
|
318
|
+
state: Readonly<{
|
|
319
|
+
tag: "loading";
|
|
320
|
+
}>;
|
|
321
|
+
items: readonly [];
|
|
322
|
+
selected: null;
|
|
323
|
+
}> | Readonly<{
|
|
324
|
+
kind: "error";
|
|
325
|
+
enabled: true;
|
|
326
|
+
canLoad: true;
|
|
327
|
+
unavailableReason: null;
|
|
328
|
+
state: Readonly<{
|
|
329
|
+
tag: "error";
|
|
330
|
+
message: string;
|
|
331
|
+
}>;
|
|
332
|
+
items: readonly [];
|
|
333
|
+
selected: null;
|
|
334
|
+
}> | Readonly<{
|
|
335
|
+
kind: "ready";
|
|
336
|
+
enabled: true;
|
|
337
|
+
canLoad: true;
|
|
338
|
+
unavailableReason: null;
|
|
339
|
+
state: Readonly<{
|
|
340
|
+
tag: "loaded";
|
|
341
|
+
value: readonly EligibleAppointmentPackage[];
|
|
342
|
+
}>;
|
|
343
|
+
items: readonly EligibleAppointmentPackage[];
|
|
344
|
+
selected: EligibleAppointmentPackage | null;
|
|
345
|
+
}>;
|
|
346
|
+
export type BookingAppointmentPackagesUnavailableReason = "disabled" | "missing-portal-auth" | "missing-priced-service";
|
|
347
|
+
export type AppointmentBookingOverrideData = Readonly<{
|
|
348
|
+
form?: BookingFormConfig | Record<string, unknown> | null;
|
|
349
|
+
services?: BookingFormServicesSource | Record<string, unknown> | null;
|
|
350
|
+
}>;
|
|
351
|
+
export type AppointmentBookingOverrideContent = Readonly<{
|
|
352
|
+
formId?: string;
|
|
353
|
+
serviceId?: string;
|
|
354
|
+
resourceId?: string;
|
|
355
|
+
requiresServiceSelection?: boolean;
|
|
356
|
+
requiresResourceSelection?: boolean;
|
|
357
|
+
shouldAutoSelectSingleResource?: boolean;
|
|
358
|
+
spamProtectionEnabled?: boolean;
|
|
359
|
+
successMessage?: string;
|
|
360
|
+
}>;
|
|
361
|
+
export type AppointmentBookingOverridePropsLike = Readonly<{
|
|
362
|
+
content?: AppointmentBookingOverrideContent | null;
|
|
363
|
+
data?: AppointmentBookingOverrideData | Record<string, unknown> | null;
|
|
364
|
+
siteId?: string;
|
|
365
|
+
apiBaseUrl?: string;
|
|
366
|
+
portalToken?: string | null;
|
|
367
|
+
blockId?: string | null;
|
|
368
|
+
}>;
|
|
369
|
+
export type AppointmentBookingOverrideInput = Readonly<{
|
|
370
|
+
siteId: string;
|
|
371
|
+
apiBaseUrl: string;
|
|
372
|
+
portalToken: string | null;
|
|
373
|
+
formId: string;
|
|
374
|
+
form: BookingFormConfig;
|
|
375
|
+
services: readonly BookingFormService[];
|
|
376
|
+
initialServiceId?: string;
|
|
377
|
+
initialResourceId?: string;
|
|
378
|
+
requiresServiceSelection: boolean;
|
|
379
|
+
requiresResourceSelection: boolean;
|
|
380
|
+
shouldAutoSelectSingleResource: boolean;
|
|
381
|
+
spamProtectionEnabled?: boolean;
|
|
382
|
+
successMessage?: string;
|
|
383
|
+
blockId?: string | null;
|
|
384
|
+
}>;
|
|
385
|
+
export type AppointmentBookingOverrideInputResult = Readonly<{
|
|
386
|
+
ok: true;
|
|
387
|
+
value: AppointmentBookingOverrideInput;
|
|
388
|
+
}> | Readonly<{
|
|
389
|
+
ok: false;
|
|
390
|
+
reason: "missing-site-id" | "missing-api-base-url" | "missing-form" | "missing-form-id" | "missing-services";
|
|
391
|
+
message: string;
|
|
392
|
+
}>;
|
|
393
|
+
export declare function createEmptyBookingValidationErrors(): BookingValidationErrors;
|
|
394
|
+
export declare function createFormBookingValidationError(formError: string): BookingValidationErrors;
|
|
395
|
+
export declare function createFieldBookingValidationErrors(fieldErrors: Readonly<Record<string, string>>): BookingValidationErrors;
|
|
396
|
+
export declare function hasBookingValidationErrors(errors: BookingValidationErrors): boolean;
|
|
397
|
+
export declare function createInitialBookingFlowReducerState(input: Readonly<{
|
|
398
|
+
defaultServiceId?: string;
|
|
399
|
+
defaultResourceId?: string;
|
|
400
|
+
initialData?: Partial<BookingFormData>;
|
|
401
|
+
}>): BookingFlowReducerState;
|
|
402
|
+
export declare function bookingFlowReducer(state: BookingFlowReducerState, event: BookingFlowEvent): BookingFlowReducerState;
|
|
403
|
+
export declare function resolveAvailabilitySelectionInvalidation(input: Readonly<{
|
|
404
|
+
selectedDate?: string;
|
|
405
|
+
selectedSlot: BookingSlotView | null;
|
|
406
|
+
availableDates: readonly string[];
|
|
407
|
+
slots: readonly BookingSlotView[];
|
|
408
|
+
}>): AvailabilitySelectionInvalidation;
|
|
409
|
+
export declare function toBookingSlotView(slot: TimeSlot): BookingSlotView;
|
|
410
|
+
export declare function toBookingSlotViews(slots: readonly TimeSlot[]): BookingSlotView[];
|
|
411
|
+
export declare function toBookingFormData(state: BookingFlowReducerState): BookingFormData;
|
|
412
|
+
export declare function buildBookingStepPlan(input: BuildBookingStepPlanInput): readonly BookingStepPlanItem[];
|
|
413
|
+
export declare function validateBookingStep(input: Readonly<{
|
|
414
|
+
stepId: BookingFlowStepId;
|
|
415
|
+
form: BookingFormConfig | null;
|
|
416
|
+
services: readonly BookingFormService[];
|
|
417
|
+
data: Partial<BookingFormData>;
|
|
418
|
+
defaultServiceId?: string;
|
|
419
|
+
defaultResourceId?: string;
|
|
420
|
+
requiresResourceSelection?: boolean;
|
|
421
|
+
paymentResolution?: BookingPaymentStepResolution;
|
|
422
|
+
}>): BookingStepValidationResult;
|
|
423
|
+
export declare function validateBookingFields(input: Readonly<{
|
|
424
|
+
fields: readonly BookingFormField[];
|
|
425
|
+
values: Readonly<Record<string, unknown>>;
|
|
426
|
+
}>): Record<string, string>;
|
|
427
|
+
export declare function validateBookingField(field: BookingFormField, value: unknown): string | null;
|
|
428
|
+
export declare function deriveBookingFlowSteps(input: DeriveBookingFlowStepsInput): DerivedBookingFlowSteps;
|
|
429
|
+
export declare function buildBookingAvailabilityQuery(input: Readonly<{
|
|
430
|
+
serviceId?: string;
|
|
431
|
+
resourceId?: string;
|
|
432
|
+
selectedDate?: string;
|
|
433
|
+
timezone: string;
|
|
434
|
+
requireDate?: boolean;
|
|
435
|
+
}>): BookingAvailabilityQuery;
|
|
436
|
+
export declare function deriveBookingFieldViews(input: Readonly<{
|
|
437
|
+
form: BookingFormConfig | null;
|
|
438
|
+
values: Readonly<Record<string, BookingFieldValue>>;
|
|
439
|
+
errors: Readonly<Record<string, string>>;
|
|
440
|
+
touched?: Readonly<Record<string, boolean>>;
|
|
441
|
+
idPrefix: string;
|
|
442
|
+
}>): readonly BookingFieldView[];
|
|
443
|
+
export declare function buildBookingSubmitPlan(input: Readonly<{
|
|
444
|
+
formId: string;
|
|
445
|
+
form: BookingFormConfig | null;
|
|
446
|
+
state: BookingFlowReducerState;
|
|
447
|
+
services: readonly BookingFormService[];
|
|
448
|
+
defaultServiceId?: string;
|
|
449
|
+
defaultResourceId?: string;
|
|
450
|
+
requiresResourceSelection?: boolean;
|
|
451
|
+
altchaSolution?: string | null;
|
|
452
|
+
viewerTimeZone: string;
|
|
453
|
+
redirect: BookingSubmitRedirectMode;
|
|
454
|
+
successUrl?: string;
|
|
455
|
+
cancelUrl?: string;
|
|
456
|
+
}>): BookingSubmitPlan;
|
|
457
|
+
export declare function getAppointmentBookingOverrideInput(props: AppointmentBookingOverridePropsLike): AppointmentBookingOverrideInputResult;
|
|
458
|
+
export declare function createBookingBlockApiConfig(input: Readonly<{
|
|
459
|
+
siteId: string;
|
|
460
|
+
apiBaseUrl: string;
|
|
461
|
+
portalToken?: string | null;
|
|
462
|
+
}>): BlockApiConfig;
|
|
463
|
+
export declare function resolveHeadlessBookingSelectedService(input: Readonly<{
|
|
464
|
+
state: BookingFlowReducerState;
|
|
465
|
+
services: readonly BookingFormService[];
|
|
466
|
+
defaultServiceId?: string;
|
|
467
|
+
}>): BookingFormService | null;
|
|
468
|
+
export declare function resolveAppointmentPackagesModel(input: Readonly<{
|
|
469
|
+
enabled: boolean;
|
|
470
|
+
canLoad: boolean;
|
|
471
|
+
unavailableReason: BookingAppointmentPackagesUnavailableReason | null;
|
|
472
|
+
state: LoadState<readonly EligibleAppointmentPackage[]>;
|
|
473
|
+
items: readonly EligibleAppointmentPackage[];
|
|
474
|
+
selected: EligibleAppointmentPackage | null;
|
|
475
|
+
}>): BookingAppointmentPackagesModel;
|
|
476
|
+
export declare function resolveHeadlessBookingStatus(input: Readonly<{
|
|
477
|
+
feedback: BookingFlowFeedback;
|
|
478
|
+
isSubmitting: boolean;
|
|
479
|
+
}>): BookingFlowStatus;
|
|
480
|
+
export declare function resolveHeadlessBookingView(input: Readonly<{
|
|
481
|
+
form: BookingFormConfig | null;
|
|
482
|
+
feedback: BookingFlowFeedback;
|
|
483
|
+
}>): BookingFlowView;
|
|
484
|
+
export declare function describeUnknownError(error: unknown, fallback: string): string;
|
|
@@ -50,6 +50,7 @@ export type BookingFormSourceRecord = Readonly<{
|
|
|
50
50
|
createdAt: string;
|
|
51
51
|
updatedAt: string;
|
|
52
52
|
}>;
|
|
53
|
+
export type BookingFormConfigSource = BookingFormConfig | BookingFormSourceRecord | Readonly<Record<string, unknown>>;
|
|
53
54
|
type BlockBookingPaymentTermsAvailability = Readonly<{
|
|
54
55
|
kind: "available";
|
|
55
56
|
paymentTerms: BlockBookingPaymentTerms;
|
|
@@ -196,8 +197,10 @@ export declare function deriveBookingFormViewState(input: Readonly<{
|
|
|
196
197
|
verificationState: AppointmentCheckoutVerificationState;
|
|
197
198
|
}>): BookingFormViewState;
|
|
198
199
|
export declare function resolveBookingSiteId(siteId: string | undefined, form: BookingFormSourceRecord | null | undefined): string;
|
|
199
|
-
export declare function normalizeBookingFormConfig(form:
|
|
200
|
-
export declare function normalizeBookingServices(services:
|
|
200
|
+
export declare function normalizeBookingFormConfig(form: unknown): BookingFormConfig | null;
|
|
201
|
+
export declare function normalizeBookingServices(services: unknown): readonly BookingFormService[];
|
|
202
|
+
export declare const BOOKING_FORM_DATA_RESERVED_KEYS: Set<string>;
|
|
203
|
+
export declare function toSelectedCollectionOptionKind(value: unknown): BookingSelectedCollectionOptionKind | undefined;
|
|
201
204
|
export declare function getBookingServicePaymentSelectionMode(service: BookingFormService | undefined): BookingPaymentSelectionMode;
|
|
202
205
|
export declare function resolveDefaultBookingServiceId(formConfig: BookingFormConfig | null | undefined, services: readonly BookingFormService[]): string | null;
|
|
203
206
|
export declare function resolveBookingSelectedService(input: Readonly<{
|
|
@@ -7,6 +7,7 @@ export declare const fallbackTransform: TransformDefinition<{
|
|
|
7
7
|
export declare const dateFormatShort: TransformDefinition;
|
|
8
8
|
export declare const arrayLengthTransform: TransformDefinition;
|
|
9
9
|
export declare const jsonArrayTransform: TransformDefinition;
|
|
10
|
+
export declare const csvTransform: TransformDefinition;
|
|
10
11
|
declare const marqueeLoopOptionsSchema: z.ZodObject<{
|
|
11
12
|
minItems: z.ZodDefault<z.ZodNumber>;
|
|
12
13
|
}, z.core.$strip>;
|