From 1f7d9441c78cf3ba8aa0c4c6079ec493d6cc873a Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Fri, 11 Aug 2023 14:29:58 -0700 Subject: [PATCH 1/5] feat(types): Add "stop" to Place type --- packages/types/src/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 1aed84d6e..5d2ab75d9 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -238,9 +238,22 @@ export type Place = { name: string; networks?: string[]; rentalVehicle?: { network: string }; + stop?: Stop; + /** + * @deprecated Only for OTP1 support, removal is immenent + */ stopCode?: string; + /** + * @deprecated Only for OTP1 support, removal is immenent + */ stopId?: string; + /** + * @deprecated Only for OTP1 support, removal is immenent + */ stopIndex?: number; + /** + * @deprecated Only for OTP1 support, removal is immenent + */ stopSequence?: number; vertexType: string; zoneId?: string; From 4a87a6598a4b5865bec771b6455fbfa2ee53f882 Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Fri, 11 Aug 2023 15:01:55 -0700 Subject: [PATCH 2/5] feat(types): add otp2 types to stop type --- packages/types/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 5d2ab75d9..4dd74fbe8 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -486,10 +486,11 @@ export type Stop = { dist?: number; geometries?: { geoJson?: GeoJSON.Polygon }; id: string; - lat: number; - lon: number; + lat?: number; + lon?: number; name: string; routes?: Route[]; + gtfsId: string; }; export type Agency = { From 6981e28e28a5f795bba2e12209cb8b6dcf2da127 Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Thu, 9 Nov 2023 11:38:41 -0800 Subject: [PATCH 3/5] sort props --- packages/types/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 4dd74fbe8..0c6084b79 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -485,12 +485,12 @@ export type Stop = { color?: string; dist?: number; geometries?: { geoJson?: GeoJSON.Polygon }; + gtfsId: string; id: string; lat?: number; lon?: number; name: string; routes?: Route[]; - gtfsId: string; }; export type Agency = { From 6a7336ff25a982f24555ad3d05a762838e79577a Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Thu, 9 Nov 2023 11:53:00 -0800 Subject: [PATCH 4/5] fix(types): add StopEventHandler to avoid breaking change --- packages/types/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 0c6084b79..1333b67f0 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -473,6 +473,8 @@ export type StopLayerStop = LayerEntity & { name: string; }; +export type StopEventHanlder = (stop: Stop | { stopId: string }) => void; + /** * This models data about a stop and it's associated routes that is obtained * from a transit index API. From 89bafa5fd975f0b67579aea34cd53c1307121272 Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Fri, 10 Nov 2023 12:50:52 -0800 Subject: [PATCH 5/5] remove question marks from types --- packages/types/src/index.ts | 6 +++--- yarn.lock | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 1333b67f0..eaf92694d 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -473,7 +473,7 @@ export type StopLayerStop = LayerEntity & { name: string; }; -export type StopEventHanlder = (stop: Stop | { stopId: string }) => void; +export type StopEventHandler = (stop: Stop | { stopId: string }) => void; /** * This models data about a stop and it's associated routes that is obtained @@ -489,8 +489,8 @@ export type Stop = { geometries?: { geoJson?: GeoJSON.Polygon }; gtfsId: string; id: string; - lat?: number; - lon?: number; + lat: number; + lon: number; name: string; routes?: Route[]; }; diff --git a/yarn.lock b/yarn.lock index 917932aaa..cde8ef964 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3241,6 +3241,24 @@ resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca" integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q== +"@opentripplanner/core-utils@11.1.2": + version "11.1.2" + resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-11.1.2.tgz#a99d1fa4fb1f587d58fae8fcfd70a3bfe4eed424" + integrity sha512-Rn1tBm5F+nt/A4/0cpq6cyNTprSsxfFslujMoZ4P4r6fZ7YTx0d25di+MZ/CZgSlCzHJIiGAfi8DsfJ7yStcTA== + dependencies: + "@conveyal/lonlat" "^1.4.1" + "@mapbox/polyline" "^1.1.0" + "@opentripplanner/geocoder" "^1.4.2" + "@styled-icons/foundation" "^10.34.0" + "@turf/along" "^6.0.1" + chroma-js "^2.4.2" + date-fns "^2.28.0" + date-fns-tz "^1.2.2" + graphql "^16.6.0" + lodash.clonedeep "^4.5.0" + lodash.isequal "^4.5.0" + qs "^6.9.1" + "@opentripplanner/types@7.0.0-alpha.2": version "7.0.0-alpha.2" resolved "https://registry.yarnpkg.com/@opentripplanner/types/-/types-7.0.0-alpha.2.tgz#d10c69f99b2da6d1e80ab5989520bde8e558627b"