@memberstack/dom 1.0.0-beta.1 → 1.0.0-beta.10

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.
@@ -0,0 +1,644 @@
1
+ export interface ClientConfig {
2
+ publicKey: string;
3
+ useCookie?: boolean;
4
+ token?: string;
5
+ apiVersion?: "2021-01-07";
6
+ }
7
+ export declare const initClient: (props: ClientConfig) => {
8
+ getApp(): Promise<{
9
+ data: {
10
+ id: string;
11
+ name: string;
12
+ domains?: {
13
+ url: string;
14
+ verified: boolean;
15
+ }[];
16
+ plans: {
17
+ id: string;
18
+ name: string;
19
+ description: string;
20
+ status: string;
21
+ planPaymentOptions?: [] | {
22
+ id: string;
23
+ amount: string;
24
+ interval: {
25
+ type: string;
26
+ count: number;
27
+ };
28
+ name: string;
29
+ type: string;
30
+ status: string;
31
+ currency: string;
32
+ }[];
33
+ }[];
34
+ customFields: {
35
+ id: string;
36
+ key: string;
37
+ label: string;
38
+ plans: {
39
+ id: string;
40
+ name: string;
41
+ description: string;
42
+ status: string;
43
+ planPaymentOptions?: [] | {
44
+ id: string;
45
+ amount: string;
46
+ interval: {
47
+ type: string;
48
+ count: number;
49
+ };
50
+ name: string;
51
+ type: string;
52
+ status: string;
53
+ currency: string;
54
+ }[];
55
+ }[];
56
+ }[];
57
+ };
58
+ }>;
59
+ getAuthProviders(): Promise<{
60
+ data: {
61
+ id: string;
62
+ name: string;
63
+ domains?: {
64
+ url: string;
65
+ verified: boolean;
66
+ }[];
67
+ plans: {
68
+ id: string;
69
+ name: string;
70
+ description: string;
71
+ status: string;
72
+ planPaymentOptions?: [] | {
73
+ id: string;
74
+ amount: string;
75
+ interval: {
76
+ type: string;
77
+ count: number;
78
+ };
79
+ name: string;
80
+ type: string;
81
+ status: string;
82
+ currency: string;
83
+ }[];
84
+ }[];
85
+ customFields: {
86
+ id: string;
87
+ key: string;
88
+ label: string;
89
+ plans: {
90
+ id: string;
91
+ name: string;
92
+ description: string;
93
+ status: string;
94
+ planPaymentOptions?: [] | {
95
+ id: string;
96
+ amount: string;
97
+ interval: {
98
+ type: string;
99
+ count: number;
100
+ };
101
+ name: string;
102
+ type: string;
103
+ status: string;
104
+ currency: string;
105
+ }[];
106
+ }[];
107
+ }[];
108
+ };
109
+ }>;
110
+ loginMemberEmailPassword(params: import("@memberstack/client/lib/types/params").LoginMemberEmailPasswordParams): Promise<{
111
+ data: {
112
+ tokens: {
113
+ accessToken: string;
114
+ refreshToken: string;
115
+ expires: number;
116
+ type: "bearer";
117
+ };
118
+ member: {
119
+ id: string;
120
+ auth: {
121
+ email: string;
122
+ };
123
+ metaData: object;
124
+ customFields: object;
125
+ permissions: string[] | [];
126
+ planConnections: {
127
+ id: string;
128
+ active: boolean;
129
+ status: string;
130
+ planId: string;
131
+ type: string;
132
+ payment: {
133
+ amount: number;
134
+ currency: string;
135
+ status: string;
136
+ lastBillingDate: number;
137
+ nextBillingDate: number;
138
+ cancelAtDate: number;
139
+ lastInvoice: string;
140
+ lastReceipt: string;
141
+ card: string;
142
+ };
143
+ }[];
144
+ };
145
+ payment: {
146
+ requirePayment: string[];
147
+ requireAuthentication: string[];
148
+ };
149
+ };
150
+ }>;
151
+ loginMemberAuthProvider(params: import("@memberstack/client/lib/types/params").LoginMemberAuthProviderParams): Promise<{
152
+ data: {
153
+ tokens: {
154
+ accessToken: string;
155
+ refreshToken: string;
156
+ expires: number;
157
+ type: "bearer";
158
+ };
159
+ member: {
160
+ id: string;
161
+ auth: {
162
+ email: string;
163
+ };
164
+ metaData: object;
165
+ customFields: object;
166
+ permissions: string[] | [];
167
+ planConnections: {
168
+ id: string;
169
+ active: boolean;
170
+ status: string;
171
+ planId: string;
172
+ type: string;
173
+ payment: {
174
+ amount: number;
175
+ currency: string;
176
+ status: string;
177
+ lastBillingDate: number;
178
+ nextBillingDate: number;
179
+ cancelAtDate: number;
180
+ lastInvoice: string;
181
+ lastReceipt: string;
182
+ card: string;
183
+ };
184
+ }[];
185
+ };
186
+ payment: {
187
+ requirePayment: string[];
188
+ requireAuthentication: string[];
189
+ };
190
+ };
191
+ }>;
192
+ getPlan(params: import("@memberstack/client/lib/types/params").GetPlanParams): Promise<{
193
+ data: {
194
+ id: string;
195
+ name: string;
196
+ description: string;
197
+ status: string;
198
+ planPaymentOptions?: [] | {
199
+ id: string;
200
+ amount: string;
201
+ interval: {
202
+ type: string;
203
+ count: number;
204
+ };
205
+ name: string;
206
+ type: string;
207
+ status: string;
208
+ currency: string;
209
+ }[];
210
+ };
211
+ }>;
212
+ getPlans(params?: import("@memberstack/client/lib/types/params").GetPlansParams): Promise<{
213
+ data: {
214
+ id: string;
215
+ name: string;
216
+ description: string;
217
+ status: string;
218
+ planPaymentOptions?: [] | {
219
+ id: string;
220
+ amount: string;
221
+ interval: {
222
+ type: string;
223
+ count: number;
224
+ };
225
+ name: string;
226
+ type: string;
227
+ status: string;
228
+ currency: string;
229
+ }[];
230
+ }[];
231
+ }>;
232
+ getCurrentMember(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
233
+ data: {
234
+ id: string;
235
+ auth: {
236
+ email: string;
237
+ };
238
+ metaData: object;
239
+ customFields: object;
240
+ permissions: string[] | [];
241
+ planConnections: {
242
+ id: string;
243
+ active: boolean;
244
+ status: string;
245
+ planId: string;
246
+ type: string;
247
+ payment: {
248
+ amount: number;
249
+ currency: string;
250
+ status: string;
251
+ lastBillingDate: number;
252
+ nextBillingDate: number;
253
+ cancelAtDate: number;
254
+ lastInvoice: string;
255
+ lastReceipt: string;
256
+ card: string;
257
+ };
258
+ }[];
259
+ };
260
+ }>;
261
+ getMemberCards(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
262
+ data: {
263
+ id: string;
264
+ brand: string;
265
+ expMonth: string;
266
+ expYear: string;
267
+ last4: string;
268
+ default: boolean;
269
+ }[];
270
+ }>;
271
+ getMemberInvoices(params?: import("@memberstack/client/lib/types/params").GetMemberInvoicesParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
272
+ hasNext: boolean;
273
+ endCursor: string;
274
+ totalCount: number;
275
+ data: {
276
+ id: string;
277
+ status: string;
278
+ amount: number;
279
+ url: string;
280
+ description: string;
281
+ number: string;
282
+ planConnection: string;
283
+ }[];
284
+ }>;
285
+ getMemberReceipts(params?: import("@memberstack/client/lib/types/params").GetMemberReceiptsParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
286
+ hasNext: boolean;
287
+ endCursor: string;
288
+ totalCount: number;
289
+ data: {
290
+ id: string;
291
+ amount: number;
292
+ url: string;
293
+ stripe?: {
294
+ url: string;
295
+ };
296
+ number: string;
297
+ purchase: string;
298
+ invoice: string;
299
+ }[];
300
+ }>;
301
+ getAuthenticationClientSecret(params: import("@memberstack/client/lib/types/params").GetAuthenticationClientSecretParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
302
+ data: string;
303
+ }>;
304
+ getTotalCheckoutAmount(params: import("@memberstack/client/lib/types/params").GetTotalCheckoutAmountParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
305
+ data: {
306
+ total: number;
307
+ subTotal: number;
308
+ currency: string;
309
+ setupFee?: {
310
+ enabled: boolean;
311
+ amount: number;
312
+ name: string;
313
+ };
314
+ freeTrial?: {
315
+ days: number;
316
+ enabled: boolean;
317
+ };
318
+ tax?: {
319
+ name: string;
320
+ percent: number;
321
+ description: string;
322
+ }[];
323
+ };
324
+ }>;
325
+ purchasePlan(params: import("@memberstack/client/lib/types/params").PurchasePlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
326
+ data: {
327
+ plan: string;
328
+ payment: {
329
+ requiresPayment: boolean;
330
+ requiresAuthentication: boolean;
331
+ };
332
+ };
333
+ }>;
334
+ cancelPlan(params: import("@memberstack/client/lib/types/params").CancelPlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
335
+ data: {
336
+ id: string;
337
+ auth: {
338
+ email: string;
339
+ };
340
+ metaData: object;
341
+ customFields: object;
342
+ permissions: string[] | [];
343
+ planConnections: {
344
+ id: string;
345
+ active: boolean;
346
+ status: string;
347
+ planId: string;
348
+ type: string;
349
+ payment: {
350
+ amount: number;
351
+ currency: string;
352
+ status: string;
353
+ lastBillingDate: number;
354
+ nextBillingDate: number;
355
+ cancelAtDate: number;
356
+ lastInvoice: string;
357
+ lastReceipt: string;
358
+ card: string;
359
+ };
360
+ }[];
361
+ };
362
+ }>;
363
+ updateMember(params: import("@memberstack/client/lib/types/params").UpdateMemberParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
364
+ data: {
365
+ id: string;
366
+ auth: {
367
+ email: string;
368
+ };
369
+ metaData: object;
370
+ customFields: object;
371
+ permissions: string[] | [];
372
+ planConnections: {
373
+ id: string;
374
+ active: boolean;
375
+ status: string;
376
+ planId: string;
377
+ type: string;
378
+ payment: {
379
+ amount: number;
380
+ currency: string;
381
+ status: string;
382
+ lastBillingDate: number;
383
+ nextBillingDate: number;
384
+ cancelAtDate: number;
385
+ lastInvoice: string;
386
+ lastReceipt: string;
387
+ card: string;
388
+ };
389
+ }[];
390
+ };
391
+ }>;
392
+ updateMemberAuth(params: import("@memberstack/client/lib/types/params").UpdateMemberAuthParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
393
+ data: {
394
+ id: string;
395
+ auth: {
396
+ email: string;
397
+ };
398
+ metaData: object;
399
+ customFields: object;
400
+ permissions: string[] | [];
401
+ planConnections: {
402
+ id: string;
403
+ active: boolean;
404
+ status: string;
405
+ planId: string;
406
+ type: string;
407
+ payment: {
408
+ amount: number;
409
+ currency: string;
410
+ status: string;
411
+ lastBillingDate: number;
412
+ nextBillingDate: number;
413
+ cancelAtDate: number;
414
+ lastInvoice: string;
415
+ lastReceipt: string;
416
+ card: string;
417
+ };
418
+ }[];
419
+ };
420
+ }>;
421
+ addCard(params: import("@memberstack/client/lib/types/params").AddMemberCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
422
+ data: {
423
+ id: string;
424
+ auth: {
425
+ email: string;
426
+ };
427
+ metaData: object;
428
+ customFields: object;
429
+ permissions: string[] | [];
430
+ planConnections: {
431
+ id: string;
432
+ active: boolean;
433
+ status: string;
434
+ planId: string;
435
+ type: string;
436
+ payment: {
437
+ amount: number;
438
+ currency: string;
439
+ status: string;
440
+ lastBillingDate: number;
441
+ nextBillingDate: number;
442
+ cancelAtDate: number;
443
+ lastInvoice: string;
444
+ lastReceipt: string;
445
+ card: string;
446
+ };
447
+ }[];
448
+ };
449
+ }>;
450
+ updateDefaultCard(params: import("@memberstack/client/lib/types/params").UpdateDefaultCardParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
451
+ data: {
452
+ id: string;
453
+ auth: {
454
+ email: string;
455
+ };
456
+ metaData: object;
457
+ customFields: object;
458
+ permissions: string[] | [];
459
+ planConnections: {
460
+ id: string;
461
+ active: boolean;
462
+ status: string;
463
+ planId: string;
464
+ type: string;
465
+ payment: {
466
+ amount: number;
467
+ currency: string;
468
+ status: string;
469
+ lastBillingDate: number;
470
+ nextBillingDate: number;
471
+ cancelAtDate: number;
472
+ lastInvoice: string;
473
+ lastReceipt: string;
474
+ card: string;
475
+ };
476
+ }[];
477
+ };
478
+ }>;
479
+ updatePlanPayment(params: import("@memberstack/client/lib/types/params").UpdatePlanPaymentParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
480
+ data: {
481
+ id: string;
482
+ auth: {
483
+ email: string;
484
+ };
485
+ metaData: object;
486
+ customFields: object;
487
+ permissions: string[] | [];
488
+ planConnections: {
489
+ id: string;
490
+ active: boolean;
491
+ status: string;
492
+ planId: string;
493
+ type: string;
494
+ payment: {
495
+ amount: number;
496
+ currency: string;
497
+ status: string;
498
+ lastBillingDate: number;
499
+ nextBillingDate: number;
500
+ cancelAtDate: number;
501
+ lastInvoice: string;
502
+ lastReceipt: string;
503
+ card: string;
504
+ };
505
+ }[];
506
+ };
507
+ }>;
508
+ signupMemberEmailPassword(params: import("@memberstack/client/lib/types/params").SignupMemberEmailPasswordParams): Promise<{
509
+ data: {
510
+ tokens: {
511
+ accessToken: string;
512
+ refreshToken: string;
513
+ expires: number;
514
+ type: "bearer";
515
+ };
516
+ member: {
517
+ id: string;
518
+ auth: {
519
+ email: string;
520
+ };
521
+ metaData: object;
522
+ customFields: object;
523
+ permissions: string[] | [];
524
+ planConnections: {
525
+ id: string;
526
+ active: boolean;
527
+ status: string;
528
+ planId: string;
529
+ type: string;
530
+ payment: {
531
+ amount: number;
532
+ currency: string;
533
+ status: string;
534
+ lastBillingDate: number;
535
+ nextBillingDate: number;
536
+ cancelAtDate: number;
537
+ lastInvoice: string;
538
+ lastReceipt: string;
539
+ card: string;
540
+ };
541
+ }[];
542
+ };
543
+ payment: {
544
+ requirePayment: string[];
545
+ requireAuthentication: string[];
546
+ };
547
+ };
548
+ }>;
549
+ signupMemberAuthProvider(params: import("@memberstack/client/lib/types/params").SignupMemberAuthProviderParams): Promise<{
550
+ data: {
551
+ tokens: {
552
+ accessToken: string;
553
+ refreshToken: string;
554
+ expires: number;
555
+ type: "bearer";
556
+ };
557
+ member: {
558
+ id: string;
559
+ auth: {
560
+ email: string;
561
+ };
562
+ metaData: object;
563
+ customFields: object;
564
+ permissions: string[] | [];
565
+ planConnections: {
566
+ id: string;
567
+ active: boolean;
568
+ status: string;
569
+ planId: string;
570
+ type: string;
571
+ payment: {
572
+ amount: number;
573
+ currency: string;
574
+ status: string;
575
+ lastBillingDate: number;
576
+ nextBillingDate: number;
577
+ cancelAtDate: number;
578
+ lastInvoice: string;
579
+ lastReceipt: string;
580
+ card: string;
581
+ };
582
+ }[];
583
+ };
584
+ payment: {
585
+ requirePayment: string[];
586
+ requireAuthentication: string[];
587
+ };
588
+ };
589
+ }>;
590
+ refreshMemberTokens(params: import("@memberstack/client/lib/types/params").RefreshMemberTokensParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
591
+ data: {
592
+ accessToken: string;
593
+ refreshToken: string;
594
+ expires: number;
595
+ type: "bearer";
596
+ };
597
+ }>;
598
+ sendMemberResetPasswordEmail(params: import("@memberstack/client/lib/types/params").SendMemberResetPasswordEmailParams): Promise<{
599
+ data: string;
600
+ }>;
601
+ resetMemberPassword(params: import("@memberstack/client/lib/types/params").ResetMemberPasswordParams): Promise<{
602
+ data: {
603
+ id: string;
604
+ auth: {
605
+ email: string;
606
+ };
607
+ metaData: object;
608
+ customFields: object;
609
+ permissions: string[] | [];
610
+ planConnections: {
611
+ id: string;
612
+ active: boolean;
613
+ status: string;
614
+ planId: string;
615
+ type: string;
616
+ payment: {
617
+ amount: number;
618
+ currency: string;
619
+ status: string;
620
+ lastBillingDate: number;
621
+ nextBillingDate: number;
622
+ cancelAtDate: number;
623
+ lastInvoice: string;
624
+ lastReceipt: string;
625
+ card: string;
626
+ };
627
+ }[];
628
+ };
629
+ }>;
630
+ logout(options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
631
+ data: {
632
+ redirect?: string;
633
+ };
634
+ }>;
635
+ replacePlan(params: import("@memberstack/client/lib/types/params").ReplacePlanParams, options?: import("@memberstack/client/lib/methods").MemberstackOptions): Promise<{
636
+ data: {
637
+ plan: string;
638
+ payment: {
639
+ requiresPayment: boolean;
640
+ requiresAuthentication: boolean;
641
+ };
642
+ };
643
+ }>;
644
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.initClient = void 0;
7
+ var client_1 = __importDefault(require("@memberstack/client"));
8
+ var initClient = function (props) {
9
+ var client = client_1.default.init(props);
10
+ return client;
11
+ };
12
+ exports.initClient = initClient;
@@ -0,0 +1,2 @@
1
+ export { hideModal, load, openModal, OpenModalParams } from "./methods";
2
+ export { initialize } from "./script";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialize = exports.openModal = exports.load = exports.hideModal = void 0;
4
+ var methods_1 = require("./methods");
5
+ Object.defineProperty(exports, "hideModal", { enumerable: true, get: function () { return methods_1.hideModal; } });
6
+ Object.defineProperty(exports, "load", { enumerable: true, get: function () { return methods_1.load; } });
7
+ Object.defineProperty(exports, "openModal", { enumerable: true, get: function () { return methods_1.openModal; } });
8
+ var script_1 = require("./script");
9
+ Object.defineProperty(exports, "initialize", { enumerable: true, get: function () { return script_1.initialize; } });
@@ -0,0 +1,17 @@
1
+ import type { DOMConfig } from "..";
2
+ export declare type OpenModalParams = {
3
+ type: "LOGIN" | "SIGNUP" | "FORGOT_PASSWORD";
4
+ params?: {
5
+ planId?: string;
6
+ planPaymentOptionId?: string;
7
+ };
8
+ options?: {
9
+ onCompleted?: (x: any) => any;
10
+ onError?: (x: any) => any;
11
+ };
12
+ };
13
+ export declare const load: (props: {
14
+ publicKey: string;
15
+ }) => void;
16
+ export declare const openModal: (props: OpenModalParams & DOMConfig) => void;
17
+ export declare const hideModal: () => void;