@hestia-earth/api 0.25.64 → 0.25.65

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.
@@ -4,3 +4,5 @@ export declare class UrlShortener extends BaseModel {
4
4
  path: string;
5
5
  count: number;
6
6
  }
7
+ export declare const whitelistedQueryParams: Record<string, string[]>;
8
+ export declare const isShortPathAllowed: (path: string) => boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UrlShortener = void 0;
3
+ exports.isShortPathAllowed = exports.whitelistedQueryParams = exports.UrlShortener = void 0;
4
4
  const model_base_1 = require("../../db/model.base");
5
5
  class UrlShortener extends model_base_1.BaseModel {
6
6
  shortId;
@@ -8,3 +8,8 @@ class UrlShortener extends model_base_1.BaseModel {
8
8
  count;
9
9
  }
10
10
  exports.UrlShortener = UrlShortener;
11
+ exports.whitelistedQueryParams = {
12
+ '/explorer': ['sortBy', 'sortOrder', 'page', 'dataVersion', 'type', 'filters']
13
+ };
14
+ const isShortPathAllowed = (path) => path.split('?')[0] in exports.whitelistedQueryParams;
15
+ exports.isShortPathAllowed = isShortPathAllowed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/api",
3
- "version": "0.25.64",
3
+ "version": "0.25.65",
4
4
  "description": "Hestia API definitions",
5
5
  "main": "dist/models.js",
6
6
  "typings": "dist/models.d.ts",