@tomei/sso 0.15.4 → 0.15.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.
Files changed (245) hide show
  1. package/__tests__/unit/components/login-user/login-user.spec.ts +16 -16
  2. package/migrations/20240314080603-create-user-table.js +108 -0
  3. package/migrations/{04-create-user-user-group-table.js → 20240314080604-create-user-user-group-table.js} +1 -1
  4. package/migrations/{05-create-login-history-table.js → 20240314080605-create-login-history-table.js} +1 -1
  5. package/package.json +3 -2
  6. package/src/components/login-user/interfaces/user-info.interface.ts +29 -9
  7. package/src/components/login-user/login-user.ts +749 -557
  8. package/src/enum/index.ts +1 -0
  9. package/src/enum/yn.enum.ts +4 -0
  10. package/src/models/user.entity.ts +160 -110
  11. package/dist/__tests__/unit/components/login-user/login-user.spec.d.ts +0 -1
  12. package/dist/__tests__/unit/components/login-user/login-user.spec.js +0 -663
  13. package/dist/__tests__/unit/components/login-user/login-user.spec.js.map +0 -1
  14. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.d.ts +0 -1
  15. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js +0 -38
  16. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js.map +0 -1
  17. package/dist/__tests__/unit/redis-client/redis.service.spec.d.ts +0 -1
  18. package/dist/__tests__/unit/redis-client/redis.service.spec.js +0 -32
  19. package/dist/__tests__/unit/redis-client/redis.service.spec.js.map +0 -1
  20. package/dist/__tests__/unit/session/session.service.spec.d.ts +0 -1
  21. package/dist/__tests__/unit/session/session.service.spec.js +0 -55
  22. package/dist/__tests__/unit/session/session.service.spec.js.map +0 -1
  23. package/dist/__tests__/unit/system-privilege/system-privilage.spec.d.ts +0 -0
  24. package/dist/__tests__/unit/system-privilege/system-privilage.spec.js +0 -6
  25. package/dist/__tests__/unit/system-privilege/system-privilage.spec.js.map +0 -1
  26. package/dist/index.d.ts +0 -1
  27. package/dist/index.js +0 -18
  28. package/dist/index.js.map +0 -1
  29. package/dist/src/components/building/building.d.ts +0 -39
  30. package/dist/src/components/building/building.js +0 -129
  31. package/dist/src/components/building/building.js.map +0 -1
  32. package/dist/src/components/building/building.repository.d.ts +0 -6
  33. package/dist/src/components/building/building.repository.js +0 -38
  34. package/dist/src/components/building/building.repository.js.map +0 -1
  35. package/dist/src/components/building/index.d.ts +0 -2
  36. package/dist/src/components/building/index.js +0 -19
  37. package/dist/src/components/building/index.js.map +0 -1
  38. package/dist/src/components/building-type/building-type.repository.d.ts +0 -5
  39. package/dist/src/components/building-type/building-type.repository.js +0 -12
  40. package/dist/src/components/building-type/building-type.repository.js.map +0 -1
  41. package/dist/src/components/building-type/index.d.ts +0 -1
  42. package/dist/src/components/building-type/index.js +0 -18
  43. package/dist/src/components/building-type/index.js.map +0 -1
  44. package/dist/src/components/index.d.ts +0 -10
  45. package/dist/src/components/index.js +0 -27
  46. package/dist/src/components/index.js.map +0 -1
  47. package/dist/src/components/login-history/index.d.ts +0 -1
  48. package/dist/src/components/login-history/index.js +0 -18
  49. package/dist/src/components/login-history/index.js.map +0 -1
  50. package/dist/src/components/login-history/login-history.repository.d.ts +0 -5
  51. package/dist/src/components/login-history/login-history.repository.js +0 -12
  52. package/dist/src/components/login-history/login-history.repository.js.map +0 -1
  53. package/dist/src/components/login-user/index.d.ts +0 -3
  54. package/dist/src/components/login-user/index.js +0 -20
  55. package/dist/src/components/login-user/index.js.map +0 -1
  56. package/dist/src/components/login-user/interfaces/index.d.ts +0 -1
  57. package/dist/src/components/login-user/interfaces/index.js +0 -18
  58. package/dist/src/components/login-user/interfaces/index.js.map +0 -1
  59. package/dist/src/components/login-user/interfaces/user-info.interface.d.ts +0 -9
  60. package/dist/src/components/login-user/interfaces/user-info.interface.js +0 -3
  61. package/dist/src/components/login-user/interfaces/user-info.interface.js.map +0 -1
  62. package/dist/src/components/login-user/login-user.d.ts +0 -47
  63. package/dist/src/components/login-user/login-user.js +0 -440
  64. package/dist/src/components/login-user/login-user.js.map +0 -1
  65. package/dist/src/components/login-user/user.repository.d.ts +0 -5
  66. package/dist/src/components/login-user/user.repository.js +0 -12
  67. package/dist/src/components/login-user/user.repository.js.map +0 -1
  68. package/dist/src/components/password-hash/index.d.ts +0 -2
  69. package/dist/src/components/password-hash/index.js +0 -19
  70. package/dist/src/components/password-hash/index.js.map +0 -1
  71. package/dist/src/components/password-hash/interfaces/index.d.ts +0 -1
  72. package/dist/src/components/password-hash/interfaces/index.js +0 -18
  73. package/dist/src/components/password-hash/interfaces/index.js.map +0 -1
  74. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.d.ts +0 -4
  75. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js +0 -3
  76. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js.map +0 -1
  77. package/dist/src/components/password-hash/password-hash.service.d.ts +0 -6
  78. package/dist/src/components/password-hash/password-hash.service.js +0 -28
  79. package/dist/src/components/password-hash/password-hash.service.js.map +0 -1
  80. package/dist/src/components/staff/index.d.ts +0 -2
  81. package/dist/src/components/staff/index.js +0 -19
  82. package/dist/src/components/staff/index.js.map +0 -1
  83. package/dist/src/components/staff/staff.d.ts +0 -50
  84. package/dist/src/components/staff/staff.js +0 -102
  85. package/dist/src/components/staff/staff.js.map +0 -1
  86. package/dist/src/components/staff/staff.repository.d.ts +0 -6
  87. package/dist/src/components/staff/staff.repository.js +0 -38
  88. package/dist/src/components/staff/staff.repository.js.map +0 -1
  89. package/dist/src/components/system/index.d.ts +0 -1
  90. package/dist/src/components/system/index.js +0 -18
  91. package/dist/src/components/system/index.js.map +0 -1
  92. package/dist/src/components/system/system.repository.d.ts +0 -5
  93. package/dist/src/components/system/system.repository.js +0 -12
  94. package/dist/src/components/system/system.repository.js.map +0 -1
  95. package/dist/src/components/system-access/index.d.ts +0 -1
  96. package/dist/src/components/system-access/index.js +0 -18
  97. package/dist/src/components/system-access/index.js.map +0 -1
  98. package/dist/src/components/system-access/system-access.repository.d.ts +0 -5
  99. package/dist/src/components/system-access/system-access.repository.js +0 -12
  100. package/dist/src/components/system-access/system-access.repository.js.map +0 -1
  101. package/dist/src/components/system-privilege/privilege.d.ts +0 -6
  102. package/dist/src/components/system-privilege/privilege.js +0 -77
  103. package/dist/src/components/system-privilege/privilege.js.map +0 -1
  104. package/dist/src/components/system-privilege/system-privilege.repository.d.ts +0 -6
  105. package/dist/src/components/system-privilege/system-privilege.repository.js +0 -35
  106. package/dist/src/components/system-privilege/system-privilege.repository.js.map +0 -1
  107. package/dist/src/components/user-group/index.d.ts +0 -1
  108. package/dist/src/components/user-group/index.js +0 -18
  109. package/dist/src/components/user-group/index.js.map +0 -1
  110. package/dist/src/components/user-group/user-group.repository.d.ts +0 -5
  111. package/dist/src/components/user-group/user-group.repository.js +0 -12
  112. package/dist/src/components/user-group/user-group.repository.js.map +0 -1
  113. package/dist/src/components/user-user-group/index.d.ts +0 -1
  114. package/dist/src/components/user-user-group/index.js +0 -18
  115. package/dist/src/components/user-user-group/index.js.map +0 -1
  116. package/dist/src/components/user-user-group/user-user-group.repository.d.ts +0 -5
  117. package/dist/src/components/user-user-group/user-user-group.repository.js +0 -12
  118. package/dist/src/components/user-user-group/user-user-group.repository.js.map +0 -1
  119. package/dist/src/database.d.ts +0 -4
  120. package/dist/src/database.js +0 -15
  121. package/dist/src/database.js.map +0 -1
  122. package/dist/src/index.d.ts +0 -5
  123. package/dist/src/index.js +0 -24
  124. package/dist/src/index.js.map +0 -1
  125. package/dist/src/interfaces/index.d.ts +0 -2
  126. package/dist/src/interfaces/index.js +0 -19
  127. package/dist/src/interfaces/index.js.map +0 -1
  128. package/dist/src/interfaces/system-login.interface.d.ts +0 -6
  129. package/dist/src/interfaces/system-login.interface.js +0 -3
  130. package/dist/src/interfaces/system-login.interface.js.map +0 -1
  131. package/dist/src/interfaces/user-session.interface.d.ts +0 -4
  132. package/dist/src/interfaces/user-session.interface.js +0 -3
  133. package/dist/src/interfaces/user-session.interface.js.map +0 -1
  134. package/dist/src/models/authorization-code.entity.d.ts +0 -14
  135. package/dist/src/models/authorization-code.entity.js +0 -86
  136. package/dist/src/models/authorization-code.entity.js.map +0 -1
  137. package/dist/src/models/bearer-token.entity.d.ts +0 -11
  138. package/dist/src/models/bearer-token.entity.js +0 -72
  139. package/dist/src/models/bearer-token.entity.js.map +0 -1
  140. package/dist/src/models/building-type.entity.d.ts +0 -7
  141. package/dist/src/models/building-type.entity.js +0 -50
  142. package/dist/src/models/building-type.entity.js.map +0 -1
  143. package/dist/src/models/building.entity.d.ts +0 -39
  144. package/dist/src/models/building.entity.js +0 -251
  145. package/dist/src/models/building.entity.js.map +0 -1
  146. package/dist/src/models/city.entity.d.ts +0 -11
  147. package/dist/src/models/city.entity.js +0 -72
  148. package/dist/src/models/city.entity.js.map +0 -1
  149. package/dist/src/models/company.entity.d.ts +0 -18
  150. package/dist/src/models/company.entity.js +0 -114
  151. package/dist/src/models/company.entity.js.map +0 -1
  152. package/dist/src/models/country.entity.d.ts +0 -13
  153. package/dist/src/models/country.entity.js +0 -76
  154. package/dist/src/models/country.entity.js.map +0 -1
  155. package/dist/src/models/department.entity.d.ts +0 -19
  156. package/dist/src/models/department.entity.js +0 -112
  157. package/dist/src/models/department.entity.js.map +0 -1
  158. package/dist/src/models/group-role-privilege.entity.d.ts +0 -17
  159. package/dist/src/models/group-role-privilege.entity.js +0 -90
  160. package/dist/src/models/group-role-privilege.entity.js.map +0 -1
  161. package/dist/src/models/group-system-access.entity.d.ts +0 -11
  162. package/dist/src/models/group-system-access.entity.js +0 -62
  163. package/dist/src/models/group-system-access.entity.js.map +0 -1
  164. package/dist/src/models/group-system-privilege.entity.d.ts +0 -11
  165. package/dist/src/models/group-system-privilege.entity.js +0 -62
  166. package/dist/src/models/group-system-privilege.entity.js.map +0 -1
  167. package/dist/src/models/group-system-role.entity.d.ts +0 -11
  168. package/dist/src/models/group-system-role.entity.js +0 -62
  169. package/dist/src/models/group-system-role.entity.js.map +0 -1
  170. package/dist/src/models/login-history.entity.d.ts +0 -12
  171. package/dist/src/models/login-history.entity.js +0 -70
  172. package/dist/src/models/login-history.entity.js.map +0 -1
  173. package/dist/src/models/oauth-token.entity.d.ts +0 -14
  174. package/dist/src/models/oauth-token.entity.js +0 -86
  175. package/dist/src/models/oauth-token.entity.js.map +0 -1
  176. package/dist/src/models/role.entity.d.ts +0 -17
  177. package/dist/src/models/role.entity.js +0 -102
  178. package/dist/src/models/role.entity.js.map +0 -1
  179. package/dist/src/models/staff-type.entity.d.ts +0 -7
  180. package/dist/src/models/staff-type.entity.js +0 -50
  181. package/dist/src/models/staff-type.entity.js.map +0 -1
  182. package/dist/src/models/staff.entity.d.ts +0 -39
  183. package/dist/src/models/staff.entity.js +0 -250
  184. package/dist/src/models/staff.entity.js.map +0 -1
  185. package/dist/src/models/state.entity.d.ts +0 -10
  186. package/dist/src/models/state.entity.js +0 -64
  187. package/dist/src/models/state.entity.js.map +0 -1
  188. package/dist/src/models/system-accesss.entity.d.ts +0 -6
  189. package/dist/src/models/system-accesss.entity.js +0 -51
  190. package/dist/src/models/system-accesss.entity.js.map +0 -1
  191. package/dist/src/models/system-privilege.entity.d.ts +0 -16
  192. package/dist/src/models/system-privilege.entity.js +0 -90
  193. package/dist/src/models/system-privilege.entity.js.map +0 -1
  194. package/dist/src/models/system-role-privilege.entity.d.ts +0 -11
  195. package/dist/src/models/system-role-privilege.entity.js +0 -60
  196. package/dist/src/models/system-role-privilege.entity.js.map +0 -1
  197. package/dist/src/models/system-role.entity.d.ts +0 -11
  198. package/dist/src/models/system-role.entity.js +0 -83
  199. package/dist/src/models/system-role.entity.js.map +0 -1
  200. package/dist/src/models/system.entity.d.ts +0 -19
  201. package/dist/src/models/system.entity.js +0 -146
  202. package/dist/src/models/system.entity.js.map +0 -1
  203. package/dist/src/models/user-group.entity.d.ts +0 -23
  204. package/dist/src/models/user-group.entity.js +0 -140
  205. package/dist/src/models/user-group.entity.js.map +0 -1
  206. package/dist/src/models/user-role.entity.d.ts +0 -12
  207. package/dist/src/models/user-role.entity.js +0 -73
  208. package/dist/src/models/user-role.entity.js.map +0 -1
  209. package/dist/src/models/user-system-privileges.entity.d.ts +0 -13
  210. package/dist/src/models/user-system-privileges.entity.js +0 -89
  211. package/dist/src/models/user-system-privileges.entity.js.map +0 -1
  212. package/dist/src/models/user-system-role.entity.d.ts +0 -11
  213. package/dist/src/models/user-system-role.entity.js +0 -60
  214. package/dist/src/models/user-system-role.entity.js.map +0 -1
  215. package/dist/src/models/user-user-group.entity.d.ts +0 -14
  216. package/dist/src/models/user-user-group.entity.js +0 -73
  217. package/dist/src/models/user-user-group.entity.js.map +0 -1
  218. package/dist/src/models/user.entity.d.ts +0 -30
  219. package/dist/src/models/user.entity.js +0 -131
  220. package/dist/src/models/user.entity.js.map +0 -1
  221. package/dist/src/redis-client/__mocks__/jest-initial-setup.d.ts +0 -1
  222. package/dist/src/redis-client/__mocks__/jest-initial-setup.js +0 -5
  223. package/dist/src/redis-client/__mocks__/jest-initial-setup.js.map +0 -1
  224. package/dist/src/redis-client/__mocks__/redis-mock.d.ts +0 -2
  225. package/dist/src/redis-client/__mocks__/redis-mock.js +0 -23
  226. package/dist/src/redis-client/__mocks__/redis-mock.js.map +0 -1
  227. package/dist/src/redis-client/index.d.ts +0 -1
  228. package/dist/src/redis-client/index.js +0 -18
  229. package/dist/src/redis-client/index.js.map +0 -1
  230. package/dist/src/redis-client/redis.service.d.ts +0 -7
  231. package/dist/src/redis-client/redis.service.js +0 -61
  232. package/dist/src/redis-client/redis.service.js.map +0 -1
  233. package/dist/src/session/index.d.ts +0 -2
  234. package/dist/src/session/index.js +0 -19
  235. package/dist/src/session/index.js.map +0 -1
  236. package/dist/src/session/interfaces/index.d.ts +0 -1
  237. package/dist/src/session/interfaces/index.js +0 -18
  238. package/dist/src/session/interfaces/index.js.map +0 -1
  239. package/dist/src/session/interfaces/session-service.interface.d.ts +0 -6
  240. package/dist/src/session/interfaces/session-service.interface.js +0 -3
  241. package/dist/src/session/interfaces/session-service.interface.js.map +0 -1
  242. package/dist/src/session/session.service.d.ts +0 -10
  243. package/dist/src/session/session.service.js +0 -63
  244. package/dist/src/session/session.service.js.map +0 -1
  245. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,18 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./password-hash-service.interface"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/password-hash/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD"}
