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,169 +1,143 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface CreditNoteEstimate {
4
-
5
- reference_invoice_id:string;
6
-
7
- type:'adjustment' | 'refundable';
8
-
9
- price_type:PriceType;
10
-
11
- currency_code:string;
12
-
13
- sub_total:number;
14
-
15
- total:number;
16
-
17
- amount_allocated:number;
18
-
19
- amount_available:number;
20
-
21
- line_items?:CreditNoteEstimate.LineItem[];
22
-
23
- discounts?:CreditNoteEstimate.Discount[];
24
-
25
- taxes?:CreditNoteEstimate.Tax[];
26
-
27
- line_item_taxes?:CreditNoteEstimate.LineItemTax[];
28
-
29
- line_item_discounts?:CreditNoteEstimate.LineItemDiscount[];
30
-
31
- line_item_tiers?:CreditNoteEstimate.LineItemTier[];
32
-
33
- round_off_amount?:number;
34
-
35
- customer_id?:string;
6
+ reference_invoice_id: string;
7
+ type: 'adjustment' | 'refundable';
8
+ price_type: PriceType;
9
+ currency_code: string;
10
+ sub_total: number;
11
+ total: number;
12
+ amount_allocated: number;
13
+ amount_available: number;
14
+ line_items?: CreditNoteEstimate.LineItem[];
15
+ discounts?: CreditNoteEstimate.Discount[];
16
+ taxes?: CreditNoteEstimate.Tax[];
17
+ line_item_taxes?: CreditNoteEstimate.LineItemTax[];
18
+ line_item_discounts?: CreditNoteEstimate.LineItemDiscount[];
19
+ line_item_tiers?: CreditNoteEstimate.LineItemTier[];
20
+ round_off_amount?: number;
21
+ customer_id?: string;
36
22
  }
