@wix/redirects 1.0.34 → 1.0.35
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 +1 -1
- package/build/cjs/src/headless-v1-redirect-session.types.d.ts +45 -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 +47 -6
- package/build/cjs/src/headless-v1-redirect-session.universal.js +3 -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 +1 -1
- package/build/es/src/headless-v1-redirect-session.types.d.ts +45 -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 +47 -6
- package/build/es/src/headless-v1-redirect-session.universal.js +2 -14
- package/build/es/src/headless-v1-redirect-session.universal.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +6 -4
|
@@ -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,4 @@ 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, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
|
|
@@ -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,8 @@ 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;
|
|
43
50
|
/**
|
|
44
51
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
45
52
|
* When redirecting to any callback URL, Wix passes the boolean `wixMemberLoggedIn` query parameter.
|
|
@@ -67,6 +74,8 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
67
74
|
logout?: RedirectSessionLogoutParams;
|
|
68
75
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
69
76
|
auth?: RedirectSessionAuthParams;
|
|
77
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
78
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
70
79
|
}
|
|
71
80
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
72
81
|
/**
|
|
@@ -325,6 +334,10 @@ export declare enum MembersAccountSection {
|
|
|
325
334
|
/** Events section in "my account" */
|
|
326
335
|
EVENTS = "EVENTS"
|
|
327
336
|
}
|
|
337
|
+
export interface RedirectSessionStoresProductParams {
|
|
338
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
339
|
+
productSlug?: string;
|
|
340
|
+
}
|
|
328
341
|
export interface CallbackParams {
|
|
329
342
|
/**
|
|
330
343
|
* 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 +421,37 @@ export interface CreateRedirectSessionResponse {
|
|
|
408
421
|
/** Details for redirecting the visitor to a Wix page. */
|
|
409
422
|
redirectSession?: RedirectSession;
|
|
410
423
|
}
|
|
424
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
425
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
426
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
427
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
428
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
429
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
430
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
431
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
432
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
433
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
434
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
435
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
436
|
+
preferences?: RedirectSessionPreferences;
|
|
437
|
+
}
|
|
438
|
+
/** @oneof */
|
|
439
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
440
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
441
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
442
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
443
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
444
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
445
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
446
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
447
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
448
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
449
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
450
|
+
}
|
|
451
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
452
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
453
|
+
redirectSession?: RedirectSession;
|
|
454
|
+
}
|
|
411
455
|
export interface ValidateCallbackURLRequest {
|
|
412
456
|
/** An external URL to validate */
|
|
413
457
|
callbackUrl?: string;
|
|
@@ -512,5 +556,6 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
512
556
|
urlDetails?: {
|
|
513
557
|
endpoint: string;
|
|
514
558
|
};
|
|
559
|
+
shortUrl: string;
|
|
515
560
|
};
|
|
516
561
|
}
|
|
@@ -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":";;;AAyMA,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;AA0ID,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,3 @@
|
|
|
1
|
-
export declare const __debug: {
|
|
2
|
-
verboseLogging: {
|
|
3
|
-
on: () => boolean;
|
|
4
|
-
off: () => boolean;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
1
|
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
|
|
8
2
|
export interface RedirectSession {
|
|
9
3
|
/** ID of the redirect session created. */
|
|
@@ -20,6 +14,11 @@ export interface RedirectSession {
|
|
|
20
14
|
* @readonly
|
|
21
15
|
*/
|
|
22
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;
|
|
23
22
|
}
|
|
24
23
|
export interface URLDetails {
|
|
25
24
|
/**
|
|
@@ -46,6 +45,8 @@ export interface CreateRedirectSessionRequest extends CreateRedirectSessionReque
|
|
|
46
45
|
logout?: RedirectSessionLogoutParams;
|
|
47
46
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
48
47
|
auth?: RedirectSessionAuthParams;
|
|
48
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
49
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
49
50
|
/**
|
|
50
51
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
51
52
|
*
|
|
@@ -71,6 +72,8 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
71
72
|
logout?: RedirectSessionLogoutParams;
|
|
72
73
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
73
74
|
auth?: RedirectSessionAuthParams;
|
|
75
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
76
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
74
77
|
}
|
|
75
78
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
76
79
|
/**
|
|
@@ -329,6 +332,10 @@ export declare enum MembersAccountSection {
|
|
|
329
332
|
/** Events section in "my account" */
|
|
330
333
|
EVENTS = "EVENTS"
|
|
331
334
|
}
|
|
335
|
+
export interface RedirectSessionStoresProductParams {
|
|
336
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
337
|
+
productSlug?: string;
|
|
338
|
+
}
|
|
332
339
|
export interface CallbackParams {
|
|
333
340
|
/**
|
|
334
341
|
* 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 +418,37 @@ export interface CreateRedirectSessionResponse {
|
|
|
411
418
|
/** Details for redirecting the visitor to a Wix page. */
|
|
412
419
|
redirectSession?: RedirectSession;
|
|
413
420
|
}
|
|
421
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
422
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
423
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
424
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
425
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
426
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
427
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
428
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
429
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
430
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
431
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
432
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
433
|
+
preferences?: RedirectSessionPreferences;
|
|
434
|
+
}
|
|
435
|
+
/** @oneof */
|
|
436
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
437
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
438
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
439
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
440
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
441
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
442
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
443
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
444
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
445
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
446
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
447
|
+
}
|
|
448
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
449
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
450
|
+
redirectSession?: RedirectSession;
|
|
451
|
+
}
|
|
414
452
|
export interface ValidateCallbackURLRequest {
|
|
415
453
|
/** An external URL to validate */
|
|
416
454
|
callbackUrl?: string;
|
|
@@ -515,6 +553,7 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
515
553
|
urlDetails?: {
|
|
516
554
|
endpoint: string;
|
|
517
555
|
};
|
|
556
|
+
shortUrl: string;
|
|
518
557
|
};
|
|
519
558
|
}
|
|
520
559
|
/**
|
|
@@ -551,6 +590,8 @@ export interface CreateRedirectSessionOptions extends CreateRedirectSessionReque
|
|
|
551
590
|
logout?: RedirectSessionLogoutParams;
|
|
552
591
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
553
592
|
auth?: RedirectSessionAuthParams;
|
|
593
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
594
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
554
595
|
/**
|
|
555
596
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
556
597
|
*
|
|
@@ -32,23 +32,10 @@ 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.CallbackType = exports.MembersAccountSection = exports.Prompt = exports.LocationType =
|
|
35
|
+
exports.createRedirectSession = 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
38
|
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
39
|
const _toVeloEntity = '$';
|
|
53
40
|
const _fromVeloEntity = '$';
|
|
54
41
|
var LocationType;
|
|
@@ -121,6 +108,7 @@ function createRedirectSession(options) {
|
|
|
121
108
|
login: '$[0].login',
|
|
122
109
|
logout: '$[0].logout',
|
|
123
110
|
auth: '$[0].auth',
|
|
111
|
+
storesProduct: '$[0].storesProduct',
|
|
124
112
|
callbacks: '$[0].callbacks',
|
|
125
113
|
preferences: '$[0].preferences',
|
|
126
114
|
};
|
|
@@ -147,7 +135,6 @@ function createRedirectSession(options) {
|
|
|
147
135
|
});
|
|
148
136
|
const payload = toAmbassadorRequest([options]);
|
|
149
137
|
const reqOpts = ambassadorWixHeadlessV1RedirectSession.createRedirectSession(payload);
|
|
150
|
-
__log(`"CreateRedirectSession" sending request with: ${__inspect(reqOpts)}`);
|
|
151
138
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
152
139
|
try {
|
|
153
140
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -165,6 +152,7 @@ function createRedirectSession(options) {
|
|
|
165
152
|
login: '$[0].login',
|
|
166
153
|
logout: '$[0].logout',
|
|
167
154
|
auth: '$[0].auth',
|
|
155
|
+
storesProduct: '$[0].storesProduct',
|
|
168
156
|
callbacks: '$[0].callbacks',
|
|
169
157
|
preferences: '$[0].preferences',
|
|
170
158
|
},
|
|
@@ -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;AAEvF,4GAA8F;AAE9F,
|
|
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;AAEvF,4GAA8F;AAE9F,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAyM5B,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,qBA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,SAAS,CAAC,CACZ,CAAC;YACF,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,4DAAG,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;QACzB,CAAC;;CACF;AAjFD,sDAiFC"}
|
|
@@ -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,4 @@ 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, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, CreateAnonymousRedirectSessionRequest, CreateAnonymousRedirectSessionRequestIntentOneOf, CreateAnonymousRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
|
|
@@ -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,8 @@ 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;
|
|
43
50
|
/**
|
|
44
51
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
45
52
|
* When redirecting to any callback URL, Wix passes the boolean `wixMemberLoggedIn` query parameter.
|
|
@@ -67,6 +74,8 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
67
74
|
logout?: RedirectSessionLogoutParams;
|
|
68
75
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
69
76
|
auth?: RedirectSessionAuthParams;
|
|
77
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
78
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
70
79
|
}
|
|
71
80
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
72
81
|
/**
|
|
@@ -325,6 +334,10 @@ export declare enum MembersAccountSection {
|
|
|
325
334
|
/** Events section in "my account" */
|
|
326
335
|
EVENTS = "EVENTS"
|
|
327
336
|
}
|
|
337
|
+
export interface RedirectSessionStoresProductParams {
|
|
338
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
339
|
+
productSlug?: string;
|
|
340
|
+
}
|
|
328
341
|
export interface CallbackParams {
|
|
329
342
|
/**
|
|
330
343
|
* 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 +421,37 @@ export interface CreateRedirectSessionResponse {
|
|
|
408
421
|
/** Details for redirecting the visitor to a Wix page. */
|
|
409
422
|
redirectSession?: RedirectSession;
|
|
410
423
|
}
|
|
424
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
425
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
426
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
427
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
428
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
429
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
430
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
431
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
432
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
433
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
434
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
435
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
436
|
+
preferences?: RedirectSessionPreferences;
|
|
437
|
+
}
|
|
438
|
+
/** @oneof */
|
|
439
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
440
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
441
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
442
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
443
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
444
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
445
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
446
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
447
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
448
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
449
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
450
|
+
}
|
|
451
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
452
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
453
|
+
redirectSession?: RedirectSession;
|
|
454
|
+
}
|
|
411
455
|
export interface ValidateCallbackURLRequest {
|
|
412
456
|
/** An external URL to validate */
|
|
413
457
|
callbackUrl?: string;
|
|
@@ -512,5 +556,6 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
512
556
|
urlDetails?: {
|
|
513
557
|
endpoint: string;
|
|
514
558
|
};
|
|
559
|
+
shortUrl: string;
|
|
515
560
|
};
|
|
516
561
|
}
|
|
@@ -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":"AAyMA,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;AA0ID,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,3 @@
|
|
|
1
|
-
export declare const __debug: {
|
|
2
|
-
verboseLogging: {
|
|
3
|
-
on: () => boolean;
|
|
4
|
-
off: () => boolean;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
1
|
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
|
|
8
2
|
export interface RedirectSession {
|
|
9
3
|
/** ID of the redirect session created. */
|
|
@@ -20,6 +14,11 @@ export interface RedirectSession {
|
|
|
20
14
|
* @readonly
|
|
21
15
|
*/
|
|
22
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;
|
|
23
22
|
}
|
|
24
23
|
export interface URLDetails {
|
|
25
24
|
/**
|
|
@@ -46,6 +45,8 @@ export interface CreateRedirectSessionRequest extends CreateRedirectSessionReque
|
|
|
46
45
|
logout?: RedirectSessionLogoutParams;
|
|
47
46
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
48
47
|
auth?: RedirectSessionAuthParams;
|
|
48
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
49
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
49
50
|
/**
|
|
50
51
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
51
52
|
*
|
|
@@ -71,6 +72,8 @@ export interface CreateRedirectSessionRequestIntentOneOf {
|
|
|
71
72
|
logout?: RedirectSessionLogoutParams;
|
|
72
73
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
73
74
|
auth?: RedirectSessionAuthParams;
|
|
75
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
76
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
74
77
|
}
|
|
75
78
|
export interface RedirectSessionBookingsCheckoutParams {
|
|
76
79
|
/**
|
|
@@ -329,6 +332,10 @@ export declare enum MembersAccountSection {
|
|
|
329
332
|
/** Events section in "my account" */
|
|
330
333
|
EVENTS = "EVENTS"
|
|
331
334
|
}
|
|
335
|
+
export interface RedirectSessionStoresProductParams {
|
|
336
|
+
/** *Required.** Slug of the product to navigate to. */
|
|
337
|
+
productSlug?: string;
|
|
338
|
+
}
|
|
332
339
|
export interface CallbackParams {
|
|
333
340
|
/**
|
|
334
341
|
* 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 +418,37 @@ export interface CreateRedirectSessionResponse {
|
|
|
411
418
|
/** Details for redirecting the visitor to a Wix page. */
|
|
412
419
|
redirectSession?: RedirectSession;
|
|
413
420
|
}
|
|
421
|
+
export interface CreateAnonymousRedirectSessionRequest extends CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
422
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
423
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
424
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
425
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
426
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
427
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
428
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
429
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
430
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
431
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
432
|
+
/** Optional preferences for customizing redirection to Wix pages. */
|
|
433
|
+
preferences?: RedirectSessionPreferences;
|
|
434
|
+
}
|
|
435
|
+
/** @oneof */
|
|
436
|
+
export interface CreateAnonymousRedirectSessionRequestIntentOneOf {
|
|
437
|
+
/** Information required for generating a custom URL for a Wix Bookings checkout. */
|
|
438
|
+
bookingsCheckout?: RedirectSessionBookingsCheckoutParams;
|
|
439
|
+
/** Information required for generating a custom URL for a Wix eCommerce checkout. */
|
|
440
|
+
ecomCheckout?: RedirectSessionEcomCheckoutParams;
|
|
441
|
+
/** Information required for generating a custom URL for a Wix Events checkout. */
|
|
442
|
+
eventsCheckout?: RedirectSessionEventsCheckoutParams;
|
|
443
|
+
/** Information required for generating a custom URL for a Wix Paid Plans checkout. */
|
|
444
|
+
paidPlansCheckout?: RedirectSessionPaidPlansCheckoutParams;
|
|
445
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
446
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
447
|
+
}
|
|
448
|
+
export interface CreateAnonymousRedirectSessionResponse {
|
|
449
|
+
/** Details for redirecting the visitor to a Wix page. */
|
|
450
|
+
redirectSession?: RedirectSession;
|
|
451
|
+
}
|
|
414
452
|
export interface ValidateCallbackURLRequest {
|
|
415
453
|
/** An external URL to validate */
|
|
416
454
|
callbackUrl?: string;
|
|
@@ -515,6 +553,7 @@ export interface CreateRedirectSessionResponseNonNullableFields {
|
|
|
515
553
|
urlDetails?: {
|
|
516
554
|
endpoint: string;
|
|
517
555
|
};
|
|
556
|
+
shortUrl: string;
|
|
518
557
|
};
|
|
519
558
|
}
|
|
520
559
|
/**
|
|
@@ -551,6 +590,8 @@ export interface CreateRedirectSessionOptions extends CreateRedirectSessionReque
|
|
|
551
590
|
logout?: RedirectSessionLogoutParams;
|
|
552
591
|
/** Information required for generating a custom URL for Wix authentication. */
|
|
553
592
|
auth?: RedirectSessionAuthParams;
|
|
593
|
+
/** Information required for generating a custom URL for a Wix stores product page. */
|
|
594
|
+
storesProduct?: RedirectSessionStoresProductParams;
|
|
554
595
|
/**
|
|
555
596
|
* Details of pages to redirect the visitor back to on the Wix Headless client site.
|
|
556
597
|
*
|
|
@@ -10,19 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { serializer } from '@wix/metro-runtime/velo';
|
|
11
11
|
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
12
12
|
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
13
|
const _toVeloEntity = '$';
|
|
27
14
|
const _fromVeloEntity = '$';
|
|
28
15
|
export var LocationType;
|
|
@@ -95,6 +82,7 @@ export function createRedirectSession(options) {
|
|
|
95
82
|
login: '$[0].login',
|
|
96
83
|
logout: '$[0].logout',
|
|
97
84
|
auth: '$[0].auth',
|
|
85
|
+
storesProduct: '$[0].storesProduct',
|
|
98
86
|
callbacks: '$[0].callbacks',
|
|
99
87
|
preferences: '$[0].preferences',
|
|
100
88
|
};
|
|
@@ -121,7 +109,6 @@ export function createRedirectSession(options) {
|
|
|
121
109
|
});
|
|
122
110
|
const payload = toAmbassadorRequest([options]);
|
|
123
111
|
const reqOpts = ambassadorWixHeadlessV1RedirectSession.createRedirectSession(payload);
|
|
124
|
-
__log(`"CreateRedirectSession" sending request with: ${__inspect(reqOpts)}`);
|
|
125
112
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
126
113
|
try {
|
|
127
114
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -139,6 +126,7 @@ export function createRedirectSession(options) {
|
|
|
139
126
|
login: '$[0].login',
|
|
140
127
|
logout: '$[0].logout',
|
|
141
128
|
auth: '$[0].auth',
|
|
129
|
+
storesProduct: '$[0].storesProduct',
|
|
142
130
|
callbacks: '$[0].callbacks',
|
|
143
131
|
preferences: '$[0].preferences',
|
|
144
132
|
},
|
|
@@ -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;AAEvF,OAAO,KAAK,sCAAsC,MAAM,qCAAqC,CAAC;AAE9F,
|
|
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;AACr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AE,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,iBAAiB,CACxC,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,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/redirects",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -12,7 +12,8 @@
|
|
|
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",
|
|
@@ -21,7 +22,8 @@
|
|
|
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": "9295712400b217648123674766c4c25edde81510a6f917429da31bf4"
|
|
37
39
|
}
|