corequery 0.31.2 → 0.32.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/args-error.d.ts +3 -0
- package/server/dist/server/api/args-error.js +7 -0
- package/server/dist/server/api/args-error.js.map +1 -0
- package/server/dist/server/api/create-api-router.js +8 -6
- package/server/dist/server/api/create-api-router.js.map +1 -1
- package/server/dist/server/api/handlers/departures/v0/index.d.ts +5 -1
- package/server/dist/server/api/handlers/departures/v0/index.js +82 -39
- package/server/dist/server/api/handlers/departures/v0/index.js.map +1 -1
- package/server/dist/server/api/handlers/departures/v0/to-api-result.d.ts +4 -0
- package/server/dist/server/api/handlers/departures/v0/to-api-result.js +24 -0
- package/server/dist/server/api/handlers/departures/v0/to-api-result.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js +24 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js.map +1 -1
- package/server/dist/server/config/config.d.ts +7 -1
- package/server/dist/server/config/helpers/corequery-filters.d.ts +14 -0
- package/server/dist/server/config/helpers/corequery-filters.js +34 -0
- package/server/dist/server/config/helpers/corequery-filters.js.map +1 -0
- package/server/dist/server/config/helpers/create-canonical-lines-serving-stop-algorithm.d.ts +1 -1
- package/server/dist/server/config/helpers/index.d.ts +1 -0
- package/server/dist/server/config/helpers/index.js +1 -0
- package/server/dist/server/config/helpers/index.js.map +1 -1
- package/server/dist/server/config/linting/types.d.ts +3 -0
- package/server/dist/server/config/types/custom-filter-function-type.d.ts +8 -0
- package/server/dist/server/config/types/custom-filter-function-type.js +2 -0
- package/server/dist/server/config/types/custom-filter-function-type.js.map +1 -0
- package/server/dist/server/config/types/get-canonical-lines-serving-stop-config.js +2 -0
- package/server/dist/server/config/types/get-canonical-lines-serving-stop-config.js.map +1 -0
- package/server/dist/server/config/types/get-default-departure-feeds-for-stop-config.d.ts +7 -0
- package/server/dist/server/config/types/get-default-departure-feeds-for-stop-config.js +2 -0
- package/server/dist/server/config/types/get-default-departure-feeds-for-stop-config.js.map +1 -0
- package/server/dist/server/config/types/get-filters-for-stop-config.d.ts +15 -0
- package/server/dist/server/config/types/get-filters-for-stop-config.js +2 -0
- package/server/dist/server/config/types/get-filters-for-stop-config.js.map +1 -0
- package/server/dist/server/config/types/index.d.ts +4 -1
- package/server/dist/server/config/types/index.js +4 -1
- package/server/dist/server/config/types/index.js.map +1 -1
- package/server/dist/server/corequery.d.ts +2 -0
- package/server/dist/server/corequery.js +4 -1
- package/server/dist/server/corequery.js.map +1 -1
- package/server/dist/server/data/departure-filters/departure-filter-type.d.ts +9 -0
- package/server/dist/server/data/departure-filters/departure-filter-type.js +9 -0
- package/server/dist/server/data/departure-filters/departure-filter-type.js.map +1 -0
- package/server/dist/server/data/departure-filters/departure-filters.d.ts +31 -0
- package/server/dist/server/data/departure-filters/departure-filters.js +94 -0
- package/server/dist/server/data/departure-filters/departure-filters.js.map +1 -0
- package/server/dist/server/data/departure-filters/index.d.ts +2 -0
- package/server/dist/server/data/departure-filters/index.js +3 -0
- package/server/dist/server/data/departure-filters/index.js.map +1 -0
- package/server/dist/server/data/departure-filters/types/arrival.d.ts +6 -0
- package/server/dist/server/data/departure-filters/types/arrival.js +12 -0
- package/server/dist/server/data/departure-filters/types/arrival.js.map +1 -0
- package/server/dist/server/data/departure-filters/types/custom.d.ts +9 -0
- package/server/dist/server/data/departure-filters/types/custom.js +19 -0
- package/server/dist/server/data/departure-filters/types/custom.js.map +1 -0
- package/server/dist/server/data/departure-filters/types/line-tag.d.ts +6 -0
- package/server/dist/server/data/departure-filters/types/line-tag.js +17 -0
- package/server/dist/server/data/departure-filters/types/line-tag.js.map +1 -0
- package/server/dist/server/data/departure-filters/types/line.d.ts +6 -0
- package/server/dist/server/data/departure-filters/types/line.js +14 -0
- package/server/dist/server/data/departure-filters/types/line.js.map +1 -0
- package/server/dist/server/data/departure-filters/types/position.d.ts +6 -0
- package/server/dist/server/data/departure-filters/types/position.js +14 -0
- package/server/dist/server/data/departure-filters/types/position.js.map +1 -0
- package/server/dist/server/data/departure-filters/types/service-tag.d.ts +6 -0
- package/server/dist/server/data/departure-filters/types/service-tag.js +14 -0
- package/server/dist/server/data/departure-filters/types/service-tag.js.map +1 -0
- package/server/dist/server/data/departure-filters/types/set-down-only.d.ts +6 -0
- package/server/dist/server/data/departure-filters/types/set-down-only.js +12 -0
- package/server/dist/server/data/departure-filters/types/set-down-only.js.map +1 -0
- package/server/dist/server/data/index.d.ts +1 -0
- package/server/dist/server/data/index.js +1 -0
- package/server/dist/server/data/index.js.map +1 -1
- package/server/dist/server/data/stop-collection.d.ts +2 -2
- package/server/dist/server/data/stop-collection.js +2 -2
- package/server/dist/server/data/stop-collection.js.map +1 -1
- package/server/dist/server/data/stop-default-departure-feed.d.ts +15 -0
- package/server/dist/server/data/stop-default-departure-feed.js +21 -0
- package/server/dist/server/data/stop-default-departure-feed.js.map +1 -0
- package/server/dist/server/data/stop-departure-filters.d.ts +39 -0
- package/server/dist/server/data/stop-departure-filters.js +63 -0
- package/server/dist/server/data/stop-departure-filters.js.map +1 -0
- package/server/dist/server/data/stop-position.d.ts +13 -0
- package/server/dist/server/data/stop-position.js +18 -0
- package/server/dist/server/data/stop-position.js.map +1 -0
- package/server/dist/server/data/stop.d.ts +11 -2
- package/server/dist/server/data/stop.js +17 -1
- package/server/dist/server/data/stop.js.map +1 -1
- package/server/dist/shared/apis/departures/v0/departure.d.ts +19 -0
- package/server/dist/shared/apis/departures/v0/departure.js +48 -0
- package/server/dist/shared/apis/departures/v0/departure.js.map +1 -0
- package/server/dist/shared/apis/departures/v0/feed.d.ts +10 -0
- package/server/dist/shared/apis/departures/v0/feed.js +15 -0
- package/server/dist/shared/apis/departures/v0/feed.js.map +1 -0
- package/server/dist/shared/apis/departures/v0/index.d.ts +33 -18
- package/server/dist/shared/apis/departures/v0/index.js +12 -68
- package/server/dist/shared/apis/departures/v0/index.js.map +1 -1
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.d.ts +42 -0
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.js +42 -28
- 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 +21 -0
- package/server/dist/shared/data/departure-filter-expression.d.ts +16 -0
- package/server/dist/shared/data/departure-filter-expression.js +82 -0
- package/server/dist/shared/data/departure-filter-expression.js.map +1 -0
- package/web/dist/assets/{About-DGmg1TM-.js → About-BdSlO-kD.js} +1 -1
- package/web/dist/assets/{AdminControls-T05hoDB-.js → AdminControls-DJo59RGN.js} +1 -1
- package/web/dist/assets/{Alert-DfpdtaOB.js → Alert-SQhECZag.js} +1 -1
- package/web/dist/assets/{Debug-Q4Vy4lZ_.js → Debug-5P9iSK2l.js} +1 -1
- package/web/dist/assets/{Home-C6T20k8G.js → Home-hrGQ5RvQ.js} +1 -1
- package/web/dist/assets/{Line-6nd7KD0E.js → Line-ClqpaOxi.js} +1 -1
- package/web/dist/assets/NotFound-D-nyY3X1.js +1 -0
- package/web/dist/assets/{NotFoundPage-UhXr10a9.js → NotFoundPage-qJ2To3wC.js} +1 -1
- package/web/dist/assets/{Picker-D-TjVZAI.js → Picker-di2TPJNV.js} +1 -1
- package/web/dist/assets/{Service-CkHxNopv.js → Service-CjcKHFQZ.js} +1 -1
- package/web/dist/assets/{Settings-Ccrmh7u8.js → Settings-Clz1x2Cr.js} +1 -1
- package/web/dist/assets/{SimpleMobileHeaderContent-Ja68XAJd.js → SimpleMobileHeaderContent-DJTkr_6C.js} +1 -1
- package/web/dist/assets/{Status-CO5w5a1E.js → Status-Bw3AMuJH.js} +1 -1
- package/web/dist/assets/Stop-hkgAICn9.js +1 -0
- package/web/dist/assets/{ZenMode-C3S7FmYt.js → ZenMode-CXXD5IBd.js} +1 -1
- package/web/dist/assets/index-DOvczcZF.js +2 -0
- package/web/dist/assets/{linear-CtNhjlrM.js → linear-BiU4teCm.js} +1 -1
- package/web/dist/assets/{use-api-BJomuYg6.js → use-api-Ft007Dfs.js} +1 -1
- package/web/dist/assets/{use-foda-synced-query-BM-OPAql.js → use-foda-synced-query-hrC70vJ_.js} +1 -1
- package/web/dist/assets/{use-simple-headers-Cbv0t_De.js → use-simple-headers-DM6VutL0.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/sw.js +1 -1
- package/server/dist/server/config/types/get-canonical-lines-serving-stop-config-func.js +0 -2
- package/server/dist/server/config/types/get-canonical-lines-serving-stop-config-func.js.map +0 -1
- package/web/dist/assets/NotFound-BozS7u6u.js +0 -1
- package/web/dist/assets/Stop-BWZOcpvU.js +0 -1
- package/web/dist/assets/index-CrhwkQ9k.js +0 -2
- /package/server/dist/server/config/types/{get-canonical-lines-serving-stop-config-func.d.ts → get-canonical-lines-serving-stop-config.d.ts} +0 -0
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import type { StopConfig, TagSuccessionConfig } from "../config/index.js";
|
|
1
|
+
import type { StopDefaultDepartureFeedsConfig, StopDepartureFiltersConfig, StopConfig, TagSuccessionConfig } from "../config/index.js";
|
|
2
2
|
import { Tags } from "./tags.js";
|
|
3
3
|
import { Location } from "./location.js";
|
|
4
|
+
import { StopDefaultDepartureFeed } from "./stop-default-departure-feed.js";
|
|
5
|
+
import { StopDepartureFilters } from "./stop-departure-filters.js";
|
|
6
|
+
import { StopPosition } from "./stop-position.js";
|
|
4
7
|
type StopFields = {
|
|
5
8
|
readonly id: number;
|
|
6
9
|
readonly name: string;
|
|
7
10
|
readonly tags: Tags;
|
|
8
11
|
readonly urlPath: string;
|
|
9
12
|
readonly location: Location | null;
|
|
13
|
+
readonly positions: readonly StopPosition[];
|
|
10
14
|
readonly canonicalLinesServingStop: readonly number[];
|
|
15
|
+
readonly departureFilters: StopDepartureFilters;
|
|
16
|
+
readonly defaultDepartureFeeds: readonly StopDefaultDepartureFeed[];
|
|
11
17
|
};
|
|
12
18
|
export declare class Stop {
|
|
13
19
|
readonly id: number;
|
|
@@ -15,9 +21,12 @@ export declare class Stop {
|
|
|
15
21
|
readonly tags: Tags;
|
|
16
22
|
readonly urlPath: string;
|
|
17
23
|
readonly location: Location | null;
|
|
24
|
+
readonly positions: readonly StopPosition[];
|
|
18
25
|
readonly canonicalLinesServingStop: readonly number[];
|
|
26
|
+
readonly departureFilters: StopDepartureFilters;
|
|
27
|
+
readonly defaultDepartureFeeds: readonly StopDefaultDepartureFeed[];
|
|
19
28
|
constructor(fields: StopFields);
|
|
20
|
-
static build(stopConfig: StopConfig, stopTagSuccession: TagSuccessionConfig, canonicalLinesServingStop: readonly number[]): Stop;
|
|
29
|
+
static build(stopConfig: StopConfig, stopTagSuccession: TagSuccessionConfig, canonicalLinesServingStop: readonly number[], departureFilters: StopDepartureFiltersConfig, defaultDepartureFeeds: StopDefaultDepartureFeedsConfig): Stop;
|
|
21
30
|
with(newValues: Partial<StopFields>): Stop;
|
|
22
31
|
/** e.g. `"Sandringham" (#1)` */
|
|
23
32
|
get debugName(): string;
|
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
import { Tags } from "./tags.js";
|
|
2
2
|
import { Location } from "./location.js";
|
|
3
|
+
import { StopDefaultDepartureFeed } from "./stop-default-departure-feed.js";
|
|
4
|
+
import { StopDepartureFilters } from "./stop-departure-filters.js";
|
|
5
|
+
import { StopPosition } from "./stop-position.js";
|
|
3
6
|
export class Stop {
|
|
4
7
|
id;
|
|
5
8
|
name;
|
|
6
9
|
tags;
|
|
7
10
|
urlPath;
|
|
8
11
|
location;
|
|
12
|
+
positions;
|
|
9
13
|
canonicalLinesServingStop;
|
|
14
|
+
departureFilters;
|
|
15
|
+
defaultDepartureFeeds;
|
|
10
16
|
constructor(fields) {
|
|
11
17
|
this.id = fields.id;
|
|
12
18
|
this.name = fields.name;
|
|
13
19
|
this.tags = fields.tags;
|
|
14
20
|
this.urlPath = fields.urlPath;
|
|
15
21
|
this.location = fields.location;
|
|
22
|
+
this.positions = fields.positions;
|
|
16
23
|
this.canonicalLinesServingStop = fields.canonicalLinesServingStop;
|
|
24
|
+
this.departureFilters = fields.departureFilters;
|
|
25
|
+
this.defaultDepartureFeeds = fields.defaultDepartureFeeds;
|
|
17
26
|
}
|
|
18
|
-
static build(stopConfig, stopTagSuccession, canonicalLinesServingStop) {
|
|
27
|
+
static build(stopConfig, stopTagSuccession, canonicalLinesServingStop, departureFilters, defaultDepartureFeeds) {
|
|
28
|
+
if (defaultDepartureFeeds.length === 0) {
|
|
29
|
+
throw new Error(`Stop #${stopConfig.id} has no default departure feeds.`);
|
|
30
|
+
}
|
|
31
|
+
const positions = StopPosition.buildAll(stopConfig.positions);
|
|
19
32
|
return new Stop({
|
|
20
33
|
id: stopConfig.id,
|
|
21
34
|
name: stopConfig.name,
|
|
22
35
|
tags: Tags.build(stopConfig.tags, stopTagSuccession),
|
|
23
36
|
urlPath: stopConfig.urlPath,
|
|
24
37
|
location: Location.buildIfPresent(stopConfig.location),
|
|
38
|
+
positions: positions,
|
|
25
39
|
canonicalLinesServingStop,
|
|
40
|
+
departureFilters: StopDepartureFilters.build(departureFilters, canonicalLinesServingStop, positions),
|
|
41
|
+
defaultDepartureFeeds: StopDefaultDepartureFeed.buildAll(defaultDepartureFeeds),
|
|
26
42
|
});
|
|
27
43
|
}
|
|
28
44
|
with(newValues) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../../data/stop.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../../data/stop.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAg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AAE,iBAAiB,CAAC;YACpD,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;YACtD,SAAS,EAAE,SAAS;YAEpB,yBAAyB;YACzB,gBAAgB,EAAE,oBAAoB,CAAC,KAAK,CAC1C,gBAAgB,EAChB,yBAAyB,EACzB,SAAS,CACV;YACD,qBAAqB,EAAE,wBAAwB,CAAC,QAAQ,CACtD,qBAAqB,CACtB;SACF,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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const departureSchema: z.ZodObject<{
|
|
3
|
+
sourceId: z.ZodString;
|
|
4
|
+
intrasourceId: z.ZodString;
|
|
5
|
+
primaryDestinationText: z.ZodString;
|
|
6
|
+
secondaryDestinationText: z.ZodNullable<z.ZodString>;
|
|
7
|
+
lineIds: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
8
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
9
|
+
lightModeHexCode: z.ZodString;
|
|
10
|
+
darkModeHexCode: z.ZodString;
|
|
11
|
+
}, z.z.core.$strip>>;
|
|
12
|
+
isCancelled: z.ZodBoolean;
|
|
13
|
+
movement: z.ZodObject<{
|
|
14
|
+
index: z.ZodNumber;
|
|
15
|
+
positionId: z.ZodNullable<z.ZodNumber>;
|
|
16
|
+
time: z.ZodString;
|
|
17
|
+
formerTime: z.ZodNullable<z.ZodString>;
|
|
18
|
+
}, z.z.core.$strip>;
|
|
19
|
+
}, z.z.core.$strip>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export const departureSchema = z.object({
|
|
3
|
+
sourceId: z.string(),
|
|
4
|
+
intrasourceId: z.string(),
|
|
5
|
+
// TODO: Possibly we should calculate these on the frontend, and just pass
|
|
6
|
+
// stop IDs for the destination and stopping pattern array (with an
|
|
7
|
+
// `isServicing` flag for each entry) for the v1 API.
|
|
8
|
+
//
|
|
9
|
+
// We shouldn't just use `stoppingPatternText`, because I could see
|
|
10
|
+
// different users wanting to configure what's shown, e.g. "just list all
|
|
11
|
+
// stops", and Zen mode, which probably re-uses this API, wants to list
|
|
12
|
+
// all stops rather than using "express between X and Y" text.
|
|
13
|
+
//
|
|
14
|
+
// The only complicating factor is how to deal with the fact that
|
|
15
|
+
// sometimes the destination is not from the "current service" we give
|
|
16
|
+
// sourceId/intrasourceId for, but from a future connecting service, e.g.
|
|
17
|
+
// "Watergardens" when viewing citybound departures at Clayton, so we need
|
|
18
|
+
// to find naming for that array that makes it clear that it's all the
|
|
19
|
+
// movements for the same vehicle, until we see a servicing movement at a
|
|
20
|
+
// stop which was already serviced. Once we find that repeated servicing
|
|
21
|
+
// movement, we trim the array to end at the previous servicing movement.
|
|
22
|
+
// What do we call that array?
|
|
23
|
+
//
|
|
24
|
+
// I also don't have a solution in mind for the secondary destination
|
|
25
|
+
// text. If the frontend is expected to calculate it, then my current idea
|
|
26
|
+
// to allow the consumer to configure arbitrary functions returning a
|
|
27
|
+
// `string | null` for a given stop array won't work. I'll need something
|
|
28
|
+
// a little more codified.
|
|
29
|
+
primaryDestinationText: z.string(),
|
|
30
|
+
secondaryDestinationText: z.string().nullable(),
|
|
31
|
+
lineIds: z.number().array().readonly(),
|
|
32
|
+
color: z
|
|
33
|
+
.object({
|
|
34
|
+
lightModeHexCode: z.string(),
|
|
35
|
+
darkModeHexCode: z.string(),
|
|
36
|
+
})
|
|
37
|
+
.nullable(),
|
|
38
|
+
isCancelled: z.boolean(),
|
|
39
|
+
movement: z.object({
|
|
40
|
+
// So that it can link to a service page.
|
|
41
|
+
index: z.number(),
|
|
42
|
+
positionId: z.number().nullable(),
|
|
43
|
+
// "time" not "departureTime", as for arrivals it'll be the arrival time.
|
|
44
|
+
time: z.string(),
|
|
45
|
+
formerTime: z.string().nullable(),
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=departure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"departure.js","sourceRoot":"","sources":["../../../../../../shared/apis/departures/v0/departure.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IAEzB,0EAA0E;IAC1E,mEAAmE;IACnE,qDAAqD;IACrD,EAAE;IACF,mEAAmE;IACnE,yEAAyE;IACzE,uEAAuE;IACvE,8DAA8D;IAC9D,EAAE;IACF,iEAAiE;IACjE,sEAAsE;IACtE,yEAAyE;IACzE,0EAA0E;IAC1E,sEAAsE;IACtE,yEAAyE;IACzE,wEAAwE;IACxE,yEAAyE;IACzE,8BAA8B;IAC9B,EAAE;IACF,qEAAqE;IACrE,0EAA0E;IAC1E,qEAAqE;IACrE,yEAAyE;IACzE,0BAA0B;IAC1B,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE;IAClC,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE/C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;QAC5B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;KAC5B,CAAC;SACD,QAAQ,EAAE;IAEb,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;IAExB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,yCAAyC;QACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QAEjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAEjC,yEAAyE;QACzE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const feedSchema: z.ZodObject<{
|
|
3
|
+
stopId: z.ZodNumber;
|
|
4
|
+
desiredCount: z.ZodNumber;
|
|
5
|
+
filterExpression: z.ZodString;
|
|
6
|
+
skips: z.ZodArray<z.ZodObject<{
|
|
7
|
+
sourceId: z.ZodString;
|
|
8
|
+
intrasourceId: z.ZodString;
|
|
9
|
+
}, z.z.core.$strip>>;
|
|
10
|
+
}, z.z.core.$strip>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export const feedSchema = z.object({
|
|
3
|
+
stopId: z.number(),
|
|
4
|
+
desiredCount: z.number(),
|
|
5
|
+
filterExpression: z.string(),
|
|
6
|
+
// Will be required for infinite scrolling, as two departures can have the
|
|
7
|
+
// same time.
|
|
8
|
+
skips: z
|
|
9
|
+
.object({
|
|
10
|
+
sourceId: z.string(),
|
|
11
|
+
intrasourceId: z.string(),
|
|
12
|
+
})
|
|
13
|
+
.array(),
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=feed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feed.js","sourceRoot":"","sources":["../../../../../../shared/apis/departures/v0/feed.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAE5B,0EAA0E;IAC1E,aAAa;IACb,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;KAC1B,CAAC;SACD,KAAK,EAAE;CACX,CAAC,CAAC"}
|
|
@@ -1,30 +1,45 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import type { Api } from "../../types.js";
|
|
3
3
|
declare const argsSchema: z.ZodObject<{
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
instant: z.ZodString;
|
|
5
|
+
direction: z.ZodEnum<{
|
|
6
|
+
forwards: "forwards";
|
|
7
|
+
backwards: "backwards";
|
|
8
|
+
}>;
|
|
9
|
+
feeds: z.ZodArray<z.ZodObject<{
|
|
10
|
+
stopId: z.ZodNumber;
|
|
11
|
+
desiredCount: z.ZodNumber;
|
|
12
|
+
filterExpression: z.ZodString;
|
|
13
|
+
skips: z.ZodArray<z.ZodObject<{
|
|
14
|
+
sourceId: z.ZodString;
|
|
15
|
+
intrasourceId: z.ZodString;
|
|
16
|
+
}, z.z.core.$strip>>;
|
|
17
|
+
}, z.z.core.$strip>>;
|
|
6
18
|
}, z.z.core.$strip>;
|
|
7
19
|
declare const resultSchema: z.ZodObject<{
|
|
8
20
|
foundationalDataHash: z.ZodString;
|
|
9
21
|
innerResult: z.ZodObject<{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
feeds: z.ZodArray<z.ZodObject<{
|
|
23
|
+
departures: z.ZodArray<z.ZodObject<{
|
|
24
|
+
sourceId: z.ZodString;
|
|
25
|
+
intrasourceId: z.ZodString;
|
|
26
|
+
primaryDestinationText: z.ZodString;
|
|
27
|
+
secondaryDestinationText: z.ZodNullable<z.ZodString>;
|
|
28
|
+
lineIds: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
29
|
+
color: z.ZodNullable<z.ZodObject<{
|
|
30
|
+
lightModeHexCode: z.ZodString;
|
|
31
|
+
darkModeHexCode: z.ZodString;
|
|
32
|
+
}, z.z.core.$strip>>;
|
|
33
|
+
isCancelled: z.ZodBoolean;
|
|
34
|
+
movement: z.ZodObject<{
|
|
35
|
+
index: z.ZodNumber;
|
|
36
|
+
positionId: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
time: z.ZodString;
|
|
38
|
+
formerTime: z.ZodNullable<z.ZodString>;
|
|
39
|
+
}, z.z.core.$strip>;
|
|
19
40
|
}, 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>;
|
|
27
41
|
}, z.z.core.$strip>>;
|
|
42
|
+
invalidFilterTokens: z.ZodArray<z.ZodString>;
|
|
28
43
|
}, z.z.core.$strip>;
|
|
29
44
|
}, z.z.core.$strip>;
|
|
30
45
|
export declare const api: Api<typeof argsSchema, typeof resultSchema>;
|
|
@@ -1,79 +1,23 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import { createFodaSyncedResultSchema } from "../../foda-synced-result.js";
|
|
3
|
+
import { departureSchema } from "./departure.js";
|
|
4
|
+
import { feedSchema } from "./feed.js";
|
|
3
5
|
// NOTE: This is a "v0" API, i.e. its not intended to be used by anyone except
|
|
4
6
|
// me, during the "beta" phase. When we switch to "v1" it'll break compatibility
|
|
5
7
|
// with frontends that only understand the v0 API, and that's A-OK.
|
|
6
8
|
const argsSchema = z.object({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// need an array of these arguments! The result needs to be an array too, to
|
|
11
|
-
// compensate.
|
|
12
|
-
//
|
|
13
|
-
// Other things the real v1 API should have:
|
|
14
|
-
//
|
|
15
|
-
// instant: z.string(),
|
|
16
|
-
// direction: z.enum(["forwards", "backwards"]),
|
|
17
|
-
// filters: z.string().array(),
|
|
18
|
-
//
|
|
19
|
-
// // Will be required for infinite scrolling, as two departures can have
|
|
20
|
-
// // the same time.
|
|
21
|
-
// skip: z
|
|
22
|
-
// .object({
|
|
23
|
-
// sourceId: z.string(),
|
|
24
|
-
// intrasourceId: z.string(),
|
|
25
|
-
// })
|
|
26
|
-
// .array(),
|
|
9
|
+
instant: z.string(),
|
|
10
|
+
direction: z.enum(["forwards", "backwards"]),
|
|
11
|
+
feeds: feedSchema.array(),
|
|
27
12
|
});
|
|
28
13
|
const resultSchema = createFodaSyncedResultSchema(z.object({
|
|
29
|
-
departures:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
// We shouldn't just use `stoppingPatternText`, because I could see
|
|
38
|
-
// different users wanting to configure what's shown, e.g. "just list all
|
|
39
|
-
// stops", and Zen mode, which probably re-uses this API, wants to list
|
|
40
|
-
// all stops rather than using "express between X and Y" text.
|
|
41
|
-
//
|
|
42
|
-
// The only complicating factor is how to deal with the fact that
|
|
43
|
-
// sometimes the destination is not from the "current service" we give
|
|
44
|
-
// sourceId/intrasourceId for, but from a future connecting service, e.g.
|
|
45
|
-
// "Watergardens" when viewing citybound departures at Clayton, so we need
|
|
46
|
-
// to find naming for that array that makes it clear that it's all the
|
|
47
|
-
// movements for the same vehicle, until we see a servicing movement at a
|
|
48
|
-
// stop which was already serviced. Once we find that repeated servicing
|
|
49
|
-
// movement, we trim the array to end at the previous servicing movement.
|
|
50
|
-
// What do we call that array?
|
|
51
|
-
//
|
|
52
|
-
// I also don't have a solution in mind for the secondary destination
|
|
53
|
-
// text. If the frontend is expected to calculate it, then my current idea
|
|
54
|
-
// to allow the consumer to configure arbitrary functions returning a
|
|
55
|
-
// `string | null` for a given stop array won't work. I'll need something
|
|
56
|
-
// a little more codified.
|
|
57
|
-
primaryDestinationText: z.string(),
|
|
58
|
-
secondaryDestinationText: z.string().nullable(),
|
|
59
|
-
lineIds: z.number().array().readonly(),
|
|
60
|
-
color: z
|
|
61
|
-
.object({
|
|
62
|
-
lightModeHexCode: z.string(),
|
|
63
|
-
darkModeHexCode: z.string(),
|
|
64
|
-
})
|
|
65
|
-
.nullable(),
|
|
66
|
-
isCancelled: z.boolean(),
|
|
67
|
-
movement: z.object({
|
|
68
|
-
// So that it can link to a service page.
|
|
69
|
-
index: z.number(),
|
|
70
|
-
positionId: z.number().nullable(),
|
|
71
|
-
// "time" not "departureTime", as for arrivals it'll be the arrival time.
|
|
72
|
-
time: z.string(),
|
|
73
|
-
formerTime: z.string().nullable(),
|
|
74
|
-
}),
|
|
75
|
-
})
|
|
76
|
-
.array(),
|
|
14
|
+
feeds: z.object({ departures: departureSchema.array() }).array(),
|
|
15
|
+
// If the client calls the departures API when its FODA is outdated, it
|
|
16
|
+
// might include filter tokens that aren't valid, e.g. `stops-at:123` after
|
|
17
|
+
// stop #123 is gone. In that case, the server will pretend the invalid
|
|
18
|
+
// tokens don't exist, and return them here so the frontend knows to show a
|
|
19
|
+
// toast saying the filters were modified, or whatever.
|
|
20
|
+
invalidFilterTokens: z.string().array(),
|
|
77
21
|
}));
|
|
78
22
|
export const api = {
|
|
79
23
|
path: "/departures/v0",
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,8EAA8E;AAC9E,gFAAgF;AAChF,mEAAmE;AAEnE,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAE5C,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,4BAA4B,CAC/C,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE;IAEhE,uEAAuE;IACvE,2EAA2E;IAC3E,uEAAuE;IACvE,2EAA2E;IAC3E,uDAAuD;IACvD,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;CACxC,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAgD;IAC9D,IAAI,EAAE,gBAAgB;IACtB,UAAU;IACV,YAAY;CACb,CAAC"}
|
|
@@ -4,10 +4,31 @@ export declare const stopFodaSchema: z.ZodObject<{
|
|
|
4
4
|
name: z.ZodString;
|
|
5
5
|
urlPath: z.ZodString;
|
|
6
6
|
canonicalLinesServingStop: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
7
|
+
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodNumber;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
}, z.z.core.$strip>>>;
|
|
7
11
|
location: z.ZodNullable<z.ZodObject<{
|
|
8
12
|
latitude: z.ZodNumber;
|
|
9
13
|
longitude: z.ZodNumber;
|
|
10
14
|
}, z.z.core.$strip>>;
|
|
15
|
+
defaultDepartureFeeds: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
desiredCount: z.ZodNumber;
|
|
18
|
+
filterExpression: z.ZodString;
|
|
19
|
+
}, z.z.core.$strip>>>;
|
|
20
|
+
departureFilters: z.ZodObject<{
|
|
21
|
+
lines: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
22
|
+
positions: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
23
|
+
customGroups: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
24
|
+
label: z.ZodString;
|
|
25
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
labelWithinGroup: z.ZodString;
|
|
28
|
+
filterExpression: z.ZodString;
|
|
29
|
+
}, z.z.core.$strip>>>;
|
|
30
|
+
}, z.z.core.$strip>>>;
|
|
31
|
+
}, z.z.core.$strip>;
|
|
11
32
|
}, z.z.core.$strip>;
|
|
12
33
|
export declare const lineDiagramStopFodaSchema: z.ZodObject<{
|
|
13
34
|
stopId: z.ZodNumber;
|
|
@@ -261,10 +282,31 @@ export declare const fodaSchema: z.ZodObject<{
|
|
|
261
282
|
name: z.ZodString;
|
|
262
283
|
urlPath: z.ZodString;
|
|
263
284
|
canonicalLinesServingStop: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
285
|
+
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
286
|
+
id: z.ZodNumber;
|
|
287
|
+
name: z.ZodString;
|
|
288
|
+
}, z.z.core.$strip>>>;
|
|
264
289
|
location: z.ZodNullable<z.ZodObject<{
|
|
265
290
|
latitude: z.ZodNumber;
|
|
266
291
|
longitude: z.ZodNumber;
|
|
267
292
|
}, z.z.core.$strip>>;
|
|
293
|
+
defaultDepartureFeeds: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
294
|
+
name: z.ZodString;
|
|
295
|
+
desiredCount: z.ZodNumber;
|
|
296
|
+
filterExpression: z.ZodString;
|
|
297
|
+
}, z.z.core.$strip>>>;
|
|
298
|
+
departureFilters: z.ZodObject<{
|
|
299
|
+
lines: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
300
|
+
positions: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
301
|
+
customGroups: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
302
|
+
label: z.ZodString;
|
|
303
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
304
|
+
name: z.ZodString;
|
|
305
|
+
labelWithinGroup: z.ZodString;
|
|
306
|
+
filterExpression: z.ZodString;
|
|
307
|
+
}, z.z.core.$strip>>>;
|
|
308
|
+
}, z.z.core.$strip>>>;
|
|
309
|
+
}, z.z.core.$strip>;
|
|
268
310
|
}, z.z.core.$strip>>>;
|
|
269
311
|
lines: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
270
312
|
id: z.ZodNumber;
|
|
@@ -7,13 +7,6 @@ import z from "zod";
|
|
|
7
7
|
// isn't necessarily a good idea anyway, since old versions of these schemas
|
|
8
8
|
// need to stick around for the server to continue using.
|
|
9
9
|
//
|
|
10
|
-
// NOTE: Despite these schemas living inside `apis/foundational-data/v1`,
|
|
11
|
-
// they'll be reused in a lot of APIs, due to the force update mechanism. When a
|
|
12
|
-
// breaking change occurs to the foundational data, it causes a breaking change
|
|
13
|
-
// to all those APIs too. E.g. we might have `/depatures/v2` API serving this V1
|
|
14
|
-
// version of the foundational data, and `/departures/v3` serving a V2 version
|
|
15
|
-
// of the foundational data.
|
|
16
|
-
//
|
|
17
10
|
// The class in /web that wraps these schemas and provides helper methods should
|
|
18
11
|
// hopefully be the only touch-point in the frontend for these schemas, so when
|
|
19
12
|
// a new version happens, there shouldn't be a million places to change. Only
|
|
@@ -34,30 +27,51 @@ export const stopFodaSchema = z.object({
|
|
|
34
27
|
name: z.string(),
|
|
35
28
|
urlPath: z.string(),
|
|
36
29
|
canonicalLinesServingStop: z.number().array().readonly(),
|
|
30
|
+
positions: z
|
|
31
|
+
.object({
|
|
32
|
+
id: z.number(),
|
|
33
|
+
name: z.string(),
|
|
34
|
+
})
|
|
35
|
+
.array()
|
|
36
|
+
.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
39
|
location: locationFodaSchema.nullable(),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
40
|
+
defaultDepartureFeeds: z
|
|
41
|
+
.object({
|
|
42
|
+
name: z.string(),
|
|
43
|
+
desiredCount: z.number(),
|
|
44
|
+
filterExpression: z.string(),
|
|
45
|
+
})
|
|
46
|
+
.array()
|
|
47
|
+
.readonly(),
|
|
48
|
+
departureFilters: z.object({
|
|
49
|
+
lines: z.number().array().readonly(),
|
|
50
|
+
positions: z.number().array().readonly(),
|
|
51
|
+
// Note that custom filter are given as a list of groups. Grouped filters:
|
|
52
|
+
//
|
|
53
|
+
// - Display together under a shared heading in the filters popover.
|
|
54
|
+
//
|
|
55
|
+
// - Logically OR instead of AND, meaning if two from the same group are
|
|
56
|
+
// selected, they'll be sent to the departures query as `a|b` instead of
|
|
57
|
+
// `a b`. We can allow arbitrary filter expressions to be combined, as
|
|
58
|
+
// every boolean expressions can be converted to conjunctive normal form,
|
|
59
|
+
// which is what the server supports, e.g. `(a b)|c` = `a|c b|c`.
|
|
60
|
+
customGroups: z
|
|
61
|
+
.object({
|
|
62
|
+
label: z.string(), // "By platform"
|
|
63
|
+
items: z
|
|
64
|
+
.object({
|
|
65
|
+
name: z.string(), // "Platform 1"
|
|
66
|
+
labelWithinGroup: z.string(), // "1"
|
|
67
|
+
filterExpression: z.string(), // "position:51"
|
|
68
|
+
})
|
|
69
|
+
.array()
|
|
70
|
+
.readonly(),
|
|
71
|
+
})
|
|
72
|
+
.array()
|
|
73
|
+
.readonly(),
|
|
74
|
+
}),
|
|
61
75
|
});
|
|
62
76
|
export const lineDiagramStopFodaSchema = z.object({
|
|
63
77
|
stopId: z.number(),
|
|
@@ -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,
|
|
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,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,kBAAkB;AAElB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,MA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C,MAAM,CAAC;IAChC,6EAA6E;IAC7E,uEAAuE;IACvE,4EAA4E;IAC5E,6EAA6E;IAC7E,sBAAsB;IACtB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,cAAc,EAAE,CAAC,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"}
|
|
@@ -16,10 +16,31 @@ declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
16
16
|
name: z.ZodString;
|
|
17
17
|
urlPath: z.ZodString;
|
|
18
18
|
canonicalLinesServingStop: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
19
|
+
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
20
|
+
id: z.ZodNumber;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
}, z.z.core.$strip>>>;
|
|
19
23
|
location: z.ZodNullable<z.ZodObject<{
|
|
20
24
|
latitude: z.ZodNumber;
|
|
21
25
|
longitude: z.ZodNumber;
|
|
22
26
|
}, z.z.core.$strip>>;
|
|
27
|
+
defaultDepartureFeeds: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
desiredCount: z.ZodNumber;
|
|
30
|
+
filterExpression: z.ZodString;
|
|
31
|
+
}, z.z.core.$strip>>>;
|
|
32
|
+
departureFilters: z.ZodObject<{
|
|
33
|
+
lines: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
34
|
+
positions: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
35
|
+
customGroups: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
36
|
+
label: z.ZodString;
|
|
37
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
labelWithinGroup: z.ZodString;
|
|
40
|
+
filterExpression: z.ZodString;
|
|
41
|
+
}, z.z.core.$strip>>>;
|
|
42
|
+
}, z.z.core.$strip>>>;
|
|
43
|
+
}, z.z.core.$strip>;
|
|
23
44
|
}, z.z.core.$strip>>>;
|
|
24
45
|
lines: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
25
46
|
id: z.ZodNumber;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class DepartureFilterExpression {
|
|
2
|
+
readonly disjunctions: readonly (readonly DepartureFilterToken[])[];
|
|
3
|
+
constructor(disjunctions: readonly (readonly DepartureFilterToken[])[]);
|
|
4
|
+
static parse(input: string): DepartureFilterExpression | null;
|
|
5
|
+
toString(): string;
|
|
6
|
+
}
|
|
7
|
+
export declare class DepartureFilterToken {
|
|
8
|
+
readonly prefix: string;
|
|
9
|
+
readonly args: string | null;
|
|
10
|
+
readonly negated: boolean;
|
|
11
|
+
private constructor();
|
|
12
|
+
static create(prefix: string, args: string | null, negated: boolean): DepartureFilterToken;
|
|
13
|
+
static parse(input: string): DepartureFilterToken | null;
|
|
14
|
+
static isValidPrefix(prefix: string): boolean;
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|