chargebee 3.22.0 → 3.22.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.
- package/CHANGELOG.md +11 -0
- package/cjs/RequestWrapper.js +8 -5
- package/cjs/environment.js +1 -1
- package/esm/RequestWrapper.js +8 -5
- package/esm/environment.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
### v3.22.1 (2026-03-09)
|
|
2
|
+
* * *
|
|
3
|
+
### Bug Fixes:
|
|
4
|
+
- Fixed GET requests incorrectly sending a request body. Parameters are now only serialized into the request body for non-GET requests.
|
|
5
|
+
|
|
6
|
+
### Tests:
|
|
7
|
+
- GET list request — body must be empty.
|
|
8
|
+
- GET retrieve request — body must be empty.
|
|
9
|
+
- GET with params — params go into the query string, not the body.
|
|
10
|
+
- POST request — body is correctly populated with encoded params.
|
|
11
|
+
|
|
1
12
|
### v3.22.0 (2026-03-02)
|
|
2
13
|
* * *
|
|
3
14
|
### New Resources:
|
package/cjs/RequestWrapper.js
CHANGED
|
@@ -64,11 +64,14 @@ class RequestWrapper {
|
|
|
64
64
|
requestParams = {};
|
|
65
65
|
}
|
|
66
66
|
const jsonKeys = this.apiCall.jsonKeys;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
let data = null;
|
|
68
|
+
if (this.apiCall.httpMethod !== 'GET') {
|
|
69
|
+
data = this.apiCall.isJsonRequest
|
|
70
|
+
? JSON.stringify(requestParams)
|
|
71
|
+
: (0, util_js_1.encodeParams)(requestParams, undefined, undefined, undefined, jsonKeys);
|
|
72
|
+
}
|
|
70
73
|
const requestHeaders = Object.assign({}, this.httpHeaders);
|
|
71
|
-
if (data.length) {
|
|
74
|
+
if (data && data.length) {
|
|
72
75
|
(0, util_js_1.extend)(true, requestHeaders, {
|
|
73
76
|
'Content-Length': data.length,
|
|
74
77
|
});
|
|
@@ -90,7 +93,7 @@ class RequestWrapper {
|
|
|
90
93
|
const url = new URL(path, `${env.protocol}://${(0, util_js_1.getHost)(env, this.apiCall.subDomain)}${env.port ? `:${env.port}` : ''}`);
|
|
91
94
|
const request = new Request(url, {
|
|
92
95
|
method: this.apiCall.httpMethod,
|
|
93
|
-
body: data
|
|
96
|
+
body: data || undefined,
|
|
94
97
|
headers: this._createHeaders(requestHeaders),
|
|
95
98
|
});
|
|
96
99
|
const resp = await this.envArg.httpClient.makeApiRequest(request, env.timeout);
|
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.22.
|
|
14
|
+
clientVersion: 'v3.22.1',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/esm/RequestWrapper.js
CHANGED
|
@@ -61,11 +61,14 @@ export class RequestWrapper {
|
|
|
61
61
|
requestParams = {};
|
|
62
62
|
}
|
|
63
63
|
const jsonKeys = this.apiCall.jsonKeys;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
let data = null;
|
|
65
|
+
if (this.apiCall.httpMethod !== 'GET') {
|
|
66
|
+
data = this.apiCall.isJsonRequest
|
|
67
|
+
? JSON.stringify(requestParams)
|
|
68
|
+
: encodeParams(requestParams, undefined, undefined, undefined, jsonKeys);
|
|
69
|
+
}
|
|
67
70
|
const requestHeaders = Object.assign({}, this.httpHeaders);
|
|
68
|
-
if (data.length) {
|
|
71
|
+
if (data && data.length) {
|
|
69
72
|
extend(true, requestHeaders, {
|
|
70
73
|
'Content-Length': data.length,
|
|
71
74
|
});
|
|
@@ -87,7 +90,7 @@ export class RequestWrapper {
|
|
|
87
90
|
const url = new URL(path, `${env.protocol}://${getHost(env, this.apiCall.subDomain)}${env.port ? `:${env.port}` : ''}`);
|
|
88
91
|
const request = new Request(url, {
|
|
89
92
|
method: this.apiCall.httpMethod,
|
|
90
|
-
body: data
|
|
93
|
+
body: data || undefined,
|
|
91
94
|
headers: this._createHeaders(requestHeaders),
|
|
92
95
|
});
|
|
93
96
|
const resp = await this.envArg.httpClient.makeApiRequest(request, env.timeout);
|
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.22.
|
|
11
|
+
clientVersion: 'v3.22.1',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|