chargebee 3.2.0 → 3.3.0
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 +47 -0
- package/cjs/RequestWrapper.js +38 -33
- package/cjs/environment.js +1 -1
- package/cjs/net/FetchClient.js +21 -14
- package/cjs/resources/api_endpoints.js +1 -0
- package/esm/RequestWrapper.js +38 -33
- package/esm/environment.js +1 -1
- package/esm/net/FetchClient.js +21 -14
- package/esm/resources/api_endpoints.js +1 -0
- package/package.json +1 -1
- package/types/core.d.ts +6 -0
- package/types/index.d.ts +2 -0
- package/types/resources/Configuration.d.ts +24 -0
- package/types/resources/CreditNote.d.ts +1 -0
- package/types/resources/CreditNoteEstimate.d.ts +1 -0
- package/types/resources/Event.d.ts +5 -2
- package/types/resources/GatewayErrorDetail.d.ts +1 -0
- package/types/resources/HostedPage.d.ts +1 -0
- package/types/resources/Invoice.d.ts +1 -0
- package/types/resources/InvoiceEstimate.d.ts +1 -0
- package/types/resources/OmnichannelSubscription.d.ts +13 -0
- package/types/resources/OmnichannelSubscriptionItem.d.ts +7 -1
- package/types/resources/Quote.d.ts +2 -0
- package/types/resources/QuoteLineGroup.d.ts +1 -0
- package/types/resources/QuotedSubscription.d.ts +3 -0
- package/types/resources/RecordedPurchase.d.ts +1 -1
- package/types/resources/Subscription.d.ts +18 -0
- package/types/resources/Transaction.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
+
### v3.3.0 (2024-12-19)
|
|
2
|
+
* * *
|
|
3
|
+
|
|
4
|
+
#### New Resource:
|
|
5
|
+
* Configuration has been added.
|
|
6
|
+
|
|
7
|
+
#### New Attribute:
|
|
8
|
+
* discount_type has been added to CreditNote#Discount.
|
|
9
|
+
* discount_type has been added to CreditNoteEstimate#Discount.
|
|
10
|
+
* discount_type has been added to Invoice#Discount.
|
|
11
|
+
* discount_type has been added to InvoiceEstimate#Discount.
|
|
12
|
+
* discount_type has been added to QuoteLineGroup#Discount.
|
|
13
|
+
* initial_purchase_transaction has been added to OmnichannelSubscription.
|
|
14
|
+
* error_cause_id has been added to GatewayErrorDetail.
|
|
15
|
+
* error_cause_id has been added to Transaction#GatewayErrorDetail.
|
|
16
|
+
* error_cause_id has been added to APIError.
|
|
17
|
+
* deleted has been added to Quote.
|
|
18
|
+
* current_term_start has been added to QuotedSubscripiton#SubscriptionItem.
|
|
19
|
+
* current_term_end has been added to QuotedSubscripiton#SubscriptionItem.
|
|
20
|
+
* next_billing_at has been added to QuotedSubscripiton#SubscriptionItem.
|
|
21
|
+
* current_term_start has been added to Subscription#SubscriptionItem.
|
|
22
|
+
* current_term_end has been added to Subscription#SubscriptionItem.
|
|
23
|
+
* next_billing_at has been added to Subscription#SubscriptionItem.
|
|
24
|
+
* billing_override has been added to Subscription.
|
|
25
|
+
* grace_period_expires_at has been added to OmnichannelSubscriptionItem.
|
|
26
|
+
|
|
27
|
+
#### New Input Params:
|
|
28
|
+
* billing_override has been added to Subscription#CreateWithItemsInputParam.
|
|
29
|
+
* billing_override has been added to Subscription#UpdateForItemsInputParam.
|
|
30
|
+
|
|
31
|
+
#### New Enum Values:
|
|
32
|
+
* OMNICHANNEL_SUBSCRIPTION_IMPORTED has been added to EventTypeEnum.
|
|
33
|
+
* DISABLED has been added to Event#WebhookStatus.
|
|
34
|
+
* OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_STARTED has been added to EventTypeEnum.
|
|
35
|
+
* OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_EXPIRED has been added to EventTypeEnum.
|
|
36
|
+
* OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_STARTED has been added to EventTypeEnum.
|
|
37
|
+
* OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_EXPIRED has been added to EventTypeEnum.
|
|
38
|
+
* IGNORED has been added to RecordedPurchase#StatusEnum.
|
|
39
|
+
* IN_DUNNING & IN_GRACE_PERIOD have been added to OmnichannelSubscriptionItem#StatusEnum.
|
|
40
|
+
|
|
41
|
+
### v3.2.1 (2024-12-04)
|
|
42
|
+
* * *
|
|
43
|
+
|
|
44
|
+
#### Bug Fixes
|
|
45
|
+
* unable to access content of HostedPage & Event (#57).
|
|
46
|
+
* uncaught promise in case of fetch failure (#58).
|
|
47
|
+
|
|
1
48
|
### v3.2.0 (2024-11-27)
|
|
2
49
|
* * *
|
|
3
50
|
#### New Resource:
|
package/cjs/RequestWrapper.js
CHANGED
|
@@ -41,42 +41,47 @@ class RequestWrapper {
|
|
|
41
41
|
resolve(response);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
params
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
try {
|
|
45
|
+
let path = (0, util_js_1.getApiURL)(env, this.apiCall.urlPrefix, this.apiCall.urlSuffix, urlIdParam);
|
|
46
|
+
if (typeof params === 'undefined' || params === null) {
|
|
47
|
+
params = {};
|
|
48
|
+
}
|
|
49
|
+
if (this.apiCall.httpMethod === 'GET') {
|
|
50
|
+
params = (0, util_js_1.serialize)(params);
|
|
51
|
+
let queryParam = this.apiCall.isListReq
|
|
52
|
+
? (0, util_js_1.encodeListParams)(params)
|
|
53
|
+
: (0, util_js_1.encodeParams)(params);
|
|
54
|
+
path += '?' + queryParam;
|
|
55
|
+
params = {};
|
|
56
|
+
}
|
|
57
|
+
let data = (0, util_js_1.encodeParams)(params);
|
|
58
|
+
if (data.length) {
|
|
59
|
+
(0, util_js_1.extend)(true, this.httpHeaders, {
|
|
60
|
+
'Content-Length': data.length,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
58
63
|
(0, util_js_1.extend)(true, this.httpHeaders, {
|
|
59
|
-
'
|
|
64
|
+
Authorization: 'Basic ' + node_buffer_1.Buffer.from(env.apiKey + ':').toString('base64'),
|
|
65
|
+
Accept: 'application/json',
|
|
66
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
67
|
+
'User-Agent': 'Chargebee-NodeJs-Client ' + env.clientVersion,
|
|
68
|
+
'Lang-Version': typeof process === 'undefined' ? '' : process.version,
|
|
69
|
+
});
|
|
70
|
+
const resp = await this.envArg.httpClient.makeApiRequest({
|
|
71
|
+
host: (0, util_js_1.getHost)(env),
|
|
72
|
+
port: env.port,
|
|
73
|
+
path,
|
|
74
|
+
method: this.apiCall.httpMethod,
|
|
75
|
+
protocol: env.protocol,
|
|
76
|
+
headers: this.httpHeaders,
|
|
77
|
+
data: data,
|
|
78
|
+
timeout: env.timeout,
|
|
60
79
|
});
|
|
80
|
+
(0, coreCommon_js_1.handleResponse)(callBackWrapper, resp);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
callBackWrapper(err, null);
|
|
61
84
|
}
|
|
62
|
-
(0, util_js_1.extend)(true, this.httpHeaders, {
|
|
63
|
-
Authorization: 'Basic ' + node_buffer_1.Buffer.from(env.apiKey + ':').toString('base64'),
|
|
64
|
-
Accept: 'application/json',
|
|
65
|
-
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
66
|
-
'User-Agent': 'Chargebee-NodeJs-Client ' + env.clientVersion,
|
|
67
|
-
'Lang-Version': typeof process === 'undefined' ? '' : process.version,
|
|
68
|
-
});
|
|
69
|
-
const resp = await this.envArg.httpClient.makeApiRequest({
|
|
70
|
-
host: (0, util_js_1.getHost)(env),
|
|
71
|
-
port: env.port,
|
|
72
|
-
path,
|
|
73
|
-
method: this.apiCall.httpMethod,
|
|
74
|
-
protocol: env.protocol,
|
|
75
|
-
headers: this.httpHeaders,
|
|
76
|
-
data: data,
|
|
77
|
-
timeout: env.timeout,
|
|
78
|
-
});
|
|
79
|
-
(0, coreCommon_js_1.handleResponse)(callBackWrapper, resp);
|
|
80
85
|
});
|
|
81
86
|
return (0, util_js_1.callbackifyPromise)(promise);
|
|
82
87
|
}
|
package/cjs/environment.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.Environment = {
|
|
|
11
11
|
hostSuffix: '.chargebee.com',
|
|
12
12
|
apiPath: '/api/v2',
|
|
13
13
|
timeout: DEFAULT_TIME_OUT,
|
|
14
|
-
clientVersion: 'v3.
|
|
14
|
+
clientVersion: 'v3.3.0',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/cjs/net/FetchClient.js
CHANGED
|
@@ -11,10 +11,15 @@ class FetchHttpClient extends ClientInterface_js_1.HttpClient {
|
|
|
11
11
|
headers: headers,
|
|
12
12
|
body: props.data ? props.data : undefined,
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
try {
|
|
15
|
+
const response = globalThis.AbortController
|
|
16
|
+
? await this.fetchWithAbortTimeout(url, fetchOptions, props.timeout)
|
|
17
|
+
: await this.fetchWithTimeout(url, fetchOptions, props.timeout);
|
|
18
|
+
return new FetchHttpClientResponse(response);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
return Promise.reject(err);
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
_createHeaders(httpHeaders) {
|
|
20
25
|
const headers = new Headers();
|
|
@@ -44,20 +49,22 @@ class FetchHttpClient extends ClientInterface_js_1.HttpClient {
|
|
|
44
49
|
timeoutId = null;
|
|
45
50
|
abort.abort(ClientInterface_js_1.HttpClient.timeOutError());
|
|
46
51
|
}, timeout);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
return fetchPromise.catch((err) => {
|
|
52
|
+
try {
|
|
53
|
+
return await fetch(url, Object.assign(Object.assign({}, fetchOptions), { signal: abort.signal }));
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
54
56
|
if (err.name === 'AbortError') {
|
|
55
|
-
|
|
57
|
+
return Promise.reject(ClientInterface_js_1.HttpClient.timeOutError());
|
|
56
58
|
}
|
|
57
59
|
else {
|
|
58
|
-
|
|
60
|
+
return Promise.reject(err);
|
|
59
61
|
}
|
|
60
|
-
}
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
if (timeoutId) {
|
|
65
|
+
clearTimeout(timeoutId);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
61
68
|
}
|
|
62
69
|
}
|
|
63
70
|
exports.FetchHttpClient = FetchHttpClient;
|
|
@@ -930,6 +930,7 @@ exports.Endpoints = {
|
|
|
930
930
|
['delete', 'POST', '/differential_prices', '/delete', true],
|
|
931
931
|
['list', 'GET', '/differential_prices', null, false],
|
|
932
932
|
],
|
|
933
|
+
configuration: [['list', 'GET', '/configurations', null, false]],
|
|
933
934
|
feature: [
|
|
934
935
|
['list', 'GET', '/features', null, false],
|
|
935
936
|
['create', 'POST', '/features', null, false],
|
package/esm/RequestWrapper.js
CHANGED
|
@@ -38,42 +38,47 @@ export class RequestWrapper {
|
|
|
38
38
|
resolve(response);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
params
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
try {
|
|
42
|
+
let path = getApiURL(env, this.apiCall.urlPrefix, this.apiCall.urlSuffix, urlIdParam);
|
|
43
|
+
if (typeof params === 'undefined' || params === null) {
|
|
44
|
+
params = {};
|
|
45
|
+
}
|
|
46
|
+
if (this.apiCall.httpMethod === 'GET') {
|
|
47
|
+
params = serialize(params);
|
|
48
|
+
let queryParam = this.apiCall.isListReq
|
|
49
|
+
? encodeListParams(params)
|
|
50
|
+
: encodeParams(params);
|
|
51
|
+
path += '?' + queryParam;
|
|
52
|
+
params = {};
|
|
53
|
+
}
|
|
54
|
+
let data = encodeParams(params);
|
|
55
|
+
if (data.length) {
|
|
56
|
+
extend(true, this.httpHeaders, {
|
|
57
|
+
'Content-Length': data.length,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
55
60
|
extend(true, this.httpHeaders, {
|
|
56
|
-
'
|
|
61
|
+
Authorization: 'Basic ' + Buffer.from(env.apiKey + ':').toString('base64'),
|
|
62
|
+
Accept: 'application/json',
|
|
63
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
64
|
+
'User-Agent': 'Chargebee-NodeJs-Client ' + env.clientVersion,
|
|
65
|
+
'Lang-Version': typeof process === 'undefined' ? '' : process.version,
|
|
66
|
+
});
|
|
67
|
+
const resp = await this.envArg.httpClient.makeApiRequest({
|
|
68
|
+
host: getHost(env),
|
|
69
|
+
port: env.port,
|
|
70
|
+
path,
|
|
71
|
+
method: this.apiCall.httpMethod,
|
|
72
|
+
protocol: env.protocol,
|
|
73
|
+
headers: this.httpHeaders,
|
|
74
|
+
data: data,
|
|
75
|
+
timeout: env.timeout,
|
|
57
76
|
});
|
|
77
|
+
handleResponse(callBackWrapper, resp);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
callBackWrapper(err, null);
|
|
58
81
|
}
|
|
59
|
-
extend(true, this.httpHeaders, {
|
|
60
|
-
Authorization: 'Basic ' + Buffer.from(env.apiKey + ':').toString('base64'),
|
|
61
|
-
Accept: 'application/json',
|
|
62
|
-
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
63
|
-
'User-Agent': 'Chargebee-NodeJs-Client ' + env.clientVersion,
|
|
64
|
-
'Lang-Version': typeof process === 'undefined' ? '' : process.version,
|
|
65
|
-
});
|
|
66
|
-
const resp = await this.envArg.httpClient.makeApiRequest({
|
|
67
|
-
host: getHost(env),
|
|
68
|
-
port: env.port,
|
|
69
|
-
path,
|
|
70
|
-
method: this.apiCall.httpMethod,
|
|
71
|
-
protocol: env.protocol,
|
|
72
|
-
headers: this.httpHeaders,
|
|
73
|
-
data: data,
|
|
74
|
-
timeout: env.timeout,
|
|
75
|
-
});
|
|
76
|
-
handleResponse(callBackWrapper, resp);
|
|
77
82
|
});
|
|
78
83
|
return callbackifyPromise(promise);
|
|
79
84
|
}
|
package/esm/environment.js
CHANGED
|
@@ -8,7 +8,7 @@ export const Environment = {
|
|
|
8
8
|
hostSuffix: '.chargebee.com',
|
|
9
9
|
apiPath: '/api/v2',
|
|
10
10
|
timeout: DEFAULT_TIME_OUT,
|
|
11
|
-
clientVersion: 'v3.
|
|
11
|
+
clientVersion: 'v3.3.0',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/esm/net/FetchClient.js
CHANGED
|
@@ -8,10 +8,15 @@ export class FetchHttpClient extends HttpClient {
|
|
|
8
8
|
headers: headers,
|
|
9
9
|
body: props.data ? props.data : undefined,
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
try {
|
|
12
|
+
const response = globalThis.AbortController
|
|
13
|
+
? await this.fetchWithAbortTimeout(url, fetchOptions, props.timeout)
|
|
14
|
+
: await this.fetchWithTimeout(url, fetchOptions, props.timeout);
|
|
15
|
+
return new FetchHttpClientResponse(response);
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
return Promise.reject(err);
|
|
19
|
+
}
|
|
15
20
|
}
|
|
16
21
|
_createHeaders(httpHeaders) {
|
|
17
22
|
const headers = new Headers();
|
|
@@ -41,20 +46,22 @@ export class FetchHttpClient extends HttpClient {
|
|
|
41
46
|
timeoutId = null;
|
|
42
47
|
abort.abort(HttpClient.timeOutError());
|
|
43
48
|
}, timeout);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return fetchPromise.catch((err) => {
|
|
49
|
+
try {
|
|
50
|
+
return await fetch(url, Object.assign(Object.assign({}, fetchOptions), { signal: abort.signal }));
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
51
53
|
if (err.name === 'AbortError') {
|
|
52
|
-
|
|
54
|
+
return Promise.reject(HttpClient.timeOutError());
|
|
53
55
|
}
|
|
54
56
|
else {
|
|
55
|
-
|
|
57
|
+
return Promise.reject(err);
|
|
56
58
|
}
|
|
57
|
-
}
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
if (timeoutId) {
|
|
62
|
+
clearTimeout(timeoutId);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
export class FetchHttpClientResponse extends HttpClientResponse {
|
|
@@ -927,6 +927,7 @@ export const Endpoints = {
|
|
|
927
927
|
['delete', 'POST', '/differential_prices', '/delete', true],
|
|
928
928
|
['list', 'GET', '/differential_prices', null, false],
|
|
929
929
|
],
|
|
930
|
+
configuration: [['list', 'GET', '/configurations', null, false]],
|
|
930
931
|
feature: [
|
|
931
932
|
['list', 'GET', '/features', null, false],
|
|
932
933
|
['create', 'POST', '/features', null, false],
|
package/package.json
CHANGED
package/types/core.d.ts
CHANGED
|
@@ -324,6 +324,11 @@ declare module 'chargebee' {
|
|
|
324
324
|
| 'omnichannel_subscription_item_resubscribed'
|
|
325
325
|
| 'omnichannel_subscription_item_upgraded'
|
|
326
326
|
| 'omnichannel_subscription_item_cancelled'
|
|
327
|
+
| 'omnichannel_subscription_imported'
|
|
328
|
+
| 'omnichannel_subscription_item_grace_period_started'
|
|
329
|
+
| 'omnichannel_subscription_item_grace_period_expired'
|
|
330
|
+
| 'omnichannel_subscription_item_dunning_started'
|
|
331
|
+
| 'omnichannel_subscription_item_dunning_expired'
|
|
327
332
|
| 'plan_created'
|
|
328
333
|
| 'plan_updated'
|
|
329
334
|
| 'plan_deleted'
|
|
@@ -492,6 +497,7 @@ declare module 'chargebee' {
|
|
|
492
497
|
| 'tiered'
|
|
493
498
|
| 'volume'
|
|
494
499
|
| 'stairstep';
|
|
500
|
+
type ProductCatalogVersionEnum = 'v1' | 'v2';
|
|
495
501
|
type ProrationTypeEnum = 'full_term' | 'partial_term' | 'none';
|
|
496
502
|
type ReferralSystemEnum =
|
|
497
503
|
| 'referral_candy'
|
package/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
///<reference path='./resources/BusinessEntityTransfer.d.ts' />
|
|
7
7
|
///<reference path='./resources/Card.d.ts' />
|
|
8
8
|
///<reference path='./resources/Comment.d.ts' />
|
|
9
|
+
///<reference path='./resources/Configuration.d.ts' />
|
|
9
10
|
///<reference path='./resources/Contact.d.ts' />
|
|
10
11
|
///<reference path='./resources/ContractTerm.d.ts' />
|
|
11
12
|
///<reference path='./resources/Coupon.d.ts' />
|
|
@@ -123,6 +124,7 @@ declare module 'chargebee' {
|
|
|
123
124
|
businessEntity: BusinessEntity.BusinessEntityResource;
|
|
124
125
|
card: Card.CardResource;
|
|
125
126
|
comment: Comment.CommentResource;
|
|
127
|
+
configuration: Configuration.ConfigurationResource;
|
|
126
128
|
coupon: Coupon.CouponResource;
|
|
127
129
|
couponCode: CouponCode.CouponCodeResource;
|
|
128
130
|
couponSet: CouponSet.CouponSetResource;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface Configuration {
|
|
6
|
+
domain?: string;
|
|
7
|
+
product_catalog_version?: ProductCatalogVersionEnum;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export namespace Configuration {
|
|
11
|
+
export class ConfigurationResource {
|
|
12
|
+
list(
|
|
13
|
+
headers?: ChargebeeRequestHeader,
|
|
14
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ListResponse {
|
|
18
|
+
configurations: Configuration[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// REQUEST PARAMS
|
|
22
|
+
//---------------
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -14,11 +14,13 @@ declare module 'chargebee' {
|
|
|
14
14
|
| 're_scheduled'
|
|
15
15
|
| 'failed'
|
|
16
16
|
| 'skipped'
|
|
17
|
-
| 'not_applicable'
|
|
17
|
+
| 'not_applicable'
|
|
18
|
+
| 'disabled';
|
|
18
19
|
webhook_failure_reason?: string;
|
|
19
20
|
webhooks?: Event.Webhook[];
|
|
20
21
|
event_type?: EventTypeEnum;
|
|
21
22
|
api_version?: ApiVersionEnum;
|
|
23
|
+
content: any;
|
|
22
24
|
origin_user?: string;
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -53,7 +55,8 @@ declare module 'chargebee' {
|
|
|
53
55
|
| 're_scheduled'
|
|
54
56
|
| 'failed'
|
|
55
57
|
| 'skipped'
|
|
56
|
-
| 'not_applicable'
|
|
58
|
+
| 'not_applicable'
|
|
59
|
+
| 'disabled';
|
|
57
60
|
}
|
|
58
61
|
// REQUEST PARAMS
|
|
59
62
|
//---------------
|
|
@@ -11,6 +11,7 @@ declare module 'chargebee' {
|
|
|
11
11
|
created_at: number;
|
|
12
12
|
resource_version?: number;
|
|
13
13
|
omnichannel_subscription_items: OmnichannelSubscriptionItem[];
|
|
14
|
+
initial_purchase_transaction?: OmnichannelSubscription.OmnichannelTransaction;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export namespace OmnichannelSubscription {
|
|
@@ -48,6 +49,18 @@ declare module 'chargebee' {
|
|
|
48
49
|
next_offset?: string;
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
export interface OmnichannelTransaction {
|
|
53
|
+
id: string;
|
|
54
|
+
id_at_source: string;
|
|
55
|
+
app_id: string;
|
|
56
|
+
price_currency: string;
|
|
57
|
+
price_units: number;
|
|
58
|
+
price_nanos: number;
|
|
59
|
+
type: 'purchase' | 'renewal';
|
|
60
|
+
transacted_at: number;
|
|
61
|
+
created_at: number;
|
|
62
|
+
resource_version?: number;
|
|
63
|
+
}
|
|
51
64
|
// REQUEST PARAMS
|
|
52
65
|
//---------------
|
|
53
66
|
|
|
@@ -5,7 +5,12 @@ declare module 'chargebee' {
|
|
|
5
5
|
export interface OmnichannelSubscriptionItem {
|
|
6
6
|
id: string;
|
|
7
7
|
item_id_at_source: string;
|
|
8
|
-
status:
|
|
8
|
+
status:
|
|
9
|
+
| 'active'
|
|
10
|
+
| 'expired'
|
|
11
|
+
| 'cancelled'
|
|
12
|
+
| 'in_dunning'
|
|
13
|
+
| 'in_grace_period';
|
|
9
14
|
current_term_start?: number;
|
|
10
15
|
current_term_end?: number;
|
|
11
16
|
expired_at?: number;
|
|
@@ -14,6 +19,7 @@ declare module 'chargebee' {
|
|
|
14
19
|
cancellation_reason?:
|
|
15
20
|
| 'customer_cancelled'
|
|
16
21
|
| 'customer_did_not_consent_to_price_increase';
|
|
22
|
+
grace_period_expires_at?: number;
|
|
17
23
|
resource_version?: number;
|
|
18
24
|
}
|
|
19
25
|
}
|
|
@@ -44,6 +44,7 @@ declare module 'chargebee' {
|
|
|
44
44
|
contract_term_end?: number;
|
|
45
45
|
contract_term_termination_fee?: number;
|
|
46
46
|
business_entity_id?: string;
|
|
47
|
+
deleted: boolean;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
export namespace Quote {
|
|
@@ -332,6 +333,7 @@ declare module 'chargebee' {
|
|
|
332
333
|
| 'prorated_credits'
|
|
333
334
|
| 'item_level_discount'
|
|
334
335
|
| 'document_level_discount';
|
|
336
|
+
discount_type?: 'fixed_amount' | 'percentage';
|
|
335
337
|
entity_id?: string;
|
|
336
338
|
coupon_set_code?: string;
|
|
337
339
|
}
|
|
@@ -69,6 +69,9 @@ declare module 'chargebee' {
|
|
|
69
69
|
unit_price?: number;
|
|
70
70
|
unit_price_in_decimal?: string;
|
|
71
71
|
amount?: number;
|
|
72
|
+
current_term_start?: number;
|
|
73
|
+
current_term_end?: number;
|
|
74
|
+
next_billing_at?: number;
|
|
72
75
|
amount_in_decimal?: string;
|
|
73
76
|
billing_period?: number;
|
|
74
77
|
billing_period_unit?: 'day' | 'week' | 'month' | 'year';
|
|
@@ -7,7 +7,7 @@ declare module 'chargebee' {
|
|
|
7
7
|
customer_id: string;
|
|
8
8
|
app_id: string;
|
|
9
9
|
source: 'apple_app_store';
|
|
10
|
-
status: 'in_process' | 'completed' | 'failed';
|
|
10
|
+
status: 'in_process' | 'completed' | 'failed' | 'ignored';
|
|
11
11
|
omnichannel_transaction_id?: string;
|
|
12
12
|
created_at: number;
|
|
13
13
|
resource_version?: number;
|
|
@@ -83,6 +83,7 @@ declare module 'chargebee' {
|
|
|
83
83
|
coupons?: Subscription.Coupon[];
|
|
84
84
|
shipping_address?: Subscription.ShippingAddress;
|
|
85
85
|
referral_info?: Subscription.ReferralInfo;
|
|
86
|
+
billing_override?: Subscription.BillingOverride;
|
|
86
87
|
invoice_notes?: string;
|
|
87
88
|
meta_data?: any;
|
|
88
89
|
deleted: boolean;
|
|
@@ -557,6 +558,9 @@ declare module 'chargebee' {
|
|
|
557
558
|
unit_price?: number;
|
|
558
559
|
unit_price_in_decimal?: string;
|
|
559
560
|
amount?: number;
|
|
561
|
+
current_term_start?: number;
|
|
562
|
+
current_term_end?: number;
|
|
563
|
+
next_billing_at?: number;
|
|
560
564
|
amount_in_decimal?: string;
|
|
561
565
|
billing_period?: number;
|
|
562
566
|
billing_period_unit?: 'day' | 'week' | 'month' | 'year';
|
|
@@ -662,6 +666,10 @@ declare module 'chargebee' {
|
|
|
662
666
|
destination_url?: string;
|
|
663
667
|
post_purchase_widget_enabled: boolean;
|
|
664
668
|
}
|
|
669
|
+
export interface BillingOverride {
|
|
670
|
+
max_excess_payment_usage?: number;
|
|
671
|
+
max_refundable_credits_usage?: number;
|
|
672
|
+
}
|
|
665
673
|
export interface ContractTerm {
|
|
666
674
|
id: string;
|
|
667
675
|
status: 'active' | 'completed' | 'cancelled' | 'terminated';
|
|
@@ -835,6 +843,7 @@ declare module 'chargebee' {
|
|
|
835
843
|
statement_descriptor?: StatementDescriptorCreateWithItemsInputParam;
|
|
836
844
|
payment_intent?: PaymentIntentCreateWithItemsInputParam;
|
|
837
845
|
contract_term?: ContractTermCreateWithItemsInputParam;
|
|
846
|
+
billing_override?: BillingOverrideCreateWithItemsInputParam;
|
|
838
847
|
subscription_items?: SubscriptionItemsCreateWithItemsInputParam[];
|
|
839
848
|
discounts?: DiscountsCreateWithItemsInputParam[];
|
|
840
849
|
item_tiers?: ItemTiersCreateWithItemsInputParam[];
|
|
@@ -991,6 +1000,7 @@ declare module 'chargebee' {
|
|
|
991
1000
|
statement_descriptor?: StatementDescriptorUpdateForItemsInputParam;
|
|
992
1001
|
customer?: CustomerUpdateForItemsInputParam;
|
|
993
1002
|
contract_term?: ContractTermUpdateForItemsInputParam;
|
|
1003
|
+
billing_override?: BillingOverrideUpdateForItemsInputParam;
|
|
994
1004
|
subscription_items?: SubscriptionItemsUpdateForItemsInputParam[];
|
|
995
1005
|
discounts?: DiscountsUpdateForItemsInputParam[];
|
|
996
1006
|
item_tiers?: ItemTiersUpdateForItemsInputParam[];
|
|
@@ -1548,6 +1558,10 @@ declare module 'chargebee' {
|
|
|
1548
1558
|
billing_cycles?: number;
|
|
1549
1559
|
trial_end?: number;
|
|
1550
1560
|
}
|
|
1561
|
+
export interface BillingOverrideCreateWithItemsInputParam {
|
|
1562
|
+
max_excess_payment_usage?: number;
|
|
1563
|
+
max_refundable_credits_usage?: number;
|
|
1564
|
+
}
|
|
1551
1565
|
export interface StatementDescriptorCreateWithItemsInputParam {
|
|
1552
1566
|
descriptor?: string;
|
|
1553
1567
|
}
|
|
@@ -1810,6 +1824,10 @@ declare module 'chargebee' {
|
|
|
1810
1824
|
trial_end?: number;
|
|
1811
1825
|
proration_type?: ProrationTypeEnum;
|
|
1812
1826
|
}
|
|
1827
|
+
export interface BillingOverrideUpdateForItemsInputParam {
|
|
1828
|
+
max_excess_payment_usage?: number;
|
|
1829
|
+
max_refundable_credits_usage?: number;
|
|
1830
|
+
}
|
|
1813
1831
|
export interface BillingAddressUpdateForItemsInputParam {
|
|
1814
1832
|
first_name?: string;
|
|
1815
1833
|
last_name?: string;
|