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,123 +1,48 @@
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 Installment {
4
-
5
- /**
6
- * @description An auto-generated unique identifier for the Payment installment.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description The ID of the invoice to which this installment belongs.
14
-
15
- */
16
-
17
- invoice_id:string;
18
-
19
- /**
20
- * @description The date when this installment is in effect.
21
-
22
- */
23
-
24
- date:number;
25
-
26
- /**
27
- * @description The part of invoice.amount_due allocated to this installment.
28
-
29
- */
30
-
31
- amount:number;
32
-
33
- /**
34
- * @description The payment status of the installment. Possible values are paid, payment_due: The payment is due, posted. \* posted - The invoice is finalized but the payment is not due yet. \* payment_due - The payment is due. One or more payments were attempted for the installment but were unsuccessful. \* paid - The installment has been paid.
35
-
36
- */
37
-
38
- status:'paid' | 'posted' | 'payment_due';
39
-
40
- /**
41
- * @description The time when this resource was created.
42
-
43
- */
44
-
45
- created_at:number;
46
-
47
- resource_version?:number;
48
-
49
- /**
50
- * @description The time when this resource was last updated.
51
-
52
- */
53
-
54
- updated_at?:number;
6
+ id: string;
7
+ invoice_id: string;
8
+ date: number;
9
+ amount: number;
10
+ status: 'posted' | 'payment_due' | 'paid';
11
+ created_at: number;
12
+ resource_version?: number;
13
+ updated_at?: number;
55
14
  }
