@golemio/pid 5.8.1-dev.2403320242 → 5.8.1-dev.2403333995

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.
@@ -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 >= -90 && latitude <= 90;
7
+ return latitude >= this.MIN_LATITUDE && latitude <= this.MAX_LATITUDE;
8
8
  }
9
9
  static isLongitudeValid(longitude) {
10
- return longitude >= -180 && longitude <= 180;
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;IAuBpB,MAAM,CAAC,eAAe,CAAC,QAAgB;QAC3C,OAAO,QAAQ,IAAI,CAAC,EAAE,IAAI,QAAQ,IAAI,EAAE,CAAC;IAC7C,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,SAAiB;QAC7C,OAAO,SAAS,IAAI,CAAC,GAAG,IAAI,SAAS,IAAI,GAAG,CAAC;IACjD,CAAC;;AA7BL,kDA8BC;;AA7BG;;;;GAIG;AACY,sCAAkB,GAAG,8CAA8C,AAAjD,CAAkD;AAErE,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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AE,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"}
@@ -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 -90 to 90, longitude in range -180 to 180. Polygons that fit only partialy to selected bounding box are included
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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/pid",
3
- "version": "5.8.1-dev.2403320242",
3
+ "version": "5.8.1-dev.2403333995",
4
4
  "description": "Golemio PID Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",