@wix/redirects 1.0.49 → 1.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/redirects",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,10 +18,9 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/redirects_redirects": "1.0.19"
21
+ "@wix/redirects_redirects": "1.0.21"
22
22
  },
23
23
  "devDependencies": {
24
- "@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
25
24
  "glob": "^10.4.1",
26
25
  "rollup": "^4.18.0",
27
26
  "rollup-plugin-dts": "^6.1.1",
@@ -43,5 +42,5 @@
43
42
  "fqdn": ""
44
43
  }
45
44
  },
46
- "falconPackageHash": "325b79f215dc88084bbdd4a81eb81c93bbea50822d77f7bcfd865b08"
45
+ "falconPackageHash": "90835d249671a6b247aa5e2a22bae75fb1ac494f82290087efcd6014"
47
46
  }
@@ -1,491 +1,8 @@
1
- /** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
2
- interface RedirectSession {
3
- /** ID of the redirect session created. */
4
- _id?: string;
5
- /**
6
- * 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.
7
- * @readonly
8
- */
9
- fullUrl?: string;
10
- /** Details about the URL of the RedirectSession */
11
- urlDetails?: URLDetails;
12
- /**
13
- * The session token to pass to the Wix page to maintain the visitor's identity.
14
- * @readonly
15
- */
16
- sessionToken?: string | null;
17
- /**
18
- * 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.
19
- * @readonly
20
- */
21
- shortUrl?: string;
22
- }
23
- interface URLDetails {
24
- /**
25
- * The endpoint of the url (includes the base url and the path to the endpoint, without the query parameters)
26
- * For example: `https://mysite.com/_api/oauth2/authorize`
27
- * @readonly
28
- */
29
- endpoint?: string;
30
- /** The query parameters of the url */
31
- searchParams?: Record<string, string>;
32
- }
33
- /** @oneof */
34
- interface CreateRedirectSessionRequestIntentOneOf {
35
- /** Information required for generating a custom URL for a Wix Bookings checkout. */
36
- bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
37
- /** Information required for generating a custom URL for a Wix eCommerce checkout. */
38
- ecomCheckout?: RedirectSessionEcomCheckoutParams;
39
- /** Information required for generating a custom URL for a Wix Events checkout. */
40
- eventsCheckout?: RedirectSessionEventsCheckoutParams;
41
- /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
42
- paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
43
- /** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
44
- login?: RedirectSessionLoginParams;
45
- /** 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. */
46
- logout?: RedirectSessionLogoutParams;
47
- /** Information required for generating a custom URL for Wix authentication. */
48
- auth?: RedirectSessionAuthParams;
49
- /** Information required for generating a custom URL for a Wix stores product page. */
50
- storesProduct?: RedirectSessionStoresProductParams;
51
- /** Information required for generating a custom URL for Wix bookings book page. */
52
- bookingsBook?: RedirectSessionBookingsBookParams;
53
- }
54
- interface RedirectSessionBookingsCheckoutParams {
55
- /**
56
- * 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`.
57
- *
58
- * Default: If you don't specify a timezone, the timezone in `slotAvailability.slot.timezone` is used.
59
- */
60
- timezone?: string;
61
- /** __Required.__ The calendar slot to check out. */
62
- slotAvailability?: SlotAvailability;
63
- }
64
- interface SlotAvailability {
65
- /**
66
- * The slot for the corresponding session, when the session is either a single session
67
- * or a specific session generated from a recurring session.
68
- */
69
- slot?: Slot;
70
- /**
71
- * Whether the slot is bookable. Bookability is determined by checking a
72
- * session's open slots and booking policies. Locks are not taken into
73
- * account.
74
- */
75
- bookable?: boolean;
76
- /**
77
- * Total number of spots for this slot.
78
- * For example, if a session has a total of 10 spots and 3 spots are booked,
79
- * `spotsTotal` is 10 and `openSpots` is 7.
80
- */
81
- totalSpots?: number | null;
82
- /** Number of open spots for this slot. */
83
- openSpots?: number | null;
84
- /** An object describing the slot's waitlist and its occupancy. */
85
- waitingList?: WaitingList;
86
- /** Booking policy violations for the slot. */
87
- bookingPolicyViolations?: BookingPolicyViolations;
88
- /**
89
- * Indicates whether the slot is locked because a waitlist exists.
90
- * When a slot frees up, the slot is offered to the next customer on the waitlist. Read-only.
91
- */
92
- locked?: boolean | null;
93
- isFromV2?: boolean;
94
- }
95
- interface Slot {
96
- /**
97
- * ID for the slot's corresponding session, when the session is either a single session
98
- * or a specific session generated from a recurring session.
99
- */
100
- sessionId?: string | null;
101
- /** Service ID. */
102
- serviceId?: string;
103
- /** Schedule ID. */
104
- scheduleId?: string;
105
- /**
106
- * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
107
- * format.
108
- *
109
- * If `timezone` is specified,
110
- * dates are based on the local date/time. This means that the timezone offset
111
- * in the `startDate` is ignored.
112
- */
113
- startDate?: string | null;
114
- /**
115
- * The end time of this slot in
116
- * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
117
- *
118
- * If `timezone` is specified,
119
- * dates are based on the local date/time. This means that the timezone offset
120
- * in the `endDate` is ignored.
121
- */
122
- endDate?: string | null;
123
- /**
124
- * The timezone for which slot availability is to be calculated.
125
- *
126
- * 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)
127
- * when calculating availability.
128
- */
129
- timezone?: string | null;
130
- /**
131
- * The resource required for this slot. Currently, the only supported resource
132
- * is the relevant staff member for the slot.
133
- */
134
- resource?: SlotResource;
135
- /** Geographic location of the slot. */
136
- location?: Location;
137
- }
138
- interface SlotResource {
139
- /**
140
- * Resource ID.
141
- * @readonly
142
- */
143
- _id?: string | null;
144
- /** Resource name. Read only. */
145
- name?: string | null;
146
- }
147
- interface Location {
148
- /**
149
- * Business location ID. Available only for locations that are business locations,
150
- * meaning the `location_type` is `"OWNER_BUSINESS"`.
151
- */
152
- _id?: string | null;
153
- /** Location name. */
154
- name?: string | null;
155
- /** The full address of this location. */
156
- formattedAddress?: string | null;
157
- /**
158
- * Location type.
159
- *
160
- * - `"OWNER_BUSINESS"`: The business address, as set in the site’s general settings.
161
- * - `"OWNER_CUSTOM"`: The address as set when creating the service.
162
- * - `"CUSTOM"`: The address as set for the individual session.
163
- */
164
- locationType?: LocationType;
165
- }
166
- declare enum LocationType {
167
- UNDEFINED = "UNDEFINED",
168
- OWNER_BUSINESS = "OWNER_BUSINESS",
169
- OWNER_CUSTOM = "OWNER_CUSTOM",
170
- CUSTOM = "CUSTOM"
171
- }
172
- interface WaitingList {
173
- /**
174
- * Total number of spots and open spots for this waitlist.
175
- * For example, a Yoga class with 10 waitlist spots and 3 registered
176
- * on the waitlist has 10 `total_spots` and 7 `open_spots`.
177
- */
178
- totalSpots?: number | null;
179
- /** Number of open spots for this waitlist. */
180
- openSpots?: number | null;
181
- }
182
- interface BookingPolicyViolations {
183
- /** Bookings policy violation. Too early to book this slot. */
184
- tooEarlyToBook?: boolean | null;
185
- /** Bookings policy violation. Too late to book this slot. */
186
- tooLateToBook?: boolean | null;
187
- /** Bookings policy violation. Online booking is disabled for this slot. */
188
- bookOnlineDisabled?: boolean | null;
189
- }
190
- interface RedirectSessionEcomCheckoutParams {
191
- /** __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. */
192
- checkoutId?: string;
193
- }
194
- interface RedirectSessionEventsCheckoutParams {
195
- /** __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. */
196
- reservationId?: string;
197
- /** __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. */
198
- eventSlug?: string;
199
- }
200
- interface RedirectSessionPaidPlansCheckoutParams {
201
- /** __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. */
202
- planId?: string;
203
- /**
204
- * 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.
205
- * 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.
206
- */
207
- checkoutData?: string | null;
208
- }
209
- interface RedirectSessionLoginParams {
210
- }
211
- interface RedirectSessionLogoutParams {
212
- /** __Required.__ ID of the OAuth app authorizing the client. */
213
- clientId?: string;
214
- }
215
- interface RedirectSessionAuthParams {
216
- /** __Required.__ The authorization request to send to the authorization server. */
217
- authRequest?: AuthorizeRequest;
218
- prompt?: Prompt;
219
- }
220
- /**
221
- * AuthorizeRequest is sent by the client to the authorization server to initiate
222
- * the authorization process.
223
- */
224
- interface AuthorizeRequest {
225
- /** ID of the Wix OAuth app requesting authorization. */
226
- clientId?: string;
227
- /**
228
- * Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).
229
- *
230
- * Supported values:
231
- * + `code`: The endpoint returns an authorization code that can be used to obtain an access token.
232
- */
233
- responseType?: string;
234
- /** 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. */
235
- redirectUri?: string | null;
236
- /**
237
- * Desired scope of access. If this field is left empty, only an access token is granted.
238
- * To received a refresh token, pass `offline_access` as the value of this field.
239
- */
240
- scope?: string | null;
241
- /**
242
- * A value used to confirm the state of an application before and after it makes an authorization
243
- * request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser
244
- * is redirected there.
245
- * Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).
246
- */
247
- state?: string;
248
- /**
249
- * esired response format.
250
- *
251
- * Supported values:
252
- * + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.
253
- * + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.
254
- * + `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).
255
- *
256
- * Default value: `query`
257
- */
258
- responseMode?: string | null;
259
- /**
260
- * Code challenge to use for PKCE verification.
261
- * This field is only used if `responseType` is set to `code`.
262
- */
263
- codeChallenge?: string | null;
264
- /**
265
- * Code challenge method to use for PKCE verification.
266
- * This field is only used if `responseType` is set to `code`.
267
- *
268
- * Supported values:
269
- * + `S256`: The code challenge is transformed using SHA-256 encyption.
270
- * + `S512`: The code challenge is transformed using SHA-512 encyption.
271
- */
272
- codeChallengeMethod?: string | null;
273
- /** Session token of the site visitor to authorize. */
274
- sessionToken?: string | null;
275
- }
276
- /** Currently only `none` and `login` are supported. */
277
- declare enum Prompt {
278
- login = "login",
279
- none = "none",
280
- consent = "consent",
281
- select_account = "select_account"
282
- }
283
- interface RedirectSessionStoresProductParams {
284
- /** *Required.** Slug of the product to navigate to. */
285
- productSlug?: string;
286
- }
287
- interface RedirectSessionBookingsBookParams {
288
- /** For use when filtering the bookings page by a specific resource. */
289
- resourceId?: string;
290
- }
291
- interface CallbackParams {
292
- /**
293
- * 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.
294
- * When redirecting to this URL, Wix passes different query parameters depending on the preceding transaction:
295
- *
296
- * After a pricing plans checkout:
297
- * + `planOrderId`: ID of a pricing plan order.
298
- *
299
- * After an eCommerce checkout:
300
- * + `orderId`: ID of an eCommerce order.
301
- *
302
- * After an Events checkout
303
- * + `orderNumber`: Unique order number for the transaction.
304
- * + `eventId`: ID of the event.
305
- *
306
- * If the process is abandoned or interrupted, the visitor is redirected to the URL specified in `postFlowUrl` instead.
307
- *
308
- * 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`.
309
- */
310
- thankYouPageUrl?: string | null;
311
- /**
312
- * The URL Wix should redirect the visitor to when the Wix-managed process is completed, abandoned, or interrupted.
313
- *
314
- * **Note**: For an authentication redirect, don't pass a URL here. Instead, pass one in `options.auth.authRequest.redirectUri`.
315
- */
316
- postFlowUrl?: string | null;
317
- /**
318
- * The URL for a custom login page implemented outside of Wix.
319
- *
320
- * Default: If you don't pass a URL, a Wix login page is used.
321
- */
322
- loginUrl?: string | null;
323
- /**
324
- * The URL for a custom bookings services page implemented outside of Wix.
325
- *
326
- * Default: If you don't pass a URL, a Wix bookings services page is used.
327
- */
328
- bookingsServiceListUrl?: string | null;
329
- /**
330
- * The URL for a custom eCommerce cart page implemented outside of Wix.
331
- *
332
- * Default: If you don't pass a URL, a Wix cart page is used.
333
- */
334
- cartPageUrl?: string | null;
335
- /**
336
- * The URL for a custom pricing plans page implemented outside of Wix. When redirecting to this URL, Wix passes the following query parameters:
337
- * + `planIds`: IDs of the pricing plans on the custom page.
338
- * + `checkoutData`: Pass this string back in `options.paidPlansCheckout.checkoutData` when redirecting back to Wix for checkout.
339
- *
340
- * Default: If you don't pass a URL, a Wix pricing plans page is used.
341
- */
342
- planListUrl?: string | null;
343
- }
344
- interface RedirectSessionPreferences {
345
- /**
346
- * 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.
347
- *
348
- * Default: `true`
349
- */
350
- useGenericWixPages?: boolean | null;
351
- /**
352
- * 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.
353
- *
354
- * Default: `true`
355
- */
356
- maintainIdentity?: boolean | null;
357
- /**
358
- * A map of additional query parameters to pass to the created Wix URL.
359
- * Global query parameters to be passed to Wix, for example campaign parameters (UTM params).
360
- */
361
- additionalQueryParameters?: Record<string, string>;
362
- }
363
- interface CreateRedirectSessionResponse {
364
- /** Details for redirecting the visitor to a Wix page. */
365
- redirectSession?: RedirectSession;
366
- }
367
- interface IdentificationData extends IdentificationDataIdOneOf {
368
- /** ID of a site visitor that has not logged in to the site. */
369
- anonymousVisitorId?: string;
370
- /** ID of a site visitor that has logged in to the site. */
371
- memberId?: string;
372
- /** ID of a Wix user (site owner, contributor, etc.). */
373
- wixUserId?: string;
374
- /** ID of an app. */
375
- appId?: string;
376
- /** @readonly */
377
- identityType?: WebhookIdentityType;
378
- }
379
- /** @oneof */
380
- interface IdentificationDataIdOneOf {
381
- /** ID of a site visitor that has not logged in to the site. */
382
- anonymousVisitorId?: string;
383
- /** ID of a site visitor that has logged in to the site. */
384
- memberId?: string;
385
- /** ID of a Wix user (site owner, contributor, etc.). */
386
- wixUserId?: string;
387
- /** ID of an app. */
388
- appId?: string;
389
- }
390
- declare enum WebhookIdentityType {
391
- UNKNOWN = "UNKNOWN",
392
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
393
- MEMBER = "MEMBER",
394
- WIX_USER = "WIX_USER",
395
- APP = "APP"
396
- }
397
- interface CreateRedirectSessionResponseNonNullableFields {
398
- redirectSession?: {
399
- _id: string;
400
- fullUrl: string;
401
- urlDetails?: {
402
- endpoint: string;
403
- };
404
- shortUrl: string;
405
- };
406
- }
407
- interface BaseEventMetadata {
408
- /** App instance ID. */
409
- instanceId?: string | null;
410
- /** Event type. */
411
- eventType?: string;
412
- /** The identification type and identity data. */
413
- identity?: IdentificationData;
414
- }
415
- interface EventMetadata extends BaseEventMetadata {
416
- /**
417
- * Unique event ID.
418
- * Allows clients to ignore duplicate webhooks.
419
- */
420
- _id?: string;
421
- /**
422
- * Assumes actions are also always typed to an entity_type
423
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
424
- */
425
- entityFqdn?: string;
426
- /**
427
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
428
- * This is although the created/updated/deleted notion is duplication of the oneof types
429
- * Example: created/updated/deleted/started/completed/email_opened
430
- */
431
- slug?: string;
432
- /** ID of the entity associated with the event. */
433
- entityId?: string;
434
- /** Event timestamp. */
435
- eventTime?: Date;
436
- /**
437
- * Whether the event was triggered as a result of a privacy regulation application
438
- * (for example, GDPR).
439
- */
440
- triggeredByAnonymizeRequest?: boolean | null;
441
- /** If present, indicates the action that triggered the event. */
442
- originatedFrom?: string | null;
443
- /**
444
- * A sequence number defining the order of updates to the underlying entity.
445
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
446
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
447
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
448
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
449
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
450
- */
451
- entityEventSequence?: string | null;
452
- }
453
- interface RedirectSessionCreatedEnvelope {
454
- entity: RedirectSession;
455
- metadata: EventMetadata;
456
- }
457
- interface CreateRedirectSessionOptions extends CreateRedirectSessionRequestIntentOneOf {
458
- /** Information required for generating a custom URL for a Wix Bookings checkout. */
459
- bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
460
- /** Information required for generating a custom URL for a Wix eCommerce checkout. */
461
- ecomCheckout?: RedirectSessionEcomCheckoutParams;
462
- /** Information required for generating a custom URL for a Wix Events checkout. */
463
- eventsCheckout?: RedirectSessionEventsCheckoutParams;
464
- /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
465
- paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
466
- /** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
467
- login?: RedirectSessionLoginParams;
468
- /** 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. */
469
- logout?: RedirectSessionLogoutParams;
470
- /** Information required for generating a custom URL for Wix authentication. */
471
- auth?: RedirectSessionAuthParams;
472
- /** Information required for generating a custom URL for a Wix stores product page. */
473
- storesProduct?: RedirectSessionStoresProductParams;
474
- /** Information required for generating a custom URL for Wix bookings book page. */
475
- bookingsBook?: RedirectSessionBookingsBookParams;
476
- /**
477
- * Details of pages to redirect the visitor back to on the Wix Headless client site.
478
- *
479
- * **Note**: For an authentication redirect, don't pass a post-flow URL here. Instead, pass one in `options.auth.authRequest.redirectUri`.
480
- */
481
- callbacks?: CallbackParams;
482
- /** Optional preferences for customizing redirection to Wix pages. */
483
- preferences?: RedirectSessionPreferences;
484
- }
485
-
486
1
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
487
2
  interface HttpClient {
488
3
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
489
6
  }
