Skip to content

Commit

Permalink
Merge pull request #84 from OneBusAway/release-please--branches--main…
Browse files Browse the repository at this point in the history
…--changes--next--components--onebusaway-sdk

release: 0.1.0-alpha.20
  • Loading branch information
Ahmedhossamdev authored Jun 29, 2024
2 parents 7698c38 + 0651be8 commit efc06a0
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.19"
".": "0.1.0-alpha.20"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-9834dce7919ec6051ccb2efe87daba2b4134057ed5844cd7bbdaaf6ef48c39f8.yml
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-02cc2e7fb32b8721d3a54086ce0e9126e48c53ef7a48a0f9cc836d58312e412d.yml
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.1.0-alpha.20 (2024-06-29)

Full Changelog: [v0.1.0-alpha.19...v0.1.0-alpha.20](https://github.com/OneBusAway/js-sdk/compare/v0.1.0-alpha.19...v0.1.0-alpha.20)

### Features

* **api:** update via SDK Studio ([#83](https://github.com/OneBusAway/js-sdk/issues/83)) ([63ead40](https://github.com/OneBusAway/js-sdk/commit/63ead409bba325016c0f323fe1deae75a3f2ee73))
* **api:** update via SDK Studio ([#85](https://github.com/OneBusAway/js-sdk/issues/85)) ([1e23f43](https://github.com/OneBusAway/js-sdk/commit/1e23f433b414cd7020dd68d3613566ad2145e163))

## 0.1.0-alpha.19 (2024-06-29)

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

- <code title="get /api/where/stops-for-location.json">client.stopsForLocation.<a href="./src/resources/stops-for-location.ts">retrieve</a>({ ...params }) -> StopsForLocationRetrieveResponse</code>

# Route

Types:

- <code><a href="./src/resources/route.ts">RouteRetrieveResponse</a></code>

Methods:

- <code title="get /api/where/route/{routeID}.json">client.route.<a href="./src/resources/route.ts">retrieve</a>(routeId) -> RouteRetrieveResponse</code>

# ArrivalAndDepartureForStop

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": "0.1.0-alpha.19",
"version": "0.1.0-alpha.20",
"description": "The official TypeScript library for the Onebusaway SDK API",
"author": "Onebusaway SDK <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class OnebusawaySDK extends Core.APIClient {
config: API.Config = new API.Config(this);
currentTime: API.CurrentTime = new API.CurrentTime(this);
stopsForLocation: API.StopsForLocation = new API.StopsForLocation(this);
route: API.Route = new API.Route(this);
arrivalAndDepartureForStop: API.ArrivalAndDepartureForStop = new API.ArrivalAndDepartureForStop(this);
arrivalsAndDeparturesForStop: API.ArrivalsAndDeparturesForStop = new API.ArrivalsAndDeparturesForStop(this);

Expand Down Expand Up @@ -203,6 +204,9 @@ export namespace OnebusawaySDK {
export import StopsForLocationRetrieveResponse = API.StopsForLocationRetrieveResponse;
export import StopsForLocationRetrieveParams = API.StopsForLocationRetrieveParams;

export import Route = API.Route;
export import RouteRetrieveResponse = API.RouteRetrieveResponse;

export import ArrivalAndDepartureForStop = API.ArrivalAndDepartureForStop;
export import ArrivalAndDepartureForStopRetrieveResponse = API.ArrivalAndDepartureForStopRetrieveResponse;
export import ArrivalAndDepartureForStopRetrieveParams = API.ArrivalAndDepartureForStopRetrieveParams;
Expand Down
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export {
} from './arrivals-and-departures-for-stop';
export { ConfigRetrieveResponse, Config } from './config';
export { CurrentTimeRetrieveResponse, CurrentTime } from './current-time';
export { RouteRetrieveResponse, Route } from './route';
export {
StopsForLocationRetrieveResponse,
StopsForLocationRetrieveParams,
Expand Down
53 changes: 53 additions & 0 deletions src/resources/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

export class Route extends APIResource {
/**
* Retrieve information for a specific route identified by its unique ID.
*/
retrieve(routeId: string, options?: Core.RequestOptions): Core.APIPromise<RouteRetrieveResponse> {
return this._client.get(`/api/where/route/${routeId}.json`, options);
}
}

export interface RouteRetrieveResponse extends Shared.ResponseWrapper {
data?: RouteRetrieveResponse.Data;
}

export namespace RouteRetrieveResponse {
export interface Data {
entry?: Data.Entry;

references?: Shared.References;
}

export namespace Data {
export interface Entry {
id?: string;

agencyId?: string;

color?: string;

description?: string;

longName?: string;

shortName?: string;

textColor?: string;

type?: number;

url?: string;
}
}
}

export namespace Route {
export import RouteRetrieveResponse = RouteAPI.RouteRetrieveResponse;
}
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.1.0-alpha.19'; // x-release-please-version
export const VERSION = '0.1.0-alpha.20'; // x-release-please-version
29 changes: 29 additions & 0 deletions tests/api-resources/route.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 onebusawaySDK = new OnebusawaySDK({
apiKey: 'My API Key',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource route', () => {
test('retrieve', async () => {
const responsePromise = onebusawaySDK.route.retrieve('string');
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('retrieve: 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(
onebusawaySDK.route.retrieve('string', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(OnebusawaySDK.NotFoundError);
});
});

0 comments on commit efc06a0

Please sign in to comment.