@tomei/sso 0.15.2 → 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.
Files changed (184) hide show
  1. package/.commitlintrc.json +22 -22
  2. package/.eslintrc +16 -16
  3. package/.eslintrc.js +35 -35
  4. package/.husky/commit-msg +15 -15
  5. package/.husky/pre-commit +7 -7
  6. package/.prettierrc +4 -4
  7. package/Jenkinsfile +57 -57
  8. package/README.md +23 -23
  9. package/__tests__/unit/components/login-user/login-user.spec.ts +742 -742
  10. package/__tests__/unit/components/password-hash/password-hash.service.spec.ts +31 -31
  11. package/__tests__/unit/redis-client/redis.service.spec.ts +23 -23
  12. package/__tests__/unit/session/session.service.spec.ts +47 -47
  13. package/__tests__/unit/system-privilege/system-privilage.spec.ts +91 -91
  14. package/create-sso-user.sql +39 -39
  15. package/dist/__tests__/unit/components/login-user/login-user.spec.d.ts +1 -1
  16. package/dist/__tests__/unit/components/login-user/login-user.spec.js +662 -662
  17. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.d.ts +1 -1
  18. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js +37 -37
  19. package/dist/__tests__/unit/redis-client/redis.service.spec.d.ts +1 -1
  20. package/dist/__tests__/unit/redis-client/redis.service.spec.js +31 -31
  21. package/dist/__tests__/unit/session/session.service.spec.d.ts +1 -1
  22. package/dist/__tests__/unit/session/session.service.spec.js +54 -54
  23. package/dist/__tests__/unit/system-privilege/system-privilage.spec.js +5 -5
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +17 -17
  26. package/dist/src/components/building/building.d.ts +39 -39
  27. package/dist/src/components/building/building.js +128 -128
  28. package/dist/src/components/building/building.repository.d.ts +6 -6
  29. package/dist/src/components/building/building.repository.js +37 -37
  30. package/dist/src/components/building/index.d.ts +2 -2
  31. package/dist/src/components/building/index.js +18 -18
  32. package/dist/src/components/building-type/building-type.repository.d.ts +5 -5
  33. package/dist/src/components/building-type/building-type.repository.js +11 -11
  34. package/dist/src/components/building-type/index.d.ts +1 -1
  35. package/dist/src/components/building-type/index.js +17 -17
  36. package/dist/src/components/index.d.ts +10 -10
  37. package/dist/src/components/index.js +26 -26
  38. package/dist/src/components/login-history/index.d.ts +1 -1
  39. package/dist/src/components/login-history/index.js +17 -17
  40. package/dist/src/components/login-history/login-history.repository.d.ts +5 -5
  41. package/dist/src/components/login-history/login-history.repository.js +11 -11
  42. package/dist/src/components/login-user/index.d.ts +3 -3
  43. package/dist/src/components/login-user/index.js +19 -19
  44. package/dist/src/components/login-user/interfaces/index.d.ts +1 -1
  45. package/dist/src/components/login-user/interfaces/index.js +17 -17
  46. package/dist/src/components/login-user/interfaces/user-info.interface.d.ts +9 -9
  47. package/dist/src/components/login-user/interfaces/user-info.interface.js +2 -2
  48. package/dist/src/components/login-user/login-user.d.ts +47 -46
  49. package/dist/src/components/login-user/login-user.js +431 -430
  50. package/dist/src/components/login-user/login-user.js.map +1 -1
  51. package/dist/src/components/login-user/user.repository.d.ts +5 -5
  52. package/dist/src/components/login-user/user.repository.js +11 -11
  53. package/dist/src/components/password-hash/index.d.ts +2 -2
  54. package/dist/src/components/password-hash/index.js +18 -18
  55. package/dist/src/components/password-hash/interfaces/index.d.ts +1 -1
  56. package/dist/src/components/password-hash/interfaces/index.js +17 -17
  57. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.d.ts +4 -4
  58. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js +2 -2
  59. package/dist/src/components/password-hash/password-hash.service.d.ts +6 -6
  60. package/dist/src/components/password-hash/password-hash.service.js +27 -27
  61. package/dist/src/components/staff/index.d.ts +2 -2
  62. package/dist/src/components/staff/index.js +18 -18
  63. package/dist/src/components/staff/staff.d.ts +50 -49
  64. package/dist/src/components/staff/staff.js +101 -101
  65. package/dist/src/components/staff/staff.js.map +1 -1
  66. package/dist/src/components/staff/staff.repository.d.ts +6 -6
  67. package/dist/src/components/staff/staff.repository.js +37 -37
  68. package/dist/src/components/system/index.d.ts +1 -1
  69. package/dist/src/components/system/index.js +17 -17
  70. package/dist/src/components/system/system.repository.d.ts +5 -5
  71. package/dist/src/components/system/system.repository.js +11 -11
  72. package/dist/src/components/system-access/index.d.ts +1 -1
  73. package/dist/src/components/system-access/index.js +17 -17
  74. package/dist/src/components/system-access/system-access.repository.d.ts +5 -5
  75. package/dist/src/components/system-access/system-access.repository.js +11 -11
  76. package/dist/src/components/system-privilege/privilege.d.ts +6 -6
  77. package/dist/src/components/system-privilege/privilege.js +76 -76
  78. package/dist/src/components/system-privilege/system-privilege.repository.d.ts +6 -6
  79. package/dist/src/components/system-privilege/system-privilege.repository.js +34 -34
  80. package/dist/src/components/user-group/index.d.ts +1 -1
  81. package/dist/src/components/user-group/index.js +17 -17
  82. package/dist/src/components/user-group/user-group.repository.d.ts +5 -5
  83. package/dist/src/components/user-group/user-group.repository.js +11 -11
  84. package/dist/src/components/user-user-group/index.d.ts +1 -1
  85. package/dist/src/components/user-user-group/index.js +17 -17
  86. package/dist/src/components/user-user-group/user-user-group.repository.d.ts +5 -5
  87. package/dist/src/components/user-user-group/user-user-group.repository.js +11 -11
  88. package/dist/src/database.d.ts +4 -4
  89. package/dist/src/database.js +14 -14
  90. package/dist/src/index.d.ts +5 -5
  91. package/dist/src/index.js +23 -23
  92. package/dist/src/interfaces/index.d.ts +2 -2
  93. package/dist/src/interfaces/index.js +18 -18
  94. package/dist/src/interfaces/system-login.interface.d.ts +6 -6
  95. package/dist/src/interfaces/system-login.interface.js +2 -2
  96. package/dist/src/interfaces/user-session.interface.d.ts +4 -4
  97. package/dist/src/interfaces/user-session.interface.js +2 -2
  98. package/dist/src/models/authorization-code.entity.d.ts +14 -14
  99. package/dist/src/models/authorization-code.entity.js +85 -85
  100. package/dist/src/models/bearer-token.entity.d.ts +11 -11
  101. package/dist/src/models/bearer-token.entity.js +71 -71
  102. package/dist/src/models/building-type.entity.d.ts +7 -7
  103. package/dist/src/models/building-type.entity.js +49 -49
  104. package/dist/src/models/building.entity.d.ts +39 -39
  105. package/dist/src/models/building.entity.js +250 -250
  106. package/dist/src/models/city.entity.d.ts +11 -11
  107. package/dist/src/models/city.entity.js +71 -71
  108. package/dist/src/models/company.entity.d.ts +18 -18
  109. package/dist/src/models/company.entity.js +113 -113
  110. package/dist/src/models/country.entity.d.ts +13 -13
  111. package/dist/src/models/country.entity.js +75 -75
  112. package/dist/src/models/department.entity.d.ts +19 -19
  113. package/dist/src/models/department.entity.js +111 -111
  114. package/dist/src/models/group-role-privilege.entity.d.ts +17 -17
  115. package/dist/src/models/group-role-privilege.entity.js +89 -89
  116. package/dist/src/models/group-system-access.entity.d.ts +11 -11
  117. package/dist/src/models/group-system-access.entity.js +61 -61
  118. package/dist/src/models/group-system-privilege.entity.d.ts +11 -11
  119. package/dist/src/models/group-system-privilege.entity.js +61 -61
  120. package/dist/src/models/group-system-role.entity.d.ts +11 -11
  121. package/dist/src/models/group-system-role.entity.js +61 -61
  122. package/dist/src/models/login-history.entity.d.ts +12 -12
  123. package/dist/src/models/login-history.entity.js +69 -69
  124. package/dist/src/models/oauth-token.entity.d.ts +14 -14
  125. package/dist/src/models/oauth-token.entity.js +85 -85
  126. package/dist/src/models/role.entity.d.ts +17 -17
  127. package/dist/src/models/role.entity.js +101 -101
  128. package/dist/src/models/staff-type.entity.d.ts +7 -7
  129. package/dist/src/models/staff-type.entity.js +49 -49
  130. package/dist/src/models/staff.entity.d.ts +39 -39
  131. package/dist/src/models/staff.entity.js +249 -249
  132. package/dist/src/models/state.entity.d.ts +10 -10
  133. package/dist/src/models/state.entity.js +63 -63
  134. package/dist/src/models/system-accesss.entity.d.ts +6 -6
  135. package/dist/src/models/system-accesss.entity.js +50 -50
  136. package/dist/src/models/system-privilege.entity.d.ts +16 -16
  137. package/dist/src/models/system-privilege.entity.js +89 -89
  138. package/dist/src/models/system-role-privilege.entity.d.ts +11 -11
  139. package/dist/src/models/system-role-privilege.entity.js +59 -59
  140. package/dist/src/models/system-role.entity.d.ts +11 -11
  141. package/dist/src/models/system-role.entity.js +82 -82
  142. package/dist/src/models/system.entity.d.ts +19 -19
  143. package/dist/src/models/system.entity.js +145 -145
  144. package/dist/src/models/user-group.entity.d.ts +23 -23
  145. package/dist/src/models/user-group.entity.js +139 -139
  146. package/dist/src/models/user-role.entity.d.ts +12 -12
  147. package/dist/src/models/user-role.entity.js +72 -72
  148. package/dist/src/models/user-system-privileges.entity.d.ts +13 -13
  149. package/dist/src/models/user-system-privileges.entity.js +88 -88
  150. package/dist/src/models/user-system-role.entity.d.ts +11 -11
  151. package/dist/src/models/user-system-role.entity.js +59 -59
  152. package/dist/src/models/user-user-group.entity.d.ts +14 -14
  153. package/dist/src/models/user-user-group.entity.js +72 -72
  154. package/dist/src/models/user.entity.d.ts +30 -30
  155. package/dist/src/models/user.entity.js +130 -130
  156. package/dist/src/redis-client/__mocks__/jest-initial-setup.d.ts +1 -1
  157. package/dist/src/redis-client/__mocks__/jest-initial-setup.js +4 -4
  158. package/dist/src/redis-client/__mocks__/redis-mock.d.ts +2 -2
  159. package/dist/src/redis-client/__mocks__/redis-mock.js +22 -22
  160. package/dist/src/redis-client/index.d.ts +1 -1
  161. package/dist/src/redis-client/index.js +17 -17
  162. package/dist/src/redis-client/redis.service.d.ts +7 -7
  163. package/dist/src/redis-client/redis.service.js +60 -60
  164. package/dist/src/session/index.d.ts +2 -2
  165. package/dist/src/session/index.js +18 -18
  166. package/dist/src/session/interfaces/index.d.ts +1 -1
  167. package/dist/src/session/interfaces/index.js +17 -17
  168. package/dist/src/session/interfaces/session-service.interface.d.ts +6 -6
  169. package/dist/src/session/interfaces/session-service.interface.js +2 -2
  170. package/dist/src/session/session.service.d.ts +10 -10
  171. package/dist/src/session/session.service.js +62 -62
  172. package/dist/tsconfig.tsbuildinfo +1 -1
  173. package/jest.config.js +13 -13
  174. package/migrations/01-alter-system-privilege-table.js +13 -13
  175. package/migrations/02-alter-user-group-table.js +78 -78
  176. package/migrations/03-alter-user-system-privilege-table.js +38 -38
  177. package/migrations/04-create-user-user-group-table.js +55 -55
  178. package/migrations/05-create-login-history-table.js +49 -49
  179. package/package.json +79 -79
  180. package/sampledotenv +7 -7
  181. package/src/components/login-user/login-user.ts +1 -0
  182. package/src/components/staff/staff.ts +1 -0
  183. package/tsconfig.build.json +5 -5
  184. package/tsconfig.json +23 -23
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,38 +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
- const password_hash_service_1 = require("../../../../src/components/password-hash/password-hash.service");
13
- jest.mock('argon2', () => {
14
- return {
15
- hash: jest.fn((passowrd) => {
16
- return `hash${passowrd}`;
17
- }),
18
- verify: jest.fn().mockResolvedValue(true)
19
- };
20
- });
21
- describe('password-hash.service', () => {
22
- const passwordHashService = new password_hash_service_1.PasswordHashService();
23
- afterEach(() => {
24
- jest.clearAllMocks();
25
- });
26
- it('should return hash password', () => __awaiter(void 0, void 0, void 0, function* () {
27
- const password = 'password';
28
- const hash = yield passwordHashService.hashPassword(password);
29
- expect(hash).toEqual('hashpassword');
30
- }));
31
- it('should return true when verify password', () => __awaiter(void 0, void 0, void 0, function* () {
32
- const password = 'password';
33
- const hash = 'hashpassword10';
34
- const result = yield passwordHashService.verify(password, hash);
35
- expect(result).toEqual(true);
36
- }));
37
- });
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
+ const password_hash_service_1 = require("../../../../src/components/password-hash/password-hash.service");
13
+ jest.mock('argon2', () => {
14
+ return {
15
+ hash: jest.fn((passowrd) => {
16
+ return `hash${passowrd}`;
17
+ }),
18
+ verify: jest.fn().mockResolvedValue(true)
19
+ };
20
+ });
21
+ describe('password-hash.service', () => {
22
+ const passwordHashService = new password_hash_service_1.PasswordHashService();
23
+ afterEach(() => {
24
+ jest.clearAllMocks();
25
+ });
26
+ it('should return hash password', () => __awaiter(void 0, void 0, void 0, function* () {
27
+ const password = 'password';
28
+ const hash = yield passwordHashService.hashPassword(password);
29
+ expect(hash).toEqual('hashpassword');
30
+ }));
31
+ it('should return true when verify password', () => __awaiter(void 0, void 0, void 0, function* () {
32
+ const password = 'password';
33
+ const hash = 'hashpassword10';
34
+ const result = yield passwordHashService.verify(password, hash);
35
+ expect(result).toEqual(true);
36
+ }));
37
+ });
38
38
  //# sourceMappingURL=password-hash.service.spec.js.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -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
