chargebee 3.0.0-beta.1 → 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 +6 -0
- package/README.md +3 -1
- package/cjs/RequestWrapper.js +5 -2
- package/cjs/environment.js +1 -1
- package/esm/RequestWrapper.js +5 -2
- package/esm/environment.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This is the [Node.js](http://nodejs.org/) library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com).
|
|
4
4
|
|
|
5
|
+
Please refer to the [migration guide](https://github.com/chargebee/chargebee-node/wiki/Migration-guide-for-v3) if you are migrating from the older versions of [chargebee-typescript](https://www.npmjs.com/package/chargebee-typescript) or [chargebee](https://www.npmjs.com/package/chargebee/v/2.40.0).
|
|
6
|
+
|
|
5
7
|
## Requirements
|
|
6
8
|
|
|
7
9
|
Node.js 18 or higher.
|
|
@@ -144,4 +146,4 @@ If you find any bugs or have any feedback, open an issue in this repository or e
|
|
|
144
146
|
|
|
145
147
|
## License
|
|
146
148
|
|
|
147
|
-
See the [LICENSE](./LICENSE) file.
|
|
149
|
+
See the [LICENSE](./LICENSE) file.
|
package/cjs/RequestWrapper.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.RequestWrapper = void 0;
|
|
|
4
4
|
const util_js_1 = require("./util.js");
|
|
5
5
|
const coreCommon_js_1 = require("./coreCommon.js");
|
|
6
6
|
const node_buffer_1 = require("node:buffer");
|
|
7
|
-
const IDEMPOTENCY_HEADER = 'chargebee-idempotency-key';
|
|
8
7
|
class RequestWrapper {
|
|
9
8
|
constructor(args, apiCall, envArg) {
|
|
10
9
|
this.getRequest = () => {
|
|
@@ -55,11 +54,15 @@ class RequestWrapper {
|
|
|
55
54
|
params = {};
|
|
56
55
|
}
|
|
57
56
|
let data = (0, util_js_1.encodeParams)(params);
|
|
57
|
+
if (data.length) {
|
|
58
|
+
(0, util_js_1.extend)(true, this.httpHeaders, {
|
|
59
|
+
'Content-Length': data.length,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
58
62
|
(0, util_js_1.extend)(true, this.httpHeaders, {
|
|
59
63
|
Authorization: 'Basic ' + node_buffer_1.Buffer.from(env.apiKey + ':').toString('base64'),
|
|
60
64
|
Accept: 'application/json',
|
|
61
65
|
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
62
|
-
'Content-Length': data.length,
|
|
63
66
|
'User-Agent': 'Chargebee-NodeJs-Client ' + env.clientVersion,
|
|
64
67
|
'Lang-Version': typeof process === 'undefined' ? '' : process.version,
|
|
65
68
|
});
|
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.0.0-beta.
|
|
14
|
+
clientVersion: 'v3.0.0-beta.2',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/esm/RequestWrapper.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { extend, callbackifyPromise, getApiURL, encodeListParams, encodeParams, serialize, getHost, } from './util.js';
|
|
2
2
|
import { handleResponse } from './coreCommon.js';
|
|
3
3
|
import { Buffer } from 'node:buffer';
|
|
4
|
-
const IDEMPOTENCY_HEADER = 'chargebee-idempotency-key';
|
|
5
4
|
export class RequestWrapper {
|
|
6
5
|
constructor(args, apiCall, envArg) {
|
|
7
6
|
this.getRequest = () => {
|
|
@@ -52,11 +51,15 @@ export class RequestWrapper {
|
|
|
52
51
|
params = {};
|
|
53
52
|
}
|
|
54
53
|
let data = encodeParams(params);
|
|
54
|
+
if (data.length) {
|
|
55
|
+
extend(true, this.httpHeaders, {
|
|
56
|
+
'Content-Length': data.length,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
55
59
|
extend(true, this.httpHeaders, {
|
|
56
60
|
Authorization: 'Basic ' + Buffer.from(env.apiKey + ':').toString('base64'),
|
|
57
61
|
Accept: 'application/json',
|
|
58
62
|
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
59
|
-
'Content-Length': data.length,
|
|
60
63
|
'User-Agent': 'Chargebee-NodeJs-Client ' + env.clientVersion,
|
|
61
64
|
'Lang-Version': typeof process === 'undefined' ? '' : process.version,
|
|
62
65
|
});
|
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.0.0-beta.
|
|
11
|
+
clientVersion: 'v3.0.0-beta.2',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|