56
- export namespace Installment {
57
- export class InstallmentResource {
58
- /**
59
- * @description Retrieves a specific installment resource.
60
15
 
61
- */
62
-
63
- retrieve(installment_id:string):ChargebeeRequest<RetrieveResponse>;
64
-
65
- /**
66
- * @description Lists the installments that match the criteria provided in the filter parameters.
67
-
68
- */
69
-
70
- list(input:ListInputParam):ChargebeeRequest<ListResponse>;
71
- }
72
- export interface RetrieveResponse {
73
- installment:Installment;
16
+ export namespace Installment {
17
+ export class InstallmentResource {
18
+ retrieve(
19
+ installment_id: string,
20
+ headers?: ChargebeeRequestHeader,
21
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
22
+
23
+ list(
24
+ input: ListInputParam,
25
+ headers?: ChargebeeRequestHeader,
26
+ ): Promise<ChargebeeResponse<ListResponse>>;
74
27
  }
75
-
76
- export interface ListResponse {
77
- /**
78
- * @description Lists the installments that match the criteria provided in the filter parameters.
79
-
80
- */
81
-
82
- list:{installment:Installment}[];
83
-
84
- /**
85
- * @description Lists the installments that match the criteria provided in the filter parameters.
86
28
 
87
- */
88
-
89
- next_offset?:string;
29
+ export interface RetrieveResponse {
30
+ installment: Installment;
90
31
  }
91
- export interface ListInputParam {
92
- [key : string]: any;
93
- /**
94
- * @description Lists the installments that match the criteria provided in the filter parameters.
95
-
96
- */
97
-
98
- limit?:number;
99
-
100
- /**
101
- * @description Lists the installments that match the criteria provided in the filter parameters.
102
32
 
103
- */
104
-
105
- offset?:string;
106
-
107
- /**
108
- * @description Lists the installments that match the criteria provided in the filter parameters.
33
+ export interface ListResponse {
34
+ list: { installment: Installment }[];
35
+ next_offset?: string;
36
+ }
109
37
 
110
- */
111
-
112
- sort_by?:string;
113
-
114
- /**
115
- * @description Lists the installments that match the criteria provided in the filter parameters.
38
+ // REQUEST PARAMS
39
+ //---------------
116
40
 
117
- */
118
-
119
- invoice_id:{in?:string,is?:string};
41
+ export interface ListInputParam {
42
+ limit?: number;
43
+ offset?: string;
44
+ sort_by?: string;
45
+ invoice_id: filter.String;
120
46
  }
121
-
122
47
  }
123
- }
48
+ }
@@ -1,169 +1,68 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface InstallmentConfig {
4
-
5
- /**
6
- * @description An auto-generated unique identifier for the Payment installment Configuration.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description A brief description for this installment configuration.
14
-
15
- */
16
-
17
- description?:string;
18
-
19
- /**
20
- * @description Specifies the total number of installments for the invoice.
21
-
22
- */
23
-
24
- number_of_installments:number;
25
-
26
- /**
27
- * @description Defines the time unit for intervals between installments.Possible values are: day, week, month \* month - month \* week - week \* day - day
28
-
29
- */
30
-
31
- period_unit:'week' | 'month' | 'day';
32
-
33
- /**
34
- * @description The time period between the effective dates of two consecutive installments, expressed in period_units.
35
-
36
- */
37
-
38
- period?:number;
39
-
40
- /**
41
- * @description The day of the week (or month) when the installment is in effect. For week: A value between 1 (Sunday) and 7 (Saturday) indicating the preferred day of the week for the installment dates. For example, 2 represents Monday. For month: A value from 1 to 31, indicating the preferred day of the month for installment dates. For example, 15 represents the 15th day of the month. If the month has fewer days than the specified preferred_day, the installment date is the last day of the month.
42
-
43
- */
44
-
45
- preferred_day?:number;
46
-
47
- /**
48
- * @description The timestamp at which the installment_config was created.
49
-
50
- */
51
-
52
- created_at:number;
53
-
54
- /**
55
- * @description Version number of this resource. The &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
56
-
57
- */
58
-
59
- resource_version?:number;
60
-
61
- /**
62
- * @description The timestamp at which the installment_config was last updated at.
63
-
64
- */
65
-
66
- updated_at?:number;
67
-
68
- /**
69
- * @description Defines the details for each installment individually.
70
-
71
- */
72
-
73
- installments?:InstallmentConfig.Installments[];
6
+ id: string;
7
+ description?: string;
8
+ number_of_installments: number;
9
+ period_unit: 'day' | 'week' | 'month';
10
+ period?: number;
11
+ preferred_day?: number;
12
+ created_at: number;
13
+ resource_version?: number;
14
+ updated_at?: number;
15
+ installments?: InstallmentConfig.Installment[];
74
16
  }
75
- export namespace InstallmentConfig {
76
- export class InstallmentConfigResource {
77
- /**
78
- * @description Creates an installment configuration. After creating an installment_config, you can use it to generate installments for multiple invoices.
79
-
80
- */
81
-
82
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
83
-
84
- /**
85
- * @description This endpoint retrieves an installment_config resource.
86
-
87
- */
88
-
89
- retrieve(installment_config_id:string):ChargebeeRequest<RetrieveResponse>;
90
-
91
- /**
92
- * @description This endpoint deletes an installment_config resource.
93
17
 
94
- */
95
-
96
- delete(installment_config_id:string):ChargebeeRequest<DeleteResponse>;
97
- }
98
- export interface CreateResponse {
99
- installment_config:InstallmentConfig;
18
+ export namespace InstallmentConfig {
19
+ export class InstallmentConfigResource {
20
+ create(
21
+ input: CreateInputParam,
22
+ headers?: ChargebeeRequestHeader,
23
+ ): Promise<ChargebeeResponse<CreateResponse>>;
24
+
25
+ retrieve(
26
+ installment_config_id: string,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
29
+
30
+ delete(
31
+ installment_config_id: string,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
100
34
  }
101
- export interface CreateInputParam {
102
-
103
- /**
104
- * @description Specifies the total number of installments for the invoice.
105
-
106
- */
107
-
108
- number_of_installments:number;
109
-
110
- /**
111
- * @description Defines the time unit for intervals between installments.Possible values are: day, week, month \* month - month \* week - week \* day - day
112
-
113
- */
114
-
115
- period_unit:'week' | 'month' | 'day';
116
-
117
- /**
118
- * @description The time period between the effective dates of two consecutive installments, expressed in period_units.
119
-
120
- */
121
-
122
- period?:number;
123
-
124
- /**
125
- * @description The day of the week (or month) when the installment is in effect. For week: A value between 1 (Sunday) and 7 (Saturday) indicating the preferred day of the week for the installment dates. For example, 2 represents Monday. For month: A value from 1 to 31, indicating the preferred day of the month for installment dates. For example, 15 represents the 15th day of the month. If the month has fewer days than the specified preferred_day, the installment date is the last day of the month.
126
-
127
- */
128
-
129
- preferred_day?:number;
130
-
131
- /**
132
- * @description A brief description for this installment configuration.
133
35
 
134
- */
135
-
136
- description?:string;
137
-
138
- /**
139
- * @description Parameters for installments
140
-
141
- */
142
-
143
- installments?:{amount_percentage?:number,period?:number}[];
36
+ export interface CreateResponse {
37
+ installment_config: InstallmentConfig;
144
38
  }
145
- export interface RetrieveResponse {
146
- installment_config:InstallmentConfig;
39
+
40
+ export interface RetrieveResponse {
41
+ installment_config: InstallmentConfig;
147
42
  }
148
-
149
- export interface DeleteResponse {
150
- installment_config:InstallmentConfig;
43
+
44
+ export interface DeleteResponse {
45
+ installment_config: InstallmentConfig;
151
46
  }
152
-
153
- export interface Installments {
154
- /**
155
- * @description The period of time (expressed in period_units) after the invoice.date, marking the date when installment is in effect. For example, when installments.period is 3 and period_unit is month, this installment is effective 3 months after the invoice.date
156
47
 
157
- */
158
-
159
- period?:number;
160
-
161
- /**
162
- * @description The percentage of invoice.amount_due allocated to this installment. If unspecified, the invoice.amount_due is distributed equally among the installments.
48
+ export interface Installment {
49
+ period?: number;
50
+ amount_percentage?: number;
51
+ }
52
+ // REQUEST PARAMS
53
+ //---------------
163
54
 
164
- */
165
-
166
- amount_percentage?:number;
55
+ export interface CreateInputParam {
56
+ number_of_installments: number;
57
+ period_unit: 'day' | 'week' | 'month';
58
+ period?: number;
59
+ preferred_day?: number;
60
+ description?: string;
61
+ installments?: InstallmentsCreateInputParam[];
62
+ }
63
+ export interface InstallmentsCreateInputParam {
64
+ period?: number;
65
+ amount_percentage?: number;
167
66
  }
168
67
  }
169
- }
68
+ }
@@ -1,34 +1,26 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface InstallmentDetail {
4
-
5
- id?:string;
6
-
7
- invoice_id?:string;
8
-
9
- amount?:number;
10
-
11
- installments?:InstallmentDetail.Installment[];
6
+ id?: string;
7
+ invoice_id?: string;
8
+ amount?: number;
9
+ installments?: InstallmentDetail.Installment[];
12
10
  }
11
+
13
12
  export namespace InstallmentDetail {
14
-
15
-
16
- export interface Installment {
17
- id:string;
18
-
19
- invoice_id:string;
20
-
21
- date:number;
22
-
23
- amount:number;
24
-
25
- status:'posted' | 'payment_due' | 'paid';
26
-
27
- created_at:number;
28
-
29
- resource_version?:number;
30
-
31
- updated_at?:number;
13
+ export interface Installment {
14
+ id: string;
15
+ invoice_id: string;
16
+ date: number;
17
+ amount: number;
18
+ status: 'posted' | 'payment_due' | 'paid';
19
+ created_at: number;
20
+ resource_version?: number;
21
+ updated_at?: number;
32
22
  }
23
+ // REQUEST PARAMS
24
+ //---------------
33
25
  }
34
- }
26
+ }