@memberstack/dom 1.9.1 → 1.9.4

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