stripe 18.1.0 → 18.1.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 +14 -0
- package/README.md +11 -11
- package/VERSION +1 -1
- package/cjs/RequestSender.js +2 -2
- package/cjs/StripeResource.js +1 -1
- package/cjs/stripe.core.js +1 -1
- package/cjs/utils.js +5 -0
- package/esm/RequestSender.js +2 -2
- package/esm/StripeResource.js +1 -1
- package/esm/stripe.core.js +1 -1
- package/esm/utils.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## 18.1.1 - 2025-05-19
|
|
3
|
+
* [#2308](https://github.com/stripe/stripe-node/pull/2308) RawRequest can use custom host
|
|
4
|
+
* RawRequest now allows you set `host` and `streaming` in request options.
|
|
5
|
+
```typescript
|
|
6
|
+
const file = await stripe.rawRequest(
|
|
7
|
+
'GET',
|
|
8
|
+
'/v1/files/file_123/contents',
|
|
9
|
+
{},
|
|
10
|
+
{host: 'files.stripe.com', streaming: true}
|
|
11
|
+
);
|
|
12
|
+
```
|
|
13
|
+
* [#2320](https://github.com/stripe/stripe-node/pull/2320) fix: examples/webhook-signing/nestjs/package.json to reduce vulnerabi…
|
|
14
|
+
* [#2326](https://github.com/stripe/stripe-node/pull/2326) Adds CONTRIBUTING.md
|
|
15
|
+
|
|
2
16
|
## 18.1.0 - 2025-04-30
|
|
3
17
|
|
|
4
18
|
This release changes the pinned API version to `2025-04-30.basil`.
|
package/README.md
CHANGED
|
@@ -523,23 +523,23 @@ const stripe = new Stripe('sk_test_...', {
|
|
|
523
523
|
});
|
|
524
524
|
```
|
|
525
525
|
|
|
526
|
-
###
|
|
526
|
+
### Public Preview SDKs
|
|
527
527
|
|
|
528
|
-
Stripe has features in the
|
|
529
|
-
We would love for you to try these
|
|
530
|
-
The beta versions can be installed in one of two ways
|
|
528
|
+
Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `15.2.0-beta.2`.
|
|
529
|
+
We would love for you to try these as we incrementally release new features and improve them based on your feedback.
|
|
531
530
|
|
|
532
|
-
|
|
533
|
-
- To install a specific beta version, replace the term "beta" in the above command with the version number like `npm install stripe@1.2.3-beta.1 --save`
|
|
531
|
+
To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-node/releases/) and use it in the below command
|
|
534
532
|
|
|
535
|
-
|
|
536
|
-
|
|
533
|
+
```
|
|
534
|
+
npm install stripe@<replace-with-the-version-of-your-choice> --save
|
|
535
|
+
```
|
|
537
536
|
|
|
538
|
-
|
|
537
|
+
> **Note**
|
|
538
|
+
> There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version in your package.json file. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest public preview SDK.
|
|
539
539
|
|
|
540
|
-
The versions tab on the [stripe page on npm](https://www.npmjs.com/package/stripe) lists the current tags in use. The `beta` tag here corresponds to the the latest
|
|
540
|
+
The versions tab on the [stripe page on npm](https://www.npmjs.com/package/stripe) lists the current tags in use. The `beta` tag here corresponds to the the latest public preview SDK.
|
|
541
541
|
|
|
542
|
-
|
|
542
|
+
Some preview features require a name and version to be set in the `Stripe-Version` header like `feature_beta=v3`. If your preview feature has this requirement, use the `apiVersion` property of `config` object to set it:
|
|
543
543
|
|
|
544
544
|
```js
|
|
545
545
|
const stripe = new Stripe('sk_test_...', {
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
18.1.
|
|
1
|
+
18.1.1
|
package/cjs/RequestSender.js
CHANGED
package/cjs/StripeResource.js
CHANGED
|
@@ -108,7 +108,7 @@ StripeResource.prototype = {
|
|
|
108
108
|
const data = encode(Object.assign({}, dataFromArgs, overrideData));
|
|
109
109
|
const options = (0, utils_js_1.getOptionsFromArgs)(args);
|
|
110
110
|
const host = options.host || spec.host;
|
|
111
|
-
const streaming = !!spec.streaming;
|
|
111
|
+
const streaming = !!spec.streaming || !!options.streaming;
|
|
112
112
|
// Validate that there are no more args.
|
|
113
113
|
if (args.filter((x) => x != null).length) {
|
|
114
114
|
throw new Error(`Stripe: Unknown arguments (${args}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${requestMethod} \`${path}\`)`);
|
package/cjs/stripe.core.js
CHANGED
|
@@ -36,7 +36,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
|
|
|
36
36
|
];
|
|
37
37
|
const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
|
|
38
38
|
function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
|
|
39
|
-
Stripe.PACKAGE_VERSION = '18.1.
|
|
39
|
+
Stripe.PACKAGE_VERSION = '18.1.1';
|
|
40
40
|
Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
|
|
41
41
|
Stripe.StripeResource = StripeResource_js_1.StripeResource;
|
|
42
42
|
Stripe.resources = resources;
|
package/cjs/utils.js
CHANGED
|
@@ -13,6 +13,7 @@ const OPTIONS_KEYS = [
|
|
|
13
13
|
'authenticator',
|
|
14
14
|
'stripeContext',
|
|
15
15
|
'additionalHeaders',
|
|
16
|
+
'streaming',
|
|
16
17
|
];
|
|
17
18
|
function isOptionsHash(o) {
|
|
18
19
|
return (o &&
|
|
@@ -107,6 +108,7 @@ function getOptionsFromArgs(args) {
|
|
|
107
108
|
host: null,
|
|
108
109
|
headers: {},
|
|
109
110
|
settings: {},
|
|
111
|
+
streaming: false,
|
|
110
112
|
};
|
|
111
113
|
if (args.length > 0) {
|
|
112
114
|
const arg = args[args.length - 1];
|
|
@@ -159,6 +161,9 @@ function getOptionsFromArgs(args) {
|
|
|
159
161
|
if (params.additionalHeaders) {
|
|
160
162
|
opts.headers = params.additionalHeaders;
|
|
161
163
|
}
|
|
164
|
+
if (params.streaming) {
|
|
165
|
+
opts.streaming = true;
|
|
166
|
+
}
|
|
162
167
|
}
|
|
163
168
|
}
|
|
164
169
|
return opts;
|
package/esm/RequestSender.js
CHANGED
|
@@ -307,8 +307,8 @@ export class RequestSender {
|
|
|
307
307
|
queryData: {},
|
|
308
308
|
authenticator,
|
|
309
309
|
headers,
|
|
310
|
-
host:
|
|
311
|
-
streaming:
|
|
310
|
+
host: calculatedOptions.host,
|
|
311
|
+
streaming: !!calculatedOptions.streaming,
|
|
312
312
|
settings: {},
|
|
313
313
|
usage: ['raw_request'],
|
|
314
314
|
};
|
package/esm/StripeResource.js
CHANGED
|
@@ -104,7 +104,7 @@ StripeResource.prototype = {
|
|
|
104
104
|
const data = encode(Object.assign({}, dataFromArgs, overrideData));
|
|
105
105
|
const options = getOptionsFromArgs(args);
|
|
106
106
|
const host = options.host || spec.host;
|
|
107
|
-
const streaming = !!spec.streaming;
|
|
107
|
+
const streaming = !!spec.streaming || !!options.streaming;
|
|
108
108
|
// Validate that there are no more args.
|
|
109
109
|
if (args.filter((x) => x != null).length) {
|
|
110
110
|
throw new Error(`Stripe: Unknown arguments (${args}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${requestMethod} \`${path}\`)`);
|
package/esm/stripe.core.js
CHANGED
|
@@ -33,7 +33,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
|
|
|
33
33
|
];
|
|
34
34
|
const defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
|
|
35
35
|
export function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
|
|
36
|
-
Stripe.PACKAGE_VERSION = '18.1.
|
|
36
|
+
Stripe.PACKAGE_VERSION = '18.1.1';
|
|
37
37
|
Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
|
|
38
38
|
Stripe.StripeResource = StripeResource;
|
|
39
39
|
Stripe.resources = resources;
|
package/esm/utils.js
CHANGED
|
@@ -10,6 +10,7 @@ const OPTIONS_KEYS = [
|
|
|
10
10
|
'authenticator',
|
|
11
11
|
'stripeContext',
|
|
12
12
|
'additionalHeaders',
|
|
13
|
+
'streaming',
|
|
13
14
|
];
|
|
14
15
|
export function isOptionsHash(o) {
|
|
15
16
|
return (o &&
|
|
@@ -100,6 +101,7 @@ export function getOptionsFromArgs(args) {
|
|
|
100
101
|
host: null,
|
|
101
102
|
headers: {},
|
|
102
103
|
settings: {},
|
|
104
|
+
streaming: false,
|
|
103
105
|
};
|
|
104
106
|
if (args.length > 0) {
|
|
105
107
|
const arg = args[args.length - 1];
|
|
@@ -152,6 +154,9 @@ export function getOptionsFromArgs(args) {
|
|
|
152
154
|
if (params.additionalHeaders) {
|
|
153
155
|
opts.headers = params.additionalHeaders;
|
|
154
156
|
}
|
|
157
|
+
if (params.streaming) {
|
|
158
|
+
opts.streaming = true;
|
|
159
|
+
}
|
|
155
160
|
}
|
|
156
161
|
}
|
|
157
162
|
return opts;
|