From 5ed9418307a412c76041ff50de8de84a27f6e5ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 07:09:31 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +-- src/resources/routes-for-location.ts | 23 +++++++++--- src/resources/stops-for-location.ts | 23 +++++++++--- src/resources/trips-for-location.ts | 20 +++++------ .../api-resources/routes-for-location.test.ts | 35 +++++++++++++------ .../api-resources/stops-for-location.test.ts | 35 +++++++++++++------ .../api-resources/trips-for-location.test.ts | 11 ++---- 7 files changed, 101 insertions(+), 50 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5a00449..1e6aa3d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit/open-transit-e8511c379642404d73fd2ff068f81d845054108160ccd58343021bbd0b444a37.yml -openapi_spec_hash: b8824d511c16ed314dc7cee996f4fd97 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit/open-transit-da4eecc88401fd486b0b8ac2a7b3f442748713e3128d878c7f3e24ea7f65f31d.yml +openapi_spec_hash: 8df6b1871782bcd2bd8fb1fb2bbc2694 config_hash: c28ddf5b7754155603d9fd1c5fcaeeff diff --git a/src/resources/routes-for-location.ts b/src/resources/routes-for-location.ts index 42f2b7c..60d6cc9 100644 --- a/src/resources/routes-for-location.ts +++ b/src/resources/routes-for-location.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../resource'; +import { isRequestOptions } from '../core'; import * as Core from '../core'; import * as Shared from './shared'; @@ -9,9 +10,17 @@ export class RoutesForLocation extends APIResource { * routes-for-location */ list( - query: RoutesForLocationListParams, + query?: RoutesForLocationListParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: RoutesForLocationListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } return this._client.get('/api/where/routes-for-location.json', { query, ...options }); } } @@ -57,12 +66,18 @@ export namespace RoutesForLocationListResponse { } export interface RoutesForLocationListParams { - lat: number; - - lon: number; + /** + * If omitted, defaults to 0.0. + */ + lat?: number; latSpan?: number; + /** + * If omitted, defaults to 0.0. + */ + lon?: number; + lonSpan?: number; query?: string; diff --git a/src/resources/stops-for-location.ts b/src/resources/stops-for-location.ts index 54d3369..d3c69ac 100644 --- a/src/resources/stops-for-location.ts +++ b/src/resources/stops-for-location.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../resource'; +import { isRequestOptions } from '../core'; import * as Core from '../core'; import * as Shared from './shared'; @@ -9,9 +10,17 @@ export class StopsForLocation extends APIResource { * stops-for-location */ list( - query: StopsForLocationListParams, + query?: StopsForLocationListParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: StopsForLocationListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } return this._client.get('/api/where/stops-for-location.json', { query, ...options }); } } @@ -59,15 +68,21 @@ export namespace StopsForLocationListResponse { } export interface StopsForLocationListParams { - lat: number; - - lon: number; + /** + * If omitted, defaults to 0.0. + */ + lat?: number; /** * An alternative to radius to set the search bounding box (optional) */ latSpan?: number; + /** + * If omitted, defaults to 0.0. + */ + lon?: number; + /** * An alternative to radius to set the search bounding box (optional) */ diff --git a/src/resources/trips-for-location.ts b/src/resources/trips-for-location.ts index ed425c0..6038b51 100644 --- a/src/resources/trips-for-location.ts +++ b/src/resources/trips-for-location.ts @@ -265,21 +265,11 @@ export namespace TripsForLocationListResponse { } export interface TripsForLocationListParams { - /** - * The latitude coordinate of the search center - */ - lat: number; - /** * Latitude span of the search bounding box */ latSpan: number; - /** - * The longitude coordinate of the search center - */ - lon: number; - /** * Longitude span of the search bounding box */ @@ -297,6 +287,16 @@ export interface TripsForLocationListParams { */ includeTrip?: boolean; + /** + * The latitude coordinate of the search center. If omitted, defaults to 0.0. + */ + lat?: number; + + /** + * The longitude coordinate of the search center. If omitted, defaults to 0.0. + */ + lon?: number; + /** * Specific time for the query. Defaults to the current time. */ diff --git a/tests/api-resources/routes-for-location.test.ts b/tests/api-resources/routes-for-location.test.ts index bb4e255..55c77d8 100644 --- a/tests/api-resources/routes-for-location.test.ts +++ b/tests/api-resources/routes-for-location.test.ts @@ -9,8 +9,8 @@ const client = new OnebusawaySDK({ }); describe('resource routesForLocation', () => { - test('list: only required params', async () => { - const responsePromise = client.routesForLocation.list({ lat: 0, lon: 0 }); + test('list', async () => { + const responsePromise = client.routesForLocation.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -20,14 +20,27 @@ describe('resource routesForLocation', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('list: required and optional params', async () => { - const response = await client.routesForLocation.list({ - lat: 0, - lon: 0, - latSpan: 0, - lonSpan: 0, - query: 'query', - radius: 0, - }); + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.routesForLocation.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + OnebusawaySDK.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.routesForLocation.list( + { + lat: 0, + latSpan: 0, + lon: 0, + lonSpan: 0, + query: 'query', + radius: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(OnebusawaySDK.NotFoundError); }); }); diff --git a/tests/api-resources/stops-for-location.test.ts b/tests/api-resources/stops-for-location.test.ts index ddd8783..acf0e7b 100644 --- a/tests/api-resources/stops-for-location.test.ts +++ b/tests/api-resources/stops-for-location.test.ts @@ -9,8 +9,8 @@ const client = new OnebusawaySDK({ }); describe('resource stopsForLocation', () => { - test('list: only required params', async () => { - const responsePromise = client.stopsForLocation.list({ lat: 0, lon: 0 }); + test('list', async () => { + const responsePromise = client.stopsForLocation.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -20,14 +20,27 @@ describe('resource stopsForLocation', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('list: required and optional params', async () => { - const response = await client.stopsForLocation.list({ - lat: 0, - lon: 0, - latSpan: 0, - lonSpan: 0, - query: 'query', - radius: 0, - }); + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.stopsForLocation.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + OnebusawaySDK.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.stopsForLocation.list( + { + lat: 0, + latSpan: 0, + lon: 0, + lonSpan: 0, + query: 'query', + radius: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(OnebusawaySDK.NotFoundError); }); }); diff --git a/tests/api-resources/trips-for-location.test.ts b/tests/api-resources/trips-for-location.test.ts index a2ea75d..6e3ed34 100644 --- a/tests/api-resources/trips-for-location.test.ts +++ b/tests/api-resources/trips-for-location.test.ts @@ -10,12 +10,7 @@ const client = new OnebusawaySDK({ describe('resource tripsForLocation', () => { test('list: only required params', async () => { - const responsePromise = client.tripsForLocation.list({ - lat: 0, - latSpan: 0, - lon: 0, - lonSpan: 0, - }); + const responsePromise = client.tripsForLocation.list({ latSpan: 0, lonSpan: 0 }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -27,12 +22,12 @@ describe('resource tripsForLocation', () => { test('list: required and optional params', async () => { const response = await client.tripsForLocation.list({ - lat: 0, latSpan: 0, - lon: 0, lonSpan: 0, includeSchedule: true, includeTrip: true, + lat: 0, + lon: 0, time: 0, }); }); From 785a697ef0b9a47f423f35c700b648fbbdf04655 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 07:09:56 +0000 Subject: [PATCH 2/2] release: 1.19.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ package-lock.json | 4 ++-- package.json | 2 +- src/version.ts | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 18e9f06..d0d087a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.18.0" + ".": "1.19.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0762452..3a5262d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.19.0 (2026-07-11) + +Full Changelog: [v1.18.0...v1.19.0](https://github.com/OneBusAway/js-sdk/compare/v1.18.0...v1.19.0) + +### Features + +* **api:** api update ([5ed9418](https://github.com/OneBusAway/js-sdk/commit/5ed9418307a412c76041ff50de8de84a27f6e5ae)) + ## 1.18.0 (2026-07-09) Full Changelog: [v1.17.0...v1.18.0](https://github.com/OneBusAway/js-sdk/compare/v1.17.0...v1.18.0) diff --git a/package-lock.json b/package-lock.json index 33b0c99..3c97e05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "onebusaway-sdk", - "version": "1.18.0", + "version": "1.19.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "onebusaway-sdk", - "version": "1.18.0", + "version": "1.19.0", "license": "Apache-2.0", "dependencies": { "@types/node": "^18.11.18", diff --git a/package.json b/package.json index 7ad5e4e..d1d98bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "onebusaway-sdk", - "version": "1.18.0", + "version": "1.19.0", "description": "The official TypeScript library for the Onebusaway SDK API", "author": "Onebusaway SDK ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 2f0d0ca..0158408 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.18.0'; // x-release-please-version +export const VERSION = '1.19.0'; // x-release-please-version