identity-admin 1.28.2 → 1.28.5
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/README.md +294 -294
- package/lib/Dashboard.d.ts +14 -14
- package/lib/Dashboard.js +95 -95
- package/lib/container/helpers/HelperInversify.d.ts +6 -6
- package/lib/container/helpers/HelperInversify.js +10 -10
- package/lib/container/helpers/HelperTypes.d.ts +5 -5
- package/lib/container/helpers/HelperTypes.js +7 -7
- package/lib/container/index.d.ts +1 -1
- package/lib/container/index.js +14 -14
- package/lib/container/repositories/RepositoryInversify.d.ts +4 -4
- package/lib/container/repositories/RepositoryInversify.js +13 -13
- package/lib/container/repositories/RepositoryTypes.d.ts +4 -4
- package/lib/container/repositories/RepositoryTypes.js +6 -6
- package/lib/container/types.d.ts +8 -8
- package/lib/container/types.js +9 -9
- package/lib/controllers/ActionController.d.ts +8 -8
- package/lib/controllers/ActionController.js +96 -96
- package/lib/controllers/AdminNotificationController.d.ts +8 -8
- package/lib/controllers/AdminNotificationController.js +69 -69
- package/lib/controllers/DashboardController.d.ts +44 -44
- package/lib/controllers/DashboardController.js +787 -787
- package/lib/controllers/ResourceController.d.ts +15 -15
- package/lib/controllers/ResourceController.js +135 -135
- package/lib/helpers/ActionsGenerator.d.ts +11 -11
- package/lib/helpers/ActionsGenerator.js +179 -179
- package/lib/helpers/AdminNotifications/AdminNotificationCreation.d.ts +49 -49
- package/lib/helpers/AdminNotifications/AdminNotificationCreation.js +66 -66
- package/lib/helpers/AdminNotifications/AdminNotificationFetcher.d.ts +51 -51
- package/lib/helpers/AdminNotifications/AdminNotificationFetcher.js +39 -39
- package/lib/helpers/FilterQueryHelper.d.ts +9 -9
- package/lib/helpers/FilterQueryHelper.js +83 -83
- package/lib/helpers/FiltersHelper.d.ts +9 -9
- package/lib/helpers/FiltersHelper.js +126 -126
- package/lib/helpers/LocalesHelper.d.ts +4 -4
- package/lib/helpers/LocalesHelper.js +73 -73
- package/lib/helpers/LocalizedStringHelper.d.ts +11 -11
- package/lib/helpers/LocalizedStringHelper.js +74 -74
- package/lib/helpers/Permissions/PermissionFetcher.d.ts +8 -8
- package/lib/helpers/Permissions/PermissionFetcher.js +95 -95
- package/lib/helpers/Permissions/PermissionLabel.d.ts +2 -2
- package/lib/helpers/Permissions/PermissionLabel.js +42 -42
- package/lib/helpers/Permissions/PermissionMapper.d.ts +13 -13
- package/lib/helpers/Permissions/PermissionMapper.js +35 -35
- package/lib/helpers/Permissions/PermissionResource.d.ts +6 -6
- package/lib/helpers/Permissions/PermissionResource.js +62 -62
- package/lib/helpers/Permissions/PermissionSavingService.d.ts +13 -13
- package/lib/helpers/Permissions/PermissionSavingService.js +32 -32
- package/lib/helpers/Permissions/SavePermissionGroup.d.ts +6 -6
- package/lib/helpers/Permissions/SavePermissionGroup.js +32 -32
- package/lib/helpers/Permissions/UpdatePermissionGroup.d.ts +6 -6
- package/lib/helpers/Permissions/UpdatePermissionGroup.js +50 -50
- package/lib/helpers/Permissions/types.d.ts +17 -17
- package/lib/helpers/Permissions/types.js +2 -2
- package/lib/helpers/PopulationHelper.d.ts +12 -12
- package/lib/helpers/PopulationHelper.js +50 -50
- package/lib/helpers/RecordsCounter.d.ts +10 -10
- package/lib/helpers/RecordsCounter.js +33 -33
- package/lib/helpers/ReportsGenerator.d.ts +26 -26
- package/lib/helpers/ReportsGenerator.js +162 -162
- package/lib/helpers/ResourceGenerator.d.ts +9 -9
- package/lib/helpers/ResourceGenerator.js +172 -172
- package/lib/helpers/ResourceHelper.d.ts +28 -28
- package/lib/helpers/ResourceHelper.js +395 -395
- package/lib/helpers/RportsGenerator.d.ts +10 -10
- package/lib/helpers/RportsGenerator.js +21 -21
- package/lib/helpers/SchemaGenerator.d.ts +7 -7
- package/lib/helpers/SchemaGenerator.js +130 -130
- package/lib/helpers/SchemaHelper.d.ts +5 -5
- package/lib/helpers/SchemaHelper.js +21 -21
- package/lib/helpers/UserActionsLog/UserActionsLogHelper.d.ts +2 -2
- package/lib/helpers/UserActionsLog/UserActionsLogHelper.js +49 -49
- package/lib/locales/en.json +53 -53
- package/lib/middlewares/cache/decorator.d.ts +3 -3
- package/lib/middlewares/cache/decorator.js +60 -60
- package/lib/middlewares/cache/deletionMethods.d.ts +3 -3
- package/lib/middlewares/cache/deletionMethods.js +23 -23
- package/lib/middlewares/isAuth.d.ts +13 -13
- package/lib/middlewares/isAuth.js +43 -43
- package/lib/models/ModelNames.d.ts +9 -9
- package/lib/models/ModelNames.js +12 -12
- package/lib/models/adminNotification/AdminNotification.d.ts +5 -5
- package/lib/models/adminNotification/AdminNotification.js +53 -53
- package/lib/models/adminNotification/IAdminNotification.d.ts +30 -30
- package/lib/models/adminNotification/IAdminNotification.js +15 -15
- package/lib/models/adminpermission/AdminPermission.d.ts +11 -11
- package/lib/models/adminpermission/AdminPermission.js +23 -23
- package/lib/models/adminpermission/IAdminPermission.d.ts +13 -13
- package/lib/models/adminpermission/IAdminPermission.js +2 -2
- package/lib/models/customPage/CustomPage.d.ts +2 -2
- package/lib/models/customPage/CustomPage.js +38 -38
- package/lib/models/customPage/ICustomPage.d.ts +17 -17
- package/lib/models/customPage/ICustomPage.js +2 -2
- package/lib/models/file/File.d.ts +2 -2
- package/lib/models/file/File.js +23 -23
- package/lib/models/file/IFile.d.ts +15 -15
- package/lib/models/file/IFile.js +2 -2
- package/lib/models/location/ILocation.d.ts +14 -14
- package/lib/models/location/ILocation.js +2 -2
- package/lib/models/location/Location.d.ts +2 -2
- package/lib/models/location/Location.js +21 -21
- package/lib/models/modelConfiguration/IModelConfigurations.d.ts +29 -29
- package/lib/models/modelConfiguration/IModelConfigurations.js +2 -2
- package/lib/models/modelConfiguration/ModelConfiguration.d.ts +13 -13
- package/lib/models/modelConfiguration/ModelConfiguration.js +95 -95
- package/lib/models/permission/IPermission.d.ts +14 -14
- package/lib/models/permission/IPermission.js +2 -2
- package/lib/models/permission/Permission.d.ts +2 -2
- package/lib/models/permission/Permission.js +21 -21
- package/lib/models/request-log/IRequestLog.d.ts +22 -22
- package/lib/models/request-log/IRequestLog.js +2 -2
- package/lib/models/request-log/RequestLog.d.ts +3 -3
- package/lib/models/request-log/RequestLog.js +51 -51
- package/lib/models/userActionsLog/IUserActionsLog.d.ts +26 -26
- package/lib/models/userActionsLog/IUserActionsLog.js +11 -11
- package/lib/models/userActionsLog/UserActionsLog.d.ts +3 -3
- package/lib/models/userActionsLog/UserActionsLog.js +41 -41
- package/lib/pdf/ReportTemplate.d.ts +71 -71
- package/lib/pdf/ReportTemplate.js +94 -94
- package/lib/repositories/AdminNotificationRepository.d.ts +7 -7
- package/lib/repositories/AdminNotificationRepository.js +23 -23
- package/lib/repositories/DashboardRepository.d.ts +5 -5
- package/lib/repositories/DashboardRepository.js +12 -12
- package/lib/repositories/Repository.d.ts +68 -68
- package/lib/repositories/Repository.js +215 -215
- package/lib/repositories/RequestLogRepository.d.ts +10 -10
- package/lib/repositories/RequestLogRepository.js +54 -54
- package/lib/repositories/SaveResult.d.ts +14 -14
- package/lib/repositories/SaveResult.js +18 -18
- package/lib/resources/AdminNotificationsResource.d.ts +3 -3
- package/lib/resources/AdminNotificationsResource.js +23 -23
- package/lib/resources/parents.d.ts +4 -4
- package/lib/resources/parents.js +7 -7
- package/lib/router/index.d.ts +8 -8
- package/lib/router/index.js +104 -104
- package/lib/types/DashbordConfig.d.ts +21 -21
- package/lib/types/DashbordConfig.js +2 -2
- package/lib/types/IConfigurationFile.d.ts +11 -11
- package/lib/types/IConfigurationFile.js +2 -2
- package/lib/types/IResourceFile.d.ts +710 -701
- package/lib/types/IResourceFile.js +2 -2
- package/lib/types/IResourceResponse.d.ts +95 -95
- package/lib/types/IResourceResponse.js +2 -2
- package/lib/types/helpers.d.ts +66 -66
- package/lib/types/helpers.js +77 -77
- package/lib/utils/DateUtils.d.ts +7 -7
- package/lib/utils/DateUtils.js +45 -45
- package/lib/utils/ResourceUtils.d.ts +2 -2
- package/lib/utils/ResourceUtils.js +7 -7
- package/lib/utils/ResponseUtils.d.ts +11 -11
- package/lib/utils/ResponseUtils.js +41 -41
- package/lib/utils/StringUtils.d.ts +9 -9
- package/lib/utils/StringUtils.js +46 -46
- package/lib/view/asset-manifest.json +18 -18
- package/lib/view/assets/icons/delete_icon.svg +3 -3
- package/lib/view/assets/icons/flags/ic_flag_cn.svg +9 -9
- package/lib/view/assets/icons/flags/ic_flag_sa.svg +9 -9
- package/lib/view/assets/icons/flags/ic_flag_vn.svg +9 -9
- package/lib/view/assets/icons/info_icon.svg +3 -3
- package/lib/view/assets/icons/navbar/ic_banking.svg +5 -5
- package/lib/view/assets/icons/navbar/ic_invoice.svg +4 -4
- package/lib/view/assets/icons/navbar/ic_kanban.svg +7 -7
- package/lib/view/assets/icons/navbar/ic_menu_item.svg +8 -8
- package/lib/view/assets/icons/small_info_icon.svg +3 -3
- package/lib/view/assets/illustrations/Group 16.svg +4 -4
- package/lib/view/assets/illustrations/logo.svg +5 -5
- package/lib/view/favicon/browserconfig.xml +9 -9
- package/lib/view/favicon/safari-pinned-tab.svg +182 -182
- package/lib/view/favicon/site.webmanifest +19 -19
- package/lib/view/fonts/index.css +18 -18
- package/lib/view/index.html +52 -52
- package/lib/view/manifest.json +20 -20
- package/lib/view/robots.txt +3 -3
- package/lib/view/static/css/main.54de06ef.css +1 -1
- package/lib/view/static/js/574.778b5963.chunk.js +1 -1
- package/lib/view/static/js/678.521704a3.chunk.js +1 -1
- package/lib/view/static/js/798.54856416.chunk.js +1 -1
- package/lib/view/static/js/main.4687f255.js +2 -2
- package/lib/view/static/js/main.4687f255.js.LICENSE.txt +214 -214
- package/package.json +63 -63
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
9
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10
|
-
};
|
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
const inversify_express_utils_1 = require("inversify-express-utils");
|
|
25
|
-
const ResponseUtils_1 = __importDefault(require("../utils/ResponseUtils"));
|
|
26
|
-
const inversify_1 = require("inversify");
|
|
27
|
-
const AdminNotificationFetcher_1 = require("../helpers/AdminNotifications/AdminNotificationFetcher");
|
|
28
|
-
const AdminNotification_1 = __importDefault(require("../models/adminNotification/AdminNotification"));
|
|
29
|
-
let DashboardNotificationController = class DashboardNotificationController {
|
|
30
|
-
constructor() { }
|
|
31
|
-
index(req, res) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const notifications = yield AdminNotificationFetcher_1.AdminNotificationFetcher.fetchNotifications();
|
|
34
|
-
return ResponseUtils_1.default.send(res, 200, 'OK', notifications);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
markOneRead(req, res) {
|
|
38
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const { id } = req.params;
|
|
40
|
-
yield AdminNotification_1.default.updateOne({ _id: id }, { isRead: true });
|
|
41
|
-
return ResponseUtils_1.default.ok(res, {});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
markAllRead(req, res) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
yield AdminNotification_1.default.updateMany({ isRead: false }, { $set: { isRead: true } });
|
|
47
|
-
return ResponseUtils_1.default.ok(res, {});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, inversify_express_utils_1.httpGet)('/'),
|
|
53
|
-
__param(0, (0, inversify_express_utils_1.request)()),
|
|
54
|
-
__param(1, (0, inversify_express_utils_1.response)())
|
|
55
|
-
], DashboardNotificationController.prototype, "index", null);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, inversify_express_utils_1.httpPost)('/markAsRead/:id'),
|
|
58
|
-
__param(0, (0, inversify_express_utils_1.request)()),
|
|
59
|
-
__param(1, (0, inversify_express_utils_1.response)())
|
|
60
|
-
], DashboardNotificationController.prototype, "markOneRead", null);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, inversify_express_utils_1.httpPost)('/markAllAsRead'),
|
|
63
|
-
__param(0, (0, inversify_express_utils_1.request)()),
|
|
64
|
-
__param(1, (0, inversify_express_utils_1.response)())
|
|
65
|
-
], DashboardNotificationController.prototype, "markAllRead", null);
|
|
66
|
-
DashboardNotificationController = __decorate([
|
|
67
|
-
(0, inversify_1.injectable)()
|
|
68
|
-
], DashboardNotificationController);
|
|
69
|
-
exports.default = DashboardNotificationController;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
9
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10
|
+
};
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
const inversify_express_utils_1 = require("inversify-express-utils");
|
|
25
|
+
const ResponseUtils_1 = __importDefault(require("../utils/ResponseUtils"));
|
|
26
|
+
const inversify_1 = require("inversify");
|
|
27
|
+
const AdminNotificationFetcher_1 = require("../helpers/AdminNotifications/AdminNotificationFetcher");
|
|
28
|
+
const AdminNotification_1 = __importDefault(require("../models/adminNotification/AdminNotification"));
|
|
29
|
+
let DashboardNotificationController = class DashboardNotificationController {
|
|
30
|
+
constructor() { }
|
|
31
|
+
index(req, res) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const notifications = yield AdminNotificationFetcher_1.AdminNotificationFetcher.fetchNotifications();
|
|
34
|
+
return ResponseUtils_1.default.send(res, 200, 'OK', notifications);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
markOneRead(req, res) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const { id } = req.params;
|
|
40
|
+
yield AdminNotification_1.default.updateOne({ _id: id }, { isRead: true });
|
|
41
|
+
return ResponseUtils_1.default.ok(res, {});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
markAllRead(req, res) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
yield AdminNotification_1.default.updateMany({ isRead: false }, { $set: { isRead: true } });
|
|
47
|
+
return ResponseUtils_1.default.ok(res, {});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, inversify_express_utils_1.httpGet)('/'),
|
|
53
|
+
__param(0, (0, inversify_express_utils_1.request)()),
|
|
54
|
+
__param(1, (0, inversify_express_utils_1.response)())
|
|
55
|
+
], DashboardNotificationController.prototype, "index", null);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, inversify_express_utils_1.httpPost)('/markAsRead/:id'),
|
|
58
|
+
__param(0, (0, inversify_express_utils_1.request)()),
|
|
59
|
+
__param(1, (0, inversify_express_utils_1.response)())
|
|
60
|
+
], DashboardNotificationController.prototype, "markOneRead", null);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, inversify_express_utils_1.httpPost)('/markAllAsRead'),
|
|
63
|
+
__param(0, (0, inversify_express_utils_1.request)()),
|
|
64
|
+
__param(1, (0, inversify_express_utils_1.response)())
|
|
65
|
+
], DashboardNotificationController.prototype, "markAllRead", null);
|
|
66
|
+
DashboardNotificationController = __decorate([
|
|
67
|
+
(0, inversify_1.injectable)()
|
|
68
|
+
], DashboardNotificationController);
|
|
69
|
+
exports.default = DashboardNotificationController;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { Response } from 'express';
|
|
2
|
-
import { Document } from 'mongoose';
|
|
3
|
-
import { IResourceFile } from '../types/IResourceFile';
|
|
4
|
-
import { IDashboardRepository } from '../repositories/Repository';
|
|
5
|
-
import { IRequest } from '../middlewares/isAuth';
|
|
6
|
-
import { IModelConfigurationDocument } from '../models/modelConfiguration/IModelConfigurations';
|
|
7
|
-
export interface PaginateParams {
|
|
8
|
-
page: number;
|
|
9
|
-
perPage: number;
|
|
10
|
-
}
|
|
11
|
-
export default class DashboardController {
|
|
12
|
-
private resource?;
|
|
13
|
-
private repository?;
|
|
14
|
-
private resources?;
|
|
15
|
-
private modelConfigurations?;
|
|
16
|
-
protected static DEFAULT_PAGE: number;
|
|
17
|
-
protected static DEFAULT_PER_PAGE: number;
|
|
18
|
-
constructor(resource?: IResourceFile, repository?: IDashboardRepository);
|
|
19
|
-
constructor(resource?: IResourceFile, repository?: IDashboardRepository, resources?: IResourceFile[]);
|
|
20
|
-
constructor(resource?: IResourceFile, repository?: IDashboardRepository, resources?: IResourceFile[], modelConfigurations?: Map<string, IModelConfigurationDocument>);
|
|
21
|
-
protected validateRequest(req: IRequest, res: Response): boolean;
|
|
22
|
-
protected paginateParams(request: IRequest): PaginateParams;
|
|
23
|
-
protected getSearchableSubStringFilter(resource: IResourceFile, filter: {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
}, subString: RegExp): {
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
};
|
|
28
|
-
protected getScopeFilter(filter: {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
}, scope: string): {
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
};
|
|
33
|
-
protected getVisibileExtraActions(currentUser: Document, record: any, resource: IResourceFile, repository: any, modelName: string): Promise<string[] | undefined>;
|
|
34
|
-
protected getHiddenActions(currentUser: Document, record: any, resource: IResourceFile, repository: any, modelName: string): Promise<string[] | undefined>;
|
|
35
|
-
private getModelConfiguration;
|
|
36
|
-
index(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
37
|
-
create(req: IRequest, res: Response): Promise<void>;
|
|
38
|
-
update(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
39
|
-
report(req: IRequest, res: Response): Promise<void>;
|
|
40
|
-
show(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
41
|
-
deleteAll(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
42
|
-
delete(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
43
|
-
getNeighbors(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
44
|
-
}
|
|
1
|
+
import { Response } from 'express';
|
|
2
|
+
import { Document } from 'mongoose';
|
|
3
|
+
import { IResourceFile } from '../types/IResourceFile';
|
|
4
|
+
import { IDashboardRepository } from '../repositories/Repository';
|
|
5
|
+
import { IRequest } from '../middlewares/isAuth';
|
|
6
|
+
import { IModelConfigurationDocument } from '../models/modelConfiguration/IModelConfigurations';
|
|
7
|
+
export interface PaginateParams {
|
|
8
|
+
page: number;
|
|
9
|
+
perPage: number;
|
|
10
|
+
}
|
|
11
|
+
export default class DashboardController {
|
|
12
|
+
private resource?;
|
|
13
|
+
private repository?;
|
|
14
|
+
private resources?;
|
|
15
|
+
private modelConfigurations?;
|
|
16
|
+
protected static DEFAULT_PAGE: number;
|
|
17
|
+
protected static DEFAULT_PER_PAGE: number;
|
|
18
|
+
constructor(resource?: IResourceFile, repository?: IDashboardRepository);
|
|
19
|
+
constructor(resource?: IResourceFile, repository?: IDashboardRepository, resources?: IResourceFile[]);
|
|
20
|
+
constructor(resource?: IResourceFile, repository?: IDashboardRepository, resources?: IResourceFile[], modelConfigurations?: Map<string, IModelConfigurationDocument>);
|
|
21
|
+
protected validateRequest(req: IRequest, res: Response): boolean;
|
|
22
|
+
protected paginateParams(request: IRequest): PaginateParams;
|
|
23
|
+
protected getSearchableSubStringFilter(resource: IResourceFile, filter: {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}, subString: RegExp): {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
};
|
|
28
|
+
protected getScopeFilter(filter: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}, scope: string): {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
};
|
|
33
|
+
protected getVisibileExtraActions(currentUser: Document, record: any, resource: IResourceFile, repository: any, modelName: string): Promise<string[] | undefined>;
|
|
34
|
+
protected getHiddenActions(currentUser: Document, record: any, resource: IResourceFile, repository: any, modelName: string): Promise<string[] | undefined>;
|
|
35
|
+
private getModelConfiguration;
|
|
36
|
+
index(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
37
|
+
create(req: IRequest, res: Response): Promise<void>;
|
|
38
|
+
update(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
39
|
+
report(req: IRequest, res: Response): Promise<void>;
|
|
40
|
+
show(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
41
|
+
deleteAll(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
42
|
+
delete(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
43
|
+
getNeighbors(req: IRequest, res: Response): Promise<void | Response<any, Record<string, any>>>;
|
|
44
|
+
}
|