Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 1.5.0 #269

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.4.0"
".": "1.5.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 28
configured_endpoints: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-6f08502508c8ad25235971add3124a1cde4f1c3ec705d5df455d750e0adcb90b.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.5.0 (2024-11-29)

Full Changelog: [v1.4.0...v1.5.0](https://github.com/OneBusAway/js-sdk/compare/v1.4.0...v1.5.0)

### Features

* **api:** api update ([#268](https://github.com/OneBusAway/js-sdk/issues/268)) ([aae3f08](https://github.com/OneBusAway/js-sdk/commit/aae3f08995e6fad2f89ac0ca1702af39152d0363))

## 1.4.0 (2024-11-29)

Full Changelog: [v1.3.0...v1.4.0](https://github.com/OneBusAway/js-sdk/compare/v1.3.0...v1.4.0)
Expand Down
10 changes: 10 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ Methods:

- <code title="get /api/where/stops-for-route/{routeID}.json">client.stopsForRoute.<a href="./src/resources/stops-for-route.ts">list</a>(routeId, { ...params }) -> StopsForRouteListResponse</code>

# StopsForAgency

Types:

- <code><a href="./src/resources/stops-for-agency.ts">StopsForAgencyListResponse</a></code>

Methods:

- <code title="get /api/where/stops-for-agency/{agencyID}.json">client.stopsForAgency.<a href="./src/resources/stops-for-agency.ts">list</a>(agencyId) -> StopsForAgencyListResponse</code>

# Stop

Types:
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.4.0",
"version": "1.5.0",
"description": "The official TypeScript library for the Onebusaway SDK API",
"author": "Onebusaway SDK <info@onebusaway.org>",
"types": "dist/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
import { Shape, ShapeRetrieveResponse } from './resources/shape';
import { Stop, StopRetrieveResponse } from './resources/stop';
import { StopIDsForAgency, StopIDsForAgencyListResponse } from './resources/stop-ids-for-agency';
import { StopsForAgency, StopsForAgencyListResponse } from './resources/stops-for-agency';
import {
StopsForLocation,
StopsForLocationListParams,
Expand Down Expand Up @@ -209,6 +210,7 @@ export class OnebusawaySDK extends Core.APIClient {
currentTime: API.CurrentTime = new API.CurrentTime(this);
stopsForLocation: API.StopsForLocation = new API.StopsForLocation(this);
stopsForRoute: API.StopsForRoute = new API.StopsForRoute(this);
stopsForAgency: API.StopsForAgency = new API.StopsForAgency(this);
stop: API.Stop = new API.Stop(this);
stopIdsForAgency: API.StopIDsForAgency = new API.StopIDsForAgency(this);
scheduleForStop: API.ScheduleForStop = new API.ScheduleForStop(this);
Expand Down Expand Up @@ -276,6 +278,7 @@ OnebusawaySDK.Config = Config;
OnebusawaySDK.CurrentTime = CurrentTime;
OnebusawaySDK.StopsForLocation = StopsForLocation;
OnebusawaySDK.StopsForRoute = StopsForRoute;
OnebusawaySDK.StopsForAgency = StopsForAgency;
OnebusawaySDK.Stop = Stop;
OnebusawaySDK.StopIDsForAgency = StopIDsForAgency;
OnebusawaySDK.ScheduleForStop = ScheduleForStop;
Expand Down Expand Up @@ -328,6 +331,8 @@ export declare namespace OnebusawaySDK {
type StopsForRouteListParams as StopsForRouteListParams,
};

export { StopsForAgency as StopsForAgency, type StopsForAgencyListResponse as StopsForAgencyListResponse };

export { Stop as Stop, type StopRetrieveResponse as StopRetrieveResponse };

export {
Expand Down
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export {
export { Shape, type ShapeRetrieveResponse } from './shape';
export { Stop, type StopRetrieveResponse } from './stop';
export { StopIDsForAgency, type StopIDsForAgencyListResponse } from './stop-ids-for-agency';
export { StopsForAgency, type StopsForAgencyListResponse } from './stops-for-agency';
export {
StopsForLocation,
type StopsForLocationListResponse,
Expand Down
54 changes: 54 additions & 0 deletions src/resources/stops-for-agency.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../resource';
import * as Core from '../core';
import * as Shared from './shared';

export class StopsForAgency extends APIResource {
/**
* Get stops for a specific agency
*/
list(agencyId: string, options?: Core.RequestOptions): Core.APIPromise<StopsForAgencyListResponse> {
return this._client.get(`/api/where/stops-for-agency/${agencyId}.json`, options);
}
}

export interface StopsForAgencyListResponse extends Shared.ResponseWrapper {
limitExceeded: boolean;

list: Array<StopsForAgencyListResponse.List>;

references: Shared.References;

outOfRange?: boolean;
}

export namespace StopsForAgencyListResponse {
export interface List {
id: string;

lat: number;

lon: number;

name: string;

parent: string;

routeIds: Array<string>;

staticRouteIds: Array<string>;

code?: string;

direction?: string;

locationType?: number;

wheelchairBoarding?: string;
}
}

export declare namespace StopsForAgency {
export { type StopsForAgencyListResponse as StopsForAgencyListResponse };
}
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.4.0'; // x-release-please-version
export const VERSION = '1.5.0'; // x-release-please-version
29 changes: 29 additions & 0 deletions tests/api-resources/stops-for-agency.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import OnebusawaySDK from 'onebusaway-sdk';
import { Response } from 'node-fetch';

const client = new OnebusawaySDK({
apiKey: 'My API Key',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource stopsForAgency', () => {
test('list', async () => {
const responsePromise = client.stopsForAgency.list('agencyID');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

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.stopsForAgency.list('agencyID', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(OnebusawaySDK.NotFoundError);
});
});