@hestia-earth/api 0.11.3 → 0.12.2

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.
@@ -9,7 +9,7 @@ export declare const dataStatesTypeMapping: {
9
9
  [state in DataState]: (SchemaType | NodeType)[];
10
10
  };
11
11
  export declare const allowedDataStates: (type: SchemaType | NodeType) => DataState[];
12
- export declare const pathWithState: (type: SchemaType | NodeType, id: string, dataState?: DataState) => string;
12
+ export declare const pathWithState: (type: SchemaType | NodeType, id: string, dataState?: DataState, strictDataState?: boolean) => string;
13
13
  export declare const nodeTypeToParam: (type: NodeType) => string;
14
14
  export declare const paramToNodeType: (type: string) => NodeType;
15
15
  export declare const parseLogMissingLookups: (data: string) => {
@@ -53,13 +53,14 @@ exports.dataStatesTypeMapping = (_a = {},
53
53
  exports.allowedDataStates = function (type) {
54
54
  return Object.values(DataState).filter(function (dataState) { return exports.dataStatesTypeMapping[dataState].includes(type); });
55
55
  };
56
- exports.pathWithState = function (type, id, dataState) {
56
+ exports.pathWithState = function (type, id, dataState, strictDataState) {
57
57
  if (dataState === void 0) { dataState = DataState.original; }
58
+ if (strictDataState === void 0) { strictDataState = false; }
58
59
  var state = exports.dataStatesTypeMapping[dataState].includes(type) ? dataState : null;
59
- return [
60
+ return (state !== null || !strictDataState) ? [
60
61
  state === DataState.original ? null : state,
61
62
  schema_1.jsonldPath(type, id)
62
- ].filter(Boolean).join('/');
63
+ ].filter(Boolean).join('/') : null;
63
64
  };
64
65
  exports.nodeTypeToParam = function (type) { return (type || '').toLowerCase() + "s"; };
65
66
  exports.paramToNodeType = function (type) { return Object.values(schema_1.NodeType).find(function (v) { return exports.nodeTypeToParam(v) === type; }); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/api",
3
- "version": "0.11.3",
3
+ "version": "0.12.2",
4
4
  "description": "Hestia API definitions",
5
5
  "main": "dist/models.js",
6
6
  "typings": "dist/models.d.ts",
@@ -30,17 +30,17 @@
30
30
  "author": "Guillaume Royer <guillaumeroyer.mail@gmail.com>",
31
31
  "license": "UNLICENSED",
32
32
  "dependencies": {
33
- "@hestia-earth/schema": "^8.0.0"
33
+ "@hestia-earth/schema": "^9.6.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@commitlint/cli": "^16.2.4",
37
37
  "@commitlint/config-conventional": "^16.2.4",
38
38
  "@elastic/elasticsearch": "7.13.0",
39
- "@hestia-earth/eslint-config": "0.0.3",
40
- "@hestia-earth/json-schema": "^8.0.0",
41
- "@hestia-earth/schema-convert": "^8.0.0",
42
- "@hestia-earth/schema-validation": "^8.0.0",
43
- "@hestia-earth/utils": "^0.10.20",
39
+ "@hestia-earth/eslint-config": "^0.0.4",
40
+ "@hestia-earth/json-schema": "^9.6.0",
41
+ "@hestia-earth/schema-convert": "^9.6.0",
42
+ "@hestia-earth/schema-validation": "^9.6.0",
43
+ "@hestia-earth/utils": "^0.10.24",
44
44
  "@mendeley/api": "^10.0.2",
45
45
  "@sentry/node": "^6.18.2",
46
46
  "@sentry/tracing": "^6.18.2",
@@ -74,7 +74,7 @@
74
74
  "cors": "^2.8.4",
75
75
  "dotenv": "^6.0.0",
76
76
  "eslint": "^7.32.0",
77
- "eslint-plugin-jsdoc": "^25.4.3",
77
+ "eslint-plugin-jsdoc": "^30.7.13",
78
78
  "express": "^4.17.3",
79
79
  "express-async-errors": "^3.1.1",
80
80
  "express-recaptcha": "^5.1.0",