identity-admin 1.26.17 → 1.26.18

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.
Files changed (173) hide show
  1. package/README.md +294 -294
  2. package/lib/Dashboard.d.ts +14 -14
  3. package/lib/Dashboard.js +95 -95
  4. package/lib/container/helpers/HelperInversify.d.ts +6 -6
  5. package/lib/container/helpers/HelperInversify.js +10 -10
  6. package/lib/container/helpers/HelperTypes.d.ts +5 -5
  7. package/lib/container/helpers/HelperTypes.js +7 -7
  8. package/lib/container/index.d.ts +1 -1
  9. package/lib/container/index.js +14 -14
  10. package/lib/container/repositories/RepositoryInversify.d.ts +4 -4
  11. package/lib/container/repositories/RepositoryInversify.js +13 -13
  12. package/lib/container/repositories/RepositoryTypes.d.ts +4 -4
  13. package/lib/container/repositories/RepositoryTypes.js +6 -6
  14. package/lib/container/types.d.ts +8 -8
  15. package/lib/container/types.js +9 -9
  16. package/lib/controllers/ActionController.d.ts +8 -8
  17. package/lib/controllers/ActionController.js +96 -96
  18. package/lib/controllers/AdminNotificationController.d.ts +8 -8
  19. package/lib/controllers/AdminNotificationController.js +69 -69
  20. package/lib/controllers/DashboardController.d.ts +43 -43
  21. package/lib/controllers/DashboardController.js +741 -741
  22. package/lib/controllers/ResourceController.d.ts +15 -15
  23. package/lib/controllers/ResourceController.js +135 -135
  24. package/lib/helpers/ActionsGenerator.d.ts +11 -11
  25. package/lib/helpers/ActionsGenerator.js +179 -179
  26. package/lib/helpers/AdminNotifications/AdminNotificationCreation.d.ts +48 -48
  27. package/lib/helpers/AdminNotifications/AdminNotificationCreation.js +66 -66
  28. package/lib/helpers/AdminNotifications/AdminNotificationFetcher.d.ts +51 -51
  29. package/lib/helpers/AdminNotifications/AdminNotificationFetcher.js +39 -39
  30. package/lib/helpers/FiltersHelper.d.ts +9 -9
  31. package/lib/helpers/FiltersHelper.js +113 -113
  32. package/lib/helpers/LocalesHelper.d.ts +4 -4
  33. package/lib/helpers/LocalesHelper.js +73 -73
  34. package/lib/helpers/LocalizedStringHelper.d.ts +9 -9
  35. package/lib/helpers/LocalizedStringHelper.js +57 -57
  36. package/lib/helpers/Permissions/PermissionFetcher.d.ts +8 -8
  37. package/lib/helpers/Permissions/PermissionFetcher.js +95 -95
  38. package/lib/helpers/Permissions/PermissionLabel.d.ts +2 -2
  39. package/lib/helpers/Permissions/PermissionLabel.js +42 -42
  40. package/lib/helpers/Permissions/PermissionMapper.d.ts +13 -13
  41. package/lib/helpers/Permissions/PermissionMapper.js +35 -35
  42. package/lib/helpers/Permissions/PermissionResource.d.ts +6 -6
  43. package/lib/helpers/Permissions/PermissionResource.js +62 -62
  44. package/lib/helpers/Permissions/PermissionSavingService.d.ts +13 -13
  45. package/lib/helpers/Permissions/PermissionSavingService.js +32 -32
  46. package/lib/helpers/Permissions/SavePermissionGroup.d.ts +6 -6
  47. package/lib/helpers/Permissions/SavePermissionGroup.js +32 -32
  48. package/lib/helpers/Permissions/UpdatePermissionGroup.d.ts +6 -6
  49. package/lib/helpers/Permissions/UpdatePermissionGroup.js +50 -50
  50. package/lib/helpers/Permissions/types.d.ts +17 -17
  51. package/lib/helpers/Permissions/types.js +2 -2
  52. package/lib/helpers/PopulationHelper.d.ts +12 -12
  53. package/lib/helpers/PopulationHelper.js +50 -50
  54. package/lib/helpers/ReportsGenerator.d.ts +11 -11
  55. package/lib/helpers/ReportsGenerator.js +57 -57
  56. package/lib/helpers/ResourceGenerator.d.ts +9 -9
  57. package/lib/helpers/ResourceGenerator.js +172 -172
  58. package/lib/helpers/ResourceHelper.d.ts +28 -28
  59. package/lib/helpers/ResourceHelper.js +395 -395
  60. package/lib/helpers/RportsGenerator.d.ts +10 -10
  61. package/lib/helpers/RportsGenerator.js +21 -21
  62. package/lib/helpers/SchemaGenerator.d.ts +7 -5
  63. package/lib/helpers/SchemaGenerator.js +130 -101
  64. package/lib/helpers/SchemaHelper.d.ts +5 -5
  65. package/lib/helpers/SchemaHelper.js +21 -21
  66. package/lib/helpers/UserActionsLog/UserActionsLogHelper.d.ts +2 -2
  67. package/lib/helpers/UserActionsLog/UserActionsLogHelper.js +49 -49
  68. package/lib/locales/en.json +53 -53
  69. package/lib/middlewares/cache/decorator.d.ts +3 -3
  70. package/lib/middlewares/cache/decorator.js +60 -60
  71. package/lib/middlewares/cache/deletionMethods.d.ts +3 -3
  72. package/lib/middlewares/cache/deletionMethods.js +23 -23
  73. package/lib/middlewares/isAuth.d.ts +13 -13
  74. package/lib/middlewares/isAuth.js +43 -43
  75. package/lib/models/ModelNames.d.ts +9 -9
  76. package/lib/models/ModelNames.js +12 -12
  77. package/lib/models/adminNotification/AdminNotification.d.ts +5 -5
  78. package/lib/models/adminNotification/AdminNotification.js +50 -50
  79. package/lib/models/adminNotification/IAdminNotification.d.ts +29 -29
  80. package/lib/models/adminNotification/IAdminNotification.js +15 -15
  81. package/lib/models/adminpermission/AdminPermission.d.ts +11 -11
  82. package/lib/models/adminpermission/AdminPermission.js +23 -23
  83. package/lib/models/adminpermission/IAdminPermission.d.ts +13 -13
  84. package/lib/models/adminpermission/IAdminPermission.js +2 -2
  85. package/lib/models/customPage/CustomPage.d.ts +2 -2
  86. package/lib/models/customPage/CustomPage.js +38 -38
  87. package/lib/models/customPage/ICustomPage.d.ts +17 -17
  88. package/lib/models/customPage/ICustomPage.js +2 -2
  89. package/lib/models/file/File.d.ts +2 -2
  90. package/lib/models/file/File.js +23 -23
  91. package/lib/models/file/IFile.d.ts +15 -15
  92. package/lib/models/file/IFile.js +2 -2
  93. package/lib/models/location/ILocation.d.ts +14 -14
  94. package/lib/models/location/ILocation.js +2 -2
  95. package/lib/models/location/Location.d.ts +2 -2
  96. package/lib/models/location/Location.js +21 -21
  97. package/lib/models/modelConfiguration/IModelConfigurations.d.ts +29 -29
  98. package/lib/models/modelConfiguration/IModelConfigurations.js +2 -2
  99. package/lib/models/modelConfiguration/ModelConfiguration.d.ts +13 -13
  100. package/lib/models/modelConfiguration/ModelConfiguration.js +95 -95
  101. package/lib/models/permission/IPermission.d.ts +14 -14
  102. package/lib/models/permission/IPermission.js +2 -2
  103. package/lib/models/permission/Permission.d.ts +2 -2
  104. package/lib/models/permission/Permission.js +21 -21
  105. package/lib/models/request-log/IRequestLog.d.ts +22 -22
  106. package/lib/models/request-log/IRequestLog.js +2 -2
  107. package/lib/models/request-log/RequestLog.d.ts +3 -3
  108. package/lib/models/request-log/RequestLog.js +51 -51
  109. package/lib/models/userActionsLog/IUserActionsLog.d.ts +26 -26
  110. package/lib/models/userActionsLog/IUserActionsLog.js +11 -11
  111. package/lib/models/userActionsLog/UserActionsLog.d.ts +3 -3
  112. package/lib/models/userActionsLog/UserActionsLog.js +41 -41
  113. package/lib/pdf/ReportTemplate.d.ts +71 -71
  114. package/lib/pdf/ReportTemplate.js +94 -94
  115. package/lib/repositories/AdminNotificationRepository.d.ts +7 -7
  116. package/lib/repositories/AdminNotificationRepository.js +23 -23
  117. package/lib/repositories/DashboardRepository.d.ts +5 -5
  118. package/lib/repositories/DashboardRepository.js +12 -12
  119. package/lib/repositories/Repository.d.ts +68 -68
  120. package/lib/repositories/Repository.js +212 -212
  121. package/lib/repositories/RequestLogRepository.d.ts +10 -10
  122. package/lib/repositories/RequestLogRepository.js +54 -54
  123. package/lib/repositories/SaveResult.d.ts +14 -14
  124. package/lib/repositories/SaveResult.js +18 -18
  125. package/lib/resources/AdminNotificationsResource.d.ts +3 -3
  126. package/lib/resources/AdminNotificationsResource.js +23 -23
  127. package/lib/resources/parents.d.ts +4 -4
  128. package/lib/resources/parents.js +7 -7
  129. package/lib/router/index.d.ts +8 -8
  130. package/lib/router/index.js +104 -104
  131. package/lib/types/DashbordConfig.d.ts +21 -21
  132. package/lib/types/DashbordConfig.js +2 -2
  133. package/lib/types/IConfigurationFile.d.ts +11 -10
  134. package/lib/types/IConfigurationFile.js +2 -2
  135. package/lib/types/IResourceFile.d.ts +675 -675
  136. package/lib/types/IResourceFile.js +2 -2
  137. package/lib/types/IResourceResponse.d.ts +95 -95
  138. package/lib/types/IResourceResponse.js +2 -2
  139. package/lib/types/helpers.d.ts +66 -66
  140. package/lib/types/helpers.js +77 -77
  141. package/lib/utils/ResourceUtils.d.ts +2 -2
  142. package/lib/utils/ResourceUtils.js +7 -7
  143. package/lib/utils/ResponseUtils.d.ts +11 -11
  144. package/lib/utils/ResponseUtils.js +41 -41
  145. package/lib/utils/StringUtils.d.ts +9 -9
  146. package/lib/utils/StringUtils.js +46 -46
  147. package/lib/view/asset-manifest.json +18 -18
  148. package/lib/view/assets/icons/delete_icon.svg +3 -3
  149. package/lib/view/assets/icons/flags/ic_flag_cn.svg +9 -9
  150. package/lib/view/assets/icons/flags/ic_flag_sa.svg +9 -9
  151. package/lib/view/assets/icons/flags/ic_flag_vn.svg +9 -9
  152. package/lib/view/assets/icons/info_icon.svg +3 -3
  153. package/lib/view/assets/icons/navbar/ic_banking.svg +5 -5
  154. package/lib/view/assets/icons/navbar/ic_invoice.svg +4 -4
  155. package/lib/view/assets/icons/navbar/ic_kanban.svg +7 -7
  156. package/lib/view/assets/icons/navbar/ic_menu_item.svg +8 -8
  157. package/lib/view/assets/icons/small_info_icon.svg +3 -3
  158. package/lib/view/assets/illustrations/Group 16.svg +4 -4
  159. package/lib/view/assets/illustrations/logo.svg +5 -5
  160. package/lib/view/favicon/browserconfig.xml +9 -9
  161. package/lib/view/favicon/safari-pinned-tab.svg +182 -182
  162. package/lib/view/favicon/site.webmanifest +19 -19
  163. package/lib/view/fonts/index.css +18 -18
  164. package/lib/view/index.html +52 -52
  165. package/lib/view/manifest.json +20 -20
  166. package/lib/view/robots.txt +3 -3
  167. package/lib/view/static/css/main.54de06ef.css +1 -1
  168. package/lib/view/static/js/574.778b5963.chunk.js +1 -1
  169. package/lib/view/static/js/678.521704a3.chunk.js +1 -1
  170. package/lib/view/static/js/798.54856416.chunk.js +1 -1
  171. package/lib/view/static/js/main.4687f255.js +2 -2
  172. package/lib/view/static/js/main.4687f255.js.LICENSE.txt +214 -214
  173. package/package.json +62 -62
