@wix/redirects_redirects
Advanced tools
Comparing version 1.0.22 to 1.0.23
@@ -1,1 +0,1 @@ | ||
export * from './src/headless-v1-redirect-session-redirects.public'; | ||
export * from './src/headless-v1-redirect-session-redirects.context'; |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./src/headless-v1-redirect-session-redirects.public"), exports); | ||
__exportStar(require("./src/headless-v1-redirect-session-redirects.context"), exports); | ||
//# sourceMappingURL=index.js.map |
import { createRedirectSession as publicCreateRedirectSession } from './headless-v1-redirect-session-redirects.public'; | ||
import { createRESTModule } from '@wix/sdk-runtime/rest-modules'; | ||
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules'; | ||
import { BuildRESTFunction } from '@wix/sdk-types'; | ||
import { onRedirectSessionCreated as publicOnRedirectSessionCreated } from './headless-v1-redirect-session-redirects.public'; | ||
export declare const createRedirectSession: ReturnType<typeof createRESTModule<typeof publicCreateRedirectSession>>; | ||
export declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<typeof publicOnRedirectSessionCreated>>; | ||
export declare const createRedirectSession: BuildRESTFunction<typeof publicCreateRedirectSession> & typeof publicCreateRedirectSession; | ||
export { publicOnRedirectSessionCreated }; | ||
export type _publicOnRedirectSessionCreatedType = typeof publicOnRedirectSessionCreated; | ||
/** */ | ||
export declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<_publicOnRedirectSessionCreatedType>>; | ||
export { LocationType, Prompt, MembersAccountSection, CallbackType, WebhookIdentityType, } from './headless-v1-redirect-session-redirects.universal'; | ||
export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, RedirectSessionStoresProductParams, RedirectSessionBookingsBookParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, RestoreInfo, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, CreateRedirectSessionResponseNonNullableFields, BaseEventMetadata, EventMetadata, RedirectSessionCreatedEnvelope, CreateRedirectSessionOptions, } from './headless-v1-redirect-session-redirects.universal'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.onRedirectSessionCreated = exports.createRedirectSession = void 0; | ||
exports.WebhookIdentityType = exports.CallbackType = exports.MembersAccountSection = exports.Prompt = exports.LocationType = exports.onRedirectSessionCreated = exports.publicOnRedirectSessionCreated = exports.createRedirectSession = void 0; | ||
const headless_v1_redirect_session_redirects_public_1 = require("./headless-v1-redirect-session-redirects.public"); | ||
@@ -8,4 +8,12 @@ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules"); | ||
const headless_v1_redirect_session_redirects_public_2 = require("./headless-v1-redirect-session-redirects.public"); | ||
Object.defineProperty(exports, "publicOnRedirectSessionCreated", { enumerable: true, get: function () { return headless_v1_redirect_session_redirects_public_2.onRedirectSessionCreated; } }); | ||
exports.createRedirectSession = (0, rest_modules_1.createRESTModule)(headless_v1_redirect_session_redirects_public_1.createRedirectSession); | ||
/** */ | ||
exports.onRedirectSessionCreated = (0, event_definition_modules_1.createEventModule)(headless_v1_redirect_session_redirects_public_2.onRedirectSessionCreated); | ||
var headless_v1_redirect_session_redirects_universal_1 = require("./headless-v1-redirect-session-redirects.universal"); | ||
Object.defineProperty(exports, "LocationType", { enumerable: true, get: function () { return headless_v1_redirect_session_redirects_universal_1.LocationType; } }); | ||
Object.defineProperty(exports, "Prompt", { enumerable: true, get: function () { return headless_v1_redirect_session_redirects_universal_1.Prompt; } }); | ||
Object.defineProperty(exports, "MembersAccountSection", { enumerable: true, get: function () { return headless_v1_redirect_session_redirects_universal_1.MembersAccountSection; } }); | ||
Object.defineProperty(exports, "CallbackType", { enumerable: true, get: function () { return headless_v1_redirect_session_redirects_universal_1.CallbackType; } }); | ||
Object.defineProperty(exports, "WebhookIdentityType", { enumerable: true, get: function () { return headless_v1_redirect_session_redirects_universal_1.WebhookIdentityType; } }); | ||
//# sourceMappingURL=headless-v1-redirect-session-redirects.context.js.map |
import { EventDefinition, HttpClient } from '@wix/sdk-types'; | ||
import { CreateRedirectSessionOptions, RedirectSessionCreatedEnvelope } from './headless-v1-redirect-session-redirects.universal'; | ||
import { CreateRedirectSessionOptions, CreateRedirectSessionResponse, CreateRedirectSessionResponseNonNullableFields, RedirectSessionCreatedEnvelope } from './headless-v1-redirect-session-redirects.universal'; | ||
export declare const __metadata: { | ||
PACKAGE_NAME: string; | ||
}; | ||
export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<import("./headless-v1-redirect-session-redirects.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session-redirects.universal").CreateRedirectSessionResponseNonNullableFields>; | ||
export declare function createRedirectSession(httpClient: HttpClient): CreateRedirectSessionSignature; | ||
interface CreateRedirectSessionSignature { | ||
/** | ||
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality. | ||
* | ||
* | ||
* The `createRedirectSession()` function enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes. | ||
* For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for a bookings, eCommerce, events, or paid plans transaction. | ||
* | ||
* To initiate a redirect session: | ||
* | ||
* 1. Call `createRedirectSession()` 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 user back to your site as appropriate when the process is over. | ||
* 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. | ||
* 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow. | ||
* @param - Options for creating a redirect session. | ||
*/ | ||
(options?: CreateRedirectSessionOptions | undefined): Promise<CreateRedirectSessionResponse & CreateRedirectSessionResponseNonNullableFields>; | ||
} | ||
export declare const onRedirectSessionCreated: EventDefinition<RedirectSessionCreatedEnvelope, "wix.headless.v1.redirect_session_created">; | ||
export { ActionEvent, AuthorizeRequest, BaseEventMetadata, BookingPolicyViolations, CallbackParams, CallbackType, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, CreateRedirectSessionOptions, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, CreateRedirectSessionResponse, CreateRedirectSessionResponseNonNullableFields, CustomMemberPaths, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, IdentificationData, IdentificationDataIdOneOf, Location, LocationType, MembersAccountSection, MessageEnvelope, NestedTimeSlot, Prompt, RedirectSession, RedirectSessionAuthParams, RedirectSessionBookingsBookParams, RedirectSessionBookingsCheckoutParams, RedirectSessionCreatedEnvelope, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionMembersAccountParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionPreferences, RedirectSessionStoresProductParams, RestoreInfo, SignInURLRequest, SignInURLResponse, Slot, SlotAvailability, SlotResource, URLDetails, ValidateCallbackURLRequest, ValidateCallbackURLResponse, WaitingList, WebhookIdentityType, } from './headless-v1-redirect-session-redirects.universal'; |
@@ -609,11 +609,14 @@ /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
export interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: { | ||
id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
export {}; |
@@ -604,11 +604,13 @@ /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
export interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
@@ -669,2 +671,3 @@ export interface BaseEventMetadata { | ||
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES | ||
* @permissionId WIX_HEADLESS.WIX_URL_CREATE | ||
* @webhook | ||
@@ -726,1 +729,2 @@ * @eventType wix.headless.v1.redirect_session_created | ||
} | ||
export {}; |
@@ -1,1 +0,1 @@ | ||
export * from './src/headless-v1-redirect-session-redirects.public'; | ||
export * from './src/headless-v1-redirect-session-redirects.context'; |
@@ -1,2 +0,2 @@ | ||
export * from './src/headless-v1-redirect-session-redirects.public'; | ||
export * from './src/headless-v1-redirect-session-redirects.context'; | ||
//# sourceMappingURL=index.js.map |
import { createRedirectSession as publicCreateRedirectSession } from './headless-v1-redirect-session-redirects.public'; | ||
import { createRESTModule } from '@wix/sdk-runtime/rest-modules'; | ||
import { createEventModule } from '@wix/sdk-runtime/event-definition-modules'; | ||
import { BuildRESTFunction } from '@wix/sdk-types'; | ||
import { onRedirectSessionCreated as publicOnRedirectSessionCreated } from './headless-v1-redirect-session-redirects.public'; | ||
export declare const createRedirectSession: ReturnType<typeof createRESTModule<typeof publicCreateRedirectSession>>; | ||
export declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<typeof publicOnRedirectSessionCreated>>; | ||
export declare const createRedirectSession: BuildRESTFunction<typeof publicCreateRedirectSession> & typeof publicCreateRedirectSession; | ||
export { publicOnRedirectSessionCreated }; | ||
export type _publicOnRedirectSessionCreatedType = typeof publicOnRedirectSessionCreated; | ||
/** */ | ||
export declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<_publicOnRedirectSessionCreatedType>>; | ||
export { LocationType, Prompt, MembersAccountSection, CallbackType, WebhookIdentityType, } from './headless-v1-redirect-session-redirects.universal'; | ||
export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, RedirectSessionStoresProductParams, RedirectSessionBookingsBookParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, RestoreInfo, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, CreateRedirectSessionResponseNonNullableFields, BaseEventMetadata, EventMetadata, RedirectSessionCreatedEnvelope, CreateRedirectSessionOptions, } from './headless-v1-redirect-session-redirects.universal'; |
@@ -6,3 +6,6 @@ import { createRedirectSession as publicCreateRedirectSession } from './headless-v1-redirect-session-redirects.public'; | ||
export const createRedirectSession = createRESTModule(publicCreateRedirectSession); | ||
export { publicOnRedirectSessionCreated }; | ||
/** */ | ||
export const onRedirectSessionCreated = createEventModule(publicOnRedirectSessionCreated); | ||
export { LocationType, Prompt, MembersAccountSection, CallbackType, WebhookIdentityType, } from './headless-v1-redirect-session-redirects.universal'; | ||
//# sourceMappingURL=headless-v1-redirect-session-redirects.context.js.map |
import { EventDefinition, HttpClient } from '@wix/sdk-types'; | ||
import { CreateRedirectSessionOptions, RedirectSessionCreatedEnvelope } from './headless-v1-redirect-session-redirects.universal'; | ||
import { CreateRedirectSessionOptions, CreateRedirectSessionResponse, CreateRedirectSessionResponseNonNullableFields, RedirectSessionCreatedEnvelope } from './headless-v1-redirect-session-redirects.universal'; | ||
export declare const __metadata: { | ||
PACKAGE_NAME: string; | ||
}; | ||
export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<import("./headless-v1-redirect-session-redirects.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session-redirects.universal").CreateRedirectSessionResponseNonNullableFields>; | ||
export declare function createRedirectSession(httpClient: HttpClient): CreateRedirectSessionSignature; | ||
interface CreateRedirectSessionSignature { | ||
/** | ||
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality. | ||
* | ||
* | ||
* The `createRedirectSession()` function enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes. | ||
* For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for a bookings, eCommerce, events, or paid plans transaction. | ||
* | ||
* To initiate a redirect session: | ||
* | ||
* 1. Call `createRedirectSession()` 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 user back to your site as appropriate when the process is over. | ||
* 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. | ||
* 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow. | ||
* @param - Options for creating a redirect session. | ||
*/ | ||
(options?: CreateRedirectSessionOptions | undefined): Promise<CreateRedirectSessionResponse & CreateRedirectSessionResponseNonNullableFields>; | ||
} | ||
export declare const onRedirectSessionCreated: EventDefinition<RedirectSessionCreatedEnvelope, "wix.headless.v1.redirect_session_created">; | ||
export { ActionEvent, AuthorizeRequest, BaseEventMetadata, BookingPolicyViolations, CallbackParams, CallbackType, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, CreateRedirectSessionOptions, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, CreateRedirectSessionResponse, CreateRedirectSessionResponseNonNullableFields, CustomMemberPaths, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, IdentificationData, IdentificationDataIdOneOf, Location, LocationType, MembersAccountSection, MessageEnvelope, NestedTimeSlot, Prompt, RedirectSession, RedirectSessionAuthParams, RedirectSessionBookingsBookParams, RedirectSessionBookingsCheckoutParams, RedirectSessionCreatedEnvelope, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionMembersAccountParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionPreferences, RedirectSessionStoresProductParams, RestoreInfo, SignInURLRequest, SignInURLResponse, Slot, SlotAvailability, SlotResource, URLDetails, ValidateCallbackURLRequest, ValidateCallbackURLResponse, WaitingList, WebhookIdentityType, } from './headless-v1-redirect-session-redirects.universal'; |
@@ -609,11 +609,14 @@ /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
export interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: { | ||
id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
export {}; |
@@ -604,11 +604,13 @@ /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
export interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
@@ -669,2 +671,3 @@ export interface BaseEventMetadata { | ||
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES | ||
* @permissionId WIX_HEADLESS.WIX_URL_CREATE | ||
* @webhook | ||
@@ -726,1 +729,2 @@ * @eventType wix.headless.v1.redirect_session_created | ||
} | ||
export {}; |
{ | ||
"name": "@wix/redirects_redirects", | ||
"version": "1.0.22", | ||
"version": "1.0.23", | ||
"publishConfig": { | ||
@@ -23,3 +23,3 @@ "registry": "https://registry.npmjs.org/", | ||
"@wix/motion-edm-autogen-query-wrapper": "^1.0.37", | ||
"@wix/sdk-runtime": "^0.3.11", | ||
"@wix/sdk-runtime": "^0.3.14", | ||
"@wix/sdk-types": "^1.9.2" | ||
@@ -34,4 +34,5 @@ }, | ||
"scripts": { | ||
"build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles", | ||
"build:dts-bundles": "test -f config/rollup-config.js && rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'", | ||
"build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles && npm run build:validate-dts", | ||
"build:dts-bundles": "test -f config/rollup-config.js && NODE_OPTIONS=--max-old-space-size=8192 rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'", | ||
"build:validate-dts": "tsc type-bundles/*.d.ts --noEmit", | ||
"test": ":" | ||
@@ -49,3 +50,3 @@ }, | ||
}, | ||
"falconPackageHash": "7f1ee07be65e0bd938c94e283924e1624d66d1a505ebdf69a756c5d9" | ||
"falconPackageHash": "90f74a8137dbc568f5a3993f0f9f6d0bfb29dda8f97ed6bbd0f9c199" | ||
} |
@@ -45,9 +45,724 @@ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T; | ||
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T; | ||
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
interface RedirectSession { | ||
/** ID of the redirect session created. */ | ||
_id?: string; | ||
/** | ||
* 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. | ||
* @readonly | ||
*/ | ||
fullUrl?: string; | ||
/** Details about the URL of the RedirectSession */ | ||
urlDetails?: URLDetails; | ||
/** | ||
* The session token to pass to the Wix page to maintain the visitor's identity. | ||
* @readonly | ||
*/ | ||
sessionToken?: string | null; | ||
/** | ||
* 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. | ||
* @readonly | ||
*/ | ||
shortUrl?: string; | ||
} | ||
interface URLDetails { | ||
/** | ||
* The endpoint of the url (includes the base url and the path to the endpoint, without the query parameters) | ||
* For example: `https://mysite.com/_api/oauth2/authorize` | ||
* @readonly | ||
*/ | ||
endpoint?: string; | ||
/** The query parameters of the url */ | ||
searchParams?: Record<string, string>; | ||
} | ||
interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf { | ||
/** Information required for generating a custom URL for a Wix Bookings checkout. */ | ||
bookingsCheckout?: RedirectSessionBookingsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix eCommerce checkout. */ | ||
ecomCheckout?: RedirectSessionEcomCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Events checkout. */ | ||
eventsCheckout?: RedirectSessionEventsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */ | ||
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams; | ||
/** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */ | ||
login?: RedirectSessionLoginParams; | ||
/** 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. */ | ||
logout?: RedirectSessionLogoutParams; | ||
/** Information required for generating a custom URL for Wix authentication. */ | ||
auth?: RedirectSessionAuthParams; | ||
/** Information required for generating a custom URL for a Wix stores product page. */ | ||
storesProduct?: RedirectSessionStoresProductParams; | ||
/** Information required for generating a custom URL for Wix bookings book page. */ | ||
bookingsBook?: RedirectSessionBookingsBookParams; | ||
/** | ||
* Details of pages to redirect the visitor back to on the Wix Headless client site. | ||
* | ||
* **Note**: For an authentication redirect, don't pass a post-flow URL here. Instead, pass one in `options.auth.authRequest.redirectUri`. | ||
*/ | ||
callbacks?: CallbackParams; | ||
/** Optional preferences for customizing redirection to Wix pages. */ | ||
preferences?: RedirectSessionPreferences; | ||
} | ||
/** @oneof */ | ||
interface CreateRedirectSessionRequestIntentOneOf { | ||
/** Information required for generating a custom URL for a Wix Bookings checkout. */ | ||
bookingsCheckout?: RedirectSessionBookingsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix eCommerce checkout. */ | ||
ecomCheckout?: RedirectSessionEcomCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Events checkout. */ | ||
eventsCheckout?: RedirectSessionEventsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */ | ||
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams; | ||
/** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */ | ||
login?: RedirectSessionLoginParams; | ||
/** 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. */ | ||
logout?: RedirectSessionLogoutParams; | ||
/** Information required for generating a custom URL for Wix authentication. */ | ||
auth?: RedirectSessionAuthParams; | ||
/** Information required for generating a custom URL for a Wix stores product page. */ | ||
storesProduct?: RedirectSessionStoresProductParams; | ||
/** Information required for generating a custom URL for Wix bookings book page. */ | ||
bookingsBook?: RedirectSessionBookingsBookParams; | ||
} | ||
interface RedirectSessionBookingsCheckoutParams { | ||
/** | ||
* 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`. | ||
* | ||
* Default: If you don't specify a timezone, the timezone in `slotAvailability.slot.timezone` is used. | ||
*/ | ||
timezone?: string; | ||
/** __Required.__ The calendar slot to check out. */ | ||
slotAvailability?: SlotAvailability; | ||
} | ||
interface SlotAvailability { | ||
/** | ||
* The slot for the corresponding session, when the session is either a single session | ||
* or a specific session generated from a recurring session. | ||
*/ | ||
slot?: Slot; | ||
/** | ||
* Whether the slot is bookable. Bookability is determined by checking a | ||
* session's open slots and booking policies. Locks are not taken into | ||
* account. | ||
*/ | ||
bookable?: boolean; | ||
/** | ||
* Total number of spots for this slot. | ||
* For example, if a session has a total of 10 spots and 3 spots are booked, | ||
* `spotsTotal` is 10 and `openSpots` is 7. | ||
*/ | ||
totalSpots?: number | null; | ||
/** Number of open spots for this slot. */ | ||
openSpots?: number | null; | ||
/** An object describing the slot's waitlist and its occupancy. */ | ||
waitingList?: WaitingList; | ||
/** Booking policy violations for the slot. */ | ||
bookingPolicyViolations?: BookingPolicyViolations; | ||
/** | ||
* Indicates whether the slot is locked because a waitlist exists. | ||
* When a slot frees up, the slot is offered to the next customer on the waitlist. Read-only. | ||
*/ | ||
locked?: boolean | null; | ||
isFromV2?: boolean; | ||
} | ||
interface Slot { | ||
/** | ||
* ID for the slot's corresponding session, when the session is either a single session | ||
* or a specific session generated from a recurring session. | ||
*/ | ||
sessionId?: string | null; | ||
/** Service ID. */ | ||
serviceId?: string; | ||
/** Schedule ID. */ | ||
scheduleId?: string; | ||
/** | ||
* The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) | ||
* format. | ||
* | ||
* If `timezone` is specified, | ||
* dates are based on the local date/time. This means that the timezone offset | ||
* in the `startDate` is ignored. | ||
*/ | ||
startDate?: string | null; | ||
/** | ||
* The end time of this slot in | ||
* [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format. | ||
* | ||
* If `timezone` is specified, | ||
* dates are based on the local date/time. This means that the timezone offset | ||
* in the `endDate` is ignored. | ||
*/ | ||
endDate?: string | null; | ||
/** | ||
* The timezone for which slot availability is to be calculated. | ||
* | ||
* Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/sdk/bookings/availabilitycalendar/queryavailability#bookings_availabilitycalendar_queryavailability_handling-daylight-savings-time-dst-for-local-time-zones) | ||
* when calculating availability. | ||
*/ | ||
timezone?: string | null; | ||
/** | ||
* The resource required for this slot. Currently, the only supported resource | ||
* is the relevant staff member for the slot. | ||
*/ | ||
resource?: SlotResource; | ||
/** Geographic location of the slot. */ | ||
location?: Location; | ||
} | ||
interface SlotResource { | ||
/** | ||
* Resource ID. | ||
* @readonly | ||
*/ | ||
_id?: string | null; | ||
/** Resource name. Read only. */ | ||
name?: string | null; | ||
} | ||
interface Location { | ||
/** | ||
* Business location ID. Available only for locations that are business locations, | ||
* meaning the `location_type` is `"OWNER_BUSINESS"`. | ||
*/ | ||
_id?: string | null; | ||
/** Location name. */ | ||
name?: string | null; | ||
/** The full address of this location. */ | ||
formattedAddress?: string | null; | ||
/** | ||
* Location type. | ||
* | ||
* - `"OWNER_BUSINESS"`: The business address, as set in the site’s general settings. | ||
* - `"OWNER_CUSTOM"`: The address as set when creating the service. | ||
* - `"CUSTOM"`: The address as set for the individual session. | ||
*/ | ||
locationType?: LocationType; | ||
} | ||
declare enum LocationType { | ||
UNDEFINED = "UNDEFINED", | ||
OWNER_BUSINESS = "OWNER_BUSINESS", | ||
OWNER_CUSTOM = "OWNER_CUSTOM", | ||
CUSTOM = "CUSTOM" | ||
} | ||
interface WaitingList { | ||
/** | ||
* Total number of spots and open spots for this waitlist. | ||
* For example, a Yoga class with 10 waitlist spots and 3 registered | ||
* on the waitlist has 10 `total_spots` and 7 `open_spots`. | ||
*/ | ||
totalSpots?: number | null; | ||
/** Number of open spots for this waitlist. */ | ||
openSpots?: number | null; | ||
} | ||
interface BookingPolicyViolations { | ||
/** Bookings policy violation. Too early to book this slot. */ | ||
tooEarlyToBook?: boolean | null; | ||
/** Bookings policy violation. Too late to book this slot. */ | ||
tooLateToBook?: boolean | null; | ||
/** Bookings policy violation. Online booking is disabled for this slot. */ | ||
bookOnlineDisabled?: boolean | null; | ||
} | ||
interface NestedTimeSlot { | ||
serviceId?: string; | ||
start?: string; | ||
end?: string; | ||
resource?: SlotResource; | ||
/** Schedule ID. */ | ||
scheduleId?: string; | ||
} | ||
interface RedirectSessionEcomCheckoutParams { | ||
/** __Required.__ ID of the checkout to process. Use [`createCheckout()`](https://dev.wix.com/api/sdk/ecom/checkout/createcheckout) or [`createCheckoutFromCurrentCart()`](https://dev.wix.com/api/sdk/ecom/currentcart/createcheckoutfromcurrentcart) to create a checkout and obtain an ID. */ | ||
checkoutId?: string; | ||
} | ||
interface RedirectSessionEventsCheckoutParams { | ||
/** __Required.__ ID of the temporary event reservation. Use [`createReservation()`](https://dev.wix.com/api/sdk/events/checkout/createreservation) to reserve a ticket temporarily and obtain a reservation ID. */ | ||
reservationId?: string; | ||
/** __Required.__ URL-friendly event slug, generated from the event title of the event. For example, `my-event-4`. Use [`listEvents()`](https://dev.wix.com/api/sdk/events/wixevents/listevents) to obtain an event slug. */ | ||
eventSlug?: string; | ||
} | ||
interface RedirectSessionPaidPlansCheckoutParams { | ||
/** __Required.__ ID of the paid plan selected. Use [`queryPublicPlans()`](https://dev.wix.com/api/sdk/pricing-plans/plans/querypublicplans) to obtain a paid plan ID. */ | ||
planId?: string; | ||
/** | ||
* 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. | ||
* 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. | ||
*/ | ||
checkoutData?: string | null; | ||
} | ||
interface RedirectSessionLoginParams { | ||
} | ||
interface RedirectSessionLogoutParams { | ||
/** __Required.__ ID of the OAuth app authorizing the client. */ | ||
clientId?: string; | ||
} | ||
interface RedirectSessionAuthParams { | ||
/** __Required.__ The authorization request to send to the authorization server. */ | ||
authRequest?: AuthorizeRequest; | ||
prompt?: Prompt; | ||
} | ||
/** | ||
* AuthorizeRequest is sent by the client to the authorization server to initiate | ||
* the authorization process. | ||
*/ | ||
interface AuthorizeRequest { | ||
/** ID of the Wix OAuth app requesting authorization. */ | ||
clientId?: string; | ||
/** | ||
* Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types). | ||
* | ||
* Supported values: | ||
* + `code`: The endpoint returns an authorization code that can be used to obtain an access token. | ||
*/ | ||
responseType?: string; | ||
/** 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. */ | ||
redirectUri?: string | null; | ||
/** | ||
* Desired scope of access. If this field is left empty, only an access token is granted. | ||
* To received a refresh token, pass `offline_access` as the value of this field. | ||
*/ | ||
scope?: string | null; | ||
/** | ||
* A value used to confirm the state of an application before and after it makes an authorization | ||
* request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser | ||
* is redirected there. | ||
* Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters). | ||
*/ | ||
state?: string; | ||
/** | ||
* esired response format. | ||
* | ||
* Supported values: | ||
* + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting. | ||
* + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting. | ||
* + `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). | ||
* | ||
* Default value: `query` | ||
*/ | ||
responseMode?: string | null; | ||
/** | ||
* Code challenge to use for PKCE verification. | ||
* This field is only used if `responseType` is set to `code`. | ||
*/ | ||
codeChallenge?: string | null; | ||
/** | ||
* Code challenge method to use for PKCE verification. | ||
* This field is only used if `responseType` is set to `code`. | ||
* | ||
* Supported values: | ||
* + `S256`: The code challenge is transformed using SHA-256 encyption. | ||
* + `S512`: The code challenge is transformed using SHA-512 encyption. | ||
*/ | ||
codeChallengeMethod?: string | null; | ||
/** Session token of the site visitor to authorize. */ | ||
sessionToken?: string | null; | ||
} | ||
/** Currently only `none` and `login` are supported. */ | ||
declare enum Prompt { | ||
login = "login", | ||
none = "none", | ||
consent = "consent", | ||
select_account = "select_account" | ||
} | ||
interface RedirectSessionMembersAccountParams { | ||
/** | ||
* The member account page to redirect to. | ||
* | ||
* Default: `ACCOUNT_INFO` | ||
*/ | ||
section?: MembersAccountSection; | ||
} | ||
declare enum MembersAccountSection { | ||
/** default - account info section in "my account" */ | ||
ACCOUNT_INFO = "ACCOUNT_INFO", | ||
/** My Bookings section in "my account" */ | ||
BOOKINGS = "BOOKINGS", | ||
/** My Orders section in "my account" */ | ||
ORDERS = "ORDERS", | ||
/** Subscriptions section in "my account" */ | ||
SUBSCRIPTIONS = "SUBSCRIPTIONS", | ||
/** Events section in "my account" */ | ||
EVENTS = "EVENTS" | ||
} | ||
interface RedirectSessionStoresProductParams { | ||
/** *Required.** Slug of the product to navigate to. */ | ||
productSlug?: string; | ||
} | ||
interface RedirectSessionBookingsBookParams { | ||
/** For use when filtering the bookings page by a specific resource. */ | ||
resourceId?: string; | ||
} | ||
interface CallbackParams { | ||
/** | ||
* 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. | ||
* When redirecting to this URL, Wix passes different query parameters depending on the preceding transaction: | ||
* | ||
* After a pricing plans checkout: | ||
* + `planOrderId`: ID of a pricing plan order. | ||
* | ||
* After an eCommerce checkout: | ||
* + `orderId`: ID of an eCommerce order. | ||
* | ||
* After an Events checkout | ||
* + `orderNumber`: Unique order number for the transaction. | ||
* + `eventId`: ID of the event. | ||
* | ||
* If the process is abandoned or interrupted, the visitor is redirected to the URL specified in `postFlowUrl` instead. | ||
* | ||
* Default: If you don't pass a URL, the visitor is redirected to a Wix thank you page, and from there to the URL specified in `postFlowUrl`. | ||
*/ | ||
thankYouPageUrl?: string | null; | ||
/** | ||
* The URL Wix should redirect the visitor to when the Wix-managed process is completed, abandoned, or interrupted. | ||
* | ||
* **Note**: For an authentication redirect, don't pass a URL here. Instead, pass one in `options.auth.authRequest.redirectUri`. | ||
*/ | ||
postFlowUrl?: string | null; | ||
/** | ||
* The URL for a custom login page implemented outside of Wix. | ||
* | ||
* Default: If you don't pass a URL, a Wix login page is used. | ||
*/ | ||
loginUrl?: string | null; | ||
/** | ||
* The URL for a custom bookings services page implemented outside of Wix. | ||
* | ||
* Default: If you don't pass a URL, a Wix bookings services page is used. | ||
*/ | ||
bookingsServiceListUrl?: string | null; | ||
/** | ||
* The URL for a custom eCommerce cart page implemented outside of Wix. | ||
* | ||
* Default: If you don't pass a URL, a Wix cart page is used. | ||
*/ | ||
cartPageUrl?: string | null; | ||
/** | ||
* The URL for a custom pricing plans page implemented outside of Wix. When redirecting to this URL, Wix passes the following query parameters: | ||
* + `planIds`: IDs of the pricing plans on the custom page. | ||
* + `checkoutData`: Pass this string back in `options.paidPlansCheckout.checkoutData` when redirecting back to Wix for checkout. | ||
* | ||
* Default: If you don't pass a URL, a Wix pricing plans page is used. | ||
*/ | ||
planListUrl?: string | null; | ||
} | ||
interface RedirectSessionPreferences { | ||
/** | ||
* 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. | ||
* | ||
* Default: `true` | ||
*/ | ||
useGenericWixPages?: boolean | null; | ||
/** | ||
* 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. | ||
* | ||
* Default: `true` | ||
*/ | ||
maintainIdentity?: boolean | null; | ||
/** | ||
* A map of additional query parameters to pass to the created Wix URL. | ||
* Global query parameters to be passed to Wix, for example campaign parameters (UTM params). | ||
*/ | ||
additionalQueryParameters?: Record<string, string>; | ||
} | ||
interface CustomMemberPaths { | ||
/** 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. */ | ||
accountPagePath?: string | null; | ||
/** 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. */ | ||
profilePagePath?: string | null; | ||
} | ||
interface CreateRedirectSessionResponse { | ||
/** Details for redirecting the visitor to a Wix page. */ | ||
redirectSession?: RedirectSession; | ||
} | ||
interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf { | ||
/** Information required for generating a custom URL for a Wix Bookings checkout. */ | ||
bookingsCheckout?: RedirectSessionBookingsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix eCommerce checkout. */ | ||
ecomCheckout?: RedirectSessionEcomCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Events checkout. */ | ||
eventsCheckout?: RedirectSessionEventsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */ | ||
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix stores product page. */ | ||
storesProduct?: RedirectSessionStoresProductParams; | ||
/** Information required for generating a custom URL for Wix bookings book page. */ | ||
bookingsBook?: RedirectSessionBookingsBookParams; | ||
/** Optional preferences for customizing redirection to Wix pages. */ | ||
preferences?: RedirectSessionPreferences; | ||
} | ||
/** @oneof */ | ||
interface CreateAnonymousRedirectSessionRequestIntentOneOf { | ||
/** Information required for generating a custom URL for a Wix Bookings checkout. */ | ||
bookingsCheckout?: RedirectSessionBookingsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix eCommerce checkout. */ | ||
ecomCheckout?: RedirectSessionEcomCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Events checkout. */ | ||
eventsCheckout?: RedirectSessionEventsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */ | ||
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix stores product page. */ | ||
storesProduct?: RedirectSessionStoresProductParams; | ||
/** Information required for generating a custom URL for Wix bookings book page. */ | ||
bookingsBook?: RedirectSessionBookingsBookParams; | ||
} | ||
interface CreateAnonymousRedirectSessionResponse { | ||
/** Details for redirecting the visitor to a Wix page. */ | ||
redirectSession?: RedirectSession; | ||
} | ||
interface ValidateCallbackURLRequest { | ||
/** An external URL to validate */ | ||
callbackUrl?: string; | ||
/** The type of the callback URL */ | ||
callbackType?: CallbackType; | ||
/** 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 */ | ||
clientId?: string; | ||
} | ||
declare enum CallbackType { | ||
/** Invalid value - default */ | ||
UNKNOWN = "UNKNOWN", | ||
/** The callback URL is used for the logout flow */ | ||
LOGOUT = "LOGOUT", | ||
/** The callback URL is used for a checkout flow */ | ||
CHECKOUT = "CHECKOUT", | ||
/** The callback URL is used for the authorize flow */ | ||
AUTHORIZE = "AUTHORIZE" | ||
} | ||
interface ValidateCallbackURLResponse { | ||
/** is the provided url allowed for the given client id */ | ||
isValid?: boolean; | ||
} | ||
interface SignInURLRequest { | ||
/** 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 */ | ||
clientId?: string; | ||
} | ||
interface SignInURLResponse { | ||
/** The Wix URL details to redirect into */ | ||
redirectSession?: RedirectSession; | ||
} | ||
interface DomainEvent extends DomainEventBodyOneOf { | ||
createdEvent?: EntityCreatedEvent; | ||
updatedEvent?: EntityUpdatedEvent; | ||
deletedEvent?: EntityDeletedEvent; | ||
actionEvent?: ActionEvent; | ||
/** | ||
* Unique event ID. | ||
* Allows clients to ignore duplicate webhooks. | ||
*/ | ||
_id?: string; | ||
/** | ||
* Assumes actions are also always typed to an entity_type | ||
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction | ||
*/ | ||
entityFqdn?: string; | ||
/** | ||
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) | ||
* This is although the created/updated/deleted notion is duplication of the oneof types | ||
* Example: created/updated/deleted/started/completed/email_opened | ||
*/ | ||
slug?: string; | ||
/** ID of the entity associated with the event. */ | ||
entityId?: string; | ||
/** Event timestamp. */ | ||
eventTime?: Date; | ||
/** | ||
* Whether the event was triggered as a result of a privacy regulation application | ||
* (for example, GDPR). | ||
*/ | ||
triggeredByAnonymizeRequest?: boolean | null; | ||
/** If present, indicates the action that triggered the event. */ | ||
originatedFrom?: string | null; | ||
/** | ||
* A sequence number defining the order of updates to the underlying entity. | ||
* For example, given that some entity was updated at 16:00 and than again at 16:01, | ||
* it is guaranteed that the sequence number of the second update is strictly higher than the first. | ||
* As the consumer, you can use this value to ensure that you handle messages in the correct order. | ||
* To do so, you will need to persist this number on your end, and compare the sequence number from the | ||
* message against the one you have stored. Given that the stored number is higher, you should ignore the message. | ||
*/ | ||
entityEventSequence?: string | null; | ||
} | ||
/** @oneof */ | ||
interface DomainEventBodyOneOf { | ||
createdEvent?: EntityCreatedEvent; | ||
updatedEvent?: EntityUpdatedEvent; | ||
deletedEvent?: EntityDeletedEvent; | ||
actionEvent?: ActionEvent; | ||
} | ||
interface EntityCreatedEvent { | ||
entity?: string; | ||
} | ||
interface RestoreInfo { | ||
deletedDate?: Date; | ||
} | ||
interface EntityUpdatedEvent { | ||
/** | ||
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. | ||
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. | ||
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. | ||
*/ | ||
currentEntity?: string; | ||
} | ||
interface EntityDeletedEvent { | ||
/** Entity that was deleted */ | ||
deletedEntity?: string | null; | ||
} | ||
interface ActionEvent { | ||
body?: string; | ||
} | ||
interface MessageEnvelope { | ||
/** App instance ID. */ | ||
instanceId?: string | null; | ||
/** Event type. */ | ||
eventType?: string; | ||
/** The identification type and identity data. */ | ||
identity?: IdentificationData; | ||
/** Stringify payload. */ | ||
data?: string; | ||
} | ||
interface IdentificationData extends IdentificationDataIdOneOf { | ||
/** ID of a site visitor that has not logged in to the site. */ | ||
anonymousVisitorId?: string; | ||
/** ID of a site visitor that has logged in to the site. */ | ||
memberId?: string; | ||
/** ID of a Wix user (site owner, contributor, etc.). */ | ||
wixUserId?: string; | ||
/** ID of an app. */ | ||
appId?: string; | ||
/** @readonly */ | ||
identityType?: WebhookIdentityType; | ||
} | ||
/** @oneof */ | ||
interface IdentificationDataIdOneOf { | ||
/** ID of a site visitor that has not logged in to the site. */ | ||
anonymousVisitorId?: string; | ||
/** ID of a site visitor that has logged in to the site. */ | ||
memberId?: string; | ||
/** ID of a Wix user (site owner, contributor, etc.). */ | ||
wixUserId?: string; | ||
/** ID of an app. */ | ||
appId?: string; | ||
} | ||
declare enum WebhookIdentityType { | ||
UNKNOWN = "UNKNOWN", | ||
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", | ||
MEMBER = "MEMBER", | ||
WIX_USER = "WIX_USER", | ||
APP = "APP" | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
interface BaseEventMetadata { | ||
/** App instance ID. */ | ||
instanceId?: string | null; | ||
/** Event type. */ | ||
eventType?: string; | ||
/** The identification type and identity data. */ | ||
identity?: IdentificationData; | ||
} | ||
interface EventMetadata extends BaseEventMetadata { | ||
/** | ||
* Unique event ID. | ||
* Allows clients to ignore duplicate webhooks. | ||
*/ | ||
_id?: string; | ||
/** | ||
* Assumes actions are also always typed to an entity_type | ||
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction | ||
*/ | ||
entityFqdn?: string; | ||
/** | ||
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) | ||
* This is although the created/updated/deleted notion is duplication of the oneof types | ||
* Example: created/updated/deleted/started/completed/email_opened | ||
*/ | ||
slug?: string; | ||
/** ID of the entity associated with the event. */ | ||
entityId?: string; | ||
/** Event timestamp. */ | ||
eventTime?: Date; | ||
/** | ||
* Whether the event was triggered as a result of a privacy regulation application | ||
* (for example, GDPR). | ||
*/ | ||
triggeredByAnonymizeRequest?: boolean | null; | ||
/** If present, indicates the action that triggered the event. */ | ||
originatedFrom?: string | null; | ||
/** | ||
* A sequence number defining the order of updates to the underlying entity. | ||
* For example, given that some entity was updated at 16:00 and than again at 16:01, | ||
* it is guaranteed that the sequence number of the second update is strictly higher than the first. | ||
* As the consumer, you can use this value to ensure that you handle messages in the correct order. | ||
* To do so, you will need to persist this number on your end, and compare the sequence number from the | ||
* message against the one you have stored. Given that the stored number is higher, you should ignore the message. | ||
*/ | ||
entityEventSequence?: string | null; | ||
} | ||
interface RedirectSessionCreatedEnvelope { | ||
entity: RedirectSession; | ||
metadata: EventMetadata; | ||
} | ||
interface CreateRedirectSessionOptions extends CreateRedirectSessionRequestIntentOneOf { | ||
/** Information required for generating a custom URL for a Wix Bookings checkout. */ | ||
bookingsCheckout?: RedirectSessionBookingsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix eCommerce checkout. */ | ||
ecomCheckout?: RedirectSessionEcomCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Events checkout. */ | ||
eventsCheckout?: RedirectSessionEventsCheckoutParams; | ||
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */ | ||
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams; | ||
/** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */ | ||
login?: RedirectSessionLoginParams; | ||
/** 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. */ | ||
logout?: RedirectSessionLogoutParams; | ||
/** Information required for generating a custom URL for Wix authentication. */ | ||
auth?: RedirectSessionAuthParams; | ||
/** Information required for generating a custom URL for a Wix stores product page. */ | ||
storesProduct?: RedirectSessionStoresProductParams; | ||
/** Information required for generating a custom URL for Wix bookings book page. */ | ||
bookingsBook?: RedirectSessionBookingsBookParams; | ||
/** | ||
* Details of pages to redirect the visitor back to on the Wix Headless client site. | ||
* | ||
* **Note**: For an authentication redirect, don't pass a post-flow URL here. Instead, pass one in `options.auth.authRequest.redirectUri`. | ||
*/ | ||
callbacks?: CallbackParams; | ||
/** Optional preferences for customizing redirection to Wix pages. */ | ||
preferences?: RedirectSessionPreferences; | ||
} | ||
declare function createRedirectSession$1(httpClient: HttpClient): CreateRedirectSessionSignature; | ||
interface CreateRedirectSessionSignature { | ||
/** | ||
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality. | ||
* | ||
* | ||
* The `createRedirectSession()` function enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes. | ||
* For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for a bookings, eCommerce, events, or paid plans transaction. | ||
* | ||
* To initiate a redirect session: | ||
* | ||
* 1. Call `createRedirectSession()` 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 user back to your site as appropriate when the process is over. | ||
* 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. | ||
* 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow. | ||
* @param - Options for creating a redirect session. | ||
*/ | ||
(options?: CreateRedirectSessionOptions | undefined): Promise<CreateRedirectSessionResponse & CreateRedirectSessionResponseNonNullableFields>; | ||
} | ||
declare const onRedirectSessionCreated$1: EventDefinition<RedirectSessionCreatedEnvelope, "wix.headless.v1.redirect_session_created">; | ||
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T; | ||
declare const createRedirectSession: ReturnType<typeof createRESTModule<typeof publicCreateRedirectSession>>; | ||
declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<typeof publicOnRedirectSessionCreated>>; | ||
declare const createRedirectSession: BuildRESTFunction<typeof createRedirectSession$1> & typeof createRedirectSession$1; | ||
export { createRedirectSession, onRedirectSessionCreated }; | ||
type _publicOnRedirectSessionCreatedType = typeof onRedirectSessionCreated$1; | ||
/** */ | ||
declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<_publicOnRedirectSessionCreatedType>>; | ||
export { type ActionEvent, type AuthorizeRequest, type BaseEventMetadata, type BookingPolicyViolations, type CallbackParams, CallbackType, type CreateAnonymousRedirectSessionRequest, type CreateAnonymousRedirectSessionRequestIntentOneOf, type CreateAnonymousRedirectSessionResponse, type CreateRedirectSessionOptions, type CreateRedirectSessionRequest, type CreateRedirectSessionRequestIntentOneOf, type CreateRedirectSessionResponse, type CreateRedirectSessionResponseNonNullableFields, type CustomMemberPaths, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, type Location, LocationType, MembersAccountSection, type MessageEnvelope, type NestedTimeSlot, Prompt, 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, type URLDetails, type ValidateCallbackURLRequest, type ValidateCallbackURLResponse, type WaitingList, WebhookIdentityType, type _publicOnRedirectSessionCreatedType, createRedirectSession, onRedirectSessionCreated, onRedirectSessionCreated$1 as publicOnRedirectSessionCreated }; |
@@ -0,1 +1,45 @@ | ||
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T; | ||
interface HttpClient { | ||
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>; | ||
fetchWithAuth: typeof fetch; | ||
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>; | ||
} | ||
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>; | ||
type HttpResponse<T = any> = { | ||
data: T; | ||
status: number; | ||
statusText: string; | ||
headers: any; | ||
request?: any; | ||
}; | ||
type RequestOptions<_TResponse = any, Data = any> = { | ||
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'; | ||
url: string; | ||
data?: Data; | ||
params?: URLSearchParams; | ||
} & APIMetadata; | ||
type APIMetadata = { | ||
methodFqn?: string; | ||
entityFqdn?: string; | ||
packageName?: string; | ||
}; | ||
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never; | ||
type EventDefinition<Payload = unknown, Type extends string = string> = { | ||
__type: 'event-definition'; | ||
type: Type; | ||
isDomainEvent?: boolean; | ||
transformations?: (envelope: unknown) => Payload; | ||
__payload: Payload; | ||
}; | ||
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>; | ||
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void; | ||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. | ||
interface SymbolConstructor { | ||
readonly observable: symbol; | ||
} | ||
} | ||
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
@@ -604,11 +648,13 @@ interface RedirectSession { | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
@@ -694,48 +740,30 @@ interface BaseEventMetadata { | ||
interface HttpClient { | ||
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>; | ||
fetchWithAuth: typeof fetch; | ||
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>; | ||
declare function createRedirectSession$1(httpClient: HttpClient): CreateRedirectSessionSignature; | ||
interface CreateRedirectSessionSignature { | ||
/** | ||
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality. | ||
* | ||
* | ||
* The `createRedirectSession()` function enables your external Wix Headless client site, built on any platform, to integrate Wix-managed frontend functionality for specific processes. | ||
* For example, your site can temporarily redirect a visitor to Wix for authentication, or for a checkout process for a bookings, eCommerce, events, or paid plans transaction. | ||
* | ||
* To initiate a redirect session: | ||
* | ||
* 1. Call `createRedirectSession()` 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 user back to your site as appropriate when the process is over. | ||
* 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. | ||
* 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow. | ||
* @param - Options for creating a redirect session. | ||
*/ | ||
(options?: CreateRedirectSessionOptions | undefined): Promise<CreateRedirectSessionResponse & CreateRedirectSessionResponseNonNullableFields>; | ||
} | ||
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>; | ||
type HttpResponse<T = any> = { | ||
data: T; | ||
status: number; | ||
statusText: string; | ||
headers: any; | ||
request?: any; | ||
}; | ||
type RequestOptions<_TResponse = any, Data = any> = { | ||
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'; | ||
url: string; | ||
data?: Data; | ||
params?: URLSearchParams; | ||
} & APIMetadata; | ||
type APIMetadata = { | ||
methodFqn?: string; | ||
entityFqdn?: string; | ||
packageName?: string; | ||
}; | ||
type EventDefinition<Payload = unknown, Type extends string = string> = { | ||
__type: 'event-definition'; | ||
type: Type; | ||
isDomainEvent?: boolean; | ||
transformations?: (envelope: unknown) => Payload; | ||
__payload: Payload; | ||
}; | ||
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
declare const onRedirectSessionCreated$1: EventDefinition<RedirectSessionCreatedEnvelope, "wix.headless.v1.redirect_session_created">; | ||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. | ||
interface SymbolConstructor { | ||
readonly observable: symbol; | ||
} | ||
} | ||
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T; | ||
declare const __metadata: { | ||
PACKAGE_NAME: string; | ||
}; | ||
declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<CreateRedirectSessionResponse & CreateRedirectSessionResponseNonNullableFields>; | ||
declare const onRedirectSessionCreated: EventDefinition<RedirectSessionCreatedEnvelope, "wix.headless.v1.redirect_session_created">; | ||
declare const createRedirectSession: BuildRESTFunction<typeof createRedirectSession$1> & typeof createRedirectSession$1; | ||
export { type ActionEvent, type AuthorizeRequest, type BaseEventMetadata, type BookingPolicyViolations, type CallbackParams, CallbackType, type CreateAnonymousRedirectSessionRequest, type CreateAnonymousRedirectSessionRequestIntentOneOf, type CreateAnonymousRedirectSessionResponse, type CreateRedirectSessionOptions, type CreateRedirectSessionRequest, type CreateRedirectSessionRequestIntentOneOf, type CreateRedirectSessionResponse, type CreateRedirectSessionResponseNonNullableFields, type CustomMemberPaths, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, type Location, LocationType, MembersAccountSection, type MessageEnvelope, type NestedTimeSlot, Prompt, 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, type URLDetails, type ValidateCallbackURLRequest, type ValidateCallbackURLResponse, type WaitingList, WebhookIdentityType, __metadata, createRedirectSession, onRedirectSessionCreated }; | ||
type _publicOnRedirectSessionCreatedType = typeof onRedirectSessionCreated$1; | ||
/** */ | ||
declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<_publicOnRedirectSessionCreatedType>>; | ||
export { type ActionEvent, type AuthorizeRequest, type BaseEventMetadata, type BookingPolicyViolations, type CallbackParams, CallbackType, type CreateAnonymousRedirectSessionRequest, type CreateAnonymousRedirectSessionRequestIntentOneOf, type CreateAnonymousRedirectSessionResponse, type CreateRedirectSessionOptions, type CreateRedirectSessionRequest, type CreateRedirectSessionRequestIntentOneOf, type CreateRedirectSessionResponse, type CreateRedirectSessionResponseNonNullableFields, type CustomMemberPaths, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, type Location, LocationType, MembersAccountSection, type MessageEnvelope, type NestedTimeSlot, Prompt, 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, type URLDetails, type ValidateCallbackURLRequest, type ValidateCallbackURLResponse, type WaitingList, WebhookIdentityType, type _publicOnRedirectSessionCreatedType, createRedirectSession, onRedirectSessionCreated, onRedirectSessionCreated$1 as publicOnRedirectSessionCreated }; |
@@ -604,11 +604,13 @@ /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
@@ -669,2 +671,3 @@ interface BaseEventMetadata { | ||
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES | ||
* @permissionId WIX_HEADLESS.WIX_URL_CREATE | ||
* @webhook | ||
@@ -671,0 +674,0 @@ * @eventType wix.headless.v1.redirect_session_created |
@@ -398,11 +398,13 @@ /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */ | ||
} | ||
interface URLDetailsNonNullableFields$1 { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields$1 { | ||
id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields$1; | ||
shortUrl: string; | ||
} | ||
interface CreateRedirectSessionResponseNonNullableFields$1 { | ||
redirectSession?: { | ||
id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields$1; | ||
} | ||
@@ -804,11 +806,13 @@ | ||
} | ||
interface URLDetailsNonNullableFields { | ||
endpoint: string; | ||
} | ||
interface RedirectSessionNonNullableFields { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: URLDetailsNonNullableFields; | ||
shortUrl: string; | ||
} | ||
interface CreateRedirectSessionResponseNonNullableFields { | ||
redirectSession?: { | ||
_id: string; | ||
fullUrl: string; | ||
urlDetails?: { | ||
endpoint: string; | ||
}; | ||
shortUrl: string; | ||
}; | ||
redirectSession?: RedirectSessionNonNullableFields; | ||
} | ||
@@ -815,0 +819,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
336888
6629
Updated@wix/sdk-runtime@^0.3.14