- const redis_service_1 = require("../../../src/redis-client/redis.service");
13
- require('dotenv').config();
14
- describe('redis.service', () => {
15
- afterEach(() => {
16
- jest.restoreAllMocks();
17
- });
18
- it('should return redis service when instansiated', () => __awaiter(void 0, void 0, void 0, function* () {
19
- const redisService = yield redis_service_1.RedisService.init();
20
- expect(redisService).toBeDefined();
21
- }));
22
- it('should able to write and read redis', () => __awaiter(void 0, void 0, void 0, function* () {
23
- const data = {
24
- test: 'test'
25
- };
26
- const redisService = yield redis_service_1.RedisService.init();
27
- yield redisService.set("test", data, 60 * 60 * 24 * 1);
28
- const result = yield redisService.get("test");
29
- expect(result).toEqual(JSON.stringify(data));
30
- }));
31
- });
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
+ const redis_service_1 = require("../../../src/redis-client/redis.service");
13
+ require('dotenv').config();
14
+ describe('redis.service', () => {
15
+ afterEach(() => {
16
+ jest.restoreAllMocks();
17
+ });
18
+ it('should return redis service when instansiated', () => __awaiter(void 0, void 0, void 0, function* () {
19
+ const redisService = yield redis_service_1.RedisService.init();
20
+ expect(redisService).toBeDefined();
21
+ }));
22
+ it('should able to write and read redis', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const data = {
24
+ test: 'test'
25
+ };
26
+ const redisService = yield redis_service_1.RedisService.init();
27
+ yield redisService.set("test", data, 60 * 60 * 24 * 1);
28
+ const result = yield redisService.get("test");
29
+ expect(result).toEqual(JSON.stringify(data));
30
+ }));
31
+ });
32
32
  //# sourceMappingURL=redis.service.spec.js.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,55 +1,55 @@
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
- const session_service_1 = require("../../../src/session/session.service");
13
- require('dotenv').config();
14
- describe('session.service', () => {
15
- it('should return session service when instansiated', () => __awaiter(void 0, void 0, void 0, function* () {
16
- const sessionService = yield session_service_1.SessionService.init();
17
- expect(sessionService).toBeDefined();
18
- }));
19
- it('should able to write session data', () => __awaiter(void 0, void 0, void 0, function* () {
20
- const data = {
21
- systemLogins: [
22
- {
23
- id: '1',
24
- code: 'EZC',
25
- sessionId: 'test1',
26
- privileges: ['PRIVILEGE1', 'PRIVILEGE2'],
27
- },
28
- ],
29
- };
30
- const sessionService = yield session_service_1.SessionService.init();
31
- yield sessionService.setUserSession("1", data);
32
- const result = yield sessionService.retrieveUserSession("1");
33
- expect(result).toEqual(data);
34
- }));
35
- it('should able to refresh session data', () => __awaiter(void 0, void 0, void 0, function* () {
36
- const setUserSession = jest.spyOn(session_service_1.SessionService.prototype, 'setUserSession');
37
- const retrieveUserSession = jest.spyOn(session_service_1.SessionService.prototype, 'retrieveUserSession');
38
- const data = {
39
- systemLogins: [
40
- {
41
- id: '1',
42
- code: 'EZC',
43
- sessionId: 'test1',
44
- privileges: ['PRIVILEGE1', 'PRIVILEGE2'],
45
- },
46
- ],
47
- };
48
- const sessionService = yield session_service_1.SessionService.init();
49
- yield sessionService.setUserSession("1", data);
50
- yield sessionService.refreshDuration("1");
51
- expect(setUserSession).toBeCalledTimes(2);
52
- expect(retrieveUserSession).toBeCalledTimes(1);
53
- }));
54
- });
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
+ const session_service_1 = require("../../../src/session/session.service");
13
+ require('dotenv').config();
14
+ describe('session.service', () => {
15
+ it('should return session service when instansiated', () => __awaiter(void 0, void 0, void 0, function* () {
16
+ const sessionService = yield session_service_1.SessionService.init();
17
+ expect(sessionService).toBeDefined();
18
+ }));
19
+ it('should able to write session data', () => __awaiter(void 0, void 0, void 0, function* () {
20
+ const data = {
21
+ systemLogins: [
22
+ {
23
+ id: '1',
24
+ code: 'EZC',
25
+ sessionId: 'test1',
26
+ privileges: ['PRIVILEGE1', 'PRIVILEGE2'],
27
+ },
28
+ ],
29
+ };
30
+ const sessionService = yield session_service_1.SessionService.init();
31
+ yield sessionService.setUserSession("1", data);
32
+ const result = yield sessionService.retrieveUserSession("1");
33
+ expect(result).toEqual(data);
34
+ }));
35
+ it('should able to refresh session data', () => __awaiter(void 0, void 0, void 0, function* () {
36
+ const setUserSession = jest.spyOn(session_service_1.SessionService.prototype, 'setUserSession');
37
+ const retrieveUserSession = jest.spyOn(session_service_1.SessionService.prototype, 'retrieveUserSession');
38
+ const data = {
39
+ systemLogins: [
40
+ {
41
+ id: '1',
42
+ code: 'EZC',
43
+ sessionId: 'test1',
44
+ privileges: ['PRIVILEGE1', 'PRIVILEGE2'],
45
+ },
46
+ ],
47
+ };
48
+ const sessionService = yield session_service_1.SessionService.init();
49
+ yield sessionService.setUserSession("1", data);
50
+ yield sessionService.refreshDuration("1");
51
+ expect(setUserSession).toBeCalledTimes(2);
52
+ expect(retrieveUserSession).toBeCalledTimes(1);
53
+ }));
54
+ });
55
55
  //# sourceMappingURL=session.service.spec.js.map
