corequery-gtfs 2.0.2 → 3.0.1
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/README.md +67 -2
- package/dist/config/apply-service-tag-succession.d.ts +1 -0
- package/dist/config/apply-service-tag-succession.js +2 -0
- package/dist/config/apply-service-tag-succession.js.map +1 -0
- package/dist/config/debug-contextualization-helpers.d.ts +4 -0
- package/dist/config/debug-contextualization-helpers.js +2 -0
- package/dist/config/debug-contextualization-helpers.js.map +1 -0
- package/dist/config/gtfs-config.d.ts +4 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -1
- package/dist/conversion/service-converter.js +14 -5
- package/dist/conversion/service-converter.js.map +1 -1
- package/dist/corequery-types.d.ts +58 -0
- package/dist/data/gtfs-realtime-transfer.d.ts +3 -1
- package/dist/data/gtfs-realtime-transfer.js +3 -1
- package/dist/data/gtfs-realtime-transfer.js.map +1 -1
- package/dist/data/route/line-routes-mapping.d.ts +3 -1
- package/dist/data/route/line-routes-mapping.js +5 -2
- package/dist/data/route/line-routes-mapping.js.map +1 -1
- package/dist/data/route/route.d.ts +2 -1
- package/dist/data/route/route.js +2 -2
- package/dist/data/route/route.js.map +1 -1
- package/dist/data/trip/added/gtfs-added-trip.d.ts +3 -0
- package/dist/data/trip/added/gtfs-added-trip.js +2 -0
- package/dist/data/trip/added/gtfs-added-trip.js.map +1 -1
- package/dist/data/trip/replaced/gtfs-replaced-trip.d.ts +3 -0
- package/dist/data/trip/replaced/gtfs-replaced-trip.js +2 -0
- package/dist/data/trip/replaced/gtfs-replaced-trip.js.map +1 -1
- package/dist/data/trip/updated/gtfs-updated-trip.d.ts +4 -0
- package/dist/data/trip/updated/gtfs-updated-trip.js +5 -0
- package/dist/data/trip/updated/gtfs-updated-trip.js.map +1 -1
- package/dist/debug-pages/debug-contextualization-helpers.d.ts +18 -0
- package/dist/debug-pages/debug-contextualization-helpers.js +37 -0
- package/dist/debug-pages/debug-contextualization-helpers.js.map +1 -0
- package/dist/debug-pages/debug-page-system.d.ts +14 -0
- package/dist/debug-pages/debug-page-system.js +48 -0
- package/dist/debug-pages/debug-page-system.js.map +1 -0
- package/dist/debug-pages/pages/debug-home-page.d.ts +11 -0
- package/dist/debug-pages/pages/debug-home-page.js +110 -0
- package/dist/debug-pages/pages/debug-home-page.js.map +1 -0
- package/dist/debug-pages/pages/debug-service-page.d.ts +25 -0
- package/dist/debug-pages/pages/debug-service-page.js +277 -0
- package/dist/debug-pages/pages/debug-service-page.js.map +1 -0
- package/dist/gtfs-service-source.d.ts +5 -1
- package/dist/gtfs-service-source.js +9 -0
- package/dist/gtfs-service-source.js.map +1 -1
- package/dist/gtfs-system.d.ts +8 -2
- package/dist/gtfs-system.js +31 -2
- package/dist/gtfs-system.js.map +1 -1
- package/dist/parser/error-types.d.ts +45 -0
- package/dist/parser/error-types.js +51 -7
- package/dist/parser/error-types.js.map +1 -1
- package/dist/parser/realtime/gtfs-realtime-data-parser.d.ts +1 -1
- package/dist/parser/realtime/gtfs-realtime-data-parser.js +16 -11
- package/dist/parser/realtime/gtfs-realtime-data-parser.js.map +1 -1
- package/dist/parser/realtime/gtfs-trip-update-parser.d.ts +1 -0
- package/dist/parser/realtime/gtfs-trip-update-parser.js +6 -0
- package/dist/parser/realtime/gtfs-trip-update-parser.js.map +1 -1
- package/dist/parser/realtime/gtfs-updated-trip-update-parser.d.ts +1 -0
- package/dist/parser/realtime/gtfs-updated-trip-update-parser.js +6 -1
- package/dist/parser/realtime/gtfs-updated-trip-update-parser.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gtfs-updated-trip.js","sourceRoot":"","sources":["../../../../src/data/trip/updated/gtfs-updated-trip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"gtfs-updated-trip.js","sourceRoot":"","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AAK,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,UAAU,CACf,IAAuB,EACvB,UAA8B,EAC9B,QAAgB;QAEhB,OAAO,IAAI,eAAe,CAAC;YACzB,aAAa,EAAE,IAAI;YACnB,UAAU;YACV,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAClC,CAAC,CAAC,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,CACpD;YACD,WAAW,EAAE,KAAK;SACnB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DebugContextualizationHelpersConfig } from "../config/debug-contextualization-helpers.js";
|
|
2
|
+
import type { TimezoneConfig } from "../config/timezone-config.js";
|
|
3
|
+
import type { StopGtfsIdMapping } from "../data/ids/stop-gtfs-id-mapping.js";
|
|
4
|
+
type DebugContextualizationHelpersFields = {
|
|
5
|
+
readonly config: DebugContextualizationHelpersConfig | null;
|
|
6
|
+
readonly timezoneConfig: TimezoneConfig;
|
|
7
|
+
readonly stopGtfsIdMapping: StopGtfsIdMapping;
|
|
8
|
+
};
|
|
9
|
+
export declare class DebugContextualizationHelpers {
|
|
10
|
+
private readonly _config;
|
|
11
|
+
private readonly _timezoneConfig;
|
|
12
|
+
private readonly _stopGtfsIdMapping;
|
|
13
|
+
constructor(fields: DebugContextualizationHelpersFields);
|
|
14
|
+
getGtfsIdContext(gtfsId: string): string;
|
|
15
|
+
formatGtfsTripUpdateTimestamp(timestamp: number): string;
|
|
16
|
+
formatInstant(instant: Temporal.Instant): string;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GtfsUpdatedTripUpdateParser } from "../parser/realtime/gtfs-updated-trip-update-parser.js";
|
|
2
|
+
export class DebugContextualizationHelpers {
|
|
3
|
+
_config;
|
|
4
|
+
_timezoneConfig;
|
|
5
|
+
_stopGtfsIdMapping;
|
|
6
|
+
constructor(fields) {
|
|
7
|
+
this._config = fields.config;
|
|
8
|
+
this._timezoneConfig = fields.timezoneConfig;
|
|
9
|
+
this._stopGtfsIdMapping = fields.stopGtfsIdMapping;
|
|
10
|
+
}
|
|
11
|
+
getGtfsIdContext(gtfsId) {
|
|
12
|
+
const result = this._stopGtfsIdMapping.tryResolve(gtfsId);
|
|
13
|
+
if (result == null)
|
|
14
|
+
return "Unmapped stop!";
|
|
15
|
+
const name = this._config?.getStopName?.(result.stopId) ?? null;
|
|
16
|
+
if (name == null)
|
|
17
|
+
return `Stop #${result.stopId}`;
|
|
18
|
+
if (result.type === "general")
|
|
19
|
+
return name;
|
|
20
|
+
const positionName = this._config?.getPositionName?.(result.stopId, result.positionId) ?? null;
|
|
21
|
+
if (positionName == null)
|
|
22
|
+
return `${name} (position #${result.positionId})`;
|
|
23
|
+
return `${name} (${positionName})`;
|
|
24
|
+
}
|
|
25
|
+
formatGtfsTripUpdateTimestamp(timestamp) {
|
|
26
|
+
const instant = GtfsUpdatedTripUpdateParser.parseInstantFromTimestamp(timestamp);
|
|
27
|
+
return this.formatInstant(instant);
|
|
28
|
+
}
|
|
29
|
+
formatInstant(instant) {
|
|
30
|
+
return instant.toLocaleString("en-US", {
|
|
31
|
+
timeStyle: "long",
|
|
32
|
+
dateStyle: "medium",
|
|
33
|
+
timeZone: this._timezoneConfig.timezone,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=debug-contextualization-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-contextualization-helpers.js","sourceRoot":"","sources":["../../src/debug-pages/debug-contextualization-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AAQpG,MAAM,OAAO,6BAA6B;IACvB,OAAO,CAA6C;IACpD,eAAe,CAAiB;IAChC,kBAAkB,CAAoB;IAEvD,YAAY,MAA2C;QACrD,IAAI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ACL,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DynamicPage, DynamicPageSystem } from "../corequery-types.js";
|
|
2
|
+
import type { GtfsSystem } from "../gtfs-system.js";
|
|
3
|
+
export declare class DebugPageSystem implements DynamicPageSystem {
|
|
4
|
+
private readonly _sourceId;
|
|
5
|
+
private readonly _sourceName;
|
|
6
|
+
private readonly _gtfsSystem;
|
|
7
|
+
static readonly HOME = "home";
|
|
8
|
+
static readonly SERVICE_PREFIX = "service-";
|
|
9
|
+
constructor(_sourceId: string, _sourceName: string, _gtfsSystem: GtfsSystem);
|
|
10
|
+
getPage(systemPath: string): Promise<DynamicPage | null>;
|
|
11
|
+
static getSystemPathForServiceDebugPage(intrasourceId: string): string;
|
|
12
|
+
private _getHomePage;
|
|
13
|
+
private _getServiceDebugPage;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CorequeryIntrasourceId } from "../conversion/corequery-intrasource-id.js";
|
|
2
|
+
import { DebugHomePage } from "./pages/debug-home-page.js";
|
|
3
|
+
import { DebugServicePage } from "./pages/debug-service-page.js";
|
|
4
|
+
export class DebugPageSystem {
|
|
5
|
+
_sourceId;
|
|
6
|
+
_sourceName;
|
|
7
|
+
_gtfsSystem;
|
|
8
|
+
static HOME = "home";
|
|
9
|
+
static SERVICE_PREFIX = "service-";
|
|
10
|
+
constructor(_sourceId, _sourceName, _gtfsSystem) {
|
|
11
|
+
this._sourceId = _sourceId;
|
|
12
|
+
this._sourceName = _sourceName;
|
|
13
|
+
this._gtfsSystem = _gtfsSystem;
|
|
14
|
+
}
|
|
15
|
+
async getPage(systemPath) {
|
|
16
|
+
if (systemPath === DebugPageSystem.HOME) {
|
|
17
|
+
return await this._getHomePage();
|
|
18
|
+
}
|
|
19
|
+
else if (systemPath.startsWith(DebugPageSystem.SERVICE_PREFIX)) {
|
|
20
|
+
const intrasourceId = systemPath.slice(DebugPageSystem.SERVICE_PREFIX.length);
|
|
21
|
+
return await this._getServiceDebugPage(intrasourceId);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
static getSystemPathForServiceDebugPage(intrasourceId) {
|
|
28
|
+
return `${DebugPageSystem.SERVICE_PREFIX}${intrasourceId}`;
|
|
29
|
+
}
|
|
30
|
+
async _getHomePage() {
|
|
31
|
+
const homePage = new DebugHomePage(this._sourceName, this._gtfsSystem);
|
|
32
|
+
return await homePage.render();
|
|
33
|
+
}
|
|
34
|
+
async _getServiceDebugPage(intrasourceId) {
|
|
35
|
+
const id = CorequeryIntrasourceId.parse(intrasourceId);
|
|
36
|
+
if (id == null)
|
|
37
|
+
return null;
|
|
38
|
+
const feed = this._gtfsSystem.getFeed();
|
|
39
|
+
if (feed == null)
|
|
40
|
+
return null;
|
|
41
|
+
const trip = feed.getTrip(id.gtfsTripId, id.serviceDay);
|
|
42
|
+
if (trip == null)
|
|
43
|
+
return null;
|
|
44
|
+
const servicePage = new DebugServicePage(trip, id.serviceDay, this._sourceId, this._gtfsSystem);
|
|
45
|
+
return await servicePage.render();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=debug-page-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-page-system.js","sourceRoot":"","sources":["../../src/debug-pages/debug-page-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAGnF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,OAAO,eAAe;IAKP;IACA;IACA;IANnB,MAAM,CAAU,IAAI,GAAG,MAAM,CAAC;IAC9B,MAAM,CAAU,cAAc,GAAG,UAAU,CAAC;IAE5C,YACmB,SAAiB,EACjB,WAAmB,EACnB,WAAuB;QAFvB,cAAS,GAAT,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AAI,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QAE9B,MAAM,WAAW,GAAG,IAAI,gBAAgB,CACtC,IAAI,EACJ,EAAE,CAAC,UAAU,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,WAAW,CACjB,CAAC;QACF,OAAO,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;IACpC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DynamicPage } from "../../corequery-types.js";
|
|
2
|
+
import type { GtfsSystem } from "../../gtfs-system.js";
|
|
3
|
+
export declare class DebugHomePage {
|
|
4
|
+
private readonly _sourceName;
|
|
5
|
+
private readonly _system;
|
|
6
|
+
constructor(_sourceName: string, _system: GtfsSystem);
|
|
7
|
+
render(): Promise<DynamicPage>;
|
|
8
|
+
private _getScheduledSection;
|
|
9
|
+
private _getRealtimeSection;
|
|
10
|
+
private _formatErrorCount;
|
|
11
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export class DebugHomePage {
|
|
2
|
+
_sourceName;
|
|
3
|
+
_system;
|
|
4
|
+
constructor(_sourceName, _system) {
|
|
5
|
+
this._sourceName = _sourceName;
|
|
6
|
+
this._system = _system;
|
|
7
|
+
}
|
|
8
|
+
async render() {
|
|
9
|
+
return Promise.resolve({
|
|
10
|
+
title: this._sourceName,
|
|
11
|
+
content: [this._getScheduledSection(), this._getRealtimeSection()],
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
_getScheduledSection() {
|
|
15
|
+
const scheduledParsingErrors = this._formatErrorCount(this._system.scheduleParsingErrors);
|
|
16
|
+
const parsedAtInstant = this._system.scheduledDataParsedAt;
|
|
17
|
+
const parsedAtStr = parsedAtInstant == null
|
|
18
|
+
? "Never"
|
|
19
|
+
: this._system.debugContextualizationHelpers.formatInstant(parsedAtInstant);
|
|
20
|
+
return {
|
|
21
|
+
type: "section",
|
|
22
|
+
title: "Schedule data",
|
|
23
|
+
content: [
|
|
24
|
+
{
|
|
25
|
+
type: "field-table",
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
key: "Parsed at",
|
|
29
|
+
value: parsedAtStr,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: "Parsing errors",
|
|
33
|
+
value: scheduledParsingErrors,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
// TODO: Implement these pages.
|
|
38
|
+
// {
|
|
39
|
+
// type: "button",
|
|
40
|
+
// text: "Parsing errors",
|
|
41
|
+
// link: {
|
|
42
|
+
// type: "system-path",
|
|
43
|
+
// systemPath: "schedule-parsing-errors",
|
|
44
|
+
// },
|
|
45
|
+
// },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
_getRealtimeSection() {
|
|
50
|
+
const realtimeParsingErrors = this._formatErrorCount(this._system.realtimeParsingErrors);
|
|
51
|
+
const parsedAtInstant = this._system.realtimeDataParsedAt;
|
|
52
|
+
const parsedAtStr = parsedAtInstant == null
|
|
53
|
+
? "Never"
|
|
54
|
+
: this._system.debugContextualizationHelpers.formatInstant(parsedAtInstant);
|
|
55
|
+
return {
|
|
56
|
+
type: "section",
|
|
57
|
+
title: "Realtime data",
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: "field-table",
|
|
61
|
+
fields: [
|
|
62
|
+
{
|
|
63
|
+
key: "Parsed at",
|
|
64
|
+
value: parsedAtStr,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "Parsing errors",
|
|
68
|
+
value: realtimeParsingErrors,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
// TODO: Implement these pages.
|
|
73
|
+
// {
|
|
74
|
+
// type: "button",
|
|
75
|
+
// text: "Parsing errors",
|
|
76
|
+
// link: {
|
|
77
|
+
// type: "system-path",
|
|
78
|
+
// systemPath: "realtime-parsing-errors",
|
|
79
|
+
// },
|
|
80
|
+
// },
|
|
81
|
+
// {
|
|
82
|
+
// type: "button",
|
|
83
|
+
// text: "Trip coverage",
|
|
84
|
+
// link: {
|
|
85
|
+
// type: "system-path",
|
|
86
|
+
// systemPath: "realtime-trip-coverage",
|
|
87
|
+
// },
|
|
88
|
+
// },
|
|
89
|
+
// {
|
|
90
|
+
// type: "button",
|
|
91
|
+
// text: "Broken transfers",
|
|
92
|
+
// link: {
|
|
93
|
+
// type: "system-path",
|
|
94
|
+
// systemPath: "broken-transfers",
|
|
95
|
+
// },
|
|
96
|
+
// },
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
_formatErrorCount(errors) {
|
|
101
|
+
const errorCount = errors.filter((e) => e.severity === "error").length;
|
|
102
|
+
const infoCount = errors.filter((e) => e.severity === "info").length;
|
|
103
|
+
const errorCountStr = errorCount === 0 ? "No" : errorCount.toString();
|
|
104
|
+
const infoCountStr = infoCount === 0 ? "no" : infoCount.toString();
|
|
105
|
+
const errorNoun = errorCount === 1 ? "error" : "errors";
|
|
106
|
+
const infoNoun = infoCount === 1 ? "message" : "messages";
|
|
107
|
+
return `${errorCountStr} ${errorNoun}, ${infoCountStr} ${infoNoun}`;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=debug-home-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-home-page.js","sourceRoot":"","sources":["../../../src/debug-pages/pages/debug-home-page.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,aAAa;IAEL;IACA;IAFnB,YACmB,WAAmB,EACnB,OAAmB;QADnB,gBAAW,GAAX,WAAW,CAAQ;QACnB,YAAO,GAAP,OAAO,CAAY;IACnC,CAAC;IAEJ,KAAK,CAAC,MAAM;QACV,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,OAAO,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,mBAAmB,EA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AC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;QAE1D,OAAO,GAAG,aAAa,IAAI,SAAS,KAAK,YAAY,IAAI,QAAQ,EAAE,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DynamicPage } from "../../corequery-types.js";
|
|
2
|
+
import type { GtfsTrip } from "../../data/trip/types.js";
|
|
3
|
+
import type { GtfsSystem } from "../../gtfs-system.js";
|
|
4
|
+
export declare class DebugServicePage {
|
|
5
|
+
private readonly _trip;
|
|
6
|
+
private readonly _serviceDay;
|
|
7
|
+
private readonly _sourceId;
|
|
8
|
+
private readonly _system;
|
|
9
|
+
constructor(_trip: GtfsTrip, _serviceDay: Temporal.PlainDate, _sourceId: string, _system: GtfsSystem);
|
|
10
|
+
render(): Promise<DynamicPage>;
|
|
11
|
+
private _renderBasicInfoSection;
|
|
12
|
+
private _renderTransfersSection;
|
|
13
|
+
private _renderTripUpdateSection;
|
|
14
|
+
private _contextualizeJson;
|
|
15
|
+
private _getTripType;
|
|
16
|
+
private _getTripGtfsRouteId;
|
|
17
|
+
private _formatTransferCount;
|
|
18
|
+
private _addEmptyMessageIfEmpty;
|
|
19
|
+
private _formatScheduledTransfer;
|
|
20
|
+
private _formatBrokenTransfer;
|
|
21
|
+
private _formatAddedTransfer;
|
|
22
|
+
private _formatTransfer;
|
|
23
|
+
private _formatGtfsEntireVehicleFormsServiceTransfer;
|
|
24
|
+
private _getSuffixForOtherTripInTransfer;
|
|
25
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { assertNever, itsOk, nonNull, parseIntThrow, } from "@dan-schel/js-utils";
|
|
2
|
+
import { GtfsScheduledTrip } from "../../data/trip/scheduled/gtfs-scheduled-trip.js";
|
|
3
|
+
import { GtfsAddedTrip } from "../../data/trip/added/gtfs-added-trip.js";
|
|
4
|
+
import { GtfsUpdatedTrip } from "../../data/trip/updated/gtfs-updated-trip.js";
|
|
5
|
+
import { GtfsReplacedTrip } from "../../data/trip/replaced/gtfs-replaced-trip.js";
|
|
6
|
+
import { GtfsEntireVehicleFormsServiceTransfer, } from "../../data/gtfs-transfer.js";
|
|
7
|
+
import { CorequeryIntrasourceId } from "../../conversion/corequery-intrasource-id.js";
|
|
8
|
+
export class DebugServicePage {
|
|
9
|
+
_trip;
|
|
10
|
+
_serviceDay;
|
|
11
|
+
_sourceId;
|
|
12
|
+
_system;
|
|
13
|
+
constructor(_trip, _serviceDay, _sourceId, _system) {
|
|
14
|
+
this._trip = _trip;
|
|
15
|
+
this._serviceDay = _serviceDay;
|
|
16
|
+
this._sourceId = _sourceId;
|
|
17
|
+
this._system = _system;
|
|
18
|
+
}
|
|
19
|
+
async render() {
|
|
20
|
+
return Promise.resolve({
|
|
21
|
+
title: this._trip.gtfsTripId,
|
|
22
|
+
content: [
|
|
23
|
+
this._renderBasicInfoSection(),
|
|
24
|
+
this._renderTransfersSection(),
|
|
25
|
+
this._renderTripUpdateSection(),
|
|
26
|
+
].filter(nonNull),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
_renderBasicInfoSection() {
|
|
30
|
+
return {
|
|
31
|
+
type: "section",
|
|
32
|
+
title: "Basic info",
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: "field-table",
|
|
36
|
+
fields: [
|
|
37
|
+
{
|
|
38
|
+
key: "Trip type",
|
|
39
|
+
value: this._getTripType(),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "GTFS trip ID",
|
|
43
|
+
value: this._trip.gtfsTripId,
|
|
44
|
+
valueStyle: "code",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "Service day",
|
|
48
|
+
value: this._serviceDay.toLocaleString("en-US", {
|
|
49
|
+
dateStyle: "medium",
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "GTFS route ID",
|
|
54
|
+
value: this._getTripGtfsRouteId(),
|
|
55
|
+
valueStyle: "code",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
_renderTransfersSection() {
|
|
63
|
+
const feed = this._system.getFeed();
|
|
64
|
+
if (feed == null)
|
|
65
|
+
return null;
|
|
66
|
+
const { scheduleData, realtimeData: rtData } = feed;
|
|
67
|
+
const tripId = this._trip.gtfsTripId;
|
|
68
|
+
const scheduled = scheduleData.getTransfersForTrip(tripId);
|
|
69
|
+
const broken = rtData.getBrokenTransfersForTrip(tripId, this._serviceDay);
|
|
70
|
+
const added = rtData.getAddedTransfersForTrip(tripId, this._serviceDay);
|
|
71
|
+
return {
|
|
72
|
+
type: "section",
|
|
73
|
+
title: "Transfers",
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: "accordion",
|
|
77
|
+
sections: [
|
|
78
|
+
{
|
|
79
|
+
title: "Scheduled",
|
|
80
|
+
value: this._formatTransferCount(scheduled.length),
|
|
81
|
+
content: this._addEmptyMessageIfEmpty(scheduled.map((t) => this._formatScheduledTransfer(t)), "No scheduled transfers."),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
title: "Broken",
|
|
85
|
+
value: this._formatTransferCount(broken.length),
|
|
86
|
+
content: this._addEmptyMessageIfEmpty(broken.map((t) => this._formatBrokenTransfer(t)), "No broken transfers."),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: "Added",
|
|
90
|
+
value: this._formatTransferCount(added.length),
|
|
91
|
+
content: this._addEmptyMessageIfEmpty(added.map((t) => this._formatAddedTransfer(t)), "No added transfers."),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
_renderTripUpdateSection() {
|
|
99
|
+
if (this._trip instanceof GtfsScheduledTrip)
|
|
100
|
+
return null;
|
|
101
|
+
const json = this._trip.tripUpdateJson;
|
|
102
|
+
const content = json != null
|
|
103
|
+
? {
|
|
104
|
+
type: "code-block",
|
|
105
|
+
text: this._contextualizeJson(JSON.stringify(json, null, 2)),
|
|
106
|
+
}
|
|
107
|
+
: {
|
|
108
|
+
type: "paragraph",
|
|
109
|
+
text: "No trip update JSON was attached to this trip.",
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
type: "section",
|
|
113
|
+
title: "Trip update JSON",
|
|
114
|
+
content: [content],
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
_contextualizeJson(json) {
|
|
118
|
+
const stopIdRegex = /^\s*"stopId": "([^"]*)",?$/;
|
|
119
|
+
const timestampRegex = /^\s*"time": ([0-9]+),?$/;
|
|
120
|
+
const helper = this._system.debugContextualizationHelpers;
|
|
121
|
+
return json
|
|
122
|
+
.split("\n")
|
|
123
|
+
.map((l) => {
|
|
124
|
+
// Show the stop and position name if possible.
|
|
125
|
+
const stopIdMatch = l.match(stopIdRegex);
|
|
126
|
+
if (stopIdMatch != null) {
|
|
127
|
+
const stopId = itsOk(stopIdMatch[1]);
|
|
128
|
+
const context = helper.getGtfsIdContext(stopId);
|
|
129
|
+
return `${l} // ${context}`;
|
|
130
|
+
}
|
|
131
|
+
// Show the timestamp in a human-readable format if possible.
|
|
132
|
+
const timestampMatch = l.match(timestampRegex);
|
|
133
|
+
if (timestampMatch != null) {
|
|
134
|
+
const timestamp = parseIntThrow(itsOk(timestampMatch[1]));
|
|
135
|
+
const context = helper.formatGtfsTripUpdateTimestamp(timestamp);
|
|
136
|
+
return `${l} // ${context}`;
|
|
137
|
+
}
|
|
138
|
+
return l;
|
|
139
|
+
})
|
|
140
|
+
.join("\n");
|
|
141
|
+
}
|
|
142
|
+
_getTripType() {
|
|
143
|
+
if (this._trip instanceof GtfsScheduledTrip) {
|
|
144
|
+
return "Scheduled";
|
|
145
|
+
}
|
|
146
|
+
else if (this._trip instanceof GtfsUpdatedTrip) {
|
|
147
|
+
return "Updated";
|
|
148
|
+
}
|
|
149
|
+
else if (this._trip instanceof GtfsAddedTrip) {
|
|
150
|
+
return "Added";
|
|
151
|
+
}
|
|
152
|
+
else if (this._trip instanceof GtfsReplacedTrip) {
|
|
153
|
+
return "Replaced";
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
assertNever(this._trip);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
_getTripGtfsRouteId() {
|
|
160
|
+
if (this._trip instanceof GtfsScheduledTrip) {
|
|
161
|
+
return this._trip.gtfsRouteId;
|
|
162
|
+
}
|
|
163
|
+
else if (this._trip instanceof GtfsUpdatedTrip) {
|
|
164
|
+
return this._trip.gtfsRouteId;
|
|
165
|
+
}
|
|
166
|
+
else if (this._trip instanceof GtfsAddedTrip) {
|
|
167
|
+
return "None (added trip)";
|
|
168
|
+
}
|
|
169
|
+
else if (this._trip instanceof GtfsReplacedTrip) {
|
|
170
|
+
const scheduled = this._trip.scheduledTrip.gtfsRouteId;
|
|
171
|
+
return `None (scheduled with: ${scheduled})`;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
assertNever(this._trip);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
_formatTransferCount(count) {
|
|
178
|
+
if (count === 0)
|
|
179
|
+
return "None";
|
|
180
|
+
return count === 1 ? `1 transfer` : `${count} transfers`;
|
|
181
|
+
}
|
|
182
|
+
_addEmptyMessageIfEmpty(content, message) {
|
|
183
|
+
if (content.length === 0) {
|
|
184
|
+
return [
|
|
185
|
+
{
|
|
186
|
+
type: "paragraph",
|
|
187
|
+
text: message,
|
|
188
|
+
},
|
|
189
|
+
];
|
|
190
|
+
}
|
|
191
|
+
return content;
|
|
192
|
+
}
|
|
193
|
+
_formatScheduledTransfer(transfer) {
|
|
194
|
+
return {
|
|
195
|
+
type: "field-table",
|
|
196
|
+
fields: this._formatTransfer(transfer),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
_formatBrokenTransfer(transfer) {
|
|
200
|
+
const reason = {
|
|
201
|
+
"trip-cancelled": "Trip cancelled",
|
|
202
|
+
"connecting-stop-or-position-changed": "Connecting stop or position changed",
|
|
203
|
+
}[transfer.reason];
|
|
204
|
+
return {
|
|
205
|
+
type: "field-table",
|
|
206
|
+
fields: [
|
|
207
|
+
...this._formatTransfer(transfer.transfer),
|
|
208
|
+
{
|
|
209
|
+
key: "Reason",
|
|
210
|
+
value: reason,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
_formatAddedTransfer(transfer) {
|
|
216
|
+
return {
|
|
217
|
+
type: "field-table",
|
|
218
|
+
fields: this._formatTransfer(transfer.transfer),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
_formatTransfer(transfer) {
|
|
222
|
+
if (transfer instanceof GtfsEntireVehicleFormsServiceTransfer) {
|
|
223
|
+
return this._formatGtfsEntireVehicleFormsServiceTransfer(transfer);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
return assertNever(transfer);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
_formatGtfsEntireVehicleFormsServiceTransfer(transfer) {
|
|
230
|
+
const otherTripId = transfer.fromTripId === this._trip.gtfsTripId
|
|
231
|
+
? transfer.toTripId
|
|
232
|
+
: transfer.fromTripId;
|
|
233
|
+
const otherTripLabel = otherTripId === transfer.fromTripId ? "From" : "To";
|
|
234
|
+
const otherTrip = this._system.getFeed()?.getTrip(otherTripId, this._serviceDay) ?? null;
|
|
235
|
+
const suffix = this._getSuffixForOtherTripInTransfer(otherTrip);
|
|
236
|
+
const id = new CorequeryIntrasourceId(otherTripId, this._serviceDay);
|
|
237
|
+
return [
|
|
238
|
+
{
|
|
239
|
+
key: "Type",
|
|
240
|
+
value: "Entire vehicle forms service",
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
key: otherTripLabel,
|
|
244
|
+
value: `${otherTripId}${suffix}`,
|
|
245
|
+
valueStyle: "code",
|
|
246
|
+
link: {
|
|
247
|
+
type: "service",
|
|
248
|
+
sourceId: this._sourceId,
|
|
249
|
+
intrasourceId: id.toString(),
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
];
|
|
253
|
+
}
|
|
254
|
+
_getSuffixForOtherTripInTransfer(trip) {
|
|
255
|
+
if (trip == null) {
|
|
256
|
+
// I don't think can happen at the moment, because the other trip is
|
|
257
|
+
// probably just cancelled at worst, right? I don't think we have a
|
|
258
|
+
// mechanism (yet) to enable real-time updates to delete trips entirely. I
|
|
259
|
+
// suppose we might one day though, since I think deleting trips is within
|
|
260
|
+
// the GTFS-RT spec.
|
|
261
|
+
return " (no longer exists)";
|
|
262
|
+
}
|
|
263
|
+
else if (trip instanceof GtfsUpdatedTrip && trip.isCancelled) {
|
|
264
|
+
return " (cancelled)";
|
|
265
|
+
}
|
|
266
|
+
else if (trip instanceof GtfsAddedTrip) {
|
|
267
|
+
return " (added)";
|
|
268
|
+
}
|
|
269
|
+
else if (trip instanceof GtfsReplacedTrip) {
|
|
270
|
+
return " (replaced)";
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
return "";
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=debug-service-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-service-page.js","sourceRoot":"","sources":["../../../src/debug-pages/pages/debug-service-page.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,EACL,OAAO,EACP,aAAa,GACd,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAElF,OAAO,EACL,qCAAqC,GAEtC,MAAM,6BAA6B,CAAC;AACrC,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MAAM,EAAE;gBAChC,UAAU,EAAE,MAAM;gBAClB,IAAI,EAAE;oBACJ,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI,CAAC,SAAS;oBACxB,aAAa,EAAE,EAAE,CAAC,QAAQ,EAAE;iBAC7B;aACF;SACF,CAAC;IACJ,CAAC;IAEO,gCAAgC,CAAC,IAAqB;QAC5D,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,oEAAoE;YACpE,mEAAmE;YACnE,0EAA0E;YAC1E,0EAA0E;YAC1E,oBAAoB;YACpB,OAAO,qBAAqB,CAAC;QAC/B,CAAC;aAAM,IAAI,IAAI,YAAY,eAAe,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC/D,OAAO,cAAc,CAAC;QACxB,CAAC;aAAM,IAAI,IAAI,YAAY,aAAa,EAAE,CAAC;YACzC,OAAO,UAAU,CAAC;QACpB,CAAC;aAAM,IAAI,IAAI,YAAY,gBAAgB,EAAE,CAAC;YAC5C,OAAO,aAAa,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { DepartureFields, DeparturesIterationDirection, DeparturesIterator, EntireVehicleFormsServiceConnectionFields, GenericServiceConnectionFields, LightweightDeparture, ServiceFields, ServiceOriginatingMovementFields, ServicePassingMovementFields, ServiceRegularMovementFields, ServiceSource, ServiceTerminatingMovementFields } from "./corequery-types.js";
|
|
1
|
+
import type { DepartureFields, DeparturesIterationDirection, DeparturesIterator, DynamicPageSystem, EntireVehicleFormsServiceConnectionFields, GenericServiceConnectionFields, LightweightDeparture, ServiceFields, ServiceOriginatingMovementFields, ServicePassingMovementFields, ServiceRegularMovementFields, ServiceSource, ServiceTerminatingMovementFields } from "./corequery-types.js";
|
|
2
2
|
import type { GtfsSystem } from "./gtfs-system.js";
|
|
3
3
|
export type GtfsTimeRounding = "no-rounding" | "nearest-minute";
|
|
4
4
|
type GtfsServiceSourceFields<CorequeryDepartureClass, CorequeryServiceClass, CorequeryTagsClass, CorequeryServiceOriginatingMovementClass, CorequeryServiceRegularMovementClass, CorequeryServiceTerminatingMovementClass, CorequeryServicePassingMovementClass, CorequeryEntireVehicleFormsServiceConnectionClass, CorequeryGenericServiceConnectionClass> = {
|
|
5
5
|
readonly sourceId: string;
|
|
6
|
+
readonly name: string;
|
|
6
7
|
readonly gtfsSystem: GtfsSystem;
|
|
7
8
|
readonly departureIterationLimitHours: number | null;
|
|
8
9
|
readonly timeRounding?: GtfsTimeRounding;
|
|
@@ -18,11 +19,14 @@ type GtfsServiceSourceFields<CorequeryDepartureClass, CorequeryServiceClass, Cor
|
|
|
18
19
|
};
|
|
19
20
|
export declare class GtfsServiceSource<CorequeryDepartureClass, CorequeryServiceClass, CorequeryTagsClass, CorequeryServiceOriginatingMovementClass, CorequeryServiceRegularMovementClass, CorequeryServiceTerminatingMovementClass, CorequeryServicePassingMovementClass, CorequeryEntireVehicleFormsServiceConnectionClass, CorequeryGenericServiceConnectionClass> implements ServiceSource<CorequeryDepartureClass, CorequeryServiceClass, LightweightDeparture<CorequeryTagsClass, CorequeryServiceOriginatingMovementClass, CorequeryServiceRegularMovementClass, CorequeryServiceTerminatingMovementClass>> {
|
|
20
21
|
readonly sourceId: string;
|
|
22
|
+
readonly name: string;
|
|
21
23
|
readonly gtfsSystem: GtfsSystem;
|
|
22
24
|
readonly departureIterationLimitHours: number | null;
|
|
23
25
|
private readonly _converter;
|
|
24
26
|
constructor(fields: GtfsServiceSourceFields<CorequeryDepartureClass, CorequeryServiceClass, CorequeryTagsClass, CorequeryServiceOriginatingMovementClass, CorequeryServiceRegularMovementClass, CorequeryServiceTerminatingMovementClass, CorequeryServicePassingMovementClass, CorequeryEntireVehicleFormsServiceConnectionClass, CorequeryGenericServiceConnectionClass>);
|
|
25
27
|
getService(intrasourceId: string): Promise<CorequeryServiceClass | null>;
|
|
26
28
|
getDeparturesIterator(stopId: number, instant: Temporal.Instant, direction: DeparturesIterationDirection): DeparturesIterator<CorequeryDepartureClass, LightweightDeparture<CorequeryTagsClass, CorequeryServiceOriginatingMovementClass, CorequeryServiceRegularMovementClass, CorequeryServiceTerminatingMovementClass>>;
|
|
29
|
+
get debugPageSystemPath(): string;
|
|
30
|
+
getDebugPageSystem(): DynamicPageSystem;
|
|
27
31
|
}
|
|
28
32
|
export {};
|
|
@@ -6,13 +6,16 @@ import { GtfsUpdatedTrip } from "./data/trip/updated/gtfs-updated-trip.js";
|
|
|
6
6
|
import { ServiceConversionIterator } from "./conversion/service-conversion-iterator.js";
|
|
7
7
|
import { GtfsAddedTrip } from "./data/trip/added/gtfs-added-trip.js";
|
|
8
8
|
import { GtfsReplacedTrip } from "./data/trip/replaced/gtfs-replaced-trip.js";
|
|
9
|
+
import { DebugPageSystem } from "./debug-pages/debug-page-system.js";
|
|
9
10
|
export class GtfsServiceSource {
|
|
10
11
|
sourceId;
|
|
12
|
+
name;
|
|
11
13
|
gtfsSystem;
|
|
12
14
|
departureIterationLimitHours;
|
|
13
15
|
_converter;
|
|
14
16
|
constructor(fields) {
|
|
15
17
|
this.sourceId = fields.sourceId;
|
|
18
|
+
this.name = fields.name;
|
|
16
19
|
this.gtfsSystem = fields.gtfsSystem;
|
|
17
20
|
this.departureIterationLimitHours = fields.departureIterationLimitHours;
|
|
18
21
|
this._converter = new ServiceConverter({
|
|
@@ -64,5 +67,11 @@ export class GtfsServiceSource {
|
|
|
64
67
|
iterator.set(instant, direction);
|
|
65
68
|
return new ServiceConversionIterator(iterator, this._converter, feed.timezoneConfig.timezone);
|
|
66
69
|
}
|
|
70
|
+
get debugPageSystemPath() {
|
|
71
|
+
return DebugPageSystem.HOME;
|
|
72
|
+
}
|
|
73
|
+
getDebugPageSystem() {
|
|
74
|
+
return new DebugPageSystem(this.sourceId, this.name, this.gtfsSystem);
|
|
75
|
+
}
|
|
67
76
|
}
|
|
68
77
|
//# sourceMappingURL=gtfs-service-source.js.map
|