@memberstack/dom 1.9.10 → 1.9.12
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/lib/index.d.ts +6 -0
- package/lib/methods/dom/main-dom.js +2030 -590
- package/lib/methods/index.d.ts +6 -0
- package/lib/methods/requests/index.d.ts +6 -0
- package/lib/methods/requests/index.js +93 -8
- package/lib/types/params.d.ts +7 -5
- package/lib/types/payloads.d.ts +3 -0
- package/package.json +1 -1
package/lib/methods/index.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ declare const _default: {
|
|
|
23
23
|
getAppAndMember(params?: any): Promise<import("../types").GetAppAndMemberPayload>;
|
|
24
24
|
getApp(): Promise<import("../types").AppPayload>;
|
|
25
25
|
loginMemberEmailPassword(params: import("../types").LoginMemberEmailPasswordParams, options?: any): Promise<import("../types").LoginMemberEmailPasswordPayload>;
|
|
26
|
+
sendMemberLoginPasswordlessEmail(params: import("../types").SendMemberLoginPasswordlessEmailParams, options?: any): Promise<import("../types").SendMemberLoginPasswordlessEmailPayload>;
|
|
27
|
+
sendMemberSignupPasswordlessEmail(params: import("../types").SendMemberLoginPasswordlessEmailParams, options?: any): Promise<import("../types").SendMemberLoginPasswordlessEmailPayload>;
|
|
28
|
+
loginMemberPasswordless(params: import("../types").LoginMemberPasswordlessParams, options?: any): Promise<import("../types").LoginMemberEmailPasswordPayload>;
|
|
26
29
|
loginMemberAuthProvider(params: import("../types").LoginMemberAuthProviderParams): Promise<import("../types").LoginMemberAuthProviderPayload>;
|
|
27
30
|
getPlan(params: import("../types").GetPlanParams): Promise<import("../types").GetPlanPayload>;
|
|
28
31
|
getPlans(): Promise<import("../types").GetPlansPayload>;
|
|
@@ -37,6 +40,9 @@ declare const _default: {
|
|
|
37
40
|
updateMember(params: import("../types").UpdateMemberParams, options?: import("./requests").MemberstackOptions): Promise<import("../types").UpdateMemberPayload>;
|
|
38
41
|
updateMemberAuth(params: import("../types").UpdateMemberAuthParams, options?: import("./requests").MemberstackOptions): Promise<import("../types").UpdateMemberAuthPayload>;
|
|
39
42
|
setPassword(params: import("../types").SetPasswordParams, options?: import("./requests").MemberstackOptions): Promise<import("../types").SetPasswordPayload>;
|
|
43
|
+
signupMemberPasswordless(params: Omit<import("../types").SignupMemberEmailPasswordParams, "password"> & {
|
|
44
|
+
passwordlessToken: string;
|
|
45
|
+
}, options?: any): Promise<import("../types").SignupMemberEmailPasswordPayload>;
|
|
40
46
|
signupMemberEmailPassword(params: import("../types").SignupMemberEmailPasswordParams, options?: any): Promise<import("../types").SignupMemberEmailPasswordPayload>;
|
|
41
47
|
sendMemberVerificationEmail(): Promise<import("../types").SendMemberVerificationEmailPayload>;
|
|
42
48
|
sendMemberResetPasswordEmail(params: import("../types").SendMemberResetPasswordEmailParams): Promise<import("../types").SendMemberResetPasswordEmailPayload>;
|
|
@@ -23,6 +23,9 @@ export declare const initRequest: ({ publicKey, appId, token, customEndpoint, se
|
|
|
23
23
|
getAppAndMember(params?: any): Promise<Payloads.GetAppAndMemberPayload>;
|
|
24
24
|
getApp(): Promise<Payloads.AppPayload>;
|
|
25
25
|
loginMemberEmailPassword(params: Params.LoginMemberEmailPasswordParams, options?: any): Promise<Payloads.LoginMemberEmailPasswordPayload>;
|
|
26
|
+
sendMemberLoginPasswordlessEmail(params: Params.SendMemberLoginPasswordlessEmailParams, options?: any): Promise<Payloads.SendMemberLoginPasswordlessEmailPayload>;
|
|
27
|
+
sendMemberSignupPasswordlessEmail(params: Params.SendMemberLoginPasswordlessEmailParams, options?: any): Promise<Payloads.SendMemberLoginPasswordlessEmailPayload>;
|
|
28
|
+
loginMemberPasswordless(params: Params.LoginMemberPasswordlessParams, options?: any): Promise<Payloads.LoginMemberEmailPasswordPayload>;
|
|
26
29
|
loginMemberAuthProvider(params: Params.LoginMemberAuthProviderParams): Promise<Payloads.LoginMemberAuthProviderPayload>;
|
|
27
30
|
getPlan(params: Params.GetPlanParams): Promise<Payloads.GetPlanPayload>;
|
|
28
31
|
getPlans(): Promise<Payloads.GetPlansPayload>;
|
|
@@ -37,6 +40,9 @@ export declare const initRequest: ({ publicKey, appId, token, customEndpoint, se
|
|
|
37
40
|
updateMember(params: Params.UpdateMemberParams, options?: MemberstackOptions): Promise<Payloads.UpdateMemberPayload>;
|
|
38
41
|
updateMemberAuth(params: Params.UpdateMemberAuthParams, options?: MemberstackOptions): Promise<Payloads.UpdateMemberAuthPayload>;
|
|
39
42
|
setPassword(params: Params.SetPasswordParams, options?: MemberstackOptions): Promise<Payloads.SetPasswordPayload>;
|
|
43
|
+
signupMemberPasswordless(params: Omit<Params.SignupMemberEmailPasswordParams, "password"> & {
|
|
44
|
+
passwordlessToken: string;
|
|
45
|
+
}, options?: any): Promise<Payloads.SignupMemberEmailPasswordPayload>;
|
|
40
46
|
signupMemberEmailPassword(params: Params.SignupMemberEmailPasswordParams, options?: any): Promise<Payloads.SignupMemberEmailPasswordPayload>;
|
|
41
47
|
sendMemberVerificationEmail(): Promise<Payloads.SendMemberVerificationEmailPayload>;
|
|
42
48
|
sendMemberResetPasswordEmail(params: Params.SendMemberResetPasswordEmailParams): Promise<Payloads.SendMemberResetPasswordEmailPayload>;
|
|
@@ -138,6 +138,7 @@ var initRequest = function (_a) {
|
|
|
138
138
|
customFields: customFields,
|
|
139
139
|
plans: plans,
|
|
140
140
|
appId: appId,
|
|
141
|
+
publicKey: publicKey,
|
|
141
142
|
origin: window.location.hostname,
|
|
142
143
|
});
|
|
143
144
|
return [2 /*return*/, openSignInWindow("".concat(endpoints_1.endpoints.API, "/auth-provider/signup?").concat(queryParams), "signup")];
|
|
@@ -151,6 +152,7 @@ var initRequest = function (_a) {
|
|
|
151
152
|
queryParams = new URLSearchParams({
|
|
152
153
|
provider: params.provider,
|
|
153
154
|
appId: appId,
|
|
155
|
+
publicKey: publicKey,
|
|
154
156
|
origin: window.location.hostname,
|
|
155
157
|
});
|
|
156
158
|
return [2 /*return*/, openSignInWindow("".concat(endpoints_1.endpoints.API, "/auth-provider/login?").concat(queryParams), "login")];
|
|
@@ -164,6 +166,7 @@ var initRequest = function (_a) {
|
|
|
164
166
|
queryParams = new URLSearchParams({
|
|
165
167
|
provider: params.provider,
|
|
166
168
|
appId: appId,
|
|
169
|
+
publicKey: publicKey,
|
|
167
170
|
member: (0, cookies_1.getMemberCookie)(),
|
|
168
171
|
origin: window.location.hostname,
|
|
169
172
|
});
|
|
@@ -238,6 +241,65 @@ var initRequest = function (_a) {
|
|
|
238
241
|
});
|
|
239
242
|
});
|
|
240
243
|
},
|
|
244
|
+
sendMemberLoginPasswordlessEmail: function (params, options) {
|
|
245
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
246
|
+
return __generator(this, function (_a) {
|
|
247
|
+
switch (_a.label) {
|
|
248
|
+
case 0: return [4 /*yield*/, sendRequest({
|
|
249
|
+
method: requests_2.HttpMethod.POST,
|
|
250
|
+
url: "/auth/passwordless/login/send",
|
|
251
|
+
data: {
|
|
252
|
+
email: params.email,
|
|
253
|
+
},
|
|
254
|
+
})];
|
|
255
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
sendMemberSignupPasswordlessEmail: function (
|
|
261
|
+
// has same params and payload as sendMemberLoginPasswordlessEmail
|
|
262
|
+
params, options) {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
264
|
+
return __generator(this, function (_a) {
|
|
265
|
+
switch (_a.label) {
|
|
266
|
+
case 0: return [4 /*yield*/, sendRequest({
|
|
267
|
+
method: requests_2.HttpMethod.POST,
|
|
268
|
+
url: "/auth/passwordless/signup/send",
|
|
269
|
+
data: {
|
|
270
|
+
email: params.email,
|
|
271
|
+
},
|
|
272
|
+
})];
|
|
273
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
loginMemberPasswordless: function (params, options
|
|
279
|
+
// has same payload as loginMemberEmailPassword
|
|
280
|
+
) {
|
|
281
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
282
|
+
var data;
|
|
283
|
+
return __generator(this, function (_a) {
|
|
284
|
+
switch (_a.label) {
|
|
285
|
+
case 0: return [4 /*yield*/, sendRequest({
|
|
286
|
+
method: requests_2.HttpMethod.POST,
|
|
287
|
+
url: "/auth/passwordless/login",
|
|
288
|
+
data: {
|
|
289
|
+
token: params.token,
|
|
290
|
+
email: params.email,
|
|
291
|
+
options: options
|
|
292
|
+
},
|
|
293
|
+
})];
|
|
294
|
+
case 1:
|
|
295
|
+
data = _a.sent();
|
|
296
|
+
(0, auth_1.setPersistedMember)(data.data.member);
|
|
297
|
+
(0, cookies_1.setMemberCookie)(data.data.tokens.accessToken, sessionDurationDays);
|
|
298
|
+
return [2 /*return*/, data];
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
},
|
|
241
303
|
loginMemberAuthProvider: function (params) {
|
|
242
304
|
return __awaiter(this, void 0, void 0, function () {
|
|
243
305
|
return __generator(this, function (_a) {
|
|
@@ -517,6 +579,35 @@ var initRequest = function (_a) {
|
|
|
517
579
|
});
|
|
518
580
|
});
|
|
519
581
|
},
|
|
582
|
+
signupMemberPasswordless: function (params, options) {
|
|
583
|
+
var _a, _b;
|
|
584
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
585
|
+
var data;
|
|
586
|
+
return __generator(this, function (_c) {
|
|
587
|
+
switch (_c.label) {
|
|
588
|
+
case 0: return [4 /*yield*/, sendRequest({
|
|
589
|
+
method: requests_2.HttpMethod.POST,
|
|
590
|
+
url: "/auth/signup?isPasswordless=true",
|
|
591
|
+
data: __assign({ email: params.email, customFields: params.customFields, passwordlessToken: params.passwordlessToken, metaData: params.metaData, plans: params.plans,
|
|
592
|
+
//internal use only
|
|
593
|
+
origin_domain: window.location.origin, options: options }, (((_a = window.Rewardful) === null || _a === void 0 ? void 0 : _a.referral) && {
|
|
594
|
+
rewardfulData: {
|
|
595
|
+
// @ts-ignore
|
|
596
|
+
referral: window.Rewardful.referral,
|
|
597
|
+
// @ts-ignore
|
|
598
|
+
coupon: (_b = window.Rewardful.coupon) === null || _b === void 0 ? void 0 : _b.id,
|
|
599
|
+
}
|
|
600
|
+
})),
|
|
601
|
+
})];
|
|
602
|
+
case 1:
|
|
603
|
+
data = _c.sent();
|
|
604
|
+
(0, auth_1.setPersistedMember)(data.data.member);
|
|
605
|
+
(0, cookies_1.setMemberCookie)(data.data.tokens.accessToken, sessionDurationDays);
|
|
606
|
+
return [2 /*return*/, data];
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
},
|
|
520
611
|
signupMemberEmailPassword: function (params, options) {
|
|
521
612
|
var _a, _b;
|
|
522
613
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -526,15 +617,9 @@ var initRequest = function (_a) {
|
|
|
526
617
|
case 0: return [4 /*yield*/, sendRequest({
|
|
527
618
|
method: requests_2.HttpMethod.POST,
|
|
528
619
|
url: "/auth/signup",
|
|
529
|
-
data: __assign(
|
|
530
|
-
payment: {
|
|
531
|
-
stripe: {
|
|
532
|
-
paymentMethodId: params.payment.stripe.paymentMethodId,
|
|
533
|
-
},
|
|
534
|
-
},
|
|
535
|
-
})), {
|
|
620
|
+
data: __assign({ email: params.email, password: params.password, customFields: params.customFields, metaData: params.metaData, plans: params.plans, captchaToken: params.captchaToken,
|
|
536
621
|
//internal use only
|
|
537
|
-
origin_domain: window.location.origin, options: options }
|
|
622
|
+
origin_domain: window.location.origin, options: options }, (((_a = window.Rewardful) === null || _a === void 0 ? void 0 : _a.referral) && {
|
|
538
623
|
rewardfulData: {
|
|
539
624
|
// @ts-ignore
|
|
540
625
|
referral: window.Rewardful.referral,
|
package/lib/types/params.d.ts
CHANGED
|
@@ -7,11 +7,6 @@ export declare type SignupMemberEmailPasswordParams = {
|
|
|
7
7
|
planId: string;
|
|
8
8
|
priceId?: string;
|
|
9
9
|
}[];
|
|
10
|
-
payment?: {
|
|
11
|
-
stripe?: {
|
|
12
|
-
paymentMethodId: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
10
|
captchaToken?: string;
|
|
16
11
|
};
|
|
17
12
|
export declare type SetPasswordParams = {
|
|
@@ -27,6 +22,13 @@ export declare type SignupWithProviderParams = {
|
|
|
27
22
|
export declare type LoginWithProviderParams = {
|
|
28
23
|
provider: string;
|
|
29
24
|
};
|
|
25
|
+
export declare type LoginMemberPasswordlessParams = {
|
|
26
|
+
token: string;
|
|
27
|
+
email: string;
|
|
28
|
+
};
|
|
29
|
+
export declare type SendMemberLoginPasswordlessEmailParams = {
|
|
30
|
+
email: string;
|
|
31
|
+
};
|
|
30
32
|
export declare type SignupMemberAuthProviderParams = {
|
|
31
33
|
code: string;
|
|
32
34
|
provider: "GOOGLE" | "FACEBOOK";
|
package/lib/types/payloads.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export declare type GetRestrictedUrlGroupsPayload = Response<Payload.Transforms[
|
|
|
15
15
|
export declare type GetPlansPayload = Response<Payload.Transforms["Plan"][]>;
|
|
16
16
|
export declare type GetPlanPayload = Response<Payload.Transforms["Plan"]>;
|
|
17
17
|
export declare type LoginMemberEmailPasswordPayload = Response<Payload.Transforms["MemberAuth"]>;
|
|
18
|
+
export declare type SendMemberLoginPasswordlessEmailPayload = Response<{
|
|
19
|
+
success: boolean;
|
|
20
|
+
}>;
|
|
18
21
|
export declare type LoginMemberAuthProviderPayload = Response<Payload.Transforms["MemberAuth"]>;
|
|
19
22
|
export declare type LogoutMemberPayload = Response<{
|
|
20
23
|
redirect?: string;
|