23
+
37
24
  export namespace CreditNoteEstimate {
38
-
39
-
40
- export interface LineItem {
41
- id?:string;
42
-
43
- subscription_id?:string;
44
-
45
- date_from:number;
46
-
47
- date_to:number;
48
-
49
- unit_amount:number;
50
-
51
- quantity?:number;
52
-
53
- amount?:number;
54
-
55
- pricing_model?:'flat_fee' | 'per_unit' | 'tiered' | 'volume' | 'stairstep';
56
-
57
- is_taxed:boolean;
58
-
59
- tax_amount?:number;
60
-
61
- tax_rate?:number;
62
-
63
- unit_amount_in_decimal?:string;
64
-
65
- quantity_in_decimal?:string;
66
-
67
- amount_in_decimal?:string;
68
-
69
- discount_amount?:number;
70
-
71
- item_level_discount_amount?:number;
72
-
73
- usage_percentage?:string;
74
-
75
- reference_line_item_id?:string;
76
-
77
- description:string;
78
-
79
- entity_description?:string;
80
-
81
- entity_type:'adhoc' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price' | 'plan_setup' | 'plan' | 'addon';
82
-
83
- tax_exempt_reason?:'tax_not_configured' | 'region_non_taxable' | 'export' | 'customer_exempt' | 'product_exempt' | 'zero_rated' | 'reverse_charge' | 'high_value_physical_goods' | 'zero_value_item' | 'tax_not_configured_external_provider';
84
-
85
- entity_id?:string;
86
-
87
- customer_id?:string;
25
+ export interface LineItem {
26
+ id?: string;
27
+ subscription_id?: string;
28
+ date_from: number;
29
+ date_to: number;
30
+ unit_amount: number;
31
+ quantity?: number;
32
+ amount?: number;
33
+ pricing_model?:
34
+ | 'flat_fee'
35
+ | 'per_unit'
36
+ | 'tiered'
37
+ | 'volume'
38
+ | 'stairstep';
39
+ is_taxed: boolean;
40
+ tax_amount?: number;
41
+ tax_rate?: number;
42
+ unit_amount_in_decimal?: string;
43
+ quantity_in_decimal?: string;
44
+ amount_in_decimal?: string;
45
+ discount_amount?: number;
46
+ item_level_discount_amount?: number;
47
+ usage_percentage?: string;
48
+ reference_line_item_id?: string;
49
+ description: string;
50
+ entity_description?: string;
51
+ entity_type:
52
+ | 'adhoc'
53
+ | 'plan_item_price'
54
+ | 'addon_item_price'
55
+ | 'charge_item_price'
56
+ | 'plan_setup'
57
+ | 'plan'
58
+ | 'addon';
59
+ tax_exempt_reason?:
60
+ | 'tax_not_configured'
61
+ | 'region_non_taxable'
62
+ | 'export'
63
+ | 'customer_exempt'
64
+ | 'product_exempt'
65
+ | 'zero_rated'
66
+ | 'reverse_charge'
67
+ | 'high_value_physical_goods'
68
+ | 'zero_value_item'
69
+ | 'tax_not_configured_external_provider';
70
+ entity_id?: string;
71
+ customer_id?: string;
88
72
  }
89
- export interface Discount {
90
- amount:number;
91
-
92
- description?:string;
93
-
94
- entity_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
95
-
96
- entity_id?:string;
97
-
98
- coupon_set_code?:string;
73
+ export interface Discount {
74
+ amount: number;
75
+ description?: string;
76
+ entity_type:
77
+ | 'item_level_coupon'
78
+ | 'document_level_coupon'
79
+ | 'promotional_credits'
80
+ | 'prorated_credits'
81
+ | 'item_level_discount'
82
+ | 'document_level_discount';
83
+ entity_id?: string;
84
+ coupon_set_code?: string;
99
85
  }
100
- export interface Tax {
101
- name:string;
102
-
103
- amount:number;
104
-
105
- description?:string;
86
+ export interface Tax {
87
+ name: string;
88
+ amount: number;
89
+ description?: string;
106
90
  }
107
- export interface LineItemTax {
108
- line_item_id?:string;
109
-
110
- tax_name:string;
111
-
112
- tax_rate:number;
113
-
114
- date_to?:number;
115
-
116
- date_from?:number;
117
-
118
- prorated_taxable_amount?:number;
119
-
120
- is_partial_tax_applied?:boolean;
121
-
122
- is_non_compliance_tax?:boolean;
123
-
124
- taxable_amount:number;
125
-
126
- tax_amount:number;
127
-
128
- tax_juris_type?:'country' | 'federal' | 'state' | 'county' | 'city' | 'special' | 'unincorporated' | 'other';
129
-
130
- tax_juris_name?:string;
131
-
132
- tax_juris_code?:string;
133
-
134
- tax_amount_in_local_currency?:number;
135
-
136
- local_currency_code?:string;
91
+ export interface LineItemTax {
92
+ line_item_id?: string;
93
+ tax_name: string;
94
+ tax_rate: number;
95
+ date_to?: number;
96
+ date_from?: number;
97
+ prorated_taxable_amount?: number;
98
+ is_partial_tax_applied?: boolean;
99
+ is_non_compliance_tax?: boolean;
100
+ taxable_amount: number;
101
+ tax_amount: number;
102
+ tax_juris_type?:
103
+ | 'country'
104
+ | 'federal'
105
+ | 'state'
106
+ | 'county'
107
+ | 'city'
108
+ | 'special'
109
+ | 'unincorporated'
110
+ | 'other';
111
+ tax_juris_name?: string;
112
+ tax_juris_code?: string;
113
+ tax_amount_in_local_currency?: number;
114
+ local_currency_code?: string;
137
115
  }
138
- export interface LineItemDiscount {
139
- line_item_id:string;
140
-
141
- discount_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
142
-
143
- coupon_id?:string;
144
-
145
- entity_id?:string;
146
-
147
- discount_amount:number;
116
+ export interface LineItemDiscount {
117
+ line_item_id: string;
118
+ discount_type:
119
+ | 'item_level_coupon'
120
+ | 'document_level_coupon'
121
+ | 'promotional_credits'
122
+ | 'prorated_credits'
123
+ | 'item_level_discount'
124
+ | 'document_level_discount';
125
+ coupon_id?: string;
126
+ entity_id?: string;
127
+ discount_amount: number;
148
128
  }
149
- export interface LineItemTier {
150
- line_item_id?:string;
151
-
152
- starting_unit:number;
153
-
154
- ending_unit?:number;
155
-
156
- quantity_used:number;
157
-
158
- unit_amount:number;
159
-
160
- starting_unit_in_decimal?:string;
161
-
162
- ending_unit_in_decimal?:string;
163
-
164
- quantity_used_in_decimal?:string;
165
-
166
- unit_amount_in_decimal?:string;
129
+ export interface LineItemTier {
130
+ line_item_id?: string;
131
+ starting_unit: number;
132
+ ending_unit?: number;
133
+ quantity_used: number;
134
+ unit_amount: number;
135
+ starting_unit_in_decimal?: string;
136
+ ending_unit_in_decimal?: string;
137
+ quantity_used_in_decimal?: string;
138
+ unit_amount_in_decimal?: string;
167
139
  }
140
+ // REQUEST PARAMS
141
+ //---------------
168
142
  }
169
- }
143
+ }
@@ -1,78 +1,91 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface Currency {
4
-
5
- id?:string;
6
-
7
- enabled:boolean;
8
-
9
- forex_type?:'manual' | 'auto';
10
-
11
- currency_code?:string;
12
-
13
- is_base_currency?:boolean;
14
-
15
- manual_exchange_rate?:string;
6
+ id?: string;
7
+ enabled: boolean;
8
+ forex_type?: 'manual' | 'auto';
9
+ currency_code?: string;
10
+ is_base_currency?: boolean;
11
+ manual_exchange_rate?: string;
16
12
  }
13
+
17
14
  export namespace Currency {
18
- export class CurrencyResource {
19
- list():ChargebeeRequest<ListResponse>;
20
-
21
- retrieve(site_currency_id:string):ChargebeeRequest<RetrieveResponse>;
22
-
23
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
24
-
25
- update(site_currency_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
26
-
27
- add_schedule(site_currency_id:string, input:AddScheduleInputParam):ChargebeeRequest<AddScheduleResponse>;
28
-
29
- remove_schedule(site_currency_id:string):ChargebeeRequest<RemoveScheduleResponse>;
15
+ export class CurrencyResource {
16
+ list(
17
+ headers?: ChargebeeRequestHeader,
18
+ ): Promise<ChargebeeResponse<ListResponse>>;
19
+
20
+ retrieve(
21
+ site_currency_id: string,
22
+ headers?: ChargebeeRequestHeader,
23
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
24
+
25
+ create(
26
+ input: CreateInputParam,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<CreateResponse>>;
29
+
30
+ update(
31
+ site_currency_id: string,
32
+ input: UpdateInputParam,
33
+ headers?: ChargebeeRequestHeader,
34
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
35
+
36
+ addSchedule(
37
+ site_currency_id: string,
38
+ input: AddScheduleInputParam,
39
+ headers?: ChargebeeRequestHeader,
40
+ ): Promise<ChargebeeResponse<AddScheduleResponse>>;
41
+
42
+ removeSchedule(
43
+ site_currency_id: string,
44
+ headers?: ChargebeeRequestHeader,
45
+ ): Promise<ChargebeeResponse<RemoveScheduleResponse>>;
30
46
  }
31
- export interface ListResponse {
32
- currency:Currency;
47
+
48
+ export interface ListResponse {
49
+ currency: Currency;
33
50
  }
34
-
35
- export interface RetrieveResponse {
36
- currency:Currency;
51
+
52
+ export interface RetrieveResponse {
53
+ currency: Currency;
37
54
  }
38
-
39
- export interface CreateResponse {
40
- currency:Currency;
55
+
56
+ export interface CreateResponse {
57
+ currency: Currency;
41
58
  }
42
- export interface CreateInputParam {
43
-
44
- currency_code:string;
45
-
46
- forex_type:'manual' | 'auto';
47
-
48
- manual_exchange_rate?:string;
59
+
60
+ export interface UpdateResponse {
61
+ currency: Currency;
49
62
  }
50
- export interface UpdateResponse {
51
- currency:Currency;
63
+
64
+ export interface AddScheduleResponse {
65
+ scheduled_at: number;
66
+ currency: Currency;
52
67
  }
53
- export interface UpdateInputParam {
54
-
55
- forex_type:'manual' | 'auto';
56
-
57
- manual_exchange_rate?:string;
68
+
69
+ export interface RemoveScheduleResponse {
70
+ scheduled_at: number;
71
+ currency: Currency;
72
+ }
73
+
74
+ // REQUEST PARAMS
75
+ //---------------
76
+
77
+ export interface CreateInputParam {
78
+ currency_code: string;
79
+ forex_type: 'manual' | 'auto';
80
+ manual_exchange_rate?: string;
58
81
  }
59
- export interface AddScheduleResponse {
60
- scheduled_at:number;
61
-
62
- currency:Currency;
82
+ export interface UpdateInputParam {
83
+ forex_type: 'manual' | 'auto';
84
+ manual_exchange_rate?: string;
63
85
  }
64
86
  export interface AddScheduleInputParam {
65
-
66
- manual_exchange_rate:string;
67
-
68
- schedule_at:number;
69
- }
70
- export interface RemoveScheduleResponse {
71
- scheduled_at:number;
72
-
73
- currency:Currency;
87
+ manual_exchange_rate: string;
88
+ schedule_at: number;
74
89
  }
75
-
76
-
77
90
  }
78
- }
91
+ }