You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,62 @@
1
1
# Changelog
2
2
3
+
## 0.1.0-alpha.18 (2025-03-20)
4
+
5
+
Full Changelog: [v0.1.0-alpha.17...v0.1.0-alpha.18](https://github.com/stainless-api/builds-node-api/compare/v0.1.0-alpha.17...v0.1.0-alpha.18)
6
+
7
+
### ⚠ BREAKING CHANGES
8
+
9
+
***client:** uri encode path parameters ([#72](https://github.com/stainless-api/builds-node-api/issues/72))
10
+
11
+
### Features
12
+
13
+
* add SKIP_BREW env var to ./scripts/bootstrap ([#92](https://github.com/stainless-api/builds-node-api/issues/92)) ([04fcfb8](https://github.com/stainless-api/builds-node-api/commit/04fcfb8ee32f275672a17d60f211d60bd7bb7f7b))
14
+
***api:** api update ([#100](https://github.com/stainless-api/builds-node-api/issues/100)) ([ea56fde](https://github.com/stainless-api/builds-node-api/commit/ea56fde9c673487f85fbaa0ccf34d872ec602510))
***internal:** clean up undefined File test ([#88](https://github.com/stainless-api/builds-node-api/issues/88)) ([e01791a](https://github.com/stainless-api/builds-node-api/commit/e01791afd6fee8c70f0b05b25aa01e5ca9c54aa9))
28
+
***internal:** return in castToError instead of throwing ([#81](https://github.com/stainless-api/builds-node-api/issues/81)) ([9e2c68d](https://github.com/stainless-api/builds-node-api/commit/9e2c68df46639d5b9d2028f9c30c65a914969428))
***client:** only accept standard types for file uploads ([#84](https://github.com/stainless-api/builds-node-api/issues/84)) ([5311571](https://github.com/stainless-api/builds-node-api/commit/53115711e99f859e6c3bc143d253e564b9547465))
37
+
***docs:** improve docs for withResponse/asResponse ([#91](https://github.com/stainless-api/builds-node-api/issues/91)) ([0e6d878](https://github.com/stainless-api/builds-node-api/commit/0e6d8785dc1003aba4e264f66f3b132bda7398b3))
38
+
***exports:** cleaner resource index imports ([#98](https://github.com/stainless-api/builds-node-api/issues/98)) ([633472c](https://github.com/stainless-api/builds-node-api/commit/633472ca26c6f92569c1d14d8974172ab1cf675c))
39
+
***exports:** stop using path fallbacks ([#99](https://github.com/stainless-api/builds-node-api/issues/99)) ([ea9298e](https://github.com/stainless-api/builds-node-api/commit/ea9298ec40d13ca66107444241780f91e9de5615))
***internal:** fix tests failing on node v18 ([#85](https://github.com/stainless-api/builds-node-api/issues/85)) ([4aa4e67](https://github.com/stainless-api/builds-node-api/commit/4aa4e67a3c9ef52bff63a5250e1ac1f996ef8a70))
46
+
***internal:** fix tests not always being type checked ([#77](https://github.com/stainless-api/builds-node-api/issues/77)) ([bdf4826](https://github.com/stainless-api/builds-node-api/commit/bdf4826ef152bbfe42f5bea82981d2ab8896ee52))
47
+
***internal:** minor client file refactoring ([#97](https://github.com/stainless-api/builds-node-api/issues/97)) ([b16b851](https://github.com/stainless-api/builds-node-api/commit/b16b851f0155a39ce2fa192ee666b7bed7a60f55))
48
+
***internal:** remove extra empty newlines ([#94](https://github.com/stainless-api/builds-node-api/issues/94)) ([9b8c286](https://github.com/stainless-api/builds-node-api/commit/9b8c28645b4c18ccc8e7b6daf4a5c5eb7623c551))
49
+
***internal:** remove unnecessary todo ([#82](https://github.com/stainless-api/builds-node-api/issues/82)) ([096c6fe](https://github.com/stainless-api/builds-node-api/commit/096c6fe767f28f483a4e30a855ef274304c9baef))
50
+
***internal:** remove unused `isRequestOptions()` function ([#70](https://github.com/stainless-api/builds-node-api/issues/70)) ([ea62ef5](https://github.com/stainless-api/builds-node-api/commit/ea62ef59ca827dfafd44be6a83e1a07c9be0435c))
***types:** improved go to definition on fetchOptions ([#90](https://github.com/stainless-api/builds-node-api/issues/90)) ([4652f7b](https://github.com/stainless-api/builds-node-api/commit/4652f7b19b58496b644363b02058c2d97d8b735b))
53
+
***types:** remove type-level dependency on some platform specifics ([#65](https://github.com/stainless-api/builds-node-api/issues/65)) ([7da0b05](https://github.com/stainless-api/builds-node-api/commit/7da0b055d754a96c886dd5362cfacfb74848282c))
54
+
55
+
56
+
### Documentation
57
+
58
+
* update URLs from stainlessapi.com to stainless.com ([#83](https://github.com/stainless-api/builds-node-api/issues/83)) ([f1b7512](https://github.com/stainless-api/builds-node-api/commit/f1b7512436a90a9151f28f34bf264dddff481dd4))
59
+
3
60
## 0.1.0-alpha.17 (2025-01-23)
4
61
5
62
Full Changelog: [v0.1.0-alpha.16...v0.1.0-alpha.17](https://github.com/stainless-api/builds-node-api/compare/v0.1.0-alpha.16...v0.1.0-alpha.17)
Copy file name to clipboardExpand all lines: README.md
+93-24Lines changed: 93 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This library provides convenient access to the Stainless REST API from server-si
6
6
7
7
The REST API documentation can be found on [app.stainlessapi.com](https://app.stainlessapi.com/docs). The full API of this library can be found in [api.md](api.md).
8
8
9
-
It is generated with [Stainless](https://www.stainlessapi.com/).
9
+
It is generated with [Stainless](https://www.stainless.com/).
@@ -146,8 +181,10 @@ Note that requests which time out will be [retried twice by default](#retries).
146
181
### Accessing raw Response data (e.g., headers)
147
182
148
183
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
184
+
This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
149
185
150
186
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
187
+
Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
> All log messages are intended for debugging only. The format and content of log messages
208
+
> may change between releases.
209
+
210
+
#### Log levels
211
+
212
+
The log level can be configured in two ways:
213
+
214
+
1. Via the `STAINLESS_LOG` environment variable
215
+
2. Using the `logLevel` client option (overrides the environment variable if set)
216
+
217
+
```ts
218
+
importStainlessfrom'stainless';
219
+
220
+
const client =newStainless({
221
+
logLevel: 'debug', // Show all log messages
222
+
});
223
+
```
224
+
225
+
Available log levels, from most to least verbose:
226
+
227
+
-`'debug'` - Show debug messages, info, warnings, and errors
228
+
-`'info'` - Show info messages, warnings, and errors
229
+
-`'warn'` - Show warnings and errors (default)
230
+
-`'error'` - Show only errors
231
+
-`'off'` - Disable all logging
232
+
233
+
At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
234
+
Some authentication-related headers are redacted, but sensitive data in request and response bodies
235
+
may still be visible.
236
+
237
+
#### Custom logger
238
+
239
+
By default, this library logs to `globalThis.console`. You can also provide a custom logger.
240
+
Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
241
+
242
+
When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
243
+
below the configured level will not be sent to your logger.
244
+
245
+
```ts
246
+
importStainlessfrom'stainless';
247
+
importpinofrom'pino';
248
+
249
+
const logger =pino();
250
+
251
+
const client =newStainless({
252
+
logger: logger.child({ name: 'Stainless' }),
253
+
logLevel: 'debug', // Send all messages to pino, allowing it to filter
254
+
});
255
+
```
256
+
167
257
### Making custom/undocumented requests
168
258
169
259
This library is typed for convenient access to the documented API. If you need to access undocumented
@@ -223,33 +313,12 @@ globalThis.fetch = fetch;
223
313
Or pass it to the client:
224
314
225
315
```ts
316
+
importStainlessfrom'stainless';
226
317
importfetchfrom'my-fetch';
227
318
228
319
const client =newStainless({ fetch });
229
320
```
230
321
231
-
### Logging and middleware
232
-
233
-
You may also provide a custom `fetch` function when instantiating the client,
234
-
which can be used to inspect or alter the `Request` or `Response` before/after each request:
console.log('About to make a request', url, init);
243
-
const response =awaitfetch(url, init);
244
-
console.log('Got response', response);
245
-
returnresponse;
246
-
},
247
-
});
248
-
```
249
-
250
-
Note that if given a `STAINLESS_LOG=debug` environment variable, this library will log all requests and responses automatically.
251
-
This is intended for debugging purposes only and may change in the future without notice.
252
-
253
322
### Fetch options
254
323
255
324
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
Copy file name to clipboardExpand all lines: SECURITY.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
## Reporting Security Issues
4
4
5
-
This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
5
+
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
6
6
7
-
To report a security issue, please contact the Stainless team at security@stainlessapi.com.
7
+
To report a security issue, please contact the Stainless team at security@stainless.com.
0 commit comments