chargebee 2.40.0 → 3.0.0-beta.1

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 +10 -1
  2. package/LICENSE +1 -1
  3. package/README.md +90 -172
  4. package/cjs/RequestWrapper.js +81 -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 +77 -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 +91 -54
  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 +36 -0
  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 +233 -724
  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 -4335
  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 +278 -900
  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 -2912
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,184 +1,209 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
3
4
  declare module 'chargebee' {
4
5
  export interface UnbilledCharge {
5
-
6
- id?:string;
7
-
8
- customer_id?:string;
9
-
10
- subscription_id?:string;
11
-
12
- date_from?:number;
13
-
14
- date_to?:number;
15
-
16
- unit_amount?:number;
17
-
18
- pricing_model?:PricingModel;
19
-
20
- quantity?:number;
21
-
22
- amount?:number;
23
-
24
- currency_code:string;
25
-
26
- discount_amount?:number;
27
-
28
- description?:string;
29
-
30
- entity_type:'plan_setup' | 'plan' | 'addon' | 'adhoc' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price';
31
-
32
- entity_id?:string;
33
-
34
- is_voided:boolean;
35
-
36
- voided_at?:number;
37
-
38
- unit_amount_in_decimal?:string;
39
-
40
- quantity_in_decimal?:string;
41
-
42
- amount_in_decimal?:string;
43
-
44
- updated_at:number;
45
-
46
- tiers?:UnbilledCharge.Tier[];
47
-
48
- is_advance_charge?:boolean;
49
-
50
- business_entity_id?:string;
51
-
52
- deleted:boolean;
6
+ id?: string;
7
+ customer_id?: string;
8
+ subscription_id?: string;
9
+ date_from?: number;
10
+ date_to?: number;
11
+ unit_amount?: number;
12
+ pricing_model?: PricingModel;
13
+ quantity?: number;
14
+ amount?: number;
15
+ currency_code: string;
16
+ discount_amount?: number;
17
+ description?: string;
18
+ entity_type:
19
+ | 'adhoc'
20
+ | 'plan_item_price'
21
+ | 'addon_item_price'
22
+ | 'charge_item_price'
23
+ | 'plan_setup'
24
+ | 'plan'
25
+ | 'addon';
26
+ entity_id?: string;
27
+ is_voided: boolean;
28
+ voided_at?: number;
29
+ unit_amount_in_decimal?: string;
30
+ quantity_in_decimal?: string;
31
+ amount_in_decimal?: string;
32
+ updated_at: number;
33
+ tiers?: UnbilledCharge.Tier[];
34
+ is_advance_charge?: boolean;
35
+ business_entity_id?: string;
36
+ deleted: boolean;
53
37
  }
38
+
54
39
  export namespace UnbilledCharge {
55
- export class UnbilledChargeResource {
56
- create_unbilled_charge(input:CreateUnbilledChargeInputParam):ChargebeeRequest<CreateUnbilledChargeResponse>;
57
-
58
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
59
-
60
- invoice_unbilled_charges(input?:InvoiceUnbilledChargesInputParam):ChargebeeRequest<InvoiceUnbilledChargesResponse>;
61
-
62
- delete(unbilled_charge_id:string):ChargebeeRequest<DeleteResponse>;
63
-
64
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
65
-
66
- invoice_now_estimate(input?:InvoiceNowEstimateInputParam):ChargebeeRequest<InvoiceNowEstimateResponse>;
67
- }
68
- export interface CreateUnbilledChargeResponse {
69
- unbilled_charges:UnbilledCharge[];
70
- }
71
- export interface CreateUnbilledChargeInputParam {
72
-
73
- addons?:{date_from?:number,date_to?:number,id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
74
-
75
- charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
76
-
77
- tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
78
-
79
- subscription_id:string;
80
-
81
- currency_code?:string;
82
- }
83
- export interface CreateResponse {
84
- unbilled_charges:UnbilledCharge[];
85
- }
86
- export interface CreateInputParam {
87
-
88
- item_prices?:{date_from?:number,date_to?:number,item_price_id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
89
-
90
- item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
91
-
92
- charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
93
-
94
- tax_providers_fields?:{field_id?:string,field_value?:string,provider_name?:string}[];
95
-
96
- subscription_id:string;
97
-
98
- currency_code?:string;
99
- }
100
- export interface InvoiceUnbilledChargesResponse {
101
- invoices:Invoice[];
40
+ export class UnbilledChargeResource {
41
+ createUnbilledCharge(
42
+ input: CreateUnbilledChargeInputParam,
43
+ headers?: ChargebeeRequestHeader,
44
+ ): Promise<ChargebeeResponse<CreateUnbilledChargeResponse>>;
45
+
46
+ create(
47
+ input: CreateInputParam,
48
+ headers?: ChargebeeRequestHeader,
49
+ ): Promise<ChargebeeResponse<CreateResponse>>;
50
+
51
+ invoiceUnbilledCharges(
52
+ input?: InvoiceUnbilledChargesInputParam,
53
+ headers?: ChargebeeRequestHeader,
54
+ ): Promise<ChargebeeResponse<InvoiceUnbilledChargesResponse>>;
55
+
56
+ delete(
57
+ unbilled_charge_id: string,
58
+ headers?: ChargebeeRequestHeader,
59
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
60
+
61
+ list(
62
+ input?: ListInputParam,
63
+ headers?: ChargebeeRequestHeader,
64
+ ): Promise<ChargebeeResponse<ListResponse>>;
65
+
66
+ invoiceNowEstimate(
67
+ input?: InvoiceNowEstimateInputParam,
68
+ headers?: ChargebeeRequestHeader,
69
+ ): Promise<ChargebeeResponse<InvoiceNowEstimateResponse>>;
102
70
  }
103
- export interface InvoiceUnbilledChargesInputParam {
104
-
105
- subscription_id?:string;
106
-
107
- customer_id?:string;
71
+
72
+ export interface CreateUnbilledChargeResponse {
73
+ unbilled_charges: UnbilledCharge[];
108
74
  }
109
- export interface DeleteResponse {
110
- unbilled_charge:UnbilledCharge;
75
+
76
+ export interface CreateResponse {
77
+ unbilled_charges: UnbilledCharge[];
111
78
  }
112
-
113
- export interface ListResponse {
114
- list:{unbilled_charge:UnbilledCharge}[];
115
-
116
- next_offset?:string;
79
+
80
+ export interface InvoiceUnbilledChargesResponse {
81
+ invoices: Invoice[];
117
82
  }
118
- export interface ListInputParam {
119
- [key : string]: any;
120
- /**
121
- * @description The number of resources to be returned.
122
83
 
123
- */
124
-
125
- limit?:number;
126
-
127
- /**
128
- * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
84
+ export interface DeleteResponse {
85
+ unbilled_charge: UnbilledCharge;
86
+ }
129
87
 
130
- */
131
-
132
- offset?:string;
133
-
134
- /**
135
- * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
88
+ export interface ListResponse {
89
+ list: { unbilled_charge: UnbilledCharge }[];
90
+ next_offset?: string;
91
+ }
136
92
 
137
- */
138
-
139
- include_deleted?:boolean;
140
-
141
- is_voided?:boolean;
142
-
143
- /**
144
- * @description A unique identifier for the subscription this charge belongs to.
93
+ export interface InvoiceNowEstimateResponse {
94
+ estimate: Estimate;
95
+ }
145
96
 
146
- */
147
-
148
- subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
149
-
150
- /**
151
- * @description A unique identifier for the customer being charged.
97
+ export interface Tier {
98
+ starting_unit: number;
99
+ ending_unit?: number;
100
+ quantity_used: number;
101
+ unit_amount: number;
102
+ starting_unit_in_decimal?: string;
103
+ ending_unit_in_decimal?: string;
104
+ quantity_used_in_decimal?: string;
105
+ unit_amount_in_decimal?: string;
106
+ }
107
+ // REQUEST PARAMS
108
+ //---------------
152
109
 
153
- */
154
-
155
- customer_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
110
+ export interface CreateUnbilledChargeInputParam {
111
+ subscription_id: string;
112
+ currency_code?: string;
113
+ addons?: AddonsCreateUnbilledChargeInputParam[];
114
+ charges?: ChargesCreateUnbilledChargeInputParam[];
115
+ tax_providers_fields?: TaxProvidersFieldsCreateUnbilledChargeInputParam[];
116
+ }
117
+ export interface CreateInputParam {
118
+ subscription_id: string;
119
+ currency_code?: string;
120
+ item_prices?: ItemPricesCreateInputParam[];
121
+ item_tiers?: ItemTiersCreateInputParam[];
122
+ charges?: ChargesCreateInputParam[];
123
+ tax_providers_fields?: TaxProvidersFieldsCreateInputParam[];
124
+ }
125
+ export interface InvoiceUnbilledChargesInputParam {
126
+ subscription_id?: string;
127
+ customer_id?: string;
156
128
  }
157
- export interface InvoiceNowEstimateResponse {
158
- estimate:Estimate;
129
+ export interface ListInputParam {
130
+ limit?: number;
131
+ offset?: string;
132
+ include_deleted?: boolean;
133
+ is_voided?: boolean;
134
+ subscription_id?: filter.String;
135
+ customer_id?: filter.String;
159
136
  }
160
137
  export interface InvoiceNowEstimateInputParam {
161
-
162
- subscription_id?:string;
163
-
164
- customer_id?:string;
165
- }
166
- export interface Tier {
167
- starting_unit:number;
168
-
169
- ending_unit?:number;
170
-
171
- quantity_used:number;
172
-
173
- unit_amount:number;
174
-
175
- starting_unit_in_decimal?:string;
176
-
177
- ending_unit_in_decimal?:string;
178
-
179
- quantity_used_in_decimal?:string;
180
-
181
- unit_amount_in_decimal?:string;
138
+ subscription_id?: string;
139
+ customer_id?: string;
140
+ }
141
+ export interface ChargesCreateUnbilledChargeInputParam {
142
+ amount?: number;
143
+ amount_in_decimal?: string;
144
+ description?: string;
145
+ taxable?: boolean;
146
+ tax_profile_id?: string;
147
+ avalara_tax_code?: string;
148
+ hsn_code?: string;
149
+ taxjar_product_code?: string;
150
+ avalara_sale_type?: AvalaraSaleType;
151
+ avalara_transaction_type?: number;
152
+ avalara_service_type?: number;
153
+ date_from?: number;
154
+ date_to?: number;
155
+ }
156
+ export interface AddonsCreateUnbilledChargeInputParam {
157
+ id?: string;
158
+ quantity?: number;
159
+ unit_price?: number;
160
+ quantity_in_decimal?: string;
161
+ unit_price_in_decimal?: string;
162
+ date_from?: number;
163
+ date_to?: number;
164
+ }
165
+ export interface TaxProvidersFieldsCreateUnbilledChargeInputParam {
166
+ provider_name?: string;
167
+ field_id?: string;
168
+ field_value?: string;
169
+ }
170
+ export interface ChargesCreateInputParam {
171
+ amount?: number;
172
+ amount_in_decimal?: string;
173
+ description?: string;
174
+ taxable?: boolean;
175
+ tax_profile_id?: string;
176
+ avalara_tax_code?: string;
177
+ hsn_code?: string;
178
+ taxjar_product_code?: string;
179
+ avalara_sale_type?: AvalaraSaleType;
180
+ avalara_transaction_type?: number;
181
+ avalara_service_type?: number;
182
+ date_from?: number;
183
+ date_to?: number;
184
+ }
185
+ export interface ItemTiersCreateInputParam {
186
+ item_price_id?: string;
187
+ starting_unit?: number;
188
+ ending_unit?: number;
189
+ price?: number;
190
+ starting_unit_in_decimal?: string;
191
+ ending_unit_in_decimal?: string;
192
+ price_in_decimal?: string;
193
+ }
194
+ export interface ItemPricesCreateInputParam {
195
+ item_price_id?: string;
196
+ quantity?: number;
197
+ quantity_in_decimal?: string;
198
+ unit_price?: number;
199
+ unit_price_in_decimal?: string;
200
+ date_from?: number;
201
+ date_to?: number;
202
+ }
203
+ export interface TaxProvidersFieldsCreateInputParam {
204
+ provider_name?: string;
205
+ field_id?: string;
206
+ field_value?: string;
182
207
  }
183
208
  }
184
- }
209
+ }