@golemio/pid 2.3.4 → 2.3.5-dev.713309674
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/db/example/00_clear_test_data.sql +2 -1
- package/db/example/07_tmp_example.sql +0 -3
- package/db/example/12_metro_line_A_gtfs_trips.sql +5 -5
- package/db/migrations/postgresql/20221202220835-positions-context.js +53 -0
- package/db/migrations/postgresql/sqls/20211006135413-init-ropid-tables-up.sql +2 -0
- package/db/migrations/postgresql/sqls/20221202220835-positions-context-down.sql +4 -0
- package/db/migrations/postgresql/sqls/20221202220835-positions-context-up.sql +4 -0
- package/dist/integration-engine/vehicle-positions/VehiclePositionsInterfaces.d.ts +9 -33
- package/dist/integration-engine/vehicle-positions/VehiclePositionsWorker.js +2 -1
- package/dist/integration-engine/vehicle-positions/VehiclePositionsWorker.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/DPPUtils.d.ts +3 -2
- package/dist/integration-engine/vehicle-positions/helpers/DPPUtils.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/PositionsManager.d.ts +7 -5
- package/dist/integration-engine/vehicle-positions/helpers/PositionsManager.js +32 -25
- package/dist/integration-engine/vehicle-positions/helpers/PositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/ValidToCalculator.d.ts +3 -2
- package/dist/integration-engine/vehicle-positions/helpers/ValidToCalculator.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.d.ts +6 -4
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/ComputeDelayHelper.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.d.ts +8 -7
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/strategy/AbstractDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/strategy/BusDelayAtStop.d.ts +5 -4
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/strategy/BusDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/strategy/FactoryDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/strategy/TramDelayAtStop.d.ts +5 -4
- package/dist/integration-engine/vehicle-positions/helpers/compute-positions/strategy/TramDelayAtStop.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsPositionsModel.d.ts +5 -37
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsPositionsModel.js +11 -5
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsPositionsModel.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsRunsModel.d.ts +1 -1
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsRunsModel.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsTripsHistoryModel.js +5 -4
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsTripsHistoryModel.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsTripsModel.d.ts +7 -20
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsTripsModel.js +29 -57
- package/dist/integration-engine/vehicle-positions/models/VehiclePositionsTripsModel.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/transformations/MetroRunsMessageProcessingTransformation.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/models/VehiclePositionsTripsModel.d.ts +1 -1
- package/dist/output-gateway/vehicle-positions/models/VehiclePositionsTripsModel.js +10 -7
- package/dist/output-gateway/vehicle-positions/models/VehiclePositionsTripsModel.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/index.d.ts +0 -9
- package/dist/schema-definitions/vehicle-positions/index.js +0 -69
- package/dist/schema-definitions/vehicle-positions/index.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.d.ts +38 -0
- package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js +277 -0
- package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js.map +1 -0
- package/dist/schema-definitions/vehicle-positions/models/index.d.ts +1 -0
- package/dist/schema-definitions/vehicle-positions/models/index.js +1 -0
- package/dist/schema-definitions/vehicle-positions/models/index.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/interfaces/IVPTripsModel.d.ts +33 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/IVPTripsModel.js +3 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/IVPTripsModel.js.map +1 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/IVPTripsPositionAttributes.d.ts +28 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/IVPTripsPositionAttributes.js +3 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/IVPTripsPositionAttributes.js.map +1 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/VPTripsLastPositionInterfaces.d.ts +27 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/VPTripsLastPositionInterfaces.js +3 -0
- package/dist/schema-definitions/vehicle-positions/models/interfaces/VPTripsLastPositionInterfaces.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VPTripsModel = void 0;
|
|
4
|
+
const schema_definitions_1 = require("@golemio/core/dist/schema-definitions");
|
|
5
|
+
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
6
|
+
class VPTripsModel extends sequelize_1.Model {
|
|
7
|
+
}
|
|
8
|
+
exports.VPTripsModel = VPTripsModel;
|
|
9
|
+
VPTripsModel.TABLE_NAME = "vehiclepositions_trips";
|
|
10
|
+
VPTripsModel.TABLE_NAME_HISTORY = "vehiclepositions_trips_history";
|
|
11
|
+
VPTripsModel.attributeModel = {
|
|
12
|
+
agency_name_real: sequelize_1.DataTypes.STRING,
|
|
13
|
+
agency_name_scheduled: sequelize_1.DataTypes.STRING,
|
|
14
|
+
cis_line_id: sequelize_1.DataTypes.STRING,
|
|
15
|
+
cis_line_short_name: sequelize_1.DataTypes.STRING,
|
|
16
|
+
cis_trip_number: sequelize_1.DataTypes.INTEGER,
|
|
17
|
+
gtfs_block_id: sequelize_1.DataTypes.STRING,
|
|
18
|
+
gtfs_route_id: sequelize_1.DataTypes.STRING,
|
|
19
|
+
gtfs_route_short_name: sequelize_1.DataTypes.STRING,
|
|
20
|
+
gtfs_route_type: sequelize_1.DataTypes.INTEGER,
|
|
21
|
+
gtfs_trip_headsign: sequelize_1.DataTypes.STRING,
|
|
22
|
+
gtfs_trip_short_name: sequelize_1.DataTypes.STRING,
|
|
23
|
+
gtfs_trip_id: sequelize_1.DataTypes.STRING,
|
|
24
|
+
// ⬐ hash(start_timestamp, cis_id, cis_short_name, cis_number);
|
|
25
|
+
id: {
|
|
26
|
+
primaryKey: true,
|
|
27
|
+
type: sequelize_1.DataTypes.STRING,
|
|
28
|
+
},
|
|
29
|
+
is_canceled: sequelize_1.DataTypes.BOOLEAN,
|
|
30
|
+
last_position_id: sequelize_1.DataTypes.INTEGER,
|
|
31
|
+
last_position_context: sequelize_1.DataTypes.JSONB,
|
|
32
|
+
origin_route_name: sequelize_1.DataTypes.STRING,
|
|
33
|
+
sequence_id: sequelize_1.DataTypes.INTEGER,
|
|
34
|
+
start_asw_stop_id: sequelize_1.DataTypes.STRING,
|
|
35
|
+
start_cis_stop_id: sequelize_1.DataTypes.INTEGER,
|
|
36
|
+
start_cis_stop_platform_code: sequelize_1.DataTypes.STRING,
|
|
37
|
+
start_time: sequelize_1.DataTypes.TIME,
|
|
38
|
+
// ⬐ Převod příjezdu první zastávky na date (pozor, čas 23:59 který přišel v 0:01 bude mít včerejší datum!)
|
|
39
|
+
start_timestamp: sequelize_1.DataTypes.BIGINT,
|
|
40
|
+
end_timestamp: sequelize_1.DataTypes.BIGINT,
|
|
41
|
+
vehicle_registration_number: sequelize_1.DataTypes.INTEGER,
|
|
42
|
+
vehicle_type_id: sequelize_1.DataTypes.INTEGER,
|
|
43
|
+
wheelchair_accessible: sequelize_1.DataTypes.BOOLEAN,
|
|
44
|
+
// ⬐ Auditni pole
|
|
45
|
+
create_batch_id: { type: sequelize_1.DataTypes.BIGINT },
|
|
46
|
+
created_at: { type: sequelize_1.DataTypes.DATE },
|
|
47
|
+
created_by: { type: sequelize_1.DataTypes.STRING(150) },
|
|
48
|
+
update_batch_id: { type: sequelize_1.DataTypes.BIGINT },
|
|
49
|
+
updated_at: { type: sequelize_1.DataTypes.DATE },
|
|
50
|
+
updated_by: { type: sequelize_1.DataTypes.STRING(150) }, // Identikace uživatele/procesu, který poslední měnil záznam
|
|
51
|
+
};
|
|
52
|
+
VPTripsModel.indexesOptions = [
|
|
53
|
+
{
|
|
54
|
+
unique: false,
|
|
55
|
+
using: "BTREE",
|
|
56
|
+
name: "vehiclepositions_trips_gtfs_trip_id",
|
|
57
|
+
fields: ["gtfs_trip_id"],
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
VPTripsModel.jsonSchema = {
|
|
61
|
+
oneOf: [
|
|
62
|
+
{
|
|
63
|
+
type: "array",
|
|
64
|
+
items: {
|
|
65
|
+
$ref: "#/definitions/trip",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
$ref: "#/definitions/trip",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
definitions: {
|
|
73
|
+
// @ts-expect-error
|
|
74
|
+
geometry: schema_definitions_1.SharedSchemaProvider.Geometry,
|
|
75
|
+
// @ts-expect-error JSONSchemaType does not like type pairings in definitions
|
|
76
|
+
trip: {
|
|
77
|
+
title: "trip",
|
|
78
|
+
description: "Vehicle Positions Trip",
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
cis_line_id: {
|
|
82
|
+
type: ["string", "null"],
|
|
83
|
+
},
|
|
84
|
+
cis_trip_number: {
|
|
85
|
+
type: ["number", "null"],
|
|
86
|
+
},
|
|
87
|
+
sequence_id: {
|
|
88
|
+
type: ["number", "null"],
|
|
89
|
+
},
|
|
90
|
+
cis_line_short_name: {
|
|
91
|
+
type: ["string", "null"],
|
|
92
|
+
},
|
|
93
|
+
gtfs_route_id: {
|
|
94
|
+
type: ["string", "null"],
|
|
95
|
+
},
|
|
96
|
+
gtfs_route_short_name: {
|
|
97
|
+
type: ["string", "null"],
|
|
98
|
+
},
|
|
99
|
+
gtfs_trip_id: {
|
|
100
|
+
type: ["string", "null"],
|
|
101
|
+
},
|
|
102
|
+
id: {
|
|
103
|
+
type: "string",
|
|
104
|
+
},
|
|
105
|
+
start_cis_stop_id: {
|
|
106
|
+
type: ["number", "null"],
|
|
107
|
+
},
|
|
108
|
+
start_cis_stop_platform_code: {
|
|
109
|
+
type: ["string", "null"],
|
|
110
|
+
},
|
|
111
|
+
start_time: {
|
|
112
|
+
type: ["string", "null"],
|
|
113
|
+
},
|
|
114
|
+
start_timestamp: {
|
|
115
|
+
type: ["string", "number", "null"],
|
|
116
|
+
},
|
|
117
|
+
vehicle_type_id: {
|
|
118
|
+
type: "number",
|
|
119
|
+
},
|
|
120
|
+
wheelchair_accessible: {
|
|
121
|
+
type: ["boolean", "null"],
|
|
122
|
+
},
|
|
123
|
+
agency_name_scheduled: {
|
|
124
|
+
type: ["string", "null"],
|
|
125
|
+
},
|
|
126
|
+
origin_route_name: {
|
|
127
|
+
type: ["string", "number", "null"],
|
|
128
|
+
},
|
|
129
|
+
agency_name_real: {
|
|
130
|
+
type: ["string", "null"],
|
|
131
|
+
},
|
|
132
|
+
vehicle_registration_number: {
|
|
133
|
+
type: ["number", "null"],
|
|
134
|
+
},
|
|
135
|
+
gtfs_trip_headsign: {
|
|
136
|
+
type: ["string", "null"],
|
|
137
|
+
},
|
|
138
|
+
start_asw_stop_id: {
|
|
139
|
+
type: ["string", "null"],
|
|
140
|
+
},
|
|
141
|
+
gtfs_route_type: {
|
|
142
|
+
type: ["string", "number", "null"],
|
|
143
|
+
},
|
|
144
|
+
gtfs_block_id: {
|
|
145
|
+
type: ["string", "null"],
|
|
146
|
+
},
|
|
147
|
+
last_position_id: {
|
|
148
|
+
type: ["number", "null"],
|
|
149
|
+
},
|
|
150
|
+
is_canceled: {
|
|
151
|
+
type: ["boolean", "null"],
|
|
152
|
+
},
|
|
153
|
+
end_timestamp: {
|
|
154
|
+
type: ["string", "number", "null"],
|
|
155
|
+
},
|
|
156
|
+
gtfs_trip_short_name: {
|
|
157
|
+
type: ["string", "null"],
|
|
158
|
+
},
|
|
159
|
+
last_position_context: {
|
|
160
|
+
oneOf: [
|
|
161
|
+
{
|
|
162
|
+
$ref: "#/definitions/context",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: "null",
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
required: ["id", "vehicle_type_id"],
|
|
171
|
+
},
|
|
172
|
+
// @ts-expect-error JSONSchemaType does not like type pairings in definitions
|
|
173
|
+
context: {
|
|
174
|
+
title: "context",
|
|
175
|
+
description: "Last position's context",
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
lastPositionId: {
|
|
179
|
+
type: ["string", "null"],
|
|
180
|
+
},
|
|
181
|
+
lastPositionOriginTimestamp: {
|
|
182
|
+
type: ["number", "null"],
|
|
183
|
+
},
|
|
184
|
+
lastPositionTracking: {
|
|
185
|
+
oneOf: [
|
|
186
|
+
{
|
|
187
|
+
type: "object",
|
|
188
|
+
properties: {
|
|
189
|
+
type: {
|
|
190
|
+
type: "string",
|
|
191
|
+
enum: ["Feature"],
|
|
192
|
+
},
|
|
193
|
+
properties: {
|
|
194
|
+
type: "object",
|
|
195
|
+
// TODO add properties after creating shared schema for VP positions
|
|
196
|
+
},
|
|
197
|
+
geometry: {
|
|
198
|
+
$ref: "#/definitions/geometry",
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
required: ["type", "properties", "geometry"],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: "null",
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
lastPositionCanceled: {
|
|
209
|
+
type: ["boolean", "null"],
|
|
210
|
+
},
|
|
211
|
+
lastPositionLastStop: {
|
|
212
|
+
type: "object",
|
|
213
|
+
properties: {
|
|
214
|
+
id: {
|
|
215
|
+
type: ["string", "null"],
|
|
216
|
+
},
|
|
217
|
+
sequence: {
|
|
218
|
+
type: ["number", "null"],
|
|
219
|
+
},
|
|
220
|
+
arrival_time: {
|
|
221
|
+
type: ["number", "null"],
|
|
222
|
+
},
|
|
223
|
+
departure_time: {
|
|
224
|
+
type: ["number", "null"],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
required: [],
|
|
228
|
+
},
|
|
229
|
+
lastPositionDelay: {
|
|
230
|
+
type: ["number", "null"],
|
|
231
|
+
},
|
|
232
|
+
atStopStreak: {
|
|
233
|
+
type: "object",
|
|
234
|
+
properties: {
|
|
235
|
+
firstPositionTimestamp: {
|
|
236
|
+
type: ["number", "null"],
|
|
237
|
+
},
|
|
238
|
+
firstPositionDelay: {
|
|
239
|
+
type: ["number", "null"],
|
|
240
|
+
},
|
|
241
|
+
stop_sequence: {
|
|
242
|
+
type: ["number", "null"],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
required: [],
|
|
246
|
+
},
|
|
247
|
+
lastPositionBeforeTrackDelayed: {
|
|
248
|
+
oneOf: [
|
|
249
|
+
{
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
delay: {
|
|
253
|
+
type: "number",
|
|
254
|
+
},
|
|
255
|
+
origin_timestamp: {
|
|
256
|
+
type: "number",
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
required: ["delay", "origin_timestamp"],
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
type: "null",
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
isLastPositionAfterTrack: {
|
|
267
|
+
type: "boolean",
|
|
268
|
+
},
|
|
269
|
+
tripId: {
|
|
270
|
+
type: "string",
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
required: ["lastPositionLastStop", "atStopStreak", "isLastPositionAfterTrack", "tripId"],
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
//# sourceMappingURL=VPTripsModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VPTripsModel.js","sourceRoot":"","sources":["../../../../src/schema-definitions/vehicle-positions/models/VPTripsModel.ts"],"names":[],"mappings":";;;AAAA,8EAA6E;AAE7E,mEAA6G;AAI7G,MAAa,YAAa,SAAQ,iBAAmB;;AAArD,oCA6SC;AA5SiB,uBAAU,GAAG,wBAAwB,CAAC;AACtC,+BAAkB,GAAG,gCAAgC,CAAC;AA8BtD,2BAAc,GAAkC;IAC1D,gBAAgB,EAAE,qBAAS,CAAC,MAAM;IAClC,qBAAqB,EAAE,qBAAS,CAAC,MAAM;IACvC,WAAW,EAAE,qBAAS,CAAC,MAAM;IAC7B,mBAAmB,EAAE,qBAAS,CAAC,MAAM;IACrC,eAAe,EAAE,qBAAS,CAAC,OAAO;IAClC,aAAa,EAAE,qBAAS,CAAC,MAAM;IAC/B,aAAa,EAAE,qBAAS,CAAC,MAAM;IAC/B,qBAAqB,EAAE,qBAAS,CAAC,MAAM;IACvC,eAAe,EAAE,qBAAS,CAAC,OAAO;IAClC,kBAAkB,EAAE,qBAAS,CAAC,MAAM;IACpC,oBAAoB,EAAE,qBAAS,CAAC,MAAM;IACtC,YAAY,EAAE,qBAAS,CAAC,MAAM;IAC9B,+DAA+D;IAC/D,EAAE,EAAE;QACA,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,qBAAS,CAAC,MAAM;KACzB;IACD,WAAW,EAAE,qBAAS,CAAC,OAAO;IAC9B,gBAAgB,EAAE,qBAAS,CAAC,OAAO;IACnC,qBAA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ACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,sBAAsB,EAAE;4BACpB,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;yBAC3B;wBACD,kBAAkB,EAAE;4BAChB,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;yBAC3B;wBACD,aAAa,EAAE;4BACX,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;yBAC3B;qBACJ;oBACD,QAAQ,EAAE,EAAE;iBACf;gBACD,8BAA8B,EAAE;oBAC5B,KAAK,EAAE;wBACH;4BACI,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACR,KAAK,EAAE;oCACH,IAAI,EAAE,QAAQ;iCACjB;gCACD,gBAAgB,EAAE;oCACd,IAAI,EAAE,QAAQ;iCACjB;6BACJ;4BACD,QAAQ,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC;yBAC1C;wBACD;4BACI,IAAI,EAAE,MAAM;yBACf;qBACJ;iBACJ;gBACD,wBAAwB,EAAE;oBACtB,IAAI,EAAE,SAAS;iBAClB;gBACD,MAAM,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACjB;aACJ;YACD,QAAQ,EAAE,CAAC,sBAAsB,EAAE,cAAc,EAAE,0BAA0B,EAAE,QAAQ,CAAC;SAC3F;KACJ;CACJ,CAAC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./MetroRunsMessagesModel"), exports);
|
|
18
|
+
__exportStar(require("./VPTripsModel"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema-definitions/vehicle-positions/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema-definitions/vehicle-positions/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,iDAA+B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IVPTripsLastPositionContext } from "./VPTripsLastPositionInterfaces";
|
|
2
|
+
export interface IVPTripsModel {
|
|
3
|
+
cis_line_id: string | null;
|
|
4
|
+
cis_trip_number: number | null;
|
|
5
|
+
sequence_id: number | null;
|
|
6
|
+
cis_line_short_name: string | null;
|
|
7
|
+
gtfs_route_id: string | null;
|
|
8
|
+
gtfs_route_short_name: string | null;
|
|
9
|
+
gtfs_trip_id: string | null;
|
|
10
|
+
id: string;
|
|
11
|
+
start_cis_stop_id: number | null;
|
|
12
|
+
start_cis_stop_platform_code: string | null;
|
|
13
|
+
start_time: string | null;
|
|
14
|
+
start_timestamp: string | number | null;
|
|
15
|
+
vehicle_type_id: number | null;
|
|
16
|
+
wheelchair_accessible: boolean | null;
|
|
17
|
+
agency_name_scheduled: string | null;
|
|
18
|
+
origin_route_name: string | null;
|
|
19
|
+
agency_name_real: string | null;
|
|
20
|
+
vehicle_registration_number: number | null;
|
|
21
|
+
gtfs_trip_headsign: string | null;
|
|
22
|
+
start_asw_stop_id: string | null;
|
|
23
|
+
gtfs_route_type: number | null;
|
|
24
|
+
gtfs_block_id: string | null;
|
|
25
|
+
last_position_id: number | null;
|
|
26
|
+
is_canceled: boolean | null;
|
|
27
|
+
end_timestamp: string | number | null;
|
|
28
|
+
gtfs_trip_short_name: string | null;
|
|
29
|
+
last_position_context: IVPTripsLastPositionContext | null;
|
|
30
|
+
}
|
|
31
|
+
export declare type VPTripsNonNullableModel = {
|
|
32
|
+
[K in keyof IVPTripsModel]: NonNullable<IVPTripsModel[K]>;
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVPTripsModel.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/interfaces/IVPTripsModel.ts"],"names":[],"mappings":""}
|
package/dist/schema-definitions/vehicle-positions/models/interfaces/IVPTripsPositionAttributes.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StatePositionEnum, StateProcessEnum } from "../../../../const";
|
|
2
|
+
export interface IVPTripsPositionAttributes {
|
|
3
|
+
bearing: number | null;
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
origin_time: string;
|
|
7
|
+
origin_timestamp: number;
|
|
8
|
+
delay: number | null;
|
|
9
|
+
tracking: number;
|
|
10
|
+
id: string;
|
|
11
|
+
shape_dist_traveled: number | null;
|
|
12
|
+
is_canceled: boolean;
|
|
13
|
+
state_position: StatePositionEnum;
|
|
14
|
+
state_process: StateProcessEnum;
|
|
15
|
+
tcp_event: string | null;
|
|
16
|
+
this_stop_sequence: number | null;
|
|
17
|
+
last_stop_sequence: number | null;
|
|
18
|
+
last_stop_id: string | null;
|
|
19
|
+
last_stop_name: string | null;
|
|
20
|
+
last_stop_arrival_time: number | null;
|
|
21
|
+
last_stop_departure_time: number | null;
|
|
22
|
+
next_stop_sequence: number | null;
|
|
23
|
+
next_stop_id: string | null;
|
|
24
|
+
next_stop_name: string | null;
|
|
25
|
+
next_stop_arrival_time: number | null;
|
|
26
|
+
next_stop_departure_time: number | null;
|
|
27
|
+
valid_to: number | null;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVPTripsPositionAttributes.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/interfaces/IVPTripsPositionAttributes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Feature, Point } from "@turf/turf";
|
|
2
|
+
import { IVPTripsPositionAttributes } from "./IVPTripsPositionAttributes";
|
|
3
|
+
export interface IVPTripsComputedPositionAtStopStreak {
|
|
4
|
+
firstPositionTimestamp: number | null;
|
|
5
|
+
firstPositionDelay: number | null;
|
|
6
|
+
stop_sequence: number | null;
|
|
7
|
+
}
|
|
8
|
+
export interface IVPTripsLastPositionContext {
|
|
9
|
+
lastPositionId: string | null;
|
|
10
|
+
lastPositionOriginTimestamp: number | null;
|
|
11
|
+
lastPositionTracking: Feature<Point, IVPTripsPositionAttributes> | null;
|
|
12
|
+
lastPositionCanceled: boolean | null;
|
|
13
|
+
lastPositionLastStop: {
|
|
14
|
+
id: string | null;
|
|
15
|
+
sequence: number | null;
|
|
16
|
+
arrival_time: number | null;
|
|
17
|
+
departure_time: number | null;
|
|
18
|
+
};
|
|
19
|
+
lastPositionDelay: number | null;
|
|
20
|
+
atStopStreak: IVPTripsComputedPositionAtStopStreak;
|
|
21
|
+
lastPositionBeforeTrackDelayed: {
|
|
22
|
+
delay: number;
|
|
23
|
+
origin_timestamp: number;
|
|
24
|
+
} | null;
|
|
25
|
+
isLastPositionAfterTrack: boolean;
|
|
26
|
+
tripId: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VPTripsLastPositionInterfaces.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/interfaces/VPTripsLastPositionInterfaces.ts"],"names":[],"mappings":""}
|