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,458 +1,142 @@
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 Feature {
4
-
5
- /**
6
- * @description A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, &#x60;number-of-users-ccjht01&#x60;. When not provided, a random value is automatically set.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description A case-sensitive unique name for the feature. For example: &#x60;user license&#x60;, &#x60;data storage&#x60;, &#x60;Salesforce Integration&#x60;, &#x60;devices&#x60;, &#x60;UHD Streaming&#x60;, and so on.
14
- **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](invoices#retrieve_invoice_as_pdf) or [hosted pages](hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](portal_sessions).
15
-
16
- */
17
-
18
- name:string;
19
-
20
- /**
21
- * @description A brief description of the feature. For example: &#x60;Access to 10TB cloud storage&#x60;.
22
-
23
- */
24
-
25
- description?:string;
26
-
27
- /**
28
- * @description The current status of the feature. \* active - A &#x60;draft&#x60; or an &#x60;archived&#x60; feature can be changed to &#x60;active&#x60;. Any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined for the feature take effect immediately. \* draft - The feature is in an unpublished state. [Item](item_entitlements) and [subscription entitlements](subscription_entitlements) can be created for a draft feature but they are not effective until the feature is active. A feature &#x60;status&#x60; cannot be changed back to &#x60;draft&#x60; once it is in &#x60;active&#x60; or &#x60;archived&#x60; &#x60;status&#x60;. \* archived - An &#x60;active&#x60; feature can be changed to &#x60;archived&#x60;. Once &#x60;archived&#x60;, no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60;, remain effective.
29
-
30
- */
31
-
32
- status?:'archived' | 'draft' | 'active';
33
-
34
- /**
35
- * @description The type of feature. \* quantity - The feature is quantity-based and entitlement levels available for it are a set of predefined number of quantity units. For example, a feature with &#x60;name&#x60; such as &#x60;number of users&#x60; can have entitlement levels of say, &#x60;5&#x60;, &#x60;20&#x60;, &#x60;50&#x60;, and &#x60;100&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* range - The feature is quantity-based and the entitlement levels available for it are the set of whole numbers within a range. The range is defined by a minimum and a maximum value. For example, a feature such as &#x60;number of users&#x60; can have entitlement levels starting at &#x60;5&#x60; users and go up to &#x60;50000&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* switch - A switch or toggle is a feature that an item or subscription can be either fully entitled to or not entitled to at all. \* custom - The entitlement levels available for this feature are defined as a set of custom values. For example, a feature &#x60;Email Support&#x60; can have entitlement levels as &#x60;24×7&#x60; and &#x60;24×5&#x60;.
36
-
37
- */
38
-
39
- type?:'quantity' | 'custom' | 'range' | 'switch';
40
-
41
- /**
42
- * @description For features of &#x60;type&#x60; &#x60;quantity&#x60; or &#x60;range&#x60;, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as &#x60;user licenses&#x60;, the &#x60;unit&#x60; can be &#x60;license&#x60;.
43
-
44
- */
45
-
46
- unit?:string;
47
-
48
- /**
49
- * @description The version number of this resource. For every change made to the resource, &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds.
50
-
51
- */
52
-
53
- resource_version?:number;
54
-
55
- /**
56
- * @description The version number of this resource. For every change made to the resource, &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds.
57
-
58
- */
59
-
60
- updated_at?:number;
61
-
62
- /**
63
- * @description When the feature was created.
64
-
65
- */
66
-
67
- created_at:number;
68
-
69
- /**
70
- * @description An ordered list of entitlement levels available for the feature. This is only applicable when &#x60;type&#x60; is other than &#x60;switch&#x60;.
71
- **Note:** When the &#x60;type&#x60; of the feature is &#x60;switch&#x60;, this is not applicable. This is because any given item (or subscription) can be either fully entitled to a &#x60;switch&#x60; feature or not entitled at all; there are no intermediate entitlement levels.
72
-
73
- */
74
-
75
- levels?:Feature.Level[];
6
+ id: string;
7
+ name: string;
8
+ description?: string;
9
+ status?: 'active' | 'archived' | 'draft';
10
+ type?: 'switch' | 'custom' | 'quantity' | 'range';
11
+ unit?: string;
12
+ resource_version?: number;
13
+ updated_at?: number;
14
+ created_at: number;
15
+ levels?: Feature.Level[];
76
16
  }
