mailmeteor 0.0.9 → 0.0.11

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.
@@ -14,6 +14,101 @@ export type ErrorResponse = {
14
14
  message: string;
15
15
  code?: 'url_invalid' | 'authentication_required' | 'rate_limit' | 'resource_missing' | 'resource_conflict' | 'resource_exhausted' | 'resource_already_exists' | 'resource_action_required' | 'account_verification_required' | 'account_unauthorized' | 'account_blocked' | 'parameter_missing' | 'parameter_invalid' | 'esp_unsupported' | 'unknown_error' | 'api_error' | 'quota_exceeded' | 'sender_missing_service' | 'sender_insufficient_permission' | 'admin_role_required' | 'TEST_ERROR';
16
16
  };
17
+ export type UserIdQuery = {
18
+ expand?: Array<'billing' | 'billing.subscription'>;
19
+ };
20
+ export type UserIdParams = {
21
+ user_id: string;
22
+ };
23
+ export type UserIdResponse200 = {
24
+ id: string;
25
+ object: 'user';
26
+ email: string;
27
+ name?: string;
28
+ blocked?: boolean;
29
+ plan: string;
30
+ quota: {
31
+ limit: number;
32
+ usage: number;
33
+ available: number;
34
+ updated_at: number;
35
+ reset_at?: number | null;
36
+ };
37
+ organization: string | null;
38
+ /**
39
+ * Creation date as a Unix timestamp (ms)
40
+ */
41
+ created_at: number;
42
+ credentials?: {
43
+ google?: {
44
+ access_token?: string;
45
+ refresh_token?: string;
46
+ expiry_date?: number;
47
+ expires_in?: number;
48
+ update_date?: number;
49
+ scope?: string;
50
+ api_domain?: string;
51
+ };
52
+ microsoft?: {
53
+ access_token?: string;
54
+ refresh_token?: string;
55
+ expiry_date?: number;
56
+ expires_in?: number;
57
+ update_date?: number;
58
+ scope?: string;
59
+ api_domain?: string;
60
+ };
61
+ zoho?: {
62
+ access_token?: string;
63
+ refresh_token?: string;
64
+ expiry_date?: number;
65
+ expires_in?: number;
66
+ update_date?: number;
67
+ scope?: string;
68
+ api_domain?: string;
69
+ };
70
+ sendgrid?: {
71
+ api_key?: string;
72
+ };
73
+ };
74
+ billing?: {
75
+ customer?: string | null;
76
+ currency?: string | null;
77
+ subscription?: {
78
+ id: string;
79
+ created_at: number;
80
+ /**
81
+ * Whether the user is a billing admin
82
+ */
83
+ admin: boolean;
84
+ current_period_start: number;
85
+ current_period_end: number;
86
+ quantity: number;
87
+ currency: string;
88
+ amount: number | null;
89
+ discount_percentage?: number | null;
90
+ name: string | null;
91
+ billing_period: 'day' | 'week' | 'month' | 'year' | null;
92
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
93
+ default_payment_method: {
94
+ type: string;
95
+ brand?: string | null;
96
+ last4: string | null;
97
+ exp_month: number | null;
98
+ exp_year: number | null;
99
+ bank_name?: string | null;
100
+ } | null;
101
+ addons: {
102
+ senders?: {
103
+ quantity: number;
104
+ };
105
+ email_warmups?: {
106
+ quantity: number;
107
+ };
108
+ };
109
+ } | null;
110
+ };
111
+ };
17
112
  export type CurrentOrganizationParams = {
18
113
  user_id: string;
19
114
  };
@@ -42,78 +137,59 @@ export type MembersParams = {
42
137
  organization_id: string;
43
138
  };
44
139
  export type MembersResponse200 = Array<{
140
+ user: string;
141
+ roles: Array<'admin' | 'member'>;
142
+ created_at: number;
143
+ updated_at?: number;
144
+ id: string;
145
+ object: 'organization_member';
45
146
  email: string;
46
147
  name?: string;
47
148
  profile_picture_url?: string;
48
- role: 'admin' | 'member';
49
- /**
50
- * Creation date
51
- */
52
- created_at: string;
53
- /**
54
- * Last Update date
55
- */
56
- updated_at?: string;
57
- id: string;
58
- organization_id: string;
59
- object: 'organization_member';
149
+ organization: string;
60
150
  }>;
