Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.18.0"
".": "1.19.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <info@onebusaway.org>",
"types": "dist/index.d.ts",
Expand Down
23 changes: 19 additions & 4 deletions src/resources/routes-for-location.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -9,9 +10,17 @@ export class RoutesForLocation extends APIResource {
* routes-for-location
*/
list(
query: RoutesForLocationListParams,
query?: RoutesForLocationListParams,
options?: Core.RequestOptions,
): Core.APIPromise<RoutesForLocationListResponse>;
list(options?: Core.RequestOptions): Core.APIPromise<RoutesForLocationListResponse>;
list(
query: RoutesForLocationListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<RoutesForLocationListResponse> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.get('/api/where/routes-for-location.json', { query, ...options });
}
}
Expand Down Expand Up @@ -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;
Expand Down
23 changes: 19 additions & 4 deletions src/resources/stops-for-location.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -9,9 +10,17 @@ export class StopsForLocation extends APIResource {
* stops-for-location
*/
list(
query: StopsForLocationListParams,
query?: StopsForLocationListParams,
options?: Core.RequestOptions,
): Core.APIPromise<StopsForLocationListResponse>;
list(options?: Core.RequestOptions): Core.APIPromise<StopsForLocationListResponse>;
list(
query: StopsForLocationListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<StopsForLocationListResponse> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.get('/api/where/stops-for-location.json', { query, ...options });
}
}
Expand Down Expand Up @@ -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)
*/
Expand Down
20 changes: 10 additions & 10 deletions src/resources/trips-for-location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.18.0'; // x-release-please-version
export const VERSION = '1.19.0'; // x-release-please-version
35 changes: 24 additions & 11 deletions tests/api-resources/routes-for-location.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
});
});
35 changes: 24 additions & 11 deletions tests/api-resources/stops-for-location.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
});
});
11 changes: 3 additions & 8 deletions tests/api-resources/trips-for-location.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
});
});
Expand Down
Loading