@hestia-earth/api 0.12.0 → 0.12.3
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/nodes/model/model.d.ts +5 -0
- package/dist/nodes/model/model.js +17 -1
- package/package.json +10 -10
|
@@ -18,3 +18,8 @@ export declare const parseLogMissingLookups: (data: string) => {
|
|
|
18
18
|
column: any;
|
|
19
19
|
}[];
|
|
20
20
|
export declare const groupLogsByModel: (data: string) => any;
|
|
21
|
+
export declare const formatForUpload: ({ "@type": type, "@id": id, ...node }: {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
"@type": any;
|
|
24
|
+
"@id": any;
|
|
25
|
+
}) => any;
|
|
@@ -30,7 +30,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
30
30
|
};
|
|
31
31
|
var _a;
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.groupLogsByModel = exports.parseLogMissingLookups = exports.paramToNodeType = exports.nodeTypeToParam = exports.pathWithState = exports.allowedDataStates = exports.dataStatesTypeMapping = exports.DataState = exports.blankNodeTypes = void 0;
|
|
33
|
+
exports.formatForUpload = exports.groupLogsByModel = exports.parseLogMissingLookups = exports.paramToNodeType = exports.nodeTypeToParam = exports.pathWithState = exports.allowedDataStates = exports.dataStatesTypeMapping = exports.DataState = exports.blankNodeTypes = void 0;
|
|
34
34
|
var schema_1 = require("@hestia-earth/schema");
|
|
35
35
|
var utils_1 = require("@hestia-earth/utils");
|
|
36
36
|
var model_1 = require("../../files/model/model");
|
|
@@ -182,3 +182,19 @@ exports.groupLogsByModel = function (data) {
|
|
|
182
182
|
: groupLog(group, log);
|
|
183
183
|
});
|
|
184
184
|
};
|
|
185
|
+
exports.formatForUpload = function (_a) {
|
|
186
|
+
var type = _a["@type"], id = _a["@id"], node = __rest(_a, ['@type', '@id']);
|
|
187
|
+
return type === schema_1.NodeType.Term
|
|
188
|
+
? { '@type': type, '@id': id }
|
|
189
|
+
: utils_1.reduceUndefinedValues(__assign({ type: type,
|
|
190
|
+
id: id }, Object.fromEntries(Object.entries(node).map(function (_a) {
|
|
191
|
+
var key = _a[0], value = _a[1];
|
|
192
|
+
var isArray = Array.isArray(value);
|
|
193
|
+
var newValue = schema_1.isExpandable(value)
|
|
194
|
+
? isArray
|
|
195
|
+
? value.map(exports.formatForUpload)
|
|
196
|
+
: exports.formatForUpload(value)
|
|
197
|
+
: value;
|
|
198
|
+
return [key, newValue];
|
|
199
|
+
}))));
|
|
200
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hestia-earth/api",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
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": "^9.
|
|
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.
|
|
40
|
-
"@hestia-earth/json-schema": "^9.
|
|
41
|
-
"@hestia-earth/schema-convert": "^9.
|
|
42
|
-
"@hestia-earth/schema-validation": "^9.
|
|
43
|
-
"@hestia-earth/utils": "^0.10.
|
|
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": "^
|
|
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",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"swagger-jsdoc": "^4.3.2",
|
|
110
110
|
"swagger-ui-dist": "^4.6.2",
|
|
111
111
|
"swagger-ui-express": "^4.3.0",
|
|
112
|
-
"ts-node": "^
|
|
113
|
-
"ts-node-dev": "^
|
|
112
|
+
"ts-node": "^10.9.1",
|
|
113
|
+
"ts-node-dev": "^2.0.0",
|
|
114
114
|
"typescript": "^3.9.10",
|
|
115
115
|
"uid-generator": "^2.0.0",
|
|
116
116
|
"winston": "^3.6.0"
|