@@ -1,4 +0,0 @@
1
- export interface IPasswordHashService {
2
- hashPassword(password: string): Promise<string>;
3
- verify(password: string, hash: string): Promise<boolean>;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=password-hash-service.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"password-hash-service.interface.js","sourceRoot":"","sources":["../../../../../src/components/password-hash/interfaces/password-hash-service.interface.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import { IPasswordHashService } from './interfaces/password-hash-service.interface';
2
- export declare class PasswordHashService implements IPasswordHashService {
3
- constructor();
4
- hashPassword(password: string): Promise<string>;
5
- verify(password: string, hash: string): Promise<boolean>;
6
- }
@@ -1,28 +0,0 @@
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.PasswordHashService = void 0;
13
- const argon2 = require("argon2");
14
- class PasswordHashService {
15
- constructor() { }
16
- hashPassword(password) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- return yield argon2.hash(password);
19
- });
20
- }
21
- verify(password, hash) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- return yield argon2.verify(hash, password);
24
- });
25
- }
26
- }
27
- exports.PasswordHashService = PasswordHashService;
28
- //# sourceMappingURL=password-hash.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"password-hash.service.js","sourceRoot":"","sources":["../../../../src/components/password-hash/password-hash.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAiC;AAGjC,MAAa,mBAAmB;IAC9B,gBAAe,CAAC;IAEV,YAAY,CAAC,QAAgB;;YACjC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;KAAA;IAEK,MAAM,CAAC,QAAgB,EAAE,IAAY;;YACzC,OAAO,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;KAAA;CACF;AAVD,kDAUC"}
@@ -1,2 +0,0 @@
1
- export * from './staff';
2
- export * from './staff.repository';
@@ -1,19 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./staff"), exports);
18
- __exportStar(require("./staff.repository"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/staff/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,0CAAwB;AACxB,qDAAmC"}
@@ -1,50 +0,0 @@
1
- import { IAddress, IPerson, ObjectBase } from '@tomei/general';
2
- import { LoginUser } from '../../..';
3
- export declare class Staff extends ObjectBase implements IPerson {
4
- ObjectId: string;
5
- ObjectName: string;
6
- TableName: 'sso_Staff';
7
- ObjectType: 'Staff';
8
- FullName: string;
9
- IDNo: string;
10
- IDType: string;
11
- Email: string;
12
- ContactNo: string;
13
- DefaultAddress: IAddress;
14
- PreferredName: string;
15
- StaffId: string;
16
- StaffTypeId: number;
17
- JobTitle: string;
18
- CarPlate: string;
19
- Mobile: string;
20
- Floor: string;
21
- Extension: string;
22
- IsCharge: boolean;
23
- Status: string;
24
- CompanyId: number;
25
- UserId: number;
26
- BuildingId: number;
27
- DepartmentId: number;
28
- private _created_by_id;
29
- private _updated_by_id;
30
- private _created_at;
31
- private _updated_at;
32
- FullAddress: string;
33
- private static _Repo;
34
- getDetails(): Promise<{
35
- FullName: string;
36
- IDNo: string;
37
- IDType: string;
38
- Email: string;
39
- ContactNo: string;
40
- }> | {
41
- FullName: string;
42
- IDNo: string;
43
- IDType: string;
44
- Email: string;
45
- ContactNo: string;
46
- };
47
- private constructor();
48
- static init(dbTransaction: any, staff_id?: string): Promise<Staff | undefined>;
49
- static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, rows?: number, search?: {}): Promise<any>;
50
- }
@@ -1,102 +0,0 @@
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.Staff = void 0;
13
- const general_1 = require("@tomei/general");
14
- const staff_repository_1 = require("./staff.repository");
15
- const config_1 = require("@tomei/config");
16
- const sequelize_1 = require("sequelize");
17
- const staff_type_entity_1 = require("../../models/staff-type.entity");
18
- const building_entity_1 = require("../../models/building.entity");
19
- const department_entity_1 = require("../../models/department.entity");
20
- const building_type_entity_1 = require("../../models/building-type.entity");
21
- class Staff extends general_1.ObjectBase {
22
- getDetails() {
23
- throw new Error('Method not implemented.');
24
- }
25
- constructor(staffInfo) {
26
- super();
27
- if (staffInfo) {
28
- this.ObjectId = staffInfo.id;
29
- this.UserId = staffInfo.user_id;
30
- this.StaffId = staffInfo.staff_id;
31
- this.FullName = staffInfo.full_name;
32
- this.PreferredName = staffInfo.preferred_name;
33
- this.IDNo = staffInfo.IdNo;
34
- this.FullAddress = staffInfo.FullAddress;
35
- this.StaffTypeId = staffInfo.staff_type_id;
36
- this.Email = staffInfo.email;
37
- this.CarPlate = staffInfo.car_plate;
38
- this.Mobile = staffInfo.mobile;
39
- this.Floor = staffInfo.floor;
40
- this.Extension = staffInfo.extension;
41
- this.IsCharge = staffInfo.is_charge;
42
- this.BuildingId = staffInfo.building_id;
43
- this.DepartmentId = staffInfo.department_id;
44
- }
45
- }
46
- static init(dbTransaction, staff_id) {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- if (staff_id) {
49
- const staff = yield Staff._Repo.findOne({
50
- where: {
51
- staff_id: staff_id,
52
- },
53
- });
54
- if (!staff) {
55
- throw Error('Building not found.');
56
- }
57
- return new Staff(staff);
58
- }
59
- });
60
- }
61
- static findAll(loginUser, dbTransaction, page, rows, search = {}) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- try {
64
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
65
- const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'Staff - View');
66
- if (!isPrivileged) {
67
- throw new Error('You do not have permission to view Building.');
68
- }
69
- const whereObj = {};
70
- Object.keys(search).forEach((key) => {
71
- if (search[key]) {
72
- whereObj[key] = {
73
- [sequelize_1.Op.substring]: search[key],
74
- };
75
- }
76
- });
77
- let options = {
78
- where: whereObj,
79
- include: [
80
- staff_type_entity_1.default,
81
- { model: building_entity_1.default, include: [building_type_entity_1.default] },
82
- department_entity_1.default,
83
- ],
84
- order: [['created_at', 'DESC']],
85
- transaction: dbTransaction,
86
- };
87
- if (page && rows) {
88
- const offset = rows * (page - 1);
89
- options = Object.assign(Object.assign({}, options), { offset, limit: rows });
90
- }
91
- const result = yield Staff._Repo.findAndCountAll(options);
92
- return result;
93
- }
94
- catch (error) {
95
- throw error;
96
- }
97
- });
98
- }
99
- }
100
- exports.Staff = Staff;
101
- Staff._Repo = new staff_repository_1.StaffRepository();
102
- //# sourceMappingURL=staff.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"staff.js","sourceRoot":"","sources":["../../../../src/components/staff/staff.ts"],"names":[],"mappings":"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"}
@@ -1,6 +0,0 @@
1
- import Staff from '../../models/staff.entity';
2
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
3
- export declare class StaffRepository extends RepositoryBase<Staff> implements IRepositoryBase<Staff> {
4
- constructor();
5
- findAndCountAll(options?: any): Promise<any>;
6
- }
@@ -1,38 +0,0 @@
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.StaffRepository = void 0;
13
- const staff_entity_1 = require("../../models/staff.entity");
14
- const general_1 = require("@tomei/general");
15
- class StaffRepository extends general_1.RepositoryBase {
16
- constructor() {
17
- super(staff_entity_1.default);
18
- }
19
- findAndCountAll(options) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- let staffs;
23
- if (options) {
24
- staffs = yield staff_entity_1.default.findAndCountAll(options);
25
- }
26
- else {
27
- staffs = yield staff_entity_1.default.findAndCountAll();
28
- }
29
- return staffs;
30
- }
31
- catch (error) {
32
- throw new Error(`An Error occured when retriving staffs: ${error.message}`);
33
- }
34
- });
35
- }
36
- }
37
- exports.StaffRepository = StaffRepository;
38
- //# sourceMappingURL=staff.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"staff.repository.js","sourceRoot":"","sources":["../../../../src/components/staff/staff.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAA8C;AAC9C,4CAAiE;AAEjE,MAAa,eACX,SAAQ,wBAAqB;IAG7B;QACE,KAAK,CAAC,sBAAK,CAAC,CAAC;IACf,CAAC;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI;gBACF,IAAI,MAAW,CAAC;gBAChB,IAAI,OAAO,EAAE;oBACX,MAAM,GAAG,MAAM,sBAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;iBAC/C;qBAAM;oBACL,MAAM,GAAG,MAAM,sBAAK,CAAC,eAAe,EAAE,CAAC;iBACxC;gBACD,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CACb,2CAA2C,KAAK,CAAC,OAAO,EAAE,CAC3D,CAAC;aACH;QACH,CAAC;KAAA;CACF;AAvBD,0CAuBC"}
@@ -1 +0,0 @@
1
- export * from './system.repository';
@@ -1,18 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./system.repository"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/system/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
@@ -1,5 +0,0 @@
1
- import System from '../../models/system.entity';
2
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
3
- export declare class SystemRepository extends RepositoryBase<System> implements IRepositoryBase<System> {
4
- constructor();
5
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SystemRepository = void 0;
4
- const system_entity_1 = require("../../models/system.entity");
5
- const general_1 = require("@tomei/general");
6
- class SystemRepository extends general_1.RepositoryBase {
7
- constructor() {
8
- super(system_entity_1.default);
9
- }
10
- }
11
- exports.SystemRepository = SystemRepository;
12
- //# sourceMappingURL=system.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system.repository.js","sourceRoot":"","sources":["../../../../src/components/system/system.repository.ts"],"names":[],"mappings":";;;AAAA,8DAAgD;AAChD,4CAAiE;AAEjE,MAAa,gBACX,SAAQ,wBAAsB;IAG9B;QACE,KAAK,CAAC,uBAAM,CAAC,CAAC;IAChB,CAAC;CACF;AAPD,4CAOC"}
@@ -1 +0,0 @@
1
- export * from './system-access.repository';
@@ -1,18 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./system-access.repository"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/system-access/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C"}
@@ -1,5 +0,0 @@
1
- import SystemAccess from '../../models/system-accesss.entity';
2
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
3
- export declare class SystemAccessRepository extends RepositoryBase<SystemAccess> implements IRepositoryBase<SystemAccess> {
4
- constructor();
5
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SystemAccessRepository = void 0;
4
- const system_accesss_entity_1 = require("../../models/system-accesss.entity");
5
- const general_1 = require("@tomei/general");
6
- class SystemAccessRepository extends general_1.RepositoryBase {
7
- constructor() {
8
- super(system_accesss_entity_1.default);
9
- }
10
- }
11
- exports.SystemAccessRepository = SystemAccessRepository;
12
- //# sourceMappingURL=system-access.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-access.repository.js","sourceRoot":"","sources":["../../../../src/components/system-access/system-access.repository.ts"],"names":[],"mappings":";;;AAAA,8EAA8D;AAC9D,4CAAiE;AAEjE,MAAa,sBACX,SAAQ,wBAA4B;IAGpC;QACE,KAAK,CAAC,+BAAY,CAAC,CAAC;IACtB,CAAC;CACF;AAPD,wDAOC"}
@@ -1,6 +0,0 @@
1
- export declare class Privilege {
2
- private static _Repository;
3
- private static _SystemRepository;
4
- static loadPrivileges(packageName: string | string[], systemCode: string, transaction?: any): Promise<void>;
5
- private static loadPrivilege;
6
- }
@@ -1,77 +0,0 @@
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.Privilege = void 0;
13
- const system_repository_1 = require("../system/system.repository");
14
- const system_privilege_repository_1 = require("./system-privilege.repository");
15
- const cuid = require("cuid");
16
- class Privilege {
17
- static loadPrivileges(packageName, systemCode, transaction) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- try {
20
- const system = yield Privilege._SystemRepository.findOne({
21
- where: {
22
- Code: systemCode,
23
- },
24
- transaction,
25
- });
26
- if (!system) {
27
- throw new Error('System not found');
28
- }
29
- if (Array.isArray(packageName)) {
30
- for (const name of packageName) {
31
- yield this.loadPrivilege(name, system.id, transaction);
32
- }
33
- }
34
- else {
35
- yield this.loadPrivilege(packageName, system.id, transaction);
36
- }
37
- }
38
- catch (error) {
39
- throw error;
40
- }
41
- });
42
- }
43
- static loadPrivilege(packageName, systemId, transaction) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- var _a;
46
- try {
47
- let privileges = [];
48
- try {
49
- const { Privileges } = yield (_a = `@tomei/${packageName}/privileges.json`, Promise.resolve().then(() => require(_a)));
50
- privileges = Privileges;
51
- }
52
- catch (error) {
53
- throw new Error('Module not found');
54
- }
55
- for (const privilege of privileges) {
56
- const { Code, Description } = privilege;
57
- yield Privilege._Repository.findOrCreate({
58
- Code,
59
- SystemId: systemId,
60
- Description,
61
- }, {
62
- PrivilegeId: cuid(),
63
- CreatedAt: new Date(),
64
- UpdatedAt: new Date(),
65
- }, transaction);
66
- }
67
- }
68
- catch (error) {
69
- throw error;
70
- }
71
- });
72
- }
73
- }
74
- exports.Privilege = Privilege;
75
- Privilege._Repository = new system_privilege_repository_1.SystemPrivilegeRepository();
76
- Privilege._SystemRepository = new system_repository_1.SystemRepository();
77
- //# sourceMappingURL=privilege.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"privilege.js","sourceRoot":"","sources":["../../../../src/components/system-privilege/privilege.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAA+D;AAC/D,+EAA0E;AAC1E,6BAA6B;AAE7B,MAAa,SAAS;IAIpB,MAAM,CAAO,cAAc,CACzB,WAA8B,EAC9B,UAAkB,EAClB,WAAiB;;YAEjB,IAAI;gBAEF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC;oBACvD,KAAK,EAAE;wBACL,IAAI,EAAE,UAAU;qBACjB;oBACD,WAAW;iBACZ,CAAC,CAAC;gBAEH,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;iBACrC;gBAED,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;oBAC9B,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;wBAC9B,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;qBACxD;iBACF;qBAAM;oBACL,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;iBAC/D;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;IAEO,MAAM,CAAO,aAAa,CAChC,WAAmB,EACnB,QAAgB,EAChB,WAAiB;;;YAEjB,IAAI;gBACF,IAAI,UAAU,GAAG,EAAE,CAAC;gBACpB,IAAI;oBACF,MAAM,EAAE,UAAU,EAAE,GAAG,YACrB,UAAU,WAAW,kBAAkB,4CACxC,CAAC;oBACF,UAAU,GAAG,UAAU,CAAC;iBACzB;gBAAC,OAAO,KAAK,EAAE;oBACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;iBACrC;gBACD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;oBAClC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;oBACxC,MAAM,SAAS,CAAC,WAAW,CAAC,YAAY,CACtC;wBACE,IAAI;wBACJ,QAAQ,EAAE,QAAQ;wBAClB,WAAW;qBACZ,EACD;wBACE,WAAW,EAAE,IAAI,EAAE;wBACnB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;qBACtB,EACD,WAAW,CACZ,CAAC;iBACH;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;;AApEH,8BAqEC;AApEgB,qBAAW,GAAG,IAAI,uDAAyB,EAAE,CAAC;AAC9C,2BAAiB,GAAG,IAAI,oCAAgB,EAAE,CAAC"}
@@ -1,6 +0,0 @@
1
- import SystemPrivilege from '../../models/system-privilege.entity';
2
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
3
- export declare class SystemPrivilegeRepository extends RepositoryBase<SystemPrivilege> implements IRepositoryBase<SystemPrivilege> {
4
- constructor();
5
- findOrCreate(where: any, defaults: any, transaction: any): Promise<[SystemPrivilege, boolean]>;
6
- }
@@ -1,35 +0,0 @@
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.SystemPrivilegeRepository = void 0;
13
- const system_privilege_entity_1 = require("../../models/system-privilege.entity");
14
- const general_1 = require("@tomei/general");
15
- class SystemPrivilegeRepository extends general_1.RepositoryBase {
16
- constructor() {
17
- super(system_privilege_entity_1.default);
18
- }
19
- findOrCreate(where, defaults, transaction) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- return yield system_privilege_entity_1.default.findOrCreate({
23
- where,
24
- defaults,
25
- transaction,
26
- });
27
- }
28
- catch (error) {
29
- throw error;
30
- }
31
- });
32
- }
33
- }
34
- exports.SystemPrivilegeRepository = SystemPrivilegeRepository;
35
- //# sourceMappingURL=system-privilege.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-privilege.repository.js","sourceRoot":"","sources":["../../../../src/components/system-privilege/system-privilege.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kFAAmE;AACnE,4CAAiE;AAEjE,MAAa,yBACX,SAAQ,wBAA+B;IAGvC;QACE,KAAK,CAAC,iCAAe,CAAC,CAAC;IACzB,CAAC;IAEK,YAAY,CAAC,KAAU,EAAE,QAAa,EAAE,WAAgB;;YAC5D,IAAI;gBACF,OAAO,MAAM,iCAAe,CAAC,YAAY,CAAC;oBACxC,KAAK;oBACL,QAAQ;oBACR,WAAW;iBACZ,CAAC,CAAC;aACJ;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;CACF;AAnBD,8DAmBC"}
@@ -1 +0,0 @@
1
- export * from './user-group.repository';
@@ -1,18 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./user-group.repository"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/user-group/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -1,5 +0,0 @@
1
- import UserGroup from '../../models/user-group.entity';
2
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
3
- export declare class UserGroupRepository extends RepositoryBase<UserGroup> implements IRepositoryBase<UserGroup> {
4
- constructor();
5
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserGroupRepository = void 0;
4
- const user_group_entity_1 = require("../../models/user-group.entity");
5
- const general_1 = require("@tomei/general");
6
- class UserGroupRepository extends general_1.RepositoryBase {
7
- constructor() {
8
- super(user_group_entity_1.default);
9
- }
10
- }
11
- exports.UserGroupRepository = UserGroupRepository;
12
- //# sourceMappingURL=user-group.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-group.repository.js","sourceRoot":"","sources":["../../../../src/components/user-group/user-group.repository.ts"],"names":[],"mappings":";;;AAAA,sEAAuD;AACvD,4CAAiE;AAEjE,MAAa,mBACX,SAAQ,wBAAyB;IAGjC;QACE,KAAK,CAAC,2BAAS,CAAC,CAAC;IACnB,CAAC;CACF;AAPD,kDAOC"}
@@ -1 +0,0 @@
1
- export * from './user-user-group.repository';
@@ -1,18 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./user-user-group.repository"), exports);
18
- //# sourceMappingURL=index.js.map