Skip to content

Commit 4a920d0

Browse files
release: 7.7.1 (#227)
* chore(internal): avoid type checking errors with ts-reset * fix(api): remove brand field from ElementalContent * chore(internal/client): fix form-urlencoded requests * chore(internal): remove mock server code * chore: update mock server docs * codegen metadata * fix(docs/contributing): correct pnpm link command * codegen metadata * codegen metadata * chore(internal): codegen related update * codegen metadata * fix(api): remove body_token parameter from tokens.addSingle method * release: 7.7.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent f35a2aa commit 4a920d0

41 files changed

Lines changed: 195 additions & 260 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "7.7.0"
2+
".": "7.7.1"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-3fc1c86b4a83a16393aaf17d1fb3ac6098d30dd057ba872973b57285a7a3f0d0.yml
3-
openapi_spec_hash: 02a545d217b13399f311e99561f9de1d
4-
config_hash: 0789c3cddc625bb9712b3bded274ab6c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-44c2e612f5d40e03f56712a4e123a193e6ea03cc64a91d0c34ee094563dafa1c.yml
3+
openapi_spec_hash: 40bf6b3f7992d55f1bd543f32564ea86
4+
config_hash: b1f6d0f43161b66d201043fcbe5c5695

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 7.7.1 (2026-03-03)
4+
5+
Full Changelog: [v7.7.0...v7.7.1](https://github.com/trycourier/courier-node/compare/v7.7.0...v7.7.1)
6+
7+
### Bug Fixes
8+
9+
* **api:** remove body_token parameter from tokens.addSingle method ([b8de6f7](https://github.com/trycourier/courier-node/commit/b8de6f7d6c936dce1b5e458b881635a4e0d920e4))
10+
* **api:** remove brand field from ElementalContent ([2a3d25d](https://github.com/trycourier/courier-node/commit/2a3d25dac9b544179e928800dba0f53623cd3734))
11+
* **docs/contributing:** correct pnpm link command ([d3b4a96](https://github.com/trycourier/courier-node/commit/d3b4a96b0d1112692832cff49bfd7897ec77df8c))
12+
13+
14+
### Chores
15+
16+
* **internal/client:** fix form-urlencoded requests ([45deac0](https://github.com/trycourier/courier-node/commit/45deac06aa22be68b4ac57136d065dd85668901c))
17+
* **internal:** avoid type checking errors with ts-reset ([88b8c18](https://github.com/trycourier/courier-node/commit/88b8c18a47ac0d71e5a58274eeb705b41dfb42c3))
18+
* **internal:** codegen related update ([879dd2f](https://github.com/trycourier/courier-node/commit/879dd2f830081dd643bff1afafe1a4f3413f80c1))
19+
* **internal:** remove mock server code ([cbd7d67](https://github.com/trycourier/courier-node/commit/cbd7d675567742542d481cf9275fa765524f2dae))
20+
* update mock server docs ([f4a7c1f](https://github.com/trycourier/courier-node/commit/f4a7c1f3590b16463dd8edb1ef81a188ae276d06))
21+
22+
23+
### Documentation
24+
25+
* add AUTO-GENERATED-OVERVIEW markers for README sync ([#228](https://github.com/trycourier/courier-node/issues/228)) ([63dc300](https://github.com/trycourier/courier-node/commit/63dc300ce3d67d339942446c86edeaa0f4aa69ee))
26+
* sync README from mintlify-docs (2026-02-20 18:11 UTC) ([#229](https://github.com/trycourier/courier-node/issues/229)) ([f35a2aa](https://github.com/trycourier/courier-node/commit/f35a2aa144409b12c125a564a003421a9b8a7a5b))
27+
328
## 7.7.0 (2026-02-06)
429

530
Full Changelog: [v7.6.3...v7.7.0](https://github.com/trycourier/courier-node/compare/v7.6.3...v7.7.0)

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,11 @@ $ yarn link @trycourier/courier
6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -global @trycourier/courier
63+
$ pnpm link --global @trycourier/courier
6464
```
6565

6666
## Running tests
6767

68-
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
69-
70-
```sh
71-
$ npx prism mock path/to/your/openapi.yml
72-
```
73-
7468
```sh
7569
$ yarn run test
7670
```

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,4 +424,4 @@ Methods:
424424
- <code title="get /users/{user_id}/tokens">client.users.tokens.<a href="./src/resources/users/tokens.ts">list</a>(userID) -> TokenListResponse</code>
425425
- <code title="delete /users/{user_id}/tokens/{token}">client.users.tokens.<a href="./src/resources/users/tokens.ts">delete</a>(token, { ...params }) -> void</code>
426426
- <code title="put /users/{user_id}/tokens">client.users.tokens.<a href="./src/resources/users/tokens.ts">addMultiple</a>(userID) -> void</code>
427-
- <code title="put /users/{user_id}/tokens/{token}">client.users.tokens.<a href="./src/resources/users/tokens.ts">addSingle</a>(pathToken, { ...params }) -> void</code>
427+
- <code title="put /users/{user_id}/tokens/{token}">client.users.tokens.<a href="./src/resources/users/tokens.ts">addSingle</a>(token, { ...params }) -> void</code>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trycourier/courier",
3-
"version": "7.7.0",
3+
"version": "7.7.1",
44
"description": "The official TypeScript library for the Courier API",
55
"author": "Courier <support@courier.com>",
66
"types": "dist/index.d.ts",

scripts/mock

Lines changed: 0 additions & 41 deletions
This file was deleted.

scripts/test

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,7 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
RED='\033[0;31m'
8-
GREEN='\033[0;32m'
9-
YELLOW='\033[0;33m'
10-
NC='\033[0m' # No Color
117

12-
function prism_is_running() {
13-
curl --silent "http://localhost:4010" >/dev/null 2>&1
14-
}
15-
16-
kill_server_on_port() {
17-
pids=$(lsof -t -i tcp:"$1" || echo "")
18-
if [ "$pids" != "" ]; then
19-
kill "$pids"
20-
echo "Stopped $pids."
21-
fi
22-
}
23-
24-
function is_overriding_api_base_url() {
25-
[ -n "$TEST_API_BASE_URL" ]
26-
}
27-
28-
if ! is_overriding_api_base_url && ! prism_is_running ; then
29-
# When we exit this script, make sure to kill the background mock server process
30-
trap 'kill_server_on_port 4010' EXIT
31-
32-
# Start the dev server
33-
./scripts/mock --daemon
34-
fi
35-
36-
if is_overriding_api_base_url ; then
37-
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
38-
echo
39-
elif ! prism_is_running ; then
40-
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
41-
echo -e "running against your OpenAPI spec."
42-
echo
43-
echo -e "To run the server, pass in the path or url of your OpenAPI"
44-
echo -e "spec to the prism command:"
45-
echo
46-
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
47-
echo
48-
49-
exit 1
50-
else
51-
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
52-
echo
53-
fi
548

559
echo "==> Running tests"
5610
./node_modules/.bin/jest "$@"

src/client.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
1111
import { getPlatformHeaders } from './internal/detect-platform';
1212
import * as Shims from './internal/shims';
1313
import * as Opts from './internal/request-options';
14-
import * as qs from './internal/qs';
14+
import { stringifyQuery } from './internal/utils/query';
1515
import { VERSION } from './version';
1616
import * as Errors from './core/error';
1717
import * as Uploads from './core/uploads';
@@ -331,8 +331,8 @@ export class Courier {
331331
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
332332
}
333333

334-
protected stringifyQuery(query: Record<string, unknown>): string {
335-
return qs.stringify(query, { arrayFormat: 'comma' });
334+
protected stringifyQuery(query: object | Record<string, unknown>): string {
335+
return stringifyQuery(query);
336336
}
337337

338338
private getUserAgent(): string {
@@ -369,7 +369,7 @@ export class Courier {
369369
}
370370

371371
if (typeof query === 'object' && query && !Array.isArray(query)) {
372-
url.search = this.stringifyQuery(query as Record<string, unknown>);
372+
url.search = this.stringifyQuery(query);
373373
}
374374

375375
return url.toString();
@@ -553,7 +553,7 @@ export class Courier {
553553
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
554554

555555
const errText = await response.text().catch((err: any) => castToError(err).message);
556-
const errJSON = safeJSON(errText);
556+
const errJSON = safeJSON(errText) as any;
557557
const errMessage = errJSON ? undefined : errText;
558558

559559
loggerFor(this).debug(
@@ -802,6 +802,14 @@ export class Courier {
802802
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
803803
) {
804804
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
805+
} else if (
806+
typeof body === 'object' &&
807+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
808+
) {
809+
return {
810+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
811+
body: this.stringifyQuery(body),
812+
};
805813
} else {
806814
return this.#encoder({ body, headers });
807815
}

src/internal/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export * from './utils/env';
66
export * from './utils/log';
77
export * from './utils/uuid';
88
export * from './utils/sleep';
9+
export * from './utils/query';

0 commit comments

Comments
 (0)