@@ -1,6 +1,6 @@
1
- describe('SystemPrivilege', () => {
2
- it('should be true', () => {
3
- expect(true).toBe(true);
4
- });
5
- });
1
+ describe('SystemPrivilege', () => {
2
+ it('should be true', () => {
3
+ expect(true).toBe(true);
4
+ });
5
+ });
6
6
  //# sourceMappingURL=system-privilage.spec.js.map
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './src';
1
+ export * from './src';
package/dist/index.js CHANGED
@@ -1,18 +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("./src"), exports);
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("./src"), exports);
18
18
  //# sourceMappingURL=index.js.map
@@ -1,39 +1,39 @@
1
- import { LoginUser } from '../../..';
2
- export declare class Building {
3
- id: number;
4
- name: string;
5
- code: string;
6
- building_type_id: number;
7
- status: string;
8
- email: string;
9
- mobile: string;
10
- phone: string;
11
- address: string;
12
- postcode: string;
13
- longitude: number;
14
- latitude: number;
15
- country_id: number;
16
- state: string;
17
- city: string;
18
- brand: string;
19
- area_staff_id: string;
20
- opening_date: any;
21
- ceased_date: any;
22
- opening_hours: any;
23
- image: string;
24
- private _created_by_id;
25
- private _updated_by_id;
26
- private _created_at;
27
- private _updated_at;
28
- private _BuildingTypeId;
29
- private _BuildingType;
30
- private static _Repo;
31
- private _RepoBuildingType;
32
- private constructor();
33
- static init(dbTransaction: any, code?: string): Promise<Building | undefined>;
34
- getBuildingType(loginUser: LoginUser, dbTransaction?: any): Promise<{
35
- BuildingTypeId: number;
36
- BuildingType: string;
37
- }>;
38
- static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, rows?: number, search?: {}): Promise<any>;
39
- }
1
+ import { LoginUser } from '../../..';
2
+ export declare class Building {
3
+ id: number;
4
+ name: string;
5
+ code: string;
6
+ building_type_id: number;
7
+ status: string;
8
+ email: string;
9
+ mobile: string;
10
+ phone: string;
11
+ address: string;
12
+ postcode: string;
13
+ longitude: number;
14
+ latitude: number;
15
+ country_id: number;
16
+ state: string;
17
+ city: string;
18
+ brand: string;
19
+ area_staff_id: string;
20
+ opening_date: any;
21
+ ceased_date: any;
22
+ opening_hours: any;
23
+ image: string;
24
+ private _created_by_id;
25
+ private _updated_by_id;
26
+ private _created_at;
27
+ private _updated_at;
28
+ private _BuildingTypeId;
29
+ private _BuildingType;
30
+ private static _Repo;
31
+ private _RepoBuildingType;
32
+ private constructor();
33
+ static init(dbTransaction: any, code?: string): Promise<Building | undefined>;
34
+ getBuildingType(loginUser: LoginUser, dbTransaction?: any): Promise<{
35
+ BuildingTypeId: number;
36
+ BuildingType: string;
37
+ }>;
38
+ static findAll(loginUser: LoginUser, dbTransaction: any, page?: number, rows?: number, search?: {}): Promise<any>;
39
+ }