Skip to content

Commit 2345487

Browse files
Merge pull request #346 from OneBusAway/release-please--branches--main--changes--next--components--onebusaway-sdk
release: 1.10.2
2 parents 6cc980f + 0f948c3 commit 2345487

File tree

7 files changed

+30
-20
lines changed

7 files changed

+30
-20
lines changed

.release-please-manifest.json

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

CHANGELOG.md

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

3+
## 1.10.2 (2025-07-10)
4+
5+
Full Changelog: [v1.10.1...v1.10.2](https://github.com/OneBusAway/js-sdk/compare/v1.10.1...v1.10.2)
6+
7+
### Chores
8+
9+
* make some internal functions async ([bd7a6e7](https://github.com/OneBusAway/js-sdk/commit/bd7a6e78fae9e047beed8d8ada8c3f93558bef60))
10+
311
## 1.10.1 (2025-07-03)
412

513
Full Changelog: [v1.10.0...v1.10.1](https://github.com/OneBusAway/js-sdk/compare/v1.10.0...v1.10.1)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "onebusaway-sdk",
3-
"version": "1.10.1",
3+
"version": "1.10.2",
44
"description": "The official TypeScript library for the Onebusaway SDK API",
55
"author": "Onebusaway SDK <[email protected]>",
66
"types": "dist/index.d.ts",

src/core.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ export abstract class APIClient {
299299
return null;
300300
}
301301

302-
buildRequest<Req>(
302+
async buildRequest<Req>(
303303
inputOptions: FinalRequestOptions<Req>,
304304
{ retryCount = 0 }: { retryCount?: number } = {},
305-
): { req: RequestInit; url: string; timeout: number } {
305+
): Promise<{ req: RequestInit; url: string; timeout: number }> {
306306
const options = { ...inputOptions };
307307
const { method, path, query, defaultBaseURL, headers: headers = {} } = options;
308308

@@ -450,7 +450,9 @@ export abstract class APIClient {
450450

451451
await this.prepareOptions(options);
452452

453-
const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
453+
const { req, url, timeout } = await this.buildRequest(options, {
454+
retryCount: maxRetries - retriesRemaining,
455+
});
454456

455457
await this.prepareRequest(req, { url, options });
456458

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '1.10.1'; // x-release-please-version
1+
export const VERSION = '1.10.2'; // x-release-please-version

tests/index.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ describe('instantiate client', () => {
2525
apiKey: 'My API Key',
2626
});
2727

28-
test('they are used in the request', () => {
29-
const { req } = client.buildRequest({ path: '/foo', method: 'post' });
28+
test('they are used in the request', async () => {
29+
const { req } = await client.buildRequest({ path: '/foo', method: 'post' });
3030
expect((req.headers as Headers)['x-my-default-header']).toEqual('2');
3131
});
3232

33-
test('can ignore `undefined` and leave the default', () => {
34-
const { req } = client.buildRequest({
33+
test('can ignore `undefined` and leave the default', async () => {
34+
const { req } = await client.buildRequest({
3535
path: '/foo',
3636
method: 'post',
3737
headers: { 'X-My-Default-Header': undefined },
3838
});
3939
expect((req.headers as Headers)['x-my-default-header']).toEqual('2');
4040
});
4141

42-
test('can be removed with `null`', () => {
43-
const { req } = client.buildRequest({
42+
test('can be removed with `null`', async () => {
43+
const { req } = await client.buildRequest({
4444
path: '/foo',
4545
method: 'post',
4646
headers: { 'X-My-Default-Header': null },
@@ -255,20 +255,20 @@ describe('request building', () => {
255255
const client = new OnebusawaySDK({ apiKey: 'My API Key' });
256256

257257
describe('Content-Length', () => {
258-
test('handles multi-byte characters', () => {
259-
const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } });
258+
test('handles multi-byte characters', async () => {
259+
const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } });
260260
expect((req.headers as Record<string, string>)['content-length']).toEqual('20');
261261
});
262262

263-
test('handles standard characters', () => {
264-
const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } });
263+
test('handles standard characters', async () => {
264+
const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } });
265265
expect((req.headers as Record<string, string>)['content-length']).toEqual('22');
266266
});
267267
});
268268

269269
describe('custom headers', () => {
270-
test('handles undefined', () => {
271-
const { req } = client.buildRequest({
270+
test('handles undefined', async () => {
271+
const { req } = await client.buildRequest({
272272
path: '/foo',
273273
method: 'post',
274274
body: { value: 'hello' },

0 commit comments

Comments
 (0)