@golemio/pid 5.8.1-dev.2403320242 → 5.8.1-dev.2408473132
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/dist/output-gateway/public/routers/v2/helpers/CustomBBoxValidator.d.ts +12 -1
- package/dist/output-gateway/public/routers/v2/helpers/CustomBBoxValidator.js +13 -2
- package/dist/output-gateway/public/routers/v2/helpers/CustomBBoxValidator.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +23 -4
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -1
- package/docs/openapi-output.yaml +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,18 @@ export declare class CustomBBoxValidator {
|
|
|
5
5
|
* 4 positive or negative floating point numbers separated by commas
|
|
6
6
|
* @example 50.073619,14.414826,50.092867,14.438086
|
|
7
7
|
*/
|
|
8
|
-
private static BOUNDING_BOX_REGEX;
|
|
8
|
+
private static readonly BOUNDING_BOX_REGEX;
|
|
9
|
+
/**
|
|
10
|
+
* Redis/Valkey GEO commands support latitude values only in the range [-85.05112878, 85.05112878].
|
|
11
|
+
*
|
|
12
|
+
* See also:
|
|
13
|
+
* <https://redis.io/docs/latest/commands/geoadd/#:~:text=Valid%20latitudes%20are%20from%20%2D85.05112878%20to%2085.05112878%20degrees.>,
|
|
14
|
+
* <https://github.com/redis/redis/issues/13756>.
|
|
15
|
+
*/
|
|
16
|
+
private static readonly MIN_LATITUDE;
|
|
17
|
+
private static readonly MAX_LATITUDE;
|
|
18
|
+
private static readonly MIN_LONGITUDE;
|
|
19
|
+
private static readonly MAX_LONGITUDE;
|
|
9
20
|
static validate: CustomValidator;
|
|
10
21
|
private static isLatitudeValid;
|
|
11
22
|
private static isLongitudeValid;
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.CustomBBoxValidator = void 0;
|
|
5
5
|
class CustomBBoxValidator {
|
|
6
6
|
static isLatitudeValid(latitude) {
|
|
7
|
-
return latitude >=
|
|
7
|
+
return latitude >= this.MIN_LATITUDE && latitude <= this.MAX_LATITUDE;
|
|
8
8
|
}
|
|
9
9
|
static isLongitudeValid(longitude) {
|
|
10
|
-
return longitude >=
|
|
10
|
+
return longitude >= this.MIN_LONGITUDE && longitude <= this.MAX_LONGITUDE;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.CustomBBoxValidator = CustomBBoxValidator;
|
|
@@ -18,6 +18,17 @@ _a = CustomBBoxValidator;
|
|
|
18
18
|
* @example 50.073619,14.414826,50.092867,14.438086
|
|
19
19
|
*/
|
|
20
20
|
CustomBBoxValidator.BOUNDING_BOX_REGEX = /^(?:-?\d+?(?:\.\d+?)?,){3}-?\d+?(?:\.\d+?)?$/;
|
|
21
|
+
/**
|
|
22
|
+
* Redis/Valkey GEO commands support latitude values only in the range [-85.05112878, 85.05112878].
|
|
23
|
+
*
|
|
24
|
+
* See also:
|
|
25
|
+
* <https://redis.io/docs/latest/commands/geoadd/#:~:text=Valid%20latitudes%20are%20from%20%2D85.05112878%20to%2085.05112878%20degrees.>,
|
|
26
|
+
* <https://github.com/redis/redis/issues/13756>.
|
|
27
|
+
*/
|
|
28
|
+
CustomBBoxValidator.MIN_LATITUDE = -85.05112878;
|
|
29
|
+
CustomBBoxValidator.MAX_LATITUDE = 85.05112878;
|
|
30
|
+
CustomBBoxValidator.MIN_LONGITUDE = -180;
|
|
31
|
+
CustomBBoxValidator.MAX_LONGITUDE = 180;
|
|
21
32
|
CustomBBoxValidator.validate = (value, _) => {
|
|
22
33
|
if (typeof value !== "string" || value.trim().length === 0 || value.length > 80 || !_a.BOUNDING_BOX_REGEX.test(value)) {
|
|
23
34
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomBBoxValidator.js","sourceRoot":"","sources":["../../../../../../src/output-gateway/public/routers/v2/helpers/CustomBBoxValidator.ts"],"names":[],"mappings":";;;;AAEA,MAAa,mBAAmB;
|
|
1
|
+
{"version":3,"file":"CustomBBoxValidator.js","sourceRoot":"","sources":["../../../../../../src/output-gateway/public/routers/v2/helpers/CustomBBoxValidator.ts"],"names":[],"mappings":";;;;AAEA,MAAa,mBAAmB;IAmCpB,MAAM,CAAC,eAAe,CAAC,QAAgB;QAC3C,OAAO,QAAQ,IAAI,IAAI,CAAC,YAAY,IAAI,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC;IAC1E,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,SAAiB;QAC7C,OAAO,SAAS,IAAI,IAAI,CAAC,aAAa,IAAI,SAAS,IAAI,IAAI,CAAC,aAAa,CAAC;IAC9E,CAAC;;AAzCL,kDA0CC;;AAzCG;;;;GAIG;AACqB,sCAAkB,GAAG,8CAA8C,AAAjD,CAAkD;AAE5F;;;;;;GAMG;AACqB,gCAAY,GAAG,CAAC,WAAW,AAAf,CAAgB;AAC5B,gCAAY,GAAG,WAAW,AAAd,CAAe;AAC3B,iCAAa,GAAG,CAAC,GAAG,AAAP,CAAQ;AACrB,iCAAa,GAAG,GAAG,AAAN,CAAO;AAE9B,4BAAQ,GAAoB,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,EAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtH,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAEnH,OAAO,CACH,EAAI,CAAC,eAAe,CAAC,MAAM,CAAC;QAC5B,EAAI,CAAC,eAAe,CAAC,SAAS,CAAC;QAC/B,EAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;QAC7B,EAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CACnC,CAAC;AACN,CAAC,AAbqB,CAapB"}
|
|
@@ -56,10 +56,12 @@ let VehicleDescriptorTripScopeHandler = class VehicleDescriptorTripScopeHandler
|
|
|
56
56
|
case RouteTypeEnums_1.GTFSRouteTypeEnum.TRAM:
|
|
57
57
|
switch (descriptor.type) {
|
|
58
58
|
case "T3R.P":
|
|
59
|
+
return "Mašinka Tomáš";
|
|
59
60
|
case "T3R.PLF":
|
|
60
61
|
case "T3R.PV":
|
|
61
62
|
case "T3M.2":
|
|
62
|
-
|
|
63
|
+
case "T3SUCS":
|
|
64
|
+
return "Hogwarts Express";
|
|
63
65
|
case "KT8D5.RN2P":
|
|
64
66
|
return "Orient Express";
|
|
65
67
|
case "14T":
|
|
@@ -68,10 +70,13 @@ let VehicleDescriptorTripScopeHandler = class VehicleDescriptorTripScopeHandler
|
|
|
68
70
|
case "15T2":
|
|
69
71
|
case "15T3":
|
|
70
72
|
case "15T4":
|
|
73
|
+
return "Shinkansen";
|
|
71
74
|
case "15T5":
|
|
72
75
|
case "15T6":
|
|
73
76
|
case "15T7":
|
|
74
77
|
return "Snowpiercer";
|
|
78
|
+
case "52T":
|
|
79
|
+
return "Shai-Hulud";
|
|
75
80
|
default:
|
|
76
81
|
return "Trainy McTrainface";
|
|
77
82
|
}
|
|
@@ -93,22 +98,36 @@ let VehicleDescriptorTripScopeHandler = class VehicleDescriptorTripScopeHandler
|
|
|
93
98
|
case "Scania":
|
|
94
99
|
return "Mr. Slowly";
|
|
95
100
|
case "MAN":
|
|
96
|
-
return "
|
|
101
|
+
return "Bumblebee";
|
|
97
102
|
case "Solaris":
|
|
98
103
|
return "Citroën DS Fantomas";
|
|
99
104
|
case "ROŠERO - P":
|
|
100
105
|
return "The Mystery Machine";
|
|
106
|
+
case "Mercedes-Benz":
|
|
107
|
+
return "Optimus Prime";
|
|
108
|
+
case "Škoda":
|
|
109
|
+
return "Tatra T815 aka The War Rig";
|
|
101
110
|
default:
|
|
102
111
|
return "Bussy McBusface";
|
|
103
112
|
}
|
|
104
113
|
case RouteTypeEnums_1.GTFSRouteTypeEnum.FERRY:
|
|
105
|
-
|
|
114
|
+
switch ((vehiclePosition.detailed_info.registration_number ?? 0) % 3) {
|
|
115
|
+
case 1:
|
|
116
|
+
return "Black Pearl";
|
|
117
|
+
case 2:
|
|
118
|
+
return "Flying Dutchman";
|
|
119
|
+
case 0:
|
|
120
|
+
default:
|
|
121
|
+
return "RMS Titanic";
|
|
122
|
+
}
|
|
106
123
|
case RouteTypeEnums_1.GTFSRouteTypeEnum.TROLLEYBUS:
|
|
107
124
|
switch (descriptor.manufacturer) {
|
|
108
125
|
case "Škoda-Solaris":
|
|
109
126
|
return "Lightning McQueen";
|
|
127
|
+
case "SOR":
|
|
128
|
+
return "Ectomobile";
|
|
110
129
|
default:
|
|
111
|
-
return "
|
|
130
|
+
return "Trolley McTrolleyface";
|
|
112
131
|
}
|
|
113
132
|
default:
|
|
114
133
|
return `${descriptor.manufacturer} ${descriptor.type}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VehicleDescriptorTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6EAA4D;AAC5D,iHAA6G;AAE7G,iEAA6D;AAC7D,qIAA4I;AAG5I,iEAAwE;AACxE,yFAAsF;AAG/E,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,mEAAgC;IAGnF,YAEY,2BAA8D;QAEtE,KAAK,EAAE,CAAC;QAFA,gCAA2B,GAA3B,2BAA2B,CAAmC;QAGtE,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,eAAe,CAAC,UAAU,EAAE,CAAC;YACjC,KAAK,kCAAiB,CAAC,IAAI;gBACvB,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;oBACtB,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VehicleDescriptorTripScopeHandler.js","sourceRoot":"","sources":["../../../../../../../src/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6EAA4D;AAC5D,iHAA6G;AAE7G,iEAA6D;AAC7D,qIAA4I;AAG5I,iEAAwE;AACxE,yFAAsF;AAG/E,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,mEAAgC;IAGnF,YAEY,2BAA8D;QAEtE,KAAK,EAAE,CAAC;QAFA,gCAA2B,GAA3B,2BAA2B,CAAmC;QAGtE,IAAI,CAAC,+BAA+B,GAAG,IAAI,iFAAuC,EAAE,CAAC;IACzF,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,MAA8B,EAAE,eAAmC;QACnF,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,+BAA+B,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;QAEnG,MAAM,kBAAkB,GAAG,eAAe,CAAC,aAAa,CAAC,mBAAmB,CAAC;QAC7E,IAAI,kBAAkB,EAAE,CAAC;YACrB,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU,CAAC;YAC7C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;YAE3G,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,OAAO,MAAM,CAAC;YAClB,CAAC;YAED,MAAM,CAAC,kBAAkB,GAAG;gBACxB,GAAG,MAAM,CAAC,kBAAkB;gBAC5B,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,eAAe,CAAC;gBAC9D,kBAAkB,EAAE,UAAU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AAY,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;QAC/D,CAAC;IACL,CAAC;CACJ,CAAA;AA7HY,8EAAiC;4CAAjC,iCAAiC;IAD7C,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,6BAAa,CAAC,iCAAiC,CAAC,CAAA;qCACnB,qEAAiC;GALjE,iCAAiC,CA6H7C"}
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -1646,7 +1646,7 @@ paths:
|
|
|
1646
1646
|
type: string
|
|
1647
1647
|
example: '50.123,14.243,50.017,14.573'
|
|
1648
1648
|
description: |
|
|
1649
|
-
Filter by bounding box in format "topLeft.lat,topLeft.lon,bottomRight.lat,bottomRight.lon". Latitude must be in range -
|
|
1649
|
+
Filter by bounding box in format "topLeft.lat,topLeft.lon,bottomRight.lat,bottomRight.lon". Latitude must be in range -85.05112878 to 85.05112878 (supported by Redis GEO commands), longitude in range -180 to 180. Polygons that fit only partially to selected bounding box are included.
|
|
1650
1650
|
- name: routeShortName
|
|
1651
1651
|
in: query
|
|
1652
1652
|
schema:
|