77
- export namespace Feature {
78
- export class FeatureResource {
79
- /**
80
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
81
-
82
- */
83
-
84
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
85
-
86
- /**
87
- * @description Creates a new feature and optionally defines the &lt;item_entitlements&gt; for it.
88
-
89
- */
90
-
91
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
92
-
93
- /**
94
- * @description Updates a specific feature.
95
- **Note**
96
-
97
- The list of objects &#x60;levels[]&#x60; provided as part of this operation fully replaces the existing
98
- list of objects [levels[]](features#feature_levels) of the feature.
99
-
100
- ### Considerations when modifying &#x60;levels&#x60; {#considerations}
101
-
102
- This section describes validations that are performed by Chargebee when modifying the &#x60;levels&#x60; list of
103
- objects for the feature, using this operation.
104
-
105
- #### Adding &#x60;levels&#x60; {#adding}
106
-
107
- Adding a new object to the &#x60;levels[]&#x60; list is allowed if and only if the feature [type](features#feature_type) is &#x60;quantity&#x60; or &#x60;custom&#x60;
108
-
109
- #### Removing &#x60;levels&#x60; {#removing}
110
-
111
- Removing an existing object in the &#x60;levels[]&#x60; list is not allowed if the &#x60;value&#x60; for that
112
- object is currently mapped to one or more [item_entitlement](item_entitlements)s or
113
- [subscription_entitlement](subscription_entitlements)s.
114
-
115
- #### Reordering &#x60;levels&#x60; {#reorder}
116
-
117
- **Note**
118
-
119
- The validation described in this section is only applicable for features of &#x60;type&#x60;
120
- &#x60;custom&#x60;
121
-
122
- If any of &#x60;levels[].value&#x60; are currently mapped to &#x60;item_entitlement&#x60;s or &#x60;subscription_entitlement&#x60;s,
123
- then the relative order of the corresponding &#x60;levels[].level&#x60; must be preserved when invoking this
124
- operation.
125
-
126
- For example, consider that the &#x60;levels[]&#x60; list is currently in the state shown below. (For brevity,
127
- only the &#x60;value&#x60; and &#x60;level&#x60; key are shown here and the JSONs have been compacted.)
128
- &#x60;
129
- {
130
- &quot;levels&quot;:[{
131
- &quot;value&quot;:&quot;email-basic&quot;,
132
- &quot;level&quot;:0
133
- },{
134
- &quot;value&quot;:&quot;email-rise&quot;,
135
- &quot;level&quot;:1
136
- },{
137
- &quot;value&quot;:&quot;email-advanced&quot;,
138
- &quot;level&quot;:2
139
- },{
140
- &quot;value&quot;:&quot;email-pro&quot;,
141
- &quot;level&quot;:3
142
- },{
143
- &quot;value&quot;:&quot;email-scale&quot;,
144
- &quot;level&quot;:4
145
- }]
146
- }
147
- &#x60;
148
-
149
- Now consider that &#x60;email-rise&#x60;, &#x60;email-advanced&#x60;, and &#x60;email-pro&#x60; have already
150
- been mapped to &#x60;item_entitlement&#x60;s or &#x60;subscription_entitlement&#x60;s. As seen in the above
151
- object, the relative order of &#x60;levels[].level&#x60; is such that &#x60;email-rise&#x60; \&lt; &#x60;email-advanced&#x60;
152
- \&lt; &#x60;email-pro&#x60;.
153
-
154
- Invoking this API to change &#x60;levels[]&#x60; to the state below is allowed since the relative order of
155
- &#x60;level&#x60; corresponding to &#x60;email-rise&#x60;, &#x60;email-advanced&#x60;, and
156
- &#x60;email-pro&#x60; has been preserved.
157
- &#x60;
158
- {
159
- &quot;levels&quot;:[{
160
- &quot;value&quot;:&quot;email-basic&quot;,
161
- &quot;level&quot;:0
162
- },{
163
- &quot;value&quot;:&quot;email-rise&quot;,
164
- &quot;level&quot;:1
165
- },{
166
- &quot;value&quot;:&quot;email-scale&quot;,
167
- &quot;level&quot;:2
168
- },{
169
- &quot;value&quot;:&quot;email-advanced&quot;,
170
- &quot;level&quot;:3
171
- },{
172
- &quot;value&quot;:&quot;email-pro&quot;,
173
- &quot;level&quot;:4
174
- }]
175
- }
176
- &#x60;
177
-
178
- However, changing &#x60;levels[]&#x60; to the state shown below is not permissible because the
179
- &#x60;level&#x60; of &#x60;email-advanced&#x60; is provided as greater than the &#x60;level&#x60; of &#x60;email-pro&#x60;,
180
- thereby disrupting the original order.
181
- &#x60;
182
- {
183
- &quot;levels&quot;:[{
184
- &quot;value&quot;:&quot;email-basic&quot;,
185
- &quot;level&quot;:0
186
- },{
187
- &quot;value&quot;:&quot;email-rise&quot;,
188
- &quot;level&quot;:1
189
- },{
190
- &quot;value&quot;:&quot;email-pro&quot;,
191
- &quot;level&quot;:2
192
- },{
193
- &quot;value&quot;:&quot;email-advanced&quot;,
194
- &quot;level&quot;:3
195
- },{
196
- &quot;value&quot;:&quot;email-scale&quot;,
197
- &quot;level&quot;:4
198
- }]
199
- }
200
- &#x60;
201
-
202
- */
203
-
204
- update(feature_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
205
-
206
- /**
207
- * @description Retrieve a specific feature using its id.
208
-
209
- */
210
-
211
- retrieve(feature_id:string):ChargebeeRequest<RetrieveResponse>;
212
-
213
- /**
214
- * @description Deletes a feature. Any item entitlements and subscription entitlements defined for the feature are also removed. This action is not permissible when the &#x60;status&#x60; of the feature is &#x60;active&#x60;.
215
-
216
- */
217
-
218
- delete(feature_id:string):ChargebeeRequest<DeleteResponse>;
219
-
220
- /**
221
- * @description Activates a &#x60;draft&#x60; feature so that any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined towards it take effect immediately. This operation changes the [status](features#feature_status) of the feature to &#x60;active&#x60;. The feature &#x60;status&#x60; must be &#x60;draft&#x60; when calling this endpoint.
222
-
223
- */
224
-
225
- activate(feature_id:string):ChargebeeRequest<ActivateResponse>;
226
-
227
- /**
228
- * @description Archives an &#x60;active&#x60; feature so that no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created towards the feature. Any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60; remain effective. This operation changes the [status](features#feature_status) of the feature to &#x60;archived&#x60;. The feature &#x60;status&#x60; must be &#x60;active&#x60; when calling this endpoint.
229
-
230
- */
231
-
232
- archive(feature_id:string):ChargebeeRequest<ArchiveResponse>;
233
-
234
- /**
235
- * @description Reactivates an archived feature so that **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created towards the feature. This operation changes the [status](features#feature_status) of the feature to &#x60;active&#x60;. The feature &#x60;status&#x60; must be &#x60;archived&#x60; when calling this endpoint.
236
17
 
237
- */
238
-
239
- reactivate(feature_id:string):ChargebeeRequest<ReactivateResponse>;
18
+ export namespace Feature {
19
+ export class FeatureResource {
20
+ list(
21
+ input?: ListInputParam,
22
+ headers?: ChargebeeRequestHeader,
23
+ ): Promise<ChargebeeResponse<ListResponse>>;
24
+
25
+ create(
26
+ input: CreateInputParam,
27
+ headers?: ChargebeeRequestHeader,
28
+ ): Promise<ChargebeeResponse<CreateResponse>>;
29
+
30
+ update(
31
+ feature_id: string,
32
+ input?: UpdateInputParam,
33
+ headers?: ChargebeeRequestHeader,
34
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
35
+
36
+ retrieve(
37
+ feature_id: string,
38
+ headers?: ChargebeeRequestHeader,
39
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
40
+
41
+ delete(
42
+ feature_id: string,
43
+ headers?: ChargebeeRequestHeader,
44
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
45
+
46
+ activate(
47
+ feature_id: string,
48
+ headers?: ChargebeeRequestHeader,
49
+ ): Promise<ChargebeeResponse<ActivateResponse>>;
50
+
51
+ archive(
52
+ feature_id: string,
53
+ headers?: ChargebeeRequestHeader,
54
+ ): Promise<ChargebeeResponse<ArchiveResponse>>;
55
+
56
+ reactivate(
57
+ feature_id: string,
58
+ headers?: ChargebeeRequestHeader,
59
+ ): Promise<ChargebeeResponse<ReactivateResponse>>;
240
60
  }
241
- export interface ListResponse {
242
- /**
243
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
244
-
245
- */
246
-
247
- list:{feature:Feature}[];
248
-
249
- /**
250
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
251
61
 
252
- */
253
-
254
- next_offset?:string;
62
+ export interface ListResponse {
63
+ list: { feature: Feature }[];
64
+ next_offset?: string;
255
65
  }
256
- export interface ListInputParam {
257
- [key : string]: any;
258
- /**
259
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
260
-
261
- */
262
-
263
- limit?:number;
264
-
265
- /**
266
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
267
-
268
- */
269
-
270
- offset?:string;
271
-
272
- /**
273
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
274
66
 
275
- */
276
-
277
- name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
278
-
279
- /**
280
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
281
-
282
- */
283
-
284
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
285
-
286
- /**
287
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
288
-
289
- */
290
-
291
- status?:{in?:string,is?:'archived' | 'draft' | 'active',is_not?:'archived' | 'draft' | 'active',not_in?:string};
292
-
293
- /**
294
- * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
295
-
296
- */
297
-
298
- type?:{in?:string,is?:'quantity' | 'custom' | 'range' | 'switch',is_not?:'quantity' | 'custom' | 'range' | 'switch',not_in?:string};
299
- }
300
- export interface CreateResponse {
301
- feature:Feature;
67
+ export interface CreateResponse {
68
+ feature: Feature;
302
69
  }
303
- export interface CreateInputParam {
304
- [key : string] : any;
305
- /**
306
- * @description A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, &#x60;number-of-users-ccjht01&#x60;. When not provided, a random value is automatically set.
307
-
308
- */
309
-
310
- id?:string;
311
-
312
- /**
313
- * @description A case-sensitive unique name for the feature. For example: &#x60;user license&#x60;, &#x60;data storage&#x60;, &#x60;Salesforce Integration&#x60;, &#x60;devices&#x60;, &#x60;UHD Streaming&#x60;, and so on.
314
- **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](invoices#retrieve_invoice_as_pdf) or [hosted pages](hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](portal_sessions).
315
-
316
- */
317
-
318
- name:string;
319
-
320
- /**
321
- * @description A brief description of the feature. For example: &#x60;Access to 10TB cloud storage&#x60;.
322
-
323
- */
324
-
325
- description?:string;
326
-
327
- /**
328
- * @description The type of feature. \* quantity - The feature is quantity-based and entitlement levels available for it are a set of predefined number of quantity units. For example, a feature with &#x60;name&#x60; such as &#x60;number of users&#x60; can have entitlement levels of say, &#x60;5&#x60;, &#x60;20&#x60;, &#x60;50&#x60;, and &#x60;100&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* range - The feature is quantity-based and the entitlement levels available for it are the set of whole numbers within a range. The range is defined by a minimum and a maximum value. For example, a feature such as &#x60;number of users&#x60; can have entitlement levels starting at &#x60;5&#x60; users and go up to &#x60;50000&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* switch - A switch or toggle is a feature that an item or subscription can be either fully entitled to or not entitled to at all. \* custom - The entitlement levels available for this feature are defined as a set of custom values. For example, a feature &#x60;Email Support&#x60; can have entitlement levels as &#x60;24×7&#x60; and &#x60;24×5&#x60;.
329
-
330
- */
331
-
332
- type?:'quantity' | 'custom' | 'range' | 'switch';
333
-
334
- /**
335
- * @description The current status of the feature. \* active - A &#x60;draft&#x60; or an &#x60;archived&#x60; feature can be changed to &#x60;active&#x60;. Any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined for the feature take effect immediately. \* draft - The feature is in an unpublished state. [Item](item_entitlements) and [subscription entitlements](subscription_entitlements) can be created for a draft feature but they are not effective until the feature is active. A feature &#x60;status&#x60; cannot be changed back to &#x60;draft&#x60; once it is in &#x60;active&#x60; or &#x60;archived&#x60; &#x60;status&#x60;. \* archived - An &#x60;active&#x60; feature can be changed to &#x60;archived&#x60;. Once &#x60;archived&#x60;, no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60;, remain effective.
336
70
 
337
- */
338
-
339
- status?:'draft' | 'active';
340
-
341
- /**
342
- * @description For features of &#x60;type&#x60; &#x60;quantity&#x60; or &#x60;range&#x60;, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as &#x60;user licenses&#x60;, the &#x60;unit&#x60; can be &#x60;license&#x60;.
343
-
344
- */
345
-
346
- unit?:string;
347
-
348
- /**
349
- * @description Parameters for levels
350
-
351
- */
352
-
353
- levels?:{is_unlimited?:boolean,level?:number,name?:string,value?:string}[];
71
+ export interface UpdateResponse {
72
+ feature: Feature;
354
73
  }
355
- export interface UpdateResponse {
356
- feature:Feature;
357
- }
358
- export interface UpdateInputParam {
359
- [key : string] : any;
360
- /**
361
- * @description A case-sensitive unique name for the feature. For example: &#x60;user license&#x60;, &#x60;data storage&#x60;, &#x60;Salesforce Integration&#x60;, &#x60;devices&#x60;, &#x60;UHD Streaming&#x60;, and so on.
362
- **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](invoices#retrieve_invoice_as_pdf) or [hosted pages](hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](portal_sessions).
363
74
 
364
- */
365
-
366
- name?:string;
367
-
368
- /**
369
- * @description A brief description of the feature. For example: &#x60;Access to 10TB cloud storage&#x60;.
75
+ export interface RetrieveResponse {
76
+ feature: Feature;
77
+ }
370
78
 
371
- */
372
-
373
- description?:string;
374
-
375
- /**
376
- * @description The current status of the feature. \* active - A &#x60;draft&#x60; or an &#x60;archived&#x60; feature can be changed to &#x60;active&#x60;. Any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined for the feature take effect immediately. \* draft - The feature is in an unpublished state. [Item](item_entitlements) and [subscription entitlements](subscription_entitlements) can be created for a draft feature but they are not effective until the feature is active. A feature &#x60;status&#x60; cannot be changed back to &#x60;draft&#x60; once it is in &#x60;active&#x60; or &#x60;archived&#x60; &#x60;status&#x60;. \* archived - An &#x60;active&#x60; feature can be changed to &#x60;archived&#x60;. Once &#x60;archived&#x60;, no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60;, remain effective.
79
+ export interface DeleteResponse {
80
+ feature: Feature;
81
+ }
377
82
 
378
- */
379
-
380
- status?:'archived' | 'draft' | 'active';
381
-
382
- /**
383
- * @description For features of &#x60;type&#x60; &#x60;quantity&#x60; or &#x60;range&#x60;, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as &#x60;user licenses&#x60;, the &#x60;unit&#x60; can be &#x60;license&#x60;.
83
+ export interface ActivateResponse {
84
+ feature: Feature;
85
+ }
384
86
 
385
- */
386
-
387
- unit?:string;
388
-
389
- /**
390
- * @description Parameters for levels
87
+ export interface ArchiveResponse {
88
+ feature: Feature;
89
+ }
391
90
 
392
- */
393
-
394
- levels?:{is_unlimited?:boolean,level?:number,name?:string,value?:string}[];
91
+ export interface ReactivateResponse {
92
+ feature: Feature;
395
93
  }
396
- export interface RetrieveResponse {
397
- feature:Feature;
94
+
95
+ export interface Level {
96
+ name?: string;
97
+ value: string;
98
+ level: number;
99
+ is_unlimited: boolean;
398
100
  }
399
-
400
- export interface DeleteResponse {
401
- feature:Feature;
101
+ // REQUEST PARAMS
102
+ //---------------
103
+
104
+ export interface ListInputParam {
105
+ limit?: number;
106
+ offset?: string;
107
+ name?: filter.String;
108
+ id?: filter.String;
109
+ status?: filter.Enum;
110
+ type?: filter.Enum;
111
+ [key: string]: unknown;
402
112
  }
403
-
404
- export interface ActivateResponse {
405
- feature:Feature;
113
+ export interface CreateInputParam {
114
+ id?: string;
115
+ name: string;
116
+ description?: string;
117
+ type?: 'switch' | 'custom' | 'quantity' | 'range';
118
+ unit?: string;
119
+ levels?: LevelsCreateInputParam[];
120
+ [key: string]: unknown;
406
121
  }
407
-
408
- export interface ArchiveResponse {
409
- feature:Feature;
122
+ export interface UpdateInputParam {
123
+ name?: string;
124
+ description?: string;
125
+ unit?: string;
126
+ levels?: LevelsUpdateInputParam[];
127
+ [key: string]: unknown;
410
128
  }
411
-
412
- export interface ReactivateResponse {
413
- feature:Feature;
129
+ export interface LevelsCreateInputParam {
130
+ name?: string;
131
+ value?: string;
132
+ is_unlimited?: boolean;
133
+ level?: number;
414
134
  }
415
-
416
- export interface Level {
417
- /**
418
- * @description A case-sensitive display name for the entitlement level. Provide a name that helps you clearly identify the entitlement level. For example: a feature such as &#x60;Email Support&#x60; can have entitlement levels named as &#x60;All weekdays&#x60;, &#x60;All days&#x60;, &#x60;40 hours per week&#x60; and so on. When not provided for &#x60;feature.type&#x60; &#x60;quantity&#x60; or &#x60;range&#x60;, this name is auto-generated as the space-separated concatenation of &#x60;levels[].value&#x60; and the pluralized version of &#x60;unit&#x60;. For example, if &#x60;levels[].value&#x60; is &#x60;20&#x60; and &#x60;unit&#x60; is &#x60;user&#x60;, then &#x60;levels[].name&#x60; becomes &#x60;20 users&#x60;.
419
-
420
- */
421
-
422
- name?:string;
423
-
424
- /**
425
- * @description The value denoting the entitlement level granted.
426
-
427
- * **When &#x60;type&#x60; is &#x60;quantity&#x60;:** this attribute denotes the quantity of units of the feature for this entitlement level. For example, a feature such as &#x60;number of users&#x60; can have &#x60;levels[].value&#x60; as &#x60;5&#x60;, &#x60;20&#x60;, &#x60;50&#x60;, and &#x60;100&#x60;. &#x60;levels[].is_unlimited&#x60; is used to set the entitlement level to &quot;unlimited&quot;.
428
- * **When &#x60;type&#x60; is &#x60;range&#x60;:** there can be be only two elements in the &#x60;levels[]&#x60; array; one corresponding to the minimum value (&#x60;levels[0]&#x60;) and the other to the maximum value (&#x60;levels[1]&#x60;) of the range of possible entitlement levels. For example, a feature such as &#x60;number of users&#x60; may have &#x60;levels[0].value&#x60; &#x3D; &#x60;5&#x60; and &#x60;levels[1].value&#x60; &#x3D; &#x60;50000&#x60;. When the upper limit is &quot;unlimited&quot;, then &#x60;levels[1].value&#x60; is not set and &#x60;levels[1].is_unlimited&#x60; is &#x60;true&#x60;.
429
- * **When &#x60;type&#x60; is &#x60;custom&#x60;:** this attribute denotes the value of this custom entitlement level. For example, a feature &#x60;Email Support&#x60; can have &#x60;levels[].value&#x60; as one of say, &#x60;24×7&#x60; and &#x60;24×5&#x60;.
430
-
431
- */
432
-
433
- value:string;
434
-
435
- /**
436
- * @description This attribute represents the order of the entitlement levels from lowest to highest.
437
-
438
- * When &#x60;type&#x60; is &#x60;quantity&#x60; or &#x60;custom&#x60;: The lowest entitlement level has the value &#x60;0&#x60;, the next higher level has the value &#x60;1&#x60;, followed by &#x60;2&#x60;, and so on.
439
- * When &#x60;type&#x60; is &#x60;range&#x60;: This attribute is &#x60;0&#x60; for the minimum value and &#x60;1&#x60; for the maximum value in the range.
440
-
441
- When not defined, it is assumed as the index of the &#x60;levels[]&#x60; array.
442
-
443
- */
444
-
445
- level:number;
446
-
447
- /**
448
- * @description When &#x60;type&#x60; is &#x60;quantity&#x60; or &#x60;range&#x60;, this attribute indicates whether the entitlement level corresponds to unlimited units of the feature. Possible values:
449
-
450
- * &#x60;true&#x60;: The entitlement level corresponds to unlimited units of the feature. &#x60;levels[].value&#x60; is ignored for this level. This can only be set for the level that has the highest value for &#x60;levels[].level.&#x60;
451
- * &#x60;false&#x60;: The entitlement level does not correspond to unlimited units of the feature.
452
-
453
- */
454
-
455
- is_unlimited:boolean;
135
+ export interface LevelsUpdateInputParam {
136
+ name?: string;
137
+ value?: string;
138
+ is_unlimited?: boolean;
139
+ level?: number;
456
140
  }
457
141
  }
458
- }
142
+ }
@@ -1,76 +1,20 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface GatewayErrorDetail {
4
-
5
- /**
6
- * @description This is a unique identifier assigned by the payment gateway. It is used to track the request at the payment gateway
7
-
8
- */
9
-
10
- request_id?:string;
11
-
12
- /**
13
- * @description This parameter categorizes the type of error that occurred for the request. It helps in understanding whether the error is due to API error, validation, processing, network issues, and more
14
-
15
- */
16
-
17
- error_category?:string;
18
-
19
- /**
20
- * @description A gateway-specific code that corresponds to the particular error encountered for the request. This code can be used for identifying the error in a standardized manner across the gateway&#x27;s services
21
-
22
- */
23
-
24
- error_code?:string;
25
-
26
- /**
27
- * @description A message provided by the gateway that describes the nature of the error encountered
28
-
29
- */
30
-
31
- error_message?:string;
32
-
33
- /**
34
- * @description When a transaction is declined, this code is provided by the gateway to specify the reason for the decline
35
-
36
- */
37
-
38
- decline_code?:string;
39
-
40
- /**
41
- * @description This message gives a descriptive explanation of the reason for the transaction&#x27;s decline
42
-
43
- */
44
-
45
- decline_message?:string;
46
-
47
- /**
48
- * @description This code represents errors that originate from the payment network (such as Visa, MasterCard, and more). It is different from the gateway error code and is specific to the network&#x27;s error-handling system
49
-
50
- */
51
-
52
- network_error_code?:string;
53
-
54
- network_error_message?:string;
55
-
56
- /**
57
- * @description This parameter indicates which specific data field or attribute in the request caused the error
58
-
59
- */
60
-
61
- error_field?:string;
62
-
63
- /**
64
- * @description After an error has occurred, the gateway or payment network may provide a recommendation code. This code suggests a course of action or remedy that you can follow to resolve the issue
65
-
66
- */
67
-
68
- recommendation_code?:string;
69
-
70
- recommendation_message?:string;
71
-
72
- processor_error_code?:string;
73
-
74
- processor_error_message?:string;
6
+ request_id?: string;
7
+ error_category?: string;
8
+ error_code?: string;
9
+ error_message?: string;
10
+ decline_code?: string;
11
+ decline_message?: string;
12
+ network_error_code?: string;
13
+ network_error_message?: string;
14
+ error_field?: string;
15
+ recommendation_code?: string;
16
+ recommendation_message?: string;
17
+ processor_error_code?: string;
18
+ processor_error_message?: string;
75
19
  }
76
- }
20
+ }