@opentripplanner/core-utils 11.4.2 → 11.4.3-mobility-profile
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/lib/__tests__/__mocks__/bike-rental-itinerary.json +863 -0
- package/lib/__tests__/__mocks__/config.json +54 -0
- package/lib/__tests__/__mocks__/fare-products-itinerary.json +1299 -0
- package/lib/__tests__/__mocks__/routes.json +107 -0
- package/lib/__tests__/__mocks__/tnc-itinerary.json +1726 -0
- package/lib/bike-rental-itinerary.json +863 -0
- package/lib/config.json +54 -0
- package/lib/core-utils.story.d.ts +0 -1
- package/lib/core-utils.story.d.ts.map +1 -1
- package/lib/fare-products-itinerary.json +1299 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -1
- package/lib/otpSchema.json +13383 -0
- package/lib/planQuery.graphql +283 -0
- package/lib/query-gen.d.ts +2 -1
- package/lib/query-gen.d.ts.map +1 -1
- package/lib/query-gen.js +5 -3
- package/lib/query-gen.js.map +1 -1
- package/lib/routes.json +107 -0
- package/lib/suspense.d.ts +8 -0
- package/lib/suspense.d.ts.map +1 -0
- package/lib/suspense.js +26 -0
- package/lib/suspense.js.map +1 -0
- package/lib/tnc-itinerary.json +1726 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/otpSchema.json +10 -0
- package/src/planQuery.graphql +2 -0
- package/src/query-gen.ts +5 -2
- package/src/suspense.tsx +19 -0
- package/tsconfig.json +1 -2
- package/esm/graphql.d.js +0 -2
- package/esm/graphql.d.js.map +0 -1
- package/esm/index.js +0 -24
- package/esm/index.js.map +0 -1
- package/esm/itinerary.js +0 -688
- package/esm/itinerary.js.map +0 -1
- package/esm/map.js +0 -53
- package/esm/map.js.map +0 -1
- package/esm/profile.js +0 -172
- package/esm/profile.js.map +0 -1
- package/esm/query-gen.js +0 -233
- package/esm/query-gen.js.map +0 -1
- package/esm/query-params.js +0 -786
- package/esm/query-params.js.map +0 -1
- package/esm/query.js +0 -538
- package/esm/query.js.map +0 -1
- package/esm/route.js +0 -460
- package/esm/route.js.map +0 -1
- package/esm/storage.js +0 -46
- package/esm/storage.js.map +0 -1
- package/esm/time.js +0 -94
- package/esm/time.js.map +0 -1
- package/esm/ui.js +0 -48
- package/esm/ui.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import * as storage from "./storage";
|
|
|
8
8
|
import * as time from "./time";
|
|
9
9
|
import * as ui from "./ui";
|
|
10
10
|
import * as queryGen from "./query-gen";
|
|
11
|
+
import SafeSuspense from "./suspense";
|
|
11
12
|
|
|
12
13
|
const core = {
|
|
13
14
|
itinerary,
|
|
@@ -22,4 +23,5 @@ const core = {
|
|
|
22
23
|
ui
|
|
23
24
|
};
|
|
24
25
|
|
|
26
|
+
export { SafeSuspense };
|
|
25
27
|
export default core;
|
package/src/otpSchema.json
CHANGED
|
@@ -7662,6 +7662,16 @@
|
|
|
7662
7662
|
"ofType": null
|
|
7663
7663
|
},
|
|
7664
7664
|
"defaultValue": null
|
|
7665
|
+
},
|
|
7666
|
+
{
|
|
7667
|
+
"name": "mobilityProfile",
|
|
7668
|
+
"description": "Preferences for routing based on mobility profile",
|
|
7669
|
+
"type": {
|
|
7670
|
+
"kind": "SCALAR",
|
|
7671
|
+
"name": "String",
|
|
7672
|
+
"ofType": null
|
|
7673
|
+
},
|
|
7674
|
+
"defaultValue": null
|
|
7665
7675
|
}
|
|
7666
7676
|
],
|
|
7667
7677
|
"type": {
|
package/src/planQuery.graphql
CHANGED
|
@@ -5,6 +5,7 @@ query Plan(
|
|
|
5
5
|
$carReluctance: Float
|
|
6
6
|
$date: String
|
|
7
7
|
$fromPlace: String!
|
|
8
|
+
$mobilityProfile: String
|
|
8
9
|
$modes: [TransportMode]
|
|
9
10
|
$numItineraries: Int
|
|
10
11
|
$preferred: InputPreferred
|
|
@@ -24,6 +25,7 @@ query Plan(
|
|
|
24
25
|
fromPlace: $fromPlace
|
|
25
26
|
# Currently only supporting EN locale, used for times and text
|
|
26
27
|
locale: "en"
|
|
28
|
+
mobilityProfile: $mobilityProfile
|
|
27
29
|
numItineraries: $numItineraries
|
|
28
30
|
preferred: $preferred
|
|
29
31
|
time: $time
|
package/src/query-gen.ts
CHANGED
|
@@ -26,6 +26,7 @@ type OTPQueryParams = {
|
|
|
26
26
|
arriveBy: boolean;
|
|
27
27
|
date?: string;
|
|
28
28
|
from: LonLatOutput & { name?: string };
|
|
29
|
+
mobilityProfile?: string;
|
|
29
30
|
modes: TransportMode[];
|
|
30
31
|
modeSettings: ModeSetting[];
|
|
31
32
|
time?: string;
|
|
@@ -219,6 +220,7 @@ export function generateOtp2Query(
|
|
|
219
220
|
banned,
|
|
220
221
|
date,
|
|
221
222
|
from,
|
|
223
|
+
mobilityProfile,
|
|
222
224
|
modes,
|
|
223
225
|
modeSettings,
|
|
224
226
|
numItineraries,
|
|
@@ -260,12 +262,13 @@ export function generateOtp2Query(
|
|
|
260
262
|
bikeReluctance,
|
|
261
263
|
carReluctance,
|
|
262
264
|
date,
|
|
263
|
-
fromPlace: `${from.name}::${from.lat},${from.lon}
|
|
265
|
+
fromPlace: `${from.name}::${from.lat},${from.lon}`,
|
|
266
|
+
mobilityProfile,
|
|
264
267
|
modes,
|
|
265
268
|
numItineraries,
|
|
266
269
|
preferred,
|
|
267
270
|
time,
|
|
268
|
-
toPlace: `${to.name}::${to.lat},${to.lon}
|
|
271
|
+
toPlace: `${to.name}::${to.lat},${to.lon}`,
|
|
269
272
|
unpreferred,
|
|
270
273
|
walkReluctance,
|
|
271
274
|
walkSpeed,
|
package/src/suspense.tsx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNode, Suspense } from "react";
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
fallback: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const SafeSuspense = ({ children, fallback }: Props): ReactElement => {
|
|
9
|
+
const IS_TEST_RUNNER = window.navigator.userAgent.match(
|
|
10
|
+
/StorybookTestRunner/
|
|
11
|
+
);
|
|
12
|
+
return IS_TEST_RUNNER ? (
|
|
13
|
+
<>{fallback}</>
|
|
14
|
+
) : (
|
|
15
|
+
<Suspense fallback={fallback}>{children}</Suspense>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default SafeSuspense;
|
package/tsconfig.json
CHANGED
package/esm/graphql.d.js
DELETED
package/esm/graphql.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"graphql.d.js"}
|
package/esm/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as itinerary from "./itinerary";
|
|
2
|
-
import * as map from "./map";
|
|
3
|
-
import * as profile from "./profile";
|
|
4
|
-
import * as query from "./query";
|
|
5
|
-
import * as queryParams from "./query-params";
|
|
6
|
-
import * as route from "./route";
|
|
7
|
-
import * as storage from "./storage";
|
|
8
|
-
import * as time from "./time";
|
|
9
|
-
import * as ui from "./ui";
|
|
10
|
-
import * as queryGen from "./query-gen";
|
|
11
|
-
var core = {
|
|
12
|
-
itinerary: itinerary,
|
|
13
|
-
map: map,
|
|
14
|
-
profile: profile,
|
|
15
|
-
query: query,
|
|
16
|
-
queryGen: queryGen,
|
|
17
|
-
queryParams: queryParams,
|
|
18
|
-
route: route,
|
|
19
|
-
storage: storage,
|
|
20
|
-
time: time,
|
|
21
|
-
ui: ui
|
|
22
|
-
};
|
|
23
|
-
export default core;
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["itinerary","map","profile","query","queryParams","route","storage","time","ui","queryGen","core"],"mappings":"AAAA,OAAO,KAAKA,SAAZ,MAA2B,aAA3B;AACA,OAAO,KAAKC,GAAZ,MAAqB,OAArB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,SAAvB;AACA,OAAO,KAAKC,WAAZ,MAA6B,gBAA7B;AACA,OAAO,KAAKC,KAAZ,MAAuB,SAAvB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,IAAZ,MAAsB,QAAtB;AACA,OAAO,KAAKC,EAAZ,MAAoB,MAApB;AACA,OAAO,KAAKC,QAAZ,MAA0B,aAA1B;AAEA,IAAMC,IAAI,GAAG;AACXV,EAAAA,SAAS,EAATA,SADW;AAEXC,EAAAA,GAAG,EAAHA,GAFW;AAGXC,EAAAA,OAAO,EAAPA,OAHW;AAIXC,EAAAA,KAAK,EAALA,KAJW;AAKXM,EAAAA,QAAQ,EAARA,QALW;AAMXL,EAAAA,WAAW,EAAXA,WANW;AAOXC,EAAAA,KAAK,EAALA,KAPW;AAQXC,EAAAA,OAAO,EAAPA,OARW;AASXC,EAAAA,IAAI,EAAJA,IATW;AAUXC,EAAAA,EAAE,EAAFA;AAVW,CAAb;AAaA,eAAeE,IAAf","sourcesContent":["import * as itinerary from \"./itinerary\";\nimport * as map from \"./map\";\nimport * as profile from \"./profile\";\nimport * as query from \"./query\";\nimport * as queryParams from \"./query-params\";\nimport * as route from \"./route\";\nimport * as storage from \"./storage\";\nimport * as time from \"./time\";\nimport * as ui from \"./ui\";\nimport * as queryGen from \"./query-gen\";\n\nconst core = {\n itinerary,\n map,\n profile,\n query,\n queryGen,\n queryParams,\n route,\n storage,\n time,\n ui\n};\n\nexport default core;\n"],"file":"index.js"}
|