@memberstack/dom 1.9.2 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/lib/auth/index.d.ts +7 -0
  2. package/lib/auth/index.js +71 -0
  3. package/lib/constants/endpoints.d.ts +3 -0
  4. package/lib/constants/{endpoint.js → endpoints.js} +1 -2
  5. package/lib/index.d.ts +725 -48
  6. package/lib/methods/dom/index.d.ts +0 -2
  7. package/lib/methods/dom/index.js +0 -12
  8. package/lib/methods/dom/main-dom.js +170 -300
  9. package/lib/methods/dom/methods.d.ts +2 -14
  10. package/lib/methods/dom/methods.js +26 -96
  11. package/lib/methods/index.d.ts +727 -61
  12. package/lib/methods/index.js +21 -72
  13. package/lib/methods/requests/index.d.ts +56 -0
  14. package/lib/methods/requests/index.js +631 -0
  15. package/lib/methods/requests/requests.d.ts +26 -0
  16. package/lib/methods/requests/requests.js +113 -0
  17. package/lib/types/index.d.ts +2 -0
  18. package/lib/{auth/persistence → types}/index.js +3 -2
  19. package/lib/types/params.d.ts +143 -0
  20. package/lib/types/params.js +2 -0
  21. package/lib/types/payloads.d.ts +45 -0
  22. package/lib/types/payloads.js +2 -0
  23. package/lib/types/utils/payloads.d.ts +219 -0
  24. package/lib/types/utils/payloads.js +3 -0
  25. package/lib/utils/cookies.d.ts +1 -1
  26. package/lib/utils/cookies.js +5 -7
  27. package/package.json +10 -4
  28. package/lib/auth/persistence/index.d.ts +0 -1
  29. package/lib/auth/persistence/local.d.ts +0 -5
  30. package/lib/auth/persistence/local.js +0 -20
  31. package/lib/auth/persistence/methods.d.ts +0 -13
  32. package/lib/auth/persistence/methods.js +0 -87
  33. package/lib/auth/persistence/session.d.ts +0 -5
  34. package/lib/auth/persistence/session.js +0 -20
  35. package/lib/constants/cookies.d.ts +0 -3
  36. package/lib/constants/cookies.js +0 -7
  37. package/lib/constants/endpoint.d.ts +0 -4
  38. package/lib/constants/storage.d.ts +0 -1
  39. package/lib/constants/storage.js +0 -4
  40. package/lib/constants/window.d.ts +0 -4
  41. package/lib/constants/window.js +0 -7
  42. package/lib/methods/client.d.ts +0 -43
  43. package/lib/methods/client.js +0 -35
  44. package/lib/methods/dom/script.d.ts +0 -3
  45. package/lib/methods/dom/script.js +0 -50
  46. package/lib/utils/interceptor.d.ts +0 -4
  47. package/lib/utils/interceptor.js +0 -18
  48. package/lib/utils/logger.d.ts +0 -3
  49. package/lib/utils/logger.js +0 -51
  50. package/lib/utils/proxy.d.ts +0 -2
  51. package/lib/utils/proxy.js +0 -105