61
151
  export type MembersBody = {
62
152
  email: string;
63
- role: 'admin' | 'member';
153
+ roles: Array<'admin' | 'member'>;
64
154
  };
65
155
  export type MembersResponse201 = {
156
+ user: string;
157
+ roles: Array<'admin' | 'member'>;
158
+ created_at: number;
159
+ updated_at?: number;
160
+ id: string;
161
+ object: 'organization_member';
66
162
  email: string;
67
163
  name?: string;
68
164
  profile_picture_url?: string;
69
- role: 'admin' | 'member';
70
- /**
71
- * Creation date
72
- */
73
- created_at: string;
74
- /**
75
- * Last Update date
76
- */
77
- updated_at?: string;
78
- id: string;
79
- organization_id: string;
80
- object: 'organization_member';
165
+ organization: string;
81
166
  };
82
167
  export type MemberIdBody = {
83
- role: 'admin' | 'member';
168
+ roles?: Array<'admin' | 'member'>;
84
169
  };
85
170
  export type MemberIdParams = {
86
171
  organization_id: string;
87
172
  member_id: string;
88
173
  };
89
174
  export type MemberIdResponse200 = {
175
+ user: string;
176
+ roles: Array<'admin' | 'member'>;
177
+ created_at: number;
178
+ updated_at?: number;
179
+ id: string;
180
+ object: 'organization_member';
90
181
  email: string;
91
182
  name?: string;
92
183
  profile_picture_url?: string;
93
- role: 'admin' | 'member';
94
- /**
95
- * Creation date
96
- */
97
- created_at: string;
98
- /**
99
- * Last Update date
100
- */
101
- updated_at?: string;
102
- id: string;
103
- organization_id: string;
104
- object: 'organization_member';
184
+ organization: string;
105
185
  };
106
186
  export type OrganizationsResponse200 = Array<{
107
187
  name: string;
108
188
  owner: string;
109
- /**
110
- * Creation date
111
- */
112
- created_at: string;
113
- /**
114
- * Last Update date
115
- */
116
- updated_at?: string;
189
+ customer?: string;
190
+ subscription?: string;
191
+ created_at: number;
192
+ updated_at?: number;
117
193
  id: string;
118
194
  object: 'organization';
119
195
  }>;
@@ -123,14 +199,10 @@ export type OrganizationsBody = {
123
199
  export type OrganizationsResponse201 = {
124
200
  name: string;
125
201
  owner: string;
126
- /**
127
- * Creation date
128
- */
129
- created_at: string;
130
- /**
131
- * Last Update date
132
- */
133
- updated_at?: string;
202
+ customer?: string;
203
+ subscription?: string;
204
+ created_at: number;
205
+ updated_at?: number;
134
206
  id: string;
135
207
  object: 'organization';
136
208
  };
@@ -140,20 +212,45 @@ export type OrganizationIdParams = {
140
212
  export type OrganizationIdResponse200 = {
141
213
  name: string;
142
214
  owner: string;
143
- /**
144
- * Creation date
145
- */
146
- created_at: string;
147
- /**
148
- * Last Update date
149
- */
150
- updated_at?: string;
215
+ customer?: string;
216
+ subscription?: string;
217
+ created_at: number;
218
+ updated_at?: number;
151
219
  id: string;
152
220
  object: 'organization';
153
221
  };
154
222
  export type OrganizationIdBody = {
155
223
  name?: string;
156
224
  };
225
+ export type SubscriptionResponse200 = {
226
+ status: 'confirmation_required' | 'success' | 'payment_failed';
227
+ client_secret?: string;
228
+ failure_code?: string;
229
+ };
230
+ export type SubscriptionBody = {
231
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
232
+ billing_period: 'month' | 'year';
233
+ };
234
+ export type PreviewBody = {
235
+ quantity: number;
236
+ };
237
+ export type PreviewResponse200 = {
238
+ discount_percents: Array<number>;
239
+ total_excluding_tax: number;
240
+ total: number;
241
+ amount_due: number;
242
+ added_from_balance: number;
243
+ consumed_balance: number;
244
+ credited_to_balance: number;
245
+ };
246
+ export type CheckoutBody = {
247
+ price_id: string;
248
+ coupon?: string;
249
+ currency?: 'usd' | 'eur' | 'inr';
250
+ };
251
+ export type CheckoutResponse200 = {
252
+ url: string;
253
+ };
157
254
  export type ContactListsBody = {
158
255
  owner: string;
159
256
  name: string;
@@ -422,33 +519,9 @@ export type AddonsResponse200 = {
422
519
  } | null;
423
520
  };
424
521
  };
425
- export type PreviewBody = {
426
- plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
427
- billing_period: 'month' | 'year';
428
- };
429
522
  export type PreviewParams = {
430
523
  addon: 'senders' | 'email_warmups';
431
524
  };
432
- export type PreviewResponse200 = {
433
- discount_percents: Array<number>;
434
- total_excluding_tax: number;
435
- total: number;
436
- amount_due: number;
437
- added_from_balance: number;
438
- consumed_balance: number;
439
- credited_to_balance: number;
440
- lines: Array<{
441
- amount: number;
442
- billing_period: 'day' | 'week' | 'month' | 'year';
443
- proration: boolean;
444
- plan?: 'free' | 'starter' | 'pro' | 'premium' | 'business';
445
- addon?: 'senders' | 'email_warmups';
446
- }>;
447
- next_renewal: number;
448
- total_tax_amounts: Array<{
449
- amount: number;
450
- }>;
451
- };
452
525
  export type AddonBody = {
453
526
  quantity: number;
454
527
  };
@@ -460,15 +533,6 @@ export type AddonResponse200 = Array<{
460
533
  email: string;
461
534
  usage: number;
462
535
  }>;
463
- export type SubscriptionResponse200 = {
464
- status: 'confirmation_required' | 'success' | 'payment_failed';
465
- client_secret?: string;
466
- failure_code?: string;
467
- };
468
- export type SubscriptionBody = {
469
- plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
470
- billing_period: 'month' | 'year';
471
- };
472
536
  export type PricesQuery = {
473
537
  currency: string;
474
538
  };
@@ -495,6 +559,118 @@ export type PricesResponse200 = {
495
559
  };
496
560
  };
