corequery 0.28.0 → 0.30.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 +1 -1
- package/server/dist/server/api/create-api-router.js +3 -1
- package/server/dist/server/api/create-api-router.js.map +1 -1
- package/server/dist/server/api/handlers/about-page/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/about-page/v1/index.js.map +1 -1
- package/server/dist/server/api/handlers/departures/v0/index.d.ts +2 -2
- package/server/dist/server/api/handlers/departures/v0/index.js +16 -13
- package/server/dist/server/api/handlers/departures/v0/index.js.map +1 -1
- package/server/dist/server/api/handlers/foda-synced-handler.d.ts +5 -0
- package/server/dist/server/api/handlers/foda-synced-handler.js +6 -0
- package/server/dist/server/api/handlers/foda-synced-handler.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.d.ts +11 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.js +107 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.js +35 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.js +23 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.js +30 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js +33 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/foundational-data/v1/index.js +6 -4
- package/server/dist/server/api/handlers/foundational-data/v1/index.js.map +1 -1
- package/server/dist/server/api/handlers/service/v0/index.d.ts +2 -2
- package/server/dist/server/api/handlers/service/v0/index.js +18 -15
- package/server/dist/server/api/handlers/service/v0/index.js.map +1 -1
- package/server/dist/server/api/handlers/version-check/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/version-check/v1/index.js.map +1 -1
- package/server/dist/server/api/handlers/versions/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/versions/v1/index.js +1 -3
- package/server/dist/server/api/handlers/versions/v1/index.js.map +1 -1
- package/server/dist/server/api/types.d.ts +8 -1
- package/server/dist/server/config/types/terminology-config.d.ts +1 -0
- package/server/dist/server/corequery.d.ts +2 -0
- package/server/dist/server/corequery.js +12 -0
- package/server/dist/server/corequery.js.map +1 -1
- package/server/dist/server/data/line-diagram-entry.d.ts +0 -3
- package/server/dist/server/data/line-diagram-entry.js +1 -18
- package/server/dist/server/data/line-diagram-entry.js.map +1 -1
- package/server/dist/server/data/line-diagram.d.ts +0 -3
- package/server/dist/server/data/line-diagram.js +0 -6
- package/server/dist/server/data/line-diagram.js.map +1 -1
- package/server/dist/server/data/line.d.ts +0 -3
- package/server/dist/server/data/line.js +1 -10
- package/server/dist/server/data/line.js.map +1 -1
- package/server/dist/server/data/location.d.ts +0 -3
- package/server/dist/server/data/location.js +0 -6
- package/server/dist/server/data/location.js.map +1 -1
- package/server/dist/server/data/stop.d.ts +0 -3
- package/server/dist/server/data/stop.js +0 -9
- package/server/dist/server/data/stop.js.map +1 -1
- package/server/dist/shared/apis/departures/v0/index.d.ts +20 -17
- package/server/dist/shared/apis/departures/v0/index.js +3 -47
- package/server/dist/shared/apis/departures/v0/index.js.map +1 -1
- package/server/dist/shared/apis/foda-synced-result.d.ts +5 -0
- package/server/dist/shared/apis/foda-synced-result.js +8 -0
- package/server/dist/shared/apis/foda-synced-result.js.map +1 -0
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.d.ts +9 -5
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.js +4 -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 +8 -0
- package/server/dist/shared/apis/service/v0/index.d.ts +21 -18
- package/server/dist/shared/apis/service/v0/index.js +3 -4
- package/server/dist/shared/apis/service/v0/index.js.map +1 -1
- package/server/dist/shared/apis/types.d.ts +1 -3
- package/server/dist/shared/apis/types.js +1 -1
- package/server/dist/shared/apis/types.js.map +1 -1
- package/web/dist/assets/About-DpFLDTV_.js +1 -0
- package/web/dist/assets/AdminControls-BMTTV4kR.js +1 -0
- package/web/dist/assets/Alert-k_U4L_j3.js +1 -0
- package/web/dist/assets/Debug-DGqHdl31.js +1 -0
- package/web/dist/assets/Divider-lz6Cf6K8.js +1 -0
- package/web/dist/assets/ErrorMessage-CCAB4vXB.js +1 -0
- package/web/dist/assets/Home-LcK9TehM.js +1 -0
- package/web/dist/assets/Line-ZicduquS.js +1 -0
- package/web/dist/assets/{LinkText-B2lDAKqQ.js → LinkText-sdmJpshg.js} +1 -1
- package/web/dist/assets/{Markdown-Dfd_0fuA.js → Markdown-D5fQv556.js} +1 -1
- package/web/dist/assets/MingcuteAlertLine-CdthHQmK.js +1 -0
- package/web/dist/assets/Nearby-BNDxZx1J.js +1 -0
- package/web/dist/assets/NotFound-zNBih-TR.js +1 -0
- package/web/dist/assets/NotFoundPage-DLkgQE3z.js +1 -0
- package/web/dist/assets/{Page-BM9NQpb4.js → Page-BMcxP_9m.js} +1 -1
- package/web/dist/assets/{Picker-DfHnlTdx.js → Picker-ByWHXE97.js} +1 -1
- package/web/dist/assets/{Placeholder-gNgvcbQj.js → Placeholder-BRnxNmKm.js} +1 -1
- package/web/dist/assets/Service-CqfnDpff.js +1 -0
- package/web/dist/assets/Settings-1Z6FXsgC.js +1 -0
- package/web/dist/assets/{SimpleMobileHeaderContent-6uhjOYtv.js → SimpleMobileHeaderContent-DnaUyjiU.js} +1 -1
- package/web/dist/assets/Status-DIIRyqgr.js +1 -0
- package/web/dist/assets/Stop-DKWaUN6o.js +1 -0
- package/web/dist/assets/Strong-C0VDYprE.js +1 -0
- package/web/dist/assets/ZenMode-qKwx-pZt.js +1 -0
- package/web/dist/assets/index-BQNbqGv2.css +2 -0
- package/web/dist/assets/index-CE8NAPhv.js +2 -0
- package/web/dist/assets/linear-CMwrWzQJ.js +1 -0
- package/web/dist/assets/use-api-BJomuYg6.js +55 -0
- package/web/dist/assets/use-foda-synced-query-BM-OPAql.js +1 -0
- package/web/dist/assets/{use-foundational-data-B1dMFR5b.js → use-foundational-data-BEVQRFj9.js} +1 -1
- package/web/dist/assets/{use-nav-exemptions-heDPohlO.js → use-nav-exemptions-QtGbfEPT.js} +1 -1
- package/web/dist/assets/{use-simple-headers-BUn06ZUr.js → use-simple-headers-Bihzijd5.js} +1 -1
- package/web/dist/index.html +6 -6
- package/web/dist/sw.js +1 -1
- package/server/dist/server/api/handlers/foundational-data/v1/builder.d.ts +0 -11
- package/server/dist/server/api/handlers/foundational-data/v1/builder.js +0 -43
- package/server/dist/server/api/handlers/foundational-data/v1/builder.js.map +0 -1
- package/web/dist/assets/About-DPBo6htj.js +0 -1
- package/web/dist/assets/AdminControls-BaBIl0zd.js +0 -1
- package/web/dist/assets/Alert-CF9YBTID.js +0 -1
- package/web/dist/assets/Debug-BHXbIz7z.js +0 -1
- package/web/dist/assets/Divider-CxLq6fQR.js +0 -1
- package/web/dist/assets/Home-Cx3eWUzu.js +0 -1
- package/web/dist/assets/Line-BrZqgDob.js +0 -1
- package/web/dist/assets/Nearby-BWRao6GM.js +0 -1
- package/web/dist/assets/NotFound-C-b5KMCg.js +0 -1
- package/web/dist/assets/NotFoundPage-DMVU_Mvx.js +0 -1
- package/web/dist/assets/Service-BDi34zmu.js +0 -1
- package/web/dist/assets/Settings-uIyfx-h7.js +0 -1
- package/web/dist/assets/Status-CjViwubY.js +0 -1
- package/web/dist/assets/Stop-DvudYtD7.js +0 -1
- package/web/dist/assets/Strong-B18AJ3bX.js +0 -1
- package/web/dist/assets/ZenMode-C6hpFacp.js +0 -1
- package/web/dist/assets/index-By-qdeD6.js +0 -2
- package/web/dist/assets/index-CYYYnuQF.css +0 -2
- package/web/dist/assets/integers-BYp6YHG5.js +0 -1
- package/web/dist/assets/use-query-DqauRKot.js +0 -55
|
@@ -4,6 +4,7 @@ import { LineCollection } from "./data/line-collection.js";
|
|
|
4
4
|
import type { AboutPageConfig, FooterConfig, LandingPageConfig, TerminologyConfig } from "./config/index.js";
|
|
5
5
|
import type { Logger } from "./logger/logger.js";
|
|
6
6
|
import { ServiceRepository } from "./data/service/service-repository.js";
|
|
7
|
+
import { MultiversionalFoda } from "./api/handlers/foundational-data/multiversional/multiversional-foda.js";
|
|
7
8
|
export type CorequeryConfigBuilder<CustomContextType> = (corequery: Corequery<CustomContextType>) => CorequeryConfig<CustomContextType>;
|
|
8
9
|
export declare class Corequery<CustomContextType = unknown> {
|
|
9
10
|
private readonly _config;
|
|
@@ -20,6 +21,7 @@ export declare class Corequery<CustomContextType = unknown> {
|
|
|
20
21
|
readonly aboutPageConfig: AboutPageConfig;
|
|
21
22
|
readonly terminologyConfig: TerminologyConfig;
|
|
22
23
|
readonly custom: CustomContextType;
|
|
24
|
+
readonly foda: MultiversionalFoda;
|
|
23
25
|
constructor(configBuilder: CorequeryConfigBuilder<CustomContextType>);
|
|
24
26
|
getCorequeryPackageVersion(): string;
|
|
25
27
|
getFrontendVersion(): string;
|
|
@@ -5,6 +5,7 @@ import { StopCollection } from "./data/stop-collection.js";
|
|
|
5
5
|
import { LineCollection } from "./data/line-collection.js";
|
|
6
6
|
import { getCorequeryPackageVersion } from "./get-corequery-package-version.js";
|
|
7
7
|
import { ServiceRepository } from "./data/service/service-repository.js";
|
|
8
|
+
import { MultiversionalFoda } from "./api/handlers/foundational-data/multiversional/multiversional-foda.js";
|
|
8
9
|
export class Corequery {
|
|
9
10
|
_config;
|
|
10
11
|
_webServer;
|
|
@@ -22,6 +23,7 @@ export class Corequery {
|
|
|
22
23
|
aboutPageConfig;
|
|
23
24
|
terminologyConfig;
|
|
24
25
|
custom;
|
|
26
|
+
foda;
|
|
25
27
|
constructor(configBuilder) {
|
|
26
28
|
this._config = configBuilder(this);
|
|
27
29
|
this._webServer = new WebServer(this, this._config.port, this._config.assets, env.COREQUERY_HOT_RELOAD ? "vite-middleware" : "dist-folder", serverFolderPath);
|
|
@@ -39,6 +41,16 @@ export class Corequery {
|
|
|
39
41
|
this.aboutPageConfig = this._config.aboutPage;
|
|
40
42
|
this.terminologyConfig = this._config.terminology;
|
|
41
43
|
this.custom = this._config.custom;
|
|
44
|
+
// Right now, FODA is completely static (it only changes if the server
|
|
45
|
+
// config changes) and relies purely on the data which is already available
|
|
46
|
+
// above. Because of that, I'm able to construct it here and memoize it for
|
|
47
|
+
// the life of the server. If that ever changes, and it may (this is why the
|
|
48
|
+
// FODA hash is NOT based on the server version, and it actually calculated
|
|
49
|
+
// from the data itself - in case it becomes dynamic in the future), then
|
|
50
|
+
// this strategy won't work anymore. I'll still want to find a way to
|
|
51
|
+
// memoize the FODA though, so that the hash is only recalculated when the
|
|
52
|
+
// FODA actually changes, instead of on every API request.
|
|
53
|
+
this.foda = MultiversionalFoda.build(this);
|
|
42
54
|
}
|
|
43
55
|
getCorequeryPackageVersion() {
|
|
44
56
|
if (this._corequeryPackageVersion == null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corequery.js","sourceRoot":"","sources":["../../corequery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,E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AAC,MAAM,CAAC;QAElC,sEAAsE;QACtE,2EAA2E;QAC3E,2EAA2E;QAC3E,4EAA4E;QAC5E,2EAA2E;QAC3E,yEAAyE;QACzE,qEAAqE;QACrE,0EAA0E;QAC1E,0DAA0D;QAC1D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,0BAA0B;QACxB,IAAI,IAAI,CAAC,wBAAwB,IAAI,IAAI,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,wBAAwB,CAAC;IACvC,CAAC;IAED,kBAAkB;QAChB,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,wBAAwB,GAAG,MAAM,0BAA0B,EAAE,CAAC;QAEnE,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC;QAE7D,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CACvB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAC3B,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,kBAAkB,EAAE,EACzB,IAAI,CAAC,0BAA0B,EAAE,CAClC,CAAC;QAEF,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { LineDiagramEntryConfig, LineDiagramShapeConfig } from "../config/index.js";
|
|
2
2
|
import { type Color } from "./color.js";
|
|
3
|
-
import type { lineDiagramEntryFodaSchema } from "../../shared/apis/foundational-data/v1/foundational-data.js";
|
|
4
|
-
import type z from "zod";
|
|
5
3
|
type LineDiagramEntryFields = {
|
|
6
4
|
readonly name: string | null;
|
|
7
5
|
readonly color: Color | null;
|
|
@@ -13,7 +11,6 @@ export declare class LineDiagramEntry {
|
|
|
13
11
|
readonly shape: LineDiagramShapeConfig;
|
|
14
12
|
constructor(fields: LineDiagramEntryFields);
|
|
15
13
|
static build(entryConfig: LineDiagramEntryConfig): LineDiagramEntry;
|
|
16
|
-
toFoda(): z.input<typeof lineDiagramEntryFodaSchema>;
|
|
17
14
|
getFallbackStopList(): number[];
|
|
18
15
|
with(newValues: Partial<LineDiagramEntryFields>): LineDiagramEntry;
|
|
19
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from "./color.js";
|
|
2
2
|
import { unique } from "@dan-schel/js-utils";
|
|
3
3
|
import { extractStopsFromLineDiagramShape } from "../config/helpers/extract-stops-from-line-diagram-shape.js";
|
|
4
4
|
const includedInStopListMapping = {
|
|
@@ -21,23 +21,6 @@ export class LineDiagramEntry {
|
|
|
21
21
|
shape: entryConfig.shape,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
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.
|
|
35
|
-
return {
|
|
36
|
-
name: this.name,
|
|
37
|
-
color: this.color != null ? getHexCodesForColor(this.color) : null,
|
|
38
|
-
...this.shape,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
24
|
getFallbackStopList() {
|
|
42
25
|
return unique(extractStopsFromLineDiagramShape(this.shape)
|
|
43
26
|
.filter((s) => includedInStopListMapping[s.type])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-diagram-entry.js","sourceRoot":"","sources":["../../../data/line-diagram-entry.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"line-diagram-entry.js","sourceRoot":"","sources":["../../../data/line-diagram-entry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,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,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"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { LineDiagramEntry } from "./line-diagram-entry.js";
|
|
2
|
-
import type { lineDiagramFodaSchema } from "../../shared/apis/foundational-data/v1/foundational-data.js";
|
|
3
|
-
import type z from "zod";
|
|
4
2
|
import type { LineDiagramConfig } from "../config/index.js";
|
|
5
3
|
type LineDiagramFields = {
|
|
6
4
|
readonly entries: LineDiagramEntry[];
|
|
@@ -9,7 +7,6 @@ export declare class LineDiagram {
|
|
|
9
7
|
readonly entries: LineDiagramEntry[];
|
|
10
8
|
constructor(fields: LineDiagramFields);
|
|
11
9
|
static build(diagram: LineDiagramConfig): LineDiagram;
|
|
12
|
-
toFoda(): z.input<typeof lineDiagramFodaSchema>;
|
|
13
10
|
with(newValues: Partial<LineDiagramFields>): LineDiagram;
|
|
14
11
|
getFallbackStopList(): number[];
|
|
15
12
|
}
|
|
@@ -10,12 +10,6 @@ export class LineDiagram {
|
|
|
10
10
|
entries: diagram.entries.map((entry) => LineDiagramEntry.build(entry)),
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
toFoda() {
|
|
14
|
-
return {
|
|
15
|
-
entries: this.entries.map((entry) => entry.toFoda()),
|
|
16
|
-
fallbackStopList: this.getFallbackStopList(),
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
13
|
with(newValues) {
|
|
20
14
|
return new LineDiagram({ ...this, ...newValues });
|
|
21
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-diagram.js","sourceRoot":"","sources":["../../../data/line-diagram.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"line-diagram.js","sourceRoot":"","sources":["../../../data/line-diagram.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO7C,MAAM,OAAO,WAAW;IACb,OAAO,CAAqB;IAErC,YAAY,MAAyB;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAA0B;QACrC,OAAO,IAAI,WAAW,CAAC;YACrB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACvE,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,SAAqC;QACxC,OAAO,IAAI,WAAW,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,mBAAmB;QACjB,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { LineConfig, TagSuccessionConfig } from "../config/index.js";
|
|
2
2
|
import { Tags } from "./tags.js";
|
|
3
|
-
import type { lineFodaSchema } from "../../shared/apis/foundational-data/v1/foundational-data.js";
|
|
4
|
-
import type z from "zod";
|
|
5
3
|
import { type Color } from "./color.js";
|
|
6
4
|
import { LineDiagram } from "./line-diagram.js";
|
|
7
5
|
type LineFields = {
|
|
@@ -21,7 +19,6 @@ export declare class Line {
|
|
|
21
19
|
readonly diagram: LineDiagram;
|
|
22
20
|
constructor(fields: LineFields);
|
|
23
21
|
static build(lineConfig: LineConfig, lineTagSuccession: TagSuccessionConfig): Line;
|
|
24
|
-
toFoda(): z.input<typeof lineFodaSchema>;
|
|
25
22
|
with(newValues: Partial<LineFields>): Line;
|
|
26
23
|
/** e.g. `"Sandringham" (#1)` */
|
|
27
24
|
get debugName(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tags } from "./tags.js";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "./color.js";
|
|
3
3
|
import { LineDiagram } from "./line-diagram.js";
|
|
4
4
|
export class Line {
|
|
5
5
|
id;
|
|
@@ -26,15 +26,6 @@ export class Line {
|
|
|
26
26
|
diagram: LineDiagram.build(lineConfig.diagram),
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
toFoda() {
|
|
30
|
-
return {
|
|
31
|
-
id: this.id,
|
|
32
|
-
name: this.name,
|
|
33
|
-
urlPath: this.urlPath,
|
|
34
|
-
color: this.color != null ? getHexCodesForColor(this.color) : null,
|
|
35
|
-
diagram: this.diagram.toFoda(),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
29
|
with(newValues) {
|
|
39
30
|
return new Line({ ...this, ...newValues });
|
|
40
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../data/line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../data/line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAW5D,MAAM,OAAO,IAAI;IACN,EAAE,CAAS;IACX,IAAI,CAAS;IACb,IAAI,CAAO;IACX,OAAO,CAAS;IAChB,KAAK,CAAe;IACpB,OAAO,CAAc;IAE9B,YAAY,MAAkB;QAC5B,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,KAAK,CACV,UAAsB,EACtB,iBAAsC;QAEtC,OAAO,IAAI,IAAI,CAAC;YACd,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC;YACpD,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,SAA8B;QACjC,OAAO,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,gCAAgC;IAChC,IAAI,SAAS;QACX,OAAO,IAAI,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE,GAAG,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { locationFodaSchema } from "../../shared/apis/foundational-data/v1/foundational-data.js";
|
|
2
|
-
import type z from "zod";
|
|
3
1
|
export declare class Location {
|
|
4
2
|
readonly latitude: number;
|
|
5
3
|
readonly longitude: number;
|
|
@@ -8,5 +6,4 @@ export declare class Location {
|
|
|
8
6
|
readonly latitude: number;
|
|
9
7
|
readonly longitude: number;
|
|
10
8
|
} | null): Location | null;
|
|
11
|
-
toFoda(): z.input<typeof locationFodaSchema>;
|
|
12
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../data/location.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../data/location.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAQ;IAED;IACA;IAFlB,YACkB,QAAgB,EAChB,SAAiB;QADjB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,SAAS,CAAQ;IAChC,CAAC;IAEJ,MAAM,CAAC,cAAc,CACnB,KAGQ;QAER,IAAI,KAAK,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QAC/B,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { StopConfig, TagSuccessionConfig } from "../config/index.js";
|
|
2
2
|
import { Tags } from "./tags.js";
|
|
3
|
-
import type { stopFodaSchema } from "../../shared/apis/foundational-data/v1/foundational-data.js";
|
|
4
|
-
import type z from "zod";
|
|
5
3
|
import { Location } from "./location.js";
|
|
6
4
|
type StopFields = {
|
|
7
5
|
readonly id: number;
|
|
@@ -21,7 +19,6 @@ export declare class Stop {
|
|
|
21
19
|
constructor(fields: StopFields);
|
|
22
20
|
static build(stopConfig: StopConfig, stopTagSuccession: TagSuccessionConfig, canonicalLinesServingStop: readonly number[]): Stop;
|
|
23
21
|
with(newValues: Partial<StopFields>): Stop;
|
|
24
|
-
toFoda(): z.input<typeof stopFodaSchema>;
|
|
25
22
|
/** e.g. `"Sandringham" (#1)` */
|
|
26
23
|
get debugName(): string;
|
|
27
24
|
}
|
|
@@ -28,15 +28,6 @@ export class Stop {
|
|
|
28
28
|
with(newValues) {
|
|
29
29
|
return new Stop({ ...this, ...newValues });
|
|
30
30
|
}
|
|
31
|
-
toFoda() {
|
|
32
|
-
return {
|
|
33
|
-
id: this.id,
|
|
34
|
-
name: this.name,
|
|
35
|
-
urlPath: this.urlPath,
|
|
36
|
-
canonicalLinesServingStop: this.canonicalLinesServingStop,
|
|
37
|
-
location: this.location?.toFoda() ?? null,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
31
|
/** e.g. `"Sandringham" (#1)` */
|
|
41
32
|
get debugName() {
|
|
42
33
|
return `"${this.name}" (#${this.id})`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../../data/stop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../../data/stop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAWrD,MAAM,OAAO,IAAI;IACN,EAAE,CAAS;IACX,IAAI,CAAS;IACb,IAAI,CAAO;IACX,OAAO,CAAS;IAChB,QAAQ,CAAkB;IAC1B,yBAAyB,CAAoB;IAEtD,YAAY,MAAkB;QAC5B,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,yBAAyB,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,KAAK,CACV,UAAsB,EACtB,iBAAsC,EACtC,yBAA4C;QAE5C,OAAO,IAAI,IAAI,CAAC;YACd,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC;YACpD,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;YACtD,yBAAyB;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,SAA8B;QACjC,OAAO,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,gCAAgC;IAChC,IAAI,SAAS;QACX,OAAO,IAAI,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE,GAAG,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -5,24 +5,27 @@ declare const argsSchema: z.ZodObject<{
|
|
|
5
5
|
count: z.ZodNumber;
|
|
6
6
|
}, z.z.core.$strip>;
|
|
7
7
|
declare const resultSchema: z.ZodObject<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
foundationalDataHash: z.ZodString;
|
|
9
|
+
innerResult: z.ZodObject<{
|
|
10
|
+
departures: z.ZodArray<z.ZodObject<{
|
|
11
|
+
sourceId: z.ZodString;
|
|
12
|
+
intrasourceId: z.ZodString;
|
|
13
|
+
primaryDestinationText: z.ZodString;
|
|
14
|
+
secondaryDestinationText: z.ZodNullable<z.ZodString>;
|
|
15
|
+
lineIds: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
16
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
17
|
+
lightModeHexCode: z.ZodString;
|
|
18
|
+
darkModeHexCode: z.ZodString;
|
|
19
|
+
}, z.z.core.$strip>>;
|
|
20
|
+
isCancelled: z.ZodBoolean;
|
|
21
|
+
movement: z.ZodObject<{
|
|
22
|
+
index: z.ZodNumber;
|
|
23
|
+
positionId: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
time: z.ZodString;
|
|
25
|
+
formerTime: z.ZodNullable<z.ZodString>;
|
|
26
|
+
}, z.z.core.$strip>;
|
|
17
27
|
}, z.z.core.$strip>>;
|
|
18
|
-
|
|
19
|
-
movement: z.ZodObject<{
|
|
20
|
-
index: z.ZodNumber;
|
|
21
|
-
positionId: z.ZodNullable<z.ZodNumber>;
|
|
22
|
-
time: z.ZodString;
|
|
23
|
-
formerTime: z.ZodNullable<z.ZodString>;
|
|
24
|
-
}, z.z.core.$strip>;
|
|
25
|
-
}, z.z.core.$strip>>;
|
|
28
|
+
}, z.z.core.$strip>;
|
|
26
29
|
}, z.z.core.$strip>;
|
|
27
30
|
export declare const api: Api<typeof argsSchema, typeof resultSchema>;
|
|
28
31
|
export {};
|
|
@@ -1,52 +1,8 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
+
import { createFodaSyncedResultSchema } from "../../foda-synced-result.js";
|
|
2
3
|
// NOTE: This is a "v0" API, i.e. its not intended to be used by anyone except
|
|
3
4
|
// me, during the "beta" phase. When we switch to "v1" it'll break compatibility
|
|
4
5
|
// with frontends that only understand the v0 API, and that's A-OK.
|
|
5
|
-
// TODO: The v1 API needs to be wrapped in foundational data (FODA) updating
|
|
6
|
-
// logic, because the cached FODA might be missing stops that this API response
|
|
7
|
-
// includes (at least, in the future when I add the stopping pattern field).
|
|
8
|
-
// Maybe the server has had a new stop added since the user opened the app. It
|
|
9
|
-
// means all APIs that reference things in the FODA (e.g. stop IDs) need to take
|
|
10
|
-
// FODA hash from the client as an argument, and if the FODA hash is outdated,
|
|
11
|
-
// return the updated FODA along with the API response, so that the client can
|
|
12
|
-
// update its cached FODA, and use that to now render the API response against.
|
|
13
|
-
//
|
|
14
|
-
// Something that'll be tricky with this foundational data update logic, is that
|
|
15
|
-
// foundational data is stored in state, in a global context, so when the API
|
|
16
|
-
// response comes back, if we need to update the foundational data, we'll call
|
|
17
|
-
// setState(), but that updated state doesn't apply until the next render (I
|
|
18
|
-
// think?), so there'll still be a render with the old foundational data unless
|
|
19
|
-
// I'm able to find a way to prevent that first render.
|
|
20
|
-
//
|
|
21
|
-
// I think if you call setState() synchronously in a component's render function
|
|
22
|
-
// rather than inside a useEffect() it'll essentially ignore the result of that
|
|
23
|
-
// render, and immediately re-render with the new state. The issue is that
|
|
24
|
-
// because we're doing an API call, it'll probably be inside a useEffect(), so
|
|
25
|
-
// maybe we'd need to store the whole result in state ("whole" = with the
|
|
26
|
-
// foundational data too), and then check synchronously inside the render
|
|
27
|
-
// function (of some `useFodaSynchronizedApiCall()` hook which will be doing the
|
|
28
|
-
// API call, subbing in the FODA hash argument, unwrapping the result, and
|
|
29
|
-
// managing everything related to this problem) that if that state is set AND
|
|
30
|
-
// has updated foundational data, then setState on the foundational data context
|
|
31
|
-
// immediately. I'd have to check that this re-rendering thing works in Preact
|
|
32
|
-
// like it does in React though.
|
|
33
|
-
//
|
|
34
|
-
// ^^ Actually, I don't think this works, because even as the render which will
|
|
35
|
-
// ultimately be discarded is being rendered, an error could be thrown while
|
|
36
|
-
// trying to resolve a stop name or something, and we don't want that! I doubt
|
|
37
|
-
// Preact will just swallow that error, and even so, executing broken code like
|
|
38
|
-
// that could weird bugs if that code has side-effects. The real solution might
|
|
39
|
-
// just have to be ensuring that components who consume an API response that
|
|
40
|
-
// requires up-to-date FODA only ever use the FODA given by the
|
|
41
|
-
// `useFodaSynchronizedApiCall()` hook itself, and the hook will ensure that if
|
|
42
|
-
// it returns a result, it also returns the FODA from that result if the FODA in
|
|
43
|
-
// the global context is outdated (but still updating the global context of
|
|
44
|
-
// course, we're just solving that first render bug). Child components fetching
|
|
45
|
-
// their FODA from the global context could still be affected by the bug though,
|
|
46
|
-
// so we might need to wrap the children in a second context provider which uses
|
|
47
|
-
// the hook result's FODA.
|
|
48
|
-
//
|
|
49
|
-
// Sheesh! 😅
|
|
50
6
|
const argsSchema = z.object({
|
|
51
7
|
stopId: z.number(),
|
|
52
8
|
count: z.number(),
|
|
@@ -69,7 +25,7 @@ const argsSchema = z.object({
|
|
|
69
25
|
// })
|
|
70
26
|
// .array(),
|
|
71
27
|
});
|
|
72
|
-
const resultSchema = z.object({
|
|
28
|
+
const resultSchema = createFodaSyncedResultSchema(z.object({
|
|
73
29
|
departures: z
|
|
74
30
|
.object({
|
|
75
31
|
sourceId: z.string(),
|
|
@@ -118,7 +74,7 @@ const resultSchema = z.object({
|
|
|
118
74
|
}),
|
|
119
75
|
})
|
|
120
76
|
.array(),
|
|
121
|
-
});
|
|
77
|
+
}));
|
|
122
78
|
export const api = {
|
|
123
79
|
path: "/departures/v0",
|
|
124
80
|
argsSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../shared/apis/departures/v0/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../shared/apis/departures/v0/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAEnF,8EAA8E;AAC9E,gFAAgF;AAChF,mEAAmE;AAEnE,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IAEjB,8EAA8E;IAC9E,4EAA4E;IAC5E,cAAc;IACd,EAAE;IACF,4CAA4C;IAC5C,EAAE;IACF,uBAAuB;IACvB,gDAAgD;IAChD,+BAA+B;IAC/B,EAAE;IACF,yEAAyE;IACz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MAAM,EAAE;YAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAClC,CAAC;KACH,CAAC;SACD,KAAK,EAAE;CACX,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAgD;IAC9D,IAAI,EAAE,gBAAgB;IACtB,UAAU;IACV,YAAY;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foda-synced-result.js","sourceRoot":"","sources":["../../../../shared/apis/foda-synced-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAgB,MAAM,KAAK,CAAC;AAEtC,MAAM,UAAU,4BAA4B,CAC1C,iBAAoB;IAEpB,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE;QAChC,WAAW,EAAE,iBAAiB;KAC/B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
export declare const locationFodaSchema: z.ZodObject<{
|
|
3
|
-
latitude: z.ZodNumber;
|
|
4
|
-
longitude: z.ZodNumber;
|
|
5
|
-
}, z.z.core.$strip>;
|
|
6
2
|
export declare const stopFodaSchema: z.ZodObject<{
|
|
7
3
|
id: z.ZodNumber;
|
|
8
4
|
name: z.ZodString;
|
|
@@ -91,7 +87,7 @@ export declare const lineDiagramEntryFodaSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
91
87
|
}>;
|
|
92
88
|
}, z.z.core.$strip>>>;
|
|
93
89
|
}, z.z.core.$strip>]>;
|
|
94
|
-
type UnderstoodLineDiagramEntryType = z.
|
|
90
|
+
type UnderstoodLineDiagramEntryType = z.output<typeof lineDiagramEntryFodaSchema>["type"];
|
|
95
91
|
export declare function isUnderstoodLineDiagramEntryType(type: string): type is UnderstoodLineDiagramEntryType;
|
|
96
92
|
export declare const lineDiagramFodaSchema: z.ZodObject<{
|
|
97
93
|
entries: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -257,6 +253,7 @@ export declare const lineFodaSchema: z.ZodObject<{
|
|
|
257
253
|
export declare const fodaSchema: z.ZodObject<{
|
|
258
254
|
metadata: z.ZodObject<{
|
|
259
255
|
hash: z.ZodString;
|
|
256
|
+
fodaApiVersion: z.ZodLiteral<"1">;
|
|
260
257
|
serverVersion: z.ZodString;
|
|
261
258
|
}, z.z.core.$strip>;
|
|
262
259
|
stops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -363,6 +360,13 @@ export declare const fodaSchema: z.ZodObject<{
|
|
|
363
360
|
line: "line";
|
|
364
361
|
route: "route";
|
|
365
362
|
}>;
|
|
363
|
+
service: z.ZodEnum<{
|
|
364
|
+
service: "service";
|
|
365
|
+
trip: "trip";
|
|
366
|
+
train: "train";
|
|
367
|
+
tram: "tram";
|
|
368
|
+
bus: "bus";
|
|
369
|
+
}>;
|
|
366
370
|
}, z.z.core.$strip>;
|
|
367
371
|
landingPage: z.ZodObject<{
|
|
368
372
|
primaryMarkdown: z.ZodString;
|
|
@@ -21,7 +21,7 @@ import z from "zod";
|
|
|
21
21
|
// data (for a little while at least). Remember that the frontend, of course,
|
|
22
22
|
// doesn't need to be backwards compatible (we won't be running an old version
|
|
23
23
|
// of the SERVER)!
|
|
24
|
-
|
|
24
|
+
const locationFodaSchema = z.object({
|
|
25
25
|
latitude: z.number(),
|
|
26
26
|
longitude: z.number(),
|
|
27
27
|
});
|
|
@@ -36,12 +36,7 @@ export const stopFodaSchema = z.object({
|
|
|
36
36
|
canonicalLinesServingStop: z.number().array().readonly(),
|
|
37
37
|
// To avoid users needing to send their location to the server, we send the
|
|
38
38
|
// locations of each stop to them instead, and do the maths client-side.
|
|
39
|
-
location:
|
|
40
|
-
.object({
|
|
41
|
-
latitude: z.number(),
|
|
42
|
-
longitude: z.number(),
|
|
43
|
-
})
|
|
44
|
-
.nullable(),
|
|
39
|
+
location: locationFodaSchema.nullable(),
|
|
45
40
|
// Considering whether things like the list of supported filters and default
|
|
46
41
|
// departure feeds would go in a `/stop-page/v1` API (which would also return
|
|
47
42
|
// the departures themselves, even though subsequent refreshes would still use
|
|
@@ -126,6 +121,7 @@ export const lineFodaSchema = z.object({
|
|
|
126
121
|
const terminologySchema = z.object({
|
|
127
122
|
stop: z.enum(["stop", "station"]),
|
|
128
123
|
line: z.enum(["line", "route"]),
|
|
124
|
+
service: z.enum(["service", "trip", "train", "tram", "bus"]),
|
|
129
125
|
// Not sure if this is really needed yet. It will be if stop filters are
|
|
130
126
|
// included in the foundational data, as they're not pre-formatted by the
|
|
131
127
|
// server (i.e. sent over as `position: 1` and expect the frontend to format
|
|
@@ -171,6 +167,7 @@ const footerFodaSchema = z.object({
|
|
|
171
167
|
export const fodaSchema = z.object({
|
|
172
168
|
metadata: z.object({
|
|
173
169
|
hash: z.string(),
|
|
170
|
+
fodaApiVersion: z.literal("1"),
|
|
174
171
|
serverVersion: z.string(),
|
|
175
172
|
}),
|
|
176
173
|
stops: stopFodaSchema.array().readonly(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundational-data.js","sourceRoot":"","sources":["../../../../../../shared/apis/foundational-data/v1/foundational-data.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,6EAA6E;AAC7E,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,yDAAyD;AACzD,EAAE;AACF,yEAAyE;AACzE,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,4BAA4B;AAC5B,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,kBAAkB;AAElB,MAAM,
|
|
1
|
+
{"version":3,"file":"foundational-data.js","sourceRoot":"","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CAAC,OAAO,CAAC,GAAG,CAAC;QAC9B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;KAC1B,CAAC;IAEF,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACxC,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACxC,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,qBAAqB;IAClC,MAAM,EAAE,gBAAgB;CACzB,CAAC,CAAC"}
|
|
@@ -8,6 +8,7 @@ declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
8
8
|
foundationalData: z.ZodObject<{
|
|
9
9
|
metadata: z.ZodObject<{
|
|
10
10
|
hash: z.ZodString;
|
|
11
|
+
fodaApiVersion: z.ZodLiteral<"1">;
|
|
11
12
|
serverVersion: z.ZodString;
|
|
12
13
|
}, z.z.core.$strip>;
|
|
13
14
|
stops: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -114,6 +115,13 @@ declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
114
115
|
line: "line";
|
|
115
116
|
route: "route";
|
|
116
117
|
}>;
|
|
118
|
+
service: z.ZodEnum<{
|
|
119
|
+
service: "service";
|
|
120
|
+
trip: "trip";
|
|
121
|
+
train: "train";
|
|
122
|
+
tram: "tram";
|
|
123
|
+
bus: "bus";
|
|
124
|
+
}>;
|
|
117
125
|
}, z.z.core.$strip>;
|
|
118
126
|
landingPage: z.ZodObject<{
|
|
119
127
|
primaryMarkdown: z.ZodString;
|
|
@@ -5,25 +5,28 @@ declare const argsSchema: z.ZodObject<{
|
|
|
5
5
|
intrasourceId: z.ZodString;
|
|
6
6
|
}, z.z.core.$strip>;
|
|
7
7
|
declare const resultSchema: z.ZodObject<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
foundationalDataHash: z.ZodString;
|
|
9
|
+
innerResult: z.ZodObject<{
|
|
10
|
+
service: z.ZodNullable<z.ZodObject<{
|
|
11
|
+
sourceId: z.ZodString;
|
|
12
|
+
intrasourceId: z.ZodString;
|
|
13
|
+
primaryDestinationText: z.ZodString;
|
|
14
|
+
lineIds: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
15
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
16
|
+
lightModeHexCode: z.ZodString;
|
|
17
|
+
darkModeHexCode: z.ZodString;
|
|
18
|
+
}, z.z.core.$strip>>;
|
|
19
|
+
isCancelled: z.ZodBoolean;
|
|
20
|
+
movements: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
21
|
+
stopId: z.ZodNumber;
|
|
22
|
+
positionId: z.ZodNullable<z.ZodNumber>;
|
|
23
|
+
arrivalTime: z.ZodNullable<z.ZodString>;
|
|
24
|
+
formerArrivalTime: z.ZodNullable<z.ZodString>;
|
|
25
|
+
departureTime: z.ZodNullable<z.ZodString>;
|
|
26
|
+
formerDepartureTime: z.ZodNullable<z.ZodString>;
|
|
27
|
+
}, z.z.core.$strip>>>;
|
|
16
28
|
}, z.z.core.$strip>>;
|
|
17
|
-
|
|
18
|
-
movements: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
19
|
-
stopId: z.ZodNumber;
|
|
20
|
-
positionId: z.ZodNullable<z.ZodNumber>;
|
|
21
|
-
arrivalTime: z.ZodNullable<z.ZodString>;
|
|
22
|
-
formerArrivalTime: z.ZodNullable<z.ZodString>;
|
|
23
|
-
departureTime: z.ZodNullable<z.ZodString>;
|
|
24
|
-
formerDepartureTime: z.ZodNullable<z.ZodString>;
|
|
25
|
-
}, z.z.core.$strip>>>;
|
|
26
|
-
}, z.z.core.$strip>>;
|
|
29
|
+
}, z.z.core.$strip>;
|
|
27
30
|
}, z.z.core.$strip>;
|
|
28
31
|
export declare const api: Api<typeof argsSchema, typeof resultSchema>;
|
|
29
32
|
export {};
|