@wix/redirects 1.0.70 → 1.0.71

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.
@@ -1,1314 +0,0 @@
1
- type HostModule<T, H extends Host> = {
2
- __type: 'host';
3
- create(host: H): T;
4
- };
5
- type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
- type Host<Environment = unknown> = {
7
- channel: {
8
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
- disconnect: () => void;
10
- } | Promise<{
11
- disconnect: () => void;
12
- }>;
13
- };
14
- environment?: Environment;
15
- /**
16
- * Optional name of the environment, use for logging
17
- */
18
- name?: string;
19
- /**
20
- * Optional bast url to use for API requests, for example `www.wixapis.com`
21
- */
22
- apiBaseUrl?: string;
23
- /**
24
- * Possible data to be provided by every host, for cross cutting concerns
25
- * like internationalization, billing, etc.
26
- */
27
- essentials?: {
28
- /**
29
- * The language of the currently viewed session
30
- */
31
- language?: string;
32
- /**
33
- * The locale of the currently viewed session
34
- */
35
- locale?: string;
36
- /**
37
- * Any headers that should be passed through to the API requests
38
- */
39
- passThroughHeaders?: Record<string, string>;
40
- };
41
- };
42
-
43
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
- interface HttpClient {
45
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
46
- fetchWithAuth: typeof fetch;
47
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
48
- getActiveToken?: () => string | undefined;
49
- }
50
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
- type HttpResponse<T = any> = {
52
- data: T;
53
- status: number;
54
- statusText: string;
55
- headers: any;
56
- request?: any;
57
- };
58
- type RequestOptions<_TResponse = any, Data = any> = {
59
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
60
- url: string;
61
- data?: Data;
62
- params?: URLSearchParams;
63
- } & APIMetadata;
64
- type APIMetadata = {
65
- methodFqn?: string;
66
- entityFqdn?: string;
67
- packageName?: string;
68
- };
69
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
- type EventDefinition<Payload = unknown, Type extends string = string> = {
71
- __type: 'event-definition';
72
- type: Type;
73
- isDomainEvent?: boolean;
74
- transformations?: (envelope: unknown) => Payload;
75
- __payload: Payload;
76
- };
77
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
80
-
81
- type ServicePluginMethodInput = {
82
- request: any;
83
- metadata: any;
84
- };
85
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
- type ServicePluginMethodMetadata = {
87
- name: string;
88
- primaryHttpMappingPath: string;
89
- transformations: {
90
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
91
- toREST: (...args: unknown[]) => unknown;
92
- };
93
- };
94
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
95
- __type: 'service-plugin-definition';
96
- componentType: string;
97
- methods: ServicePluginMethodMetadata[];
98
- __contract: Contract;
99
- };
100
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
103
-
104
- type RequestContext = {
105
- isSSR: boolean;
106
- host: string;
107
- protocol?: string;
108
- };
109
- type ResponseTransformer = (data: any, headers?: any) => any;
110
- /**
111
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
112
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
113
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
114
- */
115
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
- type AmbassadorRequestOptions<T = any> = {
117
- _?: T;
118
- url?: string;
119
- method?: Method;
120
- params?: any;
121
- data?: any;
122
- transformResponse?: ResponseTransformer | ResponseTransformer[];
123
- };
124
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
125
- __isAmbassador: boolean;
126
- };
127
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
129
-
130
- declare global {
131
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
132
- interface SymbolConstructor {
133
- readonly observable: symbol;
134
- }
135
- }
136
-
137
- declare const emptyObjectSymbol: unique symbol;
138
-
139
- /**
140
- Represents a strictly empty plain object, the `{}` value.
141
-
142
- When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
143
-
144
- @example
145
- ```
146
- import type {EmptyObject} from 'type-fest';
147
-
148
- // The following illustrates the problem with `{}`.
149
- const foo1: {} = {}; // Pass
150
- const foo2: {} = []; // Pass
151
- const foo3: {} = 42; // Pass
152
- const foo4: {} = {a: 1}; // Pass
153
-
154
- // With `EmptyObject` only the first case is valid.
155
- const bar1: EmptyObject = {}; // Pass
156
- const bar2: EmptyObject = 42; // Fail
157
- const bar3: EmptyObject = []; // Fail
158
- const bar4: EmptyObject = {a: 1}; // Fail
159
- ```
160
-
161
- Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
162
-
163
- @category Object
164
- */
165
- type EmptyObject = {[emptyObjectSymbol]?: never};
166
-
167
- /**
168
- Returns a boolean for whether the two given types are equal.
169
-
170
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
171
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
172
-
173
- Use-cases:
174
- - If you want to make a conditional branch based on the result of a comparison of two types.
175
-
176
- @example
177
- ```
178
- import type {IsEqual} from 'type-fest';
179
-
180
- // This type returns a boolean for whether the given array includes the given item.
181
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
182
- type Includes<Value extends readonly any[], Item> =
183
- Value extends readonly [Value[0], ...infer rest]
184
- ? IsEqual<Value[0], Item> extends true
185
- ? true
186
- : Includes<rest, Item>
187
- : false;
188
- ```
189
-
190
- @category Type Guard
191
- @category Utilities
192
- */
193
- type IsEqual<A, B> =
194
- (<G>() => G extends A ? 1 : 2) extends
195
- (<G>() => G extends B ? 1 : 2)
196
- ? true
197
- : false;
198
-
199
- /**
200
- Filter out keys from an object.
201
-
202
- Returns `never` if `Exclude` is strictly equal to `Key`.
203
- Returns `never` if `Key` extends `Exclude`.
204
- Returns `Key` otherwise.
205
-
206
- @example
207
- ```
208
- type Filtered = Filter<'foo', 'foo'>;
209
- //=> never
210
- ```
211
-
212
- @example
213
- ```
214
- type Filtered = Filter<'bar', string>;
215
- //=> never
216
- ```
217
-
218
- @example
219
- ```
220
- type Filtered = Filter<'bar', 'foo'>;
221
- //=> 'bar'
222
- ```
223
-
224
- @see {Except}
225
- */
226
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
227
-
228
- type ExceptOptions = {
229
- /**
230
- Disallow assigning non-specified properties.
231
-
232
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
233
-
234
- @default false
235
- */
236
- requireExactProps?: boolean;
237
- };
238
-
239
- /**
240
- Create a type from an object type without certain keys.
241
-
242
- We recommend setting the `requireExactProps` option to `true`.
243
-
244
- This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
245
-
246
- This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
247
-
248
- @example
249
- ```
250
- import type {Except} from 'type-fest';
251
-
252
- type Foo = {
253
- a: number;
254
- b: string;
255
- };
256
-
257
- type FooWithoutA = Except<Foo, 'a'>;
258
- //=> {b: string}
259
-
260
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
261
- //=> errors: 'a' does not exist in type '{ b: string; }'
262
-
263
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
264
- //=> {a: number} & Partial<Record<"b", never>>
265
-
266
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
267
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
268
- ```
269
-
270
- @category Object
271
- */
272
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
274
- } & (Options['requireExactProps'] extends true
275
- ? Partial<Record<KeysType, never>>
276
- : {});
277
-
278
- /**
279
- Returns a boolean for whether the given type is `never`.
280
-
281
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
- @link https://stackoverflow.com/a/53984913/10292952
283
- @link https://www.zhenghao.io/posts/ts-never
284
-
285
- Useful in type utilities, such as checking if something does not occur.
286
-
287
- @example
288
- ```
289
- import type {IsNever, And} from 'type-fest';
290
-
291
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
- type AreStringsEqual<A extends string, B extends string> =
293
- And<
294
- IsNever<Exclude<A, B>> extends true ? true : false,
295
- IsNever<Exclude<B, A>> extends true ? true : false
296
- >;
297
-
298
- type EndIfEqual<I extends string, O extends string> =
299
- AreStringsEqual<I, O> extends true
300
- ? never
301
- : void;
302
-
303
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
- if (input === output) {
305
- process.exit(0);
306
- }
307
- }
308
-
309
- endIfEqual('abc', 'abc');
310
- //=> never
311
-
312
- endIfEqual('abc', '123');
313
- //=> void
314
- ```
315
-
316
- @category Type Guard
317
- @category Utilities
318
- */
319
- type IsNever<T> = [T] extends [never] ? true : false;
320
-
321
- /**
322
- An if-else-like type that resolves depending on whether the given type is `never`.
323
-
324
- @see {@link IsNever}
325
-
326
- @example
327
- ```
328
- import type {IfNever} from 'type-fest';
329
-
330
- type ShouldBeTrue = IfNever<never>;
331
- //=> true
332
-
333
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
- //=> 'bar'
335
- ```
336
-
337
- @category Type Guard
338
- @category Utilities
339
- */
340
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
- IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
- );
343
-
344
- /**
345
- Extract the keys from a type where the value type of the key extends the given `Condition`.
346
-
347
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
348
-
349
- @example
350
- ```
351
- import type {ConditionalKeys} from 'type-fest';
352
-
353
- interface Example {
354
- a: string;
355
- b: string | number;
356
- c?: string;
357
- d: {};
358
- }
359
-
360
- type StringKeysOnly = ConditionalKeys<Example, string>;
361
- //=> 'a'
362
- ```
363
-
364
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
365
-
366
- @example
367
- ```
368
- import type {ConditionalKeys} from 'type-fest';
369
-
370
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
371
- //=> 'a' | 'c'
372
- ```
373
-
374
- @category Object
375
- */
376
- type ConditionalKeys<Base, Condition> =
377
- {
378
- // Map through all the keys of the given base type.
379
- [Key in keyof Base]-?:
380
- // Pick only keys with types extending the given `Condition` type.
381
- Base[Key] extends Condition
382
- // Retain this key
383
- // If the value for the key extends never, only include it if `Condition` also extends never
384
- ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
385
- // Discard this key since the condition fails.
386
- : never;
387
- // Convert the produced object into a union type of the keys which passed the conditional test.
388
- }[keyof Base];
389
-
390
- /**
391
- Exclude keys from a shape that matches the given `Condition`.
392
-
393
- This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
394
-
395
- @example
396
- ```
397
- import type {Primitive, ConditionalExcept} from 'type-fest';
398
-
399
- class Awesome {
400
- name: string;
401
- successes: number;
402
- failures: bigint;
403
-
404
- run() {}
405
- }
406
-
407
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
408
- //=> {run: () => void}
409
- ```
410
-
411
- @example
412
- ```
413
- import type {ConditionalExcept} from 'type-fest';
414
-
415
- interface Example {
416
- a: string;
417
- b: string | number;
418
- c: () => void;
419
- d: {};
420
- }
421
-
422
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
423
- //=> {b: string | number; c: () => void; d: {}}
424
- ```
425
-
426
- @category Object
427
- */
428
- type ConditionalExcept<Base, Condition> = Except<
429
- Base,
430
- ConditionalKeys<Base, Condition>
431
- >;
432
-
433
- /**
434
- * Descriptors are objects that describe the API of a module, and the module
435
- * can either be a REST module or a host module.
436
- * This type is recursive, so it can describe nested modules.
437
- */
438
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
- [key: string]: Descriptors | PublicMetadata | any;
440
- };
441
- /**
442
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
443
- * and returns an object with the same structure, but with all descriptors replaced with their API.
444
- * Any non-descriptor properties are removed from the returned object, including descriptors that
445
- * do not match the given host (as they will not work with the given host).
446
- */
447
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
448
- done: T;
449
- recurse: T extends {
450
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
451
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
452
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
453
- -1,
454
- 0,
455
- 1,
456
- 2,
457
- 3,
458
- 4,
459
- 5
460
- ][Depth]> : never;
461
- }, EmptyObject>;
462
- }[Depth extends -1 ? 'done' : 'recurse'];
463
- type PublicMetadata = {
464
- PACKAGE_NAME?: string;
465
- };
466
-
467
- declare global {
468
- interface ContextualClient {
469
- }
470
- }
471
- /**
472
- * A type used to create concerete types from SDK descriptors in
473
- * case a contextual client is available.
474
- */
475
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
- host: Host;
477
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
478
-
479
- /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
480
- interface RedirectSession {
481
- /** ID of the redirect session created. */
482
- _id?: string;
483
- /**
484
- * 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.
485
- * @readonly
486
- */
487
- fullUrl?: string;
488
- /** Details about the URL of the redirect session. */
489
- urlDetails?: URLDetails;
490
- /**
491
- * The session token to pass to the Wix page to maintain the visitor's identity.
492
- * @readonly
493
- */
494
- sessionToken?: string | null;
495
- /**
496
- * 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.
497
- * @readonly
498
- */
499
- shortUrl?: string;
500
- }
501
- interface URLDetails {
502
- /**
503
- * Endpoint of the url. This includes the base URL and the path to the endpoint, without query parameters.
504
- * For example: `https://mysite.com/_api/oauth2/authorize`.
505
- * @readonly
506
- */
507
- endpoint?: string;
508
- /** URL query parameters. */
509
- searchParams?: Record<string, string>;
510
- }
511
- interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf {
512
- /** Information required for generating a custom URL for a Wix Bookings checkout. */
513
- bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
514
- /** Information required for generating a custom URL for a Wix eCommerce checkout. */
515
- ecomCheckout?: RedirectSessionEcomCheckoutParams;
516
- /** Information required for generating a custom URL for a Wix Events checkout. */
517
- eventsCheckout?: RedirectSessionEventsCheckoutParams;
518
- /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
519
- paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
520
- /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
521
- login?: RedirectSessionLoginParams;
522
- /** 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. */
523
- logout?: RedirectSessionLogoutParams;
524
- /** Information required for generating a custom URL for Wix authentication. */
525
- auth?: RedirectSessionAuthParams;
526
- /** Information required for generating a custom URL for a Wix stores product page. */
527
- storesProduct?: RedirectSessionStoresProductParams;
528
- /** Information required for generating a custom URL for Wix bookings book page. */
529
- bookingsBook?: RedirectSessionBookingsBookParams;
530
- /**
531
- * Details of pages to redirect the visitor back to on the Wix Headless client site.
532
- * When redirecting to any callback URL, Wix specifies the boolean `wixMemberLoggedIn` parameter.
533
- * If `true`, a member logged in during the preceding Wix-managed process.
534
- *
535
- * **Note**: For an authentication redirect, don't specify a post-flow URL here. Instead, specify one in `auth.authRequest.redirectUri`.
536
- */
537
- callbacks?: CallbackParams;
538
- /** Optional preferences for customizing redirection to Wix pages. */
539
- preferences?: RedirectSessionPreferences;
540
- }
541
- /** @oneof */
542
- interface CreateRedirectSessionRequestIntentOneOf {
543
- /** Information required for generating a custom URL for a Wix Bookings checkout. */
544
- bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
545
- /** Information required for generating a custom URL for a Wix eCommerce checkout. */
546
- ecomCheckout?: RedirectSessionEcomCheckoutParams;
547
- /** Information required for generating a custom URL for a Wix Events checkout. */
548
- eventsCheckout?: RedirectSessionEventsCheckoutParams;
549
- /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
550
- paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
551
- /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
552
- login?: RedirectSessionLoginParams;
553
- /** 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. */
554
- logout?: RedirectSessionLogoutParams;
555
- /** Information required for generating a custom URL for Wix authentication. */
556
- auth?: RedirectSessionAuthParams;
557
- /** Information required for generating a custom URL for a Wix stores product page. */
558
- storesProduct?: RedirectSessionStoresProductParams;
559
- /** Information required for generating a custom URL for Wix bookings book page. */
560
- bookingsBook?: RedirectSessionBookingsBookParams;
561
- }
562
- interface RedirectSessionBookingsCheckoutParams {
563
- /**
564
- * 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`.
565
- *
566
- * Default: If you don't specify a timezone, the timezone in `slotAvailability.slot.timezone` is used.
567
- */
568
- timezone?: string;
569
- slotAvailability?: SlotAvailability;
570
- }
571
- interface SlotAvailability {
572
- /**
573
- * The slot for the corresponding session, when the session is either a single session
574
- * or a specific session generated from a recurring session.
575
- */
576
- slot?: Slot;
577
- /**
578
- * Whether the slot is bookable. Bookability is determined by checking a
579
- * session's open slots and booking policies. Locks are not taken into
580
- * account.
581
- */
582
- bookable?: boolean;
583
- /**
584
- * Total number of spots for this slot.
585
- * For example, if a session has a total of 10 spots and 3 spots are booked,
586
- * `spotsTotal` is 10 and `openSpots` is 7.
587
- */
588
- totalSpots?: number | null;
589
- /** Number of open spots for this slot. */
590
- openSpots?: number | null;
591
- /** An object describing the slot's waitlist and its occupancy. */
592
- waitingList?: WaitingList;
593
- /** Booking policy violations for the slot. */
594
- bookingPolicyViolations?: BookingPolicyViolations;
595
- /**
596
- * Indicates whether the slot is locked because a waitlist exists.
597
- * When a slot frees up, the slot is offered to the next customer on the waitlist. Read-only.
598
- */
599
- locked?: boolean | null;
600
- isFromV2?: boolean;
601
- }
602
- interface Slot {
603
- /**
604
- * ID for the slot's corresponding session, when the session is either a single session
605
- * or a specific session generated from a recurring session.
606
- */
607
- sessionId?: string | null;
608
- /** Service ID. */
609
- serviceId?: string;
610
- /** Schedule ID. */
611
- scheduleId?: string;
612
- /**
613
- * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
614
- * format.
615
- *
616
- * If `timezone` is specified,
617
- * dates are based on the local date/time. This means that the timezone offset
618
- * in the `start_date` is ignored.
619
- */
620
- startDate?: string | null;
621
- /**
622
- * The end time of this slot in
623
- * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
624
- *
625
- * If `timezone` is specified,
626
- * dates are based on the local date/time. This means that the timezone offset
627
- * in the `end_date` is ignored.
628
- */
629
- endDate?: string | null;
630
- /**
631
- * The timezone for which slot availability is to be calculated.
632
- *
633
- * 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)
634
- * when calculating availability.
635
- */
636
- timezone?: string | null;
637
- /**
638
- * The resource required for this slot. Currently, the only supported resource
639
- * is the relevant staff member for the slot.
640
- */
641
- resource?: SlotResource;
642
- /** Geographic location of the slot. */
643
- location?: Location;
644
- }
645
- interface SlotResource {
646
- /**
647
- * Resource ID.
648
- * @readonly
649
- */
650
- _id?: string | null;
651
- /** Resource name. Read only. */
652
- name?: string | null;
653
- }
654
- interface Location {
655
- /**
656
- * Business location ID. Available only for locations that are business locations,
657
- * meaning the `location_type` is `"OWNER_BUSINESS"`.
658
- */
659
- _id?: string | null;
660
- /** Location name. */
661
- name?: string | null;
662
- /** The full address of this location. */
663
- formattedAddress?: string | null;
664
- /** The full translated address of this location. */
665
- formattedAddressTranslated?: string | null;
666
- /**
667
- * Location type.
668
- *
669
- * - `"OWNER_BUSINESS"`: The business address, as set in the site’s general settings.
670
- * - `"OWNER_CUSTOM"`: The address as set when creating the service.
671
- * - `"CUSTOM"`: The address as set for the individual session.
672
- */
673
- locationType?: LocationType;
674
- }
675
- declare enum LocationType {
676
- UNDEFINED = "UNDEFINED",
677
- OWNER_BUSINESS = "OWNER_BUSINESS",
678
- OWNER_CUSTOM = "OWNER_CUSTOM",
679
- CUSTOM = "CUSTOM"
680
- }
681
- interface WaitingList {
682
- /**
683
- * Total number of spots and open spots for this waitlist.
684
- * For example, a Yoga class with 10 waitlist spots and 3 registered
685
- * on the waitlist has 10 `total_spots` and 7 `open_spots`.
686
- */
687
- totalSpots?: number | null;
688
- /** Number of open spots for this waitlist. */
689
- openSpots?: number | null;
690
- }
691
- interface BookingPolicyViolations {
692
- /** Bookings policy violation. Too early to book this slot. */
693
- tooEarlyToBook?: boolean | null;
694
- /** Bookings policy violation. Too late to book this slot. */
695
- tooLateToBook?: boolean | null;
696
- /** Bookings policy violation. Online booking is disabled for this slot. */
697
- bookOnlineDisabled?: boolean | null;
698
- }
699
- interface NestedTimeSlot {
700
- serviceId?: string;
701
- start?: string;
702
- end?: string;
703
- resource?: SlotResource;
704
- /** Schedule ID. */
705
- scheduleId?: string;
706
- }
707
- interface RedirectSessionEcomCheckoutParams {
708
- /**
709
- * - SDK: Use [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).
710
- * - REST: Use [Create Checkout From Cart](https://dev.wix.com/docs/rest/business-solutions/e-commerce/cart/create-checkout-from-cart).
711
- */
712
- checkoutId?: string;
713
- }
714
- interface RedirectSessionEventsCheckoutParams {
715
- reservationId?: string;
716
- eventSlug?: string;
717
- }
718
- interface RedirectSessionPaidPlansCheckoutParams {
719
- planId?: string;
720
- /**
721
- * 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.
722
- * 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.
723
- */
724
- checkoutData?: string | null;
725
- }
726
- interface RedirectSessionLoginParams {
727
- }
728
- interface RedirectSessionLogoutParams {
729
- clientId?: string;
730
- }
731
- interface RedirectSessionAuthParams {
732
- authRequest?: AuthorizeRequest;
733
- /** prompt type */
734
- prompt?: Prompt;
735
- }
736
- /**
737
- * AuthorizeRequest is sent by the client to the authorization server to initiate
738
- * the authorization process.
739
- */
740
- interface AuthorizeRequest {
741
- /** ID of the Wix OAuth app requesting authorization. */
742
- clientId?: string;
743
- /**
744
- * Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).
745
- *
746
- * Supported values:
747
- * + `code`: The endpoint returns an authorization code that can be used to obtain an access token.
748
- */
749
- responseType?: string;
750
- /** 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. */
751
- redirectUri?: string | null;
752
- /**
753
- * Desired scope of access. If this field is left empty, only an access token is granted.
754
- * To received a refresh token, pass `offline_access` as the value of this field.
755
- */
756
- scope?: string | null;
757
- /**
758
- * A value used to confirm the state of an application before and after it makes an authorization
759
- * request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser
760
- * is redirected there.
761
- * Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).
762
- */
763
- state?: string;
764
- /**
765
- * esired response format.
766
- *
767
- * Supported values:
768
- * + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.
769
- * + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.
770
- * + `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).
771
- *
772
- * Default value: `query`
773
- */
774
- responseMode?: string | null;
775
- /**
776
- * Code challenge to use for PKCE verification.
777
- * This field is only used if `responseType` is set to `code`.
778
- */
779
- codeChallenge?: string | null;
780
- /**
781
- * Code challenge method to use for PKCE verification.
782
- * This field is only used if `responseType` is set to `code`.
783
- *
784
- * Supported values:
785
- * + `S256`: The code challenge is transformed using SHA-256 encyption.
786
- * + `S512`: The code challenge is transformed using SHA-512 encyption.
787
- */
788
- codeChallengeMethod?: string | null;
789
- /** Session token of the site visitor to authorize. */
790
- sessionToken?: string | null;
791
- }
792
- /** Currently only `none` and `login` are supported. */
793
- declare enum Prompt {
794
- login = "login",
795
- none = "none",
796
- consent = "consent",
797
- select_account = "select_account"
798
- }
799
- interface RedirectSessionMembersAccountParams {
800
- /**
801
- * The member account page to redirect to.
802
- *
803
- * Default: `ACCOUNT_INFO`
804
- */
805
- section?: MembersAccountSection;
806
- }
807
- declare enum MembersAccountSection {
808
- /** Account info section in "my account". */
809
- ACCOUNT_INFO = "ACCOUNT_INFO",
810
- /** My Bookings section in "my account". */
811
- BOOKINGS = "BOOKINGS",
812
- /** My Orders section in "my account". */
813
- ORDERS = "ORDERS",
814
- /** Subscriptions section in "my account". */
815
- SUBSCRIPTIONS = "SUBSCRIPTIONS",
816
- /** Events section in "my account". */
817
- EVENTS = "EVENTS"
818
- }
819
- interface RedirectSessionStoresProductParams {
820
- productSlug?: string;
821
- }
822
- interface RedirectSessionBookingsBookParams {
823
- /** For use when filtering the bookings page by a specific resource. */
824
- resourceId?: string;
825
- }
826
- interface CallbackParams {
827
- /**
828
- * 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.
829
- * When redirecting to this URL, Wix passes different query parameters depending on the preceding transaction:
830
- *
831
- * After a pricing plans checkout:
832
- * + `planOrderId`: ID of a pricing plan order.
833
- *
834
- * After an eCommerce checkout:
835
- * + `orderId`: ID of an eCommerce order.
836
- *
837
- * After an Events checkout:
838
- * + `orderNumber`: Unique order number for the transaction.
839
- * + `eventId`: ID of the event.
840
- *
841
- * If the process is abandoned or interrupted, the visitor is redirected to the URL specified in `postFlowUrl` instead.
842
- *
843
- * 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`.
844
- */
845
- thankYouPageUrl?: string | null;
846
- /**
847
- * The URL Wix should redirect the visitor to when the Wix-managed process is completed, abandoned, or interrupted.
848
- *
849
- * **Note**: For an authentication redirect, don't specify a URL here. Instead, specify one in `options.auth.authRequest.redirectUri`.
850
- */
851
- postFlowUrl?: string | null;
852
- /**
853
- * The URL for a custom login page implemented outside of Wix.
854
- *
855
- * Default: If you don't specify a URL, a Wix login page is used.
856
- */
857
- loginUrl?: string | null;
858
- /**
859
- * The URL for a custom bookings services page implemented outside of Wix.
860
- *
861
- * Default: If you don't specify a URL, a Wix bookings services page is used.
862
- */
863
- bookingsServiceListUrl?: string | null;
864
- /**
865
- * The URL for a custom eCommerce cart page implemented outside of Wix.
866
- *
867
- * Default: If you don't specify a URL, a Wix cart page is used.
868
- */
869
- cartPageUrl?: string | null;
870
- /**
871
- * The URL for a custom pricing plans page implemented outside of Wix. When redirecting to this URL, Wix specifies the following query parameters:
872
- * + `planIds`: IDs of the pricing plans on the custom page.
873
- * + `checkoutData`: Specify this string back in `options.paidPlansCheckout.checkoutData` when redirecting back to Wix for checkout.
874
- *
875
- * Default: If you don't specify a URL, a Wix pricing plans page is used.
876
- */
877
- planListUrl?: string | null;
878
- }
879
- interface RedirectSessionPreferences {
880
- /**
881
- * 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.
882
- *
883
- * Default: `true`
884
- */
885
- useGenericWixPages?: boolean | null;
886
- /**
887
- * 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.
888
- *
889
- * Default: `true`
890
- */
891
- maintainIdentity?: boolean | null;
892
- /**
893
- * Map of additional global query parameters to add to the created Wix URL.
894
- * For example, [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters).
895
- */
896
- additionalQueryParameters?: Record<string, string>;
897
- }
898
- interface CustomMemberPaths {
899
- /** 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. */
900
- accountPagePath?: string | null;
901
- /** 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. */
902
- profilePagePath?: string | null;
903
- }
904
- interface CreateRedirectSessionResponse {
905
- /** Details for redirecting the visitor to a Wix page. */
906
- redirectSession?: RedirectSession;
907
- }
908
- interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
909
- /** Information required for generating a custom URL for a Wix Bookings checkout. */
910
- bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
911
- /** Information required for generating a custom URL for a Wix eCommerce checkout. */
912
- ecomCheckout?: RedirectSessionEcomCheckoutParams;
913
- /** Information required for generating a custom URL for a Wix Events checkout. */
914
- eventsCheckout?: RedirectSessionEventsCheckoutParams;
915
- /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
916
- paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
917
- /** Information required for generating a custom URL for a Wix stores product page. */
918
- storesProduct?: RedirectSessionStoresProductParams;
919
- /** Information required for generating a custom URL for Wix bookings book page. */
920
- bookingsBook?: RedirectSessionBookingsBookParams;
921
- /** Optional preferences for customizing redirection to Wix pages. */
922
- preferences?: RedirectSessionPreferences;
923
- }
924
- /** @oneof */
925
- interface CreateAnonymousRedirectSessionRequestIntentOneOf {
926
- /** Information required for generating a custom URL for a Wix Bookings checkout. */
927
- bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
928
- /** Information required for generating a custom URL for a Wix eCommerce checkout. */
929
- ecomCheckout?: RedirectSessionEcomCheckoutParams;
930
- /** Information required for generating a custom URL for a Wix Events checkout. */
931
- eventsCheckout?: RedirectSessionEventsCheckoutParams;
932
- /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
933
- paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
934
- /** Information required for generating a custom URL for a Wix stores product page. */
935
- storesProduct?: RedirectSessionStoresProductParams;
936
- /** Information required for generating a custom URL for Wix bookings book page. */
937
- bookingsBook?: RedirectSessionBookingsBookParams;
938
- }
939
- interface CreateAnonymousRedirectSessionResponse {
940
- /** Details for redirecting the visitor to a Wix page. */
941
- redirectSession?: RedirectSession;
942
- }
943
- interface AttachPagesRequest {
944
- /** App ID that we want to inherit pages for. */
945
- appDefId?: string;
946
- }
947
- interface AttachPagesResponse {
948
- /** The status of the operation. */
949
- status?: AttachPagesResponseStatus;
950
- /** A descriptive message about the operation */
951
- message?: string;
952
- /** True if pages were attached, false otherwise */
953
- pagesAttached?: boolean;
954
- /** True if the site was already published */
955
- sitePublished?: boolean;
956
- }
957
- declare enum AttachPagesResponseStatus {
958
- /** Invalid value. */
959
- UNKNOWN = "UNKNOWN",
960
- /** Pages were successfully attached. */
961
- SUCCESS = "SUCCESS",
962
- /** No pages were attached because the site is already published. */
963
- NO_ACTION = "NO_ACTION",
964
- /** An error occurred, such as when the site or app is not found. */
965
- ERROR = "ERROR"
966
- }
967
- interface ValidateCallbackURLRequest {
968
- /** An external URL to validate */
969
- callbackUrl?: string;
970
- /** Type of the callback URL. */
971
- callbackType?: CallbackType;
972
- /** 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 */
973
- clientId?: string;
974
- }
975
- declare enum CallbackType {
976
- /** Invalid value. */
977
- UNKNOWN = "UNKNOWN",
978
- /** Callback URL is used for the logout flow. */
979
- LOGOUT = "LOGOUT",
980
- /** Callback URL is used for a checkout flow. */
981
- CHECKOUT = "CHECKOUT",
982
- /** Callback URL is used for the authorize flow. */
983
- AUTHORIZE = "AUTHORIZE"
984
- }
985
- interface ValidateCallbackURLResponse {
986
- /** Indicates if the provided URL is allowed for the given client id */
987
- isValid?: boolean;
988
- }
989
- interface SignInURLRequest {
990
- /** 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 */
991
- clientId?: string;
992
- }
993
- interface SignInURLResponse {
994
- /** The Wix URL details to redirect into */
995
- redirectSession?: RedirectSession;
996
- }
997
- interface AttachAllTemplatesRequest {
998
- }
999
- interface AttachAllTemplatesResponse {
1000
- /** The status of the operation. */
1001
- status?: Status;
1002
- }
1003
- declare enum Status {
1004
- /** Invalid value. */
1005
- UNKNOWN = "UNKNOWN",
1006
- /** Templates were successfully attached. */
1007
- SUCCESS = "SUCCESS",
1008
- /** An error occurred. */
1009
- ERROR = "ERROR"
1010
- }
1011
- interface DomainEvent extends DomainEventBodyOneOf {
1012
- createdEvent?: EntityCreatedEvent;
1013
- updatedEvent?: EntityUpdatedEvent;
1014
- deletedEvent?: EntityDeletedEvent;
1015
- actionEvent?: ActionEvent;
1016
- /**
1017
- * Unique event ID.
1018
- * Allows clients to ignore duplicate webhooks.
1019
- */
1020
- _id?: string;
1021
- /**
1022
- * Assumes actions are also always typed to an entity_type
1023
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1024
- */
1025
- entityFqdn?: string;
1026
- /**
1027
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1028
- * This is although the created/updated/deleted notion is duplication of the oneof types
1029
- * Example: created/updated/deleted/started/completed/email_opened
1030
- */
1031
- slug?: string;
1032
- /** ID of the entity associated with the event. */
1033
- entityId?: string;
1034
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1035
- eventTime?: Date | null;
1036
- /**
1037
- * Whether the event was triggered as a result of a privacy regulation application
1038
- * (for example, GDPR).
1039
- */
1040
- triggeredByAnonymizeRequest?: boolean | null;
1041
- /** If present, indicates the action that triggered the event. */
1042
- originatedFrom?: string | null;
1043
- /**
1044
- * A sequence number defining the order of updates to the underlying entity.
1045
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
1046
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1047
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1048
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
1049
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1050
- */
1051
- entityEventSequence?: string | null;
1052
- }
1053
- /** @oneof */
1054
- interface DomainEventBodyOneOf {
1055
- createdEvent?: EntityCreatedEvent;
1056
- updatedEvent?: EntityUpdatedEvent;
1057
- deletedEvent?: EntityDeletedEvent;
1058
- actionEvent?: ActionEvent;
1059
- }
1060
- interface EntityCreatedEvent {
1061
- entity?: string;
1062
- }
1063
- interface RestoreInfo {
1064
- deletedDate?: Date | null;
1065
- }
1066
- interface EntityUpdatedEvent {
1067
- /**
1068
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
1069
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
1070
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
1071
- */
1072
- currentEntity?: string;
1073
- }
1074
- interface EntityDeletedEvent {
1075
- /** Entity that was deleted */
1076
- deletedEntity?: string | null;
1077
- }
1078
- interface ActionEvent {
1079
- body?: string;
1080
- }
1081
- interface MessageEnvelope {
1082
- /** App instance ID. */
1083
- instanceId?: string | null;
1084
- /** Event type. */
1085
- eventType?: string;
1086
- /** The identification type and identity data. */
1087
- identity?: IdentificationData;
1088
- /** Stringify payload. */
1089
- data?: string;
1090
- }
1091
- interface IdentificationData extends IdentificationDataIdOneOf {
1092
- /** ID of a site visitor that has not logged in to the site. */
1093
- anonymousVisitorId?: string;
1094
- /** ID of a site visitor that has logged in to the site. */
1095
- memberId?: string;
1096
- /** ID of a Wix user (site owner, contributor, etc.). */
1097
- wixUserId?: string;
1098
- /** ID of an app. */
1099
- appId?: string;
1100
- /** @readonly */
1101
- identityType?: WebhookIdentityType;
1102
- }
1103
- /** @oneof */
1104
- interface IdentificationDataIdOneOf {
1105
- /** ID of a site visitor that has not logged in to the site. */
1106
- anonymousVisitorId?: string;
1107
- /** ID of a site visitor that has logged in to the site. */
1108
- memberId?: string;
1109
- /** ID of a Wix user (site owner, contributor, etc.). */
1110
- wixUserId?: string;
1111
- /** ID of an app. */
1112
- appId?: string;
1113
- }
1114
- declare enum WebhookIdentityType {
1115
- UNKNOWN = "UNKNOWN",
1116
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1117
- MEMBER = "MEMBER",
1118
- WIX_USER = "WIX_USER",
1119
- APP = "APP"
1120
- }
1121
- interface URLDetailsNonNullableFields {
1122
- endpoint: string;
1123
- }
1124
- interface RedirectSessionNonNullableFields {
1125
- _id: string;
1126
- fullUrl: string;
1127
- urlDetails?: URLDetailsNonNullableFields;
1128
- shortUrl: string;
1129
- }
1130
- interface CreateRedirectSessionResponseNonNullableFields {
1131
- redirectSession?: RedirectSessionNonNullableFields;
1132
- }
1133
- interface BaseEventMetadata {
1134
- /** App instance ID. */
1135
- instanceId?: string | null;
1136
- /** Event type. */
1137
- eventType?: string;
1138
- /** The identification type and identity data. */
1139
- identity?: IdentificationData;
1140
- }
1141
- interface EventMetadata extends BaseEventMetadata {
1142
- /**
1143
- * Unique event ID.
1144
- * Allows clients to ignore duplicate webhooks.
1145
- */
1146
- _id?: string;
1147
- /**
1148
- * Assumes actions are also always typed to an entity_type
1149
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1150
- */
1151
- entityFqdn?: string;
1152
- /**
1153
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1154
- * This is although the created/updated/deleted notion is duplication of the oneof types
1155
- * Example: created/updated/deleted/started/completed/email_opened
1156
- */
1157
- slug?: string;
1158
- /** ID of the entity associated with the event. */
1159
- entityId?: string;
1160
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1161
- eventTime?: Date | null;
1162
- /**
1163
- * Whether the event was triggered as a result of a privacy regulation application
1164
- * (for example, GDPR).
1165
- */
1166
- triggeredByAnonymizeRequest?: boolean | null;
1167
- /** If present, indicates the action that triggered the event. */
1168
- originatedFrom?: string | null;
1169
- /**
1170
- * A sequence number defining the order of updates to the underlying entity.
1171
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
1172
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1173
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1174
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
1175
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1176
- */
1177
- entityEventSequence?: string | null;
1178
- }
1179
- interface RedirectSessionCreatedEnvelope {
1180
- entity: RedirectSession;
1181
- metadata: EventMetadata;
1182
- }
1183
- interface CreateRedirectSessionOptions extends CreateRedirectSessionRequestIntentOneOf {
1184
- /** Information required for generating a custom URL for a Wix Bookings checkout. */
1185
- bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
1186
- /** Information required for generating a custom URL for a Wix eCommerce checkout. */
1187
- ecomCheckout?: RedirectSessionEcomCheckoutParams;
1188
- /** Information required for generating a custom URL for a Wix Events checkout. */
1189
- eventsCheckout?: RedirectSessionEventsCheckoutParams;
1190
- /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
1191
- paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
1192
- /** Specify an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
1193
- login?: RedirectSessionLoginParams;
1194
- /** 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. */
1195
- logout?: RedirectSessionLogoutParams;
1196
- /** Information required for generating a custom URL for Wix authentication. */
1197
- auth?: RedirectSessionAuthParams;
1198
- /** Information required for generating a custom URL for a Wix stores product page. */
1199
- storesProduct?: RedirectSessionStoresProductParams;
1200
- /** Information required for generating a custom URL for Wix bookings book page. */
1201
- bookingsBook?: RedirectSessionBookingsBookParams;
1202
- /**
1203
- * Details of pages to redirect back to on the Wix Headless client site.
1204
- *
1205
- * **Note**: For an authentication redirect, don't specify a post-flow URL here. Instead, specify one in `options.auth.authRequest.redirectUri`.
1206
- */
1207
- callbacks?: CallbackParams;
1208
- /** Optional preferences for customizing redirection to Wix pages. */
1209
- preferences?: RedirectSessionPreferences;
1210
- }
1211
-
1212
- declare function createRedirectSession$1(httpClient: HttpClient): CreateRedirectSessionSignature;
1213
- interface CreateRedirectSessionSignature {
1214
- /**
1215
- * Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.
1216
- *
1217
- * 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.
1218
- * 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.
1219
- *
1220
- * To initiate a redirect session:
1221
- *
1222
- * 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.
1223
- * 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.
1224
- * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.
1225
- * @param - Options for creating a redirect session.
1226
- */
1227
- (options?: CreateRedirectSessionOptions | undefined): Promise<CreateRedirectSessionResponse & CreateRedirectSessionResponseNonNullableFields>;
1228
- }
1229
- declare const onRedirectSessionCreated$1: EventDefinition<RedirectSessionCreatedEnvelope, "wix.headless.v1.redirect_session_created">;
1230
-
1231
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1232
-
1233
- declare const createRedirectSession: MaybeContext<BuildRESTFunction<typeof createRedirectSession$1> & typeof createRedirectSession$1>;
1234
-
1235
- type _publicOnRedirectSessionCreatedType = typeof onRedirectSessionCreated$1;
1236
- /**
1237
- * Triggerd when a redirect session is created
1238
- */
1239
- declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<_publicOnRedirectSessionCreatedType>>;
1240
-
1241
- type index_d_ActionEvent = ActionEvent;
1242
- type index_d_AttachAllTemplatesRequest = AttachAllTemplatesRequest;
1243
- type index_d_AttachAllTemplatesResponse = AttachAllTemplatesResponse;
1244
- type index_d_AttachPagesRequest = AttachPagesRequest;
1245
- type index_d_AttachPagesResponse = AttachPagesResponse;
1246
- type index_d_AttachPagesResponseStatus = AttachPagesResponseStatus;
1247
- declare const index_d_AttachPagesResponseStatus: typeof AttachPagesResponseStatus;
1248
- type index_d_AuthorizeRequest = AuthorizeRequest;
1249
- type index_d_BaseEventMetadata = BaseEventMetadata;
1250
- type index_d_BookingPolicyViolations = BookingPolicyViolations;
1251
- type index_d_CallbackParams = CallbackParams;
1252
- type index_d_CallbackType = CallbackType;
1253
- declare const index_d_CallbackType: typeof CallbackType;
1254
- type index_d_CreateAnonymousRedirectSessionRequest = CreateAnonymousRedirectSessionRequest;
1255
- type index_d_CreateAnonymousRedirectSessionRequestIntentOneOf = CreateAnonymousRedirectSessionRequestIntentOneOf;
1256
- type index_d_CreateAnonymousRedirectSessionResponse = CreateAnonymousRedirectSessionResponse;
1257
- type index_d_CreateRedirectSessionOptions = CreateRedirectSessionOptions;
1258
- type index_d_CreateRedirectSessionRequest = CreateRedirectSessionRequest;
1259
- type index_d_CreateRedirectSessionRequestIntentOneOf = CreateRedirectSessionRequestIntentOneOf;
1260
- type index_d_CreateRedirectSessionResponse = CreateRedirectSessionResponse;
1261
- type index_d_CreateRedirectSessionResponseNonNullableFields = CreateRedirectSessionResponseNonNullableFields;
1262
- type index_d_CustomMemberPaths = CustomMemberPaths;
1263
- type index_d_DomainEvent = DomainEvent;
1264
- type index_d_DomainEventBodyOneOf = DomainEventBodyOneOf;
1265
- type index_d_EntityCreatedEvent = EntityCreatedEvent;
1266
- type index_d_EntityDeletedEvent = EntityDeletedEvent;
1267
- type index_d_EntityUpdatedEvent = EntityUpdatedEvent;
1268
- type index_d_EventMetadata = EventMetadata;
1269
- type index_d_IdentificationData = IdentificationData;
1270
- type index_d_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1271
- type index_d_Location = Location;
1272
- type index_d_LocationType = LocationType;
1273
- declare const index_d_LocationType: typeof LocationType;
1274
- type index_d_MembersAccountSection = MembersAccountSection;
1275
- declare const index_d_MembersAccountSection: typeof MembersAccountSection;
1276
- type index_d_MessageEnvelope = MessageEnvelope;
1277
- type index_d_NestedTimeSlot = NestedTimeSlot;
1278
- type index_d_Prompt = Prompt;
1279
- declare const index_d_Prompt: typeof Prompt;
1280
- type index_d_RedirectSession = RedirectSession;
1281
- type index_d_RedirectSessionAuthParams = RedirectSessionAuthParams;
1282
- type index_d_RedirectSessionBookingsBookParams = RedirectSessionBookingsBookParams;
1283
- type index_d_RedirectSessionBookingsCheckoutParams = RedirectSessionBookingsCheckoutParams;
1284
- type index_d_RedirectSessionCreatedEnvelope = RedirectSessionCreatedEnvelope;
1285
- type index_d_RedirectSessionEcomCheckoutParams = RedirectSessionEcomCheckoutParams;
1286
- type index_d_RedirectSessionEventsCheckoutParams = RedirectSessionEventsCheckoutParams;
1287
- type index_d_RedirectSessionLoginParams = RedirectSessionLoginParams;
1288
- type index_d_RedirectSessionLogoutParams = RedirectSessionLogoutParams;
1289
- type index_d_RedirectSessionMembersAccountParams = RedirectSessionMembersAccountParams;
1290
- type index_d_RedirectSessionPaidPlansCheckoutParams = RedirectSessionPaidPlansCheckoutParams;
1291
- type index_d_RedirectSessionPreferences = RedirectSessionPreferences;
1292
- type index_d_RedirectSessionStoresProductParams = RedirectSessionStoresProductParams;
1293
- type index_d_RestoreInfo = RestoreInfo;
1294
- type index_d_SignInURLRequest = SignInURLRequest;
1295
- type index_d_SignInURLResponse = SignInURLResponse;
1296
- type index_d_Slot = Slot;
1297
- type index_d_SlotAvailability = SlotAvailability;
1298
- type index_d_SlotResource = SlotResource;
1299
- type index_d_Status = Status;
1300
- declare const index_d_Status: typeof Status;
1301
- type index_d_URLDetails = URLDetails;
1302
- type index_d_ValidateCallbackURLRequest = ValidateCallbackURLRequest;
1303
- type index_d_ValidateCallbackURLResponse = ValidateCallbackURLResponse;
1304
- type index_d_WaitingList = WaitingList;
1305
- type index_d_WebhookIdentityType = WebhookIdentityType;
1306
- declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
1307
- type index_d__publicOnRedirectSessionCreatedType = _publicOnRedirectSessionCreatedType;
1308
- declare const index_d_createRedirectSession: typeof createRedirectSession;
1309
- declare const index_d_onRedirectSessionCreated: typeof onRedirectSessionCreated;
1310
- declare namespace index_d {
1311
- export { type index_d_ActionEvent as ActionEvent, type index_d_AttachAllTemplatesRequest as AttachAllTemplatesRequest, type index_d_AttachAllTemplatesResponse as AttachAllTemplatesResponse, type index_d_AttachPagesRequest as AttachPagesRequest, type index_d_AttachPagesResponse as AttachPagesResponse, index_d_AttachPagesResponseStatus as AttachPagesResponseStatus, type index_d_AuthorizeRequest as AuthorizeRequest, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_BookingPolicyViolations as BookingPolicyViolations, type index_d_CallbackParams as CallbackParams, index_d_CallbackType as CallbackType, type index_d_CreateAnonymousRedirectSessionRequest as CreateAnonymousRedirectSessionRequest, type index_d_CreateAnonymousRedirectSessionRequestIntentOneOf as CreateAnonymousRedirectSessionRequestIntentOneOf, type index_d_CreateAnonymousRedirectSessionResponse as CreateAnonymousRedirectSessionResponse, type index_d_CreateRedirectSessionOptions as CreateRedirectSessionOptions, type index_d_CreateRedirectSessionRequest as CreateRedirectSessionRequest, type index_d_CreateRedirectSessionRequestIntentOneOf as CreateRedirectSessionRequestIntentOneOf, type index_d_CreateRedirectSessionResponse as CreateRedirectSessionResponse, type index_d_CreateRedirectSessionResponseNonNullableFields as CreateRedirectSessionResponseNonNullableFields, type index_d_CustomMemberPaths as CustomMemberPaths, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_Location as Location, index_d_LocationType as LocationType, index_d_MembersAccountSection as MembersAccountSection, type index_d_MessageEnvelope as MessageEnvelope, type index_d_NestedTimeSlot as NestedTimeSlot, index_d_Prompt as Prompt, type index_d_RedirectSession as RedirectSession, type index_d_RedirectSessionAuthParams as RedirectSessionAuthParams, type index_d_RedirectSessionBookingsBookParams as RedirectSessionBookingsBookParams, type index_d_RedirectSessionBookingsCheckoutParams as RedirectSessionBookingsCheckoutParams, type index_d_RedirectSessionCreatedEnvelope as RedirectSessionCreatedEnvelope, type index_d_RedirectSessionEcomCheckoutParams as RedirectSessionEcomCheckoutParams, type index_d_RedirectSessionEventsCheckoutParams as RedirectSessionEventsCheckoutParams, type index_d_RedirectSessionLoginParams as RedirectSessionLoginParams, type index_d_RedirectSessionLogoutParams as RedirectSessionLogoutParams, type index_d_RedirectSessionMembersAccountParams as RedirectSessionMembersAccountParams, type index_d_RedirectSessionPaidPlansCheckoutParams as RedirectSessionPaidPlansCheckoutParams, type index_d_RedirectSessionPreferences as RedirectSessionPreferences, type index_d_RedirectSessionStoresProductParams as RedirectSessionStoresProductParams, type index_d_RestoreInfo as RestoreInfo, type index_d_SignInURLRequest as SignInURLRequest, type index_d_SignInURLResponse as SignInURLResponse, type index_d_Slot as Slot, type index_d_SlotAvailability as SlotAvailability, type index_d_SlotResource as SlotResource, index_d_Status as Status, type index_d_URLDetails as URLDetails, type index_d_ValidateCallbackURLRequest as ValidateCallbackURLRequest, type index_d_ValidateCallbackURLResponse as ValidateCallbackURLResponse, type index_d_WaitingList as WaitingList, index_d_WebhookIdentityType as WebhookIdentityType, type index_d__publicOnRedirectSessionCreatedType as _publicOnRedirectSessionCreatedType, index_d_createRedirectSession as createRedirectSession, index_d_onRedirectSessionCreated as onRedirectSessionCreated, onRedirectSessionCreated$1 as publicOnRedirectSessionCreated };
1312
- }
1313
-
1314
- export { index_d as redirects };