corequery 0.17.0 → 0.18.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/package.json +8 -8
- package/server/dist/server/config/helpers/create-canonical-lines-serving-stop-algorithm.js.map +1 -1
- package/server/dist/server/config/helpers/extract-stops-from-line-diagram-shape.d.ts +2 -0
- package/server/dist/server/config/helpers/extract-stops-from-line-diagram-shape.js +20 -0
- package/server/dist/server/config/helpers/extract-stops-from-line-diagram-shape.js.map +1 -0
- package/server/dist/server/config/linting/line/diagram/entry-minimum-stops.js +28 -6
- package/server/dist/server/config/linting/line/diagram/entry-minimum-stops.js.map +1 -1
- package/server/dist/server/config/linting/line/diagram/stops-exist.js +3 -1
- package/server/dist/server/config/linting/line/diagram/stops-exist.js.map +1 -1
- package/server/dist/server/config/linting/line/diagram/stops-in-routes.js +3 -1
- package/server/dist/server/config/linting/line/diagram/stops-in-routes.js.map +1 -1
- package/server/dist/server/config/linting/types.d.ts +2 -1
- package/server/dist/server/config/types/line-config.d.ts +24 -6
- package/server/dist/server/data/line-diagram-entry.d.ts +3 -4
- package/server/dist/server/data/line-diagram-entry.js +18 -10
- package/server/dist/server/data/line-diagram-entry.js.map +1 -1
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.d.ts +231 -0
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.js +21 -7
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.js.map +1 -1
- package/server/dist/shared/apis/foundational-data/v1/index.d.ts +56 -0
- package/web/dist/assets/{About-CaTBAYPV.js → About-DCZPSDgX.js} +1 -1
- package/web/dist/assets/AdminControls-CpAjDT3_.js +1 -0
- package/web/dist/assets/{Alert-ZeYzkS1G.js → Alert-DqAOXpg1.js} +1 -1
- package/web/dist/assets/{Debug-B4B1XWnL.js → Debug-CofWDu-3.js} +1 -1
- package/web/dist/assets/{Divider-dQCO5rFf.js → Divider-BcodRRFp.js} +1 -1
- package/web/dist/assets/Home-dNO-yO__.js +1 -0
- package/web/dist/assets/Line-Bmt5V-JG.js +1 -0
- package/web/dist/assets/{LinkText-BZEamFKR.js → LinkText-CuzmudpX.js} +1 -1
- package/web/dist/assets/{Markdown-CsYleoHG.js → Markdown-Cac8FRvA.js} +1 -1
- package/web/dist/assets/Nearby-C8uhAo0W.js +1 -0
- package/web/dist/assets/NotFound-cAXZYx-i.js +1 -0
- package/web/dist/assets/{NotFoundPage-CmT-cPq4.js → NotFoundPage-CjreacId.js} +1 -1
- package/web/dist/assets/{Page-14zdRXyE.js → Page-BISwM3fy.js} +1 -1
- package/web/dist/assets/{Picker-B_2kVnst.js → Picker-CNeXxMsu.js} +1 -1
- package/web/dist/assets/{Placeholder-Dg6ymgQL.js → Placeholder-CfWUL8Q7.js} +1 -1
- package/web/dist/assets/{Settings-DetCeQb0.js → Settings-DTkq0LPs.js} +1 -1
- package/web/dist/assets/Status-CHOcJQcX.js +1 -0
- package/web/dist/assets/{Stop-B_-mSd4e.js → Stop-BTYeBxkC.js} +1 -1
- package/web/dist/assets/{Strong-DQEYCa_y.js → Strong-BND8QD53.js} +1 -1
- package/web/dist/assets/ZenMode-DPheq9G5.js +1 -0
- package/web/dist/assets/index-BMguVN4e.css +1 -0
- package/web/dist/assets/{index-CLEhHuwG.js → index-jI1qL-AF.js} +6 -6
- package/web/dist/assets/{use-simple-headers-CdkDNHF3.js → use-simple-headers-CqMikxZC.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/AdminControls-z2-hx_Wi.js +0 -1
- package/web/dist/assets/Home-CrgHy4-U.js +0 -1
- package/web/dist/assets/Line-aTuN5Qn2.js +0 -1
- package/web/dist/assets/Nearby-D9fcPcO8.js +0 -1
- package/web/dist/assets/NotFound-s2u-0Rtl.js +0 -1
- package/web/dist/assets/Status-BZjxaB6p.js +0 -1
- package/web/dist/assets/ZenMode-BYFX2HyF.js +0 -1
- package/web/dist/assets/index-gUxgtCJY.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "corequery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"server/dist",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"bump-check": "bump-check --ignore \"^renovate\\/\""
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dan-schel/js-utils": "^4.
|
|
29
|
+
"@dan-schel/js-utils": "^4.13.0",
|
|
30
30
|
"express": "^5.2.1",
|
|
31
31
|
"node-html-parser": "^7.1.0",
|
|
32
32
|
"sharp": "^0.34.5",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@eslint/js": "9.39.4",
|
|
37
37
|
"@preact/preset-vite": "2.10.5",
|
|
38
|
-
"@tailwindcss/vite": "4.2.
|
|
38
|
+
"@tailwindcss/vite": "4.2.4",
|
|
39
39
|
"@types/express": "5.0.6",
|
|
40
40
|
"@types/node": "24.12.2",
|
|
41
|
-
"@vitest/coverage-v8": "4.1.
|
|
41
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
42
42
|
"chalk": "5.6.2",
|
|
43
43
|
"clsx": "2.1.1",
|
|
44
44
|
"eslint": "9.39.4",
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
"eslint-plugin-react": "7.37.5",
|
|
48
48
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
49
49
|
"globals": "17.5.0",
|
|
50
|
-
"knip": "6.
|
|
50
|
+
"knip": "6.8.0",
|
|
51
51
|
"preact": "10.29.1",
|
|
52
52
|
"preact-iso": "2.11.1",
|
|
53
53
|
"prettier": "3.8.3",
|
|
54
|
-
"tailwindcss": "4.2.
|
|
54
|
+
"tailwindcss": "4.2.4",
|
|
55
55
|
"tsc-alias": "1.8.16",
|
|
56
56
|
"tsx": "4.21.0",
|
|
57
57
|
"typescript": "6.0.3",
|
|
58
|
-
"typescript-eslint": "8.
|
|
58
|
+
"typescript-eslint": "8.59.1",
|
|
59
59
|
"vite": "7.3.2",
|
|
60
60
|
"vite-plugin-pwa": "1.2.0",
|
|
61
|
-
"vitest": "4.1.
|
|
61
|
+
"vitest": "4.1.5"
|
|
62
62
|
},
|
|
63
63
|
"author": "dan-schel",
|
|
64
64
|
"description": "A platform for building web apps serving transit information.",
|
package/server/dist/server/config/helpers/create-canonical-lines-serving-stop-algorithm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-canonical-lines-serving-stop-algorithm.js","sourceRoot":"","sources":["../../../../config/helpers/create-canonical-lines-serving-stop-algorithm.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,MAAM,eAAe,GAAyC;IAC5D,SAAS,EAAE,KAAK;IAChB,0BAA0B,EAAE,IAAI;CACjC,CAAC;
|
|
1
|
+
{"version":3,"file":"create-canonical-lines-serving-stop-algorithm.js","sourceRoot":"","sources":["../../../../config/helpers/create-canonical-lines-serving-stop-algorithm.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { assertNever } from "@dan-schel/js-utils";
|
|
2
|
+
export function extractStopsFromLineDiagramShape(shape) {
|
|
3
|
+
if (shape.type === "linear") {
|
|
4
|
+
return shape.stops;
|
|
5
|
+
}
|
|
6
|
+
else if (shape.type === "branch") {
|
|
7
|
+
return [...shape.commonStops, ...shape.branchAStops, ...shape.branchBStops];
|
|
8
|
+
}
|
|
9
|
+
else if (shape.type === "loop") {
|
|
10
|
+
return [
|
|
11
|
+
...shape.loopLeftStops,
|
|
12
|
+
...shape.loopRightStops,
|
|
13
|
+
...shape.mainStops,
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
assertNever(shape);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=extract-stops-from-line-diagram-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-stops-from-line-diagram-shape.js","sourceRoot":"","sources":["../../../../config/helpers/extract-stops-from-line-diagram-shape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,UAAU,gCAAgC,CAC9C,KAA6B;IAE7B,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,KAAK,CAAC;IACrB,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;IAC9E,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,aAAa;YACtB,GAAG,KAAK,CAAC,cAAc;YACvB,GAAG,KAAK,CAAC,SAAS;SACnB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
import { chooseNameForEntry } from "../../../../../server/config/linting/utils/choose-name-for-entry.js";
|
|
2
2
|
import { IssueCollector } from "../../../../../server/config/linting/utils/issue-collector.js";
|
|
3
|
+
import { assertNever } from "@dan-schel/js-utils";
|
|
3
4
|
export function checkLineDiagramEntriesMinimumStops(issues, line, lineIndex) {
|
|
4
5
|
for (const [entryIndex, entry] of line.diagram.entries.entries()) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const entryName = chooseNameForEntry(entry.name, entryIndex);
|
|
7
|
+
function addIssueUnlessLengthIs(minimum, array, arrayName) {
|
|
8
|
+
if (array.length < minimum) {
|
|
9
|
+
issues.add({
|
|
10
|
+
message: `Diagram entry ${entryName} in line "${line.name}" has fewer than ${minimum} ${minimum === 1 ? "stop" : "stops"} in ${arrayName}.`,
|
|
11
|
+
path: `lines[${lineIndex}].diagram.entries[${entryIndex}].${arrayName}`,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (entry.shape.type === "linear") {
|
|
16
|
+
addIssueUnlessLengthIs(2, entry.shape.stops, "stops");
|
|
17
|
+
}
|
|
18
|
+
else if (entry.shape.type === "branch") {
|
|
19
|
+
addIssueUnlessLengthIs(1, entry.shape.commonStops, "commonStops");
|
|
20
|
+
addIssueUnlessLengthIs(1, entry.shape.branchAStops, "branchAStops");
|
|
21
|
+
addIssueUnlessLengthIs(1, entry.shape.branchBStops, "branchBStops");
|
|
22
|
+
}
|
|
23
|
+
else if (entry.shape.type === "loop") {
|
|
24
|
+
const loopStops = [
|
|
25
|
+
...entry.shape.loopLeftStops,
|
|
26
|
+
...entry.shape.loopRightStops,
|
|
27
|
+
];
|
|
28
|
+
addIssueUnlessLengthIs(1, loopStops, "loopLeftStops and loopRightStops combined");
|
|
29
|
+
// Intentionally allow mainStops to be empty (for the City Circle line!).
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
assertNever(entry.shape);
|
|
11
33
|
}
|
|
12
34
|
}
|
|
13
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-minimum-stops.js","sourceRoot":"","sources":["../../../../../../config/linting/line/diagram/entry-minimum-stops.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"entry-minimum-stops.js","sourceRoot":"","sources":["../../../../../../config/linting/line/diagram/entry-minimum-stops.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,UAAU,mCAAmC,CACjD,MAAsB,EACtB,IAAgB,EAChB,SAAiB;IAEjB,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QACjE,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAE7D,SAAS,sBAAsB,CAC7B,OAAe,EACf,KAAyB,EACzB,SAAiB;YAEjB,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC;gBAC3B,MAAM,CAAC,GAAG,CAAC;oBACT,OAAO,EAAE,iBAAiB,SAAS,aAAa,IAAI,CAAC,IAAI,oBAAoB,OAAO,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,OAAO,SAAS,GAAG;oBAC3I,IAAI,EAAE,SAAS,SAAS,qBAAqB,UAAU,KAAK,SAAS,EAAE;iBACxE,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAClC,sBAAsB,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;aAAM,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzC,sBAAsB,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YAClE,sBAAsB,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;YACpE,sBAAsB,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACtE,CAAC;aAAM,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACvC,MAAM,SAAS,GAAG;gBAChB,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa;gBAC5B,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc;aAC9B,CAAC;YACF,sBAAsB,CACpB,CAAC,EACD,SAAS,EACT,2CAA2C,CAC5C,CAAC;YAEF,yEAAyE;QAC3E,CAAC;aAAM,CAAC;YACN,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { chooseNameForEntry } from "../../../../../server/config/linting/utils/choose-name-for-entry.js";
|
|
2
2
|
import { IssueCollector } from "../../../../../server/config/linting/utils/issue-collector.js";
|
|
3
|
+
import { extractStopsFromLineDiagramShape } from "../../../../../server/config/helpers/extract-stops-from-line-diagram-shape.js";
|
|
3
4
|
export function checkLineDiagramStopsExist(issues, line, lineIndex, stops) {
|
|
4
5
|
const stopIds = new Set(stops.map((stop) => stop.id));
|
|
5
6
|
for (const [entryIndex, entry] of line.diagram.entries.entries()) {
|
|
6
|
-
|
|
7
|
+
const stops = extractStopsFromLineDiagramShape(entry.shape);
|
|
8
|
+
for (const [stopIndex, diagramStop] of stops.entries()) {
|
|
7
9
|
if (!stopIds.has(diagramStop.stopId)) {
|
|
8
10
|
const entryName = chooseNameForEntry(entry.name, entryIndex);
|
|
9
11
|
issues.add({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stops-exist.js","sourceRoot":"","sources":["../../../../../../config/linting/line/diagram/stops-exist.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"stops-exist.js","sourceRoot":"","sources":["../../../../../../config/linting/line/diagram/stops-exist.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,gCAAgC,EAAE,MAAM,kEAAkE,CAAC;AAEpH,MAAM,UAAU,0BAA0B,CACxC,MAAsB,EACtB,IAAgB,EAChB,SAAiB,EACjB,KAA4B;IAE5B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAEtD,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QACjE,MAAM,KAAK,GAAG,gCAAgC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE5D,KAAK,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACvD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrC,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAC7D,MAAM,CAAC,GAAG,CAAC;oBACT,OAAO,EAAE,WAAW,WAAW,CAAC,MAAM,qBAAqB,SAAS,aAAa,IAAI,CAAC,IAAI,oCAAoC;oBAC9H,IAAI,EAAE,SAAS,SAAS,qBAAqB,UAAU,WAAW,SAAS,UAAU;iBACtF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { chooseNameForEntry } from "../../../../../server/config/linting/utils/choose-name-for-entry.js";
|
|
2
2
|
import { IssueCollector } from "../../../../../server/config/linting/utils/issue-collector.js";
|
|
3
|
+
import { extractStopsFromLineDiagramShape } from "../../../../../server/config/helpers/extract-stops-from-line-diagram-shape.js";
|
|
3
4
|
export function checkLineDiagramStopsInRoutes(issues, line, lineIndex, options) {
|
|
4
5
|
if (options.ignoreDiagramStopNotInRoute ?? false)
|
|
5
6
|
return;
|
|
@@ -10,7 +11,8 @@ export function checkLineDiagramStopsInRoutes(issues, line, lineIndex, options)
|
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
for (const [entryIndex, entry] of line.diagram.entries.entries()) {
|
|
13
|
-
|
|
14
|
+
const stops = extractStopsFromLineDiagramShape(entry.shape);
|
|
15
|
+
for (const [stopIndex, diagramStop] of stops.entries()) {
|
|
14
16
|
if (!routeStopIds.has(diagramStop.stopId)) {
|
|
15
17
|
const entryName = chooseNameForEntry(entry.name, entryIndex);
|
|
16
18
|
issues.add({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stops-in-routes.js","sourceRoot":"","sources":["../../../../../../config/linting/line/diagram/stops-in-routes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"stops-in-routes.js","sourceRoot":"","sources":["../../../../../../config/linting/line/diagram/stops-in-routes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,gCAAgC,EAAE,MAAM,kEAAkE,CAAC;AAEpH,MAAM,UAAU,6BAA6B,CAC3C,MAAsB,EACtB,IAAgB,EAChB,SAAiB,EACjB,OAAwB;IAExB,IAAI,OAAO,CAAC,2BAA2B,IAAI,KAAK;QAAE,OAAO;IAEzD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IACvC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAC/B,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QACjE,MAAM,KAAK,GAAG,gCAAgC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE5D,KAAK,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACvD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1C,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAC7D,MAAM,CAAC,GAAG,CAAC;oBACT,OAAO,EAAE,WAAW,WAAW,CAAC,MAAM,qBAAqB,SAAS,aAAa,IAAI,CAAC,IAAI,gCAAgC;oBAC1H,IAAI,EAAE,SAAS,SAAS,qBAAqB,UAAU,WAAW,SAAS,UAAU;iBACtF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -55,7 +55,7 @@ export type LineLintOptions = {
|
|
|
55
55
|
/** Options to control the lint rules for routes on this line. */
|
|
56
56
|
readonly routes?: Record<number, RouteLintOptions>;
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
type RouteLintOptions = {
|
|
59
59
|
/** Ignore this route sharing the same name as another route on this line. */
|
|
60
60
|
readonly ignoreDuplicatedName?: boolean;
|
|
61
61
|
/** Ignore this route missing a mirrored counterpart. */
|
|
@@ -69,3 +69,4 @@ export type LinesPageLineLintOptions = {
|
|
|
69
69
|
/** Ignore this line appearing in multiple lines page sections. */
|
|
70
70
|
readonly ignoreDuplicatedLine?: boolean;
|
|
71
71
|
};
|
|
72
|
+
export {};
|
|
@@ -21,14 +21,32 @@ export type RouteConfig = {
|
|
|
21
21
|
}[];
|
|
22
22
|
readonly color: Color | null;
|
|
23
23
|
};
|
|
24
|
+
export type LineDiagramConfig = {
|
|
25
|
+
readonly entries: readonly LineDiagramEntryConfig[];
|
|
26
|
+
};
|
|
24
27
|
export type LineDiagramEntryConfig = {
|
|
25
28
|
readonly name: string | null;
|
|
26
29
|
readonly color: Color | null;
|
|
27
|
-
readonly
|
|
28
|
-
readonly stopId: number;
|
|
29
|
-
readonly type: LineDiagramStopTypeConfig;
|
|
30
|
-
}[];
|
|
30
|
+
readonly shape: LineDiagramShapeConfig;
|
|
31
31
|
};
|
|
32
|
-
export type
|
|
33
|
-
|
|
32
|
+
export type LineDiagramShapeConfig = LinearLineDiagramShapeConfig | BranchLineDiagramShapeConfig | LoopLineDiagramShapeConfig;
|
|
33
|
+
export type LinearLineDiagramShapeConfig = {
|
|
34
|
+
type: "linear";
|
|
35
|
+
stops: readonly LineDiagramStopConfig[];
|
|
36
|
+
};
|
|
37
|
+
export type BranchLineDiagramShapeConfig = {
|
|
38
|
+
readonly type: "branch";
|
|
39
|
+
readonly commonStops: readonly LineDiagramStopConfig[];
|
|
40
|
+
readonly branchAStops: readonly LineDiagramStopConfig[];
|
|
41
|
+
readonly branchBStops: readonly LineDiagramStopConfig[];
|
|
42
|
+
};
|
|
43
|
+
export type LoopLineDiagramShapeConfig = {
|
|
44
|
+
readonly type: "loop";
|
|
45
|
+
readonly loopLeftStops: readonly LineDiagramStopConfig[];
|
|
46
|
+
readonly loopRightStops: readonly LineDiagramStopConfig[];
|
|
47
|
+
readonly mainStops: readonly LineDiagramStopConfig[];
|
|
48
|
+
};
|
|
49
|
+
export type LineDiagramStopConfig = {
|
|
50
|
+
readonly stopId: number;
|
|
51
|
+
readonly type: LineDiagramStopTypeConfig;
|
|
34
52
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { LineDiagramEntryConfig } from "../../server/config/index.js";
|
|
1
|
+
import type { LineDiagramEntryConfig, LineDiagramShapeConfig } from "../../server/config/index.js";
|
|
2
2
|
import { type Color } from "../../server/data/color.js";
|
|
3
3
|
import type { lineDiagramEntryFodaSchema } from "../../shared/apis/foundational-data/v1/foundational-data.js";
|
|
4
4
|
import type z from "zod";
|
|
5
|
-
type LineDiagramStop = LineDiagramEntryConfig["stops"][number];
|
|
6
5
|
type LineDiagramEntryFields = {
|
|
7
6
|
readonly name: string | null;
|
|
8
7
|
readonly color: Color | null;
|
|
9
|
-
readonly
|
|
8
|
+
readonly shape: LineDiagramShapeConfig;
|
|
10
9
|
};
|
|
11
10
|
export declare class LineDiagramEntry {
|
|
12
11
|
readonly name: string | null;
|
|
13
12
|
readonly color: Color | null;
|
|
14
|
-
readonly
|
|
13
|
+
readonly shape: LineDiagramShapeConfig;
|
|
15
14
|
constructor(fields: LineDiagramEntryFields);
|
|
16
15
|
static build(entryConfig: LineDiagramEntryConfig): LineDiagramEntry;
|
|
17
16
|
toFoda(): z.input<typeof lineDiagramEntryFodaSchema>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { getHexCodesForColor } from "../../server/data/color.js";
|
|
2
|
+
import { unique } from "@dan-schel/js-utils";
|
|
3
|
+
import { extractStopsFromLineDiagramShape } from "../../server/config/helpers/extract-stops-from-line-diagram-shape.js";
|
|
2
4
|
const includedInStopListMapping = {
|
|
3
5
|
"regular": true,
|
|
4
6
|
"always-express": false,
|
|
@@ -6,34 +8,40 @@ const includedInStopListMapping = {
|
|
|
6
8
|
export class LineDiagramEntry {
|
|
7
9
|
name;
|
|
8
10
|
color;
|
|
9
|
-
|
|
11
|
+
shape;
|
|
10
12
|
constructor(fields) {
|
|
11
13
|
this.name = fields.name;
|
|
12
14
|
this.color = fields.color;
|
|
13
|
-
this.
|
|
15
|
+
this.shape = fields.shape;
|
|
14
16
|
}
|
|
15
17
|
static build(entryConfig) {
|
|
16
18
|
return new LineDiagramEntry({
|
|
17
19
|
name: entryConfig.name,
|
|
18
20
|
color: entryConfig.color,
|
|
19
|
-
|
|
21
|
+
shape: entryConfig.shape,
|
|
20
22
|
});
|
|
21
23
|
}
|
|
22
24
|
toFoda() {
|
|
25
|
+
// So there's a mismatch between how the config creates line diagrams, with
|
|
26
|
+
// its "shape" field, and how the FODA schema doesn't have a "shape" field,
|
|
27
|
+
// it's all just dumped at the top level. This wasn't intentional, I decided
|
|
28
|
+
// on the schema first, and then when I got around to implementing the
|
|
29
|
+
// config I preferred having a "shape" field, as name and color are common.
|
|
30
|
+
//
|
|
31
|
+
// But, to be fair, maybe it's a good thing? This means if we change other
|
|
32
|
+
// fields (not just the shape), it can be a new "type" in the FODA, and then
|
|
33
|
+
// the frontend gracefully falls back to the fallbackStopList, instead of
|
|
34
|
+
// requiring a breaking change to the FODA schema.
|
|
23
35
|
return {
|
|
24
|
-
type: "linear",
|
|
25
36
|
name: this.name,
|
|
26
37
|
color: this.color != null ? getHexCodesForColor(this.color) : null,
|
|
27
|
-
|
|
28
|
-
stopId: stop.stopId,
|
|
29
|
-
type: stop.type,
|
|
30
|
-
})),
|
|
38
|
+
...this.shape,
|
|
31
39
|
};
|
|
32
40
|
}
|
|
33
41
|
getFallbackStopList() {
|
|
34
|
-
return this.
|
|
42
|
+
return unique(extractStopsFromLineDiagramShape(this.shape)
|
|
35
43
|
.filter((s) => includedInStopListMapping[s.type])
|
|
36
|
-
.map((stop) => stop.stopId);
|
|
44
|
+
.map((stop) => stop.stopId));
|
|
37
45
|
}
|
|
38
46
|
with(newValues) {
|
|
39
47
|
return new LineDiagramEntry({ ...this, ...newValues });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-diagram-entry.js","sourceRoot":"","sources":["../../../data/line-diagram-entry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"line-diagram-entry.js","sourceRoot":"","sources":["../../../data/line-diagram-entry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAc,MAAM,wBAAwB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,kEAAkE,CAAC;AAEpH,MAAM,yBAAyB,GAA+C;IAC5E,SAAS,EAAE,IAAI;IACf,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAQF,MAAM,OAAO,gBAAgB;IAClB,IAAI,CAAgB;IACpB,KAAK,CAAe;IACpB,KAAK,CAAyB;IAEvC,YAAY,MAA8B;QACxC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAmC;QAC9C,OAAO,IAAI,gBAAgB,CAAC;YAC1B,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,KAAK,EAAE,WAAW,CAAC,KAAK;YACxB,KAAK,EAAE,WAAW,CAAC,KAAK;SACzB,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,2EAA2E;QAC3E,2EAA2E;QAC3E,4EAA4E;QAC5E,sEAAsE;QACtE,2EAA2E;QAC3E,EAAE;QACF,0EAA0E;QAC1E,4EAA4E;QAC5E,yEAAyE;QACzE,kDAAkD;QAClD,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YAClE,GAAG,IAAI,CAAC,KAAK;SACd,CAAC;IACJ,CAAC;IAED,mBAAmB;QACjB,OAAO,MAAM,CACX,gCAAgC,CAAC,IAAI,CAAC,KAAK,CAAC;aACzC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aAChD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAC9B,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,SAA0C;QAC7C,OAAO,IAAI,gBAAgB,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -13,6 +13,13 @@ export declare const stopFodaSchema: z.ZodObject<{
|
|
|
13
13
|
longitude: z.ZodNumber;
|
|
14
14
|
}, z.z.core.$strip>>;
|
|
15
15
|
}, z.z.core.$strip>;
|
|
16
|
+
export declare const lineDiagramStopFodaSchema: z.ZodObject<{
|
|
17
|
+
stopId: z.ZodNumber;
|
|
18
|
+
type: z.ZodEnum<{
|
|
19
|
+
regular: "regular";
|
|
20
|
+
"always-express": "always-express";
|
|
21
|
+
}>;
|
|
22
|
+
}, z.z.core.$strip>;
|
|
16
23
|
export declare const lineDiagramEntryFodaSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
17
24
|
type: z.ZodLiteral<"linear">;
|
|
18
25
|
name: z.ZodNullable<z.ZodString>;
|
|
@@ -27,6 +34,62 @@ export declare const lineDiagramEntryFodaSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
27
34
|
"always-express": "always-express";
|
|
28
35
|
}>;
|
|
29
36
|
}, z.z.core.$strip>>>;
|
|
37
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
38
|
+
type: z.ZodLiteral<"branch">;
|
|
39
|
+
name: z.ZodNullable<z.ZodString>;
|
|
40
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
41
|
+
lightModeHexCode: z.ZodString;
|
|
42
|
+
darkModeHexCode: z.ZodString;
|
|
43
|
+
}, z.z.core.$strip>>;
|
|
44
|
+
commonStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
45
|
+
stopId: z.ZodNumber;
|
|
46
|
+
type: z.ZodEnum<{
|
|
47
|
+
regular: "regular";
|
|
48
|
+
"always-express": "always-express";
|
|
49
|
+
}>;
|
|
50
|
+
}, z.z.core.$strip>>>;
|
|
51
|
+
branchAStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
52
|
+
stopId: z.ZodNumber;
|
|
53
|
+
type: z.ZodEnum<{
|
|
54
|
+
regular: "regular";
|
|
55
|
+
"always-express": "always-express";
|
|
56
|
+
}>;
|
|
57
|
+
}, z.z.core.$strip>>>;
|
|
58
|
+
branchBStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
59
|
+
stopId: z.ZodNumber;
|
|
60
|
+
type: z.ZodEnum<{
|
|
61
|
+
regular: "regular";
|
|
62
|
+
"always-express": "always-express";
|
|
63
|
+
}>;
|
|
64
|
+
}, z.z.core.$strip>>>;
|
|
65
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
66
|
+
type: z.ZodLiteral<"loop">;
|
|
67
|
+
name: z.ZodNullable<z.ZodString>;
|
|
68
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
69
|
+
lightModeHexCode: z.ZodString;
|
|
70
|
+
darkModeHexCode: z.ZodString;
|
|
71
|
+
}, z.z.core.$strip>>;
|
|
72
|
+
loopLeftStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
73
|
+
stopId: z.ZodNumber;
|
|
74
|
+
type: z.ZodEnum<{
|
|
75
|
+
regular: "regular";
|
|
76
|
+
"always-express": "always-express";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.z.core.$strip>>>;
|
|
79
|
+
loopRightStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
80
|
+
stopId: z.ZodNumber;
|
|
81
|
+
type: z.ZodEnum<{
|
|
82
|
+
regular: "regular";
|
|
83
|
+
"always-express": "always-express";
|
|
84
|
+
}>;
|
|
85
|
+
}, z.z.core.$strip>>>;
|
|
86
|
+
mainStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
87
|
+
stopId: z.ZodNumber;
|
|
88
|
+
type: z.ZodEnum<{
|
|
89
|
+
regular: "regular";
|
|
90
|
+
"always-express": "always-express";
|
|
91
|
+
}>;
|
|
92
|
+
}, z.z.core.$strip>>>;
|
|
30
93
|
}, z.z.core.$strip>]>;
|
|
31
94
|
export declare const lineDiagramFodaSchema: z.ZodObject<{
|
|
32
95
|
entries: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -43,6 +106,62 @@ export declare const lineDiagramFodaSchema: z.ZodObject<{
|
|
|
43
106
|
"always-express": "always-express";
|
|
44
107
|
}>;
|
|
45
108
|
}, z.z.core.$strip>>>;
|
|
109
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
110
|
+
type: z.ZodLiteral<"branch">;
|
|
111
|
+
name: z.ZodNullable<z.ZodString>;
|
|
112
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
113
|
+
lightModeHexCode: z.ZodString;
|
|
114
|
+
darkModeHexCode: z.ZodString;
|
|
115
|
+
}, z.z.core.$strip>>;
|
|
116
|
+
commonStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
117
|
+
stopId: z.ZodNumber;
|
|
118
|
+
type: z.ZodEnum<{
|
|
119
|
+
regular: "regular";
|
|
120
|
+
"always-express": "always-express";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.z.core.$strip>>>;
|
|
123
|
+
branchAStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
124
|
+
stopId: z.ZodNumber;
|
|
125
|
+
type: z.ZodEnum<{
|
|
126
|
+
regular: "regular";
|
|
127
|
+
"always-express": "always-express";
|
|
128
|
+
}>;
|
|
129
|
+
}, z.z.core.$strip>>>;
|
|
130
|
+
branchBStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
131
|
+
stopId: z.ZodNumber;
|
|
132
|
+
type: z.ZodEnum<{
|
|
133
|
+
regular: "regular";
|
|
134
|
+
"always-express": "always-express";
|
|
135
|
+
}>;
|
|
136
|
+
}, z.z.core.$strip>>>;
|
|
137
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
138
|
+
type: z.ZodLiteral<"loop">;
|
|
139
|
+
name: z.ZodNullable<z.ZodString>;
|
|
140
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
141
|
+
lightModeHexCode: z.ZodString;
|
|
142
|
+
darkModeHexCode: z.ZodString;
|
|
143
|
+
}, z.z.core.$strip>>;
|
|
144
|
+
loopLeftStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
145
|
+
stopId: z.ZodNumber;
|
|
146
|
+
type: z.ZodEnum<{
|
|
147
|
+
regular: "regular";
|
|
148
|
+
"always-express": "always-express";
|
|
149
|
+
}>;
|
|
150
|
+
}, z.z.core.$strip>>>;
|
|
151
|
+
loopRightStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
152
|
+
stopId: z.ZodNumber;
|
|
153
|
+
type: z.ZodEnum<{
|
|
154
|
+
regular: "regular";
|
|
155
|
+
"always-express": "always-express";
|
|
156
|
+
}>;
|
|
157
|
+
}, z.z.core.$strip>>>;
|
|
158
|
+
mainStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
159
|
+
stopId: z.ZodNumber;
|
|
160
|
+
type: z.ZodEnum<{
|
|
161
|
+
regular: "regular";
|
|
162
|
+
"always-express": "always-express";
|
|
163
|
+
}>;
|
|
164
|
+
}, z.z.core.$strip>>>;
|
|
46
165
|
}, z.z.core.$strip>]>, z.ZodObject<{
|
|
47
166
|
type: z.ZodString;
|
|
48
167
|
}, z.z.core.$strip>]>>>;
|
|
@@ -71,6 +190,62 @@ export declare const lineFodaSchema: z.ZodObject<{
|
|
|
71
190
|
"always-express": "always-express";
|
|
72
191
|
}>;
|
|
73
192
|
}, z.z.core.$strip>>>;
|
|
193
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
194
|
+
type: z.ZodLiteral<"branch">;
|
|
195
|
+
name: z.ZodNullable<z.ZodString>;
|
|
196
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
197
|
+
lightModeHexCode: z.ZodString;
|
|
198
|
+
darkModeHexCode: z.ZodString;
|
|
199
|
+
}, z.z.core.$strip>>;
|
|
200
|
+
commonStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
201
|
+
stopId: z.ZodNumber;
|
|
202
|
+
type: z.ZodEnum<{
|
|
203
|
+
regular: "regular";
|
|
204
|
+
"always-express": "always-express";
|
|
205
|
+
}>;
|
|
206
|
+
}, z.z.core.$strip>>>;
|
|
207
|
+
branchAStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
208
|
+
stopId: z.ZodNumber;
|
|
209
|
+
type: z.ZodEnum<{
|
|
210
|
+
regular: "regular";
|
|
211
|
+
"always-express": "always-express";
|
|
212
|
+
}>;
|
|
213
|
+
}, z.z.core.$strip>>>;
|
|
214
|
+
branchBStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
215
|
+
stopId: z.ZodNumber;
|
|
216
|
+
type: z.ZodEnum<{
|
|
217
|
+
regular: "regular";
|
|
218
|
+
"always-express": "always-express";
|
|
219
|
+
}>;
|
|
220
|
+
}, z.z.core.$strip>>>;
|
|
221
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
222
|
+
type: z.ZodLiteral<"loop">;
|
|
223
|
+
name: z.ZodNullable<z.ZodString>;
|
|
224
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
225
|
+
lightModeHexCode: z.ZodString;
|
|
226
|
+
darkModeHexCode: z.ZodString;
|
|
227
|
+
}, z.z.core.$strip>>;
|
|
228
|
+
loopLeftStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
229
|
+
stopId: z.ZodNumber;
|
|
230
|
+
type: z.ZodEnum<{
|
|
231
|
+
regular: "regular";
|
|
232
|
+
"always-express": "always-express";
|
|
233
|
+
}>;
|
|
234
|
+
}, z.z.core.$strip>>>;
|
|
235
|
+
loopRightStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
236
|
+
stopId: z.ZodNumber;
|
|
237
|
+
type: z.ZodEnum<{
|
|
238
|
+
regular: "regular";
|
|
239
|
+
"always-express": "always-express";
|
|
240
|
+
}>;
|
|
241
|
+
}, z.z.core.$strip>>>;
|
|
242
|
+
mainStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
243
|
+
stopId: z.ZodNumber;
|
|
244
|
+
type: z.ZodEnum<{
|
|
245
|
+
regular: "regular";
|
|
246
|
+
"always-express": "always-express";
|
|
247
|
+
}>;
|
|
248
|
+
}, z.z.core.$strip>>>;
|
|
74
249
|
}, z.z.core.$strip>]>, z.ZodObject<{
|
|
75
250
|
type: z.ZodString;
|
|
76
251
|
}, z.z.core.$strip>]>>>;
|
|
@@ -115,6 +290,62 @@ export declare const fodaSchema: z.ZodObject<{
|
|
|
115
290
|
"always-express": "always-express";
|
|
116
291
|
}>;
|
|
117
292
|
}, z.z.core.$strip>>>;
|
|
293
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
294
|
+
type: z.ZodLiteral<"branch">;
|
|
295
|
+
name: z.ZodNullable<z.ZodString>;
|
|
296
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
297
|
+
lightModeHexCode: z.ZodString;
|
|
298
|
+
darkModeHexCode: z.ZodString;
|
|
299
|
+
}, z.z.core.$strip>>;
|
|
300
|
+
commonStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
301
|
+
stopId: z.ZodNumber;
|
|
302
|
+
type: z.ZodEnum<{
|
|
303
|
+
regular: "regular";
|
|
304
|
+
"always-express": "always-express";
|
|
305
|
+
}>;
|
|
306
|
+
}, z.z.core.$strip>>>;
|
|
307
|
+
branchAStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
308
|
+
stopId: z.ZodNumber;
|
|
309
|
+
type: z.ZodEnum<{
|
|
310
|
+
regular: "regular";
|
|
311
|
+
"always-express": "always-express";
|
|
312
|
+
}>;
|
|
313
|
+
}, z.z.core.$strip>>>;
|
|
314
|
+
branchBStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
315
|
+
stopId: z.ZodNumber;
|
|
316
|
+
type: z.ZodEnum<{
|
|
317
|
+
regular: "regular";
|
|
318
|
+
"always-express": "always-express";
|
|
319
|
+
}>;
|
|
320
|
+
}, z.z.core.$strip>>>;
|
|
321
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
322
|
+
type: z.ZodLiteral<"loop">;
|
|
323
|
+
name: z.ZodNullable<z.ZodString>;
|
|
324
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
325
|
+
lightModeHexCode: z.ZodString;
|
|
326
|
+
darkModeHexCode: z.ZodString;
|
|
327
|
+
}, z.z.core.$strip>>;
|
|
328
|
+
loopLeftStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
329
|
+
stopId: z.ZodNumber;
|
|
330
|
+
type: z.ZodEnum<{
|
|
331
|
+
regular: "regular";
|
|
332
|
+
"always-express": "always-express";
|
|
333
|
+
}>;
|
|
334
|
+
}, z.z.core.$strip>>>;
|
|
335
|
+
loopRightStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
336
|
+
stopId: z.ZodNumber;
|
|
337
|
+
type: z.ZodEnum<{
|
|
338
|
+
regular: "regular";
|
|
339
|
+
"always-express": "always-express";
|
|
340
|
+
}>;
|
|
341
|
+
}, z.z.core.$strip>>>;
|
|
342
|
+
mainStops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
343
|
+
stopId: z.ZodNumber;
|
|
344
|
+
type: z.ZodEnum<{
|
|
345
|
+
regular: "regular";
|
|
346
|
+
"always-express": "always-express";
|
|
347
|
+
}>;
|
|
348
|
+
}, z.z.core.$strip>>>;
|
|
118
349
|
}, z.z.core.$strip>]>, z.ZodObject<{
|
|
119
350
|
type: z.ZodString;
|
|
120
351
|
}, z.z.core.$strip>]>>>;
|
|
@@ -64,18 +64,32 @@ export const stopFodaSchema = z.object({
|
|
|
64
64
|
// requests rather than the size of each one, as when the internet is
|
|
65
65
|
// available, it's fast anyway!
|
|
66
66
|
});
|
|
67
|
+
export const lineDiagramStopFodaSchema = z.object({
|
|
68
|
+
stopId: z.number(),
|
|
69
|
+
type: z.enum(["regular", "always-express"]),
|
|
70
|
+
});
|
|
67
71
|
export const lineDiagramEntryFodaSchema = z.union([
|
|
68
72
|
z.object({
|
|
69
73
|
type: z.literal("linear"),
|
|
70
74
|
name: z.string().nullable(),
|
|
71
75
|
color: colorFodaSchema.nullable(),
|
|
72
|
-
stops:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
stops: lineDiagramStopFodaSchema.array().readonly(),
|
|
77
|
+
}),
|
|
78
|
+
z.object({
|
|
79
|
+
type: z.literal("branch"),
|
|
80
|
+
name: z.string().nullable(),
|
|
81
|
+
color: colorFodaSchema.nullable(),
|
|
82
|
+
commonStops: lineDiagramStopFodaSchema.array().readonly(),
|
|
83
|
+
branchAStops: lineDiagramStopFodaSchema.array().readonly(),
|
|
84
|
+
branchBStops: lineDiagramStopFodaSchema.array().readonly(),
|
|
85
|
+
}),
|
|
86
|
+
z.object({
|
|
87
|
+
type: z.literal("loop"),
|
|
88
|
+
name: z.string().nullable(),
|
|
89
|
+
color: colorFodaSchema.nullable(),
|
|
90
|
+
loopLeftStops: lineDiagramStopFodaSchema.array().readonly(),
|
|
91
|
+
loopRightStops: lineDiagramStopFodaSchema.array().readonly(),
|
|
92
|
+
mainStops: lineDiagramStopFodaSchema.array().readonly(),
|
|
79
93
|
}),
|
|
80
94
|
]);
|
|
81
95
|
export const lineDiagramFodaSchema = z.object({
|