@memberstack/dom 1.9.4 → 1.9.7
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/auth/index.js +4 -0
- package/lib/index.d.ts +62 -58
- package/lib/methods/dom/main-dom.js +2336 -567
- package/lib/methods/dom/methods.d.ts +1 -1
- package/lib/methods/dom/methods.js +3 -4
- package/lib/methods/index.d.ts +64 -58
- package/lib/methods/index.js +2 -0
- package/lib/methods/requests/index.d.ts +5 -2
- package/lib/methods/requests/index.js +44 -13
- package/lib/methods/requests/requests.d.ts +3 -1
- package/lib/methods/requests/requests.js +15 -14
- package/lib/types/params.d.ts +3 -1
- package/lib/types/payloads.d.ts +1 -0
- package/lib/types/utils/payloads.d.ts +16 -9
- package/lib/utils/cookies.js +1 -1
- package/package.json +1 -1
package/lib/auth/index.js
CHANGED
|
@@ -52,6 +52,10 @@ exports.updatePersistedMember = function (member) {
|
|
|
52
52
|
if (member) {
|
|
53
53
|
localStorage === null || localStorage === void 0 ? void 0 : localStorage.setItem("_ms-mem", JSON.stringify(member));
|
|
54
54
|
}
|
|
55
|
+
else {
|
|
56
|
+
localStorage === null || localStorage === void 0 ? void 0 : localStorage.removeItem("_ms-mem");
|
|
57
|
+
cookies_1.setMemberCookie("", -1);
|
|
58
|
+
}
|
|
55
59
|
};
|
|
56
60
|
exports.unsetPersistedMember = function () {
|
|
57
61
|
localStorage === null || localStorage === void 0 ? void 0 : localStorage.removeItem("_ms-mem");
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
init: (props: import("./methods").DOMConfig) => {
|
|
3
|
-
openModal: (type: "LOGIN" | "SIGNUP" | "FORGOT_PASSWORD" | "RESET_PASSWORD", params?: {}) => Promise<unknown>;
|
|
3
|
+
openModal: (type: "LOGIN" | "SIGNUP" | "FORGOT_PASSWORD" | "RESET_PASSWORD" | "PROFILE", params?: {}) => Promise<unknown>;
|
|
4
4
|
hideModal: () => void;
|
|
5
5
|
_hideLoader: (element?: any) => void;
|
|
6
6
|
_showLoader: (element?: any) => void;
|
|
@@ -14,10 +14,7 @@ declare const _default: {
|
|
|
14
14
|
data: {
|
|
15
15
|
id: string;
|
|
16
16
|
name: string;
|
|
17
|
-
|
|
18
|
-
url: string;
|
|
19
|
-
verified: boolean;
|
|
20
|
-
}[];
|
|
17
|
+
mode: "live" | "sandbox";
|
|
21
18
|
plans: {
|
|
22
19
|
id: string;
|
|
23
20
|
name: string;
|
|
@@ -41,44 +38,41 @@ declare const _default: {
|
|
|
41
38
|
currency: string;
|
|
42
39
|
}[];
|
|
43
40
|
}[];
|
|
44
|
-
|
|
41
|
+
contentGroups: {
|
|
45
42
|
id: string;
|
|
43
|
+
name: string;
|
|
46
44
|
key: string;
|
|
47
|
-
|
|
45
|
+
allowAllMembers: boolean;
|
|
46
|
+
redirect: string;
|
|
47
|
+
urls: {
|
|
48
|
+
url: string;
|
|
49
|
+
filter: string;
|
|
50
|
+
}[];
|
|
48
51
|
plans: {
|
|
49
52
|
id: string;
|
|
50
|
-
name: string;
|
|
51
|
-
description: string;
|
|
52
|
-
status: string;
|
|
53
|
-
redirects: {
|
|
54
|
-
afterLogin: string;
|
|
55
|
-
afterLogout: string;
|
|
56
|
-
afterSignup: string;
|
|
57
|
-
};
|
|
58
|
-
prices?: [] | {
|
|
59
|
-
id: string;
|
|
60
|
-
amount: string;
|
|
61
|
-
interval: {
|
|
62
|
-
type: string;
|
|
63
|
-
count: number;
|
|
64
|
-
};
|
|
65
|
-
name: string;
|
|
66
|
-
type: string;
|
|
67
|
-
status: string;
|
|
68
|
-
currency: string;
|
|
69
|
-
}[];
|
|
70
53
|
}[];
|
|
71
54
|
}[];
|
|
55
|
+
customField: {
|
|
56
|
+
order: number;
|
|
57
|
+
key: string;
|
|
58
|
+
label: string;
|
|
59
|
+
hidden: boolean;
|
|
60
|
+
}[];
|
|
61
|
+
branding: {
|
|
62
|
+
logo: string;
|
|
63
|
+
colors: {
|
|
64
|
+
lightMode: {
|
|
65
|
+
primaryButton: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
72
69
|
};
|
|
73
70
|
}>;
|
|
74
71
|
getAuthProviders(): Promise<{
|
|
75
72
|
data: {
|
|
76
73
|
id: string;
|
|
77
74
|
name: string;
|
|
78
|
-
|
|
79
|
-
url: string;
|
|
80
|
-
verified: boolean;
|
|
81
|
-
}[];
|
|
75
|
+
mode: "live" | "sandbox";
|
|
82
76
|
plans: {
|
|
83
77
|
id: string;
|
|
84
78
|
name: string;
|
|
@@ -102,34 +96,34 @@ declare const _default: {
|
|
|
102
96
|
currency: string;
|
|
103
97
|
}[];
|
|
104
98
|
}[];
|
|
105
|
-
|
|
99
|
+
contentGroups: {
|
|
106
100
|
id: string;
|
|
101
|
+
name: string;
|
|
107
102
|
key: string;
|
|
108
|
-
|
|
103
|
+
allowAllMembers: boolean;
|
|
104
|
+
redirect: string;
|
|
105
|
+
urls: {
|
|
106
|
+
url: string;
|
|
107
|
+
filter: string;
|
|
108
|
+
}[];
|
|
109
109
|
plans: {
|
|
110
110
|
id: string;
|
|
111
|
-
name: string;
|
|
112
|
-
description: string;
|
|
113
|
-
status: string;
|
|
114
|
-
redirects: {
|
|
115
|
-
afterLogin: string;
|
|
116
|
-
afterLogout: string;
|
|
117
|
-
afterSignup: string;
|
|
118
|
-
};
|
|
119
|
-
prices?: [] | {
|
|
120
|
-
id: string;
|
|
121
|
-
amount: string;
|
|
122
|
-
interval: {
|
|
123
|
-
type: string;
|
|
124
|
-
count: number;
|
|
125
|
-
};
|
|
126
|
-
name: string;
|
|
127
|
-
type: string;
|
|
128
|
-
status: string;
|
|
129
|
-
currency: string;
|
|
130
|
-
}[];
|
|
131
111
|
}[];
|
|
132
112
|
}[];
|
|
113
|
+
customField: {
|
|
114
|
+
order: number;
|
|
115
|
+
key: string;
|
|
116
|
+
label: string;
|
|
117
|
+
hidden: boolean;
|
|
118
|
+
}[];
|
|
119
|
+
branding: {
|
|
120
|
+
logo: string;
|
|
121
|
+
colors: {
|
|
122
|
+
lightMode: {
|
|
123
|
+
primaryButton: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
133
127
|
};
|
|
134
128
|
}>;
|
|
135
129
|
loginMemberEmailPassword(params: import("./types").LoginMemberEmailPasswordParams): Promise<{
|
|
@@ -144,6 +138,7 @@ declare const _default: {
|
|
|
144
138
|
auth: {
|
|
145
139
|
email: string;
|
|
146
140
|
};
|
|
141
|
+
loginRedirect: string;
|
|
147
142
|
stripeCustomerId: string;
|
|
148
143
|
createdAt: string;
|
|
149
144
|
metaData: object;
|
|
@@ -169,7 +164,6 @@ declare const _default: {
|
|
|
169
164
|
}[];
|
|
170
165
|
};
|
|
171
166
|
redirect: string;
|
|
172
|
-
loginRedirect: string;
|
|
173
167
|
payment: {
|
|
174
168
|
requirePayment: string[];
|
|
175
169
|
requireAuthentication: string[];
|
|
@@ -188,6 +182,7 @@ declare const _default: {
|
|
|
188
182
|
auth: {
|
|
189
183
|
email: string;
|
|
190
184
|
};
|
|
185
|
+
loginRedirect: string;
|
|
191
186
|
stripeCustomerId: string;
|
|
192
187
|
createdAt: string;
|
|
193
188
|
metaData: object;
|
|
@@ -213,7 +208,6 @@ declare const _default: {
|
|
|
213
208
|
}[];
|
|
214
209
|
};
|
|
215
210
|
redirect: string;
|
|
216
|
-
loginRedirect: string;
|
|
217
211
|
payment: {
|
|
218
212
|
requirePayment: string[];
|
|
219
213
|
requireAuthentication: string[];
|
|
@@ -245,7 +239,7 @@ declare const _default: {
|
|
|
245
239
|
}[];
|
|
246
240
|
};
|
|
247
241
|
}>;
|
|
248
|
-
getPlans(
|
|
242
|
+
getPlans(): Promise<{
|
|
249
243
|
data: {
|
|
250
244
|
id: string;
|
|
251
245
|
name: string;
|
|
@@ -275,6 +269,7 @@ declare const _default: {
|
|
|
275
269
|
id: string;
|
|
276
270
|
name: string;
|
|
277
271
|
key: string;
|
|
272
|
+
allowAllMembers: boolean;
|
|
278
273
|
redirect: string;
|
|
279
274
|
urls: {
|
|
280
275
|
url: string;
|
|
@@ -291,6 +286,7 @@ declare const _default: {
|
|
|
291
286
|
auth: {
|
|
292
287
|
email: string;
|
|
293
288
|
};
|
|
289
|
+
loginRedirect: string;
|
|
294
290
|
stripeCustomerId: string;
|
|
295
291
|
createdAt: string;
|
|
296
292
|
metaData: object;
|
|
@@ -436,12 +432,14 @@ declare const _default: {
|
|
|
436
432
|
url: string;
|
|
437
433
|
};
|
|
438
434
|
}>;
|
|
435
|
+
removePlan(params: import("./types").RemovePlanParams, options?: import("./methods/requests").MemberstackOptions): Promise<null>;
|
|
439
436
|
cancelPlan(params: import("./types").CancelPlanParams, options?: import("./methods/requests").MemberstackOptions): Promise<{
|
|
440
437
|
data: {
|
|
441
438
|
id: string;
|
|
442
439
|
auth: {
|
|
443
440
|
email: string;
|
|
444
441
|
};
|
|
442
|
+
loginRedirect: string;
|
|
445
443
|
stripeCustomerId: string;
|
|
446
444
|
createdAt: string;
|
|
447
445
|
metaData: object;
|
|
@@ -473,6 +471,7 @@ declare const _default: {
|
|
|
473
471
|
auth: {
|
|
474
472
|
email: string;
|
|
475
473
|
};
|
|
474
|
+
loginRedirect: string;
|
|
476
475
|
stripeCustomerId: string;
|
|
477
476
|
createdAt: string;
|
|
478
477
|
metaData: object;
|
|
@@ -504,6 +503,7 @@ declare const _default: {
|
|
|
504
503
|
auth: {
|
|
505
504
|
email: string;
|
|
506
505
|
};
|
|
506
|
+
loginRedirect: string;
|
|
507
507
|
stripeCustomerId: string;
|
|
508
508
|
createdAt: string;
|
|
509
509
|
metaData: object;
|
|
@@ -535,6 +535,7 @@ declare const _default: {
|
|
|
535
535
|
auth: {
|
|
536
536
|
email: string;
|
|
537
537
|
};
|
|
538
|
+
loginRedirect: string;
|
|
538
539
|
stripeCustomerId: string;
|
|
539
540
|
createdAt: string;
|
|
540
541
|
metaData: object;
|
|
@@ -566,6 +567,7 @@ declare const _default: {
|
|
|
566
567
|
auth: {
|
|
567
568
|
email: string;
|
|
568
569
|
};
|
|
570
|
+
loginRedirect: string;
|
|
569
571
|
stripeCustomerId: string;
|
|
570
572
|
createdAt: string;
|
|
571
573
|
metaData: object;
|
|
@@ -597,6 +599,7 @@ declare const _default: {
|
|
|
597
599
|
auth: {
|
|
598
600
|
email: string;
|
|
599
601
|
};
|
|
602
|
+
loginRedirect: string;
|
|
600
603
|
stripeCustomerId: string;
|
|
601
604
|
createdAt: string;
|
|
602
605
|
metaData: object;
|
|
@@ -634,6 +637,7 @@ declare const _default: {
|
|
|
634
637
|
auth: {
|
|
635
638
|
email: string;
|
|
636
639
|
};
|
|
640
|
+
loginRedirect: string;
|
|
637
641
|
stripeCustomerId: string;
|
|
638
642
|
createdAt: string;
|
|
639
643
|
metaData: object;
|
|
@@ -659,7 +663,6 @@ declare const _default: {
|
|
|
659
663
|
}[];
|
|
660
664
|
};
|
|
661
665
|
redirect: string;
|
|
662
|
-
loginRedirect: string;
|
|
663
666
|
payment: {
|
|
664
667
|
requirePayment: string[];
|
|
665
668
|
requireAuthentication: string[];
|
|
@@ -678,6 +681,7 @@ declare const _default: {
|
|
|
678
681
|
auth: {
|
|
679
682
|
email: string;
|
|
680
683
|
};
|
|
684
|
+
loginRedirect: string;
|
|
681
685
|
stripeCustomerId: string;
|
|
682
686
|
createdAt: string;
|
|
683
687
|
metaData: object;
|
|
@@ -703,7 +707,6 @@ declare const _default: {
|
|
|
703
707
|
}[];
|
|
704
708
|
};
|
|
705
709
|
redirect: string;
|
|
706
|
-
loginRedirect: string;
|
|
707
710
|
payment: {
|
|
708
711
|
requirePayment: string[];
|
|
709
712
|
requireAuthentication: string[];
|
|
@@ -719,6 +722,7 @@ declare const _default: {
|
|
|
719
722
|
auth: {
|
|
720
723
|
email: string;
|
|
721
724
|
};
|
|
725
|
+
loginRedirect: string;
|
|
722
726
|
stripeCustomerId: string;
|
|
723
727
|
createdAt: string;
|
|
724
728
|
metaData: object;
|