bengaluru-transit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +507 -0
- package/dist/api/info.d.ts +77 -0
- package/dist/api/info.d.ts.map +1 -0
- package/dist/api/info.js +197 -0
- package/dist/api/info.js.map +1 -0
- package/dist/api/locations.d.ts +26 -0
- package/dist/api/locations.d.ts.map +1 -0
- package/dist/api/locations.js +57 -0
- package/dist/api/locations.js.map +1 -0
- package/dist/api/routes.d.ts +341 -0
- package/dist/api/routes.d.ts.map +1 -0
- package/dist/api/routes.js +1133 -0
- package/dist/api/routes.js.map +1 -0
- package/dist/api/stops.d.ts +92 -0
- package/dist/api/stops.d.ts.map +1 -0
- package/dist/api/stops.js +237 -0
- package/dist/api/stops.js.map +1 -0
- package/dist/api/vehicles.d.ts +49 -0
- package/dist/api/vehicles.d.ts.map +1 -0
- package/dist/api/vehicles.js +154 -0
- package/dist/api/vehicles.js.map +1 -0
- package/dist/client/base-client.d.ts +52 -0
- package/dist/client/base-client.d.ts.map +1 -0
- package/dist/client/base-client.js +76 -0
- package/dist/client/base-client.js.map +1 -0
- package/dist/client/transit-client.d.ts +91 -0
- package/dist/client/transit-client.d.ts.map +1 -0
- package/dist/client/transit-client.js +98 -0
- package/dist/client/transit-client.js.map +1 -0
- package/dist/constants/api.d.ts +16 -0
- package/dist/constants/api.d.ts.map +1 -0
- package/dist/constants/api.js +16 -0
- package/dist/constants/api.js.map +1 -0
- package/dist/constants/routes.d.ts +16 -0
- package/dist/constants/routes.d.ts.map +1 -0
- package/dist/constants/routes.js +16 -0
- package/dist/constants/routes.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/common.d.ts +34 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +20 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/index.d.ts +7 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +7 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/info.d.ts +390 -0
- package/dist/schemas/info.d.ts.map +1 -0
- package/dist/schemas/info.js +110 -0
- package/dist/schemas/info.js.map +1 -0
- package/dist/schemas/locations.d.ts +84 -0
- package/dist/schemas/locations.d.ts.map +1 -0
- package/dist/schemas/locations.js +31 -0
- package/dist/schemas/locations.js.map +1 -0
- package/dist/schemas/routes.d.ts +3967 -0
- package/dist/schemas/routes.d.ts.map +1 -0
- package/dist/schemas/routes.js +532 -0
- package/dist/schemas/routes.js.map +1 -0
- package/dist/schemas/stops.d.ts +543 -0
- package/dist/schemas/stops.d.ts.map +1 -0
- package/dist/schemas/stops.js +129 -0
- package/dist/schemas/stops.js.map +1 -0
- package/dist/schemas/vehicles.d.ts +602 -0
- package/dist/schemas/vehicles.d.ts.map +1 -0
- package/dist/schemas/vehicles.js +116 -0
- package/dist/schemas/vehicles.js.map +1 -0
- package/dist/types/api.d.ts +9 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +5 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/coordinates.d.ts +7 -0
- package/dist/types/coordinates.d.ts.map +1 -0
- package/dist/types/coordinates.js +2 -0
- package/dist/types/coordinates.js.map +1 -0
- package/dist/types/geojson.d.ts +84 -0
- package/dist/types/geojson.d.ts.map +1 -0
- package/dist/types/geojson.js +2 -0
- package/dist/types/geojson.js.map +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +12 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/info.d.ts +133 -0
- package/dist/types/info.d.ts.map +1 -0
- package/dist/types/info.js +5 -0
- package/dist/types/info.js.map +1 -0
- package/dist/types/locations.d.ts +59 -0
- package/dist/types/locations.d.ts.map +1 -0
- package/dist/types/locations.js +5 -0
- package/dist/types/locations.js.map +1 -0
- package/dist/types/routes.d.ts +1137 -0
- package/dist/types/routes.d.ts.map +1 -0
- package/dist/types/routes.js +14 -0
- package/dist/types/routes.js.map +1 -0
- package/dist/types/stops.d.ts +286 -0
- package/dist/types/stops.d.ts.map +1 -0
- package/dist/types/stops.js +26 -0
- package/dist/types/stops.js.map +1 -0
- package/dist/types/vehicles.d.ts +138 -0
- package/dist/types/vehicles.d.ts.map +1 -0
- package/dist/types/vehicles.js +5 -0
- package/dist/types/vehicles.js.map +1 -0
- package/dist/utils/date.d.ts +35 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +49 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/errors.d.ts +34 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +41 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/geojson.d.ts +36 -0
- package/dist/utils/geojson.d.ts.map +1 -0
- package/dist/utils/geojson.js +115 -0
- package/dist/utils/geojson.js.map +1 -0
- package/dist/utils/validation.d.ts +40 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +62 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicles.js","sourceRoot":"","sources":["../../src/schemas/vehicles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,IAAI,EAAE,CAAC,CA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CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CAC7E,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coordinate type definition
|
|
3
|
+
* Format: [latitude, longitude]
|
|
4
|
+
* This matches the transit API format (latitude first, unlike GeoJSON which uses longitude first)
|
|
5
|
+
*/
|
|
6
|
+
export type Coordinate = [latitude: number, longitude: number];
|
|
7
|
+
//# sourceMappingURL=coordinates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../../src/types/coordinates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../../src/types/coordinates.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Feature, FeatureCollection, LineString, Point } from 'geojson';
|
|
2
|
+
/**
|
|
3
|
+
* Extended GeoJSON types for transit-specific use cases
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A bus route represented as a GeoJSON LineString Feature
|
|
7
|
+
*/
|
|
8
|
+
export type RouteFeature = Feature<LineString, RouteProperties>;
|
|
9
|
+
/**
|
|
10
|
+
* A bus stop represented as a GeoJSON Point Feature
|
|
11
|
+
*/
|
|
12
|
+
export type StopFeature = Feature<Point, StopProperties>;
|
|
13
|
+
/**
|
|
14
|
+
* A bus location represented as a GeoJSON Point Feature
|
|
15
|
+
*/
|
|
16
|
+
export type LocationFeature = Feature<Point, LocationProperties>;
|
|
17
|
+
/**
|
|
18
|
+
* A facility/amenity represented as a GeoJSON Point Feature
|
|
19
|
+
*/
|
|
20
|
+
export type FacilityFeature = Feature<Point, FacilityProperties>;
|
|
21
|
+
/**
|
|
22
|
+
* Properties for a route feature
|
|
23
|
+
*/
|
|
24
|
+
export interface RouteProperties {
|
|
25
|
+
routeId: string;
|
|
26
|
+
routeName?: string;
|
|
27
|
+
routeNumber?: string;
|
|
28
|
+
from?: string;
|
|
29
|
+
to?: string;
|
|
30
|
+
distance?: number;
|
|
31
|
+
duration?: number;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Properties for a stop feature
|
|
36
|
+
*/
|
|
37
|
+
export interface StopProperties {
|
|
38
|
+
stopId: string;
|
|
39
|
+
stopName?: string;
|
|
40
|
+
stopCode?: string;
|
|
41
|
+
address?: string;
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Properties for a location feature (real-time bus location)
|
|
46
|
+
*/
|
|
47
|
+
export interface LocationProperties {
|
|
48
|
+
busId?: string;
|
|
49
|
+
routeId?: string;
|
|
50
|
+
direction?: string;
|
|
51
|
+
speed?: number;
|
|
52
|
+
timestamp?: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Properties for a facility feature (amenities around bus stations)
|
|
57
|
+
*/
|
|
58
|
+
export interface FacilityProperties {
|
|
59
|
+
facilityId?: string;
|
|
60
|
+
facilityName: string;
|
|
61
|
+
facilityType: string;
|
|
62
|
+
facilityTypeId: string;
|
|
63
|
+
icon?: string;
|
|
64
|
+
distance?: number;
|
|
65
|
+
stationName?: string;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Collection of route features
|
|
70
|
+
*/
|
|
71
|
+
export type RouteFeatureCollection = FeatureCollection<LineString, RouteProperties>;
|
|
72
|
+
/**
|
|
73
|
+
* Collection of stop features
|
|
74
|
+
*/
|
|
75
|
+
export type StopFeatureCollection = FeatureCollection<Point, StopProperties>;
|
|
76
|
+
/**
|
|
77
|
+
* Collection of location features
|
|
78
|
+
*/
|
|
79
|
+
export type LocationFeatureCollection = FeatureCollection<Point, LocationProperties>;
|
|
80
|
+
/**
|
|
81
|
+
* Collection of facility features
|
|
82
|
+
*/
|
|
83
|
+
export type FacilityFeatureCollection = FeatureCollection<Point, FacilityProperties>;
|
|
84
|
+
//# sourceMappingURL=geojson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../../src/types/geojson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE7E;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,eA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G;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geojson.js","sourceRoot":"","sources":["../../src/types/geojson.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type exports for Bengaluru Transit SDK
|
|
3
|
+
*
|
|
4
|
+
* This file exports only clean, user-facing types.
|
|
5
|
+
* Raw types (prefixed with "Raw") are available in their individual files
|
|
6
|
+
* for advanced use cases but are not re-exported here to keep the public API clean.
|
|
7
|
+
*/
|
|
8
|
+
export type { TransitApiError } from "./api";
|
|
9
|
+
export * from "./coordinates";
|
|
10
|
+
export * from "./geojson";
|
|
11
|
+
export type { RouteDirection, RoutePointsResponse, RoutePointsParams, RouteSearchItem, RouteSearchResponse, RouteSearchParams, RouteListItem, AllRoutesResponse, TripDetailItem, TimetableItem, TimetableResponse, TimetableByRouteParamsWithStops, TimetableByRouteParamsWithoutStops, TimetableByRouteParams, RouteDetailVehicleProperties, RouteDetailVehicleItem, RouteDetailStationProperties, RouteDetailStationFeature, RouteDetailDirectionData, RouteDetailsResponse, RouteDetailsParams, RouteBetweenStopsItem, RoutesBetweenStopsResponse, RoutesBetweenStopsParams, FareDataItem, FareDataResponse, FareDataParams, TripPlannerFilter, TripPlannerParams, TripPlannerPathLeg, TripPlannerRoute, TripPlannerResponse, PathDetailRequestItem, PathDetailsParams, PathDetailItem, PathDetailsResponse, WaypointsParams, TripPathResponse, TimetableByStationItem, TimetableByStationResponse, TimetableByStationParams, } from "./routes";
|
|
12
|
+
export type { VehicleDataItem, SearchVehiclesResponse, SearchVehiclesParams, VehicleTripResponse, VehicleTripParams, } from "./vehicles";
|
|
13
|
+
export type { FacilityTypeGroup, NearbyStation, AroundBusStopsResponse, AroundBusStopsParams, StationType, NearbyBusStopItem, NearbyBusStopsResponse, NearbyBusStopsParams, TransitCategory, NearbyStationItem, NearbyStationsResponse, NearbyStationsParams, } from "./stops";
|
|
14
|
+
export type { HelplineDataItem, HelplineResponse, ServiceTypeDataItem, ServiceTypesResponse, AboutDataItem, AboutDataResponse, EmergencyMessageDataItem, EmergencyMessagesResponse, FareScrollMessageDataItem, FareScrollMessagesResponse, } from "./info";
|
|
15
|
+
export type { PlaceItem, SearchPlacesResponse, SearchPlacesParams, } from "./locations";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAG7C,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAI1B,YAAY,EACX,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,+BAA+B,EAC/B,kCAAkC,EAClC,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,GACxB,MAAM,UAAU,CAAC;AAGlB,YAAY,EACX,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,GACjB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACX,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACX,SAAS,EACT,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type exports for Bengaluru Transit SDK
|
|
3
|
+
*
|
|
4
|
+
* This file exports only clean, user-facing types.
|
|
5
|
+
* Raw types (prefixed with "Raw") are available in their individual files
|
|
6
|
+
* for advanced use cases but are not re-exported here to keep the public API clean.
|
|
7
|
+
*/
|
|
8
|
+
// Coordinate types
|
|
9
|
+
export * from "./coordinates";
|
|
10
|
+
// GeoJSON types
|
|
11
|
+
export * from "./geojson";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,mBAAmB;AACnB,cAAc,eAAe,CAAC;AAE9B,gBAAgB;AAChB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for general/info API endpoints
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { rawHelplineResponseSchema, rawFareScrollMessagesResponseSchema } from "../schemas/info";
|
|
6
|
+
/**
|
|
7
|
+
* Raw helpline data item from BMTC API
|
|
8
|
+
*/
|
|
9
|
+
export interface RawHelplineDataItem {
|
|
10
|
+
labelname: string;
|
|
11
|
+
busstopname: string | null;
|
|
12
|
+
helplinenumber: string;
|
|
13
|
+
responsecode: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Raw helpline API response from BMTC API (for validation)
|
|
17
|
+
* Uses Zod inferred type to match schema exactly
|
|
18
|
+
*/
|
|
19
|
+
export type RawHelplineResponse = z.infer<typeof rawHelplineResponseSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Clean, normalized helpline data item
|
|
22
|
+
*/
|
|
23
|
+
export interface HelplineDataItem {
|
|
24
|
+
labelName: string;
|
|
25
|
+
busStopName: string | null;
|
|
26
|
+
helplineNumber: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Clean, normalized helpline response
|
|
30
|
+
*/
|
|
31
|
+
export interface HelplineResponse {
|
|
32
|
+
items: HelplineDataItem[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Raw service type data item from BMTC API
|
|
36
|
+
*/
|
|
37
|
+
export interface RawServiceTypeDataItem {
|
|
38
|
+
servicetype: string;
|
|
39
|
+
servicetypeid: number;
|
|
40
|
+
responsecode: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Clean, normalized service type data item
|
|
44
|
+
*/
|
|
45
|
+
export interface ServiceTypeDataItem {
|
|
46
|
+
serviceType: string;
|
|
47
|
+
serviceTypeId: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Clean, normalized service types response
|
|
51
|
+
*/
|
|
52
|
+
export interface ServiceTypesResponse {
|
|
53
|
+
items: ServiceTypeDataItem[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Raw about data item from BMTC API
|
|
57
|
+
*/
|
|
58
|
+
export interface RawAboutDataItem {
|
|
59
|
+
termsandconditionsurl: string;
|
|
60
|
+
aboutbmtcurl: string;
|
|
61
|
+
aboutdeveloperurl: string;
|
|
62
|
+
airportlattitude: number;
|
|
63
|
+
airportlongitude: number;
|
|
64
|
+
airportstationid: number;
|
|
65
|
+
airportstationname: string;
|
|
66
|
+
responsecode: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Clean, normalized about data item
|
|
70
|
+
*/
|
|
71
|
+
export interface AboutDataItem {
|
|
72
|
+
termsAndConditionsUrl: string;
|
|
73
|
+
aboutBmtcUrl: string;
|
|
74
|
+
aboutDeveloperUrl: string;
|
|
75
|
+
airportLatitude: number;
|
|
76
|
+
airportLongitude: number;
|
|
77
|
+
airportStationId: string;
|
|
78
|
+
airportStationName: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Clean, normalized about data response
|
|
82
|
+
*/
|
|
83
|
+
export interface AboutDataResponse {
|
|
84
|
+
item: AboutDataItem;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Raw emergency message data item from BMTC API
|
|
88
|
+
*/
|
|
89
|
+
export interface RawEmergencyMessageDataItem {
|
|
90
|
+
id: number;
|
|
91
|
+
message_english: string;
|
|
92
|
+
message_kannada: string;
|
|
93
|
+
isdisplay: number;
|
|
94
|
+
display_key: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Clean, normalized emergency message data item
|
|
98
|
+
*/
|
|
99
|
+
export interface EmergencyMessageDataItem {
|
|
100
|
+
id: string;
|
|
101
|
+
messageEnglish: string;
|
|
102
|
+
messageKannada: string;
|
|
103
|
+
isDisplay: boolean;
|
|
104
|
+
displayKey: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Clean, normalized emergency messages response
|
|
108
|
+
*/
|
|
109
|
+
export interface EmergencyMessagesResponse {
|
|
110
|
+
items: EmergencyMessageDataItem[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Raw fare scroll messages API response from BMTC API (for validation)
|
|
114
|
+
* Uses Zod inferred type to match schema exactly
|
|
115
|
+
*/
|
|
116
|
+
export type RawFareScrollMessagesResponse = z.infer<typeof rawFareScrollMessagesResponseSchema>;
|
|
117
|
+
/**
|
|
118
|
+
* Clean, normalized fare scroll message data item
|
|
119
|
+
*/
|
|
120
|
+
export interface FareScrollMessageDataItem {
|
|
121
|
+
id: string;
|
|
122
|
+
messageEnglish: string;
|
|
123
|
+
messageKannada: string;
|
|
124
|
+
isDisplay: boolean;
|
|
125
|
+
displayKey: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Clean, normalized fare scroll messages response
|
|
129
|
+
*/
|
|
130
|
+
export interface FareScrollMessagesResponse {
|
|
131
|
+
items: FareScrollMessageDataItem[];
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/types/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACX,yBAAyB,EACzB,mCAAmC,EACnC,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE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AAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,KAAK,EAAE,wBAAwB,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,mCAAmC,CAC1C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,KAAK,EAAE,yBAAyB,EAAE,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/types/info.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for location-related API endpoints
|
|
3
|
+
*/
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { rawSearchPlacesResponseSchema } from "../schemas/locations";
|
|
6
|
+
/**
|
|
7
|
+
* Raw place item from GetSearchPlaceData API
|
|
8
|
+
*/
|
|
9
|
+
export interface RawPlaceItem {
|
|
10
|
+
title: string;
|
|
11
|
+
placename: string;
|
|
12
|
+
lat: number;
|
|
13
|
+
lng: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Raw search places API response from BMTC API (for validation)
|
|
17
|
+
* Uses Zod inferred type to match schema exactly
|
|
18
|
+
*/
|
|
19
|
+
export type RawSearchPlacesResponse = z.infer<typeof rawSearchPlacesResponseSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Clean, normalized place item
|
|
22
|
+
*/
|
|
23
|
+
export interface PlaceItem {
|
|
24
|
+
/**
|
|
25
|
+
* Short title/name of the place
|
|
26
|
+
*/
|
|
27
|
+
title: string;
|
|
28
|
+
/**
|
|
29
|
+
* Full formatted address of the place
|
|
30
|
+
*/
|
|
31
|
+
address: string;
|
|
32
|
+
/**
|
|
33
|
+
* Latitude coordinate
|
|
34
|
+
*/
|
|
35
|
+
latitude: number;
|
|
36
|
+
/**
|
|
37
|
+
* Longitude coordinate
|
|
38
|
+
*/
|
|
39
|
+
longitude: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Clean, normalized search places response
|
|
43
|
+
*/
|
|
44
|
+
export interface SearchPlacesResponse {
|
|
45
|
+
/**
|
|
46
|
+
* List of matching places
|
|
47
|
+
*/
|
|
48
|
+
items: PlaceItem[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parameters for searching places
|
|
52
|
+
*/
|
|
53
|
+
export interface SearchPlacesParams {
|
|
54
|
+
/**
|
|
55
|
+
* Search query for places (partial match supported)
|
|
56
|
+
*/
|
|
57
|
+
query: string;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=locations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.d.ts","sourceRoot":"","sources":["../../src/types/locations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,6BAA6B,CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,KAAK,EAAE,SAAS,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.js","sourceRoot":"","sources":["../../src/types/locations.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|