@memberstack/dom 1.0.60-alpha.12 → 1.0.60-alpha.16

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.
@@ -1,4 +1,5 @@
1
1
  import msClient from "@memberstack/client";
2
+ import { Persistence, onAuthChange } from "../auth/persistence";
2
3
  import { OpenModalParams } from "../types/params";
3
4
  declare global {
4
5
  interface Window {
@@ -9,16 +10,1303 @@ declare global {
9
10
  export interface ClientConfig {
10
11
  publicKey: string;
11
12
  useCookie?: boolean;
13
+ persistence?: Persistence;
12
14
  token?: string;
13
15
  apiVersion?: "2021-01-07";
14
16
  }
15
- declare const DOMMethods: ({ publicKey, useCookie, token, apiVersion }: ClientConfig) => {
16
- load: () => void;
17
+ declare const DOMMethods: ({ publicKey, useCookie, token, apiVersion, persistence, }: ClientConfig) => {
18
+ load: () => any;
17
19
  openModal: (type: OpenModalParams["type"], params?: OpenModalParams["params"], options?: OpenModalParams["options"]) => any;
18
20
  hideModal: () => any;
19
21
  };
20
- export declare const init: (props: ClientConfig) => ReturnType<typeof msClient["init"]> & ReturnType<typeof DOMMethods>;
22
+ export declare const init: ({ persistence, useCookie, ...props }: ClientConfig) => {
23
+ getApp(): Promise<{
24
+ data: {
25
+ id: string;
26
+ name: string;
27
+ domains?: {
28
+ url: string;
29
+ verified: boolean;
30
+ }[];
31
+ plans: {
32
+ id: string;
33
+ name: string;
34
+ description: string;
35
+ status: string;
36
+ planPaymentOptions?: [] | {
37
+ id: string;
38
+ amount: string;
39
+ interval: {
40
+ type: string;
41
+ count: number;
42
+ };
43
+ name: string;
44
+ type: string;
45
+ status: string;
46
+ currency: string;
47
+ }[];
48
+ }[];
49
+ customFields: {
50
+ id: string;
51
+ key: string;
52
+ label: string;
53
+ plans: {
54
+ id: string;
55
+ name: string;
56
+ description: string;
57
+ status: string;
58
+ planPaymentOptions?: [] | {
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
+ planPaymentOptions?: [] | {
88
+ id: string;
89
+ amount: string;
90
+ interval: {
91
+ type: string;
92
+ count: number;
93
+ };
94
+ name: string;
95
+ type: string;
96
+ status: string;
97
+ currency: string;
98
+ }[];
99
+ }[];
100
+ customFields: {
101
+ id: string;
102
+ key: string;
103
+ label: string;
104
+ plans: {
105
+ id: string;
106
+ name: string;
107
+ description: string;
108
+ status: string;
109
+ planPaymentOptions?: [] | {
110
+ id: string;
111
+ amount: string;
112
+ interval: {
113
+ type: string;
114
+ count: number;
115
+ };
116
+ name: string;
117
+ type: string;
118
+ status: string;
119
+ currency: string;
120
+ }[];
121
+ }[];
122
+ }[];
123
+ };
124
+ }>;
125
+ loginMemberEmailPassword(params: import("@memberstack/client/lib/types/params").LoginMemberEmailPasswordParams): Promise<{
126
+ data: {
127
+ tokens: {
128
+ accessToken: string;
129
+ refreshToken: string;
130
+ expires: number;
131
+ type: "bearer";
132
+ };
133
+ member: {
134
+ id: string;
135
+ auth: {
136
+ email: string;
137
+ };
138
+ metaData: object;
139
+ customFields: object;
140
+ permissions: string[] | [];
141
+ planConnections: {
142
+ id: string;
143
+ active: boolean;
144
+ status: string;
145
+ planId: string;
146
+ type: string;
147
+ payment: {
148
+ amount: number;
149
+ currency: string;
150
+ status: string;
151
+ lastBillingDate: number;
152
+ nextBillingDate: number;
153
+ cancelAtDate: number;
154
+ lastInvoice: string;
155
+ lastReceipt: string;
156
+ card: string;
157
+ };
158
+ }[];
159
+ };
160
+ payment: {
161
+ requirePayment: string[];
162
+ requireAuthentication: string[];
163
+ };
164
+ };
165
+ }>;
166
+ loginMemberAuthProvider(params: import("@memberstack/client/lib/types/params").LoginMemberAuthProviderParams): Promise<{
167
+ data: {
168
+ tokens: {
169
+ accessToken: string;
170
+ refreshToken: string;
171
+ expires: number;
172
+ type: "bearer";
173
+ };
174
+ member: {
175
+ id: string;
176
+ auth: {
177
+ email: string;
178
+ };
179
+ metaData: object;
180
+ customFields: object;
181
+ permissions: string[] | [];
182
+ planConnections: {
183
+ id: string;
184
+ active: boolean;
185
+ status: string;
186
+ planId: string;
187
+ type: string;
188
+ payment: {
189
+ amount: number;
190
+ currency: string;
191
+ status: string;
192
+ lastBillingDate: number;
193
+ nextBillingDate: number;
194
+ cancelAtDate: number;
195
+ lastInvoice: string;
196
+ lastReceipt: string;
197
+ card: string;
198
+ };
199
+ }[];
200
+ };
201
+ payment: {
202
+ requirePayment: string[];
203
+ requireAuthentication: string[];
204
+ };
205
+ };
206
+ }>;
207
+ getPlan(params: import("@memberstack/client/lib/types/params").GetPlanParams): Promise<{
208
+ data: {
209
+ id: string;
210
+ name: string;
211
+ description: string;
212
+ status: string;
213
+ planPaymentOptions?: [] | {
214
+ id: string;
215
+ amount: string;
216
+ interval: {
217
+ type: string;
218
+ count: number;
219
+ };
220
+ name: string;
221
+ type: string;
222
+ status: string;
223
+ currency: string;
224
+ }[];
225
+ };
226
+ }>;
227
+ getPlans(params?: import("@memberstack/client/lib/types/params").GetPlansParams): Promise<{
228
+ data: {
229
+ id: string;
230
+ name: string;
231
+ description: string;
232
+ status: string;
233
+ planPaymentOptions?: [] | {
234
+ id: string;
235
+ amount: string;
236
+ interval: {
237
+ type: string;
238
+ count: number;
239
+ };
240
+ name: string;
241
+ type: string;
242
+ status: string;
243
+ currency: string;
244
+ }[];
245
+ }[];
246
+ }>;
247
+ getCurrentMember(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
248
+ data: {
249
+ id: string;
250
+ auth: {
251
+ email: string;
252
+ };
253
+ metaData: object;
254
+ customFields: object;
255
+ permissions: string[] | [];
256
+ planConnections: {
257
+ id: string;
258
+ active: boolean;
259
+ status: string;
260
+ planId: string;
261
+ type: string;
262
+ payment: {
263
+ amount: number;
264
+ currency: string;
265
+ status: string;
266
+ lastBillingDate: number;
267
+ nextBillingDate: number;
268
+ cancelAtDate: number;
269
+ lastInvoice: string;
270
+ lastReceipt: string;
271
+ card: string;
272
+ };
273
+ }[];
274
+ };
275
+ }>;
276
+ getMemberCards(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
277
+ data: {
278
+ id: string;
279
+ brand: string;
280
+ expMonth: string;
281
+ expYear: string;
282
+ last4: string;
283
+ default: boolean;
284
+ }[];
285
+ }>;
286
+ getMemberInvoices(params?: import("@memberstack/client/lib/types/params").GetMemberInvoicesParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
287
+ hasNext: boolean;
288
+ endCursor: string;
289
+ totalCount: number;
290
+ data: {
291
+ id: string;
292
+ status: string;
293
+ amount: number;
294
+ url: string;
295
+ description: string;
296
+ number: string;
297
+ planConnection: string;
298
+ }[];
299
+ }>;
300
+ getMemberReceipts(params?: import("@memberstack/client/lib/types/params").GetMemberReceiptsParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
301
+ hasNext: boolean;
302
+ endCursor: string;
303
+ totalCount: number;
304
+ data: {
305
+ id: string;
306
+ amount: number;
307
+ url: string;
308
+ stripe?: {
309
+ url: string;
310
+ };
311
+ number: string;
312
+ purchase: string;
313
+ invoice: string;
314
+ }[];
315
+ }>;
316
+ getAuthenticationClientSecret(params: import("@memberstack/client/lib/types/params").GetAuthenticationClientSecretParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
317
+ data: string;
318
+ }>;
319
+ getTotalCheckoutAmount(params: import("@memberstack/client/lib/types/params").GetTotalCheckoutAmountParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
320
+ data: {
321
+ total: number;
322
+ subTotal: number;
323
+ currency: string;
324
+ setupFee?: {
325
+ enabled: boolean;
326
+ amount: number;
327
+ name: string;
328
+ };
329
+ freeTrial?: {
330
+ days: number;
331
+ enabled: boolean;
332
+ };
333
+ tax?: {
334
+ name: string;
335
+ percent: number;
336
+ description: string;
337
+ }[];
338
+ };
339
+ }>;
340
+ purchasePlan(params: import("@memberstack/client/lib/types/params").PurchasePlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
341
+ data: {
342
+ plan: string;
343
+ payment: {
344
+ requiresPayment: boolean;
345
+ requiresAuthentication: boolean;
346
+ };
347
+ };
348
+ }>;
349
+ cancelPlan(params: import("@memberstack/client/lib/types/params").CancelPlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
350
+ data: {
351
+ id: string;
352
+ auth: {
353
+ email: string;
354
+ };
355
+ metaData: object;
356
+ customFields: object;
357
+ permissions: string[] | [];
358
+ planConnections: {
359
+ id: string;
360
+ active: boolean;
361
+ status: string;
362
+ planId: string;
363
+ type: string;
364
+ payment: {
365
+ amount: number;
366
+ currency: string;
367
+ status: string;
368
+ lastBillingDate: number;
369
+ nextBillingDate: number;
370
+ cancelAtDate: number;
371
+ lastInvoice: string;
372
+ lastReceipt: string;
373
+ card: string;
374
+ };
375
+ }[];
376
+ };
377
+ }>;
378
+ updateMember(params: import("@memberstack/client/lib/types/params").UpdateMemberParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
379
+ data: {
380
+ id: string;
381
+ auth: {
382
+ email: string;
383
+ };
384
+ metaData: object;
385
+ customFields: object;
386
+ permissions: string[] | [];
387
+ planConnections: {
388
+ id: string;
389
+ active: boolean;
390
+ status: string;
391
+ planId: string;
392
+ type: string;
393
+ payment: {
394
+ amount: number;
395
+ currency: string;
396
+ status: string;
397
+ lastBillingDate: number;
398
+ nextBillingDate: number;
399
+ cancelAtDate: number;
400
+ lastInvoice: string;
401
+ lastReceipt: string;
402
+ card: string;
403
+ };
404
+ }[];
405
+ };
406
+ }>;
407
+ updateMemberAuth(params: import("@memberstack/client/lib/types/params").UpdateMemberAuthParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
408
+ data: {
409
+ id: string;
410
+ auth: {
411
+ email: string;
412
+ };
413
+ metaData: object;
414
+ customFields: object;
415
+ permissions: string[] | [];
416
+ planConnections: {
417
+ id: string;
418
+ active: boolean;
419
+ status: string;
420
+ planId: string;
421
+ type: string;
422
+ payment: {
423
+ amount: number;
424
+ currency: string;
425
+ status: string;
426
+ lastBillingDate: number;
427
+ nextBillingDate: number;
428
+ cancelAtDate: number;
429
+ lastInvoice: string;
430
+ lastReceipt: string;
431
+ card: string;
432
+ };
433
+ }[];
434
+ };
435
+ }>;
436
+ addCard(params: import("@memberstack/client/lib/types/params").AddMemberCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
437
+ data: {
438
+ id: string;
439
+ auth: {
440
+ email: string;
441
+ };
442
+ metaData: object;
443
+ customFields: object;
444
+ permissions: string[] | [];
445
+ planConnections: {
446
+ id: string;
447
+ active: boolean;
448
+ status: string;
449
+ planId: string;
450
+ type: string;
451
+ payment: {
452
+ amount: number;
453
+ currency: string;
454
+ status: string;
455
+ lastBillingDate: number;
456
+ nextBillingDate: number;
457
+ cancelAtDate: number;
458
+ lastInvoice: string;
459
+ lastReceipt: string;
460
+ card: string;
461
+ };
462
+ }[];
463
+ };
464
+ }>;
465
+ updateDefaultCard(params: import("@memberstack/client/lib/types/params").UpdateDefaultCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
466
+ data: {
467
+ id: string;
468
+ auth: {
469
+ email: string;
470
+ };
471
+ metaData: object;
472
+ customFields: object;
473
+ permissions: string[] | [];
474
+ planConnections: {
475
+ id: string;
476
+ active: boolean;
477
+ status: string;
478
+ planId: string;
479
+ type: string;
480
+ payment: {
481
+ amount: number;
482
+ currency: string;
483
+ status: string;
484
+ lastBillingDate: number;
485
+ nextBillingDate: number;
486
+ cancelAtDate: number;
487
+ lastInvoice: string;
488
+ lastReceipt: string;
489
+ card: string;
490
+ };
491
+ }[];
492
+ };
493
+ }>;
494
+ updatePlanPayment(params: import("@memberstack/client/lib/types/params").UpdatePlanPaymentParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
495
+ data: {
496
+ id: string;
497
+ auth: {
498
+ email: string;
499
+ };
500
+ metaData: object;
501
+ customFields: object;
502
+ permissions: string[] | [];
503
+ planConnections: {
504
+ id: string;
505
+ active: boolean;
506
+ status: string;
507
+ planId: string;
508
+ type: string;
509
+ payment: {
510
+ amount: number;
511
+ currency: string;
512
+ status: string;
513
+ lastBillingDate: number;
514
+ nextBillingDate: number;
515
+ cancelAtDate: number;
516
+ lastInvoice: string;
517
+ lastReceipt: string;
518
+ card: string;
519
+ };
520
+ }[];
521
+ };
522
+ }>;
523
+ signupMemberEmailPassword(params: import("@memberstack/client/lib/types/params").SignupMemberEmailPasswordParams): Promise<{
524
+ data: {
525
+ tokens: {
526
+ accessToken: string;
527
+ refreshToken: string;
528
+ expires: number;
529
+ type: "bearer";
530
+ };
531
+ member: {
532
+ id: string;
533
+ auth: {
534
+ email: string;
535
+ };
536
+ metaData: object;
537
+ customFields: object;
538
+ permissions: string[] | [];
539
+ planConnections: {
540
+ id: string;
541
+ active: boolean;
542
+ status: string;
543
+ planId: string;
544
+ type: string;
545
+ payment: {
546
+ amount: number;
547
+ currency: string;
548
+ status: string;
549
+ lastBillingDate: number;
550
+ nextBillingDate: number;
551
+ cancelAtDate: number;
552
+ lastInvoice: string;
553
+ lastReceipt: string;
554
+ card: string;
555
+ };
556
+ }[];
557
+ };
558
+ payment: {
559
+ requirePayment: string[];
560
+ requireAuthentication: string[];
561
+ };
562
+ };
563
+ }>;
564
+ signupMemberAuthProvider(params: import("@memberstack/client/lib/types/params").SignupMemberAuthProviderParams): Promise<{
565
+ data: {
566
+ tokens: {
567
+ accessToken: string;
568
+ refreshToken: string;
569
+ expires: number;
570
+ type: "bearer";
571
+ };
572
+ member: {
573
+ id: string;
574
+ auth: {
575
+ email: string;
576
+ };
577
+ metaData: object;
578
+ customFields: object;
579
+ permissions: string[] | [];
580
+ planConnections: {
581
+ id: string;
582
+ active: boolean;
583
+ status: string;
584
+ planId: string;
585
+ type: string;
586
+ payment: {
587
+ amount: number;
588
+ currency: string;
589
+ status: string;
590
+ lastBillingDate: number;
591
+ nextBillingDate: number;
592
+ cancelAtDate: number;
593
+ lastInvoice: string;
594
+ lastReceipt: string;
595
+ card: string;
596
+ };
597
+ }[];
598
+ };
599
+ payment: {
600
+ requirePayment: string[];
601
+ requireAuthentication: string[];
602
+ };
603
+ };
604
+ }>;
605
+ refreshMemberTokens(params: import("@memberstack/client/lib/types/params").RefreshMemberTokensParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
606
+ data: {
607
+ accessToken: string;
608
+ refreshToken: string;
609
+ expires: number;
610
+ type: "bearer";
611
+ };
612
+ }>;
613
+ sendMemberResetPasswordEmail(params: import("@memberstack/client/lib/types/params").SendMemberResetPasswordEmailParams): Promise<{
614
+ data: string;
615
+ }>;
616
+ resetMemberPassword(params: import("@memberstack/client/lib/types/params").ResetMemberPasswordParams): Promise<{
617
+ data: {
618
+ id: string;
619
+ auth: {
620
+ email: string;
621
+ };
622
+ metaData: object;
623
+ customFields: object;
624
+ permissions: string[] | [];
625
+ planConnections: {
626
+ id: string;
627
+ active: boolean;
628
+ status: string;
629
+ planId: string;
630
+ type: string;
631
+ payment: {
632
+ amount: number;
633
+ currency: string;
634
+ status: string;
635
+ lastBillingDate: number;
636
+ nextBillingDate: number;
637
+ cancelAtDate: number;
638
+ lastInvoice: string;
639
+ lastReceipt: string;
640
+ card: string;
641
+ };
642
+ }[];
643
+ };
644
+ }>;
645
+ logout(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
646
+ data: {
647
+ redirect?: string;
648
+ };
649
+ }>;
650
+ replacePlan(params: import("@memberstack/client/lib/types/params").ReplacePlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
651
+ data: {
652
+ plan: string;
653
+ payment: {
654
+ requiresPayment: boolean;
655
+ requiresAuthentication: boolean;
656
+ };
657
+ };
658
+ }>;
659
+ } & {
660
+ load: () => any;
661
+ openModal: (type: OpenModalParams["type"], params?: OpenModalParams["params"], options?: OpenModalParams["options"]) => any;
662
+ hideModal: () => any;
663
+ } & {
664
+ onAuthChange: (x: (x?: any) => any) => void;
665
+ };
21
666
  export declare const Methods: {
22
- init: (props: ClientConfig) => ReturnType<typeof msClient["init"]> & ReturnType<typeof DOMMethods>;
667
+ init: ({ persistence, useCookie, ...props }: ClientConfig) => {
668
+ getApp(): Promise<{
669
+ data: {
670
+ id: string;
671
+ name: string;
672
+ domains?: {
673
+ url: string;
674
+ verified: boolean;
675
+ }[];
676
+ plans: {
677
+ id: string;
678
+ name: string;
679
+ description: string;
680
+ status: string;
681
+ planPaymentOptions?: [] | {
682
+ id: string;
683
+ amount: string;
684
+ interval: {
685
+ type: string;
686
+ count: number;
687
+ };
688
+ name: string;
689
+ type: string;
690
+ status: string;
691
+ currency: string;
692
+ }[];
693
+ }[];
694
+ customFields: {
695
+ id: string;
696
+ key: string;
697
+ label: string;
698
+ plans: {
699
+ id: string;
700
+ name: string;
701
+ description: string;
702
+ status: string;
703
+ planPaymentOptions?: [] | {
704
+ id: string;
705
+ amount: string;
706
+ interval: {
707
+ type: string;
708
+ count: number;
709
+ };
710
+ name: string;
711
+ type: string;
712
+ status: string;
713
+ currency: string;
714
+ }[];
715
+ }[];
716
+ }[];
717
+ };
718
+ }>;
719
+ getAuthProviders(): Promise<{
720
+ data: {
721
+ id: string;
722
+ name: string;
723
+ domains?: {
724
+ url: string;
725
+ verified: boolean;
726
+ }[];
727
+ plans: {
728
+ id: string;
729
+ name: string;
730
+ description: string;
731
+ status: string;
732
+ planPaymentOptions?: [] | {
733
+ id: string;
734
+ amount: string;
735
+ interval: {
736
+ type: string;
737
+ count: number;
738
+ };
739
+ name: string;
740
+ type: string;
741
+ status: string;
742
+ currency: string;
743
+ }[];
744
+ }[];
745
+ customFields: {
746
+ id: string;
747
+ key: string;
748
+ label: string;
749
+ plans: {
750
+ id: string;
751
+ name: string;
752
+ description: string;
753
+ status: string;
754
+ planPaymentOptions?: [] | {
755
+ id: string;
756
+ amount: string;
757
+ interval: {
758
+ type: string;
759
+ count: number;
760
+ };
761
+ name: string;
762
+ type: string;
763
+ status: string;
764
+ currency: string;
765
+ }[];
766
+ }[];
767
+ }[];
768
+ };
769
+ }>;
770
+ loginMemberEmailPassword(params: import("@memberstack/client/lib/types/params").LoginMemberEmailPasswordParams): Promise<{
771
+ data: {
772
+ tokens: {
773
+ accessToken: string;
774
+ refreshToken: string;
775
+ expires: number;
776
+ type: "bearer";
777
+ };
778
+ member: {
779
+ id: string;
780
+ auth: {
781
+ email: string;
782
+ };
783
+ metaData: object;
784
+ customFields: object;
785
+ permissions: string[] | [];
786
+ planConnections: {
787
+ id: string;
788
+ active: boolean;
789
+ status: string;
790
+ planId: string;
791
+ type: string;
792
+ payment: {
793
+ amount: number;
794
+ currency: string;
795
+ status: string;
796
+ lastBillingDate: number;
797
+ nextBillingDate: number;
798
+ cancelAtDate: number;
799
+ lastInvoice: string;
800
+ lastReceipt: string;
801
+ card: string;
802
+ };
803
+ }[];
804
+ };
805
+ payment: {
806
+ requirePayment: string[];
807
+ requireAuthentication: string[];
808
+ };
809
+ };
810
+ }>;
811
+ loginMemberAuthProvider(params: import("@memberstack/client/lib/types/params").LoginMemberAuthProviderParams): Promise<{
812
+ data: {
813
+ tokens: {
814
+ accessToken: string;
815
+ refreshToken: string;
816
+ expires: number;
817
+ type: "bearer";
818
+ };
819
+ member: {
820
+ id: string;
821
+ auth: {
822
+ email: string;
823
+ };
824
+ metaData: object;
825
+ customFields: object;
826
+ permissions: string[] | [];
827
+ planConnections: {
828
+ id: string;
829
+ active: boolean;
830
+ status: string;
831
+ planId: string;
832
+ type: string;
833
+ payment: {
834
+ amount: number;
835
+ currency: string;
836
+ status: string;
837
+ lastBillingDate: number;
838
+ nextBillingDate: number;
839
+ cancelAtDate: number;
840
+ lastInvoice: string;
841
+ lastReceipt: string;
842
+ card: string;
843
+ };
844
+ }[];
845
+ };
846
+ payment: {
847
+ requirePayment: string[];
848
+ requireAuthentication: string[];
849
+ };
850
+ };
851
+ }>;
852
+ getPlan(params: import("@memberstack/client/lib/types/params").GetPlanParams): Promise<{
853
+ data: {
854
+ id: string;
855
+ name: string;
856
+ description: string;
857
+ status: string;
858
+ planPaymentOptions?: [] | {
859
+ id: string;
860
+ amount: string;
861
+ interval: {
862
+ type: string;
863
+ count: number;
864
+ };
865
+ name: string;
866
+ type: string;
867
+ status: string;
868
+ currency: string;
869
+ }[];
870
+ };
871
+ }>;
872
+ getPlans(params?: import("@memberstack/client/lib/types/params").GetPlansParams): Promise<{
873
+ data: {
874
+ id: string;
875
+ name: string;
876
+ description: string;
877
+ status: string;
878
+ planPaymentOptions?: [] | {
879
+ id: string;
880
+ amount: string;
881
+ interval: {
882
+ type: string;
883
+ count: number;
884
+ };
885
+ name: string;
886
+ type: string;
887
+ status: string;
888
+ currency: string;
889
+ }[];
890
+ }[];
891
+ }>;
892
+ getCurrentMember(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
893
+ data: {
894
+ id: string;
895
+ auth: {
896
+ email: string;
897
+ };
898
+ metaData: object;
899
+ customFields: object;
900
+ permissions: string[] | [];
901
+ planConnections: {
902
+ id: string;
903
+ active: boolean;
904
+ status: string;
905
+ planId: string;
906
+ type: string;
907
+ payment: {
908
+ amount: number;
909
+ currency: string;
910
+ status: string;
911
+ lastBillingDate: number;
912
+ nextBillingDate: number;
913
+ cancelAtDate: number;
914
+ lastInvoice: string;
915
+ lastReceipt: string;
916
+ card: string;
917
+ };
918
+ }[];
919
+ };
920
+ }>;
921
+ getMemberCards(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
922
+ data: {
923
+ id: string;
924
+ brand: string;
925
+ expMonth: string;
926
+ expYear: string;
927
+ last4: string;
928
+ default: boolean;
929
+ }[];
930
+ }>;
931
+ getMemberInvoices(params?: import("@memberstack/client/lib/types/params").GetMemberInvoicesParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
932
+ hasNext: boolean;
933
+ endCursor: string;
934
+ totalCount: number;
935
+ data: {
936
+ id: string;
937
+ status: string;
938
+ amount: number;
939
+ url: string;
940
+ description: string;
941
+ number: string;
942
+ planConnection: string;
943
+ }[];
944
+ }>;
945
+ getMemberReceipts(params?: import("@memberstack/client/lib/types/params").GetMemberReceiptsParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
946
+ hasNext: boolean;
947
+ endCursor: string;
948
+ totalCount: number;
949
+ data: {
950
+ id: string;
951
+ amount: number;
952
+ url: string;
953
+ stripe?: {
954
+ url: string;
955
+ };
956
+ number: string;
957
+ purchase: string;
958
+ invoice: string;
959
+ }[];
960
+ }>;
961
+ getAuthenticationClientSecret(params: import("@memberstack/client/lib/types/params").GetAuthenticationClientSecretParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
962
+ data: string;
963
+ }>;
964
+ getTotalCheckoutAmount(params: import("@memberstack/client/lib/types/params").GetTotalCheckoutAmountParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
965
+ data: {
966
+ total: number;
967
+ subTotal: number;
968
+ currency: string;
969
+ setupFee?: {
970
+ enabled: boolean;
971
+ amount: number;
972
+ name: string;
973
+ };
974
+ freeTrial?: {
975
+ days: number;
976
+ enabled: boolean;
977
+ };
978
+ tax?: {
979
+ name: string;
980
+ percent: number;
981
+ description: string;
982
+ }[];
983
+ };
984
+ }>;
985
+ purchasePlan(params: import("@memberstack/client/lib/types/params").PurchasePlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
986
+ data: {
987
+ plan: string;
988
+ payment: {
989
+ requiresPayment: boolean;
990
+ requiresAuthentication: boolean;
991
+ };
992
+ };
993
+ }>;
994
+ cancelPlan(params: import("@memberstack/client/lib/types/params").CancelPlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
995
+ data: {
996
+ id: string;
997
+ auth: {
998
+ email: string;
999
+ };
1000
+ metaData: object;
1001
+ customFields: object;
1002
+ permissions: string[] | [];
1003
+ planConnections: {
1004
+ id: string;
1005
+ active: boolean;
1006
+ status: string;
1007
+ planId: string;
1008
+ type: string;
1009
+ payment: {
1010
+ amount: number;
1011
+ currency: string;
1012
+ status: string;
1013
+ lastBillingDate: number;
1014
+ nextBillingDate: number;
1015
+ cancelAtDate: number;
1016
+ lastInvoice: string;
1017
+ lastReceipt: string;
1018
+ card: string;
1019
+ };
1020
+ }[];
1021
+ };
1022
+ }>;
1023
+ updateMember(params: import("@memberstack/client/lib/types/params").UpdateMemberParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1024
+ data: {
1025
+ id: string;
1026
+ auth: {
1027
+ email: string;
1028
+ };
1029
+ metaData: object;
1030
+ customFields: object;
1031
+ permissions: string[] | [];
1032
+ planConnections: {
1033
+ id: string;
1034
+ active: boolean;
1035
+ status: string;
1036
+ planId: string;
1037
+ type: string;
1038
+ payment: {
1039
+ amount: number;
1040
+ currency: string;
1041
+ status: string;
1042
+ lastBillingDate: number;
1043
+ nextBillingDate: number;
1044
+ cancelAtDate: number;
1045
+ lastInvoice: string;
1046
+ lastReceipt: string;
1047
+ card: string;
1048
+ };
1049
+ }[];
1050
+ };
1051
+ }>;
1052
+ updateMemberAuth(params: import("@memberstack/client/lib/types/params").UpdateMemberAuthParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1053
+ data: {
1054
+ id: string;
1055
+ auth: {
1056
+ email: string;
1057
+ };
1058
+ metaData: object;
1059
+ customFields: object;
1060
+ permissions: string[] | [];
1061
+ planConnections: {
1062
+ id: string;
1063
+ active: boolean;
1064
+ status: string;
1065
+ planId: string;
1066
+ type: string;
1067
+ payment: {
1068
+ amount: number;
1069
+ currency: string;
1070
+ status: string;
1071
+ lastBillingDate: number;
1072
+ nextBillingDate: number;
1073
+ cancelAtDate: number;
1074
+ lastInvoice: string;
1075
+ lastReceipt: string;
1076
+ card: string;
1077
+ };
1078
+ }[];
1079
+ };
1080
+ }>;
1081
+ addCard(params: import("@memberstack/client/lib/types/params").AddMemberCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1082
+ data: {
1083
+ id: string;
1084
+ auth: {
1085
+ email: string;
1086
+ };
1087
+ metaData: object;
1088
+ customFields: object;
1089
+ permissions: string[] | [];
1090
+ planConnections: {
1091
+ id: string;
1092
+ active: boolean;
1093
+ status: string;
1094
+ planId: string;
1095
+ type: string;
1096
+ payment: {
1097
+ amount: number;
1098
+ currency: string;
1099
+ status: string;
1100
+ lastBillingDate: number;
1101
+ nextBillingDate: number;
1102
+ cancelAtDate: number;
1103
+ lastInvoice: string;
1104
+ lastReceipt: string;
1105
+ card: string;
1106
+ };
1107
+ }[];
1108
+ };
1109
+ }>;
1110
+ updateDefaultCard(params: import("@memberstack/client/lib/types/params").UpdateDefaultCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1111
+ data: {
1112
+ id: string;
1113
+ auth: {
1114
+ email: string;
1115
+ };
1116
+ metaData: object;
1117
+ customFields: object;
1118
+ permissions: string[] | [];
1119
+ planConnections: {
1120
+ id: string;
1121
+ active: boolean;
1122
+ status: string;
1123
+ planId: string;
1124
+ type: string;
1125
+ payment: {
1126
+ amount: number;
1127
+ currency: string;
1128
+ status: string;
1129
+ lastBillingDate: number;
1130
+ nextBillingDate: number;
1131
+ cancelAtDate: number;
1132
+ lastInvoice: string;
1133
+ lastReceipt: string;
1134
+ card: string;
1135
+ };
1136
+ }[];
1137
+ };
1138
+ }>;
1139
+ updatePlanPayment(params: import("@memberstack/client/lib/types/params").UpdatePlanPaymentParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1140
+ data: {
1141
+ id: string;
1142
+ auth: {
1143
+ email: string;
1144
+ };
1145
+ metaData: object;
1146
+ customFields: object;
1147
+ permissions: string[] | [];
1148
+ planConnections: {
1149
+ id: string;
1150
+ active: boolean;
1151
+ status: string;
1152
+ planId: string;
1153
+ type: string;
1154
+ payment: {
1155
+ amount: number;
1156
+ currency: string;
1157
+ status: string;
1158
+ lastBillingDate: number;
1159
+ nextBillingDate: number;
1160
+ cancelAtDate: number;
1161
+ lastInvoice: string;
1162
+ lastReceipt: string;
1163
+ card: string;
1164
+ };
1165
+ }[];
1166
+ };
1167
+ }>;
1168
+ signupMemberEmailPassword(params: import("@memberstack/client/lib/types/params").SignupMemberEmailPasswordParams): Promise<{
1169
+ data: {
1170
+ tokens: {
1171
+ accessToken: string;
1172
+ refreshToken: string;
1173
+ expires: number;
1174
+ type: "bearer";
1175
+ };
1176
+ member: {
1177
+ id: string;
1178
+ auth: {
1179
+ email: string;
1180
+ };
1181
+ metaData: object;
1182
+ customFields: object;
1183
+ permissions: string[] | [];
1184
+ planConnections: {
1185
+ id: string;
1186
+ active: boolean;
1187
+ status: string;
1188
+ planId: string;
1189
+ type: string;
1190
+ payment: {
1191
+ amount: number;
1192
+ currency: string;
1193
+ status: string;
1194
+ lastBillingDate: number;
1195
+ nextBillingDate: number;
1196
+ cancelAtDate: number;
1197
+ lastInvoice: string;
1198
+ lastReceipt: string;
1199
+ card: string;
1200
+ };
1201
+ }[];
1202
+ };
1203
+ payment: {
1204
+ requirePayment: string[];
1205
+ requireAuthentication: string[];
1206
+ };
1207
+ };
1208
+ }>;
1209
+ signupMemberAuthProvider(params: import("@memberstack/client/lib/types/params").SignupMemberAuthProviderParams): Promise<{
1210
+ data: {
1211
+ tokens: {
1212
+ accessToken: string;
1213
+ refreshToken: string;
1214
+ expires: number;
1215
+ type: "bearer";
1216
+ };
1217
+ member: {
1218
+ id: string;
1219
+ auth: {
1220
+ email: string;
1221
+ };
1222
+ metaData: object;
1223
+ customFields: object;
1224
+ permissions: string[] | [];
1225
+ planConnections: {
1226
+ id: string;
1227
+ active: boolean;
1228
+ status: string;
1229
+ planId: string;
1230
+ type: string;
1231
+ payment: {
1232
+ amount: number;
1233
+ currency: string;
1234
+ status: string;
1235
+ lastBillingDate: number;
1236
+ nextBillingDate: number;
1237
+ cancelAtDate: number;
1238
+ lastInvoice: string;
1239
+ lastReceipt: string;
1240
+ card: string;
1241
+ };
1242
+ }[];
1243
+ };
1244
+ payment: {
1245
+ requirePayment: string[];
1246
+ requireAuthentication: string[];
1247
+ };
1248
+ };
1249
+ }>;
1250
+ refreshMemberTokens(params: import("@memberstack/client/lib/types/params").RefreshMemberTokensParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1251
+ data: {
1252
+ accessToken: string;
1253
+ refreshToken: string;
1254
+ expires: number;
1255
+ type: "bearer";
1256
+ };
1257
+ }>;
1258
+ sendMemberResetPasswordEmail(params: import("@memberstack/client/lib/types/params").SendMemberResetPasswordEmailParams): Promise<{
1259
+ data: string;
1260
+ }>;
1261
+ resetMemberPassword(params: import("@memberstack/client/lib/types/params").ResetMemberPasswordParams): Promise<{
1262
+ data: {
1263
+ id: string;
1264
+ auth: {
1265
+ email: string;
1266
+ };
1267
+ metaData: object;
1268
+ customFields: object;
1269
+ permissions: string[] | [];
1270
+ planConnections: {
1271
+ id: string;
1272
+ active: boolean;
1273
+ status: string;
1274
+ planId: string;
1275
+ type: string;
1276
+ payment: {
1277
+ amount: number;
1278
+ currency: string;
1279
+ status: string;
1280
+ lastBillingDate: number;
1281
+ nextBillingDate: number;
1282
+ cancelAtDate: number;
1283
+ lastInvoice: string;
1284
+ lastReceipt: string;
1285
+ card: string;
1286
+ };
1287
+ }[];
1288
+ };
1289
+ }>;
1290
+ logout(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1291
+ data: {
1292
+ redirect?: string;
1293
+ };
1294
+ }>;
1295
+ replacePlan(params: import("@memberstack/client/lib/types/params").ReplacePlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
1296
+ data: {
1297
+ plan: string;
1298
+ payment: {
1299
+ requiresPayment: boolean;
1300
+ requiresAuthentication: boolean;
1301
+ };
1302
+ };
1303
+ }>;
1304
+ } & {
1305
+ load: () => any;
1306
+ openModal: (type: OpenModalParams["type"], params?: OpenModalParams["params"], options?: OpenModalParams["options"]) => any;
1307
+ hideModal: () => any;
1308
+ } & {
1309
+ onAuthChange: (x: (x?: any) => any) => void;
1310
+ };
23
1311
  };
24
1312
  export {};