@@ -1,74 +1,740 @@
1
- import { Persistence } from "../auth/persistence";
2
- import { ClientConfig } from "./client";
3
- declare global {
4
- interface Window {
5
- __MSDOM: any;
6
- __MSDOMREADY: any;
7
- APP_ID: string;
8
- }
9
- }
10
- export declare type DOMConfig = ClientConfig & {
1
+ export declare type DOMConfig = {
11
2
  publicKey: string;
12
- persistence?: Persistence;
13
- useCookie?: boolean;
14
- debug?: boolean;
3
+ appId?: string;
15
4
  };
16
5
  declare const _default: {
17
6
  init: (props: DOMConfig) => {
18
- getApp(): Promise<import("@memberstack/client/lib/types/payloads").AppPayload>;
19
- getAuthProviders(): Promise<import("@memberstack/client/lib/types/payloads").AppPayload>;
20
- loginMemberEmailPassword(params: import("@memberstack/client/lib/types/params").LoginMemberEmailPasswordParams): Promise<import("@memberstack/client/lib/types/payloads").LoginMemberEmailPasswordPayload>;
21
- loginMemberAuthProvider(params: import("@memberstack/client/lib/types/params").LoginMemberAuthProviderParams): Promise<import("@memberstack/client/lib/types/payloads").LoginMemberAuthProviderPayload>;
22
- getPlan(params: import("@memberstack/client/lib/types/params").GetPlanParams): Promise<import("@memberstack/client/lib/types/payloads").GetPlanPayload>;
23
- getPlans(params?: import("@memberstack/client/lib/types/params").GetPlansParams): Promise<import("@memberstack/client/lib/types/payloads").GetPlansPayload>;
24
- getRestrictedUrlGroups(): Promise<import("@memberstack/client/lib/types/payloads").GetRestrictedUrlGroupsPayload>;
25
- getCurrentMember(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetCurrentMemberPayload>;
26
- getMemberJSON(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetMemberJSONPayload>;
27
- updateMemberJSON(params: import("@memberstack/client/lib/types/params").UpdateMemberJSONParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetMemberJSONPayload>;
28
- getMemberCards(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetMemberCardsPayload>;
29
- getMemberInvoices(params?: import("@memberstack/client/lib/types/params").GetMemberInvoicesParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetMemberInvoicesPayload>;
30
- getMemberReceipts(params?: import("@memberstack/client/lib/types/params").GetMemberReceiptsParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetMemberReceiptsPayload>;
31
- getAuthenticationClientSecret(params: import("@memberstack/client/lib/types/params").GetAuthenticationClientSecretParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetAuthenticationClientSecretPayload>;
32
- getTotalCheckoutAmount(params: import("@memberstack/client/lib/types/params").GetTotalCheckoutAmountParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").GetTotalCheckoutAmountPayload>;
33
- purchasePlans(params: import("@memberstack/client/lib/types/params").PurchasePlansParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").PurchasePlansPayload>;
34
- addPlan(params: import("@memberstack/client/lib/types/params").AddPlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").AddPlanPayload>;
35
- purchasePlansWithCheckout(params: import("@memberstack/client/lib/types/params").PurchasePlansWithCheckoutParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").PurchasePlansWithCheckoutPayload>;
36
- launchStripeCustomerPortal(params: import("@memberstack/client/lib/types/params").LaunchStripeCustomerPortalParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").LaunchStripeCustomerPortalPayload>;
37
- cancelPlan(params: import("@memberstack/client/lib/types/params").CancelPlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").CancelPlanPayload>;
38
- updateMember(params: import("@memberstack/client/lib/types/params").UpdateMemberParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").UpdateMemberPayload>;
39
- updateMemberAuth(params: import("@memberstack/client/lib/types/params").UpdateMemberAuthParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").UpdateMemberAuthPayload>;
40
- addCard(params: import("@memberstack/client/lib/types/params").AddMemberCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").AddMemberCardPayload>;
41
- updateDefaultCard(params: import("@memberstack/client/lib/types/params").UpdateDefaultCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").UpdateDefaultCardPayload>;
42
- updatePlanPayment(params: import("@memberstack/client/lib/types/params").UpdatePlanPaymentParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").UpdatePlanPaymentPayload>;
43
- signupMemberEmailPassword(params: import("@memberstack/client/lib/types/params").SignupMemberEmailPasswordParams): Promise<import("@memberstack/client/lib/types/payloads").SignupMemberEmailPasswordPayload>;
44
- signupMemberAuthProvider(params: import("@memberstack/client/lib/types/params").SignupMemberAuthProviderParams): Promise<import("@memberstack/client/lib/types/payloads").SignupMemberAuthProviderPayload>;
45
- sendMemberResetPasswordEmail(params: import("@memberstack/client/lib/types/params").SendMemberResetPasswordEmailParams): Promise<import("@memberstack/client/lib/types/payloads").SendMemberResetPasswordEmailPayload>;
46
- resetMemberPassword(params: import("@memberstack/client/lib/types/params").ResetMemberPasswordParams): Promise<import("@memberstack/client/lib/types/payloads").ResetMemberPasswordPayload>;
47
- logout(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").LogoutMemberPayload>;
48
- replacePlan(params: import("@memberstack/client/lib/types/params").ReplacePlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<import("@memberstack/client/lib/types/payloads").ReplacePlanPayload>;
7
+ openModal: (type: "LOGIN" | "SIGNUP" | "FORGOT_PASSWORD" | "RESET_PASSWORD", params?: {}) => Promise<unknown>;
8
+ hideModal: () => void;
9
+ _hideLoader: (element?: any) => void;
10
+ _showLoader: (element?: any) => void;
11
+ _showMessage: (msg: any, isError: any) => void;
12
+ getMemberCookie: () => any;
13
+ onAuthChange: (cb: any) => {
14
+ unsubscribe: () => boolean;
15
+ };
16
+ } & {
17
+ getApp(): Promise<{
18
+ data: {
19
+ id: string;
20
+ name: string;
21
+ mode: "live" | "sandbox";
22
+ plans: {
23
+ id: string;
24
+ name: string;
25
+ description: string;
26
+ status: string;
27
+ redirects: {
28
+ afterLogin: string;
29
+ afterLogout: string;
30
+ afterSignup: string;
31
+ };
32
+ prices?: [] | {
33
+ id: string;
34
+ amount: string;
35
+ interval: {
36
+ type: string;
37
+ count: number;
38
+ };
39
+ name: string;
40
+ type: string;
41
+ status: string;
42
+ currency: string;
43
+ }[];
44
+ }[];
45
+ contentGroups: {
46
+ id: string;
47
+ name: string;
48
+ key: string;
49
+ allowAllMembers: boolean;
50
+ redirect: string;
51
+ urls: {
52
+ url: string;
53
+ filter: string;
54
+ }[];
55
+ plans: {
56
+ id: string;
57
+ }[];
58
+ }[];
59
+ };
60
+ }>;
61
+ getAuthProviders(): Promise<{
62
+ data: {
63
+ id: string;
64
+ name: string;
65
+ mode: "live" | "sandbox";
66
+ plans: {
67
+ id: string;
68
+ name: string;
69
+ description: string;
70
+ status: string;
71
+ redirects: {
72
+ afterLogin: string;
73
+ afterLogout: string;
74
+ afterSignup: string;
75
+ };
76
+ prices?: [] | {
77
+ id: string;
78
+ amount: string;
79
+ interval: {
80
+ type: string;
81
+ count: number;
82
+ };
83
+ name: string;
84
+ type: string;
85
+ status: string;
86
+ currency: string;
87
+ }[];
88
+ }[];
89
+ contentGroups: {
90
+ id: string;
91
+ name: string;
92
+ key: string;
93
+ allowAllMembers: boolean;
94
+ redirect: string;
95
+ urls: {
96
+ url: string;
97
+ filter: string;
98
+ }[];
99
+ plans: {
100
+ id: string;
101
+ }[];
102
+ }[];
103
+ };
104
+ }>;
105
+ loginMemberEmailPassword(params: import("../types").LoginMemberEmailPasswordParams): Promise<{
106
+ data: {
107
+ tokens: {
108
+ accessToken: string;
109
+ expires: number;
110
+ type: "bearer";
111
+ };
112
+ member: {
113
+ id: string;
114
+ auth: {
115
+ email: string;
116
+ };
117
+ stripeCustomerId: string;
118
+ createdAt: string;
119
+ metaData: object;
120
+ customFields: object;
121
+ permissions: [] | string[];
122
+ planConnections: {
123
+ id: string;
124
+ active: boolean;
125
+ status: string;
126
+ planId: string;
127
+ type: string;
128
+ payment: {
129
+ amount: number;
130
+ currency: string;
131
+ status: string;
132
+ lastBillingDate: number;
133
+ nextBillingDate: number;
134
+ cancelAtDate: number;
135
+ lastInvoice: string;
136
+ lastReceipt: string;
137
+ card: string;
138
+ };
139
+ }[];
140
+ };
141
+ redirect: string;
142
+ loginRedirect: string;
143
+ payment: {
144
+ requirePayment: string[];
145
+ requireAuthentication: string[];
146
+ };
147
+ };
148
+ }>;
149
+ loginMemberAuthProvider(params: import("../types").LoginMemberAuthProviderParams): Promise<{
150
+ data: {
151
+ tokens: {
152
+ accessToken: string;
153
+ expires: number;
154
+ type: "bearer";
155
+ };
156
+ member: {
157
+ id: string;
158
+ auth: {
159
+ email: string;
160
+ };
161
+ stripeCustomerId: string;
162
+ createdAt: string;
163
+ metaData: object;
164
+ customFields: object;
165
+ permissions: [] | string[];
166
+ planConnections: {
167
+ id: string;
168
+ active: boolean;
169
+ status: string;
170
+ planId: string;
171
+ type: string;
172
+ payment: {
173
+ amount: number;
174
+ currency: string;
175
+ status: string;
176
+ lastBillingDate: number;
177
+ nextBillingDate: number;
178
+ cancelAtDate: number;
179
+ lastInvoice: string;
180
+ lastReceipt: string;
181
+ card: string;
182
+ };
183
+ }[];
184
+ };
185
+ redirect: string;
186
+ loginRedirect: string;
187
+ payment: {
188
+ requirePayment: string[];
189
+ requireAuthentication: string[];
190
+ };
191
+ };
192
+ }>;
193
+ getPlan(params: import("../types").GetPlanParams): Promise<{
194
+ data: {
195
+ id: string;
196
+ name: string;
197
+ description: string;
198
+ status: string;
199
+ redirects: {
200
+ afterLogin: string;
201
+ afterLogout: string;
202
+ afterSignup: string;
203
+ };
204
+ prices?: [] | {
205
+ id: string;
206
+ amount: string;
207
+ interval: {
208
+ type: string;
209
+ count: number;
210
+ };
211
+ name: string;
212
+ type: string;
213
+ status: string;
214
+ currency: string;
215
+ }[];
216
+ };
217
+ }>;
218
+ getPlans(): Promise<{
219
+ data: {
220
+ id: string;
221
+ name: string;
222
+ description: string;
223
+ status: string;
224
+ redirects: {
225
+ afterLogin: string;
226
+ afterLogout: string;
227
+ afterSignup: string;
228
+ };
229
+ prices?: [] | {
230
+ id: string;
231
+ amount: string;
232
+ interval: {
233
+ type: string;
234
+ count: number;
235
+ };
236
+ name: string;
237
+ type: string;
238
+ status: string;
239
+ currency: string;
240
+ }[];
241
+ }[];
242
+ }>;
243
+ getRestrictedUrlGroups(): Promise<{
244
+ data: {
245
+ id: string;
246
+ name: string;
247
+ key: string;
248
+ allowAllMembers: boolean;
249
+ redirect: string;
250
+ urls: {
251
+ url: string;
252
+ filter: string;
253
+ }[];
254
+ plans: {
255
+ id: string;
256
+ }[];
257
+ }[];
258
+ }>;
259
+ getCurrentMember(options?: import("./requests").GetCurrentMemberParams): Promise<{
260
+ data: {
261
+ id: string;
262
+ auth: {
263
+ email: string;
264
+ };
265
+ stripeCustomerId: string;
266
+ createdAt: string;
267
+ metaData: object;
268
+ customFields: object;
269
+ permissions: [] | string[];
270
+ planConnections: {
271
+ id: string;
272
+ active: boolean;
273
+ status: string;
274
+ planId: string;
275
+ type: string;
276
+ payment: {
277
+ amount: number;
278
+ currency: string;
279
+ status: string;
280
+ lastBillingDate: number;
281
+ nextBillingDate: number;
282
+ cancelAtDate: number;
283
+ lastInvoice: string;
284
+ lastReceipt: string;
285
+ card: string;
286
+ };
287
+ }[];
288
+ };
289
+ }>;
290
+ getMemberJSON(options?: import("./requests").MemberstackOptions): Promise<{
291
+ data: {
292
+ json: object;
293
+ };
294
+ }>;
295
+ updateMemberJSON(params: import("../types").UpdateMemberJSONParams, options?: import("./requests").MemberstackOptions): Promise<{
296
+ data: {
297
+ json: object;
298
+ };
299
+ }>;
300
+ getMemberCards(options?: import("./requests").MemberstackOptions): Promise<{
301
+ data: {
302
+ id: string;
303
+ brand: string;
304
+ expMonth: string;
305
+ expYear: string;
306
+ last4: string;
307
+ default: boolean;
308
+ }[];
309
+ }>;
310
+ getMemberInvoices(params?: import("../types").GetMemberInvoicesParams, options?: import("./requests").MemberstackOptions): Promise<{
311
+ hasNext: boolean;
312
+ endCursor: string;
313
+ totalCount: number;
314
+ data: {
315
+ id: string;
316
+ status: string;
317
+ amount: number;
318
+ url: string;
319
+ description: string;
320
+ number: string;
321
+ planConnection: string;
322
+ createdAt: string;
323
+ currency: string;
324
+ }[];
325
+ }>;
326
+ getMemberReceipts(params?: import("../types").GetMemberReceiptsParams, options?: import("./requests").MemberstackOptions): Promise<{
327
+ hasNext: boolean;
328
+ endCursor: string;
329
+ totalCount: number;
330
+ data: {
331
+ id: string;
332
+ amount: number;
333
+ url: string;
334
+ stripe?: {
335
+ url: string;
336
+ };
337
+ number: string;
338
+ purchase: string;
339
+ invoice: string;
340
+ createdAt: string;
341
+ currency: string;
342
+ }[];
343
+ }>;
344
+ getAuthenticationClientSecret(params: import("../types").GetAuthenticationClientSecretParams, options?: import("./requests").MemberstackOptions): Promise<{
345
+ data: string;
346
+ }>;
347
+ getTotalCheckoutAmount(params: import("../types").GetTotalCheckoutAmountParams, options?: import("./requests").MemberstackOptions): Promise<{
348
+ data: {
349
+ total: number;
350
+ subTotal: number;
351
+ currency: string;
352
+ setupFee?: {
353
+ enabled: boolean;
354
+ amount: number;
355
+ name: string;
356
+ };
357
+ freeTrial?: {
358
+ days: number;
359
+ enabled: boolean;
360
+ };
361
+ tax?: {
362
+ name: string;
363
+ percent: number;
364
+ description: string;
365
+ }[];
366
+ };
367
+ }>;
368
+ purchasePlans(params: import("../types").PurchasePlansParams, options?: import("./requests").MemberstackOptions): Promise<{
369
+ data: {
370
+ plan: string;
371
+ payment: {
372
+ requiresPayment: boolean;
373
+ requiresAuthentication: boolean;
374
+ };
375
+ };
376
+ }>;
377
+ addPlan(params: import("../types").AddPlanParams, options?: import("./requests").MemberstackOptions): Promise<{
378
+ data: {
379
+ redirect: string;
380
+ planConnection: {
381
+ id: string;
382
+ active: boolean;
383
+ status: string;
384
+ planId: string;
385
+ type: string;
386
+ payment: {
387
+ amount: number;
388
+ currency: string;
389
+ status: string;
390
+ lastBillingDate: number;
391
+ nextBillingDate: number;
392
+ cancelAtDate: number;
393
+ lastInvoice: string;
394
+ lastReceipt: string;
395
+ card: string;
396
+ };
397
+ };
398
+ };
399
+ }>;
400
+ purchasePlansWithCheckout(params: import("../types").PurchasePlansWithCheckoutParams, options?: import("./requests").MemberstackOptions): Promise<{
401
+ data: {
402
+ url: string;
403
+ };
404
+ }>;
405
+ launchStripeCustomerPortal(params: import("../types").LaunchStripeCustomerPortalParams, options?: import("./requests").MemberstackOptions): Promise<{
406
+ data: {
407
+ url: string;
408
+ };
409
+ }>;
410
+ cancelPlan(params: import("../types").CancelPlanParams, options?: import("./requests").MemberstackOptions): Promise<{
411
+ data: {
412
+ id: string;
413
+ auth: {
414
+ email: string;
415
+ };
416
+ stripeCustomerId: string;
417
+ createdAt: string;
418
+ metaData: object;
419
+ customFields: object;
420
+ permissions: [] | string[];
421
+ planConnections: {
422
+ id: string;
423
+ active: boolean;
424
+ status: string;
425
+ planId: string;
426
+ type: string;
427
+ payment: {
428
+ amount: number;
429
+ currency: string;
430
+ status: string;
431
+ lastBillingDate: number;
432
+ nextBillingDate: number;
433
+ cancelAtDate: number;
434
+ lastInvoice: string;
435
+ lastReceipt: string;
436
+ card: string;
437
+ };
438
+ }[];
439
+ };
440
+ }>;
441
+ updateMember(params: import("../types").UpdateMemberParams, options?: import("./requests").MemberstackOptions): Promise<{
442
+ data: {
443
+ id: string;
444
+ auth: {
445
+ email: string;
446
+ };
447
+ stripeCustomerId: string;
448
+ createdAt: string;
449
+ metaData: object;
450
+ customFields: object;
451
+ permissions: [] | string[];
452
+ planConnections: {
453
+ id: string;
454
+ active: boolean;
455
+ status: string;
456
+ planId: string;
457
+ type: string;
458
+ payment: {
459
+ amount: number;
460
+ currency: string;
461
+ status: string;
462
+ lastBillingDate: number;
463
+ nextBillingDate: number;
464
+ cancelAtDate: number;
465
+ lastInvoice: string;
466
+ lastReceipt: string;
467
+ card: string;
468
+ };
469
+ }[];
470
+ };
471
+ }>;
472
+ updateMemberAuth(params: import("../types").UpdateMemberAuthParams, options?: import("./requests").MemberstackOptions): Promise<{
473
+ data: {
474
+ id: string;
475
+ auth: {
476
+ email: string;
477
+ };
478
+ stripeCustomerId: string;
479
+ createdAt: string;
480
+ metaData: object;
481
+ customFields: object;
482
+ permissions: [] | string[];
483
+ planConnections: {
484
+ id: string;
485
+ active: boolean;
486
+ status: string;
487
+ planId: string;
488
+ type: string;
489
+ payment: {
490
+ amount: number;
491
+ currency: string;
492
+ status: string;
493
+ lastBillingDate: number;
494
+ nextBillingDate: number;
495
+ cancelAtDate: number;
496
+ lastInvoice: string;
497
+ lastReceipt: string;
498
+ card: string;
499
+ };
500
+ }[];
501
+ };
502
+ }>;
503
+ addCard(params: import("../types").AddMemberCardParams, options?: import("./requests").MemberstackOptions): Promise<{
504
+ data: {
505
+ id: string;
506
+ auth: {
507
+ email: string;
508
+ };
509
+ stripeCustomerId: string;
510
+ createdAt: string;
511
+ metaData: object;
512
+ customFields: object;
513
+ permissions: [] | string[];
514
+ planConnections: {
515
+ id: string;
516
+ active: boolean;
517
+ status: string;
518
+ planId: string;
519
+ type: string;
520
+ payment: {
521
+ amount: number;
522
+ currency: string;
523
+ status: string;
524
+ lastBillingDate: number;
525
+ nextBillingDate: number;
526
+ cancelAtDate: number;
527
+ lastInvoice: string;
528
+ lastReceipt: string;
529
+ card: string;
530
+ };
531
+ }[];
532
+ };
533
+ }>;
534
+ updateDefaultCard(params: import("../types").UpdateDefaultCardParams, options?: import("./requests").MemberstackOptions): Promise<{
535
+ data: {
536
+ id: string;
537
+ auth: {
538
+ email: string;
539
+ };
540
+ stripeCustomerId: string;
541
+ createdAt: string;
542
+ metaData: object;
543
+ customFields: object;
544
+ permissions: [] | string[];
545
+ planConnections: {
546
+ id: string;
547
+ active: boolean;
548
+ status: string;
549
+ planId: string;
550
+ type: string;
551
+ payment: {
552
+ amount: number;
553
+ currency: string;
554
+ status: string;
555
+ lastBillingDate: number;
556
+ nextBillingDate: number;
557
+ cancelAtDate: number;
558
+ lastInvoice: string;
559
+ lastReceipt: string;
560
+ card: string;
561
+ };
562
+ }[];
563
+ };
564
+ }>;
565
+ updatePlanPayment(params: import("../types").UpdatePlanPaymentParams, options?: import("./requests").MemberstackOptions): Promise<{
566
+ data: {
567
+ id: string;
568
+ auth: {
569
+ email: string;
570
+ };
571
+ stripeCustomerId: string;
572
+ createdAt: string;
573
+ metaData: object;
574
+ customFields: object;
575
+ permissions: [] | string[];
576
+ planConnections: {
577
+ id: string;
578
+ active: boolean;
579
+ status: string;
580
+ planId: string;
581
+ type: string;
582
+ payment: {
583
+ amount: number;
584
+ currency: string;
585
+ status: string;
586
+ lastBillingDate: number;
587
+ nextBillingDate: number;
588
+ cancelAtDate: number;
589
+ lastInvoice: string;
590
+ lastReceipt: string;
591
+ card: string;
592
+ };
593
+ }[];
594
+ };
595
+ }>;
596
+ signupMemberEmailPassword(params: import("../types").SignupMemberEmailPasswordParams): Promise<{
597
+ data: {
598
+ tokens: {
599
+ accessToken: string;
600
+ expires: number;
601
+ type: "bearer";
602
+ };
603
+ member: {
604
+ id: string;
605
+ auth: {
606
+ email: string;
607
+ };
608
+ stripeCustomerId: string;
609
+ createdAt: string;
610
+ metaData: object;
611
+ customFields: object;
612
+ permissions: [] | string[];
613
+ planConnections: {
614
+ id: string;
615
+ active: boolean;
616
+ status: string;
617
+ planId: string;
618
+ type: string;
619
+ payment: {
620
+ amount: number;
621
+ currency: string;
622
+ status: string;
623
+ lastBillingDate: number;
624
+ nextBillingDate: number;
625
+ cancelAtDate: number;
626
+ lastInvoice: string;
627
+ lastReceipt: string;
628
+ card: string;
629
+ };
630
+ }[];
631
+ };
632
+ redirect: string;
633
+ loginRedirect: string;
634
+ payment: {
635
+ requirePayment: string[];
636
+ requireAuthentication: string[];
637
+ };
638
+ };
639
+ }>;
640
+ signupMemberAuthProvider(params: import("../types").SignupMemberAuthProviderParams): Promise<{
641
+ data: {
642
+ tokens: {
643
+ accessToken: string;
644
+ expires: number;
645
+ type: "bearer";
646
+ };
647
+ member: {
648
+ id: string;
649
+ auth: {
650
+ email: string;
651
+ };
652
+ stripeCustomerId: string;
653
+ createdAt: string;
654
+ metaData: object;
655
+ customFields: object;
656
+ permissions: [] | string[];
657
+ planConnections: {
658
+ id: string;
659
+ active: boolean;
660
+ status: string;
661
+ planId: string;
662
+ type: string;
663
+ payment: {
664
+ amount: number;
665
+ currency: string;
666
+ status: string;
667
+ lastBillingDate: number;
668
+ nextBillingDate: number;
669
+ cancelAtDate: number;
670
+ lastInvoice: string;
671
+ lastReceipt: string;
672
+ card: string;
673
+ };
674
+ }[];
675
+ };
676
+ redirect: string;
677
+ loginRedirect: string;
678
+ payment: {
679
+ requirePayment: string[];
680
+ requireAuthentication: string[];
681
+ };
682
+ };
683
+ }>;
684
+ sendMemberResetPasswordEmail(params: import("../types").SendMemberResetPasswordEmailParams): Promise<{
685
+ data: string;
686
+ }>;
687
+ resetMemberPassword(params: import("../types").ResetMemberPasswordParams): Promise<{
688
+ data: {
689
+ id: string;
690
+ auth: {
691
+ email: string;
692
+ };
693
+ stripeCustomerId: string;
694
+ createdAt: string;
695
+ metaData: object;
696
+ customFields: object;
697
+ permissions: [] | string[];
698
+ planConnections: {
699
+ id: string;
700
+ active: boolean;
701
+ status: string;
702
+ planId: string;
703
+ type: string;
704
+ payment: {
705
+ amount: number;
706
+ currency: string;
707
+ status: string;
708
+ lastBillingDate: number;
709
+ nextBillingDate: number;
710
+ cancelAtDate: number;
711
+ lastInvoice: string;
712
+ lastReceipt: string;
713
+ card: string;
714
+ };
715
+ }[];
716
+ };
717
+ }>;
718
+ logout(options?: import("./requests").MemberstackOptions): Promise<{
719
+ data: {
720
+ redirect?: string;
721
+ };
722
+ }>;
723
+ replacePlan(params: import("../types").ReplacePlanParams, options?: import("./requests").MemberstackOptions): Promise<{
724
+ data: {
725
+ plan: string;
726
+ payment: {
727
+ requiresPayment: boolean;
728
+ requiresAuthentication: boolean;
729
+ };
730
+ };
731
+ }>;
49
732
  decodeToken({ token }: {
50
733
  token: string;
51
734
  }): Promise<Pick<import("jose").JWTPayload, "iat" | "exp"> & {
52
735
  id: string;
53
736
  type: "member";
54
737
  }>;
55
- } & {
56
- load: () => void;
57
- hideModal: () => void;
58
- onAuthChange: (cb: any) => {
59
- unsubscribe: () => boolean;
60
- };
61
- getMemberCookie: () => string;
62
- _showLoader: (element?: any) => void;
63
- _hideLoader: (element?: any) => void;
64
- _showMessage: (msg: any, isError: any) => void;
65
- openModal: (type: "LOGIN" | "SIGNUP" | "FORGOT_PASSWORD" | "PROFILE", params?: {
66
- planId?: string;
67
- priceId?: string;
68
- }, options?: {
69
- onCompleted?: (x: any) => any;
70
- onError?: (x: any) => any;
71
- }) => Promise<unknown>;
72
738
  };
73
739
  };
74
740
  export default _default;