@hestia-earth/api 0.17.2 → 0.17.4
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.
|
@@ -17,8 +17,6 @@ export declare const parseLogMissingLookups: (data: string) => {
|
|
|
17
17
|
termId: any;
|
|
18
18
|
column: any;
|
|
19
19
|
}[];
|
|
20
|
-
export declare const formatForUpload: (
|
|
21
|
-
[
|
|
22
|
-
"@type": any;
|
|
23
|
-
"@id": any;
|
|
20
|
+
export declare const formatForUpload: (nodes: any[], typeToId?: {
|
|
21
|
+
[type: string]: string[];
|
|
24
22
|
}) => any;
|
|
@@ -91,19 +91,27 @@ exports.parseLogMissingLookups = function (data) {
|
|
|
91
91
|
var messages = lines.map(parseMessage).filter(function (v) { return Object.keys(v).length > 1; });
|
|
92
92
|
return utils_1.unique(messages.map(parseLookup));
|
|
93
93
|
};
|
|
94
|
-
|
|
95
|
-
var type = _a["@type"], id = _a["@id"]
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
var mapTypeToId = function (nodes) { return nodes.reduce(function (prev, _a) {
|
|
95
|
+
var type = _a["@type"], id = _a["@id"];
|
|
96
|
+
prev[type] = prev[type] || [];
|
|
97
|
+
prev[type].push(id);
|
|
98
|
+
return prev;
|
|
99
|
+
}, {}); };
|
|
100
|
+
exports.formatForUpload = function (nodes, typeToId) {
|
|
101
|
+
if (typeToId === void 0) { typeToId = mapTypeToId(nodes); }
|
|
102
|
+
return nodes.map(function (_a) {
|
|
103
|
+
var _b;
|
|
104
|
+
var type = _a["@type"], id = _a["@id"], node = __rest(_a, ['@type', '@id']);
|
|
105
|
+
return type === schema_1.NodeType.Term
|
|
106
|
+
? { '@type': type, '@id': id }
|
|
107
|
+
: utils_1.reduceUndefinedValues(__assign(__assign({}, (!id || ((_b = typeToId[type]) !== null && _b !== void 0 ? _b : []).includes(id) ? { type: type, id: id } : { '@type': type, '@id': id })), Object.fromEntries(Object.entries(node).map(function (_a) {
|
|
108
|
+
var key = _a[0], value = _a[1];
|
|
109
|
+
var newValue = schema_1.isExpandable(value)
|
|
110
|
+
? Array.isArray(value)
|
|
111
|
+
? exports.formatForUpload(value, typeToId)
|
|
112
|
+
: exports.formatForUpload([value], typeToId)[0]
|
|
113
|
+
: value;
|
|
114
|
+
return [key, newValue];
|
|
115
|
+
}))));
|
|
116
|
+
});
|
|
109
117
|
};
|
|
@@ -21,6 +21,7 @@ export declare class User extends BaseModel {
|
|
|
21
21
|
maxUploads: number;
|
|
22
22
|
maxApiCalls: number;
|
|
23
23
|
dataPrivate: boolean;
|
|
24
|
+
validFilesCount: number;
|
|
24
25
|
emailNotificationsSuccess: boolean;
|
|
25
26
|
emailNotificationsFailure: boolean;
|
|
26
27
|
emailNotificationsFeedback: boolean;
|
|
@@ -42,7 +42,9 @@ var UserRole;
|
|
|
42
42
|
var User = (function (_super) {
|
|
43
43
|
__extends(User, _super);
|
|
44
44
|
function User() {
|
|
45
|
-
|
|
45
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
46
|
+
_this.validFilesCount = 0;
|
|
47
|
+
return _this;
|
|
46
48
|
}
|
|
47
49
|
return User;
|
|
48
50
|
}(model_base_1.BaseModel));
|