490
7
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
491
8
  type HttpResponse<T = any> = {
@@ -511,18 +28,26 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
511
28
  __type: 'event-definition';
512
29
  type: Type;
513
30
  isDomainEvent?: boolean;
514
- transformations?: unknown;
31
+ transformations?: (envelope: unknown) => Payload;
515
32
  __payload: Payload;
516
33
  };
517
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
34
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
518
35
  type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
519
36
  type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
520
37
 
521
- declare function createRedirectSession$1(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<CreateRedirectSessionResponse & CreateRedirectSessionResponseNonNullableFields>;
522
- declare const onRedirectSessionCreated$1: EventDefinition<RedirectSessionCreatedEnvelope, "wix.headless.v1.redirect_session_created">;
38
+ declare global {
39
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
40
+ interface SymbolConstructor {
41
+ readonly observable: symbol;
42
+ }
43
+ }
44
+
45
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
46
+
47
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
523
48
 
524
- declare const createRedirectSession: BuildRESTFunction<typeof createRedirectSession$1>;
525
- declare const onRedirectSessionCreated: BuildEventDefinition<typeof onRedirectSessionCreated$1>;
49
+ declare const createRedirectSession: ReturnType<typeof createRESTModule<typeof publicCreateRedirectSession>>;
50
+ declare const onRedirectSessionCreated: ReturnType<typeof createEventModule<typeof publicOnRedirectSessionCreated>>;
526
51
 
527
52
  declare const context_createRedirectSession: typeof createRedirectSession;
528
53
  declare const context_onRedirectSessionCreated: typeof onRedirectSessionCreated;
@@ -543,6 +543,9 @@ interface DomainEventBodyOneOf {
543
543
  interface EntityCreatedEvent {
544
544
  entity?: string;
545
545
  }
546
+ interface RestoreInfo {
547
+ deletedDate?: Date;
548
+ }
546
549
  interface EntityUpdatedEvent {
547
550
  /**
548
551
  * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
@@ -689,6 +692,8 @@ interface CreateRedirectSessionOptions extends CreateRedirectSessionRequestInten
689
692
 
690
693
  interface HttpClient {
691
694
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
695
+ fetchWithAuth: typeof fetch;
696
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
692
697
  }
693
698
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
694
699
  type HttpResponse<T = any> = {
@@ -713,10 +718,17 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
713
718
  __type: 'event-definition';
714
719
  type: Type;
715
720
  isDomainEvent?: boolean;
716
- transformations?: unknown;
721
+ transformations?: (envelope: unknown) => Payload;
717
722
  __payload: Payload;
718
723
  };
719
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
724
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
725
+
726
+ declare global {
727
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
728
+ interface SymbolConstructor {
729
+ readonly observable: symbol;
730
+ }
731
+ }
720
732
 
721
733
  declare const __metadata: {
722
734
  PACKAGE_NAME: string;
@@ -770,6 +782,7 @@ type index_d_RedirectSessionMembersAccountParams = RedirectSessionMembersAccount
770
782
  type index_d_RedirectSessionPaidPlansCheckoutParams = RedirectSessionPaidPlansCheckoutParams;
771
783
  type index_d_RedirectSessionPreferences = RedirectSessionPreferences;
772
784
  type index_d_RedirectSessionStoresProductParams = RedirectSessionStoresProductParams;
785
+ type index_d_RestoreInfo = RestoreInfo;
773
786
  type index_d_SignInURLRequest = SignInURLRequest;
774
787
  type index_d_SignInURLResponse = SignInURLResponse;
775
788
  type index_d_Slot = Slot;
@@ -785,7 +798,7 @@ declare const index_d___metadata: typeof __metadata;
785
798
  declare const index_d_createRedirectSession: typeof createRedirectSession;
786
799
  declare const index_d_onRedirectSessionCreated: typeof onRedirectSessionCreated;
787
800
  declare namespace index_d {
788
- export { type index_d_ActionEvent as ActionEvent, 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_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, 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, index_d___metadata as __metadata, index_d_createRedirectSession as createRedirectSession, index_d_onRedirectSessionCreated as onRedirectSessionCreated };
801
+ export { type index_d_ActionEvent as ActionEvent, 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, 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, index_d___metadata as __metadata, index_d_createRedirectSession as createRedirectSession, index_d_onRedirectSessionCreated as onRedirectSessionCreated };
789
802
  }
790
803
 
791
804
  export { index_d as redirects };