@wix/redirects 1.0.0 → 1.0.2

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.
Files changed (25) hide show
  1. package/build/cjs/src/headless-v1-redirect-session.http.d.ts +12 -1
  2. package/build/cjs/src/headless-v1-redirect-session.http.js +12 -1
  3. package/build/cjs/src/headless-v1-redirect-session.http.js.map +1 -1
  4. package/build/cjs/src/headless-v1-redirect-session.public.d.ts +2 -2
  5. package/build/cjs/src/headless-v1-redirect-session.public.js +2 -1
  6. package/build/cjs/src/headless-v1-redirect-session.public.js.map +1 -1
  7. package/build/cjs/src/headless-v1-redirect-session.types.d.ts +96 -38
  8. package/build/cjs/src/headless-v1-redirect-session.types.js +14 -1
  9. package/build/cjs/src/headless-v1-redirect-session.types.js.map +1 -1
  10. package/build/cjs/src/headless-v1-redirect-session.universal.d.ts +115 -48
  11. package/build/cjs/src/headless-v1-redirect-session.universal.js +24 -2
  12. package/build/cjs/src/headless-v1-redirect-session.universal.js.map +1 -1
  13. package/build/es/src/headless-v1-redirect-session.http.d.ts +12 -1
  14. package/build/es/src/headless-v1-redirect-session.http.js +12 -1
  15. package/build/es/src/headless-v1-redirect-session.http.js.map +1 -1
  16. package/build/es/src/headless-v1-redirect-session.public.d.ts +2 -2
  17. package/build/es/src/headless-v1-redirect-session.public.js +1 -1
  18. package/build/es/src/headless-v1-redirect-session.public.js.map +1 -1
  19. package/build/es/src/headless-v1-redirect-session.types.d.ts +96 -38
  20. package/build/es/src/headless-v1-redirect-session.types.js +13 -0
  21. package/build/es/src/headless-v1-redirect-session.types.js.map +1 -1
  22. package/build/es/src/headless-v1-redirect-session.universal.d.ts +115 -48
  23. package/build/es/src/headless-v1-redirect-session.universal.js +23 -1
  24. package/build/es/src/headless-v1-redirect-session.universal.js.map +1 -1
  25. package/package.json +2 -2
@@ -1,4 +1,15 @@
1
1
  import { RequestOptionsFactory } from '@wix/sdk-types';
2
2
  import { CreateRedirectSessionRequest, CreateRedirectSessionResponse } from './headless-v1-redirect-session.types';
3
- /** Creates a new WixUrl */
3
+ /**
4
+ * Creates a URL for redirecting a visitor or member from an external Wix Headless client site to a Wix page for Wix-managed functionality.
5
+ *
6
+ *
7
+ * The Create Redirect Session endpoint enables your external Wix Headless client site, built on any platform, to let Wix take care of frontend functionality for specific processes,
8
+ * including authentication, as well as checkouts for bookings, eCommerce, events, and paid plans.
9
+ *
10
+ * For each purpose, call Create Redirect Session with the relevant information to enable Wix to take care of one specific process, and provide a callback URL, so Wix can redirect
11
+ * the user back to the appropriate page on your site.
12
+ *
13
+ * Redirect your visitor or member to the URL provided in the response, which includes query parameters informing Wix where to redirect the visitor or member back to on the Wix Headless client site
14
+ */
4
15
  export declare function createRedirectSession(payload: CreateRedirectSessionRequest): RequestOptionsFactory<CreateRedirectSessionResponse>;
@@ -22,7 +22,18 @@ function resolveWixHeadlessV1RedirectSessionServiceUrl(opts) {
22
22
  };
23
23
  return (0, metro_runtime_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
24
24
  }
25
- /** Creates a new WixUrl */
25
+ /**
26
+ * Creates a URL for redirecting a visitor or member from an external Wix Headless client site to a Wix page for Wix-managed functionality.
27
+ *
28
+ *
29
+ * The Create Redirect Session endpoint enables your external Wix Headless client site, built on any platform, to let Wix take care of frontend functionality for specific processes,
30
+ * including authentication, as well as checkouts for bookings, eCommerce, events, and paid plans.
31
+ *
32
+ * For each purpose, call Create Redirect Session with the relevant information to enable Wix to take care of one specific process, and provide a callback URL, so Wix can redirect
33
+ * the user back to the appropriate page on your site.
34
+ *
35
+ * Redirect your visitor or member to the URL provided in the response, which includes query parameters informing Wix where to redirect the visitor or member back to on the Wix Headless client site
36
+ */
26
37
  function createRedirectSession(payload) {
27
38
  const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createRedirectSessionRequest, {});
