From 94612cdb8285265c356db068310cc5d40e2467e6 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:38:38 -0500 Subject: [PATCH 1/9] feat(core-utils): Add support for routing based on mobility profile --- packages/core-utils/src/otpSchema.json | 10 ++++++++++ packages/core-utils/src/planQuery.graphql | 2 ++ packages/core-utils/src/query-gen.ts | 3 +++ 3 files changed, 15 insertions(+) diff --git a/packages/core-utils/src/otpSchema.json b/packages/core-utils/src/otpSchema.json index c67babfcc..3d528f767 100644 --- a/packages/core-utils/src/otpSchema.json +++ b/packages/core-utils/src/otpSchema.json @@ -7662,6 +7662,16 @@ "ofType": null }, "defaultValue": null + }, + { + "name": "mobilityProfile", + "description": "Preferences for routing based on mobility profile", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null } ], "type": { diff --git a/packages/core-utils/src/planQuery.graphql b/packages/core-utils/src/planQuery.graphql index 03b635ccd..e83e60f4e 100644 --- a/packages/core-utils/src/planQuery.graphql +++ b/packages/core-utils/src/planQuery.graphql @@ -5,6 +5,7 @@ query Plan( $carReluctance: Float $date: String $fromPlace: String! + $mobilityProfile: String $modes: [TransportMode] $numItineraries: Int $preferred: InputPreferred @@ -24,6 +25,7 @@ query Plan( fromPlace: $fromPlace # Currently only supporting EN locale, used for times and text locale: "en" + mobilityProfile: $mobilityProfile numItineraries: $numItineraries preferred: $preferred time: $time diff --git a/packages/core-utils/src/query-gen.ts b/packages/core-utils/src/query-gen.ts index 5858ffab6..7d634b53c 100644 --- a/packages/core-utils/src/query-gen.ts +++ b/packages/core-utils/src/query-gen.ts @@ -26,6 +26,7 @@ type OTPQueryParams = { arriveBy: boolean; date?: string; from: LonLatOutput & { name?: string }; + mobilityProfile?: string; modes: TransportMode[]; modeSettings: ModeSetting[]; time?: string; @@ -217,6 +218,7 @@ export function generateOtp2Query( banned, date, from, + mobilityProfile, modes, modeSettings, numItineraries, @@ -258,6 +260,7 @@ export function generateOtp2Query( carReluctance, date, fromPlace: `${from.name}::${from.lat},${from.lon}}`, + mobilityProfile, modes, numItineraries, preferred, From 82e4f89df0716b9f16bdb905c1587ad3a177d8b3 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:51:47 -0500 Subject: [PATCH 2/9] chore(core-utils): Add .npmignore to help with branch-based dependency. --- packages/core-utils/.npmignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/core-utils/.npmignore diff --git a/packages/core-utils/.npmignore b/packages/core-utils/.npmignore new file mode 100644 index 000000000..e69de29bb From 34547a8f8d487f3122ebbd92d2d0f1466dd42dd3 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:54:12 -0500 Subject: [PATCH 3/9] chore(core-utils): Add prepare script for building tsc while referencing branch. --- packages/core-utils/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core-utils/package.json b/packages/core-utils/package.json index ec90d4538..aa600a803 100644 --- a/packages/core-utils/package.json +++ b/packages/core-utils/package.json @@ -27,6 +27,7 @@ }, "gitHead": "0af1b7cda60bd4252b219dcf893e01c2acb2ed5d", "scripts": { + "prepare": "tsc", "tsc": "tsc" }, "devDependencies": { From 3c9187d57dd19ac995a0135307d8babbf67e2023 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:17:20 -0500 Subject: [PATCH 4/9] chore(core-utils): Adjust prepare script --- packages/core-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-utils/package.json b/packages/core-utils/package.json index aa600a803..30cd470af 100644 --- a/packages/core-utils/package.json +++ b/packages/core-utils/package.json @@ -27,7 +27,7 @@ }, "gitHead": "0af1b7cda60bd4252b219dcf893e01c2acb2ed5d", "scripts": { - "prepare": "tsc", + "prepare": "yarn tsc", "tsc": "tsc" }, "devDependencies": { From 58e6220230640d6cc78e4f94f3984e5b1f670584 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:26:39 -0500 Subject: [PATCH 5/9] Revert "chore(core-utils): Adjust prepare script" This reverts commit 3c9187d57dd19ac995a0135307d8babbf67e2023. --- packages/core-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-utils/package.json b/packages/core-utils/package.json index 30cd470af..aa600a803 100644 --- a/packages/core-utils/package.json +++ b/packages/core-utils/package.json @@ -27,7 +27,7 @@ }, "gitHead": "0af1b7cda60bd4252b219dcf893e01c2acb2ed5d", "scripts": { - "prepare": "yarn tsc", + "prepare": "tsc", "tsc": "tsc" }, "devDependencies": { From febad26a2451cfa696ce69d1bdb143368a08806d Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:26:54 -0500 Subject: [PATCH 6/9] Revert "chore(core-utils): Add prepare script for building tsc while referencing branch." This reverts commit 34547a8f8d487f3122ebbd92d2d0f1466dd42dd3. --- packages/core-utils/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core-utils/package.json b/packages/core-utils/package.json index aa600a803..ec90d4538 100644 --- a/packages/core-utils/package.json +++ b/packages/core-utils/package.json @@ -27,7 +27,6 @@ }, "gitHead": "0af1b7cda60bd4252b219dcf893e01c2acb2ed5d", "scripts": { - "prepare": "tsc", "tsc": "tsc" }, "devDependencies": { From ffce141410430cc1765f056e7e44a581b110c025 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:27:10 -0500 Subject: [PATCH 7/9] Revert "chore(core-utils): Add .npmignore to help with branch-based dependency." This reverts commit 82e4f89df0716b9f16bdb905c1587ad3a177d8b3. --- packages/core-utils/.npmignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 packages/core-utils/.npmignore diff --git a/packages/core-utils/.npmignore b/packages/core-utils/.npmignore deleted file mode 100644 index e69de29bb..000000000 From 8b4b4e37a8e432b17ac717a8cf91f85723fbb7f0 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:02:00 -0400 Subject: [PATCH 8/9] chore(core-utils): Update package version [skip ci] --- packages/core-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-utils/package.json b/packages/core-utils/package.json index 0ea1e7375..6dafc4bf0 100644 --- a/packages/core-utils/package.json +++ b/packages/core-utils/package.json @@ -1,6 +1,6 @@ { "name": "@opentripplanner/core-utils", - "version": "11.4.2", + "version": "11.4.2-mobility-profile", "description": "Core functionality that is shared among numerous UI components", "engines": { "node": ">=13" From dc4187900963bba6eed64a1e5d35945f3cd734cf Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:36:33 -0400 Subject: [PATCH 9/9] chore(core-utils): Update package version --- packages/core-utils/package.json | 2 +- yarn.lock | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/core-utils/package.json b/packages/core-utils/package.json index 6dafc4bf0..b2bcfc86e 100644 --- a/packages/core-utils/package.json +++ b/packages/core-utils/package.json @@ -1,6 +1,6 @@ { "name": "@opentripplanner/core-utils", - "version": "11.4.2-mobility-profile", + "version": "11.4.3-mobility-profile", "description": "Core functionality that is shared among numerous UI components", "engines": { "node": ">=13" diff --git a/yarn.lock b/yarn.lock index a727db669..fe4c2c616 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4601,10 +4601,23 @@ resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda" integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== -"@opentripplanner/types@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@opentripplanner/types/-/types-6.5.0.tgz#d8cca355bf30f0984283faa793113ad6c0dba38d" - integrity sha512-FllEyE+1WQ2GOSKXQOuzrk+OPcJEqr4+zacsHQLB9WVyfm5D/BPHR1/OjfuVngrwLTK5bKP8VlDRS1ba/R8rtg== +"@opentripplanner/core-utils@^11.4.1": + version "11.4.3" + resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-11.4.3.tgz#4655f9a3bef1977e53abd81a4a0eae966f977c60" + integrity sha512-GbvchRsLfEi9JygUx6ypU+Iqv2hELseC53yQyQ/XdnB1kcHzN71BtBbz+qpD5/jk8IuM92j1taRnGMeu5ni6yA== + dependencies: + "@conveyal/lonlat" "^1.4.1" + "@mapbox/polyline" "^1.1.0" + "@opentripplanner/geocoder" "^3.0.0" + "@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@6.5.0": version "6.5.0"