@hestia-earth/api 0.24.46 → 0.24.48
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.
|
@@ -185,7 +185,6 @@ export declare const validatedStatuses: FileStatus[];
|
|
|
185
185
|
export declare const canValidate: ({ status, isPrivate, archived }: Partial<File>, user: Pick<User, 'role'>) => boolean;
|
|
186
186
|
export declare const isValidated: ({ validatedAt, status }: Partial<File>) => boolean;
|
|
187
187
|
export declare const canSubmit: (file: Partial<File>, user: User) => boolean;
|
|
188
|
-
export declare const canFeedback: ({ status }: File) => boolean;
|
|
189
188
|
export declare const isDraft: ({ filepath, filename }: Partial<File>) => boolean;
|
|
190
189
|
export declare const canEditComment: (comment: IFileComment, user: User) => boolean;
|
|
191
190
|
export declare const canCommitHestiaData: (file: File, user: User) => boolean;
|
|
@@ -26,7 +26,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
26
26
|
var _a;
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.validatedStatuses = exports.canRemove = exports.isAssigned = exports.isAuthorized = exports.isOwner = exports.userFolder = exports.isFolderUpload = exports.isAdminFolder = exports.isAggregation = exports.aggregationFolder = exports.isTerm = exports.isGlossary = exports.isReconciliation = exports.isAnalysis = exports.reconciliationFolder = exports.termFolder = exports.glossaryFolder = exports.analysesFolder = exports.filenameFromPath = exports.rootFolderFromPath = exports.folderFromPath = exports.normalizeFolder = exports.isFilepathValid = exports.isFilenameValid = exports.canUploadFolderFile = exports.canUseFolder = exports.replaceInvalidChars = exports.validPathChars = exports.filenameWithoutExt = exports.fileToExt = exports.isSupportedExt = exports.fileExt = exports.filepathSearch = exports.filenameSearch = exports.File = exports.FilePipelineError = exports.FilePipelineProgress = exports.FilePipelineStatus = exports.FileError = exports.FileStatus = exports.FileProgress = exports.FileFindFields = exports.HestiaExtensions = exports.finalFormatExtensions = exports.maxFileSizeByFile = exports.SupportedExtensions = exports.maxFileSize = exports.maxFileSizeMb = exports.sizeInMb = exports.mb = void 0;
|
|
29
|
-
exports.canCommitHestiaData = exports.canEditComment = exports.isDraft = exports.
|
|
29
|
+
exports.canCommitHestiaData = exports.canEditComment = exports.isDraft = exports.canSubmit = exports.isValidated = exports.canValidate = void 0;
|
|
30
30
|
var model_base_1 = require("../../db/model.base");
|
|
31
31
|
var model_1 = require("../../users/model/model");
|
|
32
32
|
exports.mb = 1048576;
|
|
@@ -251,7 +251,9 @@ exports.isTerm = isTerm;
|
|
|
251
251
|
exports.aggregationFolder = 'aggregation';
|
|
252
252
|
var isAggregation = function (path) { return (0, exports.rootFolderFromPath)(path) === exports.aggregationFolder; };
|
|
253
253
|
exports.isAggregation = isAggregation;
|
|
254
|
-
var isAdminFolder = function (path) {
|
|
254
|
+
var isAdminFolder = function (path) {
|
|
255
|
+
return !!path && [exports.isTerm, exports.isAnalysis, exports.isAggregation, exports.isReconciliation].some(function (f) { return f(path); });
|
|
256
|
+
};
|
|
255
257
|
exports.isAdminFolder = isAdminFolder;
|
|
256
258
|
var isFolderUpload = function (path, termsOnly) {
|
|
257
259
|
if (termsOnly === void 0) { termsOnly = false; }
|
|
@@ -295,23 +297,6 @@ var canSubmit = function (file, user) {
|
|
|
295
297
|
((0, exports.isOwner)(file, user) || (0, exports.isAuthorized)(file, user));
|
|
296
298
|
};
|
|
297
299
|
exports.canSubmit = canSubmit;
|
|
298
|
-
var feedbackStatuses = [
|
|
299
|
-
FileStatus.checkExistingDone,
|
|
300
|
-
FileStatus.extendBibliographyDone,
|
|
301
|
-
FileStatus.addMetadataDone,
|
|
302
|
-
FileStatus.validateHestiaDone,
|
|
303
|
-
FileStatus.validateDataDone,
|
|
304
|
-
FileError.checkExistingError,
|
|
305
|
-
FileError.extendBibliographyError,
|
|
306
|
-
FileError.addMetadataError,
|
|
307
|
-
FileError.validateHestiaError,
|
|
308
|
-
FileError.validateDataError
|
|
309
|
-
];
|
|
310
|
-
var canFeedback = function (_a) {
|
|
311
|
-
var status = _a.status;
|
|
312
|
-
return feedbackStatuses.includes(status);
|
|
313
|
-
};
|
|
314
|
-
exports.canFeedback = canFeedback;
|
|
315
300
|
var isDraft = function (_a) {
|
|
316
301
|
var filepath = _a.filepath, filename = _a.filename;
|
|
317
302
|
return (filepath || filename || '').endsWith(SupportedExtensions.draft);
|