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,50 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PopulationHelper = exports.PopulationType = void 0;
|
|
13
|
-
var PopulationType;
|
|
14
|
-
(function (PopulationType) {
|
|
15
|
-
PopulationType["LIST"] = "LIST";
|
|
16
|
-
PopulationType["SHOW"] = "SHOW";
|
|
17
|
-
})(PopulationType = exports.PopulationType || (exports.PopulationType = {}));
|
|
18
|
-
class PopulationHelper {
|
|
19
|
-
constructor(resource, populationType, populatedString) {
|
|
20
|
-
this.resource = resource;
|
|
21
|
-
this.populatedString = populatedString;
|
|
22
|
-
this.populationType = populationType;
|
|
23
|
-
}
|
|
24
|
-
get() {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const { populate } = this.resource.properties;
|
|
27
|
-
if (!populate) {
|
|
28
|
-
return this.populatedString;
|
|
29
|
-
}
|
|
30
|
-
if (!populate.all && !populate.list && !populate.show) {
|
|
31
|
-
return this.populatedString;
|
|
32
|
-
}
|
|
33
|
-
if (populate.all) {
|
|
34
|
-
return yield populate.all(this.populatedString);
|
|
35
|
-
}
|
|
36
|
-
if (this.populationType === PopulationType.LIST) {
|
|
37
|
-
if (populate.list) {
|
|
38
|
-
return yield populate.list(this.populatedString);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
if (populate.show) {
|
|
43
|
-
return yield populate.show(this.populatedString);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return this.populatedString;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.PopulationHelper = PopulationHelper;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PopulationHelper = exports.PopulationType = void 0;
|
|
13
|
+
var PopulationType;
|
|
14
|
+
(function (PopulationType) {
|
|
15
|
+
PopulationType["LIST"] = "LIST";
|
|
16
|
+
PopulationType["SHOW"] = "SHOW";
|
|
17
|
+
})(PopulationType = exports.PopulationType || (exports.PopulationType = {}));
|
|
18
|
+
class PopulationHelper {
|
|
19
|
+
constructor(resource, populationType, populatedString) {
|
|
20
|
+
this.resource = resource;
|
|
21
|
+
this.populatedString = populatedString;
|
|
22
|
+
this.populationType = populationType;
|
|
23
|
+
}
|
|
24
|
+
get() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { populate } = this.resource.properties;
|
|
27
|
+
if (!populate) {
|
|
28
|
+
return this.populatedString;
|
|
29
|
+
}
|
|
30
|
+
if (!populate.all && !populate.list && !populate.show) {
|
|
31
|
+
return this.populatedString;
|
|
32
|
+
}
|
|
33
|
+
if (populate.all) {
|
|
34
|
+
return yield populate.all(this.populatedString);
|
|
35
|
+
}
|
|
36
|
+
if (this.populationType === PopulationType.LIST) {
|
|
37
|
+
if (populate.list) {
|
|
38
|
+
return yield populate.list(this.populatedString);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (populate.show) {
|
|
43
|
+
return yield populate.show(this.populatedString);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return this.populatedString;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.PopulationHelper = PopulationHelper;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IRequest } from '../middlewares/isAuth';
|
|
2
|
-
import Repository from '../repositories/Repository';
|
|
3
|
-
import { IResourceFile } from '../types/IResourceFile';
|
|
4
|
-
import { IModelConfigurationDocument } from '../models/modelConfiguration/IModelConfigurations';
|
|
5
|
-
export declare class RecordsCounter {
|
|
6
|
-
static count(req: IRequest, resource: IResourceFile, repository: Repository<any>, currentRecord: any, modelConfigurations?: Map<string, IModelConfigurationDocument> | undefined): Promise<{
|
|
7
|
-
recordsCount: number;
|
|
8
|
-
recordIndex: number;
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
1
|
+
import { IRequest } from '../middlewares/isAuth';
|
|
2
|
+
import Repository from '../repositories/Repository';
|
|
3
|
+
import { IResourceFile } from '../types/IResourceFile';
|
|
4
|
+
import { IModelConfigurationDocument } from '../models/modelConfiguration/IModelConfigurations';
|
|
5
|
+
export declare class RecordsCounter {
|
|
6
|
+
static count(req: IRequest, resource: IResourceFile, repository: Repository<any>, currentRecord: any, modelConfigurations?: Map<string, IModelConfigurationDocument> | undefined): Promise<{
|
|
7
|
+
recordsCount: number;
|
|
8
|
+
recordIndex: number;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RecordsCounter = void 0;
|
|
13
|
-
const FilterQueryHelper_1 = require("./FilterQueryHelper");
|
|
14
|
-
class RecordsCounter {
|
|
15
|
-
static count(req, resource, repository, currentRecord, modelConfigurations) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const sort = req.query.order;
|
|
18
|
-
const sortBy = req.query.orderBy;
|
|
19
|
-
const sortQuery = {};
|
|
20
|
-
sortQuery[sortBy] = sort;
|
|
21
|
-
if (sortBy !== '_id') {
|
|
22
|
-
sortQuery._id = 'asc';
|
|
23
|
-
}
|
|
24
|
-
const filter = yield FilterQueryHelper_1.FilterQueryHelper.getFilter(req, resource, modelConfigurations);
|
|
25
|
-
const comparisonQuery = { $or: [] };
|
|
26
|
-
comparisonQuery.$or.push({ [sortBy]: { [sort === 'asc' ? '$lt' : '$gt']: currentRecord[sortBy] } }, { [sortBy]: currentRecord[sortBy], _id: { $lt: currentRecord._id } });
|
|
27
|
-
const recordIndex = (yield repository.count(Object.assign(Object.assign({}, filter), comparisonQuery))) + 1;
|
|
28
|
-
const recordsCount = yield repository.count(filter);
|
|
29
|
-
return { recordsCount, recordIndex };
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.RecordsCounter = RecordsCounter;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RecordsCounter = void 0;
|
|
13
|
+
const FilterQueryHelper_1 = require("./FilterQueryHelper");
|
|
14
|
+
class RecordsCounter {
|
|
15
|
+
static count(req, resource, repository, currentRecord, modelConfigurations) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const sort = req.query.order;
|
|
18
|
+
const sortBy = req.query.orderBy;
|
|
19
|
+
const sortQuery = {};
|
|
20
|
+
sortQuery[sortBy] = sort;
|
|
21
|
+
if (sortBy !== '_id') {
|
|
22
|
+
sortQuery._id = 'asc';
|
|
23
|
+
}
|
|
24
|
+
const filter = yield FilterQueryHelper_1.FilterQueryHelper.getFilter(req, resource, modelConfigurations);
|
|
25
|
+
const comparisonQuery = { $or: [] };
|
|
26
|
+
comparisonQuery.$or.push({ [sortBy]: { [sort === 'asc' ? '$lt' : '$gt']: currentRecord[sortBy] } }, { [sortBy]: currentRecord[sortBy], _id: { $lt: currentRecord._id } });
|
|
27
|
+
const recordIndex = (yield repository.count(Object.assign(Object.assign({}, filter), comparisonQuery))) + 1;
|
|
28
|
+
const recordsCount = yield repository.count(filter);
|
|
29
|
+
return { recordsCount, recordIndex };
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.RecordsCounter = RecordsCounter;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { FieldTypes } from '../types/helpers';
|
|
3
|
-
import { IResourceFile } from '../types/IResourceFile';
|
|
4
|
-
export interface Columns {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
type: FieldTypes;
|
|
8
|
-
titlePath?: string;
|
|
9
|
-
titleType?: FieldTypes;
|
|
10
|
-
}
|
|
11
|
-
export declare enum Languages {
|
|
12
|
-
ARABIC = "ar",
|
|
13
|
-
ENGLISH = "en"
|
|
14
|
-
}
|
|
15
|
-
export interface ILanguage {
|
|
16
|
-
key: Languages;
|
|
17
|
-
value?: string;
|
|
18
|
-
}
|
|
19
|
-
export default class ReportsGenerator {
|
|
20
|
-
static CreateXlsxFile(columns: Columns[], data: any[], name: string, language: Languages, resource: IResourceFile): Buffer;
|
|
21
|
-
static CreatePdfFile(columns: Columns[], data: any[], name: string, language: Languages, resource: IResourceFile): Promise<Buffer>;
|
|
22
|
-
static getRows(columns: Columns[], data: any[], language: Languages, resource: IResourceFile): any[][];
|
|
23
|
-
static getFieldValue(field: Columns, row: any, language: Languages, resource: IResourceFile): any;
|
|
24
|
-
static checkLocalizedStringExistence(columns: Columns[]): boolean;
|
|
25
|
-
static getReferenceValueByTitleType(rowValue: any, language: Languages, titleType?: FieldTypes): any;
|
|
26
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { FieldTypes } from '../types/helpers';
|
|
3
|
+
import { IResourceFile } from '../types/IResourceFile';
|
|
4
|
+
export interface Columns {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
type: FieldTypes;
|
|
8
|
+
titlePath?: string;
|
|
9
|
+
titleType?: FieldTypes;
|
|
10
|
+
}
|
|
11
|
+
export declare enum Languages {
|
|
12
|
+
ARABIC = "ar",
|
|
13
|
+
ENGLISH = "en"
|
|
14
|
+
}
|
|
15
|
+
export interface ILanguage {
|
|
16
|
+
key: Languages;
|
|
17
|
+
value?: string;
|
|
18
|
+
}
|
|
19
|
+
export default class ReportsGenerator {
|
|
20
|
+
static CreateXlsxFile(columns: Columns[], data: any[], name: string, language: Languages, resource: IResourceFile): Buffer;
|
|
21
|
+
static CreatePdfFile(columns: Columns[], data: any[], name: string, language: Languages, resource: IResourceFile): Promise<Buffer>;
|
|
22
|
+
static getRows(columns: Columns[], data: any[], language: Languages, resource: IResourceFile): any[][];
|
|
23
|
+
static getFieldValue(field: Columns, row: any, language: Languages, resource: IResourceFile): any;
|
|
24
|
+
static checkLocalizedStringExistence(columns: Columns[]): boolean;
|
|
25
|
+
static getReferenceValueByTitleType(rowValue: any, language: Languages, titleType?: FieldTypes): any;
|
|
26
|
+
}
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.Languages = void 0;
|
|
39
|
-
const node_xlsx_1 = __importDefault(require("node-xlsx"));
|
|
40
|
-
const lodash_1 = require("lodash");
|
|
41
|
-
const helpers_1 = require("../types/helpers");
|
|
42
|
-
const pdfjs_1 = __importDefault(require("pdfjs"));
|
|
43
|
-
const fs = __importStar(require("fs"));
|
|
44
|
-
const LocalizedStringHelper_1 = __importDefault(require("./LocalizedStringHelper"));
|
|
45
|
-
const DateUtils_1 = require("../utils/DateUtils");
|
|
46
|
-
var Languages;
|
|
47
|
-
(function (Languages) {
|
|
48
|
-
Languages["ARABIC"] = "ar";
|
|
49
|
-
Languages["ENGLISH"] = "en";
|
|
50
|
-
})(Languages = exports.Languages || (exports.Languages = {}));
|
|
51
|
-
class ReportsGenerator {
|
|
52
|
-
static CreateXlsxFile(columns, data, name, language, resource) {
|
|
53
|
-
const header = columns.map((field) => field.label);
|
|
54
|
-
const rows = this.getRows(columns, data, language, resource);
|
|
55
|
-
const sheets = [
|
|
56
|
-
{
|
|
57
|
-
name,
|
|
58
|
-
data: [header, ...rows],
|
|
59
|
-
options: {},
|
|
60
|
-
},
|
|
61
|
-
];
|
|
62
|
-
const buffer = node_xlsx_1.default.build(sheets);
|
|
63
|
-
return buffer;
|
|
64
|
-
}
|
|
65
|
-
static CreatePdfFile(columns, data, name, language, resource) {
|
|
66
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
const rows = this.getRows(columns, data, language, resource);
|
|
68
|
-
const ArabicFont = new pdfjs_1.default.Font(fs.readFileSync(__dirname + '/../assets/Amiri-Regular.ttf'));
|
|
69
|
-
const localizedStringIsExisted = this.checkLocalizedStringExistence(columns);
|
|
70
|
-
const doc = new pdfjs_1.default.Document({
|
|
71
|
-
width: 861.12,
|
|
72
|
-
font: localizedStringIsExisted ? ArabicFont : require('pdfjs/font/Helvetica'),
|
|
73
|
-
});
|
|
74
|
-
const table = doc.table({
|
|
75
|
-
widths: columns.map((column) => '*'),
|
|
76
|
-
borderWidth: 1,
|
|
77
|
-
});
|
|
78
|
-
const header = table.header({
|
|
79
|
-
backgroundColor: 0xdddddd,
|
|
80
|
-
color: 0x333333,
|
|
81
|
-
paddingBottom: 5,
|
|
82
|
-
paddingTop: 5,
|
|
83
|
-
});
|
|
84
|
-
columns.map((field) => header.cell(field.label, {
|
|
85
|
-
textAlign: 'center',
|
|
86
|
-
alignment: 'center',
|
|
87
|
-
}));
|
|
88
|
-
rows.forEach((row) => {
|
|
89
|
-
const tableRow = table.row();
|
|
90
|
-
row.map((cell) => tableRow.cell(`${cell !== null && cell !== void 0 ? cell : '---'}`, {
|
|
91
|
-
textAlign: 'center',
|
|
92
|
-
alignment: 'center',
|
|
93
|
-
paddingBottom: 5,
|
|
94
|
-
paddingTop: 5,
|
|
95
|
-
}));
|
|
96
|
-
});
|
|
97
|
-
return yield doc.asBuffer();
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
static getRows(columns, data, language, resource) {
|
|
101
|
-
const rows = data.map((row) => columns.map((field) => this.getFieldValue(field, row, language, resource)));
|
|
102
|
-
return rows;
|
|
103
|
-
}
|
|
104
|
-
static getFieldValue(field, row, language, resource) {
|
|
105
|
-
var _a, _b, _c, _d;
|
|
106
|
-
const schema = resource.properties.model;
|
|
107
|
-
const fieldProps = schema ? schema[field.value] : undefined;
|
|
108
|
-
switch (field.type) {
|
|
109
|
-
case helpers_1.FieldTypes.OBJECTID:
|
|
110
|
-
return (_b = (_a = (0, lodash_1.get)(row, field.value)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
|
|
111
|
-
case helpers_1.FieldTypes.LOCALIZEDSTRING:
|
|
112
|
-
return LocalizedStringHelper_1.default.getLocalizedValue(row, field.value, language);
|
|
113
|
-
case helpers_1.FieldTypes.DATE:
|
|
114
|
-
const withTime = fieldProps && fieldProps.withTime ? true : false;
|
|
115
|
-
return DateUtils_1.DateUtils.getIsoDate((0, lodash_1.get)(row, field.value), withTime);
|
|
116
|
-
case helpers_1.FieldTypes.REFERENCE:
|
|
117
|
-
const valuePath = (_c = field.titlePath) !== null && _c !== void 0 ? _c : field.value;
|
|
118
|
-
const rowValue = (0, lodash_1.get)(row, valuePath);
|
|
119
|
-
return rowValue ? this.getReferenceValueByTitleType(rowValue, language, field.titleType) : row[field.value] ? (0, lodash_1.get)(row, `${field.value}._id`).toString() : '-';
|
|
120
|
-
case helpers_1.FieldTypes.ENUM:
|
|
121
|
-
const enumValues = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.enumValues;
|
|
122
|
-
const fieldValue = (0, lodash_1.get)(row, field.value);
|
|
123
|
-
if (enumValues && typeof enumValues === 'object' && !Array.isArray(enumValues)) {
|
|
124
|
-
const enumValue = enumValues[fieldValue];
|
|
125
|
-
return (_d = enumValue === null || enumValue === void 0 ? void 0 : enumValue.label) !== null && _d !== void 0 ? _d : fieldValue;
|
|
126
|
-
}
|
|
127
|
-
return fieldValue;
|
|
128
|
-
default:
|
|
129
|
-
return (0, lodash_1.get)(row, field.value);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
static checkLocalizedStringExistence(columns) {
|
|
133
|
-
return columns.some((column) => column.type === helpers_1.FieldTypes.LOCALIZEDSTRING);
|
|
134
|
-
}
|
|
135
|
-
static getReferenceValueByTitleType(rowValue, language, titleType) {
|
|
136
|
-
if (!titleType)
|
|
137
|
-
return rowValue;
|
|
138
|
-
switch (titleType) {
|
|
139
|
-
case helpers_1.FieldTypes.BOOLEAN:
|
|
140
|
-
case helpers_1.FieldTypes.STRING:
|
|
141
|
-
case helpers_1.FieldTypes.ENUM:
|
|
142
|
-
case helpers_1.FieldTypes.DATE:
|
|
143
|
-
case helpers_1.FieldTypes.OBJECTID:
|
|
144
|
-
case helpers_1.FieldTypes.PHONENUMBER:
|
|
145
|
-
case helpers_1.FieldTypes.REFERENCE:
|
|
146
|
-
case helpers_1.FieldTypes.COLOR:
|
|
147
|
-
case helpers_1.FieldTypes.TIMEPICKER:
|
|
148
|
-
case helpers_1.FieldTypes.LOCATION:
|
|
149
|
-
case helpers_1.FieldTypes.RICH_TEXT_I:
|
|
150
|
-
case helpers_1.FieldTypes.RICH_TEXT_II:
|
|
151
|
-
case helpers_1.FieldTypes.EXTERNAL_LINK:
|
|
152
|
-
case helpers_1.FieldTypes.NUMBER:
|
|
153
|
-
case helpers_1.FieldTypes.HTML:
|
|
154
|
-
return rowValue;
|
|
155
|
-
case helpers_1.FieldTypes.LOCALIZEDSTRING:
|
|
156
|
-
return LocalizedStringHelper_1.default.getLocalizedValue({ title: rowValue }, 'title', language);
|
|
157
|
-
default:
|
|
158
|
-
return rowValue;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
exports.default = ReportsGenerator;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.Languages = void 0;
|
|
39
|
+
const node_xlsx_1 = __importDefault(require("node-xlsx"));
|
|
40
|
+
const lodash_1 = require("lodash");
|
|
41
|
+
const helpers_1 = require("../types/helpers");
|
|
42
|
+
const pdfjs_1 = __importDefault(require("pdfjs"));
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const LocalizedStringHelper_1 = __importDefault(require("./LocalizedStringHelper"));
|
|
45
|
+
const DateUtils_1 = require("../utils/DateUtils");
|
|
46
|
+
var Languages;
|
|
47
|
+
(function (Languages) {
|
|
48
|
+
Languages["ARABIC"] = "ar";
|
|
49
|
+
Languages["ENGLISH"] = "en";
|
|
50
|
+
})(Languages = exports.Languages || (exports.Languages = {}));
|
|
51
|
+
class ReportsGenerator {
|
|
52
|
+
static CreateXlsxFile(columns, data, name, language, resource) {
|
|
53
|
+
const header = columns.map((field) => field.label);
|
|
54
|
+
const rows = this.getRows(columns, data, language, resource);
|
|
55
|
+
const sheets = [
|
|
56
|
+
{
|
|
57
|
+
name,
|
|
58
|
+
data: [header, ...rows],
|
|
59
|
+
options: {},
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
const buffer = node_xlsx_1.default.build(sheets);
|
|
63
|
+
return buffer;
|
|
64
|
+
}
|
|
65
|
+
static CreatePdfFile(columns, data, name, language, resource) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const rows = this.getRows(columns, data, language, resource);
|
|
68
|
+
const ArabicFont = new pdfjs_1.default.Font(fs.readFileSync(__dirname + '/../assets/Amiri-Regular.ttf'));
|
|
69
|
+
const localizedStringIsExisted = this.checkLocalizedStringExistence(columns);
|
|
70
|
+
const doc = new pdfjs_1.default.Document({
|
|
71
|
+
width: 861.12,
|
|
72
|
+
font: localizedStringIsExisted ? ArabicFont : require('pdfjs/font/Helvetica'),
|
|
73
|
+
});
|
|
74
|
+
const table = doc.table({
|
|
75
|
+
widths: columns.map((column) => '*'),
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
});
|
|
78
|
+
const header = table.header({
|
|
79
|
+
backgroundColor: 0xdddddd,
|
|
80
|
+
color: 0x333333,
|
|
81
|
+
paddingBottom: 5,
|
|
82
|
+
paddingTop: 5,
|
|
83
|
+
});
|
|
84
|
+
columns.map((field) => header.cell(field.label, {
|
|
85
|
+
textAlign: 'center',
|
|
86
|
+
alignment: 'center',
|
|
87
|
+
}));
|
|
88
|
+
rows.forEach((row) => {
|
|
89
|
+
const tableRow = table.row();
|
|
90
|
+
row.map((cell) => tableRow.cell(`${cell !== null && cell !== void 0 ? cell : '---'}`, {
|
|
91
|
+
textAlign: 'center',
|
|
92
|
+
alignment: 'center',
|
|
93
|
+
paddingBottom: 5,
|
|
94
|
+
paddingTop: 5,
|
|
95
|
+
}));
|
|
96
|
+
});
|
|
97
|
+
return yield doc.asBuffer();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
static getRows(columns, data, language, resource) {
|
|
101
|
+
const rows = data.map((row) => columns.map((field) => this.getFieldValue(field, row, language, resource)));
|
|
102
|
+
return rows;
|
|
103
|
+
}
|
|
104
|
+
static getFieldValue(field, row, language, resource) {
|
|
105
|
+
var _a, _b, _c, _d;
|
|
106
|
+
const schema = resource.properties.model;
|
|
107
|
+
const fieldProps = schema ? schema[field.value] : undefined;
|
|
108
|
+
switch (field.type) {
|
|
109
|
+
case helpers_1.FieldTypes.OBJECTID:
|
|
110
|
+
return (_b = (_a = (0, lodash_1.get)(row, field.value)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
|
|
111
|
+
case helpers_1.FieldTypes.LOCALIZEDSTRING:
|
|
112
|
+
return LocalizedStringHelper_1.default.getLocalizedValue(row, field.value, language);
|
|
113
|
+
case helpers_1.FieldTypes.DATE:
|
|
114
|
+
const withTime = fieldProps && fieldProps.withTime ? true : false;
|
|
115
|
+
return DateUtils_1.DateUtils.getIsoDate((0, lodash_1.get)(row, field.value), withTime);
|
|
116
|
+
case helpers_1.FieldTypes.REFERENCE:
|
|
117
|
+
const valuePath = (_c = field.titlePath) !== null && _c !== void 0 ? _c : field.value;
|
|
118
|
+
const rowValue = (0, lodash_1.get)(row, valuePath);
|
|
119
|
+
return rowValue ? this.getReferenceValueByTitleType(rowValue, language, field.titleType) : row[field.value] ? (0, lodash_1.get)(row, `${field.value}._id`).toString() : '-';
|
|
120
|
+
case helpers_1.FieldTypes.ENUM:
|
|
121
|
+
const enumValues = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.enumValues;
|
|
122
|
+
const fieldValue = (0, lodash_1.get)(row, field.value);
|
|
123
|
+
if (enumValues && typeof enumValues === 'object' && !Array.isArray(enumValues)) {
|
|
124
|
+
const enumValue = enumValues[fieldValue];
|
|
125
|
+
return (_d = enumValue === null || enumValue === void 0 ? void 0 : enumValue.label) !== null && _d !== void 0 ? _d : fieldValue;
|
|
126
|
+
}
|
|
127
|
+
return fieldValue;
|
|
128
|
+
default:
|
|
129
|
+
return (0, lodash_1.get)(row, field.value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
static checkLocalizedStringExistence(columns) {
|
|
133
|
+
return columns.some((column) => column.type === helpers_1.FieldTypes.LOCALIZEDSTRING);
|
|
134
|
+
}
|
|
135
|
+
static getReferenceValueByTitleType(rowValue, language, titleType) {
|
|
136
|
+
if (!titleType)
|
|
137
|
+
return rowValue;
|
|
138
|
+
switch (titleType) {
|
|
139
|
+
case helpers_1.FieldTypes.BOOLEAN:
|
|
140
|
+
case helpers_1.FieldTypes.STRING:
|
|
141
|
+
case helpers_1.FieldTypes.ENUM:
|
|
142
|
+
case helpers_1.FieldTypes.DATE:
|
|
143
|
+
case helpers_1.FieldTypes.OBJECTID:
|
|
144
|
+
case helpers_1.FieldTypes.PHONENUMBER:
|
|
145
|
+
case helpers_1.FieldTypes.REFERENCE:
|
|
146
|
+
case helpers_1.FieldTypes.COLOR:
|
|
147
|
+
case helpers_1.FieldTypes.TIMEPICKER:
|
|
148
|
+
case helpers_1.FieldTypes.LOCATION:
|
|
149
|
+
case helpers_1.FieldTypes.RICH_TEXT_I:
|
|
150
|
+
case helpers_1.FieldTypes.RICH_TEXT_II:
|
|
151
|
+
case helpers_1.FieldTypes.EXTERNAL_LINK:
|
|
152
|
+
case helpers_1.FieldTypes.NUMBER:
|
|
153
|
+
case helpers_1.FieldTypes.HTML:
|
|
154
|
+
return rowValue;
|
|
155
|
+
case helpers_1.FieldTypes.LOCALIZEDSTRING:
|
|
156
|
+
return LocalizedStringHelper_1.default.getLocalizedValue({ title: rowValue }, 'title', language);
|
|
157
|
+
default:
|
|
158
|
+
return rowValue;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.default = ReportsGenerator;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Document } from "mongoose";
|
|
2
|
-
import { IResourceFile } from "../types/IResourceFile";
|
|
3
|
-
import { IConfiguartionFile } from "../types/IConfigurationFile";
|
|
4
|
-
import { IModelConfigurationDocument } from "../models/modelConfiguration/IModelConfigurations";
|
|
5
|
-
export default class ResourceGenerator {
|
|
6
|
-
static generate(resource: IResourceFile, currentUser: Document, configurations?: IConfiguartionFile, modelConfigurations?: Map<string, IModelConfigurationDocument>, permissions?: {
|
|
7
|
-
[permissionKey: string]: boolean;
|
|
8
|
-
}): any;
|
|
9
|
-
}
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IResourceFile } from "../types/IResourceFile";
|
|
3
|
+
import { IConfiguartionFile } from "../types/IConfigurationFile";
|
|
4
|
+
import { IModelConfigurationDocument } from "../models/modelConfiguration/IModelConfigurations";
|
|
5
|
+
export default class ResourceGenerator {
|
|
6
|
+
static generate(resource: IResourceFile, currentUser: Document, configurations?: IConfiguartionFile, modelConfigurations?: Map<string, IModelConfigurationDocument>, permissions?: {
|
|
7
|
+
[permissionKey: string]: boolean;
|
|
8
|
+
}): any;
|
|
9
|
+
}
|