28
39
  const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_createRedirectSessionResponse, {});
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.http.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.http.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,sDAAgD;AAQhD,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,SAAS,6CAA6C,CACpD,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,2BAA2B;AAC3B,SAAgB,qBAAqB,CACnC,OAAqC;IAErC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EACrD,6BAA6B,EAC7B,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;IAE7E,SAAS,uBAAuB,CAAC,EAAE,IAAI,EAAO;QAC5C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,kCAAkC;YAC9C,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,8DAA8D;YACzE,GAAG,EAAE,6CAA6C,CAAC;gBACjD,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,uBAAuB,CAAC,OAAO,GAAG,OAAO,CAAC;IAE1C,OAAO,uBAAuB,CAAC;AACjC,CAAC;AA9BD,sDA8BC"}
1
+ {"version":3,"file":"headless-v1-redirect-session.http.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.http.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,sDAAgD;AAQhD,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,SAAS,6CAA6C,CACpD,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,qBAAqB,CACnC,OAAqC;IAErC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EACrD,6BAA6B,EAC7B,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;IAE7E,SAAS,uBAAuB,CAAC,EAAE,IAAI,EAAO;QAC5C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,kCAAkC;YAC9C,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,8DAA8D;YACzE,GAAG,EAAE,6CAA6C,CAAC;gBACjD,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,uBAAuB,CAAC,OAAO,GAAG,OAAO,CAAC;IAE1C,OAAO,uBAAuB,CAAC;AACjC,CAAC;AA9BD,sDA8BC"}
@@ -4,5 +4,5 @@ export declare const __metadata: {
4
4
  PACKAGE_NAME: string;
5
5
  };
6
6
  export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions | undefined) => Promise<import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponse>;
