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.
- package/CHANGELOG.md +11 -15
- package/LICENSE +1 -1
- package/README.md +90 -170
- package/cjs/RequestWrapper.js +84 -0
- package/cjs/asyncApiSupport.js +39 -0
- package/cjs/chargebee.cjs.js +13 -0
- package/cjs/chargebee.cjs.worker.js +9 -0
- package/cjs/chargebeeError.js +17 -0
- package/cjs/coreCommon.js +72 -0
- package/cjs/createChargebee.js +92 -0
- package/cjs/environment.js +18 -0
- package/cjs/filter.js +1 -0
- package/cjs/net/ClientInterface.js +40 -0
- package/cjs/net/FetchClient.js +86 -0
- package/cjs/net/NodeClient.js +61 -0
- package/cjs/package.json +1 -0
- package/cjs/resources/api_endpoints.js +1086 -0
- package/cjs/util.js +218 -0
- package/esm/RequestWrapper.js +80 -0
- package/esm/asyncApiSupport.js +35 -0
- package/esm/chargebee.esm.js +9 -0
- package/esm/chargebee.esm.worker.js +5 -0
- package/esm/chargebeeError.js +13 -0
- package/esm/coreCommon.js +67 -0
- package/esm/createChargebee.js +88 -0
- package/esm/environment.js +15 -0
- package/esm/filter.js +1 -0
- package/esm/net/ClientInterface.js +35 -0
- package/esm/net/FetchClient.js +81 -0
- package/esm/net/NodeClient.js +56 -0
- package/esm/package.json +1 -0
- package/esm/resources/api_endpoints.js +1083 -0
- package/esm/util.js +202 -0
- package/package.json +69 -38
- package/types/core.d.ts +558 -89
- package/types/index.d.ts +90 -55
- package/types/resources/Address.d.ts +57 -272
- package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
- package/types/resources/AttachedItem.d.ts +91 -329
- package/types/resources/Attribute.d.ts +5 -5
- package/types/resources/BusinessEntity.d.ts +49 -69
- package/types/resources/BusinessEntityTransfer.d.ts +11 -17
- package/types/resources/Card.d.ts +146 -424
- package/types/resources/Comment.d.ts +72 -189
- package/types/resources/Contact.d.ts +12 -64
- package/types/resources/ContractTerm.d.ts +15 -96
- package/types/resources/Coupon.d.ts +282 -758
- package/types/resources/CouponCode.d.ts +56 -52
- package/types/resources/CouponSet.d.ts +92 -234
- package/types/resources/CreditNote.d.ts +588 -1758
- package/types/resources/CreditNoteEstimate.d.ts +131 -157
- package/types/resources/Currency.d.ts +75 -62
- package/types/resources/Customer.d.ts +892 -835
- package/types/resources/CustomerEntitlement.d.ts +24 -35
- package/types/resources/DifferentialPrice.d.ts +116 -314
- package/types/resources/Discount.d.ts +20 -125
- package/types/resources/Download.d.ts +6 -22
- package/types/resources/Entitlement.d.ts +51 -160
- package/types/resources/EntitlementOverride.d.ts +58 -139
- package/types/resources/Estimate.d.ts +1178 -527
- package/types/resources/Event.d.ts +67 -178
- package/types/resources/Export.d.ts +563 -723
- package/types/resources/Feature.d.ts +117 -433
- package/types/resources/GatewayErrorDetail.d.ts +16 -72
- package/types/resources/Gift.d.ts +265 -432
- package/types/resources/Hierarchy.d.ts +8 -36
- package/types/resources/HostedPage.d.ts +1017 -1153
- package/types/resources/ImpactedItem.d.ts +13 -50
- package/types/resources/ImpactedItemPrice.d.ts +13 -15
- package/types/resources/ImpactedSubscription.d.ts +13 -45
- package/types/resources/InAppSubscription.d.ts +93 -389
- package/types/resources/Installment.d.ts +35 -110
- package/types/resources/InstallmentConfig.d.ts +54 -155
- package/types/resources/InstallmentDetail.d.ts +19 -27
- package/types/resources/Invoice.d.ts +1574 -3157
- package/types/resources/InvoiceEstimate.d.ts +131 -161
- package/types/resources/Item.d.ts +133 -611
- package/types/resources/ItemEntitlement.d.ts +78 -215
- package/types/resources/ItemFamily.d.ts +69 -178
- package/types/resources/ItemPrice.d.ts +291 -1203
- package/types/resources/Metadata.d.ts +3 -5
- package/types/resources/Order.d.ts +538 -1471
- package/types/resources/PaymentIntent.d.ts +163 -347
- package/types/resources/PaymentReferenceNumber.d.ts +7 -29
- package/types/resources/PaymentSource.d.ts +476 -1272
- package/types/resources/PaymentVoucher.d.ts +87 -306
- package/types/resources/PortalSession.d.ts +71 -207
- package/types/resources/PriceVariant.d.ts +91 -279
- package/types/resources/PricingPageSession.d.ts +92 -41
- package/types/resources/PromotionalCredit.d.ts +90 -346
- package/types/resources/Purchase.d.ts +185 -315
- package/types/resources/Quote.d.ts +1406 -887
- package/types/resources/QuoteLineGroup.d.ts +125 -452
- package/types/resources/QuotedCharge.d.ts +45 -274
- package/types/resources/QuotedSubscription.d.ts +100 -488
- package/types/resources/Ramp.d.ts +230 -747
- package/types/resources/ResourceMigration.d.ts +25 -80
- package/types/resources/SiteMigrationDetail.d.ts +34 -112
- package/types/resources/Subscription.d.ts +2390 -4336
- package/types/resources/SubscriptionEntitlement.d.ts +59 -160
- package/types/resources/SubscriptionEstimate.d.ts +51 -75
- package/types/resources/TaxWithheld.d.ts +15 -40
- package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
- package/types/resources/TimeMachine.d.ts +43 -97
- package/types/resources/Token.d.ts +15 -85
- package/types/resources/Transaction.d.ts +276 -911
- package/types/resources/UnbilledCharge.d.ts +189 -164
- package/types/resources/Usage.d.ts +89 -279
- package/types/resources/VirtualBankAccount.d.ts +103 -255
- package/types/resources/filter.d.ts +52 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
- package/.github/ISSUE_TEMPLATE/config.yml +0 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/lib/chargebee.js +0 -512
- package/lib/resources/api_endpoints.js +0 -2935
- package/types/resources/NonSubscription.d.ts +0 -30
- 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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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: `Access to 10TB cloud storage`.
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
description?:string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @description The current status of the feature. \* active - A `draft` or an `archived` feature can be changed to `active`. 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 `status` cannot be changed back to `draft` once it is in `active` or `archived` `status`. \* archived - An `active` feature can be changed to `archived`. Once `archived`, 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 `active`, 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 `name` such as `number of users` can have entitlement levels of say, `5`, `20`, `50`, and `100`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `number of users` can have entitlement levels starting at `5` users and go up to `50000`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `Email Support` can have entitlement levels as `24×7` and `24×5`.
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
type?:'quantity' | 'custom' | 'range' | 'switch';
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @description For features of `type` `quantity` or `range`, 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 `user licenses`, the `unit` can be `license`.
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
unit?:string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @description The version number of this resource. For every change made to the resource, `resource_version` 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, `resource_version` 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 `type` is other than `switch`.
|
|
71
|
-
**Note:** When the `type` of the feature is `switch`, this is not applicable. This is because any given item (or subscription) can be either fully entitled to a `switch` 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 "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
81
|
-
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @description Creates a new feature and optionally defines the <item_entitlements> 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 `levels[]` 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 `levels` {#considerations}
|
|
101
|
-
|
|
102
|
-
This section describes validations that are performed by Chargebee when modifying the `levels` list of
|
|
103
|
-
objects for the feature, using this operation.
|
|
104
|
-
|
|
105
|
-
#### Adding `levels` {#adding}
|
|
106
|
-
|
|
107
|
-
Adding a new object to the `levels[]` list is allowed if and only if the feature [type](features#feature_type) is `quantity` or `custom`
|
|
108
|
-
|
|
109
|
-
#### Removing `levels` {#removing}
|
|
110
|
-
|
|
111
|
-
Removing an existing object in the `levels[]` list is not allowed if the `value` 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 `levels` {#reorder}
|
|
116
|
-
|
|
117
|
-
**Note**
|
|
118
|
-
|
|
119
|
-
The validation described in this section is only applicable for features of `type`
|
|
120
|
-
`custom`
|
|
121
|
-
|
|
122
|
-
If any of `levels[].value` are currently mapped to `item_entitlement`s or `subscription_entitlement`s,
|
|
123
|
-
then the relative order of the corresponding `levels[].level` must be preserved when invoking this
|
|
124
|
-
operation.
|
|
125
|
-
|
|
126
|
-
For example, consider that the `levels[]` list is currently in the state shown below. (For brevity,
|
|
127
|
-
only the `value` and `level` key are shown here and the JSONs have been compacted.)
|
|
128
|
-
`
|
|
129
|
-
{
|
|
130
|
-
"levels":[{
|
|
131
|
-
"value":"email-basic",
|
|
132
|
-
"level":0
|
|
133
|
-
},{
|
|
134
|
-
"value":"email-rise",
|
|
135
|
-
"level":1
|
|
136
|
-
},{
|
|
137
|
-
"value":"email-advanced",
|
|
138
|
-
"level":2
|
|
139
|
-
},{
|
|
140
|
-
"value":"email-pro",
|
|
141
|
-
"level":3
|
|
142
|
-
},{
|
|
143
|
-
"value":"email-scale",
|
|
144
|
-
"level":4
|
|
145
|
-
}]
|
|
146
|
-
}
|
|
147
|
-
`
|
|
148
|
-
|
|
149
|
-
Now consider that `email-rise`, `email-advanced`, and `email-pro` have already
|
|
150
|
-
been mapped to `item_entitlement`s or `subscription_entitlement`s. As seen in the above
|
|
151
|
-
object, the relative order of `levels[].level` is such that `email-rise` \< `email-advanced`
|
|
152
|
-
\< `email-pro`.
|
|
153
|
-
|
|
154
|
-
Invoking this API to change `levels[]` to the state below is allowed since the relative order of
|
|
155
|
-
`level` corresponding to `email-rise`, `email-advanced`, and
|
|
156
|
-
`email-pro` has been preserved.
|
|
157
|
-
`
|
|
158
|
-
{
|
|
159
|
-
"levels":[{
|
|
160
|
-
"value":"email-basic",
|
|
161
|
-
"level":0
|
|
162
|
-
},{
|
|
163
|
-
"value":"email-rise",
|
|
164
|
-
"level":1
|
|
165
|
-
},{
|
|
166
|
-
"value":"email-scale",
|
|
167
|
-
"level":2
|
|
168
|
-
},{
|
|
169
|
-
"value":"email-advanced",
|
|
170
|
-
"level":3
|
|
171
|
-
},{
|
|
172
|
-
"value":"email-pro",
|
|
173
|
-
"level":4
|
|
174
|
-
}]
|
|
175
|
-
}
|
|
176
|
-
`
|
|
177
|
-
|
|
178
|
-
However, changing `levels[]` to the state shown below is not permissible because the
|
|
179
|
-
`level` of `email-advanced` is provided as greater than the `level` of `email-pro`,
|
|
180
|
-
thereby disrupting the original order.
|
|
181
|
-
`
|
|
182
|
-
{
|
|
183
|
-
"levels":[{
|
|
184
|
-
"value":"email-basic",
|
|
185
|
-
"level":0
|
|
186
|
-
},{
|
|
187
|
-
"value":"email-rise",
|
|
188
|
-
"level":1
|
|
189
|
-
},{
|
|
190
|
-
"value":"email-pro",
|
|
191
|
-
"level":2
|
|
192
|
-
},{
|
|
193
|
-
"value":"email-advanced",
|
|
194
|
-
"level":3
|
|
195
|
-
},{
|
|
196
|
-
"value":"email-scale",
|
|
197
|
-
"level":4
|
|
198
|
-
}]
|
|
199
|
-
}
|
|
200
|
-
`
|
|
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 `status` of the feature is `active`.
|
|
215
|
-
|
|
216
|
-
*/
|
|
217
|
-
|
|
218
|
-
delete(feature_id:string):ChargebeeRequest<DeleteResponse>;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @description Activates a `draft` 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 `active`. The feature `status` must be `draft` when calling this endpoint.
|
|
222
|
-
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
activate(feature_id:string):ChargebeeRequest<ActivateResponse>;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* @description Archives an `active` 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 `active` remain effective. This operation changes the [status](features#feature_status) of the feature to `archived`. The feature `status` must be `active` 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 `active`. The feature `status` must be `archived` when calling this endpoint.
|
|
236
17
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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 "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
244
|
-
|
|
245
|
-
*/
|
|
246
|
-
|
|
247
|
-
list:{feature:Feature}[];
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
251
61
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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 "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
260
|
-
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
limit?:number;
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
267
|
-
|
|
268
|
-
*/
|
|
269
|
-
|
|
270
|
-
offset?:string;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
274
66
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
281
|
-
|
|
282
|
-
*/
|
|
283
|
-
|
|
284
|
-
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
288
|
-
|
|
289
|
-
*/
|
|
290
|
-
|
|
291
|
-
status?:{in?:string,is?:'archived' | 'draft' | 'active',is_not?:'archived' | 'draft' | 'active',not_in?:string};
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
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, `number-of-users-ccjht01`. 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: `user license`, `data storage`, `Salesforce Integration`, `devices`, `UHD Streaming`, 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: `Access to 10TB cloud storage`.
|
|
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 `name` such as `number of users` can have entitlement levels of say, `5`, `20`, `50`, and `100`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `number of users` can have entitlement levels starting at `5` users and go up to `50000`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `Email Support` can have entitlement levels as `24×7` and `24×5`.
|
|
329
|
-
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
type?:'quantity' | 'custom' | 'range' | 'switch';
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* @description The current status of the feature. \* active - A `draft` or an `archived` feature can be changed to `active`. 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 `status` cannot be changed back to `draft` once it is in `active` or `archived` `status`. \* archived - An `active` feature can be changed to `archived`. Once `archived`, 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 `active`, remain effective.
|
|
336
70
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
status?:'draft' | 'active';
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* @description For features of `type` `quantity` or `range`, 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 `user licenses`, the `unit` can be `license`.
|
|
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: `user license`, `data storage`, `Salesforce Integration`, `devices`, `UHD Streaming`, 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
|
-
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* @description A brief description of the feature. For example: `Access to 10TB cloud storage`.
|
|
75
|
+
export interface RetrieveResponse {
|
|
76
|
+
feature: Feature;
|
|
77
|
+
}
|
|
370
78
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* @description The current status of the feature. \* active - A `draft` or an `archived` feature can be changed to `active`. 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 `status` cannot be changed back to `draft` once it is in `active` or `archived` `status`. \* archived - An `active` feature can be changed to `archived`. Once `archived`, 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 `active`, remain effective.
|
|
79
|
+
export interface DeleteResponse {
|
|
80
|
+
feature: Feature;
|
|
81
|
+
}
|
|
377
82
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* @description For features of `type` `quantity` or `range`, 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 `user licenses`, the `unit` can be `license`.
|
|
83
|
+
export interface ActivateResponse {
|
|
84
|
+
feature: Feature;
|
|
85
|
+
}
|
|
384
86
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
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
|
-
|
|
397
|
-
|
|
94
|
+
|
|
95
|
+
export interface Level {
|
|
96
|
+
name?: string;
|
|
97
|
+
value: string;
|
|
98
|
+
level: number;
|
|
99
|
+
is_unlimited: boolean;
|
|
398
100
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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
|
-
|
|
405
|
-
|
|
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
|
-
|
|
409
|
-
|
|
122
|
+
export interface UpdateInputParam {
|
|
123
|
+
name?: string;
|
|
124
|
+
description?: string;
|
|
125
|
+
unit?: string;
|
|
126
|
+
levels?: LevelsUpdateInputParam[];
|
|
127
|
+
[key: string]: unknown;
|
|
410
128
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
129
|
+
export interface LevelsCreateInputParam {
|
|
130
|
+
name?: string;
|
|
131
|
+
value?: string;
|
|
132
|
+
is_unlimited?: boolean;
|
|
133
|
+
level?: number;
|
|
414
134
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
*/
|
|
421
|
-
|
|
422
|
-
name?:string;
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* @description The value denoting the entitlement level granted.
|
|
426
|
-
|
|
427
|
-
* **When `type` is `quantity`:** this attribute denotes the quantity of units of the feature for this entitlement level. For example, a feature such as `number of users` can have `levels[].value` as `5`, `20`, `50`, and `100`. `levels[].is_unlimited` is used to set the entitlement level to "unlimited".
|
|
428
|
-
* **When `type` is `range`:** there can be be only two elements in the `levels[]` array; one corresponding to the minimum value (`levels[0]`) and the other to the maximum value (`levels[1]`) of the range of possible entitlement levels. For example, a feature such as `number of users` may have `levels[0].value` = `5` and `levels[1].value` = `50000`. When the upper limit is "unlimited", then `levels[1].value` is not set and `levels[1].is_unlimited` is `true`.
|
|
429
|
-
* **When `type` is `custom`:** this attribute denotes the value of this custom entitlement level. For example, a feature `Email Support` can have `levels[].value` as one of say, `24×7` and `24×5`.
|
|
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 `type` is `quantity` or `custom`: The lowest entitlement level has the value `0`, the next higher level has the value `1`, followed by `2`, and so on.
|
|
439
|
-
* When `type` is `range`: This attribute is `0` for the minimum value and `1` for the maximum value in the range.
|
|
440
|
-
|
|
441
|
-
When not defined, it is assumed as the index of the `levels[]` array.
|
|
442
|
-
|
|
443
|
-
*/
|
|
444
|
-
|
|
445
|
-
level:number;
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* @description When `type` is `quantity` or `range`, this attribute indicates whether the entitlement level corresponds to unlimited units of the feature. Possible values:
|
|
449
|
-
|
|
450
|
-
* `true`: The entitlement level corresponds to unlimited units of the feature. `levels[].value` is ignored for this level. This can only be set for the level that has the highest value for `levels[].level.`
|
|
451
|
-
* `false`: 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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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'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'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'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
|
+
}
|