@@ -1,13 +1,13 @@
1
- import { Model } from "mongoose";
2
- export declare class PermissionSavingService {
3
- private permissionGroupId;
4
- private permissions;
5
- private AdminPermission;
6
- constructor(permissionGroupId: string, permissions: {
7
- [key: string]: {
8
- [key: string]: boolean;
9
- };
10
- }, AdminPermission: Model<any, any>);
11
- save(): Promise<void>;
12
- update(): Promise<void>;
13
- }
1
+ import { Model } from "mongoose";
2
+ export declare class PermissionSavingService {
3
+ private permissionGroupId;
4
+ private permissions;
5
+ private AdminPermission;
6
+ constructor(permissionGroupId: string, permissions: {
7
+ [key: string]: {
8
+ [key: string]: boolean;
9
+ };
10
+ }, AdminPermission: Model<any, any>);
11
+ save(): Promise<void>;
12
+ update(): Promise<void>;
13
+ }
@@ -1,32 +1,32 @@
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.PermissionSavingService = void 0;
13
- const SavePermissionGroup_1 = require("./SavePermissionGroup");
14
- const UpdatePermissionGroup_1 = require("./UpdatePermissionGroup");
15
- class PermissionSavingService {
16
- constructor(permissionGroupId, permissions, AdminPermission) {
17
- (this.AdminPermission = AdminPermission),
18
- (this.permissionGroupId = permissionGroupId),
19
- (this.permissions = permissions);
20
- }
21
- save() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- yield (0, SavePermissionGroup_1.savePermissionGroup)(this.permissionGroupId, this.permissions, this.AdminPermission);
24
- });
25
- }
26
- update() {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- yield (0, UpdatePermissionGroup_1.updatePermissionGroup)(this.permissionGroupId, this.permissions, this.AdminPermission);
29
- });
30
- }
31
- }
32
- exports.PermissionSavingService = PermissionSavingService;
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.PermissionSavingService = void 0;
13
+ const SavePermissionGroup_1 = require("./SavePermissionGroup");
14
+ const UpdatePermissionGroup_1 = require("./UpdatePermissionGroup");
15
+ class PermissionSavingService {
16
+ constructor(permissionGroupId, permissions, AdminPermission) {
17
+ (this.AdminPermission = AdminPermission),
18
+ (this.permissionGroupId = permissionGroupId),
19
+ (this.permissions = permissions);
20
+ }
21
+ save() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ yield (0, SavePermissionGroup_1.savePermissionGroup)(this.permissionGroupId, this.permissions, this.AdminPermission);
24
+ });
25
+ }
26
+ update() {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ yield (0, UpdatePermissionGroup_1.updatePermissionGroup)(this.permissionGroupId, this.permissions, this.AdminPermission);
29
+ });
30
+ }
31
+ }
32
+ exports.PermissionSavingService = PermissionSavingService;
@@ -1,6 +1,6 @@
1
- import { Model } from "mongoose";
2
- export declare function savePermissionGroup(permissionGroupId: string, permissions: {
3
- [key: string]: {
4
- [key: string]: boolean;
5
- };
6
- }, AdminPermission: Model<any, any>): Promise<void>;
1
+ import { Model } from "mongoose";
2
+ export declare function savePermissionGroup(permissionGroupId: string, permissions: {
3
+ [key: string]: {
4
+ [key: string]: boolean;
5
+ };
6
+ }, AdminPermission: Model<any, any>): Promise<void>;
@@ -1,32 +1,32 @@
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.savePermissionGroup = void 0;
13
- function savePermissionGroup(permissionGroupId, permissions, AdminPermission) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- const props = [];
16
- for (const key in permissions) {
17
- const data = permissions[key];
18
- for (const permissionId in data) {
19
- if (permissionId !== "all" &&
20
- permissionId !== "opened" &&
21
- data[permissionId]) {
22
- props.push({
23
- permissionGroupId,
24
- permissionId,
25
- });
26
- }
27
- }
28
- }
29
- yield AdminPermission.insertMany(props);
30
- });
31
- }
32
- exports.savePermissionGroup = savePermissionGroup;
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.savePermissionGroup = void 0;
13
+ function savePermissionGroup(permissionGroupId, permissions, AdminPermission) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ const props = [];
16
+ for (const key in permissions) {
17
+ const data = permissions[key];
18
+ for (const permissionId in data) {
19
+ if (permissionId !== "all" &&
20
+ permissionId !== "opened" &&
21
+ data[permissionId]) {
22
+ props.push({
23
+ permissionGroupId,
24
+ permissionId,
25
+ });
26
+ }
27
+ }
28
+ }
29
+ yield AdminPermission.insertMany(props);
30
+ });
31
+ }
32
+ exports.savePermissionGroup = savePermissionGroup;
@@ -1,6 +1,6 @@
1
- import { Model } from "mongoose";
2
- export declare function updatePermissionGroup(permissionGroupId: string, permissions: {
3
- [key: string]: {
4
- [key: string]: boolean;
5
- };
6
- }, AdminPermission: Model<any, any>): Promise<void>;
1
+ import { Model } from "mongoose";
2
+ export declare function updatePermissionGroup(permissionGroupId: string, permissions: {
3
+ [key: string]: {
4
+ [key: string]: boolean;
5
+ };
6
+ }, AdminPermission: Model<any, any>): Promise<void>;
@@ -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.updatePermissionGroup = void 0;
13
- function updatePermissionGroup(permissionGroupId, permissions, AdminPermission) {
14
- var _a;
15
- return __awaiter(this, void 0, void 0, function* () {
16
- const permissionIdsMap = new Map();
17
- const oldPermissions = yield AdminPermission.find({
18
- permissionGroupId,
19
- });
20
- oldPermissions.forEach((oldPermission) => {
21
- permissionIdsMap.set(oldPermission.permissionId.toString(), oldPermission);
22
- });
23
- const props = [];
24
- for (const key in permissions) {
25
- const data = permissions[key];
26
- for (const permissionId in data) {
27
- if (permissionId === "all" || permissionId === "opened") {
28
- continue;
29
- }
30
- if (data[permissionId]) {
31
- if (!permissionIdsMap.get(permissionId)) {
32
- props.push({
33
- permissionGroupId,
34
- permissionId,
35
- });
36
- }
37
- }
38
- else {
39
- if (permissionIdsMap.get(permissionId)) {
40
- yield AdminPermission.remove({
41
- _id: (_a = permissionIdsMap.get(permissionId)) === null || _a === void 0 ? void 0 : _a._id,
42
- });
43
- }
44
- }
45
- }
46
- }
47
- yield AdminPermission.insertMany(props);
48
- });
49
- }
50
- exports.updatePermissionGroup = updatePermissionGroup;
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.updatePermissionGroup = void 0;
13
+ function updatePermissionGroup(permissionGroupId, permissions, AdminPermission) {
14
+ var _a;
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ const permissionIdsMap = new Map();
17
+ const oldPermissions = yield AdminPermission.find({
18
+ permissionGroupId,
19
+ });
20
+ oldPermissions.forEach((oldPermission) => {
21
+ permissionIdsMap.set(oldPermission.permissionId.toString(), oldPermission);
22
+ });
23
+ const props = [];
24
+ for (const key in permissions) {
25
+ const data = permissions[key];
26
+ for (const permissionId in data) {
27
+ if (permissionId === "all" || permissionId === "opened") {
28
+ continue;
29
+ }
30
+ if (data[permissionId]) {
31
+ if (!permissionIdsMap.get(permissionId)) {
32
+ props.push({
33
+ permissionGroupId,
34
+ permissionId,
35
+ });
36
+ }
37
+ }
38
+ else {
39
+ if (permissionIdsMap.get(permissionId)) {
40
+ yield AdminPermission.remove({
41
+ _id: (_a = permissionIdsMap.get(permissionId)) === null || _a === void 0 ? void 0 : _a._id,
42
+ });
43
+ }
44
+ }
45
+ }
46
+ }
47
+ yield AdminPermission.insertMany(props);
48
+ });
49
+ }
50
+ exports.updatePermissionGroup = updatePermissionGroup;
@@ -1,17 +1,17 @@
1
- export interface IPermission {
2
- id: string;
3
- modelName: string;
4
- label: string;
5
- checked: boolean;
6
- key: string;
7
- }
8
- export interface IPermissions {
9
- modelName: string;
10
- label: string;
11
- permissions: IPermission[];
12
- }
13
- export interface IPermissionData {
14
- [modelName: string]: {
15
- [actionKey: string]: boolean;
16
- };
17
- }
1
+ export interface IPermission {
2
+ id: string;
3
+ modelName: string;
4
+ label: string;
5
+ checked: boolean;
6
+ key: string;
7
+ }
8
+ export interface IPermissions {
9
+ modelName: string;
10
+ label: string;
11
+ permissions: IPermission[];
12
+ }
13
+ export interface IPermissionData {
14
+ [modelName: string]: {
15
+ [actionKey: string]: boolean;
16
+ };
17
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +1,12 @@
1
- import { IResourceFile } from "../types/IResourceFile";
2
- export declare enum PopulationType {
3
- LIST = "LIST",
4
- SHOW = "SHOW"
5
- }
6
- export declare class PopulationHelper {
7
- private resource;
8
- private populatedString;
9
- private populationType;
10
- constructor(resource: IResourceFile, populationType: PopulationType, populatedString: any);
11
- get(): Promise<any>;
12
- }
1
+ import { IResourceFile } from "../types/IResourceFile";
2
+ export declare enum PopulationType {
3
+ LIST = "LIST",
4
+ SHOW = "SHOW"
5
+ }
6
+ export declare class PopulationHelper {
7
+ private resource;
8
+ private populatedString;
9
+ private populationType;
10
+ constructor(resource: IResourceFile, populationType: PopulationType, populatedString: any);
11
+ get(): Promise<any>;
12
+ }
@@ -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,11 +1,11 @@
1
- /// <reference types="node" />
2
- import { FieldTypes } from '../types/helpers';
3
- export interface Columns {
4
- label: string;
5
- value: string;
6
- type: FieldTypes;
7
- }
8
- export default class ReportsGenerator {
9
- static CreateXlsxFile(columns: Columns[], data: any[], name: string): Buffer;
10
- static CreatePdfFile(columns: Columns[], data: any[], name: string): Promise<Buffer>;
11
- }
1
+ /// <reference types="node" />
2
+ import { FieldTypes } from '../types/helpers';
3
+ export interface Columns {
4
+ label: string;
5
+ value: string;
6
+ type: FieldTypes;
7
+ }
8
+ export default class ReportsGenerator {
9
+ static CreateXlsxFile(columns: Columns[], data: any[], name: string): Buffer;
10
+ static CreatePdfFile(columns: Columns[], data: any[], name: string): Promise<Buffer>;
11
+ }
@@ -1,57 +1,57 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const node_xlsx_1 = __importDefault(require("node-xlsx"));
16
- const lodash_1 = require("lodash");
17
- const helpers_1 = require("../types/helpers");
18
- const pdfjs_1 = __importDefault(require("pdfjs"));
19
- class ReportsGenerator {
20
- static CreateXlsxFile(columns, data, name) {
21
- const header = columns.map((field) => field.label);
22
- const rows = data.map((row) => columns.map((field) => { var _a, _b; return (field.type === helpers_1.FieldTypes.OBJECTID ? (_b = (_a = (0, lodash_1.get)(row, field.value)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '' : (0, lodash_1.get)(row, field.value)); }));
23
- const sheets = [
24
- {
25
- name,
26
- data: [header, ...rows],
27
- options: {},
28
- },
29
- ];
30
- const buffer = node_xlsx_1.default.build(sheets);
31
- return buffer;
32
- }
33
- static CreatePdfFile(columns, data, name) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const rows = data.map((row) => columns.map((field) => { var _a, _b; return (field.type === helpers_1.FieldTypes.OBJECTID ? (_b = (_a = (0, lodash_1.get)(row, field.value)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '' : (0, lodash_1.get)(row, field.value)); }));
36
- const doc = new pdfjs_1.default.Document({
37
- width: 861.12,
38
- font: require('pdfjs/font/Helvetica'),
39
- });
40
- const table = doc.table({
41
- widths: columns.map(column => '*'),
42
- borderWidth: 1,
43
- });
44
- const header = table.header({
45
- backgroundColor: 0x000,
46
- color: 0xffffff,
47
- });
48
- columns.map((field) => header.cell(field.label));
49
- rows.forEach(row => {
50
- const tableRow = table.row();
51
- row.map(cell => tableRow.cell(`${cell !== null && cell !== void 0 ? cell : '---'}`));
52
- });
53
- return yield doc.asBuffer();
54
- });
55
- }
56
- }
57
- exports.default = ReportsGenerator;
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const node_xlsx_1 = __importDefault(require("node-xlsx"));
16
+ const lodash_1 = require("lodash");
17
+ const helpers_1 = require("../types/helpers");
18
+ const pdfjs_1 = __importDefault(require("pdfjs"));
19
+ class ReportsGenerator {
20
+ static CreateXlsxFile(columns, data, name) {
21
+ const header = columns.map((field) => field.label);
22
+ const rows = data.map((row) => columns.map((field) => { var _a, _b; return (field.type === helpers_1.FieldTypes.OBJECTID ? (_b = (_a = (0, lodash_1.get)(row, field.value)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '' : (0, lodash_1.get)(row, field.value)); }));
23
+ const sheets = [
24
+ {
25
+ name,
26
+ data: [header, ...rows],
27
+ options: {},
28
+ },
29
+ ];
30
+ const buffer = node_xlsx_1.default.build(sheets);
31
+ return buffer;
32
+ }
33
+ static CreatePdfFile(columns, data, name) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const rows = data.map((row) => columns.map((field) => { var _a, _b; return (field.type === helpers_1.FieldTypes.OBJECTID ? (_b = (_a = (0, lodash_1.get)(row, field.value)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '' : (0, lodash_1.get)(row, field.value)); }));
36
+ const doc = new pdfjs_1.default.Document({
37
+ width: 861.12,
38
+ font: require('pdfjs/font/Helvetica'),
39
+ });
40
+ const table = doc.table({
41
+ widths: columns.map(column => '*'),
42
+ borderWidth: 1,
43
+ });
44
+ const header = table.header({
45
+ backgroundColor: 0x000,
46
+ color: 0xffffff,
47
+ });
48
+ columns.map((field) => header.cell(field.label));
49
+ rows.forEach(row => {
50
+ const tableRow = table.row();
51
+ row.map(cell => tableRow.cell(`${cell !== null && cell !== void 0 ? cell : '---'}`));
52
+ });
53
+ return yield doc.asBuffer();
54
+ });
55
+ }
56
+ }
57
+ 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
+ }