7
- export { LocationType, CallbackType, } from './headless-v1-redirect-session.universal';
8
- export { RedirectSession, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionAuthorizeParams, AuthorizeRequest, RedirectSessionLogoutParams, RedirectSessionAuthParams, CallbackParams, RedirectSessionPreferences, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
7
+ export { LocationType, MembersAccountSection, CallbackType, } from './headless-v1-redirect-session.universal';
8
+ export { RedirectSession, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionAuthorizeParams, AuthorizeRequest, RedirectSessionLogoutParams, RedirectSessionAuthParams, RedirectSessionMembersAccountParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CallbackType = exports.LocationType = exports.createRedirectSession = exports.__metadata = void 0;
3
+ exports.CallbackType = exports.MembersAccountSection = exports.LocationType = exports.createRedirectSession = exports.__metadata = void 0;
4
4
  const headless_v1_redirect_session_universal_1 = require("./headless-v1-redirect-session.universal");
5
5
  exports.__metadata = { PACKAGE_NAME: '@wix/redirects' };
6
6
  function createRedirectSession(httpClient) {
@@ -11,5 +11,6 @@ function createRedirectSession(httpClient) {
11
11
  exports.createRedirectSession = createRedirectSession;
12
12
  var headless_v1_redirect_session_universal_2 = require("./headless-v1-redirect-session.universal");
13
13
  Object.defineProperty(exports, "LocationType", { enumerable: true, get: function () { return headless_v1_redirect_session_universal_2.LocationType; } });
14
+ Object.defineProperty(exports, "MembersAccountSection", { enumerable: true, get: function () { return headless_v1_redirect_session_universal_2.MembersAccountSection; } });
14
15
  Object.defineProperty(exports, "CallbackType", { enumerable: true, get: function () { return headless_v1_redirect_session_universal_2.CallbackType; } });
15
16
  //# sourceMappingURL=headless-v1-redirect-session.public.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.public.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.public.ts"],"names":[],"mappings":";;;AACA,qGAGkD;AAErC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE7D,SAAgB,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,CAAC,OAAsC,EAAE,EAAE,CAChD,IAAA,8DAA8B,EAC5B,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,sDAOC;AAED,mGAGkD;AAFhD,sIAAA,YAAY,OAAA;AACZ,sIAAA,YAAY,OAAA"}
1
+ {"version":3,"file":"headless-v1-redirect-session.public.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.public.ts"],"names":[],"mappings":";;;AACA,qGAGkD;AAErC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE7D,SAAgB,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,CAAC,OAAsC,EAAE,EAAE,CAChD,IAAA,8DAA8B,EAC5B,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,sDAOC;AAED,mGAIkD;AAHhD,sIAAA,YAAY,OAAA;AACZ,+IAAA,qBAAqB,OAAA;AACrB,sIAAA,YAAY,OAAA"}
@@ -1,56 +1,56 @@
1
- /** WixUrl is the main entity of WixUrlService that can be used for lorem ipsum dolor */
1
+ /** Information for redirecting a visitor or member from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
2
2
  export interface RedirectSession {
3
- /** A guid representing the redirect session (for future use) */
3
+ /** ID of the redirect session created. */
4
4
  id?: string;
5
5
  /**
6
- * The Wix URL to redirect into
6
+ * The full URL of the Wix page to redirect the visitor or member to. This URL includes query parameters informing Wix where to redirect the visitor or member back to on the Wix Headless client site.
7
7
  * @readonly
8
8
  */
9
9
  fullUrl?: string;
10
10
  }
11
11
  export interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf {
12
- /** The parameters used in order to generate the URL into the Bookings checkout flow */
12
+ /** Information required for generating a custom URL for a Wix Bookings checkout. */
13
13
  bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
14
- /** The parameters used in order to generate the URL into the Ecom checkout flow */
14
+ /** Information required for generating a custom URL for a Wix eCommerce checkout. */
15
15
  ecomCheckout?: RedirectSessionEcomCheckoutParams;
16
- /** The parameters used in order to generate the URL into the events checkout flow */
16
+ /** Information required for generating a custom URL for a Wix Events checkout. */
17
17
  eventsCheckout?: RedirectSessionEventsCheckoutParams;
18
- /** The parameters used in order to generate the URL into the paid plans checkout flow */
18
+ /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
19
19
  paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
20
- /** The parameters used in order to generate the URL into the Wix login page */
20
+ /** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
21
21
  login?: RedirectSessionLoginParams;
22
- /** The parameters used in order to generate the URL to logout from Wix (invalidate token and clear cookies on wix domain) */
22
+ /** 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. */
23
23
  logout?: RedirectSessionLogoutParams;
24
- /** The parameters used in order to generate the URL into the authorize page */
24
+ /** Information required for generating a custom URL for Wix authentication. */
25
25
  auth?: RedirectSessionAuthParams;
26
- /** The callbacks (URL) allowing the definition of the pages which should be redirected back to the original site during the flow initiated in Wix */
26
+ /** Details of pages to redirect the visitor or member back to on the Wix Headless client site. **Note:** When redirecting for authentication, do not pass a callback URL here. */
27
27
  callbacks?: CallbackParams;
28
- /** Redirect sessions options */
28
+ /** Optional preferences for customizing redirection to Wix pages. */
29
29
  preferences?: RedirectSessionPreferences;
30
30
  }
31
31
  /** @oneof */
32
32
  export interface CreateRedirectSessionRequestIntentOneOf {
33
- /** The parameters used in order to generate the URL into the Bookings checkout flow */
33
+ /** Information required for generating a custom URL for a Wix Bookings checkout. */
34
34
  bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
35
- /** The parameters used in order to generate the URL into the Ecom checkout flow */
35
+ /** Information required for generating a custom URL for a Wix eCommerce checkout. */
36
36
  ecomCheckout?: RedirectSessionEcomCheckoutParams;
37
- /** The parameters used in order to generate the URL into the events checkout flow */
37
+ /** Information required for generating a custom URL for a Wix Events checkout. */
38
38
  eventsCheckout?: RedirectSessionEventsCheckoutParams;
39
- /** The parameters used in order to generate the URL into the paid plans checkout flow */
39
+ /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
40
40
  paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
41
- /** The parameters used in order to generate the URL into the Wix login page */
41
+ /** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
42
42
  login?: RedirectSessionLoginParams;
43
- /** The parameters used in order to generate the URL to logout from Wix (invalidate token and clear cookies on wix domain) */
43
+ /** 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. */
44
44
  logout?: RedirectSessionLogoutParams;
45
- /** The parameters used in order to generate the URL into the authorize page */
45
+ /** Information required for generating a custom URL for Wix authentication. */
46
46
  auth?: RedirectSessionAuthParams;
47
47
  }
48
48
  export interface RedirectSessionBookingsCheckoutParams {
49
- /** The timezone used for presentation and formatting when presenting the selected slot in a human readable format */
49
+ /** 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`. */
50
50
  timezone?: string;
51
- /** (Required) The ID of the service used in order to select the slot */
51
+ /** *Required.** ID of the service for which to select the slot. Use [Query Services](https://dev.wix.com/api/rest/wix-bookings/services-v2/query-services) to obtain a service ID. */
52
52
  serviceId?: string;
53
- /** (Required) The selected calendar slots to checkout */
53
+ /** *Required.** The calendar slot to check out. */
54
54
  slotAvailability?: SlotAvailability;
55
55
  }
56
56
  export interface SlotAvailability {
@@ -179,19 +179,22 @@ export interface BookingPolicyViolations {
179
179
  bookOnlineDisabled?: boolean | null;
180
180
  }
181
181
  export interface RedirectSessionEcomCheckoutParams {
182
- /** (Required) The ID of the checkout entity used in order to start the checkout with */
182
+ /** *Required.** ID of the checkout to process. Use [Create Checkout From Cart](https://dev.wix.com/api/rest/wix-ecommerce/cart/create-checkout-from-cart) to create a checkout and obtain an ID. */
183
183
  checkoutId?: string;
184
184
  }
185
185
  export interface RedirectSessionEventsCheckoutParams {
186
- /** (Required) The ID of the selected event */
186
+ /** *Required.** ID of the temporary event reservation. Use [Create Reservation](https://dev.wix.com/api/rest/wix-events/wix-events/checkout/create-reservation) to reserve a ticket temporarily and obtain a reservation ID. */
187
187
  reservationId?: string;
188
- /** (Required) The slug of the selected event (url friendly name) */
188
+ /** *Required.** URL-friendly event slug, generated from the event title of the event. For example, `my-event-4`. Use [Query Events](https://dev.wix.com/api/rest/wix-events/wix-events/event/query-events) to obtain an event slug. */
189
189
  eventSlug?: string;
190
190
  }
191
191
  export interface RedirectSessionPaidPlansCheckoutParams {
192
- /** (Required) The ID of the selected paid plan */
192
+ /** *Required.** ID of the paid plan selected. Use [Query Public Plans](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/query-public-plans) to obtain a paid plan ID. */
193
193
  planId?: string;
194
- /** The encoded string representing the navigation defined for the end of the flow, probably received by wix site when navigating to headless */
194
+ /**
195
+ * For use when pricing plan selection is part of a checkout flow and the paid plan selection page is implemented on the external Wix Headless client site.
196
+ * In this case, a string is passed to the external pricing plans page as `checkoutData` query parameter. Pass this string here when redirecting back to Wix.
197
+ */
195
198
  checkoutData?: string | null;
196
199
  }
197
200
  export interface RedirectSessionLoginParams {
@@ -251,33 +254,88 @@ export interface AuthorizeRequest {
251
254
  errorDescription?: string | null;
252
255
  }
253
256
  export interface RedirectSessionLogoutParams {
254
- /** (Required) The oauth app id used */
257
+ /** *Required.** ID of the OAuth app authorizing the client. */
255
258
  clientId?: string;
256
259
  }
257
260
  export interface RedirectSessionAuthParams {
258
- /** (Required) The authorization request to be sent to the authorization server */
261
+ /** *Required.** The authorization request to send to the authorization server. */
259
262
  authRequest?: AuthorizeRequest;
260
263
  }
264
+ export interface RedirectSessionMembersAccountParams {
265
+ /**
266
+ * The member account page to redirect to.
267
+ *
268
+ * Default: `ACCOUNT_INFO`
269
+ */
270
+ section?: MembersAccountSection;
271
+ }
272
+ export declare enum MembersAccountSection {
273
+ /** default - account info section in "my account" */
274
+ ACCOUNT_INFO = "ACCOUNT_INFO",
275
+ /** My Bookings section in "my account" */
276
+ BOOKINGS = "BOOKINGS",
277
+ /** My Orders section in "my account" */
278
+ ORDERS = "ORDERS",
279
+ /** Subscriptions section in "my account" */
280
+ SUBSCRIPTIONS = "SUBSCRIPTIONS",
281
+ /** Events section in "my account" */
282
+ EVENTS = "EVENTS"
283
+ }
261
284
  export interface CallbackParams {
262
- /** An external thank you page URL, used when the thank you page is implemented outside of Wix */
285
+ /**
286
+ * The URL for a custom thank you page implemented on a site outside of Wix. The visitor or member is directed to this page at the end of the Wix-managed process.
287
+ * If the process is abandoned or interrupted, the visitor or member is redirected to the URL specified in `postFlowUrl`.
288
+ *
289
+ * Default: If you don't pass a URL, the visitor or member is redirected to a Wix thank you page, and from there to the URL specified in `postFlowUrl`.
290
+ */
263
291
  thankYouPageUrl?: string | null;
264
- /** The external home page URL, used in order to indicate where to redirect to at the end of the flow (after thank you page/error) */
292
+ /**
293
+ * The URL Wix should redirect the visitor or member to when the Wix-managed process is completed, abandoned, or interrupted.
294
+ *
295
+ * **Note**: For an authentication redirect, you don't need to pass a URL here. Instead, pass one in `auth.authRequest.redirectUri`.
296
+ */
265
297
  postFlowUrl?: string | null;
266
- /** An external pricing plans page URL, used in case the checkout allows payment with a paid plans */
267
- plansListUrl?: string | null;
268
- /** An external login page in case login form is implemented outside Wix */
298
+ /**
299
+ * The URL for a custom login page implemented outside of Wix.
300
+ *
301
+ * Default: If you don't pass a URL, a Wix login page is used.
302
+ */
269
303
  loginUrl?: string | null;
270
- /** An external service list page URL (Bookings Services), used when the services page is implemented outside of Wix */
304
+ /**
305
+ * The URL for a custom bookings services page implemented outside of Wix.
306
+ *
307
+ * Default: If you don't pass a URL, a Wix bookings services page is used.
308
+ */
271
309
  bookingsServiceListUrl?: string | null;
272
- /** An external cart page URL, used when the cart page is implemented outside of Wix */
310
+ /**
311
+ * The URL for a custom eCommerce cart page implemented outside of Wix.
312
+ *
313
+ * Default: If you don't pass a URL, a Wix cart page is used.
314
+ */
273
315
  cartPageUrl?: string | null;
316
+ /**
317
+ * The URL for a custom pricing plans page implemented outside of Wix.
318
+ *
319
+ * Default: If you don't pass a URL, a Wix pricing plans page is used.
320
+ */
321
+ planListUrl?: string | null;
274
322
  }
275
323
  export interface RedirectSessionPreferences {
276
- /** (Default: true) - Define whether the base wix site should be used or the template site for all checkouts */
324
+ /**
325
+ * Whether to use a standard Wix template for Wix pages to which the visitor is redirected. Set to `false` only for a client of a Wix site with custom pages.
326
+ *
327
+ * Default: `true`
328
+ */
277
329
  useGenericWixPages?: boolean | null;
278
330
  }
331
+ export interface CustomMemberPaths {
332
+ /** 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. */
333
+ accountPagePath?: string | null;
334
+ /** 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. */
335
+ profilePagePath?: string | null;
336
+ }
279
337
  export interface CreateRedirectSessionResponse {
280
- /** The Wix URL details to redirect into */
338
+ /** Details for redirecting the visitor or member to a Wix page. */
281
339
  redirectSession?: RedirectSession;
282
340
  }
283
341
  export interface ValidateCallbackURLRequest {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CallbackType = exports.LocationType = void 0;
3
+ exports.CallbackType = exports.MembersAccountSection = exports.LocationType = void 0;
4
4
  var LocationType;
5
5
  (function (LocationType) {
6
6
  LocationType["UNDEFINED"] = "UNDEFINED";
@@ -8,6 +8,19 @@ var LocationType;
8
8
  LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
9
9
  LocationType["CUSTOM"] = "CUSTOM";
10
10
  })(LocationType = exports.LocationType || (exports.LocationType = {}));
11
+ var MembersAccountSection;
12
+ (function (MembersAccountSection) {
13
+ /** default - account info section in "my account" */
14
+ MembersAccountSection["ACCOUNT_INFO"] = "ACCOUNT_INFO";
15
+ /** My Bookings section in "my account" */
16
+ MembersAccountSection["BOOKINGS"] = "BOOKINGS";
17
+ /** My Orders section in "my account" */
18
+ MembersAccountSection["ORDERS"] = "ORDERS";
19
+ /** Subscriptions section in "my account" */
20
+ MembersAccountSection["SUBSCRIPTIONS"] = "SUBSCRIPTIONS";
21
+ /** Events section in "my account" */
22
+ MembersAccountSection["EVENTS"] = "EVENTS";
23
+ })(MembersAccountSection = exports.MembersAccountSection || (exports.MembersAccountSection = {}));
11
24
  var CallbackType;
12
25
  (function (CallbackType) {
13
26
  /** Invalid value - default */
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":";;;AAqKA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AA+ID,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8BAA8B;IAC9B,mCAAmB,CAAA;IACnB,mDAAmD;IACnD,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,qCAAqB,CAAA;IACrB,sDAAsD;IACtD,uCAAuB,CAAA;AACzB,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB"}
1
+ {"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":";;;AAqKA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAyHD,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC/B,qDAAqD;IACrD,sDAA6B,CAAA;IAC7B,0CAA0C;IAC1C,8CAAqB,CAAA;IACrB,wCAAwC;IACxC,0CAAiB,CAAA;IACjB,4CAA4C;IAC5C,wDAA+B,CAAA;IAC/B,qCAAqC;IACrC,0CAAiB,CAAA;AACnB,CAAC,EAXW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAWhC;AAwED,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8BAA8B;IAC9B,mCAAmB,CAAA;IACnB,mDAAmD;IACnD,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,qCAAqB,CAAA;IACrB,sDAAsD;IACtD,uCAAuB,CAAA;AACzB,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB"}
@@ -4,59 +4,59 @@ export declare const __debug: {
4
4
  off: () => boolean;
5
5
  };
6
6
  };
7
- /** WixUrl is the main entity of WixUrlService that can be used for lorem ipsum dolor */
7
+ /** Information for redirecting a visitor or member from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
8
8
  export interface RedirectSession {
9
- /** A guid representing the redirect session (for future use) */
9
+ /** ID of the redirect session created. */
10
10
  _id?: string;
11
11
  /**
12
- * The Wix URL to redirect into
12
+ * The full URL of the Wix page to redirect the visitor or member to. This URL includes query parameters informing Wix where to redirect the visitor or member back to on the Wix Headless client site.
13
13
  * @readonly
14
14
  */
15
15
  fullUrl?: string;
16
16
  }
17
17
  export interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf {
18
- /** The parameters used in order to generate the URL into the Bookings checkout flow */
18
+ /** Information required for generating a custom URL for a Wix Bookings checkout. */
19
19
  bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
20
- /** The parameters used in order to generate the URL into the Ecom checkout flow */
20
+ /** Information required for generating a custom URL for a Wix eCommerce checkout. */
21
21
  ecomCheckout?: RedirectSessionEcomCheckoutParams;
22
- /** The parameters used in order to generate the URL into the events checkout flow */
22
+ /** Information required for generating a custom URL for a Wix Events checkout. */
23
23
  eventsCheckout?: RedirectSessionEventsCheckoutParams;
24
- /** The parameters used in order to generate the URL into the paid plans checkout flow */
24
+ /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
25
25
  paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
26
- /** The parameters used in order to generate the URL into the Wix login page */
26
+ /** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
27
27
  login?: RedirectSessionLoginParams;
28
- /** The parameters used in order to generate the URL to logout from Wix (invalidate token and clear cookies on wix domain) */
28
+ /** 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. */
29
29
  logout?: RedirectSessionLogoutParams;
30
- /** The parameters used in order to generate the URL into the authorize page */
30
+ /** Information required for generating a custom URL for Wix authentication. */
31
31
  auth?: RedirectSessionAuthParams;
32
- /** The callbacks (URL) allowing the definition of the pages which should be redirected back to the original site during the flow initiated in Wix */
32
+ /** Details of pages to redirect the visitor or member back to on the Wix Headless client site. **Note:** When redirecting for authentication, do not pass a callback URL here. */
33
33
  callbacks?: CallbackParams;
34
- /** Redirect sessions options */
34
+ /** Optional preferences for customizing redirection to Wix pages. */
35
35
  preferences?: RedirectSessionPreferences;
36
36
  }
37
37
  /** @oneof */
38
38
  export interface CreateRedirectSessionRequestIntentOneOf {
39
- /** The parameters used in order to generate the URL into the Bookings checkout flow */
39
+ /** Information required for generating a custom URL for a Wix Bookings checkout. */
40
40
  bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
41
- /** The parameters used in order to generate the URL into the Ecom checkout flow */
41
+ /** Information required for generating a custom URL for a Wix eCommerce checkout. */
42
42
  ecomCheckout?: RedirectSessionEcomCheckoutParams;
43
- /** The parameters used in order to generate the URL into the events checkout flow */
43
+ /** Information required for generating a custom URL for a Wix Events checkout. */
44
44
  eventsCheckout?: RedirectSessionEventsCheckoutParams;
45
- /** The parameters used in order to generate the URL into the paid plans checkout flow */
45
+ /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
46
46
  paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
47
- /** The parameters used in order to generate the URL into the Wix login page */
47
+ /** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
48
48
  login?: RedirectSessionLoginParams;
49
- /** The parameters used in order to generate the URL to logout from Wix (invalidate token and clear cookies on wix domain) */
49
+ /** 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. */
50
50
  logout?: RedirectSessionLogoutParams;
51
- /** The parameters used in order to generate the URL into the authorize page */
51
+ /** Information required for generating a custom URL for Wix authentication. */
52
52
  auth?: RedirectSessionAuthParams;
53
53
  }
54
54
  export interface RedirectSessionBookingsCheckoutParams {
55
- /** The timezone used for presentation and formatting when presenting the selected slot in a human readable format */
55
+ /** 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`. */
56
56
  timezone?: string;
57
- /** (Required) The ID of the service used in order to select the slot */
57
+ /** *Required.** ID of the service for which to select the slot. Use [Query Services](https://dev.wix.com/api/rest/wix-bookings/services-v2/query-services) to obtain a service ID. */
58
58
  serviceId?: string;
59
- /** (Required) The selected calendar slots to checkout */
59
+ /** *Required.** The calendar slot to check out. */
60
60
  slotAvailability?: SlotAvailability;
61
61
  }
62
62
  export interface SlotAvailability {
@@ -185,19 +185,22 @@ export interface BookingPolicyViolations {
185
185
  bookOnlineDisabled?: boolean | null;
186
186
  }
187
187
  export interface RedirectSessionEcomCheckoutParams {
188
- /** (Required) The ID of the checkout entity used in order to start the checkout with */
188
+ /** *Required.** ID of the checkout to process. Use [Create Checkout From Cart](https://dev.wix.com/api/rest/wix-ecommerce/cart/create-checkout-from-cart) to create a checkout and obtain an ID. */
189
189
  checkoutId?: string;
190
190
  }
191
191
  export interface RedirectSessionEventsCheckoutParams {
192
- /** (Required) The ID of the selected event */
192
+ /** *Required.** ID of the temporary event reservation. Use [Create Reservation](https://dev.wix.com/api/rest/wix-events/wix-events/checkout/create-reservation) to reserve a ticket temporarily and obtain a reservation ID. */
193
193
  reservationId?: string;
194
- /** (Required) The slug of the selected event (url friendly name) */
194
+ /** *Required.** URL-friendly event slug, generated from the event title of the event. For example, `my-event-4`. Use [Query Events](https://dev.wix.com/api/rest/wix-events/wix-events/event/query-events) to obtain an event slug. */
195
195
  eventSlug?: string;
196
196
  }
197
197
  export interface RedirectSessionPaidPlansCheckoutParams {
198
- /** (Required) The ID of the selected paid plan */
198
+ /** *Required.** ID of the paid plan selected. Use [Query Public Plans](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/query-public-plans) to obtain a paid plan ID. */
199
199
  planId?: string;
200
- /** The encoded string representing the navigation defined for the end of the flow, probably received by wix site when navigating to headless */
200
+ /**
201
+ * For use when pricing plan selection is part of a checkout flow and the paid plan selection page is implemented on the external Wix Headless client site.
202
+ * In this case, a string is passed to the external pricing plans page as `checkoutData` query parameter. Pass this string here when redirecting back to Wix.
203
+ */
201
204
  checkoutData?: string | null;
202
205
  }
203
206
  export interface RedirectSessionLoginParams {
@@ -257,33 +260,88 @@ export interface AuthorizeRequest {
257
260
  errorDescription?: string | null;
258
261
  }
259
262
  export interface RedirectSessionLogoutParams {
260
- /** (Required) The oauth app id used */
263
+ /** *Required.** ID of the OAuth app authorizing the client. */
261
264
  clientId?: string;
262
265
  }
263
266
  export interface RedirectSessionAuthParams {
264
- /** (Required) The authorization request to be sent to the authorization server */
267
+ /** *Required.** The authorization request to send to the authorization server. */
265
268
  authRequest?: AuthorizeRequest;
266
269
  }
270
+ export interface RedirectSessionMembersAccountParams {
271
+ /**
272
+ * The member account page to redirect to.
273
+ *
274
+ * Default: `ACCOUNT_INFO`
275
+ */
276
+ section?: MembersAccountSection;
277
+ }
278
+ export declare enum MembersAccountSection {
279
+ /** default - account info section in "my account" */
280
+ ACCOUNT_INFO = "ACCOUNT_INFO",
281
+ /** My Bookings section in "my account" */
282
+ BOOKINGS = "BOOKINGS",
283
+ /** My Orders section in "my account" */
284
+ ORDERS = "ORDERS",
285
+ /** Subscriptions section in "my account" */
286
+ SUBSCRIPTIONS = "SUBSCRIPTIONS",
287
+ /** Events section in "my account" */
288
+ EVENTS = "EVENTS"
289
+ }
267
290
  export interface CallbackParams {
268
- /** An external thank you page URL, used when the thank you page is implemented outside of Wix */
291
+ /**
292
+ * The URL for a custom thank you page implemented on a site outside of Wix. The visitor or member is directed to this page at the end of the Wix-managed process.
293
+ * If the process is abandoned or interrupted, the visitor or member is redirected to the URL specified in `postFlowUrl`.
294
+ *
295
+ * Default: If you don't pass a URL, the visitor or member is redirected to a Wix thank you page, and from there to the URL specified in `postFlowUrl`.
296
+ */
269
297
  thankYouPageUrl?: string | null;
270
- /** The external home page URL, used in order to indicate where to redirect to at the end of the flow (after thank you page/error) */
298
+ /**
299
+ * The URL Wix should redirect the visitor or member to when the Wix-managed process is completed, abandoned, or interrupted.
300
+ *
301
+ * **Note**: For an authentication redirect, you don't need to pass a URL here. Instead, pass one in `auth.authRequest.redirectUri`.
302
+ */
271
303
  postFlowUrl?: string | null;
272
- /** An external pricing plans page URL, used in case the checkout allows payment with a paid plans */
273
- plansListUrl?: string | null;
274
- /** An external login page in case login form is implemented outside Wix */
304
+ /**
305
+ * The URL for a custom login page implemented outside of Wix.
306
+ *
307
+ * Default: If you don't pass a URL, a Wix login page is used.
308
+ */
275
309
  loginUrl?: string | null;
276
- /** An external service list page URL (Bookings Services), used when the services page is implemented outside of Wix */
310
+ /**
311
+ * The URL for a custom bookings services page implemented outside of Wix.
312
+ *
313
+ * Default: If you don't pass a URL, a Wix bookings services page is used.
314
+ */
277
315
  bookingsServiceListUrl?: string | null;
278
- /** An external cart page URL, used when the cart page is implemented outside of Wix */
316
+ /**
317
+ * The URL for a custom eCommerce cart page implemented outside of Wix.
318
+ *
319
+ * Default: If you don't pass a URL, a Wix cart page is used.
320
+ */
279
321
  cartPageUrl?: string | null;
322
+ /**
323
+ * The URL for a custom pricing plans page implemented outside of Wix.
324
+ *
325
+ * Default: If you don't pass a URL, a Wix pricing plans page is used.
326
+ */
327
+ planListUrl?: string | null;
280
328
  }
281
329
  export interface RedirectSessionPreferences {
282
- /** (Default: true) - Define whether the base wix site should be used or the template site for all checkouts */
330
+ /**
331
+ * Whether to use a standard Wix template for Wix pages to which the visitor is redirected. Set to `false` only for a client of a Wix site with custom pages.
332
+ *
333
+ * Default: `true`
334
+ */
283
335
  useGenericWixPages?: boolean | null;
284
336
  }
337
+ export interface CustomMemberPaths {
338
+ /** 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. */
339
+ accountPagePath?: string | null;
340
+ /** 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. */
341
+ profilePagePath?: string | null;
342
+ }
285
343
  export interface CreateRedirectSessionResponse {
286
- /** The Wix URL details to redirect into */
344
+ /** Details for redirecting the visitor or member to a Wix page. */
287
345
  redirectSession?: RedirectSession;
288
346
  }
289
347
  export interface ValidateCallbackURLRequest {
@@ -317,29 +375,38 @@ export interface SignInURLResponse {
317
375
  redirectSession?: RedirectSession;
318
376
  }
319
377
  /**
320
- * Creates a new WixUrl
378
+ * Creates a URL for redirecting a visitor or member from an external Wix Headless client site to a Wix page for Wix-managed functionality.
379
+ *
380
+ *
381
+ * The Create Redirect Session endpoint enables your external Wix Headless client site, built on any platform, to let Wix take care of frontend functionality for specific processes,
382
+ * including authentication, as well as checkouts for bookings, eCommerce, events, and paid plans.
383
+ *
384
+ * For each purpose, call Create Redirect Session with the relevant information to enable Wix to take care of one specific process, and provide a callback URL, so Wix can redirect
385
+ * the user back to the appropriate page on your site.
386
+ *
387
+ * Redirect your visitor or member to the URL provided in the response, which includes query parameters informing Wix where to redirect the visitor or member back to on the Wix Headless client site
321
388
  * @public
322
389
  * @documentationMaturity preview
323
390
  * @requiredField CreateRedirectSessionRequest
324
391
  */
325
392
  export declare function createRedirectSession(options?: CreateRedirectSessionOptions): Promise<CreateRedirectSessionResponse>;
326
393
  export interface CreateRedirectSessionOptions extends CreateRedirectSessionRequestIntentOneOf {
327
- /** The parameters used in order to generate the URL into the Bookings checkout flow */
394
+ /** Information required for generating a custom URL for a Wix Bookings checkout. */
328
395
  bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
329
- /** The parameters used in order to generate the URL into the Ecom checkout flow */
396
+ /** Information required for generating a custom URL for a Wix eCommerce checkout. */
330
397
  ecomCheckout?: RedirectSessionEcomCheckoutParams;
331
- /** The parameters used in order to generate the URL into the events checkout flow */
398
+ /** Information required for generating a custom URL for a Wix Events checkout. */
332
399
  eventsCheckout?: RedirectSessionEventsCheckoutParams;
333
- /** The parameters used in order to generate the URL into the paid plans checkout flow */
400
+ /** Information required for generating a custom URL for a Wix Paid Plans checkout. */
334
401
  paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
335
- /** The parameters used in order to generate the URL into the Wix login page */
402
+ /** Pass an empty object in this parameter to generate a URL for Wix login without first checking whether the visitor is authenticated. */
336
403
  login?: RedirectSessionLoginParams;
337
- /** The parameters used in order to generate the URL to logout from Wix (invalidate token and clear cookies on wix domain) */
404
+ /** 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. */
338
405
  logout?: RedirectSessionLogoutParams;
339
- /** The parameters used in order to generate the URL into the authorize page */
406
+ /** Information required for generating a custom URL for Wix authentication. */
340
407
  auth?: RedirectSessionAuthParams;
341
- /** The callbacks (URL) allowing the definition of the pages which should be redirected back to the original site during the flow initiated in Wix */
408
+ /** Details of pages to redirect the visitor or member back to on the Wix Headless client site. **Note:** When redirecting for authentication, do not pass a callback URL here. */
342
409
  callbacks?: CallbackParams;
343
- /** Redirect sessions options */
410
+ /** Optional preferences for customizing redirection to Wix pages. */
344
411
  preferences?: RedirectSessionPreferences;
345
412
  }