@wix/redirects 1.0.34 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context.d.ts +1 -0
- package/build/cjs/context.js +28 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/src/headless-v1-redirect-session.context.d.ts +3 -0
- package/build/cjs/src/headless-v1-redirect-session.context.js +16 -0
- package/build/cjs/src/headless-v1-redirect-session.context.js.map +1 -0
- package/build/cjs/src/headless-v1-redirect-session.public.d.ts +2 -1
- package/build/cjs/src/headless-v1-redirect-session.public.js +3 -1
- package/build/cjs/src/headless-v1-redirect-session.public.js.map +1 -1
- package/build/cjs/src/headless-v1-redirect-session.types.d.ts +57 -0
- package/build/cjs/src/headless-v1-redirect-session.types.js.map +1 -1
- package/build/cjs/src/headless-v1-redirect-session.universal.d.ts +92 -24
- package/build/cjs/src/headless-v1-redirect-session.universal.js +10 -15
- package/build/cjs/src/headless-v1-redirect-session.universal.js.map +1 -1
- package/build/es/context.d.ts +1 -0
- package/build/es/context.js +2 -0
- package/build/es/context.js.map +1 -0
- package/build/es/src/headless-v1-redirect-session.context.d.ts +3 -0
- package/build/es/src/headless-v1-redirect-session.context.js +12 -0
- package/build/es/src/headless-v1-redirect-session.context.js.map +1 -0
- package/build/es/src/headless-v1-redirect-session.public.d.ts +2 -1
- package/build/es/src/headless-v1-redirect-session.public.js +1 -0
- package/build/es/src/headless-v1-redirect-session.public.js.map +1 -1
- package/build/es/src/headless-v1-redirect-session.types.d.ts +57 -0
- package/build/es/src/headless-v1-redirect-session.types.js.map +1 -1
- package/build/es/src/headless-v1-redirect-session.universal.d.ts +92 -24
- package/build/es/src/headless-v1-redirect-session.universal.js +9 -14
- package/build/es/src/headless-v1-redirect-session.universal.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +7 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as redirects from './src/headless-v1-redirect-session.context';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.redirects = void 0;
|
|
27
|
+
exports.redirects = __importStar(require("./src/headless-v1-redirect-session.context"));
|
|
28
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wFAAwE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRedirectSession = void 0;
|
|
4
|
+
const headless_v1_redirect_session_public_1 = require("./headless-v1-redirect-session.public");
|
|
5
|
+
const createRedirectSession = (...args) => {
|
|
6
|
+
// @ts-expect-error
|
|
7
|
+
if (!globalThis.__wix_context__) {
|
|
8
|
+
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
|
|
9
|
+
}
|
|
10
|
+
// @ts-expect-error
|
|
11
|
+
return globalThis.__wix_context__
|
|
12
|
+
.initWixModules(headless_v1_redirect_session_public_1.createRedirectSession)
|
|
13
|
+
.apply(undefined, args);
|
|
14
|
+
};
|
|
15
|
+
exports.createRedirectSession = createRedirectSession;
|
|
16
|
+
//# sourceMappingURL=headless-v1-redirect-session.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless-v1-redirect-session.context.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.context.ts"],"names":[],"mappings":";;;AAAA,+FAA6G;AAGtG,MAAM,qBAAqB,GAE9B,CAAC,GAAG,IAAS,EAAE,EAAE;IACnB,mBAAmB;IACnB,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IACD,mBAAmB;IACnB,OAAO,UAAU,CAAC,eAAe;SAC9B,cAAc,CAAC,2DAA2B,CAAC;SAC3C,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC;AAbW,QAAA,qBAAqB,yBAahC"}
|
|
@@ -5,4 +5,5 @@ export declare const __metadata: {
|
|
|
5
5
|
};
|
|
6
6
|
export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponseNonNullableFields>;
|
|
7
7
|
export { LocationType, Prompt, MembersAccountSection, CallbackType, } from './headless-v1-redirect-session.universal';
|
|
8
|
-
export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
|
|
8
|
+
export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, RedirectSessionStoresProductParams, RedirectSessionBookingsBookParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainCreatedEvent, DomainDeletedEvent, DomainUpdatedEvent, DomainActionEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
|
|
9
|
+
export { onRedirectSessionCreated } 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.MembersAccountSection = exports.Prompt = exports.LocationType = exports.createRedirectSession = exports.__metadata = void 0;
|
|
3
|
+
exports.onRedirectSessionCreated = exports.CallbackType = exports.MembersAccountSection = exports.Prompt = 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) {
|
|
@@ -14,4 +14,6 @@ Object.defineProperty(exports, "LocationType", { enumerable: true, get: function
|
|
|
14
14
|
Object.defineProperty(exports, "Prompt", { enumerable: true, get: function () { return headless_v1_redirect_session_universal_2.Prompt; } });
|
|
15
15
|
Object.defineProperty(exports, "MembersAccountSection", { enumerable: true, get: function () { return headless_v1_redirect_session_universal_2.MembersAccountSection; } });
|
|
16
16
|
Object.defineProperty(exports, "CallbackType", { enumerable: true, get: function () { return headless_v1_redirect_session_universal_2.CallbackType; } });
|
|
17
|
+
var headless_v1_redirect_session_universal_3 = require("./headless-v1-redirect-session.universal");
|
|
18
|
+
Object.defineProperty(exports, "onRedirectSessionCreated", { enumerable: true, get: function () { return headless_v1_redirect_session_universal_3.onRedirectSessionCreated; } });
|
|
17
19
|
//# 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,mGAKkD;AAJhD,sIAAA,YAAY,OAAA;AACZ,gIAAA,MAAM,OAAA;AACN,+IAAA,qBAAqB,OAAA;AACrB,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,mGAKkD;AAJhD,sIAAA,YAAY,OAAA;AACZ,gIAAA,MAAM,OAAA;AACN,+IAAA,qBAAqB,OAAA;AACrB,sIAAA,YAAY,OAAA;AAiDd,mGAAoF;AAA3E,kJAAA,wBAAwB,OAAA"}
|
|
@@ -14,6 +14,11 @@ export interface RedirectSession {
|
|
|
14
14
|
* @readonly
|
|
15
15
|
*/
|
|
16
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;
|
|
17
22
|
}
|
|
18
23
|
export interface URLDetails {
|
|
19
24
|
/**
|
|
@@ -40,6 +45,10 @@ export interface CreateRedirectSessionRequest extends CreateRedirectSessionReque
|
|
|
40
45
|
logout?: RedirectSessionLogoutParams;
|
|
41
46
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
42
47
|
auth?: RedirectSessionAuthParams;
|
|
48
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
49
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
50
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
51
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
43
52
|
/**
|
|
44
53
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
45
54
|
* When redirecting to any callback URL, Wix passes the boolean `wixMemberLoggedIn` query parameter.
|
|
@@ -67,6 +76,10 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
67
76
|
logout?: RedirectSessionLogoutParams;
|
|
68
77
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
69
78
|
auth?: RedirectSessionAuthParams;
|
|
79
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
80
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
81
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
82
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
70
83
|
}
|
|
71
84
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
72
85
|
/**
|
|
@@ -325,6 +338,14 @@ export declare enum MembersAccountSection {
|
|
|
325
338
|
/** Events section in "my account" */
|
|
326
339
|
EVENTS = "EVENTS"
|
|
327
340
|
}
|
|
341
|
+
export interface RedirectSessionStoresProductParams {
|
|
342
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
343
|
+
productSlug?: string;
|
|
344
|
+
}
|
|
345
|
+
export interface RedirectSessionBookingsBookParams {
|
|
346
|
+
/** For use when filtering the bookings page by a specific resource. */
|
|
347
|
+
resourceId?: string;
|
|
348
|
+
}
|
|
328
349
|
export interface CallbackParams {
|
|
329
350
|
/**
|
|
330
351
|
* 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.
|
|
@@ -408,6 +429,41 @@ export interface CreateRedirectSessionResponse {
|
|
|
408
429
|
/** Details for redirecting the visitor to a Wix page. */
|
|
409
430
|
redirectSession?: RedirectSession;
|
|
410
431
|
}
|
|
432
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
433
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
434
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
435
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
436
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
437
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
438
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
439
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
440
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
441
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
442
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
443
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
444
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
445
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
446
|
+
preferences?: RedirectSessionPreferences;
|
|
447
|
+
}
|
|
448
|
+
/** @oneof */
|
|
449
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
450
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
451
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
452
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
453
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
454
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
455
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
456
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
457
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
458
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
459
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
460
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
461
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
462
|
+
}
|
|
463
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
464
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
465
|
+
redirectSession?: RedirectSession;
|
|
466
|
+
}
|
|
411
467
|
export interface ValidateCallbackURLRequest {
|
|
412
468
|
/** An external URL to validate */
|
|
413
469
|
callbackUrl?: string;
|
|
@@ -512,5 +568,6 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
512
568
|
urlDetails?: {
|
|
513
569
|
endpoint: string;
|
|
514
570
|
};
|
|
571
|
+
shortUrl: string;
|
|
515
572
|
};
|
|
516
573
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":";;;AA6MA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AA2HD,uDAAuD;AACvD,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,sBAAN,MAAM,QAKjB;AAWD,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,qCAArB,qBAAqB,QAWhC;AAmJD,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,4BAAZ,YAAY,QASvB"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
verboseLogging: {
|
|
3
|
-
on: () => boolean;
|
|
4
|
-
off: () => boolean;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
1
|
+
import { EventDefinition } from '@wix/sdk-types';
|
|
7
2
|
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
|
|
8
3
|
export interface RedirectSession {
|
|
9
4
|
/** ID of the redirect session created. */
|
|
@@ -20,6 +15,11 @@ export interface RedirectSession {
|
|
|
20
15
|
* @readonly
|
|
21
16
|
*/
|
|
22
17
|
sessionToken?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
shortUrl?: string;
|
|
23
23
|
}
|
|
24
24
|
export interface URLDetails {
|
|
25
25
|
/**
|
|
@@ -46,6 +46,10 @@ export interface CreateRedirectSessionRequest extends CreateRedirectSessionReque
|
|
|
46
46
|
logout?: RedirectSessionLogoutParams;
|
|
47
47
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
48
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;
|
|
49
53
|
/**
|
|
50
54
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
51
55
|
*
|
|
@@ -71,6 +75,10 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
71
75
|
logout?: RedirectSessionLogoutParams;
|
|
72
76
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
73
77
|
auth?: RedirectSessionAuthParams;
|
|
78
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
79
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
80
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
81
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
74
82
|
}
|
|
75
83
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
76
84
|
/**
|
|
@@ -329,6 +337,14 @@ export declare enum MembersAccountSection {
|
|
|
329
337
|
/** Events section in "my account" */
|
|
330
338
|
EVENTS = "EVENTS"
|
|
331
339
|
}
|
|
340
|
+
export interface RedirectSessionStoresProductParams {
|
|
341
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
342
|
+
productSlug?: string;
|
|
343
|
+
}
|
|
344
|
+
export interface RedirectSessionBookingsBookParams {
|
|
345
|
+
/** For use when filtering the bookings page by a specific resource. */
|
|
346
|
+
resourceId?: string;
|
|
347
|
+
}
|
|
332
348
|
export interface CallbackParams {
|
|
333
349
|
/**
|
|
334
350
|
* 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.
|
|
@@ -411,6 +427,41 @@ export interface CreateRedirectSessionResponse {
|
|
|
411
427
|
/** Details for redirecting the visitor to a Wix page. */
|
|
412
428
|
redirectSession?: RedirectSession;
|
|
413
429
|
}
|
|
430
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
431
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
432
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
433
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
434
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
435
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
436
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
437
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
438
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
439
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
440
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
441
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
442
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
443
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
444
|
+
preferences?: RedirectSessionPreferences;
|
|
445
|
+
}
|
|
446
|
+
/** @oneof */
|
|
447
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
448
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
449
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
450
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
451
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
452
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
453
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
454
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
455
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
456
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
457
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
458
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
459
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
460
|
+
}
|
|
461
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
462
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
463
|
+
redirectSession?: RedirectSession;
|
|
464
|
+
}
|
|
414
465
|
export interface ValidateCallbackURLRequest {
|
|
415
466
|
/** An external URL to validate */
|
|
416
467
|
callbackUrl?: string;
|
|
@@ -441,11 +492,11 @@ export interface SignInURLResponse {
|
|
|
441
492
|
/** The Wix URL details to redirect into */
|
|
442
493
|
redirectSession?: RedirectSession;
|
|
443
494
|
}
|
|
444
|
-
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
445
|
-
createdEvent?: EntityCreatedEvent
|
|
446
|
-
updatedEvent?: EntityUpdatedEvent
|
|
447
|
-
deletedEvent?: EntityDeletedEvent
|
|
448
|
-
actionEvent?: ActionEvent
|
|
495
|
+
export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
|
|
496
|
+
createdEvent?: EntityCreatedEvent<T>;
|
|
497
|
+
updatedEvent?: EntityUpdatedEvent<T>;
|
|
498
|
+
deletedEvent?: EntityDeletedEvent<T>;
|
|
499
|
+
actionEvent?: ActionEvent<T>;
|
|
449
500
|
/**
|
|
450
501
|
* Unique event ID.
|
|
451
502
|
* Allows clients to ignore duplicate webhooks.
|
|
@@ -483,30 +534,38 @@ export interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
483
534
|
*/
|
|
484
535
|
entityEventSequence?: string | null;
|
|
485
536
|
}
|
|
537
|
+
export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
|
|
538
|
+
}
|
|
539
|
+
export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
|
|
540
|
+
}
|
|
541
|
+
export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
|
|
542
|
+
}
|
|
543
|
+
export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
|
|
544
|
+
}
|
|
486
545
|
/** @oneof */
|
|
487
|
-
export interface DomainEventBodyOneOf {
|
|
488
|
-
createdEvent?: EntityCreatedEvent
|
|
489
|
-
updatedEvent?: EntityUpdatedEvent
|
|
490
|
-
deletedEvent?: EntityDeletedEvent
|
|
491
|
-
actionEvent?: ActionEvent
|
|
546
|
+
export interface DomainEventBodyOneOf<T> {
|
|
547
|
+
createdEvent?: EntityCreatedEvent<T>;
|
|
548
|
+
updatedEvent?: EntityUpdatedEvent<T>;
|
|
549
|
+
deletedEvent?: EntityDeletedEvent<T>;
|
|
550
|
+
actionEvent?: ActionEvent<T>;
|
|
492
551
|
}
|
|
493
|
-
export interface EntityCreatedEvent {
|
|
494
|
-
|
|
552
|
+
export interface EntityCreatedEvent<T> {
|
|
553
|
+
entity?: T;
|
|
495
554
|
}
|
|
496
|
-
export interface EntityUpdatedEvent {
|
|
555
|
+
export interface EntityUpdatedEvent<T> {
|
|
497
556
|
/**
|
|
498
557
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
499
558
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
500
559
|
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
501
560
|
*/
|
|
502
|
-
|
|
561
|
+
currentEntity?: T;
|
|
503
562
|
}
|
|
504
|
-
export interface EntityDeletedEvent {
|
|
563
|
+
export interface EntityDeletedEvent<T> {
|
|
505
564
|
/** Entity that was deleted */
|
|
506
|
-
|
|
565
|
+
deletedEntity?: T | null;
|
|
507
566
|
}
|
|
508
|
-
export interface ActionEvent {
|
|
509
|
-
|
|
567
|
+
export interface ActionEvent<T> {
|
|
568
|
+
body?: T;
|
|
510
569
|
}
|
|
511
570
|
export interface CreateRedirectSessionResponseNonNullableFields {
|
|
512
571
|
redirectSession?: {
|
|
@@ -515,8 +574,10 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
515
574
|
urlDetails?: {
|
|
516
575
|
endpoint: string;
|
|
517
576
|
};
|
|
577
|
+
shortUrl: string;
|
|
518
578
|
};
|
|
519
579
|
}
|
|
580
|
+
export declare const onRedirectSessionCreated: EventDefinition<DomainCreatedEvent<RedirectSession>, "wix.headless.v1.redirect_session_created">;
|
|
520
581
|
/**
|
|
521
582
|
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.
|
|
522
583
|
*
|
|
@@ -532,6 +593,9 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
532
593
|
* @public
|
|
533
594
|
* @documentationMaturity preview
|
|
534
595
|
* @param options - Options for creating a redirect session.
|
|
596
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
597
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
598
|
+
* @applicableIdentity APP
|
|
535
599
|
* @applicableIdentity MEMBER
|
|
536
600
|
* @applicableIdentity VISITOR
|
|
537
601
|
*/
|
|
@@ -551,6 +615,10 @@ export interface CreateRedirectSessionOptions extends CreateRedirectSessionReque
|
|
|
551
615
|
logout?: RedirectSessionLogoutParams;
|
|
552
616
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
553
617
|
auth?: RedirectSessionAuthParams;
|
|
618
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
619
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
620
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
621
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
554
622
|
/**
|
|
555
623
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
556
624
|
*
|
|
@@ -32,23 +32,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.createRedirectSession = exports.
|
|
35
|
+
exports.createRedirectSession = exports.onRedirectSessionCreated = exports.CallbackType = exports.MembersAccountSection = exports.Prompt = exports.LocationType = void 0;
|
|
36
36
|
const velo_1 = require("@wix/metro-runtime/velo");
|
|
37
37
|
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
38
|
+
const sdk_types_1 = require("@wix/sdk-types");
|
|
38
39
|
const ambassadorWixHeadlessV1RedirectSession = __importStar(require("./headless-v1-redirect-session.http"));
|
|
39
|
-
let __verbose = false;
|
|
40
|
-
function __log(...args) {
|
|
41
|
-
__verbose && console.log(...args);
|
|
42
|
-
}
|
|
43
|
-
function __inspect(obj) {
|
|
44
|
-
return obj;
|
|
45
|
-
}
|
|
46
|
-
exports.__debug = {
|
|
47
|
-
verboseLogging: {
|
|
48
|
-
on: () => (__verbose = true),
|
|
49
|
-
off: () => (__verbose = false),
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
40
|
const _toVeloEntity = '$';
|
|
53
41
|
const _fromVeloEntity = '$';
|
|
54
42
|
var LocationType;
|
|
@@ -92,6 +80,7 @@ var CallbackType;
|
|
|
92
80
|
})(CallbackType || (exports.CallbackType = CallbackType = {}));
|
|
93
81
|
const _createRedirectSessionRequest = {};
|
|
94
82
|
const _createRedirectSessionResponse = {};
|
|
83
|
+
exports.onRedirectSessionCreated = (0, sdk_types_1.EventDefinition)('wix.headless.v1.redirect_session_created')();
|
|
95
84
|
/**
|
|
96
85
|
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.
|
|
97
86
|
*
|
|
@@ -107,6 +96,9 @@ const _createRedirectSessionResponse = {};
|
|
|
107
96
|
* @public
|
|
108
97
|
* @documentationMaturity preview
|
|
109
98
|
* @param options - Options for creating a redirect session.
|
|
99
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
100
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
101
|
+
* @applicableIdentity APP
|
|
110
102
|
* @applicableIdentity MEMBER
|
|
111
103
|
* @applicableIdentity VISITOR
|
|
112
104
|
*/
|
|
@@ -121,6 +113,8 @@ function createRedirectSession(options) {
|
|
|
121
113
|
login: '$[0].login',
|
|
122
114
|
logout: '$[0].logout',
|
|
123
115
|
auth: '$[0].auth',
|
|
116
|
+
storesProduct: '$[0].storesProduct',
|
|
117
|
+
bookingsBook: '$[0].bookingsBook',
|
|
124
118
|
callbacks: '$[0].callbacks',
|
|
125
119
|
preferences: '$[0].preferences',
|
|
126
120
|
};
|
|
@@ -147,7 +141,6 @@ function createRedirectSession(options) {
|
|
|
147
141
|
});
|
|
148
142
|
const payload = toAmbassadorRequest([options]);
|
|
149
143
|
const reqOpts = ambassadorWixHeadlessV1RedirectSession.createRedirectSession(payload);
|
|
150
|
-
__log(`"CreateRedirectSession" sending request with: ${__inspect(reqOpts)}`);
|
|
151
144
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
152
145
|
try {
|
|
153
146
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -165,6 +158,8 @@ function createRedirectSession(options) {
|
|
|
165
158
|
login: '$[0].login',
|
|
166
159
|
logout: '$[0].logout',
|
|
167
160
|
auth: '$[0].auth',
|
|
161
|
+
storesProduct: '$[0].storesProduct',
|
|
162
|
+
bookingsBook: '$[0].bookingsBook',
|
|
168
163
|
callbacks: '$[0].callbacks',
|
|
169
164
|
preferences: '$[0].preferences',
|
|
170
165
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless-v1-redirect-session.universal.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqD;AACrD,sEAAuF;
|
|
1
|
+
{"version":3,"file":"headless-v1-redirect-session.universal.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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AAW,uBAAX,WAAW,CAAE,SAAS,4DAAG,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;QACtC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;gBACE,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE;oBACxB,gBAAgB,EAAE,uBAAuB;oBACzC,YAAY,EAAE,mBAAmB;oBACjC,cAAc,EAAE,qBAAqB;oBACrC,iBAAiB,EAAE,wBAAwB;oBAC3C,KAAK,EAAE,YAAY;oBACnB,MAAM,EAAE,aAAa;oBACrB,IAAI,EAAE,WAAW;oBACjB,aAAa,EAAE,oBAAoB;oBACnC,YAAY,EAAE,mBAAmB;oBACjC,SAAS,EAAE,gBAAgB;oBAC3B,WAAW,EAAE,kBAAkB;iBAChC;gBACD,uBAAuB,EAAE,KAAK;aAC/B,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;YACF,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,4DAAG,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;QACzB,CAAC;;CACF;AAnFD,sDAmFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as redirects from './src/headless-v1-redirect-session.context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRedirectSession as publicCreateRedirectSession } from './headless-v1-redirect-session.public';
|
|
2
|
+
export const createRedirectSession = (...args) => {
|
|
3
|
+
// @ts-expect-error
|
|
4
|
+
if (!globalThis.__wix_context__) {
|
|
5
|
+
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
|
|
6
|
+
}
|
|
7
|
+
// @ts-expect-error
|
|
8
|
+
return globalThis.__wix_context__
|
|
9
|
+
.initWixModules(publicCreateRedirectSession)
|
|
10
|
+
.apply(undefined, args);
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=headless-v1-redirect-session.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless-v1-redirect-session.context.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,IAAI,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAG7G,MAAM,CAAC,MAAM,qBAAqB,GAE9B,CAAC,GAAG,IAAS,EAAE,EAAE;IACnB,mBAAmB;IACnB,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IACD,mBAAmB;IACnB,OAAO,UAAU,CAAC,eAAe;SAC9B,cAAc,CAAC,2BAA2B,CAAC;SAC3C,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC"}
|
|
@@ -5,4 +5,5 @@ export declare const __metadata: {
|
|
|
5
5
|
};
|
|
6
6
|
export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponseNonNullableFields>;
|
|
7
7
|
export { LocationType, Prompt, MembersAccountSection, CallbackType, } from './headless-v1-redirect-session.universal';
|
|
8
|
-
export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
|
|
8
|
+
export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, RedirectSessionStoresProductParams, RedirectSessionBookingsBookParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainCreatedEvent, DomainDeletedEvent, DomainUpdatedEvent, DomainActionEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
|
|
9
|
+
export { onRedirectSessionCreated } from './headless-v1-redirect-session.universal';
|
|
@@ -6,4 +6,5 @@ export function createRedirectSession(httpClient) {
|
|
|
6
6
|
{ httpClient });
|
|
7
7
|
}
|
|
8
8
|
export { LocationType, Prompt, MembersAccountSection, CallbackType, } from './headless-v1-redirect-session.universal';
|
|
9
|
+
export { onRedirectSessionCreated } from './headless-v1-redirect-session.universal';
|
|
9
10
|
//# 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,OAAO,EAEL,qBAAqB,IAAI,8BAA8B,GACxD,MAAM,0CAA0C,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE7D,MAAM,UAAU,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,CAAC,OAAsC,EAAE,EAAE,CAChD,8BAA8B,CAC5B,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EACL,YAAY,EACZ,MAAM,EACN,qBAAqB,EACrB,YAAY,GACb,MAAM,0CAA0C,CAAC"}
|
|
1
|
+
{"version":3,"file":"headless-v1-redirect-session.public.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.public.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,qBAAqB,IAAI,8BAA8B,GACxD,MAAM,0CAA0C,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE7D,MAAM,UAAU,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,CAAC,OAAsC,EAAE,EAAE,CAChD,8BAA8B,CAC5B,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EACL,YAAY,EACZ,MAAM,EACN,qBAAqB,EACrB,YAAY,GACb,MAAM,0CAA0C,CAAC;AAgDlD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -14,6 +14,11 @@ export interface RedirectSession {
|
|
|
14
14
|
* @readonly
|
|
15
15
|
*/
|
|
16
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;
|
|
17
22
|
}
|
|
18
23
|
export interface URLDetails {
|
|
19
24
|
/**
|
|
@@ -40,6 +45,10 @@ export interface CreateRedirectSessionRequest extends CreateRedirectSessionReque
|
|
|
40
45
|
logout?: RedirectSessionLogoutParams;
|
|
41
46
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
42
47
|
auth?: RedirectSessionAuthParams;
|
|
48
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
49
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
50
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
51
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
43
52
|
/**
|
|
44
53
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
45
54
|
* When redirecting to any callback URL, Wix passes the boolean `wixMemberLoggedIn` query parameter.
|
|
@@ -67,6 +76,10 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
67
76
|
logout?: RedirectSessionLogoutParams;
|
|
68
77
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
69
78
|
auth?: RedirectSessionAuthParams;
|
|
79
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
80
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
81
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
82
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
70
83
|
}
|
|
71
84
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
72
85
|
/**
|
|
@@ -325,6 +338,14 @@ export declare enum MembersAccountSection {
|
|
|
325
338
|
/** Events section in "my account" */
|
|
326
339
|
EVENTS = "EVENTS"
|
|
327
340
|
}
|
|
341
|
+
export interface RedirectSessionStoresProductParams {
|
|
342
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
343
|
+
productSlug?: string;
|
|
344
|
+
}
|
|
345
|
+
export interface RedirectSessionBookingsBookParams {
|
|
346
|
+
/** For use when filtering the bookings page by a specific resource. */
|
|
347
|
+
resourceId?: string;
|
|
348
|
+
}
|
|
328
349
|
export interface CallbackParams {
|
|
329
350
|
/**
|
|
330
351
|
* 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.
|
|
@@ -408,6 +429,41 @@ export interface CreateRedirectSessionResponse {
|
|
|
408
429
|
/** Details for redirecting the visitor to a Wix page. */
|
|
409
430
|
redirectSession?: RedirectSession;
|
|
410
431
|
}
|
|
432
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
433
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
434
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
435
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
436
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
437
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
438
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
439
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
440
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
441
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
442
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
443
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
444
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
445
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
446
|
+
preferences?: RedirectSessionPreferences;
|
|
447
|
+
}
|
|
448
|
+
/** @oneof */
|
|
449
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
450
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
451
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
452
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
453
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
454
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
455
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
456
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
457
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
458
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
459
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
460
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
461
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
462
|
+
}
|
|
463
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
464
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
465
|
+
redirectSession?: RedirectSession;
|
|
466
|
+
}
|
|
411
467
|
export interface ValidateCallbackURLRequest {
|
|
412
468
|
/** An external URL to validate */
|
|
413
469
|
callbackUrl?: string;
|
|
@@ -512,5 +568,6 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
512
568
|
urlDetails?: {
|
|
513
569
|
endpoint: string;
|
|
514
570
|
};
|
|
571
|
+
shortUrl: string;
|
|
515
572
|
};
|
|
516
573
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":"AA6MA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AA2HD,uDAAuD;AACvD,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AAWD,MAAM,CAAN,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,KAArB,qBAAqB,QAWhC;AAmJD,MAAM,CAAN,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,KAAZ,YAAY,QASvB"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
verboseLogging: {
|
|
3
|
-
on: () => boolean;
|
|
4
|
-
off: () => boolean;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
1
|
+
import { EventDefinition } from '@wix/sdk-types';
|
|
7
2
|
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
|
|
8
3
|
export interface RedirectSession {
|
|
9
4
|
/** ID of the redirect session created. */
|
|
@@ -20,6 +15,11 @@ export interface RedirectSession {
|
|
|
20
15
|
* @readonly
|
|
21
16
|
*/
|
|
22
17
|
sessionToken?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
shortUrl?: string;
|
|
23
23
|
}
|
|
24
24
|
export interface URLDetails {
|
|
25
25
|
/**
|
|
@@ -46,6 +46,10 @@ export interface CreateRedirectSessionRequest extends CreateRedirectSessionReque
|
|
|
46
46
|
logout?: RedirectSessionLogoutParams;
|
|
47
47
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
48
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;
|
|
49
53
|
/**
|
|
50
54
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
51
55
|
*
|
|
@@ -71,6 +75,10 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
71
75
|
logout?: RedirectSessionLogoutParams;
|
|
72
76
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
73
77
|
auth?: RedirectSessionAuthParams;
|
|
78
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
79
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
80
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
81
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
74
82
|
}
|
|
75
83
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
76
84
|
/**
|
|
@@ -329,6 +337,14 @@ export declare enum MembersAccountSection {
|
|
|
329
337
|
/** Events section in "my account" */
|
|
330
338
|
EVENTS = "EVENTS"
|
|
331
339
|
}
|
|
340
|
+
export interface RedirectSessionStoresProductParams {
|
|
341
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
342
|
+
productSlug?: string;
|
|
343
|
+
}
|
|
344
|
+
export interface RedirectSessionBookingsBookParams {
|
|
345
|
+
/** For use when filtering the bookings page by a specific resource. */
|
|
346
|
+
resourceId?: string;
|
|
347
|
+
}
|
|
332
348
|
export interface CallbackParams {
|
|
333
349
|
/**
|
|
334
350
|
* 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.
|
|
@@ -411,6 +427,41 @@ export interface CreateRedirectSessionResponse {
|
|
|
411
427
|
/** Details for redirecting the visitor to a Wix page. */
|
|
412
428
|
redirectSession?: RedirectSession;
|
|
413
429
|
}
|
|
430
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
431
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
432
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
433
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
434
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
435
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
436
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
437
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
438
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
439
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
440
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
441
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
442
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
443
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
444
|
+
preferences?: RedirectSessionPreferences;
|
|
445
|
+
}
|
|
446
|
+
/** @oneof */
|
|
447
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
448
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
449
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
450
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
451
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
452
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
453
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
454
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
455
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
456
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
457
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
458
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
459
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
460
|
+
}
|
|
461
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
462
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
463
|
+
redirectSession?: RedirectSession;
|
|
464
|
+
}
|
|
414
465
|
export interface ValidateCallbackURLRequest {
|
|
415
466
|
/** An external URL to validate */
|
|
416
467
|
callbackUrl?: string;
|
|
@@ -441,11 +492,11 @@ export interface SignInURLResponse {
|
|
|
441
492
|
/** The Wix URL details to redirect into */
|
|
442
493
|
redirectSession?: RedirectSession;
|
|
443
494
|
}
|
|
444
|
-
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
445
|
-
createdEvent?: EntityCreatedEvent
|
|
446
|
-
updatedEvent?: EntityUpdatedEvent
|
|
447
|
-
deletedEvent?: EntityDeletedEvent
|
|
448
|
-
actionEvent?: ActionEvent
|
|
495
|
+
export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
|
|
496
|
+
createdEvent?: EntityCreatedEvent<T>;
|
|
497
|
+
updatedEvent?: EntityUpdatedEvent<T>;
|
|
498
|
+
deletedEvent?: EntityDeletedEvent<T>;
|
|
499
|
+
actionEvent?: ActionEvent<T>;
|
|
449
500
|
/**
|
|
450
501
|
* Unique event ID.
|
|
451
502
|
* Allows clients to ignore duplicate webhooks.
|
|
@@ -483,30 +534,38 @@ export interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
483
534
|
*/
|
|
484
535
|
entityEventSequence?: string | null;
|
|
485
536
|
}
|
|
537
|
+
export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
|
|
538
|
+
}
|
|
539
|
+
export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
|
|
540
|
+
}
|
|
541
|
+
export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
|
|
542
|
+
}
|
|
543
|
+
export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
|
|
544
|
+
}
|
|
486
545
|
/** @oneof */
|
|
487
|
-
export interface DomainEventBodyOneOf {
|
|
488
|
-
createdEvent?: EntityCreatedEvent
|
|
489
|
-
updatedEvent?: EntityUpdatedEvent
|
|
490
|
-
deletedEvent?: EntityDeletedEvent
|
|
491
|
-
actionEvent?: ActionEvent
|
|
546
|
+
export interface DomainEventBodyOneOf<T> {
|
|
547
|
+
createdEvent?: EntityCreatedEvent<T>;
|
|
548
|
+
updatedEvent?: EntityUpdatedEvent<T>;
|
|
549
|
+
deletedEvent?: EntityDeletedEvent<T>;
|
|
550
|
+
actionEvent?: ActionEvent<T>;
|
|
492
551
|
}
|
|
493
|
-
export interface EntityCreatedEvent {
|
|
494
|
-
|
|
552
|
+
export interface EntityCreatedEvent<T> {
|
|
553
|
+
entity?: T;
|
|
495
554
|
}
|
|
496
|
-
export interface EntityUpdatedEvent {
|
|
555
|
+
export interface EntityUpdatedEvent<T> {
|
|
497
556
|
/**
|
|
498
557
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
499
558
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
500
559
|
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
501
560
|
*/
|
|
502
|
-
|
|
561
|
+
currentEntity?: T;
|
|
503
562
|
}
|
|
504
|
-
export interface EntityDeletedEvent {
|
|
563
|
+
export interface EntityDeletedEvent<T> {
|
|
505
564
|
/** Entity that was deleted */
|
|
506
|
-
|
|
565
|
+
deletedEntity?: T | null;
|
|
507
566
|
}
|
|
508
|
-
export interface ActionEvent {
|
|
509
|
-
|
|
567
|
+
export interface ActionEvent<T> {
|
|
568
|
+
body?: T;
|
|
510
569
|
}
|
|
511
570
|
export interface CreateRedirectSessionResponseNonNullableFields {
|
|
512
571
|
redirectSession?: {
|
|
@@ -515,8 +574,10 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
515
574
|
urlDetails?: {
|
|
516
575
|
endpoint: string;
|
|
517
576
|
};
|
|
577
|
+
shortUrl: string;
|
|
518
578
|
};
|
|
519
579
|
}
|
|
580
|
+
export declare const onRedirectSessionCreated: EventDefinition<DomainCreatedEvent<RedirectSession>, "wix.headless.v1.redirect_session_created">;
|
|
520
581
|
/**
|
|
521
582
|
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.
|
|
522
583
|
*
|
|
@@ -532,6 +593,9 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
532
593
|
* @public
|
|
533
594
|
* @documentationMaturity preview
|
|
534
595
|
* @param options - Options for creating a redirect session.
|
|
596
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
597
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
598
|
+
* @applicableIdentity APP
|
|
535
599
|
* @applicableIdentity MEMBER
|
|
536
600
|
* @applicableIdentity VISITOR
|
|
537
601
|
*/
|
|
@@ -551,6 +615,10 @@ export interface CreateRedirectSessionOptions extends CreateRedirectSessionReque
|
|
|
551
615
|
logout?: RedirectSessionLogoutParams;
|
|
552
616
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
553
617
|
auth?: RedirectSessionAuthParams;
|
|
618
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
619
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
620
|
+
/** Information required for generating a custom URL for Wix bookings book page. */
|
|
621
|
+
bookingsBook?: RedirectSessionBookingsBookParams;
|
|
554
622
|
/**
|
|
555
623
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
556
624
|
*
|
|
@@ -9,20 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { serializer } from '@wix/metro-runtime/velo';
|
|
11
11
|
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
12
|
+
import { EventDefinition } from '@wix/sdk-types';
|
|
12
13
|
import * as ambassadorWixHeadlessV1RedirectSession from './headless-v1-redirect-session.http';
|
|
13
|
-
let __verbose = false;
|
|
14
|
-
function __log(...args) {
|
|
15
|
-
__verbose && console.log(...args);
|
|
16
|
-
}
|
|
17
|
-
function __inspect(obj) {
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
20
|
-
export const __debug = {
|
|
21
|
-
verboseLogging: {
|
|
22
|
-
on: () => (__verbose = true),
|
|
23
|
-
off: () => (__verbose = false),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
14
|
const _toVeloEntity = '$';
|
|
27
15
|
const _fromVeloEntity = '$';
|
|
28
16
|
export var LocationType;
|
|
@@ -66,6 +54,7 @@ export var CallbackType;
|
|
|
66
54
|
})(CallbackType || (CallbackType = {}));
|
|
67
55
|
const _createRedirectSessionRequest = {};
|
|
68
56
|
const _createRedirectSessionResponse = {};
|
|
57
|
+
export const onRedirectSessionCreated = EventDefinition('wix.headless.v1.redirect_session_created')();
|
|
69
58
|
/**
|
|
70
59
|
* Creates a URL for redirecting a visitor from an external client site to a Wix page for Wix-managed functionality.
|
|
71
60
|
*
|
|
@@ -81,6 +70,9 @@ const _createRedirectSessionResponse = {};
|
|
|
81
70
|
* @public
|
|
82
71
|
* @documentationMaturity preview
|
|
83
72
|
* @param options - Options for creating a redirect session.
|
|
73
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
74
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
75
|
+
* @applicableIdentity APP
|
|
84
76
|
* @applicableIdentity MEMBER
|
|
85
77
|
* @applicableIdentity VISITOR
|
|
86
78
|
*/
|
|
@@ -95,6 +87,8 @@ export function createRedirectSession(options) {
|
|
|
95
87
|
login: '$[0].login',
|
|
96
88
|
logout: '$[0].logout',
|
|
97
89
|
auth: '$[0].auth',
|
|
90
|
+
storesProduct: '$[0].storesProduct',
|
|
91
|
+
bookingsBook: '$[0].bookingsBook',
|
|
98
92
|
callbacks: '$[0].callbacks',
|
|
99
93
|
preferences: '$[0].preferences',
|
|
100
94
|
};
|
|
@@ -121,7 +115,6 @@ export function createRedirectSession(options) {
|
|
|
121
115
|
});
|
|
122
116
|
const payload = toAmbassadorRequest([options]);
|
|
123
117
|
const reqOpts = ambassadorWixHeadlessV1RedirectSession.createRedirectSession(payload);
|
|
124
|
-
__log(`"CreateRedirectSession" sending request with: ${__inspect(reqOpts)}`);
|
|
125
118
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
126
119
|
try {
|
|
127
120
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -139,6 +132,8 @@ export function createRedirectSession(options) {
|
|
|
139
132
|
login: '$[0].login',
|
|
140
133
|
logout: '$[0].logout',
|
|
141
134
|
auth: '$[0].auth',
|
|
135
|
+
storesProduct: '$[0].storesProduct',
|
|
136
|
+
bookingsBook: '$[0].bookingsBook',
|
|
142
137
|
callbacks: '$[0].callbacks',
|
|
143
138
|
preferences: '$[0].preferences',
|
|
144
139
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless-v1-redirect-session.universal.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"headless-v1-redirect-session.universal.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,sCAAsC,MAAM,qCAAqC,CAAC;AAE9F,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AA6M5B,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AA2HD,uDAAuD;AACvD,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AAWD,MAAM,CAAN,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,KAArB,qBAAqB,QAWhC;AAkJD,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8BAA8B;IAC9B,mCAAmB,CAAA;IACnB,m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|
|
2
2
|
"name": "@wix/redirects",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -12,16 +12,18 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"build",
|
|
14
14
|
"frontend/package.json",
|
|
15
|
-
"meta"
|
|
15
|
+
"meta",
|
|
16
|
+
"context"
|
|
16
17
|
],
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"@wix/metro-runtime": "^1.1528.0",
|
|
19
|
-
"@wix/sdk-types": "^1.5.
|
|
20
|
+
"@wix/sdk-types": "^1.5.9",
|
|
20
21
|
"@wix/sdk-runtime": "^0.2.7",
|
|
21
22
|
"@wix/motion-edm-autogen-query-wrapper": "^1.0.37"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"typescript": "^5.3.2"
|
|
25
|
+
"typescript": "^5.3.2",
|
|
26
|
+
"@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz"
|
|
25
27
|
},
|
|
26
28
|
"scripts": {
|
|
27
29
|
"build": "tsc -b tsconfig.json tsconfig.esm.json",
|
|
@@ -33,5 +35,5 @@
|
|
|
33
35
|
"groupId": "com.wixpress.public-sdk-autogen"
|
|
34
36
|
}
|
|
35
37
|
},
|
|
36
|
-
"falconPackageHash": "
|
|
38
|
+
"falconPackageHash": "85eb3f0275c808645fde725dbaf8c3712450226c8e8adf6821848997"
|
|
37
39
|
}
|