chargebee 3.3.0 → 3.5.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 +51 -0
- package/cjs/RequestWrapper.js +9 -3
- package/cjs/coreCommon.js +1 -0
- package/cjs/createChargebee.js +3 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +2100 -366
- package/cjs/util.js +22 -17
- package/esm/RequestWrapper.js +9 -3
- package/esm/coreCommon.js +1 -0
- package/esm/createChargebee.js +3 -0
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +2100 -366
- package/esm/util.js +22 -17
- package/package.json +1 -1
- package/types/core.d.ts +9 -2
- package/types/index.d.ts +4 -0
- package/types/resources/AttachedItem.d.ts +1 -0
- package/types/resources/Comment.d.ts +1 -0
- package/types/resources/Coupon.d.ts +5 -16
- package/types/resources/CreditNote.d.ts +4 -3
- package/types/resources/CreditNoteEstimate.d.ts +1 -1
- package/types/resources/Customer.d.ts +0 -12
- package/types/resources/DifferentialPrice.d.ts +1 -0
- package/types/resources/Feature.d.ts +1 -0
- package/types/resources/Invoice.d.ts +8 -0
- package/types/resources/InvoiceEstimate.d.ts +6 -0
- package/types/resources/Item.d.ts +1 -0
- package/types/resources/ItemFamily.d.ts +1 -0
- package/types/resources/ItemPrice.d.ts +1 -0
- package/types/resources/Order.d.ts +1 -1
- package/types/resources/PriceVariant.d.ts +1 -0
- package/types/resources/Purchase.d.ts +33 -0
- package/types/resources/Rule.d.ts +33 -0
- package/types/resources/Subscription.d.ts +1 -0
- package/types/resources/UsageEvent.d.ts +53 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
### v3.5.0 (2025-03-06)
|
|
2
|
+
* * *
|
|
3
|
+
|
|
4
|
+
### New Input Params:
|
|
5
|
+
* created_at has been added to Invoice#LineItemsImportInputParams.
|
|
6
|
+
* PaymentIntent has been added to Purchase#CreateInputParams.
|
|
7
|
+
|
|
8
|
+
### New Enums:
|
|
9
|
+
* SUBSCRIPTION_ENTITLEMENTS_UPDATED has been added to EventType#Enum.
|
|
10
|
+
|
|
11
|
+
### v3.4.0 (2025-02-10)
|
|
12
|
+
* * *
|
|
13
|
+
|
|
14
|
+
#### New Resources:
|
|
15
|
+
* Rule has been added.
|
|
16
|
+
* UsageEvent has been added.
|
|
17
|
+
|
|
18
|
+
#### New Attribute:
|
|
19
|
+
* deleted has been added to AttachedItem.
|
|
20
|
+
* deleted has been added to Coupon.
|
|
21
|
+
* deleted has been added to DifferentialPrice.
|
|
22
|
+
* deleted has been added to ItemFamily.
|
|
23
|
+
* deleted has been added to ItemPrice.
|
|
24
|
+
* deleted has been added to Item.
|
|
25
|
+
* deleted has been added to PriceVariant.
|
|
26
|
+
* tax_application has abeend added to CreditNote#Allocation.
|
|
27
|
+
* tax_application has been added to Invoice#AppliedCredit.
|
|
28
|
+
* line_item_credit has been added to Invoice.
|
|
29
|
+
|
|
30
|
+
#### New Input Params:
|
|
31
|
+
* exhausted_coupon_ids has been added to Subscription#ImportForItems.
|
|
32
|
+
|
|
33
|
+
#### New Enums
|
|
34
|
+
* STORE has been added in CreditNote#TypeEnum.
|
|
35
|
+
* STORE has been added in CreditNoteEstimate#TypeEnum.
|
|
36
|
+
* STORE has been added in Order#TypeEnum.
|
|
37
|
+
* TaxApplicationEnum has been added in CreditNote#Application.
|
|
38
|
+
* TaxApplicationEnum has been added in Invoice#AppliedCredit.
|
|
39
|
+
* RECORDED_PURCHASE has been added in EntityTypeEnum.
|
|
40
|
+
* RECORD_PURCHASE_FAILED, has been added in EventTypeEnum.
|
|
41
|
+
|
|
42
|
+
#### Deleted Input Params
|
|
43
|
+
* tax_providers_fields has been removed from Customer#MoveParams.
|
|
44
|
+
* tax_providers_fields has been removed from Customer#MergeParams
|
|
45
|
+
|
|
46
|
+
#### Deprecated input params.
|
|
47
|
+
* deprecated label in discount_quantity has been removed from Coupon#CreateParams.
|
|
48
|
+
* deprecated label in discount_quantity has been removed from Coupon#UpdateParams.
|
|
49
|
+
* deprecated label in discount_quantity has been removed from Coupon#CreateForItemsParams.
|
|
50
|
+
* deprecated label in discount_quantity has been removed from Coupon#UpdateForItemsParams.
|
|
51
|
+
|
|
1
52
|
### v3.3.0 (2024-12-19)
|
|
2
53
|
* * *
|
|
3
54
|
|
package/cjs/RequestWrapper.js
CHANGED
|
@@ -54,21 +54,27 @@ class RequestWrapper {
|
|
|
54
54
|
path += '?' + queryParam;
|
|
55
55
|
params = {};
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
const jsonKeys = this.apiCall.jsonKeys;
|
|
58
|
+
let data = this.apiCall.isJsonRequest
|
|
59
|
+
? JSON.stringify(params)
|
|
60
|
+
: (0, util_js_1.encodeParams)(params, undefined, undefined, undefined, jsonKeys);
|
|
58
61
|
if (data.length) {
|
|
59
62
|
(0, util_js_1.extend)(true, this.httpHeaders, {
|
|
60
63
|
'Content-Length': data.length,
|
|
61
64
|
});
|
|
62
65
|
}
|
|
66
|
+
const contentType = this.apiCall.isJsonRequest
|
|
67
|
+
? 'application/json;charset=UTF-8'
|
|
68
|
+
: 'application/x-www-form-urlencoded; charset=utf-8';
|
|
63
69
|
(0, util_js_1.extend)(true, this.httpHeaders, {
|
|
64
70
|
Authorization: 'Basic ' + node_buffer_1.Buffer.from(env.apiKey + ':').toString('base64'),
|
|
65
71
|
Accept: 'application/json',
|
|
66
|
-
'Content-Type':
|
|
72
|
+
'Content-Type': contentType,
|
|
67
73
|
'User-Agent': 'Chargebee-NodeJs-Client ' + env.clientVersion,
|
|
68
74
|
'Lang-Version': typeof process === 'undefined' ? '' : process.version,
|
|
69
75
|
});
|
|
70
76
|
const resp = await this.envArg.httpClient.makeApiRequest({
|
|
71
|
-
host: (0, util_js_1.getHost)(env),
|
|
77
|
+
host: (0, util_js_1.getHost)(env, this.apiCall.subDomain),
|
|
72
78
|
port: env.port,
|
|
73
79
|
path,
|
|
74
80
|
method: this.apiCall.httpMethod,
|
package/cjs/coreCommon.js
CHANGED
package/cjs/createChargebee.js
CHANGED
|
@@ -78,6 +78,9 @@ const CreateChargebee = (httpClient) => {
|
|
|
78
78
|
urlSuffix: metaArr[3],
|
|
79
79
|
hasIdInUrl: metaArr[4],
|
|
80
80
|
isListReq: metaArr[0] === 'list',
|
|
81
|
+
subDomain: metaArr[5],
|
|
82
|
+
isJsonRequest: metaArr[6],
|
|
83
|
+
jsonKeys: metaArr[7],
|
|
81
84
|
};
|
|
82
85
|
this[res][apiCall.methodName] = this._createApiFunc(apiCall, this._env);
|
|
83
86
|
}
|
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.5.0',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|