@wix/auto_sdk_redirects_redirects 1.0.34 → 1.0.35
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/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +18 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +18 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +18 -1
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +18 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +1 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +18 -1
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +18 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +1 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +18 -1
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +18 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
2
|
import { CreateRedirectSessionOptions, CreateRedirectSessionResponse, RedirectSessionCreatedEnvelope } from './index.typings.js';
|
|
3
|
-
export { ActionEvent, AttachAllTemplatesRequest, AttachAllTemplatesResponse, AttachPagesRequest, AttachPagesResponse, AttachPagesResponseStatus, AttachPagesResponseStatusWithLiterals, AuthorizeRequest, BaseEventMetadata, BookingPolicyViolations, CallbackParams, CallbackType, CallbackTypeWithLiterals, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, CreateRedirectSessionOptionsIntentOneOf, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, CustomMemberPaths, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, IdentificationData, IdentificationDataIdOneOf, Location, LocationType, LocationTypeWithLiterals, MembersAccountSection, MembersAccountSectionWithLiterals, MessageEnvelope, NestedTimeSlot, PhoneCall, Prompt, PromptWithLiterals, RedirectSession, RedirectSessionAuthParams, RedirectSessionBookingsBookParams, RedirectSessionBookingsCheckoutParams, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionMembersAccountParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionPreferences, RedirectSessionStoresProductParams, RestoreInfo, SignInURLRequest, SignInURLResponse, Slot, SlotAvailability, SlotResource, Status, StatusWithLiterals, URLDetails, ValidateCallbackURLRequest, ValidateCallbackURLResponse, WaitingList, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
3
|
+
export { AccountDetails, ActionEvent, AttachAllTemplatesRequest, AttachAllTemplatesResponse, AttachPagesRequest, AttachPagesResponse, AttachPagesResponseStatus, AttachPagesResponseStatusWithLiterals, AuthorizeRequest, BaseEventMetadata, BookingPolicyViolations, CallbackParams, CallbackType, CallbackTypeWithLiterals, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, CreateRedirectSessionOptionsIntentOneOf, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, CustomMemberPaths, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, IdentificationData, IdentificationDataIdOneOf, Location, LocationType, LocationTypeWithLiterals, MembersAccountSection, MembersAccountSectionWithLiterals, MessageEnvelope, NestedTimeSlot, PhoneCall, Prompt, PromptWithLiterals, RedirectSession, RedirectSessionAuthParams, RedirectSessionBookingsBookParams, RedirectSessionBookingsCheckoutParams, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionMembersAccountParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionPreferences, RedirectSessionStoresProductParams, RestoreInfo, SignInURLRequest, SignInURLResponse, Slot, SlotAvailability, SlotResource, Status, StatusWithLiterals, URLDetails, ValidateCallbackURLRequest, ValidateCallbackURLResponse, WaitingList, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function createRedirectSession$1(httpClient: HttpClient): CreateRedirectSessionSignature;
|
|
6
6
|
interface CreateRedirectSessionSignature {
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/headless-v1-redirect-session-redirects.public.ts","../../src/headless-v1-redirect-session-redirects.universal.ts","../../src/headless-v1-redirect-session-redirects.http.ts","../../src/headless-v1-redirect-session-redirects.context.ts"],"sourcesContent":["export * from './src/headless-v1-redirect-session-redirects.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateRedirectSessionOptions,\n CreateRedirectSessionResponse,\n RedirectSessionCreatedEnvelope,\n createRedirectSession as universalCreateRedirectSession,\n} from './headless-v1-redirect-session-redirects.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/redirects' };\n\nexport function createRedirectSession(\n httpClient: HttpClient\n): CreateRedirectSessionSignature {\n return (options?: CreateRedirectSessionOptions) =>\n universalCreateRedirectSession(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateRedirectSessionSignature {\n /**\n * Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.\n *\n * The Create Redirect Session method enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes.\n * For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for bookings, eCommerce, events, or paid plans transactions.\n *\n * To initiate a redirect session:\n *\n * 1. Call Create Redirect Session with the details required for Wix to take care of one specific process (for example, authentication or a bookings checkout). Provide one or more callback URLs, so Wix can redirect the visitor back to your site as appropriate when the process is over.\n * 1. Redirect your visitor to the URL provided in the response. This URL includes query parameters informing Wix where to redirect the visitor back to on your external site.\n * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.\n *\n * > **Note**: When creating a redirect session for a multilingual site:\n * >\n * > * If you don't specify the `lang` parameter in `additional_query_parameters` and the request contains an `x-wix-linguist` header, the language from the header will be added to the redirect URL as `lang`.\n * > * If you specify the `lang` parameter, it takes priority over the header.\n * @param - Options for creating a redirect session.\n */\n (options?: CreateRedirectSessionOptions): Promise<\n NonNullablePaths<\n CreateRedirectSessionResponse,\n | `redirectSession._id`\n | `redirectSession.fullUrl`\n | `redirectSession.urlDetails.endpoint`\n | `redirectSession.shortUrl`,\n 4\n >\n >;\n}\n\nexport const onRedirectSessionCreated = EventDefinition(\n 'wix.headless.v1.redirect_session_created',\n true,\n (event: RedirectSessionCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<RedirectSessionCreatedEnvelope>();\n\nexport {\n ActionEvent,\n AttachAllTemplatesRequest,\n AttachAllTemplatesResponse,\n AttachPagesRequest,\n AttachPagesResponse,\n AttachPagesResponseStatus,\n AuthorizeRequest,\n BaseEventMetadata,\n BookingPolicyViolations,\n CallbackParams,\n CallbackType,\n CreateAnonymousRedirectSessionRequest,\n CreateAnonymousRedirectSessionRequestIntentOneOf,\n CreateAnonymousRedirectSessionResponse,\n CreateRedirectSessionOptions,\n CreateRedirectSessionOptionsIntentOneOf,\n CreateRedirectSessionRequest,\n CreateRedirectSessionRequestIntentOneOf,\n CreateRedirectSessionResponse,\n CustomMemberPaths,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n IdentificationData,\n IdentificationDataIdOneOf,\n Location,\n LocationType,\n MembersAccountSection,\n MessageEnvelope,\n NestedTimeSlot,\n PhoneCall,\n Prompt,\n RedirectSession,\n RedirectSessionAuthParams,\n RedirectSessionBookingsBookParams,\n RedirectSessionBookingsCheckoutParams,\n RedirectSessionCreatedEnvelope,\n RedirectSessionEcomCheckoutParams,\n RedirectSessionEventsCheckoutParams,\n RedirectSessionLoginParams,\n RedirectSessionLogoutParams,\n RedirectSessionMembersAccountParams,\n RedirectSessionPaidPlansCheckoutParams,\n RedirectSessionPreferences,\n RedirectSessionStoresProductParams,\n RestoreInfo,\n SignInURLRequest,\n SignInURLResponse,\n Slot,\n SlotAvailability,\n SlotResource,\n Status,\n URLDetails,\n ValidateCallbackURLRequest,\n ValidateCallbackURLResponse,\n WaitingList,\n WebhookIdentityType,\n} from './headless-v1-redirect-session-redirects.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixHeadlessV1RedirectSession from './headless-v1-redirect-session-redirects.http.js';\n\n/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */\nexport interface RedirectSession {\n /**\n * ID of the redirect session created.\n * @format GUID\n */\n _id?: string;\n /**\n * The full URL of the Wix page to redirect the visitor to. This URL includes query parameters informing Wix where to redirect the visitor back to on the Wix Headless client site.\n * @maxLength 2048\n * @readonly\n */\n fullUrl?: string;\n /** Details about the URL of the redirect session. */\n urlDetails?: URLDetails;\n /**\n * The session token to pass to the Wix page to maintain the visitor's identity.\n * @maxLength 2048\n * @readonly\n */\n sessionToken?: string | null;\n /**\n * The short URL of the Wix page to redirect the visitor to. This URL includes query parameters informing Wix where to redirect the visitor back to on the Wix Headless client site.\n * @maxLength 2048\n * @readonly\n */\n shortUrl?: string;\n /**\n * The base URL of the Wix page to redirect the visitor to.\n * @internal\n * @maxLength 2048\n * @readonly\n */\n wixBaseUrl?: string;\n}\n\nexport interface URLDetails {\n /**\n * Endpoint of the url. This includes the base URL and the path to the endpoint, without query parameters.\n * For example: `https://mysite.com/_api/oauth2/authorize`.\n * @maxLength 2048\n * @readonly\n */\n endpoint?: string;\n /** URL query parameters. */\n searchParams?: Record<string, string>;\n}\n\nexport interface CreateRedirectSessionRequest\n extends CreateRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n /**\n * Details of pages to redirect the visitor back to on the Wix Headless client site.\n * When redirecting to any callback URL, Wix specifies the boolean `wixMemberLoggedIn` parameter.\n * If `true`, a member logged in during the preceding Wix-managed process.\n *\n * **Note**: For an authentication redirect, don't specify a post-flow URL here. Instead, specify one in `auth.authRequest.redirectUri`.\n */\n callbacks?: CallbackParams;\n /** Optional preferences for customizing redirection to Wix pages. */\n preferences?: RedirectSessionPreferences;\n /**\n * The origin of the request\n * @maxLength 2048\n */\n origin?: string | null;\n}\n\n/** @oneof */\nexport interface CreateRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n}\n\nexport interface RedirectSessionBookingsCheckoutParams {\n /**\n * The timezone to use when presenting the selected slot to users, in [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) format. For example, `America/Santiago`.\n *\n * Default: If you don't specify a timezone, the timezone in `slotAvailability.slot.timezone` is used.\n * @maxLength 40\n */\n timezone?: string;\n /** <b>Required</b>. The selected calendar slots to begin a booking checkout. */\n slotAvailability?: SlotAvailability;\n}\n\nexport interface SlotAvailability {\n /**\n * The slot for the corresponding session, when the session is either a single session\n * or a specific session generated from a recurring session.\n */\n slot?: Slot;\n /**\n * Whether the slot is bookable. Bookability is determined by checking a\n * session's open slots and booking policies. Locks are not taken into\n * account.\n */\n bookable?: boolean;\n /**\n * Total number of spots for this slot.\n * For example, if a session has a total of 10 spots and 3 spots are booked,\n * `spotsTotal` is 10 and `openSpots` is 7.\n */\n totalSpots?: number | null;\n /** Number of open spots for this slot. */\n openSpots?: number | null;\n /** An object describing the slot's waitlist and its occupancy. */\n waitingList?: WaitingList;\n /** Booking policy violations for the slot. */\n bookingPolicyViolations?: BookingPolicyViolations;\n /**\n * Indicates whether the slot is locked because a waitlist exists.\n * When a slot frees up, the slot is offered to the next customer on the waitlist. Read-only.\n */\n locked?: boolean | null;\n /**\n * Deprecated. not in use since 2025-06-15.\n * @deprecated Deprecated. not in use since 2025-06-15.\n * @targetRemovalDate 2025-06-15\n */\n isFromV2?: boolean;\n}\n\nexport interface Slot {\n /**\n * ID for the slot's corresponding session, when the session is either a single session\n * or a specific session generated from a recurring session.\n *\n * Deprecated. Please use `eventId` instead.\n * @deprecated ID for the slot's corresponding session, when the session is either a single session\n * or a specific session generated from a recurring session.\n *\n * Deprecated. Please use `eventId` instead.\n * @replacedBy event_id\n * @targetRemovalDate 2025-09-30\n */\n sessionId?: string | null;\n /** Service ID. */\n serviceId?: string;\n /** Schedule ID. */\n scheduleId?: string;\n /**\n * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)\n * format.\n *\n * If `timezone` is specified,\n * dates are based on the local date/time. This means that the timezone offset\n * in the `start_date` is ignored.\n */\n startDate?: string | null;\n /**\n * The end time of this slot in\n * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.\n *\n * If `timezone` is specified,\n * dates are based on the local date/time. This means that the timezone offset\n * in the `end_date` is ignored.\n */\n endDate?: string | null;\n /**\n * The timezone for which slot availability is to be calculated.\n *\n * Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)\n * when calculating availability.\n */\n timezone?: string | null;\n /**\n * The resource required for this slot. Currently, the only supported resource\n * is the relevant staff member for the slot.\n */\n resource?: SlotResource;\n /** Geographic location of the slot. */\n location?: Location;\n /**\n * ID for the slot's corresponding event, when the event is either a single event\n * or a specific event generated from a recurring event.\n * @minLength 36\n * @maxLength 250\n */\n eventId?: string | null;\n}\n\nexport interface SlotResource {\n /**\n * Resource ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Resource name. Read only.\n * @maxLength 1200\n */\n name?: string | null;\n}\n\nexport interface Location {\n /**\n * Business location ID. Available only for locations that are business locations,\n * meaning the `location_type` is `\"OWNER_BUSINESS\"`.\n * @format GUID\n */\n _id?: string | null;\n /** Location name. */\n name?: string | null;\n /** The full address of this location. */\n formattedAddress?: string | null;\n /**\n * The full translated address of this location.\n * @maxLength 512\n */\n formattedAddressTranslated?: string | null;\n /** Location type. */\n locationType?: LocationTypeWithLiterals;\n}\n\nexport enum LocationType {\n /** Undefined location type. */\n UNDEFINED = 'UNDEFINED',\n /** The business address, as set in the site’s general settings. */\n OWNER_BUSINESS = 'OWNER_BUSINESS',\n /** The address as set when creating the service. */\n OWNER_CUSTOM = 'OWNER_CUSTOM',\n /** The address as set for the individual session. */\n CUSTOM = 'CUSTOM',\n}\n\n/** @enumType */\nexport type LocationTypeWithLiterals =\n | LocationType\n | 'UNDEFINED'\n | 'OWNER_BUSINESS'\n | 'OWNER_CUSTOM'\n | 'CUSTOM';\n\nexport interface PhoneCall {\n /** Whether the service is delivered via phone call. */\n enabled?: boolean | null;\n}\n\nexport interface WaitingList {\n /**\n * Total number of spots and open spots for this waitlist.\n * For example, a Yoga class with 10 waitlist spots and 3 registered\n * on the waitlist has 10 `total_spots` and 7 `open_spots`.\n */\n totalSpots?: number | null;\n /** Number of open spots for this waitlist. */\n openSpots?: number | null;\n}\n\nexport interface BookingPolicyViolations {\n /** Bookings policy violation. Too early to book this slot. */\n tooEarlyToBook?: boolean | null;\n /** Bookings policy violation. Too late to book this slot. */\n tooLateToBook?: boolean | null;\n /** Bookings policy violation. Online booking is disabled for this slot. */\n bookOnlineDisabled?: boolean | null;\n /** Bookings policy violation. Intake Form submission is required for this slot. */\n validSubmissionRequired?: boolean | null;\n}\n\nexport interface NestedTimeSlot {\n /** @format GUID */\n serviceId?: string;\n /** @maxLength 30 */\n start?: string;\n /** @maxLength 30 */\n end?: string;\n resource?: SlotResource;\n /** Schedule ID. */\n scheduleId?: string;\n}\n\nexport interface RedirectSessionEcomCheckoutParams {\n /**\n * <b>Required</b>. ID of the checkout to process.\n * To retrieve this ID, create a checkout and the relevant ID is returned in the response.\n *\n * Create a checkout using one of the following:\n * - SDK: [Create Checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/create-checkout) or [Create Checkout From Current Cart](https://dev.wix.com/docs/sdk/backend-modules/ecom/current-cart/create-checkout-from-current-cart).\n * - REST: [Create Checkout From Cart](https://dev.wix.com/docs/rest/business-solutions/e-commerce/cart/create-checkout-from-cart).\n * @format GUID\n */\n checkoutId?: string;\n}\n\nexport interface RedirectSessionEventsCheckoutParams {\n /**\n * <b>Required</b>. ID of the temporary event reservation. Call Create Reservation ([SDK](https://dev.wix.com/docs/sdk/backend-modules/events/orders/create-reservation) | [REST](https://dev.wix.com/docs/rest/business-solutions/events/orders/create-reservation)) to reserve a ticket temporarily and obtain a reservation ID.\n * @format GUID\n */\n reservationId?: string;\n /**\n * <b>Required</b>. URL-friendly event slug, generated from the event title of the event. For example, `my-event-4`. To obtain an event slug, call Get Event ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/get-event) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/get-event)).\n * @maxLength 150\n */\n eventSlug?: string;\n}\n\nexport interface RedirectSessionPaidPlansCheckoutParams {\n /**\n * <b>Required</b>. ID of the paid plan selected. To get a plan ID, call Query Public Plans ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/query-public-plans) | [REST](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/plans/query-public-plans)).\n * @format GUID\n */\n planId?: string;\n /**\n * For use when pricing plan selection is part of a checkout flow, only if the paid plan selection page is implemented on an external Wix Headless client site.\n * In this case, a string is received by the external pricing plans page as a `checkoutData` query parameter. Pass this string back here when redirecting back to Wix for checkout.\n * @maxLength 2048\n */\n checkoutData?: string | null;\n}\n\nexport interface RedirectSessionLoginParams {}\n\nexport interface RedirectSessionLogoutParams {\n /**\n * <b>Required</b>. ID of the OAuth app authorizing the client. To get this ID, go to your [Headless settings](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2F{{oauth-apps-settings/manage}}) and copy the Client ID of your OAuth app.\n * @format GUID\n */\n clientId?: string;\n}\n\nexport interface RedirectSessionAuthParams {\n /** <b>Required</b>. Details of the authorization request. */\n authRequest?: AuthorizeRequest;\n /** The type of prompt to use during the authorization process. */\n prompt?: PromptWithLiterals;\n}\n\n/**\n * AuthorizeRequest is sent by the client to the authorization server to initiate\n * the authorization process.\n */\nexport interface AuthorizeRequest {\n /**\n * ID of the Wix OAuth app requesting authorization.\n * @format GUID\n */\n clientId?: string;\n /**\n * Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).\n *\n * Supported values:\n * + `code`: The endpoint returns an authorization code that can be used to obtain an access token.\n * @minLength 1\n */\n responseType?: string;\n /**\n * URI to redirect the browser to after authentication and authorization. The browser is redirected to this URI whether the authentication and authorization process is successful or not.\n * @minLength 1\n */\n redirectUri?: string | null;\n /**\n * Desired scope of access. If this field is left empty, only an access token is granted.\n * To received a refresh token, pass `offline_access` as the value of this field.\n */\n scope?: string | null;\n /**\n * A value used to confirm the state of an application before and after it makes an authorization\n * request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser\n * is redirected there.\n * Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).\n * @minLength 1\n */\n state?: string;\n /**\n * esired response format.\n *\n * Supported values:\n * + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.\n * + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.\n * + `web_message`: The response parameters are encoded as a JSON object and added to the body of a [web message response](https://datatracker.ietf.org/doc/html/draft-sakimura-oauth-wmrm-00).\n *\n * Default value: `query`\n */\n responseMode?: string | null;\n /**\n * Code challenge to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n */\n codeChallenge?: string | null;\n /**\n * Code challenge method to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n *\n * Supported values:\n * + `S256`: The code challenge is transformed using SHA-256 encyption.\n * + `S512`: The code challenge is transformed using SHA-512 encyption.\n */\n codeChallengeMethod?: string | null;\n /** Session token of the site visitor to authorize. */\n sessionToken?: string | null;\n /**\n * URL to redirect user to sign in\n * @format SECURE_WEB_URL\n */\n signInUrl?: string | null;\n /** Indicates whether the user has consented to the requested scopes */\n userConsented?: boolean | null;\n /** Indicates whether login is optional. If true, will not redirect to the sign_in_url if user is not logged in. */\n optionalLogin?: boolean | null;\n /**\n * The site id the authorization is requested for.\n * @format GUID\n */\n metaSiteId?: string | null;\n}\n\n/** Specifies the behavior of the authorization flow regarding site member authentication and consent. */\nexport enum Prompt {\n /** Display the login page to the member, prompting them to enter their credentials. */\n login = 'login',\n /**\n * Bypass the Wix login page and redirect the member directly to your site.\n * This option checks if the member has an active session from a previous login\n * and, if so, immediately redirects to the specified URL while retrieving tokens.\n */\n none = 'none',\n}\n\n/** @enumType */\nexport type PromptWithLiterals = Prompt | 'login' | 'none';\n\nexport interface RedirectSessionMembersAccountParams {\n /**\n * The member account page to redirect to.\n *\n * Default: `ACCOUNT_INFO`\n */\n section?: MembersAccountSectionWithLiterals;\n}\n\nexport enum MembersAccountSection {\n /** Account info section in \"my account\". */\n ACCOUNT_INFO = 'ACCOUNT_INFO',\n /** My Bookings section in \"my account\". */\n BOOKINGS = 'BOOKINGS',\n /** My Orders section in \"my account\". */\n ORDERS = 'ORDERS',\n /** Subscriptions section in \"my account\". */\n SUBSCRIPTIONS = 'SUBSCRIPTIONS',\n /** Events section in \"my account\". */\n EVENTS = 'EVENTS',\n}\n\n/** @enumType */\nexport type MembersAccountSectionWithLiterals =\n | MembersAccountSection\n | 'ACCOUNT_INFO'\n | 'BOOKINGS'\n | 'ORDERS'\n | 'SUBSCRIPTIONS'\n | 'EVENTS';\n\nexport interface RedirectSessionStoresProductParams {\n /**\n * <b>Required</b>. Unique slug of the product to redirect to. To obtain a product slug, call Query Products [SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/get-product-by-slug) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/products-v3/query-products)).\n * @maxLength 150\n */\n productSlug?: string;\n}\n\nexport interface RedirectSessionBookingsBookParams {\n /**\n * For use when filtering the bookings page by a specific resource.\n * @format GUID\n */\n resourceId?: string;\n}\n\nexport interface CallbackParams {\n /**\n * The URL for a custom thank you page implemented on a site outside of Wix. The visitor is directed to this page after the Wix-managed process is completed.\n * When redirecting to this URL, Wix passes different query parameters depending on the preceding transaction:\n *\n * After a pricing plans checkout:\n * + `planOrderId`: ID of a pricing plan order.\n *\n * After an eCommerce checkout:\n * + `orderId`: ID of an eCommerce order.\n *\n * After an Events checkout:\n * + `orderNumber`: Unique order number for the transaction.\n * + `eventId`: ID of the event.\n *\n * If the process is abandoned or interrupted, the visitor is redirected to the URL specified in `postFlowUrl` instead.\n *\n * Default: If you don't specify a URL, the visitor is redirected to a Wix thank you page, and from there to the URL specified in `postFlowUrl`.\n * @maxLength 2048\n */\n thankYouPageUrl?: string | null;\n /**\n * The URL Wix should redirect the visitor to when the Wix-managed process is completed, abandoned, or interrupted.\n *\n * **Note**: For an authentication redirect, don't specify a URL here. Instead, specify one in `options.auth.authRequest.redirectUri`.\n * @maxLength 2048\n */\n postFlowUrl?: string | null;\n /**\n * The URL for a custom login page implemented outside of Wix.\n *\n * Default: If you don't specify a URL, a Wix login page is used.\n * @maxLength 2048\n */\n loginUrl?: string | null;\n /**\n * The URL for a custom bookings services page implemented outside of Wix.\n *\n * Default: If you don't specify a URL, a Wix bookings services page is used.\n * @maxLength 2048\n */\n bookingsServiceListUrl?: string | null;\n /**\n * The URL for a custom eCommerce cart page implemented outside of Wix.\n *\n * Default: If you don't specify a URL, a Wix cart page is used.\n * @maxLength 2048\n */\n cartPageUrl?: string | null;\n /**\n * The URL for a custom pricing plans page implemented outside of Wix. When redirecting to this URL, Wix specifies the following query parameters:\n * + `planIds`: IDs of the pricing plans on the custom page.\n * + `checkoutData`: Specify this string back in `options.paidPlansCheckout.checkoutData` when redirecting back to Wix for checkout.\n *\n * Default: If you don't specify a URL, a Wix pricing plans page is used.\n * @maxLength 2048\n */\n planListUrl?: string | null;\n}\n\nexport interface RedirectSessionPreferences {\n /**\n * Whether to use a standard Wix template for Wix-managed pages the visitor is redirected to. Set to `false` only if your client site connects with a Wix site that has custom pages.\n *\n * Default: `true`\n */\n useGenericWixPages?: boolean | null;\n /**\n * Whether to maintain the identity used in the redirect to Wix (not relevant for `logout` and `auth` intents), or to use a new visitor identity.\n *\n * Default: `true`\n */\n maintainIdentity?: boolean | null;\n /**\n * Map of global query parameters to append to the Wix URL.\n *\n * Common parameters include:\n * - [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters): Use to track the source of site traffic.\n *\n * - `lang`: Use to control the displayed language of the Wix-managed page. For supported values, see [ISO 639 language codes](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).\n */\n additionalQueryParameters?: Record<string, string>;\n /**\n * Check if Wix page for the requested intent is published and return it if possible. Otherwise, return a standard Wix template for it.\n * Default: `false`\n */\n checkIfPublish?: boolean | null;\n}\n\nexport interface CustomMemberPaths {\n /**\n * Path of the account page in the site's members area. Required if `useGenericWixPages` is `false` and the account page path has been changed in the Wix editor.\n * @format URL_SLUG\n */\n accountPagePath?: string | null;\n /**\n * Path of the member profile page in the site's members area. Required if `useGenericWixPages` is `false` and the member profile page path has been changed in the Wix editor.\n * @format URL_SLUG\n */\n profilePagePath?: string | null;\n}\n\nexport interface CreateRedirectSessionResponse {\n /** Details for redirecting the visitor to a Wix page. */\n redirectSession?: RedirectSession;\n}\n\nexport interface CreateAnonymousRedirectSessionRequest\n extends CreateAnonymousRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n /** Optional preferences for customizing redirection to Wix pages. */\n preferences?: RedirectSessionPreferences;\n}\n\n/** @oneof */\nexport interface CreateAnonymousRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n}\n\nexport interface CreateAnonymousRedirectSessionResponse {\n /** Details for redirecting the visitor to a Wix page. */\n redirectSession?: RedirectSession;\n}\n\nexport interface AttachPagesRequest {\n /**\n * App ID that we want to inherit pages for.\n * @format GUID\n */\n appDefId?: string;\n}\n\nexport interface AttachPagesResponse {\n /** The status of the operation. */\n status?: AttachPagesResponseStatusWithLiterals;\n /**\n * A descriptive message about the operation\n * @maxLength 2048\n */\n message?: string;\n /** True if pages were attached, false otherwise */\n pagesAttached?: boolean;\n /** True if the site was already published */\n sitePublished?: boolean;\n}\n\nexport enum AttachPagesResponseStatus {\n /** Invalid value. */\n UNKNOWN = 'UNKNOWN',\n /** Pages were successfully attached. */\n SUCCESS = 'SUCCESS',\n /** No pages were attached because the site is already published. */\n NO_ACTION = 'NO_ACTION',\n /** An error occurred, such as when the site or app is not found. */\n ERROR = 'ERROR',\n}\n\n/** @enumType */\nexport type AttachPagesResponseStatusWithLiterals =\n | AttachPagesResponseStatus\n | 'UNKNOWN'\n | 'SUCCESS'\n | 'NO_ACTION'\n | 'ERROR';\n\nexport interface ValidateCallbackURLRequest {\n /**\n * An external URL to validate\n * @maxLength 2048\n */\n callbackUrl?: string;\n /** Type of the callback URL. */\n callbackType?: CallbackTypeWithLiterals;\n /**\n * The oauth app id used in order to pull the allowed domains from, has to correspond to the same metasite as the site in context\n * @format GUID\n */\n clientId?: string;\n}\n\nexport enum CallbackType {\n /** Invalid value. */\n UNKNOWN = 'UNKNOWN',\n /** Callback URL is used for the logout flow. */\n LOGOUT = 'LOGOUT',\n /** Callback URL is used for a checkout flow. */\n CHECKOUT = 'CHECKOUT',\n /** Callback URL is used for the authorize flow. */\n AUTHORIZE = 'AUTHORIZE',\n}\n\n/** @enumType */\nexport type CallbackTypeWithLiterals =\n | CallbackType\n | 'UNKNOWN'\n | 'LOGOUT'\n | 'CHECKOUT'\n | 'AUTHORIZE';\n\nexport interface ValidateCallbackURLResponse {\n /** Indicates if the provided URL is allowed for the given client id */\n isValid?: boolean;\n}\n\nexport interface SignInURLRequest {\n /**\n * The oauth app id used in order to pull the allowed domains from, has to correspond to the same metasite as the site in context\n * @format GUID\n */\n clientId?: string;\n}\n\nexport interface SignInURLResponse {\n /** The Wix URL details to redirect into */\n redirectSession?: RedirectSession;\n}\n\nexport interface AttachAllTemplatesRequest {}\n\nexport interface AttachAllTemplatesResponse {\n /** The status of the operation. */\n status?: StatusWithLiterals;\n}\n\nexport enum Status {\n /** Invalid value. */\n UNKNOWN = 'UNKNOWN',\n /** Templates were successfully attached. */\n SUCCESS = 'SUCCESS',\n /** An error occurred. */\n ERROR = 'ERROR',\n}\n\n/** @enumType */\nexport type StatusWithLiterals = Status | 'UNKNOWN' | 'SUCCESS' | 'ERROR';\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface RedirectSessionCreatedEnvelope {\n entity: RedirectSession;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a redirect session is created.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionId WIX_HEADLESS.WIX_URL_CREATE\n * @webhook\n * @eventType wix.headless.v1.redirect_session_created\n * @serviceIdentifier wix.headless.v1.RedirectSessionService\n * @slug created\n */\nexport declare function onRedirectSessionCreated(\n handler: (event: RedirectSessionCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.\n *\n * The Create Redirect Session method enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes.\n * For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for bookings, eCommerce, events, or paid plans transactions.\n *\n * To initiate a redirect session:\n *\n * 1. Call Create Redirect Session with the details required for Wix to take care of one specific process (for example, authentication or a bookings checkout). Provide one or more callback URLs, so Wix can redirect the visitor back to your site as appropriate when the process is over.\n * 1. Redirect your visitor to the URL provided in the response. This URL includes query parameters informing Wix where to redirect the visitor back to on your external site.\n * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.\n *\n * > **Note**: When creating a redirect session for a multilingual site:\n * >\n * > * If you don't specify the `lang` parameter in `additional_query_parameters` and the request contains an `x-wix-linguist` header, the language from the header will be added to the redirect URL as `lang`.\n * > * If you specify the `lang` parameter, it takes priority over the header.\n * @public\n * @requiredField options.intent\n * @param options - Options for creating a redirect session.\n * @permissionId WIX_HEADLESS.WIX_URL_CREATE\n * @applicableIdentity APP\n * @fqn wix.headless.v1.RedirectSessionService.CreateRedirectSession\n */\nexport async function createRedirectSession(\n options?: CreateRedirectSessionOptions\n): Promise<\n NonNullablePaths<\n CreateRedirectSessionResponse,\n | `redirectSession._id`\n | `redirectSession.fullUrl`\n | `redirectSession.urlDetails.endpoint`\n | `redirectSession.shortUrl`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n bookingsCheckout: options?.bookingsCheckout,\n ecomCheckout: options?.ecomCheckout,\n eventsCheckout: options?.eventsCheckout,\n paidPlansCheckout: options?.paidPlansCheckout,\n login: options?.login,\n logout: options?.logout,\n auth: options?.auth,\n storesProduct: options?.storesProduct,\n bookingsBook: options?.bookingsBook,\n callbacks: options?.callbacks,\n preferences: options?.preferences,\n origin: options?.origin,\n });\n\n const reqOpts =\n ambassadorWixHeadlessV1RedirectSession.createRedirectSession(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n bookingsCheckout: '$[0].bookingsCheckout',\n ecomCheckout: '$[0].ecomCheckout',\n eventsCheckout: '$[0].eventsCheckout',\n paidPlansCheckout: '$[0].paidPlansCheckout',\n login: '$[0].login',\n logout: '$[0].logout',\n auth: '$[0].auth',\n storesProduct: '$[0].storesProduct',\n bookingsBook: '$[0].bookingsBook',\n callbacks: '$[0].callbacks',\n preferences: '$[0].preferences',\n origin: '$[0].origin',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateRedirectSessionOptions\n extends CreateRedirectSessionOptionsIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n /**\n * Details of pages to redirect back to on the Wix Headless client site.\n *\n * **Note**: For an authentication redirect, don't specify a post-flow URL here. Instead, specify one in `options.auth.authRequest.redirectUri`.\n */\n callbacks?: CallbackParams;\n /** Optional preferences for customizing redirection to Wix pages. */\n preferences?: RedirectSessionPreferences;\n /**\n * The origin of the request\n * @maxLength 2048\n */\n origin?: string | null;\n}\n\n/** @oneof */\nexport interface CreateRedirectSessionOptionsIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixHeadlessV1RedirectSessionServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/redirects-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/redirects-api',\n destPath: '',\n },\n {\n srcPath: '/redirect-session',\n destPath: '',\n },\n {\n srcPath: '/headless/v1/redirect-session',\n destPath: '/v1/redirect-session',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/headless/v1/redirect-session',\n destPath: '/v1/redirect-session',\n },\n ],\n _: [\n {\n srcPath: '/headless/v1/redirect-session',\n destPath: '/v1/redirect-session',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_redirects_redirects';\n\n/**\n * Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.\n *\n * The Create Redirect Session method enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes.\n * For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for bookings, eCommerce, events, or paid plans transactions.\n *\n * To initiate a redirect session:\n *\n * 1. Call Create Redirect Session with the details required for Wix to take care of one specific process (for example, authentication or a bookings checkout). Provide one or more callback URLs, so Wix can redirect the visitor back to your site as appropriate when the process is over.\n * 1. Redirect your visitor to the URL provided in the response. This URL includes query parameters informing Wix where to redirect the visitor back to on your external site.\n * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.\n *\n * > **Note**: When creating a redirect session for a multilingual site:\n * >\n * > * If you don't specify the `lang` parameter in `additional_query_parameters` and the request contains an `x-wix-linguist` header, the language from the header will be added to the redirect URL as `lang`.\n * > * If you specify the `lang` parameter, it takes priority over the header.\n */\nexport function createRedirectSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __createRedirectSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.headless.v1.redirect_session',\n method: 'POST' as any,\n methodFqn: 'wix.headless.v1.RedirectSessionService.CreateRedirectSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixHeadlessV1RedirectSessionServiceUrl({\n protoPath: '/v1/redirect-session',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createRedirectSession;\n}\n","import { createRedirectSession as publicCreateRedirectSession } from './headless-v1-redirect-session-redirects.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onRedirectSessionCreated as publicOnRedirectSessionCreated } from './headless-v1-redirect-session-redirects.public.js';\n\nexport const createRedirectSession: MaybeContext<\n BuildRESTFunction<typeof publicCreateRedirectSession> &\n typeof publicCreateRedirectSession\n> = /*#__PURE__*/ createRESTModule(publicCreateRedirectSession);\n/**\n * Triggered when a redirect session is created.\n */\nexport const onRedirectSessionCreated: BuildEventDefinition<\n typeof publicOnRedirectSessionCreated\n> &\n typeof publicOnRedirectSessionCreated = createEventModule(\n publicOnRedirectSessionCreated\n);\n\nexport {\n LocationType,\n Prompt,\n MembersAccountSection,\n AttachPagesResponseStatus,\n CallbackType,\n Status,\n WebhookIdentityType,\n} from './headless-v1-redirect-session-redirects.universal.js';\nexport {\n RedirectSession,\n URLDetails,\n CreateRedirectSessionRequest,\n CreateRedirectSessionRequestIntentOneOf,\n RedirectSessionBookingsCheckoutParams,\n SlotAvailability,\n Slot,\n SlotResource,\n Location,\n PhoneCall,\n WaitingList,\n BookingPolicyViolations,\n NestedTimeSlot,\n RedirectSessionEcomCheckoutParams,\n RedirectSessionEventsCheckoutParams,\n RedirectSessionPaidPlansCheckoutParams,\n RedirectSessionLoginParams,\n RedirectSessionLogoutParams,\n RedirectSessionAuthParams,\n AuthorizeRequest,\n RedirectSessionMembersAccountParams,\n RedirectSessionStoresProductParams,\n RedirectSessionBookingsBookParams,\n CallbackParams,\n RedirectSessionPreferences,\n CustomMemberPaths,\n CreateRedirectSessionResponse,\n CreateAnonymousRedirectSessionRequest,\n CreateAnonymousRedirectSessionRequestIntentOneOf,\n CreateAnonymousRedirectSessionResponse,\n AttachPagesRequest,\n AttachPagesResponse,\n ValidateCallbackURLRequest,\n ValidateCallbackURLResponse,\n SignInURLRequest,\n SignInURLResponse,\n AttachAllTemplatesRequest,\n AttachAllTemplatesResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n RedirectSessionCreatedEnvelope,\n CreateRedirectSessionOptions,\n CreateRedirectSessionOptionsIntentOneOf,\n} from './headless-v1-redirect-session-redirects.universal.js';\nexport {\n LocationTypeWithLiterals,\n PromptWithLiterals,\n MembersAccountSectionWithLiterals,\n AttachPagesResponseStatusWithLiterals,\n CallbackTypeWithLiterals,\n StatusWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './headless-v1-redirect-session-redirects.universal.js';\n"],"mappings":"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","names":["createRedirectSession","onRedirectSessionCreated","import_rename_all_nested_keys","LocationType","Prompt","MembersAccountSection","AttachPagesResponseStatus","CallbackType","Status","WebhookIdentityType","createRedirectSession","sdkTransformError","createRedirectSession","import_rest_modules","createRedirectSession","onRedirectSessionCreated"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/headless-v1-redirect-session-redirects.public.ts","../../src/headless-v1-redirect-session-redirects.universal.ts","../../src/headless-v1-redirect-session-redirects.http.ts","../../src/headless-v1-redirect-session-redirects.context.ts"],"sourcesContent":["export * from './src/headless-v1-redirect-session-redirects.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateRedirectSessionOptions,\n CreateRedirectSessionResponse,\n RedirectSessionCreatedEnvelope,\n createRedirectSession as universalCreateRedirectSession,\n} from './headless-v1-redirect-session-redirects.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/redirects' };\n\nexport function createRedirectSession(\n httpClient: HttpClient\n): CreateRedirectSessionSignature {\n return (options?: CreateRedirectSessionOptions) =>\n universalCreateRedirectSession(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateRedirectSessionSignature {\n /**\n * Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.\n *\n * The Create Redirect Session method enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes.\n * For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for bookings, eCommerce, events, or paid plans transactions.\n *\n * To initiate a redirect session:\n *\n * 1. Call Create Redirect Session with the details required for Wix to take care of one specific process (for example, authentication or a bookings checkout). Provide one or more callback URLs, so Wix can redirect the visitor back to your site as appropriate when the process is over.\n * 1. Redirect your visitor to the URL provided in the response. This URL includes query parameters informing Wix where to redirect the visitor back to on your external site.\n * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.\n *\n * > **Note**: When creating a redirect session for a multilingual site:\n * >\n * > * If you don't specify the `lang` parameter in `additional_query_parameters` and the request contains an `x-wix-linguist` header, the language from the header will be added to the redirect URL as `lang`.\n * > * If you specify the `lang` parameter, it takes priority over the header.\n * @param - Options for creating a redirect session.\n */\n (options?: CreateRedirectSessionOptions): Promise<\n NonNullablePaths<\n CreateRedirectSessionResponse,\n | `redirectSession._id`\n | `redirectSession.fullUrl`\n | `redirectSession.urlDetails.endpoint`\n | `redirectSession.shortUrl`,\n 4\n >\n >;\n}\n\nexport const onRedirectSessionCreated = EventDefinition(\n 'wix.headless.v1.redirect_session_created',\n true,\n (event: RedirectSessionCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<RedirectSessionCreatedEnvelope>();\n\nexport {\n AccountDetails,\n ActionEvent,\n AttachAllTemplatesRequest,\n AttachAllTemplatesResponse,\n AttachPagesRequest,\n AttachPagesResponse,\n AttachPagesResponseStatus,\n AuthorizeRequest,\n BaseEventMetadata,\n BookingPolicyViolations,\n CallbackParams,\n CallbackType,\n CreateAnonymousRedirectSessionRequest,\n CreateAnonymousRedirectSessionRequestIntentOneOf,\n CreateAnonymousRedirectSessionResponse,\n CreateRedirectSessionOptions,\n CreateRedirectSessionOptionsIntentOneOf,\n CreateRedirectSessionRequest,\n CreateRedirectSessionRequestIntentOneOf,\n CreateRedirectSessionResponse,\n CustomMemberPaths,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n IdentificationData,\n IdentificationDataIdOneOf,\n Location,\n LocationType,\n MembersAccountSection,\n MessageEnvelope,\n NestedTimeSlot,\n PhoneCall,\n Prompt,\n RedirectSession,\n RedirectSessionAuthParams,\n RedirectSessionBookingsBookParams,\n RedirectSessionBookingsCheckoutParams,\n RedirectSessionCreatedEnvelope,\n RedirectSessionEcomCheckoutParams,\n RedirectSessionEventsCheckoutParams,\n RedirectSessionLoginParams,\n RedirectSessionLogoutParams,\n RedirectSessionMembersAccountParams,\n RedirectSessionPaidPlansCheckoutParams,\n RedirectSessionPreferences,\n RedirectSessionStoresProductParams,\n RestoreInfo,\n SignInURLRequest,\n SignInURLResponse,\n Slot,\n SlotAvailability,\n SlotResource,\n Status,\n URLDetails,\n ValidateCallbackURLRequest,\n ValidateCallbackURLResponse,\n WaitingList,\n WebhookIdentityType,\n} from './headless-v1-redirect-session-redirects.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixHeadlessV1RedirectSession from './headless-v1-redirect-session-redirects.http.js';\n\n/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */\nexport interface RedirectSession {\n /**\n * ID of the redirect session created.\n * @format GUID\n */\n _id?: string;\n /**\n * The full URL of the Wix page to redirect the visitor to. This URL includes query parameters informing Wix where to redirect the visitor back to on the Wix Headless client site.\n * @maxLength 2048\n * @readonly\n */\n fullUrl?: string;\n /** Details about the URL of the redirect session. */\n urlDetails?: URLDetails;\n /**\n * The session token to pass to the Wix page to maintain the visitor's identity.\n * @maxLength 2048\n * @readonly\n */\n sessionToken?: string | null;\n /**\n * The short URL of the Wix page to redirect the visitor to. This URL includes query parameters informing Wix where to redirect the visitor back to on the Wix Headless client site.\n * @maxLength 2048\n * @readonly\n */\n shortUrl?: string;\n /**\n * The base URL of the Wix page to redirect the visitor to.\n * @internal\n * @maxLength 2048\n * @readonly\n */\n wixBaseUrl?: string;\n}\n\nexport interface URLDetails {\n /**\n * Endpoint of the url. This includes the base URL and the path to the endpoint, without query parameters.\n * For example: `https://mysite.com/_api/oauth2/authorize`.\n * @maxLength 2048\n * @readonly\n */\n endpoint?: string;\n /** URL query parameters. */\n searchParams?: Record<string, string>;\n}\n\nexport interface CreateRedirectSessionRequest\n extends CreateRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n /**\n * Details of pages to redirect the visitor back to on the Wix Headless client site.\n * When redirecting to any callback URL, Wix specifies the boolean `wixMemberLoggedIn` parameter.\n * If `true`, a member logged in during the preceding Wix-managed process.\n *\n * **Note**: For an authentication redirect, don't specify a post-flow URL here. Instead, specify one in `auth.authRequest.redirectUri`.\n */\n callbacks?: CallbackParams;\n /** Optional preferences for customizing redirection to Wix pages. */\n preferences?: RedirectSessionPreferences;\n /**\n * The origin of the request\n * @maxLength 2048\n */\n origin?: string | null;\n}\n\n/** @oneof */\nexport interface CreateRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n}\n\nexport interface RedirectSessionBookingsCheckoutParams {\n /**\n * The timezone to use when presenting the selected slot to users, in [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) format. For example, `America/Santiago`.\n *\n * Default: If you don't specify a timezone, the timezone in `slotAvailability.slot.timezone` is used.\n * @maxLength 40\n */\n timezone?: string;\n /** <b>Required</b>. The selected calendar slots to begin a booking checkout. */\n slotAvailability?: SlotAvailability;\n}\n\nexport interface SlotAvailability {\n /**\n * The slot for the corresponding session, when the session is either a single session\n * or a specific session generated from a recurring session.\n */\n slot?: Slot;\n /**\n * Whether the slot is bookable. Bookability is determined by checking a\n * session's open slots and booking policies. Locks are not taken into\n * account.\n */\n bookable?: boolean;\n /**\n * Total number of spots for this slot.\n * For example, if a session has a total of 10 spots and 3 spots are booked,\n * `spotsTotal` is 10 and `openSpots` is 7.\n */\n totalSpots?: number | null;\n /** Number of open spots for this slot. */\n openSpots?: number | null;\n /** An object describing the slot's waitlist and its occupancy. */\n waitingList?: WaitingList;\n /** Booking policy violations for the slot. */\n bookingPolicyViolations?: BookingPolicyViolations;\n /**\n * Indicates whether the slot is locked because a waitlist exists.\n * When a slot frees up, the slot is offered to the next customer on the waitlist. Read-only.\n */\n locked?: boolean | null;\n /**\n * Deprecated. not in use since 2025-06-15.\n * @deprecated Deprecated. not in use since 2025-06-15.\n * @targetRemovalDate 2025-06-15\n */\n isFromV2?: boolean;\n}\n\nexport interface Slot {\n /**\n * ID for the slot's corresponding session, when the session is either a single session\n * or a specific session generated from a recurring session.\n *\n * Deprecated. Please use `eventId` instead.\n * @deprecated ID for the slot's corresponding session, when the session is either a single session\n * or a specific session generated from a recurring session.\n *\n * Deprecated. Please use `eventId` instead.\n * @replacedBy event_id\n * @targetRemovalDate 2025-09-30\n */\n sessionId?: string | null;\n /** Service ID. */\n serviceId?: string;\n /** Schedule ID. */\n scheduleId?: string;\n /**\n * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)\n * format.\n *\n * If `timezone` is specified,\n * dates are based on the local date/time. This means that the timezone offset\n * in the `start_date` is ignored.\n */\n startDate?: string | null;\n /**\n * The end time of this slot in\n * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.\n *\n * If `timezone` is specified,\n * dates are based on the local date/time. This means that the timezone offset\n * in the `end_date` is ignored.\n */\n endDate?: string | null;\n /**\n * The timezone for which slot availability is to be calculated.\n *\n * Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)\n * when calculating availability.\n */\n timezone?: string | null;\n /**\n * The resource required for this slot. Currently, the only supported resource\n * is the relevant staff member for the slot.\n */\n resource?: SlotResource;\n /** Geographic location of the slot. */\n location?: Location;\n /**\n * ID for the slot's corresponding event, when the event is either a single event\n * or a specific event generated from a recurring event.\n * @minLength 36\n * @maxLength 250\n */\n eventId?: string | null;\n}\n\nexport interface SlotResource {\n /**\n * Resource ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Resource name. Read only.\n * @maxLength 1200\n */\n name?: string | null;\n}\n\nexport interface Location {\n /**\n * Business location ID. Available only for locations that are business locations,\n * meaning the `location_type` is `\"OWNER_BUSINESS\"`.\n * @format GUID\n */\n _id?: string | null;\n /** Location name. */\n name?: string | null;\n /** The full address of this location. */\n formattedAddress?: string | null;\n /**\n * The full translated address of this location.\n * @maxLength 512\n */\n formattedAddressTranslated?: string | null;\n /** Location type. */\n locationType?: LocationTypeWithLiterals;\n}\n\nexport enum LocationType {\n /** Undefined location type. */\n UNDEFINED = 'UNDEFINED',\n /** The business address, as set in the site’s general settings. */\n OWNER_BUSINESS = 'OWNER_BUSINESS',\n /** The address as set when creating the service. */\n OWNER_CUSTOM = 'OWNER_CUSTOM',\n /** The address as set for the individual session. */\n CUSTOM = 'CUSTOM',\n}\n\n/** @enumType */\nexport type LocationTypeWithLiterals =\n | LocationType\n | 'UNDEFINED'\n | 'OWNER_BUSINESS'\n | 'OWNER_CUSTOM'\n | 'CUSTOM';\n\nexport interface PhoneCall {\n /** Whether the service is delivered via phone call. */\n enabled?: boolean | null;\n}\n\nexport interface WaitingList {\n /**\n * Total number of spots and open spots for this waitlist.\n * For example, a Yoga class with 10 waitlist spots and 3 registered\n * on the waitlist has 10 `total_spots` and 7 `open_spots`.\n */\n totalSpots?: number | null;\n /** Number of open spots for this waitlist. */\n openSpots?: number | null;\n}\n\nexport interface BookingPolicyViolations {\n /** Bookings policy violation. Too early to book this slot. */\n tooEarlyToBook?: boolean | null;\n /** Bookings policy violation. Too late to book this slot. */\n tooLateToBook?: boolean | null;\n /** Bookings policy violation. Online booking is disabled for this slot. */\n bookOnlineDisabled?: boolean | null;\n /** Bookings policy violation. Intake Form submission is required for this slot. */\n validSubmissionRequired?: boolean | null;\n}\n\nexport interface NestedTimeSlot {\n /** @format GUID */\n serviceId?: string;\n /** @maxLength 30 */\n start?: string;\n /** @maxLength 30 */\n end?: string;\n resource?: SlotResource;\n /** Schedule ID. */\n scheduleId?: string;\n}\n\nexport interface RedirectSessionEcomCheckoutParams {\n /**\n * <b>Required</b>. ID of the checkout to process.\n * To retrieve this ID, create a checkout and the relevant ID is returned in the response.\n *\n * Create a checkout using one of the following:\n * - SDK: [Create Checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/create-checkout) or [Create Checkout From Current Cart](https://dev.wix.com/docs/sdk/backend-modules/ecom/current-cart/create-checkout-from-current-cart).\n * - REST: [Create Checkout From Cart](https://dev.wix.com/docs/rest/business-solutions/e-commerce/cart/create-checkout-from-cart).\n * @format GUID\n */\n checkoutId?: string;\n}\n\nexport interface RedirectSessionEventsCheckoutParams {\n /**\n * <b>Required</b>. ID of the temporary event reservation. Call Create Reservation ([SDK](https://dev.wix.com/docs/sdk/backend-modules/events/orders/create-reservation) | [REST](https://dev.wix.com/docs/rest/business-solutions/events/orders/create-reservation)) to reserve a ticket temporarily and obtain a reservation ID.\n * @format GUID\n */\n reservationId?: string;\n /**\n * <b>Required</b>. URL-friendly event slug, generated from the event title of the event. For example, `my-event-4`. To obtain an event slug, call Get Event ([SDK](https://dev.wix.com/docs/sdk/backend-modules/calendar/events/get-event) | [REST](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/get-event)).\n * @maxLength 150\n */\n eventSlug?: string;\n}\n\nexport interface RedirectSessionPaidPlansCheckoutParams {\n /**\n * <b>Required</b>. ID of the paid plan selected. To get a plan ID, call Query Public Plans ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/query-public-plans) | [REST](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/plans/query-public-plans)).\n * @format GUID\n */\n planId?: string;\n /**\n * For use when pricing plan selection is part of a checkout flow, only if the paid plan selection page is implemented on an external Wix Headless client site.\n * In this case, a string is received by the external pricing plans page as a `checkoutData` query parameter. Pass this string back here when redirecting back to Wix for checkout.\n * @maxLength 2048\n */\n checkoutData?: string | null;\n}\n\nexport interface RedirectSessionLoginParams {}\n\nexport interface RedirectSessionLogoutParams {\n /**\n * <b>Required</b>. ID of the OAuth app authorizing the client. To get this ID, go to your [Headless settings](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2F{{oauth-apps-settings/manage}}) and copy the Client ID of your OAuth app.\n * @format GUID\n */\n clientId?: string;\n}\n\nexport interface RedirectSessionAuthParams {\n /** <b>Required</b>. Details of the authorization request. */\n authRequest?: AuthorizeRequest;\n /** The type of prompt to use during the authorization process. */\n prompt?: PromptWithLiterals;\n}\n\n/**\n * AuthorizeRequest is sent by the client to the authorization server to initiate\n * the authorization process.\n */\nexport interface AuthorizeRequest {\n /**\n * ID of the Wix OAuth app requesting authorization.\n * @format GUID\n */\n clientId?: string;\n /**\n * Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).\n *\n * Supported values:\n * + `code`: The endpoint returns an authorization code that can be used to obtain an access token.\n * @minLength 1\n */\n responseType?: string;\n /**\n * URI to redirect the browser to after authentication and authorization. The browser is redirected to this URI whether the authentication and authorization process is successful or not.\n * @minLength 1\n */\n redirectUri?: string | null;\n /**\n * Desired scope of access. If this field is left empty, only an access token is granted.\n * To received a refresh token, pass `offline_access` as the value of this field.\n */\n scope?: string | null;\n /**\n * A value used to confirm the state of an application before and after it makes an authorization\n * request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser\n * is redirected there.\n * Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).\n * @minLength 1\n */\n state?: string;\n /**\n * esired response format.\n *\n * Supported values:\n * + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.\n * + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.\n * + `web_message`: The response parameters are encoded as a JSON object and added to the body of a [web message response](https://datatracker.ietf.org/doc/html/draft-sakimura-oauth-wmrm-00).\n *\n * Default value: `query`\n */\n responseMode?: string | null;\n /**\n * Code challenge to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n */\n codeChallenge?: string | null;\n /**\n * Code challenge method to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n *\n * Supported values:\n * + `S256`: The code challenge is transformed using SHA-256 encyption.\n * + `S512`: The code challenge is transformed using SHA-512 encyption.\n */\n codeChallengeMethod?: string | null;\n /** Session token of the site visitor to authorize. */\n sessionToken?: string | null;\n /**\n * URL to redirect user to sign in\n * @format SECURE_WEB_URL\n */\n signInUrl?: string | null;\n /** Indicates whether the user has consented to the requested scopes */\n userConsented?: boolean | null;\n /** Indicates whether login is optional. If true, will not redirect to the sign_in_url if user is not logged in. */\n optionalLogin?: boolean | null;\n /**\n * The site id the authorization is requested for.\n * @format GUID\n */\n metaSiteId?: string | null;\n}\n\n/** Specifies the behavior of the authorization flow regarding site member authentication and consent. */\nexport enum Prompt {\n /** Display the login page to the member, prompting them to enter their credentials. */\n login = 'login',\n /**\n * Bypass the Wix login page and redirect the member directly to your site.\n * This option checks if the member has an active session from a previous login\n * and, if so, immediately redirects to the specified URL while retrieving tokens.\n */\n none = 'none',\n}\n\n/** @enumType */\nexport type PromptWithLiterals = Prompt | 'login' | 'none';\n\nexport interface RedirectSessionMembersAccountParams {\n /**\n * The member account page to redirect to.\n *\n * Default: `ACCOUNT_INFO`\n */\n section?: MembersAccountSectionWithLiterals;\n}\n\nexport enum MembersAccountSection {\n /** Account info section in \"my account\". */\n ACCOUNT_INFO = 'ACCOUNT_INFO',\n /** My Bookings section in \"my account\". */\n BOOKINGS = 'BOOKINGS',\n /** My Orders section in \"my account\". */\n ORDERS = 'ORDERS',\n /** Subscriptions section in \"my account\". */\n SUBSCRIPTIONS = 'SUBSCRIPTIONS',\n /** Events section in \"my account\". */\n EVENTS = 'EVENTS',\n}\n\n/** @enumType */\nexport type MembersAccountSectionWithLiterals =\n | MembersAccountSection\n | 'ACCOUNT_INFO'\n | 'BOOKINGS'\n | 'ORDERS'\n | 'SUBSCRIPTIONS'\n | 'EVENTS';\n\nexport interface RedirectSessionStoresProductParams {\n /**\n * <b>Required</b>. Unique slug of the product to redirect to. To obtain a product slug, call Query Products [SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/products-v3/get-product-by-slug) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/products-v3/query-products)).\n * @maxLength 150\n */\n productSlug?: string;\n}\n\nexport interface RedirectSessionBookingsBookParams {\n /**\n * For use when filtering the bookings page by a specific resource.\n * @format GUID\n */\n resourceId?: string;\n}\n\nexport interface CallbackParams {\n /**\n * The URL for a custom thank you page implemented on a site outside of Wix. The visitor is directed to this page after the Wix-managed process is completed.\n * When redirecting to this URL, Wix passes different query parameters depending on the preceding transaction:\n *\n * After a pricing plans checkout:\n * + `planOrderId`: ID of a pricing plan order.\n *\n * After an eCommerce checkout:\n * + `orderId`: ID of an eCommerce order.\n *\n * After an Events checkout:\n * + `orderNumber`: Unique order number for the transaction.\n * + `eventId`: ID of the event.\n *\n * If the process is abandoned or interrupted, the visitor is redirected to the URL specified in `postFlowUrl` instead.\n *\n * Default: If you don't specify a URL, the visitor is redirected to a Wix thank you page, and from there to the URL specified in `postFlowUrl`.\n * @maxLength 2048\n */\n thankYouPageUrl?: string | null;\n /**\n * The URL Wix should redirect the visitor to when the Wix-managed process is completed, abandoned, or interrupted.\n *\n * **Note**: For an authentication redirect, don't specify a URL here. Instead, specify one in `options.auth.authRequest.redirectUri`.\n * @maxLength 2048\n */\n postFlowUrl?: string | null;\n /**\n * The URL for a custom login page implemented outside of Wix.\n *\n * Default: If you don't specify a URL, a Wix login page is used.\n * @maxLength 2048\n */\n loginUrl?: string | null;\n /**\n * The URL for a custom bookings services page implemented outside of Wix.\n *\n * Default: If you don't specify a URL, a Wix bookings services page is used.\n * @maxLength 2048\n */\n bookingsServiceListUrl?: string | null;\n /**\n * The URL for a custom eCommerce cart page implemented outside of Wix.\n *\n * Default: If you don't specify a URL, a Wix cart page is used.\n * @maxLength 2048\n */\n cartPageUrl?: string | null;\n /**\n * The URL for a custom pricing plans page implemented outside of Wix. When redirecting to this URL, Wix specifies the following query parameters:\n * + `planIds`: IDs of the pricing plans on the custom page.\n * + `checkoutData`: Specify this string back in `options.paidPlansCheckout.checkoutData` when redirecting back to Wix for checkout.\n *\n * Default: If you don't specify a URL, a Wix pricing plans page is used.\n * @maxLength 2048\n */\n planListUrl?: string | null;\n}\n\nexport interface RedirectSessionPreferences {\n /**\n * Whether to use a standard Wix template for Wix-managed pages the visitor is redirected to. Set to `false` only if your client site connects with a Wix site that has custom pages.\n *\n * Default: `true`\n */\n useGenericWixPages?: boolean | null;\n /**\n * Whether to maintain the identity used in the redirect to Wix (not relevant for `logout` and `auth` intents), or to use a new visitor identity.\n *\n * Default: `true`\n */\n maintainIdentity?: boolean | null;\n /**\n * Map of global query parameters to append to the Wix URL.\n *\n * Common parameters include:\n * - [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters): Use to track the source of site traffic.\n *\n * - `lang`: Use to control the displayed language of the Wix-managed page. For supported values, see [ISO 639 language codes](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).\n */\n additionalQueryParameters?: Record<string, string>;\n /**\n * Check if Wix page for the requested intent is published and return it if possible. Otherwise, return a standard Wix template for it.\n * Default: `false`\n */\n checkIfPublish?: boolean | null;\n}\n\nexport interface CustomMemberPaths {\n /**\n * Path of the account page in the site's members area. Required if `useGenericWixPages` is `false` and the account page path has been changed in the Wix editor.\n * @format URL_SLUG\n */\n accountPagePath?: string | null;\n /**\n * Path of the member profile page in the site's members area. Required if `useGenericWixPages` is `false` and the member profile page path has been changed in the Wix editor.\n * @format URL_SLUG\n */\n profilePagePath?: string | null;\n}\n\nexport interface CreateRedirectSessionResponse {\n /** Details for redirecting the visitor to a Wix page. */\n redirectSession?: RedirectSession;\n}\n\nexport interface CreateAnonymousRedirectSessionRequest\n extends CreateAnonymousRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n /** Optional preferences for customizing redirection to Wix pages. */\n preferences?: RedirectSessionPreferences;\n}\n\n/** @oneof */\nexport interface CreateAnonymousRedirectSessionRequestIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n}\n\nexport interface CreateAnonymousRedirectSessionResponse {\n /** Details for redirecting the visitor to a Wix page. */\n redirectSession?: RedirectSession;\n}\n\nexport interface AttachPagesRequest {\n /**\n * App ID that we want to inherit pages for.\n * @format GUID\n */\n appDefId?: string;\n}\n\nexport interface AttachPagesResponse {\n /** The status of the operation. */\n status?: AttachPagesResponseStatusWithLiterals;\n /**\n * A descriptive message about the operation\n * @maxLength 2048\n */\n message?: string;\n /** True if pages were attached, false otherwise */\n pagesAttached?: boolean;\n /** True if the site was already published */\n sitePublished?: boolean;\n}\n\nexport enum AttachPagesResponseStatus {\n /** Invalid value. */\n UNKNOWN = 'UNKNOWN',\n /** Pages were successfully attached. */\n SUCCESS = 'SUCCESS',\n /** No pages were attached because the site is already published. */\n NO_ACTION = 'NO_ACTION',\n /** An error occurred, such as when the site or app is not found. */\n ERROR = 'ERROR',\n}\n\n/** @enumType */\nexport type AttachPagesResponseStatusWithLiterals =\n | AttachPagesResponseStatus\n | 'UNKNOWN'\n | 'SUCCESS'\n | 'NO_ACTION'\n | 'ERROR';\n\nexport interface ValidateCallbackURLRequest {\n /**\n * An external URL to validate\n * @maxLength 2048\n */\n callbackUrl?: string;\n /** Type of the callback URL. */\n callbackType?: CallbackTypeWithLiterals;\n /**\n * The oauth app id used in order to pull the allowed domains from, has to correspond to the same metasite as the site in context\n * @format GUID\n */\n clientId?: string;\n}\n\nexport enum CallbackType {\n /** Invalid value. */\n UNKNOWN = 'UNKNOWN',\n /** Callback URL is used for the logout flow. */\n LOGOUT = 'LOGOUT',\n /** Callback URL is used for a checkout flow. */\n CHECKOUT = 'CHECKOUT',\n /** Callback URL is used for the authorize flow. */\n AUTHORIZE = 'AUTHORIZE',\n}\n\n/** @enumType */\nexport type CallbackTypeWithLiterals =\n | CallbackType\n | 'UNKNOWN'\n | 'LOGOUT'\n | 'CHECKOUT'\n | 'AUTHORIZE';\n\nexport interface ValidateCallbackURLResponse {\n /** Indicates if the provided URL is allowed for the given client id */\n isValid?: boolean;\n}\n\nexport interface SignInURLRequest {\n /**\n * The oauth app id used in order to pull the allowed domains from, has to correspond to the same metasite as the site in context\n * @format GUID\n */\n clientId?: string;\n}\n\nexport interface SignInURLResponse {\n /** The Wix URL details to redirect into */\n redirectSession?: RedirectSession;\n}\n\nexport interface AttachAllTemplatesRequest {}\n\nexport interface AttachAllTemplatesResponse {\n /** The status of the operation. */\n status?: StatusWithLiterals;\n}\n\nexport enum Status {\n /** Invalid value. */\n UNKNOWN = 'UNKNOWN',\n /** Templates were successfully attached. */\n SUCCESS = 'SUCCESS',\n /** An error occurred. */\n ERROR = 'ERROR',\n}\n\n/** @enumType */\nexport type StatusWithLiterals = Status | 'UNKNOWN' | 'SUCCESS' | 'ERROR';\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountDetails {\n /**\n * ID of the account.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the site, if applicable.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface RedirectSessionCreatedEnvelope {\n entity: RedirectSession;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a redirect session is created.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionId WIX_HEADLESS.WIX_URL_CREATE\n * @webhook\n * @eventType wix.headless.v1.redirect_session_created\n * @serviceIdentifier wix.headless.v1.RedirectSessionService\n * @slug created\n */\nexport declare function onRedirectSessionCreated(\n handler: (event: RedirectSessionCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.\n *\n * The Create Redirect Session method enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes.\n * For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for bookings, eCommerce, events, or paid plans transactions.\n *\n * To initiate a redirect session:\n *\n * 1. Call Create Redirect Session with the details required for Wix to take care of one specific process (for example, authentication or a bookings checkout). Provide one or more callback URLs, so Wix can redirect the visitor back to your site as appropriate when the process is over.\n * 1. Redirect your visitor to the URL provided in the response. This URL includes query parameters informing Wix where to redirect the visitor back to on your external site.\n * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.\n *\n * > **Note**: When creating a redirect session for a multilingual site:\n * >\n * > * If you don't specify the `lang` parameter in `additional_query_parameters` and the request contains an `x-wix-linguist` header, the language from the header will be added to the redirect URL as `lang`.\n * > * If you specify the `lang` parameter, it takes priority over the header.\n * @public\n * @requiredField options.intent\n * @param options - Options for creating a redirect session.\n * @permissionId WIX_HEADLESS.WIX_URL_CREATE\n * @applicableIdentity APP\n * @fqn wix.headless.v1.RedirectSessionService.CreateRedirectSession\n */\nexport async function createRedirectSession(\n options?: CreateRedirectSessionOptions\n): Promise<\n NonNullablePaths<\n CreateRedirectSessionResponse,\n | `redirectSession._id`\n | `redirectSession.fullUrl`\n | `redirectSession.urlDetails.endpoint`\n | `redirectSession.shortUrl`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n bookingsCheckout: options?.bookingsCheckout,\n ecomCheckout: options?.ecomCheckout,\n eventsCheckout: options?.eventsCheckout,\n paidPlansCheckout: options?.paidPlansCheckout,\n login: options?.login,\n logout: options?.logout,\n auth: options?.auth,\n storesProduct: options?.storesProduct,\n bookingsBook: options?.bookingsBook,\n callbacks: options?.callbacks,\n preferences: options?.preferences,\n origin: options?.origin,\n });\n\n const reqOpts =\n ambassadorWixHeadlessV1RedirectSession.createRedirectSession(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n bookingsCheckout: '$[0].bookingsCheckout',\n ecomCheckout: '$[0].ecomCheckout',\n eventsCheckout: '$[0].eventsCheckout',\n paidPlansCheckout: '$[0].paidPlansCheckout',\n login: '$[0].login',\n logout: '$[0].logout',\n auth: '$[0].auth',\n storesProduct: '$[0].storesProduct',\n bookingsBook: '$[0].bookingsBook',\n callbacks: '$[0].callbacks',\n preferences: '$[0].preferences',\n origin: '$[0].origin',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateRedirectSessionOptions\n extends CreateRedirectSessionOptionsIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n /**\n * Details of pages to redirect back to on the Wix Headless client site.\n *\n * **Note**: For an authentication redirect, don't specify a post-flow URL here. Instead, specify one in `options.auth.authRequest.redirectUri`.\n */\n callbacks?: CallbackParams;\n /** Optional preferences for customizing redirection to Wix pages. */\n preferences?: RedirectSessionPreferences;\n /**\n * The origin of the request\n * @maxLength 2048\n */\n origin?: string | null;\n}\n\n/** @oneof */\nexport interface CreateRedirectSessionOptionsIntentOneOf {\n /** Information required for generating a custom URL for a Wix Bookings checkout. */\n bookingsCheckout?: RedirectSessionBookingsCheckoutParams;\n /** Information required for generating a custom URL for a Wix eCommerce checkout. */\n ecomCheckout?: RedirectSessionEcomCheckoutParams;\n /** Information required for generating a custom URL for a Wix Events checkout. */\n eventsCheckout?: RedirectSessionEventsCheckoutParams;\n /** Information required for generating a custom URL for a Wix Paid Plans checkout. */\n paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;\n /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */\n login?: RedirectSessionLoginParams;\n /** Information required for generating a custom URL to log out from a Wix account. This process invalidates the visitor or member token and clears cookies associated with the Wix domain from their browser. */\n logout?: RedirectSessionLogoutParams;\n /** Information required for generating a custom URL for Wix authentication. */\n auth?: RedirectSessionAuthParams;\n /** Information required for generating a custom URL for a Wix stores product page. */\n storesProduct?: RedirectSessionStoresProductParams;\n /** Information required for generating a custom URL for Wix bookings book page. */\n bookingsBook?: RedirectSessionBookingsBookParams;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixHeadlessV1RedirectSessionServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/redirects-api',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/redirects-api',\n destPath: '',\n },\n {\n srcPath: '/redirect-session',\n destPath: '',\n },\n {\n srcPath: '/headless/v1/redirect-session',\n destPath: '/v1/redirect-session',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/headless/v1/redirect-session',\n destPath: '/v1/redirect-session',\n },\n ],\n _: [\n {\n srcPath: '/headless/v1/redirect-session',\n destPath: '/v1/redirect-session',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_redirects_redirects';\n\n/**\n * Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.\n *\n * The Create Redirect Session method enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes.\n * For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for bookings, eCommerce, events, or paid plans transactions.\n *\n * To initiate a redirect session:\n *\n * 1. Call Create Redirect Session with the details required for Wix to take care of one specific process (for example, authentication or a bookings checkout). Provide one or more callback URLs, so Wix can redirect the visitor back to your site as appropriate when the process is over.\n * 1. Redirect your visitor to the URL provided in the response. This URL includes query parameters informing Wix where to redirect the visitor back to on your external site.\n * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.\n *\n * > **Note**: When creating a redirect session for a multilingual site:\n * >\n * > * If you don't specify the `lang` parameter in `additional_query_parameters` and the request contains an `x-wix-linguist` header, the language from the header will be added to the redirect URL as `lang`.\n * > * If you specify the `lang` parameter, it takes priority over the header.\n */\nexport function createRedirectSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __createRedirectSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.headless.v1.redirect_session',\n method: 'POST' as any,\n methodFqn: 'wix.headless.v1.RedirectSessionService.CreateRedirectSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixHeadlessV1RedirectSessionServiceUrl({\n protoPath: '/v1/redirect-session',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createRedirectSession;\n}\n","import { createRedirectSession as publicCreateRedirectSession } from './headless-v1-redirect-session-redirects.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onRedirectSessionCreated as publicOnRedirectSessionCreated } from './headless-v1-redirect-session-redirects.public.js';\n\nexport const createRedirectSession: MaybeContext<\n BuildRESTFunction<typeof publicCreateRedirectSession> &\n typeof publicCreateRedirectSession\n> = /*#__PURE__*/ createRESTModule(publicCreateRedirectSession);\n/**\n * Triggered when a redirect session is created.\n */\nexport const onRedirectSessionCreated: BuildEventDefinition<\n typeof publicOnRedirectSessionCreated\n> &\n typeof publicOnRedirectSessionCreated = createEventModule(\n publicOnRedirectSessionCreated\n);\n\nexport {\n LocationType,\n Prompt,\n MembersAccountSection,\n AttachPagesResponseStatus,\n CallbackType,\n Status,\n WebhookIdentityType,\n} from './headless-v1-redirect-session-redirects.universal.js';\nexport {\n RedirectSession,\n URLDetails,\n CreateRedirectSessionRequest,\n CreateRedirectSessionRequestIntentOneOf,\n RedirectSessionBookingsCheckoutParams,\n SlotAvailability,\n Slot,\n SlotResource,\n Location,\n PhoneCall,\n WaitingList,\n BookingPolicyViolations,\n NestedTimeSlot,\n RedirectSessionEcomCheckoutParams,\n RedirectSessionEventsCheckoutParams,\n RedirectSessionPaidPlansCheckoutParams,\n RedirectSessionLoginParams,\n RedirectSessionLogoutParams,\n RedirectSessionAuthParams,\n AuthorizeRequest,\n RedirectSessionMembersAccountParams,\n RedirectSessionStoresProductParams,\n RedirectSessionBookingsBookParams,\n CallbackParams,\n RedirectSessionPreferences,\n CustomMemberPaths,\n CreateRedirectSessionResponse,\n CreateAnonymousRedirectSessionRequest,\n CreateAnonymousRedirectSessionRequestIntentOneOf,\n CreateAnonymousRedirectSessionResponse,\n AttachPagesRequest,\n AttachPagesResponse,\n ValidateCallbackURLRequest,\n ValidateCallbackURLResponse,\n SignInURLRequest,\n SignInURLResponse,\n AttachAllTemplatesRequest,\n AttachAllTemplatesResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountDetails,\n BaseEventMetadata,\n EventMetadata,\n RedirectSessionCreatedEnvelope,\n CreateRedirectSessionOptions,\n CreateRedirectSessionOptionsIntentOneOf,\n} from './headless-v1-redirect-session-redirects.universal.js';\nexport {\n LocationTypeWithLiterals,\n PromptWithLiterals,\n MembersAccountSectionWithLiterals,\n AttachPagesResponseStatusWithLiterals,\n CallbackTypeWithLiterals,\n StatusWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './headless-v1-redirect-session-redirects.universal.js';\n"],"mappings":"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","names":["createRedirectSession","onRedirectSessionCreated","import_rename_all_nested_keys","LocationType","Prompt","MembersAccountSection","AttachPagesResponseStatus","CallbackType","Status","WebhookIdentityType","createRedirectSession","sdkTransformError","createRedirectSession","import_rest_modules","createRedirectSession","onRedirectSessionCreated"]}
|
|
@@ -819,6 +819,23 @@ declare enum WebhookIdentityType {
|
|
|
819
819
|
}
|
|
820
820
|
/** @enumType */
|
|
821
821
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
822
|
+
interface AccountDetails {
|
|
823
|
+
/**
|
|
824
|
+
* ID of the account.
|
|
825
|
+
* @format GUID
|
|
826
|
+
*/
|
|
827
|
+
accountId?: string | null;
|
|
828
|
+
/**
|
|
829
|
+
* ID of the parent account.
|
|
830
|
+
* @format GUID
|
|
831
|
+
*/
|
|
832
|
+
parentAccountId?: string | null;
|
|
833
|
+
/**
|
|
834
|
+
* ID of the site, if applicable.
|
|
835
|
+
* @format GUID
|
|
836
|
+
*/
|
|
837
|
+
siteId?: string | null;
|
|
838
|
+
}
|
|
822
839
|
interface BaseEventMetadata {
|
|
823
840
|
/**
|
|
824
841
|
* App instance ID.
|
|
@@ -973,4 +990,4 @@ interface CreateRedirectSessionOptionsIntentOneOf {
|
|
|
973
990
|
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
974
991
|
}
|
|
975
992
|
|
|
976
|
-
export { type ActionEvent, type AttachAllTemplatesRequest, type AttachAllTemplatesResponse, type AttachPagesRequest, type AttachPagesResponse, AttachPagesResponseStatus, type AttachPagesResponseStatusWithLiterals, type AuthorizeRequest, type BaseEventMetadata, type BookingPolicyViolations, type CallbackParams, CallbackType, type CallbackTypeWithLiterals, type CreateAnonymousRedirectSessionRequest, type CreateAnonymousRedirectSessionRequestIntentOneOf, type CreateAnonymousRedirectSessionResponse, type CreateRedirectSessionOptions, type CreateRedirectSessionOptionsIntentOneOf, type CreateRedirectSessionRequest, type CreateRedirectSessionRequestIntentOneOf, type CreateRedirectSessionResponse, type CustomMemberPaths, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, type Location, LocationType, type LocationTypeWithLiterals, MembersAccountSection, type MembersAccountSectionWithLiterals, type MessageEnvelope, type NestedTimeSlot, type PhoneCall, Prompt, type PromptWithLiterals, type RedirectSession, type RedirectSessionAuthParams, type RedirectSessionBookingsBookParams, type RedirectSessionBookingsCheckoutParams, type RedirectSessionCreatedEnvelope, type RedirectSessionEcomCheckoutParams, type RedirectSessionEventsCheckoutParams, type RedirectSessionLoginParams, type RedirectSessionLogoutParams, type RedirectSessionMembersAccountParams, type RedirectSessionPaidPlansCheckoutParams, type RedirectSessionPreferences, type RedirectSessionStoresProductParams, type RestoreInfo, type SignInURLRequest, type SignInURLResponse, type Slot, type SlotAvailability, type SlotResource, Status, type StatusWithLiterals, type URLDetails, type ValidateCallbackURLRequest, type ValidateCallbackURLResponse, type WaitingList, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createRedirectSession, onRedirectSessionCreated };
|
|
993
|
+
export { type AccountDetails, type ActionEvent, type AttachAllTemplatesRequest, type AttachAllTemplatesResponse, type AttachPagesRequest, type AttachPagesResponse, AttachPagesResponseStatus, type AttachPagesResponseStatusWithLiterals, type AuthorizeRequest, type BaseEventMetadata, type BookingPolicyViolations, type CallbackParams, CallbackType, type CallbackTypeWithLiterals, type CreateAnonymousRedirectSessionRequest, type CreateAnonymousRedirectSessionRequestIntentOneOf, type CreateAnonymousRedirectSessionResponse, type CreateRedirectSessionOptions, type CreateRedirectSessionOptionsIntentOneOf, type CreateRedirectSessionRequest, type CreateRedirectSessionRequestIntentOneOf, type CreateRedirectSessionResponse, type CustomMemberPaths, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, type Location, LocationType, type LocationTypeWithLiterals, MembersAccountSection, type MembersAccountSectionWithLiterals, type MessageEnvelope, type NestedTimeSlot, type PhoneCall, Prompt, type PromptWithLiterals, type RedirectSession, type RedirectSessionAuthParams, type RedirectSessionBookingsBookParams, type RedirectSessionBookingsCheckoutParams, type RedirectSessionCreatedEnvelope, type RedirectSessionEcomCheckoutParams, type RedirectSessionEventsCheckoutParams, type RedirectSessionLoginParams, type RedirectSessionLogoutParams, type RedirectSessionMembersAccountParams, type RedirectSessionPaidPlansCheckoutParams, type RedirectSessionPreferences, type RedirectSessionStoresProductParams, type RestoreInfo, type SignInURLRequest, type SignInURLResponse, type Slot, type SlotAvailability, type SlotResource, Status, type StatusWithLiterals, type URLDetails, type ValidateCallbackURLRequest, type ValidateCallbackURLResponse, type WaitingList, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createRedirectSession, onRedirectSessionCreated };
|