@tomei/sso 0.15.3 → 0.15.4
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/dist/__tests__/unit/components/login-user/login-user.spec.d.ts +1 -0
- package/dist/__tests__/unit/components/login-user/login-user.spec.js +663 -0
- package/dist/__tests__/unit/components/login-user/login-user.spec.js.map +1 -0
- package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.d.ts +1 -0
- package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js +38 -0
- package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js.map +1 -0
- package/dist/__tests__/unit/redis-client/redis.service.spec.d.ts +1 -0
- package/dist/__tests__/unit/redis-client/redis.service.spec.js +32 -0
- package/dist/__tests__/unit/redis-client/redis.service.spec.js.map +1 -0
- package/dist/__tests__/unit/session/session.service.spec.d.ts +1 -0
- package/dist/__tests__/unit/session/session.service.spec.js +55 -0
- package/dist/__tests__/unit/session/session.service.spec.js.map +1 -0
- package/dist/__tests__/unit/system-privilege/system-privilage.spec.d.ts +0 -0
- package/dist/__tests__/unit/system-privilege/system-privilage.spec.js +6 -0
- package/dist/__tests__/unit/system-privilege/system-privilage.spec.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/building/building.d.ts +39 -0
- package/dist/src/components/building/building.js +129 -0
- package/dist/src/components/building/building.js.map +1 -0
- package/dist/src/components/building/building.repository.d.ts +6 -0
- package/dist/src/components/building/building.repository.js +38 -0
- package/dist/src/components/building/building.repository.js.map +1 -0
- package/dist/src/components/building/index.d.ts +2 -0
- package/dist/src/components/building/index.js +19 -0
- package/dist/src/components/building/index.js.map +1 -0
- package/dist/src/components/building-type/building-type.repository.d.ts +5 -0
- package/dist/src/components/building-type/building-type.repository.js +12 -0
- package/dist/src/components/building-type/building-type.repository.js.map +1 -0
- package/dist/src/components/building-type/index.d.ts +1 -0
- package/dist/src/components/building-type/index.js +18 -0
- package/dist/src/components/building-type/index.js.map +1 -0
- package/dist/src/components/index.d.ts +10 -0
- package/dist/src/components/index.js +27 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/login-history/index.d.ts +1 -0
- package/dist/src/components/login-history/index.js +18 -0
- package/dist/src/components/login-history/index.js.map +1 -0
- package/dist/src/components/login-history/login-history.repository.d.ts +5 -0
- package/dist/src/components/login-history/login-history.repository.js +12 -0
- package/dist/src/components/login-history/login-history.repository.js.map +1 -0
- package/dist/src/components/login-user/index.d.ts +3 -0
- package/dist/src/components/login-user/index.js +20 -0
- package/dist/src/components/login-user/index.js.map +1 -0
- package/dist/src/components/login-user/interfaces/index.d.ts +1 -0
- package/dist/src/components/login-user/interfaces/index.js +18 -0
- package/dist/src/components/login-user/interfaces/index.js.map +1 -0
- package/dist/src/components/login-user/interfaces/user-info.interface.d.ts +9 -0
- package/dist/src/components/login-user/interfaces/user-info.interface.js +3 -0
- package/dist/src/components/login-user/interfaces/user-info.interface.js.map +1 -0
- package/dist/src/components/login-user/login-user.d.ts +47 -0
- package/dist/src/components/login-user/login-user.js +440 -0
- package/dist/src/components/login-user/login-user.js.map +1 -0
- package/dist/src/components/login-user/user.repository.d.ts +5 -0
- package/dist/src/components/login-user/user.repository.js +12 -0
- package/dist/src/components/login-user/user.repository.js.map +1 -0
- package/dist/src/components/password-hash/index.d.ts +2 -0
- package/dist/src/components/password-hash/index.js +19 -0
- package/dist/src/components/password-hash/index.js.map +1 -0
- package/dist/src/components/password-hash/interfaces/index.d.ts +1 -0
- package/dist/src/components/password-hash/interfaces/index.js +18 -0
- package/dist/src/components/password-hash/interfaces/index.js.map +1 -0
- package/dist/src/components/password-hash/interfaces/password-hash-service.interface.d.ts +4 -0
- package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js +3 -0
- package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js.map +1 -0
- package/dist/src/components/password-hash/password-hash.service.d.ts +6 -0
- package/dist/src/components/password-hash/password-hash.service.js +28 -0
- package/dist/src/components/password-hash/password-hash.service.js.map +1 -0
- package/dist/src/components/staff/index.d.ts +2 -0
- package/dist/src/components/staff/index.js +19 -0
- package/dist/src/components/staff/index.js.map +1 -0
- package/dist/src/components/staff/staff.d.ts +50 -0
- package/dist/src/components/staff/staff.js +102 -0
- package/dist/src/components/staff/staff.js.map +1 -0
- package/dist/src/components/staff/staff.repository.d.ts +6 -0
- package/dist/src/components/staff/staff.repository.js +38 -0
- package/dist/src/components/staff/staff.repository.js.map +1 -0
- package/dist/src/components/system/index.d.ts +1 -0
- package/dist/src/components/system/index.js +18 -0
- package/dist/src/components/system/index.js.map +1 -0
- package/dist/src/components/system/system.repository.d.ts +5 -0
- package/dist/src/components/system/system.repository.js +12 -0
- package/dist/src/components/system/system.repository.js.map +1 -0
- package/dist/src/components/system-access/index.d.ts +1 -0
- package/dist/src/components/system-access/index.js +18 -0
- package/dist/src/components/system-access/index.js.map +1 -0
- package/dist/src/components/system-access/system-access.repository.d.ts +5 -0
- package/dist/src/components/system-access/system-access.repository.js +12 -0
- package/dist/src/components/system-access/system-access.repository.js.map +1 -0
- package/dist/src/components/system-privilege/privilege.d.ts +6 -0
- package/dist/src/components/system-privilege/privilege.js +77 -0
- package/dist/src/components/system-privilege/privilege.js.map +1 -0
- package/dist/src/components/system-privilege/system-privilege.repository.d.ts +6 -0
- package/dist/src/components/system-privilege/system-privilege.repository.js +35 -0
- package/dist/src/components/system-privilege/system-privilege.repository.js.map +1 -0
- package/dist/src/components/user-group/index.d.ts +1 -0
- package/dist/src/components/user-group/index.js +18 -0
- package/dist/src/components/user-group/index.js.map +1 -0
- package/dist/src/components/user-group/user-group.repository.d.ts +5 -0
- package/dist/src/components/user-group/user-group.repository.js +12 -0
- package/dist/src/components/user-group/user-group.repository.js.map +1 -0
- package/dist/src/components/user-user-group/index.d.ts +1 -0
- package/dist/src/components/user-user-group/index.js +18 -0
- package/dist/src/components/user-user-group/index.js.map +1 -0
- package/dist/src/components/user-user-group/user-user-group.repository.d.ts +5 -0
- package/dist/src/components/user-user-group/user-user-group.repository.js +12 -0
- package/dist/src/components/user-user-group/user-user-group.repository.js.map +1 -0
- package/dist/src/database.d.ts +4 -0
- package/dist/src/database.js +15 -0
- package/dist/src/database.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +24 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +2 -0
- package/dist/src/interfaces/index.js +19 -0
- package/dist/src/interfaces/index.js.map +1 -0
- package/dist/src/interfaces/system-login.interface.d.ts +6 -0
- package/dist/src/interfaces/system-login.interface.js +3 -0
- package/dist/src/interfaces/system-login.interface.js.map +1 -0
- package/dist/src/interfaces/user-session.interface.d.ts +4 -0
- package/dist/src/interfaces/user-session.interface.js +3 -0
- package/dist/src/interfaces/user-session.interface.js.map +1 -0
- package/dist/src/models/authorization-code.entity.d.ts +14 -0
- package/dist/src/models/authorization-code.entity.js +86 -0
- package/dist/src/models/authorization-code.entity.js.map +1 -0
- package/dist/src/models/bearer-token.entity.d.ts +11 -0
- package/dist/src/models/bearer-token.entity.js +72 -0
- package/dist/src/models/bearer-token.entity.js.map +1 -0
- package/dist/src/models/building-type.entity.d.ts +7 -0
- package/dist/src/models/building-type.entity.js +50 -0
- package/dist/src/models/building-type.entity.js.map +1 -0
- package/dist/src/models/building.entity.d.ts +39 -0
- package/dist/src/models/building.entity.js +251 -0
- package/dist/src/models/building.entity.js.map +1 -0
- package/dist/src/models/city.entity.d.ts +11 -0
- package/dist/src/models/city.entity.js +72 -0
- package/dist/src/models/city.entity.js.map +1 -0
- package/dist/src/models/company.entity.d.ts +18 -0
- package/dist/src/models/company.entity.js +114 -0
- package/dist/src/models/company.entity.js.map +1 -0
- package/dist/src/models/country.entity.d.ts +13 -0
- package/dist/src/models/country.entity.js +76 -0
- package/dist/src/models/country.entity.js.map +1 -0
- package/dist/src/models/department.entity.d.ts +19 -0
- package/dist/src/models/department.entity.js +112 -0
- package/dist/src/models/department.entity.js.map +1 -0
- package/dist/src/models/group-role-privilege.entity.d.ts +17 -0
- package/dist/src/models/group-role-privilege.entity.js +90 -0
- package/dist/src/models/group-role-privilege.entity.js.map +1 -0
- package/dist/src/models/group-system-access.entity.d.ts +11 -0
- package/dist/src/models/group-system-access.entity.js +62 -0
- package/dist/src/models/group-system-access.entity.js.map +1 -0
- package/dist/src/models/group-system-privilege.entity.d.ts +11 -0
- package/dist/src/models/group-system-privilege.entity.js +62 -0
- package/dist/src/models/group-system-privilege.entity.js.map +1 -0
- package/dist/src/models/group-system-role.entity.d.ts +11 -0
- package/dist/src/models/group-system-role.entity.js +62 -0
- package/dist/src/models/group-system-role.entity.js.map +1 -0
- package/dist/src/models/login-history.entity.d.ts +12 -0
- package/dist/src/models/login-history.entity.js +70 -0
- package/dist/src/models/login-history.entity.js.map +1 -0
- package/dist/src/models/oauth-token.entity.d.ts +14 -0
- package/dist/src/models/oauth-token.entity.js +86 -0
- package/dist/src/models/oauth-token.entity.js.map +1 -0
- package/dist/src/models/role.entity.d.ts +17 -0
- package/dist/src/models/role.entity.js +102 -0
- package/dist/src/models/role.entity.js.map +1 -0
- package/dist/src/models/staff-type.entity.d.ts +7 -0
- package/dist/src/models/staff-type.entity.js +50 -0
- package/dist/src/models/staff-type.entity.js.map +1 -0
- package/dist/src/models/staff.entity.d.ts +39 -0
- package/dist/src/models/staff.entity.js +250 -0
- package/dist/src/models/staff.entity.js.map +1 -0
- package/dist/src/models/state.entity.d.ts +10 -0
- package/dist/src/models/state.entity.js +64 -0
- package/dist/src/models/state.entity.js.map +1 -0
- package/dist/src/models/system-accesss.entity.d.ts +6 -0
- package/dist/src/models/system-accesss.entity.js +51 -0
- package/dist/src/models/system-accesss.entity.js.map +1 -0
- package/dist/src/models/system-privilege.entity.d.ts +16 -0
- package/dist/src/models/system-privilege.entity.js +90 -0
- package/dist/src/models/system-privilege.entity.js.map +1 -0
- package/dist/src/models/system-role-privilege.entity.d.ts +11 -0
- package/dist/src/models/system-role-privilege.entity.js +60 -0
- package/dist/src/models/system-role-privilege.entity.js.map +1 -0
- package/dist/src/models/system-role.entity.d.ts +11 -0
- package/dist/src/models/system-role.entity.js +83 -0
- package/dist/src/models/system-role.entity.js.map +1 -0
- package/dist/src/models/system.entity.d.ts +19 -0
- package/dist/src/models/system.entity.js +146 -0
- package/dist/src/models/system.entity.js.map +1 -0
- package/dist/src/models/user-group.entity.d.ts +23 -0
- package/dist/src/models/user-group.entity.js +140 -0
- package/dist/src/models/user-group.entity.js.map +1 -0
- package/dist/src/models/user-role.entity.d.ts +12 -0
- package/dist/src/models/user-role.entity.js +73 -0
- package/dist/src/models/user-role.entity.js.map +1 -0
- package/dist/src/models/user-system-privileges.entity.d.ts +13 -0
- package/dist/src/models/user-system-privileges.entity.js +89 -0
- package/dist/src/models/user-system-privileges.entity.js.map +1 -0
- package/dist/src/models/user-system-role.entity.d.ts +11 -0
- package/dist/src/models/user-system-role.entity.js +60 -0
- package/dist/src/models/user-system-role.entity.js.map +1 -0
- package/dist/src/models/user-user-group.entity.d.ts +14 -0
- package/dist/src/models/user-user-group.entity.js +73 -0
- package/dist/src/models/user-user-group.entity.js.map +1 -0
- package/dist/src/models/user.entity.d.ts +30 -0
- package/dist/src/models/user.entity.js +131 -0
- package/dist/src/models/user.entity.js.map +1 -0
- package/dist/src/redis-client/__mocks__/jest-initial-setup.d.ts +1 -0
- package/dist/src/redis-client/__mocks__/jest-initial-setup.js +5 -0
- package/dist/src/redis-client/__mocks__/jest-initial-setup.js.map +1 -0
- package/dist/src/redis-client/__mocks__/redis-mock.d.ts +2 -0
- package/dist/src/redis-client/__mocks__/redis-mock.js +23 -0
- package/dist/src/redis-client/__mocks__/redis-mock.js.map +1 -0
- package/dist/src/redis-client/index.d.ts +1 -0
- package/dist/src/redis-client/index.js +18 -0
- package/dist/src/redis-client/index.js.map +1 -0
- package/dist/src/redis-client/redis.service.d.ts +7 -0
- package/dist/src/redis-client/redis.service.js +61 -0
- package/dist/src/redis-client/redis.service.js.map +1 -0
- package/dist/src/session/index.d.ts +2 -0
- package/dist/src/session/index.js +19 -0
- package/dist/src/session/index.js.map +1 -0
- package/dist/src/session/interfaces/index.d.ts +1 -0
- package/dist/src/session/interfaces/index.js +18 -0
- package/dist/src/session/interfaces/index.js.map +1 -0
- package/dist/src/session/interfaces/session-service.interface.d.ts +6 -0
- package/dist/src/session/interfaces/session-service.interface.js +3 -0
- package/dist/src/session/interfaces/session-service.interface.js.map +1 -0
- package/dist/src/session/session.service.d.ts +10 -0
- package/dist/src/session/session.service.js +63 -0
- package/dist/src/session/session.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +2 -2
@@ -0,0 +1,18 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/password-hash/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"password-hash-service.interface.js","sourceRoot":"","sources":["../../../../../src/components/password-hash/interfaces/password-hash-service.interface.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,6 @@
|
|
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
|
+
}
|
@@ -0,0 +1,28 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1,19 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/staff/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,0CAAwB;AACxB,qDAAmC"}
|
@@ -0,0 +1,50 @@
|
|
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
|
+
}
|
@@ -0,0 +1,102 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"staff.js","sourceRoot":"","sources":["../../../../src/components/staff/staff.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,6 @@
|
|
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
|
+
}
|
@@ -0,0 +1,38 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './system.repository';
|
@@ -0,0 +1,18 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/system/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|
@@ -0,0 +1,12 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './system-access.repository';
|
@@ -0,0 +1,18 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/system-access/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C"}
|
@@ -0,0 +1,5 @@
|
|
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
|
+
}
|
@@ -0,0 +1,12 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1,77 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1,6 @@
|
|
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
|
+
}
|
@@ -0,0 +1,35 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './user-group.repository';
|
@@ -0,0 +1,18 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/user-group/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
@@ -0,0 +1,12 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './user-user-group.repository';
|
@@ -0,0 +1,18 @@
|
|
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
|