-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from OneBusAway/release-please--branches--main…
…--changes--next--components--onebusaway-sdk release: 0.1.0-alpha.13
- Loading branch information
Showing
12 changed files
with
292 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.prism.log | ||
node_modules | ||
yarn-error.log | ||
codegen.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
".": "0.1.0-alpha.12" | ||
".": "0.1.0-alpha.13" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 6 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-e2d8fe6ddeac1c6c1069b561d47fb0a2a5c821fe2840c734238e050d73fe211b.yml | ||
configured_endpoints: 7 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-078a3ae0f749c5f370d657032346c607e199d3f87f16c33e7b6b7555995663de.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "onebusaway-sdk", | ||
"version": "0.1.0-alpha.12", | ||
"version": "0.1.0-alpha.13", | ||
"description": "The official TypeScript library for the Onebusaway SDK API", | ||
"author": "Onebusaway SDK <[email protected]>", | ||
"types": "dist/index.d.ts", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
// 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 ArrivalsAndDeparturesForStopAPI from './arrivals-and-departures-for-stop'; | ||
import * as Shared from './shared'; | ||
|
||
export class ArrivalsAndDeparturesForStop extends APIResource { | ||
/** | ||
* arrivals-and-departures-for-stop | ||
*/ | ||
retrieve( | ||
stopId: string, | ||
query?: ArrivalsAndDeparturesForStopRetrieveParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<ArrivalsAndDeparturesForStopRetrieveResponse>; | ||
retrieve( | ||
stopId: string, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<ArrivalsAndDeparturesForStopRetrieveResponse>; | ||
retrieve( | ||
stopId: string, | ||
query: ArrivalsAndDeparturesForStopRetrieveParams | Core.RequestOptions = {}, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<ArrivalsAndDeparturesForStopRetrieveResponse> { | ||
if (isRequestOptions(query)) { | ||
return this.retrieve(stopId, {}, query); | ||
} | ||
return this._client.get(`/api/where/arrivals-and-departures-for-stop/stopID.json`, { query, ...options }); | ||
} | ||
} | ||
|
||
export interface ArrivalsAndDeparturesForStopRetrieveResponse extends Shared.ResponseWrapper { | ||
data?: ArrivalsAndDeparturesForStopRetrieveResponse.Data; | ||
} | ||
|
||
export namespace ArrivalsAndDeparturesForStopRetrieveResponse { | ||
export interface Data { | ||
entry?: Data.Entry; | ||
} | ||
|
||
export namespace Data { | ||
export interface Entry { | ||
arrivalsAndDepartures?: Array<Entry.ArrivalsAndDeparture>; | ||
|
||
references?: Shared.References; | ||
} | ||
|
||
export namespace Entry { | ||
export interface ArrivalsAndDeparture { | ||
actualTrack?: string; | ||
|
||
arrivalEnabled?: boolean; | ||
|
||
blockTripSequence?: number; | ||
|
||
departureEnabled?: boolean; | ||
|
||
distanceFromStop?: number; | ||
|
||
frequency?: string; | ||
|
||
historicalOccupancy?: string; | ||
|
||
lastUpdateTime?: number; | ||
|
||
numberOfStopsAway?: number; | ||
|
||
occupancyStatus?: string; | ||
|
||
predicted?: boolean; | ||
|
||
predictedArrivalInterval?: string; | ||
|
||
predictedArrivalTime?: number; | ||
|
||
predictedDepartureInterval?: string; | ||
|
||
predictedDepartureTime?: number; | ||
|
||
predictedOccupancy?: string; | ||
|
||
routeId?: string; | ||
|
||
routeLongName?: string; | ||
|
||
routeShortName?: string; | ||
|
||
scheduledArrivalInterval?: string; | ||
|
||
scheduledArrivalTime?: number; | ||
|
||
scheduledDepartureInterval?: string; | ||
|
||
scheduledDepartureTime?: number; | ||
|
||
scheduledTrack?: string; | ||
|
||
serviceDate?: number; | ||
|
||
situationIds?: Array<string>; | ||
|
||
status?: string; | ||
|
||
stopId?: string; | ||
|
||
stopSequence?: number; | ||
|
||
totalStopsInTrip?: number; | ||
|
||
tripHeadsign?: string; | ||
|
||
tripId?: string; | ||
|
||
tripStatus?: ArrivalsAndDeparture.TripStatus; | ||
|
||
vehicleId?: string; | ||
} | ||
|
||
export namespace ArrivalsAndDeparture { | ||
export interface TripStatus { | ||
activeTripId?: string; | ||
|
||
blockTripSequence?: number; | ||
|
||
closestStop?: string; | ||
|
||
closestStopTimeOffset?: number; | ||
|
||
distanceAlongTrip?: number; | ||
|
||
frequency?: string; | ||
|
||
lastKnownDistanceAlongTrip?: number; | ||
|
||
lastKnownLocation?: TripStatus.LastKnownLocation; | ||
|
||
lastKnownOrientation?: number; | ||
|
||
lastLocationUpdateTime?: number; | ||
|
||
lastUpdateTime?: number; | ||
|
||
nextStop?: string; | ||
|
||
nextStopTimeOffset?: number; | ||
|
||
occupancyCapacity?: number; | ||
|
||
occupancyCount?: number; | ||
|
||
occupancyStatus?: string; | ||
|
||
orientation?: number; | ||
|
||
phase?: string; | ||
|
||
position?: TripStatus.Position; | ||
|
||
predicted?: boolean; | ||
|
||
scheduledDistanceAlongTrip?: number; | ||
|
||
scheduleDeviation?: number; | ||
|
||
serviceDate?: number; | ||
|
||
situationIds?: Array<string>; | ||
|
||
status?: string; | ||
|
||
totalDistanceAlongTrip?: number; | ||
|
||
vehicleId?: string; | ||
} | ||
|
||
export namespace TripStatus { | ||
export interface LastKnownLocation { | ||
lat?: number; | ||
|
||
lon?: number; | ||
} | ||
|
||
export interface Position { | ||
lat?: number; | ||
|
||
lon?: number; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
export interface ArrivalsAndDeparturesForStopRetrieveParams { | ||
/** | ||
* Include vehicles arriving or departing in the next n minutes. | ||
*/ | ||
minutesAfter?: number; | ||
|
||
/** | ||
* Include vehicles having arrived or departed in the previous n minutes. | ||
*/ | ||
minutesBefore?: number; | ||
|
||
/** | ||
* The specific time for querying the system status. | ||
*/ | ||
time?: string; | ||
} | ||
|
||
export namespace ArrivalsAndDeparturesForStop { | ||
export import ArrivalsAndDeparturesForStopRetrieveResponse = ArrivalsAndDeparturesForStopAPI.ArrivalsAndDeparturesForStopRetrieveResponse; | ||
export import ArrivalsAndDeparturesForStopRetrieveParams = ArrivalsAndDeparturesForStopAPI.ArrivalsAndDeparturesForStopRetrieveParams; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const VERSION = '0.1.0-alpha.12'; // x-release-please-version | ||
export const VERSION = '0.1.0-alpha.13'; // x-release-please-version |
40 changes: 40 additions & 0 deletions
40
tests/api-resources/arrivals-and-departures-for-stop.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// 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 arrivalsAndDeparturesForStop', () => { | ||
test('retrieve', async () => { | ||
const responsePromise = onebusawaySDK.arrivalsAndDeparturesForStop.retrieve('1_75403'); | ||
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.arrivalsAndDeparturesForStop.retrieve('1_75403', { path: '/_stainless_unknown_path' }), | ||
).rejects.toThrow(OnebusawaySDK.NotFoundError); | ||
}); | ||
|
||
test('retrieve: 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( | ||
onebusawaySDK.arrivalsAndDeparturesForStop.retrieve( | ||
'1_75403', | ||
{ minutesAfter: 0, minutesBefore: 0, time: '2019-12-27T18:11:19.117Z' }, | ||
{ path: '/_stainless_unknown_path' }, | ||
), | ||
).rejects.toThrow(OnebusawaySDK.NotFoundError); | ||
}); | ||
}); |