chargebee 2.41.0 → 3.0.0-beta.2

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 (118) hide show
  1. package/CHANGELOG.md +11 -15
  2. package/LICENSE +1 -1
  3. package/README.md +90 -170
  4. package/cjs/RequestWrapper.js +84 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +80 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +90 -55
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +24 -35
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +230 -747
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4336
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +276 -911
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2935
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,66 +1,70 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface CouponCode {
4
-
5
- /**
6
- * @description Unique coupon code that can be redeemed only once.
6
+ code: string;
7
+ status: 'not_redeemed' | 'redeemed' | 'archived';
8
+ coupon_id: string;
9
+ coupon_set_id: string;
10
+ coupon_set_name: string;
11
+ }
7
12
 
8
- */
9
-
10
- code:string;
11
-
12
- /**
13
- * @description Status of the coupon code. \* not_redeemed - Can be applied to a subscription. \* redeemed - Cannot be applied to a subscription as the coupon code has been already used. \* archived - Cannot be applied to a subscription as it has been made inactive.
13
+ export namespace CouponCode {
14
+ export class CouponCodeResource {
15
+ create(
16
+ input: CreateInputParam,
17
+ headers?: ChargebeeRequestHeader,
18
+ ): Promise<ChargebeeResponse<CreateResponse>>;
14
19
 
15
- */
16
-
17
- status:'archived' | 'redeemed' | 'not_redeemed';
18
-
19
- /**
20
- * @description Id of the main coupon resource.
20
+ retrieve(
21
+ coupon_code_code: string,
22
+ headers?: ChargebeeRequestHeader,
23
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
21
24
 
22
- */
23
-
24
- coupon_id:string;
25
-
26
- /**
27
- * @description Uniquely identifies a coupon_set
25
+ list(
26
+ input?: ListInputParam,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<ListResponse>>;
28
29
 
29
- */
30
-
31
- coupon_set_id:string;
32
-
33
- /**
34
- * @description Coupon set name to which this coupon code would be grouped under. If the coupon set with the passed name is not present, a new coupon set will be created.
30
+ archive(
31
+ coupon_code_code: string,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<ArchiveResponse>>;
34
+ }
35
35
 
36
- */
37
-
38
- coupon_set_name:string;
39
- }
40
- export namespace CouponCode {
41
- export class CouponCodeResource {
42
- /**
43
- * @description Retrieves a specific coupon code details.
36
+ export interface CreateResponse {
37
+ coupon_code: CouponCode;
38
+ }
44
39
 
45
- */
46
-
47
- retrieve(coupon_code_code:string):ChargebeeRequest<RetrieveResponse>;
48
-
49
- /**
50
- * @description Archives a coupon code thereby making it inactive. The archived coupon code cannot be applied to any subscription.
40
+ export interface RetrieveResponse {
41
+ coupon_code: CouponCode;
42
+ }
43
+
44
+ export interface ListResponse {
45
+ list: { coupon_code: CouponCode }[];
46
+ next_offset?: string;
47
+ }
51
48
 
52
- */
53
-
54
- archive(coupon_code_code:string):ChargebeeRequest<ArchiveResponse>;
49
+ export interface ArchiveResponse {
50
+ coupon_code: CouponCode;
55
51
  }
56
- export interface RetrieveResponse {
57
- coupon_code:CouponCode;
52
+
53
+ // REQUEST PARAMS
54
+ //---------------
55
+
56
+ export interface CreateInputParam {
57
+ coupon_id: string;
58
+ coupon_set_name: string;
59
+ code: string;
58
60
  }
59
-
60
- export interface ArchiveResponse {
61
- coupon_code:CouponCode;
61
+ export interface ListInputParam {
62
+ limit?: number;
63
+ offset?: string;
64
+ code?: filter.String;
65
+ coupon_id?: filter.String;
66
+ coupon_set_name?: filter.String;
67
+ status?: filter.Enum;
62
68
  }
63
-
64
-
65
69
  }
66
- }
70
+ }
@@ -1,253 +1,111 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface CouponSet {
4
-
5
- /**
6
- * @description Uniquely identifies a coupon_set
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description Coupon id linked to coupon set
14
-
15
- */
16
-
17
- coupon_id:string;
18
-
19
- /**
20
- * @description Name of the coupon set
21
-
22
- */
23
-
24
- name:string;
25
-
26
- /**
27
- * @description No of coupon codes present in coupon set
28
-
29
- */
30
-
31
- total_count?:number;
32
-
33
- /**
34
- * @description No of redeemed codes
35
-
36
- */
37
-
38
- redeemed_count?:number;
39
-
40
- /**
41
- * @description No of archived codes
42
-
43
- */
44
-
45
- archived_count?:number;
6
+ id: string;
7
+ coupon_id: string;
8
+ name: string;
9
+ total_count?: number;
10
+ redeemed_count?: number;
11
+ archived_count?: number;
12
+ meta_data?: any;
46
13
  }
14
+
47
15
  export namespace CouponSet {
48
- export class CouponSetResource {
49
- /**
50
- * @description Create a coupon set with a coupon code compatible to your product offers and promotional discounts
51
-
52
- */
53
-
54
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
55
-
56
- /**
57
- * @description This API add coupon codes to an existing coupon set.
58
-
59
- */
60
-
61
- add_coupon_codes(coupon_set_id:string, input?:AddCouponCodesInputParam):ChargebeeRequest<AddCouponCodesResponse>;
62
-
63
- /**
64
- * @description Use this API to get the list of all the coupon sets.
65
-
66
- */
67
-
68
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
69
-
70
- /**
71
- * @description Use this API to retrieve a specific coupon set.
72
-
73
- */
74
-
75
- retrieve(coupon_set_id:string):ChargebeeRequest<RetrieveResponse>;
76
-
77
- /**
78
- * @description Use this API to update a specific coupon set by updating its &#x60;name&#x60; and the &#x60;meta_data&#x60;.
79
-
80
- */
81
-
82
- update(coupon_set_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
83
-
84
- /**
85
- * @description Use this endpoint to delete a specific coupon set
86
-
87
- */
88
-
89
- delete(coupon_set_id:string):ChargebeeRequest<DeleteResponse>;
90
-
91
- /**
92
- * @description Use this API to delete all the unutilised coupon codes from a specific coupon set.
93
-
94
- */
95
-
96
- delete_unused_coupon_codes(coupon_set_id:string):ChargebeeRequest<DeleteUnusedCouponCodesResponse>;
16
+ export class CouponSetResource {
17
+ create(
18
+ input: CreateInputParam,
19
+ headers?: ChargebeeRequestHeader,
20
+ ): Promise<ChargebeeResponse<CreateResponse>>;
21
+
22
+ addCouponCodes(
23
+ coupon_set_id: string,
24
+ input?: AddCouponCodesInputParam,
25
+ headers?: ChargebeeRequestHeader,
26
+ ): Promise<ChargebeeResponse<AddCouponCodesResponse>>;
27
+
28
+ list(
29
+ input?: ListInputParam,
30
+ headers?: ChargebeeRequestHeader,
31
+ ): Promise<ChargebeeResponse<ListResponse>>;
32
+
33
+ retrieve(
34
+ coupon_set_id: string,
35
+ headers?: ChargebeeRequestHeader,
36
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
37
+
38
+ update(
39
+ coupon_set_id: string,
40
+ input?: UpdateInputParam,
41
+ headers?: ChargebeeRequestHeader,
42
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
43
+
44
+ delete(
45
+ coupon_set_id: string,
46
+ headers?: ChargebeeRequestHeader,
47
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
48
+
49
+ deleteUnusedCouponCodes(
50
+ coupon_set_id: string,
51
+ headers?: ChargebeeRequestHeader,
52
+ ): Promise<ChargebeeResponse<DeleteUnusedCouponCodesResponse>>;
97
53
  }
98
- export interface CreateResponse {
99
- coupon_set:CouponSet;
54
+
55
+ export interface CreateResponse {
56
+ coupon_set: CouponSet;
100
57
  }
101
- export interface CreateInputParam {
102
-
103
- /**
104
- * @description Coupon id linked to coupon set.
105
-
106
- */
107
-
108
- coupon_id:string;
109
-
110
- /**
111
- * @description Name of the coupon set.
112
-
113
- */
114
-
115
- name:string;
116
-
117
- /**
118
- * @description Uniquely identifies a coupon_set.
119
-
120
- */
121
-
122
- id:string;
123
-
124
- /**
125
- * @description A collection of key-value pairs that provides extra information about the coupon set.
126
- **Note:** There&#x27;s a character limit of 65,535.
127
- [Learn more](advanced-features?prod_cat_ver&#x3D;2#metadata).
128
-
129
- */
130
-
131
- meta_data?:object;
58
+
59
+ export interface AddCouponCodesResponse {
60
+ coupon_set: CouponSet;
132
61
  }
133
- export interface AddCouponCodesResponse {
134
- coupon_set:CouponSet;
62
+
63
+ export interface ListResponse {
64
+ list: { coupon_set: CouponSet }[];
65
+ next_offset?: string;
135
66
  }
136
- export interface AddCouponCodesInputParam {
137
-
138
- /**
139
- * @description You can pass up to 100 values per API call. You can also use the Chargebee UI to pass up to 1000 codes per operation. There is no limit on the total number of coupon codes that can be included in a coupon set.
140
67
 
141
- */
142
-
143
- code?:string[];
68
+ export interface RetrieveResponse {
69
+ coupon_set: CouponSet;
144
70
  }
145
- export interface ListResponse {
146
- /**
147
- * @description Use this API to get the list of all the coupon sets.
148
-
149
- */
150
-
151
- list:{coupon_set:CouponSet}[];
152
-
153
- /**
154
- * @description Use this API to get the list of all the coupon sets.
155
-
156
- */
157
-
158
- next_offset?:string;
71
+
72
+ export interface UpdateResponse {
73
+ coupon_set: CouponSet;
159
74
  }
160
- export interface ListInputParam {
161
- [key : string]: any;
162
- /**
163
- * @description Use this API to get the list of all the coupon sets.
164
-
165
- */
166
-
167
- limit?:number;
168
-
169
- /**
170
- * @description Use this API to get the list of all the coupon sets.
171
-
172
- */
173
-
174
- offset?:string;
175
-
176
- /**
177
- * @description Use this API to get the list of all the coupon sets.
178
-
179
- */
180
-
181
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
182
-
183
- /**
184
- * @description Use this API to get the list of all the coupon sets.
185
-
186
- */
187
-
188
- name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
189
-
190
- /**
191
- * @description Use this API to get the list of all the coupon sets.
192
-
193
- */
194
-
195
- coupon_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
196
-
197
- /**
198
- * @description Use this API to get the list of all the coupon sets.
199
-
200
- */
201
-
202
- total_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
203
-
204
- /**
205
- * @description Use this API to get the list of all the coupon sets.
206
-
207
- */
208
-
209
- redeemed_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
210
-
211
- /**
212
- * @description Use this API to get the list of all the coupon sets.
213
-
214
- */
215
-
216
- archived_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
75
+
76
+ export interface DeleteResponse {
77
+ coupon_set: CouponSet;
217
78
  }
218
- export interface RetrieveResponse {
219
- coupon_set:CouponSet;
79
+
80
+ export interface DeleteUnusedCouponCodesResponse {
81
+ coupon_set: CouponSet;
220
82
  }
221
-
222
- export interface UpdateResponse {
223
- coupon_set:CouponSet;
83
+
84
+ // REQUEST PARAMS
85
+ //---------------
86
+
87
+ export interface CreateInputParam {
88
+ coupon_id: string;
89
+ name: string;
90
+ id: string;
91
+ meta_data?: any;
224
92
  }
225
- export interface UpdateInputParam {
226
-
227
- /**
228
- * @description Name of the coupon set.
229
-
230
- */
231
-
232
- name?:string;
233
-
234
- /**
235
- * @description A collection of key-value pairs that provides extra information about the coupon set.
236
- **Note:** There&#x27;s a character limit of 65,535.
237
- [Learn more](advanced-features?prod_cat_ver&#x3D;2#metadata).
238
-
239
- */
240
-
241
- meta_data?:object;
93
+ export interface AddCouponCodesInputParam {
94
+ code?: string[];
242
95
  }
243
- export interface DeleteResponse {
244
- coupon_set:CouponSet;
96
+ export interface ListInputParam {
97
+ limit?: number;
98
+ offset?: string;
99
+ id?: filter.String;
100
+ name?: filter.String;
101
+ coupon_id?: filter.String;
102
+ total_count?: filter.Number;
103
+ redeemed_count?: filter.Number;
104
+ archived_count?: filter.Number;
245
105
  }
246
-
247
- export interface DeleteUnusedCouponCodesResponse {
248
- coupon_set:CouponSet;
106
+ export interface UpdateInputParam {
107
+ name?: string;
108
+ meta_data?: any;
249
109
  }
250
-
251
-
252
110
  }
253
- }
111
+ }