497
561
  export type OpenapiJsonResponse200 = unknown;
562
+ export type UsersRetrieveData = {
563
+ body?: never;
564
+ path: {
565
+ user_id: string;
566
+ };
567
+ query?: {
568
+ expand?: Array<'billing' | 'billing.subscription'>;
569
+ };
570
+ url: '/users/{user_id}';
571
+ };
572
+ export type UsersRetrieveErrors = {
573
+ /**
574
+ * Error response
575
+ */
576
+ default: ErrorResponse;
577
+ };
578
+ export type UsersRetrieveError = UsersRetrieveErrors[keyof UsersRetrieveErrors];
579
+ export type UsersRetrieveResponses = {
580
+ /**
581
+ * Response
582
+ */
583
+ 200: {
584
+ id: string;
585
+ object: 'user';
586
+ email: string;
587
+ name?: string;
588
+ blocked?: boolean;
589
+ plan: string;
590
+ quota: {
591
+ limit: number;
592
+ usage: number;
593
+ available: number;
594
+ updated_at: number;
595
+ reset_at?: number | null;
596
+ };
597
+ organization: string | null;
598
+ /**
599
+ * Creation date as a Unix timestamp (ms)
600
+ */
601
+ created_at: number;
602
+ credentials?: {
603
+ google?: {
604
+ access_token?: string;
605
+ refresh_token?: string;
606
+ expiry_date?: number;
607
+ expires_in?: number;
608
+ update_date?: number;
609
+ scope?: string;
610
+ api_domain?: string;
611
+ };
612
+ microsoft?: {
613
+ access_token?: string;
614
+ refresh_token?: string;
615
+ expiry_date?: number;
616
+ expires_in?: number;
617
+ update_date?: number;
618
+ scope?: string;
619
+ api_domain?: string;
620
+ };
621
+ zoho?: {
622
+ access_token?: string;
623
+ refresh_token?: string;
624
+ expiry_date?: number;
625
+ expires_in?: number;
626
+ update_date?: number;
627
+ scope?: string;
628
+ api_domain?: string;
629
+ };
630
+ sendgrid?: {
631
+ api_key?: string;
632
+ };
633
+ };
634
+ billing?: {
635
+ customer?: string | null;
636
+ currency?: string | null;
637
+ subscription?: {
638
+ id: string;
639
+ created_at: number;
640
+ /**
641
+ * Whether the user is a billing admin
642
+ */
643
+ admin: boolean;
644
+ current_period_start: number;
645
+ current_period_end: number;
646
+ quantity: number;
647
+ currency: string;
648
+ amount: number | null;
649
+ discount_percentage?: number | null;
650
+ name: string | null;
651
+ billing_period: 'day' | 'week' | 'month' | 'year' | null;
652
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
653
+ default_payment_method: {
654
+ type: string;
655
+ brand?: string | null;
656
+ last4: string | null;
657
+ exp_month: number | null;
658
+ exp_year: number | null;
659
+ bank_name?: string | null;
660
+ } | null;
661
+ addons: {
662
+ senders?: {
663
+ quantity: number;
664
+ };
665
+ email_warmups?: {
666
+ quantity: number;
667
+ };
668
+ };
669
+ } | null;
670
+ };
671
+ };
672
+ };
673
+ export type UsersRetrieveResponse = UsersRetrieveResponses[keyof UsersRetrieveResponses];
498
674
  export type UsersGetCurrentOrganizationData = {
499
675
  body?: never;
500
676
  path: {
@@ -593,7 +769,7 @@ export type UsersDeleteActionResponses = {
593
769
  204: void;
594
770
  };
595
771
  export type UsersDeleteActionResponse = UsersDeleteActionResponses[keyof UsersDeleteActionResponses];
596
- export type OrganizationMemberListData = {
772
+ export type OrganizationMembersListData = {
597
773
  body?: never;
598
774
  path: {
599
775
  organization_id: string;
@@ -604,40 +780,35 @@ export type OrganizationMemberListData = {
604
780
  };
605
781
  url: '/organizations/{organization_id}/members';
606
782
  };
607
- export type OrganizationMemberListErrors = {
783
+ export type OrganizationMembersListErrors = {
608
784
  /**
609
785
  * Error response
610
786
  */
611
787
  default: ErrorResponse;
612
788
  };
613
- export type OrganizationMemberListError = OrganizationMemberListErrors[keyof OrganizationMemberListErrors];
614
- export type OrganizationMemberListResponses = {
789
+ export type OrganizationMembersListError = OrganizationMembersListErrors[keyof OrganizationMembersListErrors];
790
+ export type OrganizationMembersListResponses = {
615
791
  /**
616
792
  * Response
617
793
  */
618
794
  200: Array<{
795
+ user: string;
796
+ roles: Array<'admin' | 'member'>;
797
+ created_at: number;
798
+ updated_at?: number;
799
+ id: string;
800
+ object: 'organization_member';
619
801
  email: string;
620
802
  name?: string;
621
803
  profile_picture_url?: string;
622
- role: 'admin' | 'member';
623
- /**
624
- * Creation date
625
- */
626
- created_at: string;
627
- /**
628
- * Last Update date
629
- */
630
- updated_at?: string;
631
- id: string;
632
- organization_id: string;
633
- object: 'organization_member';
804
+ organization: string;
634
805
  }>;
635
806
  };
636
- export type OrganizationMemberListResponse = OrganizationMemberListResponses[keyof OrganizationMemberListResponses];
637
- export type OrganizationMemberCreateData = {
807
+ export type OrganizationMembersListResponse = OrganizationMembersListResponses[keyof OrganizationMembersListResponses];
808
+ export type OrganizationMembersCreateData = {
638
809
  body: {
639
810
  email: string;
640
- role: 'admin' | 'member';
811
+ roles: Array<'admin' | 'member'>;
641
812
  };
642
813
  path: {
643
814
  organization_id: string;
@@ -645,37 +816,32 @@ export type OrganizationMemberCreateData = {
645
816
  query?: never;
646
817
  url: '/organizations/{organization_id}/members';
647
818
  };
648
- export type OrganizationMemberCreateErrors = {
819
+ export type OrganizationMembersCreateErrors = {
649
820
  /**
650
821
  * Error response
651
822
  */
652
823
  default: ErrorResponse;
653
824
  };
654
- export type OrganizationMemberCreateError = OrganizationMemberCreateErrors[keyof OrganizationMemberCreateErrors];
655
- export type OrganizationMemberCreateResponses = {
825
+ export type OrganizationMembersCreateError = OrganizationMembersCreateErrors[keyof OrganizationMembersCreateErrors];
826
+ export type OrganizationMembersCreateResponses = {
656
827
  /**
657
828
  * Response
658
829
  */
659
830
  201: {
831
+ user: string;
832
+ roles: Array<'admin' | 'member'>;
833
+ created_at: number;
834
+ updated_at?: number;
835
+ id: string;
836
+ object: 'organization_member';
660
837
  email: string;
661
838
  name?: string;
662
839
  profile_picture_url?: string;
663
- role: 'admin' | 'member';
664
- /**
665
- * Creation date
666
- */
667
- created_at: string;
668
- /**
669
- * Last Update date
670
- */
671
- updated_at?: string;
672
- id: string;
673
- organization_id: string;
674
- object: 'organization_member';
840
+ organization: string;
675
841
  };
676
842
  };
677
- export type OrganizationMemberCreateResponse = OrganizationMemberCreateResponses[keyof OrganizationMemberCreateResponses];
678
- export type OrganizationMemberDeleteData = {
843
+ export type OrganizationMembersCreateResponse = OrganizationMembersCreateResponses[keyof OrganizationMembersCreateResponses];
844
+ export type OrganizationMembersDeleteData = {
679
845
  body?: never;
680
846
  path: {
681
847
  organization_id: string;
@@ -684,23 +850,23 @@ export type OrganizationMemberDeleteData = {
684
850
  query?: never;
685
851
  url: '/organizations/{organization_id}/members/{member_id}';
686
852
  };
687
- export type OrganizationMemberDeleteErrors = {
853
+ export type OrganizationMembersDeleteErrors = {
688
854
  /**
689
855
  * Error response
690
856
  */
691
857
  default: ErrorResponse;
692
858
  };
693
- export type OrganizationMemberDeleteError = OrganizationMemberDeleteErrors[keyof OrganizationMemberDeleteErrors];
694
- export type OrganizationMemberDeleteResponses = {
859
+ export type OrganizationMembersDeleteError = OrganizationMembersDeleteErrors[keyof OrganizationMembersDeleteErrors];
860
+ export type OrganizationMembersDeleteResponses = {
695
861
  /**
696
862
  * Response
697
863
  */
698
864
  204: void;
699
865
  };
700
- export type OrganizationMemberDeleteResponse = OrganizationMemberDeleteResponses[keyof OrganizationMemberDeleteResponses];
701
- export type OrganizationMemberUpdateData = {
866
+ export type OrganizationMembersDeleteResponse = OrganizationMembersDeleteResponses[keyof OrganizationMembersDeleteResponses];
867
+ export type OrganizationMembersUpdateData = {
702
868
  body: {
703
- role: 'admin' | 'member';
869
+ roles?: Array<'admin' | 'member'>;
704
870
  };
705
871
  path: {
706
872
  organization_id: string;
@@ -709,36 +875,31 @@ export type OrganizationMemberUpdateData = {
709
875
  query?: never;
710
876
  url: '/organizations/{organization_id}/members/{member_id}';
711
877
  };
712
- export type OrganizationMemberUpdateErrors = {
878
+ export type OrganizationMembersUpdateErrors = {
713
879
  /**
714
880
  * Error response
715
881
  */
716
882
  default: ErrorResponse;
717
883
  };
718
- export type OrganizationMemberUpdateError = OrganizationMemberUpdateErrors[keyof OrganizationMemberUpdateErrors];
719
- export type OrganizationMemberUpdateResponses = {
884
+ export type OrganizationMembersUpdateError = OrganizationMembersUpdateErrors[keyof OrganizationMembersUpdateErrors];
885
+ export type OrganizationMembersUpdateResponses = {
720
886
  /**
721
887
  * Response
722
888
  */
723
889
  200: {
890
+ user: string;
891
+ roles: Array<'admin' | 'member'>;
892
+ created_at: number;
893
+ updated_at?: number;
894
+ id: string;
895
+ object: 'organization_member';
724
896
  email: string;
725
897
  name?: string;
726
898
  profile_picture_url?: string;
727
- role: 'admin' | 'member';
728
- /**
729
- * Creation date
730
- */
731
- created_at: string;
732
- /**
733
- * Last Update date
734
- */
735
- updated_at?: string;
736
- id: string;
737
- organization_id: string;
738
- object: 'organization_member';
899
+ organization: string;
739
900
  };
740
901
  };
741
- export type OrganizationMemberUpdateResponse = OrganizationMemberUpdateResponses[keyof OrganizationMemberUpdateResponses];
902
+ export type OrganizationMembersUpdateResponse = OrganizationMembersUpdateResponses[keyof OrganizationMembersUpdateResponses];
742
903
  export type OrganizationsListData = {
743
904
  body?: never;
744
905
  path?: never;
@@ -759,14 +920,10 @@ export type OrganizationsListResponses = {
759
920
  200: Array<{
760
921
  name: string;
761
922
  owner: string;
762
- /**
763
- * Creation date
764
- */
765
- created_at: string;
766
- /**
767
- * Last Update date
768
- */
769
- updated_at?: string;
923
+ customer?: string;
924
+ subscription?: string;
925
+ created_at: number;
926
+ updated_at?: number;
770
927
  id: string;
771
928
  object: 'organization';
772
929
  }>;
@@ -794,14 +951,10 @@ export type OrganizationsCreateResponses = {
794
951
  201: {
795
952
  name: string;
796
953
  owner: string;
797
- /**
798
- * Creation date
799
- */
800
- created_at: string;
801
- /**
802
- * Last Update date
803
- */
804
- updated_at?: string;
954
+ customer?: string;
955
+ subscription?: string;
956
+ created_at: number;
957
+ updated_at?: number;
805
958
  id: string;
806
959
  object: 'organization';
807
960
  };
@@ -851,14 +1004,10 @@ export type OrganizationsRetrieveResponses = {
851
1004
  200: {
852
1005
  name: string;
853
1006
  owner: string;
854
- /**
855
- * Creation date
856
- */
857
- created_at: string;
858
- /**
859
- * Last Update date
860
- */
861
- updated_at?: string;
1007
+ customer?: string;
1008
+ subscription?: string;
1009
+ created_at: number;
1010
+ updated_at?: number;
862
1011
  id: string;
863
1012
  object: 'organization';
864
1013
  };
@@ -888,19 +1037,162 @@ export type OrganizationsUpdateResponses = {
888
1037
  200: {
889
1038
  name: string;
890
1039
  owner: string;
891
- /**
892
- * Creation date
893
- */
894
- created_at: string;
895
- /**
896
- * Last Update date
897
- */
898
- updated_at?: string;
1040
+ customer?: string;
1041
+ subscription?: string;
1042
+ created_at: number;
1043
+ updated_at?: number;
899
1044
  id: string;
900
1045
  object: 'organization';
901
1046
  };
902
1047
  };
903
1048
  export type OrganizationsUpdateResponse = OrganizationsUpdateResponses[keyof OrganizationsUpdateResponses];
1049
+ export type BillingSubscriptionGetData = {
1050
+ body?: never;
1051
+ path?: never;
1052
+ query?: never;
1053
+ url: '/billing/subscription';
1054
+ };
1055
+ export type BillingSubscriptionGetErrors = {
1056
+ /**
1057
+ * Error response
1058
+ */
1059
+ default: ErrorResponse;
1060
+ };
1061
+ export type BillingSubscriptionGetError = BillingSubscriptionGetErrors[keyof BillingSubscriptionGetErrors];
1062
+ export type BillingSubscriptionGetResponses = {
1063
+ /**
1064
+ * Response
1065
+ */
1066
+ 200: {
1067
+ id: string;
1068
+ created_at: number;
1069
+ /**
1070
+ * Whether the user is a billing admin
1071
+ */
1072
+ admin: boolean;
1073
+ current_period_start: number;
1074
+ current_period_end: number;
1075
+ quantity: number;
1076
+ currency: string;
1077
+ amount: number | null;
1078
+ discount_percentage?: number | null;
1079
+ name: string | null;
1080
+ billing_period: 'day' | 'week' | 'month' | 'year' | null;
1081
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
1082
+ default_payment_method: {
1083
+ type: string;
1084
+ brand?: string | null;
1085
+ last4: string | null;
1086
+ exp_month: number | null;
1087
+ exp_year: number | null;
1088
+ bank_name?: string | null;
1089
+ } | null;
1090
+ addons: {
1091
+ senders?: {
1092
+ quantity: number;
1093
+ };
1094
+ email_warmups?: {
1095
+ quantity: number;
1096
+ };
1097
+ };
1098
+ } | null;
1099
+ };
1100
+ export type BillingSubscriptionGetResponse = BillingSubscriptionGetResponses[keyof BillingSubscriptionGetResponses];
1101
+ export type BillingSubscriptionUpdateData = {
1102
+ body: {
1103
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
1104
+ billing_period: 'month' | 'year';
1105
+ };
1106
+ path?: never;
1107
+ query?: never;
1108
+ url: '/billing/subscription';
1109
+ };
1110
+ export type BillingSubscriptionUpdateErrors = {
1111
+ /**
1112
+ * Error response
1113
+ */
1114
+ default: ErrorResponse;
1115
+ };
1116
+ export type BillingSubscriptionUpdateError = BillingSubscriptionUpdateErrors[keyof BillingSubscriptionUpdateErrors];
1117
+ export type BillingSubscriptionUpdateResponses = {
1118
+ /**
1119
+ * Response
1120
+ */
1121
+ 200: {
1122
+ status: 'confirmation_required' | 'success' | 'payment_failed';
1123
+ client_secret?: string;
1124
+ failure_code?: string;
1125
+ };
1126
+ };
1127
+ export type BillingSubscriptionUpdateResponse = BillingSubscriptionUpdateResponses[keyof BillingSubscriptionUpdateResponses];
1128
+ export type BillingSubscriptionPreviewUpdateData = {
1129
+ body: {
1130
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
1131
+ billing_period: 'month' | 'year';
1132
+ };
1133
+ path?: never;
1134
+ query?: never;
1135
+ url: '/billing/subscription/preview';
1136
+ };
1137
+ export type BillingSubscriptionPreviewUpdateErrors = {
1138
+ /**
1139
+ * Error response
1140
+ */
1141
+ default: ErrorResponse;
1142
+ };
1143
+ export type BillingSubscriptionPreviewUpdateError = BillingSubscriptionPreviewUpdateErrors[keyof BillingSubscriptionPreviewUpdateErrors];
1144
+ export type BillingSubscriptionPreviewUpdateResponses = {
1145
+ /**
1146
+ * Response
1147
+ */
1148
+ 200: {
1149
+ discount_percents: Array<number>;
1150
+ total_excluding_tax: number;
1151
+ total: number;
1152
+ amount_due: number;
1153
+ added_from_balance: number;
1154
+ consumed_balance: number;
1155
+ credited_to_balance: number;
1156
+ lines: Array<{
1157
+ amount: number;
1158
+ billing_period: 'day' | 'week' | 'month' | 'year';
1159
+ proration: boolean;
1160
+ plan?: 'free' | 'starter' | 'pro' | 'premium' | 'business';
1161
+ addon?: 'senders' | 'email_warmups';
1162
+ }>;
1163
+ next_renewal: number;
1164
+ total_tax_amounts: Array<{
1165
+ amount: number;
1166
+ }>;
1167
+ };
1168
+ };
1169
+ export type BillingSubscriptionPreviewUpdateResponse = BillingSubscriptionPreviewUpdateResponses[keyof BillingSubscriptionPreviewUpdateResponses];
1170
+ export type BillingSubscriptionCheckoutData = {
1171
+ body: {
1172
+ price_id: string;
1173
+ coupon?: string;
1174
+ currency?: 'usd' | 'eur' | 'inr';
1175
+ };
1176
+ path?: never;
1177
+ query?: never;
1178
+ url: '/billing/subscription/checkout';
1179
+ };
1180
+ export type BillingSubscriptionCheckoutErrors = {
1181
+ /**
1182
+ * Error response
1183
+ */
1184
+ default: ErrorResponse;
1185
+ };
1186
+ export type BillingSubscriptionCheckoutError = BillingSubscriptionCheckoutErrors[keyof BillingSubscriptionCheckoutErrors];
1187
+ export type BillingSubscriptionCheckoutResponses = {
1188
+ /**
1189
+ * Response
1190
+ */
1191
+ 200: {
1192
+ url: string;
1193
+ };
1194
+ };
1195
+ export type BillingSubscriptionCheckoutResponse = BillingSubscriptionCheckoutResponses[keyof BillingSubscriptionCheckoutResponses];
904
1196
  export type ContactListsCreateData = {
905
1197
  body: {
906
1198
  owner: string;
@@ -1648,123 +1940,6 @@ export type BillingAddonsUpdateResponses = {
1648
1940
  };
1649
1941
  };
1650
1942
  export type BillingAddonsUpdateResponse = BillingAddonsUpdateResponses[keyof BillingAddonsUpdateResponses];
1651
- export type BillingSubscriptionGetData = {
1652
- body?: never;
1653
- path?: never;
1654
- query?: never;
1655
- url: '/billing/subscription';
1656
- };
1657
- export type BillingSubscriptionGetErrors = {
1658
- /**
1659
- * Error response
1660
- */
1661
- default: ErrorResponse;
1662
- };
1663
- export type BillingSubscriptionGetError = BillingSubscriptionGetErrors[keyof BillingSubscriptionGetErrors];
1664
- export type BillingSubscriptionGetResponses = {
1665
- /**
1666
- * Response
1667
- */
1668
- 200: {
1669
- id: string;
1670
- created_at: number;
1671
- current_period_start: number;
1672
- current_period_end: number;
1673
- quantity: number;
1674
- currency: string;
1675
- amount: number | null;
1676
- discount_percentage?: number | null;
1677
- name: string | null;
1678
- billing_period: 'day' | 'week' | 'month' | 'year' | null;
1679
- plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
1680
- default_payment_method: {
1681
- type: string;
1682
- brand?: string | null;
1683
- last4: string | null;
1684
- exp_month: number | null;
1685
- exp_year: number | null;
1686
- bank_name?: string | null;
1687
- } | null;
1688
- addons: {
1689
- senders?: {
1690
- quantity: number;
1691
- };
1692
- email_warmups?: {
1693
- quantity: number;
1694
- };
1695
- };
1696
- } | null;
1697
- };
1698
- export type BillingSubscriptionGetResponse = BillingSubscriptionGetResponses[keyof BillingSubscriptionGetResponses];
1699
- export type BillingSubscriptionUpdateData = {
1700
- body: {
1701
- plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
1702
- billing_period: 'month' | 'year';
1703
- };
1704
- path?: never;
1705
- query?: never;
1706
- url: '/billing/subscription';
1707
- };
1708
- export type BillingSubscriptionUpdateErrors = {
1709
- /**
1710
- * Error response
1711
- */
1712
- default: ErrorResponse;
1713
- };
1714
- export type BillingSubscriptionUpdateError = BillingSubscriptionUpdateErrors[keyof BillingSubscriptionUpdateErrors];
1715
- export type BillingSubscriptionUpdateResponses = {
1716
- /**
1717
- * Response
1718
- */
1719
- 200: {
1720
- status: 'confirmation_required' | 'success' | 'payment_failed';
1721
- client_secret?: string;
1722
- failure_code?: string;
1723
- };
1724
- };
1725
- export type BillingSubscriptionUpdateResponse = BillingSubscriptionUpdateResponses[keyof BillingSubscriptionUpdateResponses];
1726
- export type BillingSubscriptionPreviewUpdateData = {
1727
- body: {
1728
- plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
1729
- billing_period: 'month' | 'year';
1730
- };
1731
- path?: never;
1732
- query?: never;
1733
- url: '/billing/subscription/preview';
1734
- };
1735
- export type BillingSubscriptionPreviewUpdateErrors = {
1736
- /**
1737
- * Error response
1738
- */
1739
- default: ErrorResponse;
1740
- };
1741
- export type BillingSubscriptionPreviewUpdateError = BillingSubscriptionPreviewUpdateErrors[keyof BillingSubscriptionPreviewUpdateErrors];
1742
- export type BillingSubscriptionPreviewUpdateResponses = {
1743
- /**
1744
- * Response
1745
- */
1746
- 200: {
1747
- discount_percents: Array<number>;
1748
- total_excluding_tax: number;
1749
- total: number;
1750
- amount_due: number;
1751
- added_from_balance: number;
1752
- consumed_balance: number;
1753
- credited_to_balance: number;
1754
- lines: Array<{
1755
- amount: number;
1756
- billing_period: 'day' | 'week' | 'month' | 'year';
1757
- proration: boolean;
1758
- plan?: 'free' | 'starter' | 'pro' | 'premium' | 'business';
1759
- addon?: 'senders' | 'email_warmups';
1760
- }>;
1761
- next_renewal: number;
1762
- total_tax_amounts: Array<{
1763
- amount: number;
1764
- }>;
1765
- };
1766
- };
1767
- export type BillingSubscriptionPreviewUpdateResponse = BillingSubscriptionPreviewUpdateResponses[keyof BillingSubscriptionPreviewUpdateResponses];
1768
1943
  export type BillingGetPricesData = {
1769
1944
  body?: never;
1770
1945
  path?: never;