@tomei/sso 0.15.2 → 0.15.3

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 (261) 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/jest.config.js +13 -13
  16. package/migrations/01-alter-system-privilege-table.js +13 -13
  17. package/migrations/02-alter-user-group-table.js +78 -78
  18. package/migrations/03-alter-user-system-privilege-table.js +38 -38
  19. package/migrations/04-create-user-user-group-table.js +55 -55
  20. package/migrations/05-create-login-history-table.js +49 -49
  21. package/package.json +79 -79
  22. package/sampledotenv +7 -7
  23. package/src/components/login-user/login-user.ts +1 -0
  24. package/src/components/staff/staff.ts +1 -0
  25. package/tsconfig.build.json +5 -5
  26. package/tsconfig.json +23 -23
  27. package/dist/__tests__/unit/components/login-user/login-user.spec.d.ts +0 -1
  28. package/dist/__tests__/unit/components/login-user/login-user.spec.js +0 -663
  29. package/dist/__tests__/unit/components/login-user/login-user.spec.js.map +0 -1
  30. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.d.ts +0 -1
  31. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js +0 -38
  32. package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js.map +0 -1
  33. package/dist/__tests__/unit/redis-client/redis.service.spec.d.ts +0 -1
  34. package/dist/__tests__/unit/redis-client/redis.service.spec.js +0 -32
  35. package/dist/__tests__/unit/redis-client/redis.service.spec.js.map +0 -1
  36. package/dist/__tests__/unit/session/session.service.spec.d.ts +0 -1
  37. package/dist/__tests__/unit/session/session.service.spec.js +0 -55
  38. package/dist/__tests__/unit/session/session.service.spec.js.map +0 -1
  39. package/dist/__tests__/unit/system-privilege/system-privilage.spec.d.ts +0 -0
  40. package/dist/__tests__/unit/system-privilege/system-privilage.spec.js +0 -6
  41. package/dist/__tests__/unit/system-privilege/system-privilage.spec.js.map +0 -1
  42. package/dist/index.d.ts +0 -1
  43. package/dist/index.js +0 -18
  44. package/dist/index.js.map +0 -1
  45. package/dist/src/components/building/building.d.ts +0 -39
  46. package/dist/src/components/building/building.js +0 -129
  47. package/dist/src/components/building/building.js.map +0 -1
  48. package/dist/src/components/building/building.repository.d.ts +0 -6
  49. package/dist/src/components/building/building.repository.js +0 -38
  50. package/dist/src/components/building/building.repository.js.map +0 -1
  51. package/dist/src/components/building/index.d.ts +0 -2
  52. package/dist/src/components/building/index.js +0 -19
  53. package/dist/src/components/building/index.js.map +0 -1
  54. package/dist/src/components/building-type/building-type.repository.d.ts +0 -5
  55. package/dist/src/components/building-type/building-type.repository.js +0 -12
  56. package/dist/src/components/building-type/building-type.repository.js.map +0 -1
  57. package/dist/src/components/building-type/index.d.ts +0 -1
  58. package/dist/src/components/building-type/index.js +0 -18
  59. package/dist/src/components/building-type/index.js.map +0 -1
  60. package/dist/src/components/index.d.ts +0 -10
  61. package/dist/src/components/index.js +0 -27
  62. package/dist/src/components/index.js.map +0 -1
  63. package/dist/src/components/login-history/index.d.ts +0 -1
  64. package/dist/src/components/login-history/index.js +0 -18
  65. package/dist/src/components/login-history/index.js.map +0 -1
  66. package/dist/src/components/login-history/login-history.repository.d.ts +0 -5
  67. package/dist/src/components/login-history/login-history.repository.js +0 -12
  68. package/dist/src/components/login-history/login-history.repository.js.map +0 -1
  69. package/dist/src/components/login-user/index.d.ts +0 -3
  70. package/dist/src/components/login-user/index.js +0 -20
  71. package/dist/src/components/login-user/index.js.map +0 -1
  72. package/dist/src/components/login-user/interfaces/index.d.ts +0 -1
  73. package/dist/src/components/login-user/interfaces/index.js +0 -18
  74. package/dist/src/components/login-user/interfaces/index.js.map +0 -1
  75. package/dist/src/components/login-user/interfaces/user-info.interface.d.ts +0 -9
  76. package/dist/src/components/login-user/interfaces/user-info.interface.js +0 -3
  77. package/dist/src/components/login-user/interfaces/user-info.interface.js.map +0 -1
  78. package/dist/src/components/login-user/login-user.d.ts +0 -46
  79. package/dist/src/components/login-user/login-user.js +0 -439
  80. package/dist/src/components/login-user/login-user.js.map +0 -1
  81. package/dist/src/components/login-user/user.repository.d.ts +0 -5
  82. package/dist/src/components/login-user/user.repository.js +0 -12
  83. package/dist/src/components/login-user/user.repository.js.map +0 -1
  84. package/dist/src/components/password-hash/index.d.ts +0 -2
  85. package/dist/src/components/password-hash/index.js +0 -19
  86. package/dist/src/components/password-hash/index.js.map +0 -1
  87. package/dist/src/components/password-hash/interfaces/index.d.ts +0 -1
  88. package/dist/src/components/password-hash/interfaces/index.js +0 -18
  89. package/dist/src/components/password-hash/interfaces/index.js.map +0 -1
  90. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.d.ts +0 -4
  91. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js +0 -3
  92. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js.map +0 -1
  93. package/dist/src/components/password-hash/password-hash.service.d.ts +0 -6
  94. package/dist/src/components/password-hash/password-hash.service.js +0 -28
  95. package/dist/src/components/password-hash/password-hash.service.js.map +0 -1
  96. package/dist/src/components/staff/index.d.ts +0 -2
  97. package/dist/src/components/staff/index.js +0 -19
  98. package/dist/src/components/staff/index.js.map +0 -1
  99. package/dist/src/components/staff/staff.d.ts +0 -49
  100. package/dist/src/components/staff/staff.js +0 -102
  101. package/dist/src/components/staff/staff.js.map +0 -1
  102. package/dist/src/components/staff/staff.repository.d.ts +0 -6
  103. package/dist/src/components/staff/staff.repository.js +0 -38
  104. package/dist/src/components/staff/staff.repository.js.map +0 -1
  105. package/dist/src/components/system/index.d.ts +0 -1
  106. package/dist/src/components/system/index.js +0 -18
  107. package/dist/src/components/system/index.js.map +0 -1
  108. package/dist/src/components/system/system.repository.d.ts +0 -5
  109. package/dist/src/components/system/system.repository.js +0 -12
  110. package/dist/src/components/system/system.repository.js.map +0 -1
  111. package/dist/src/components/system-access/index.d.ts +0 -1
  112. package/dist/src/components/system-access/index.js +0 -18
  113. package/dist/src/components/system-access/index.js.map +0 -1
  114. package/dist/src/components/system-access/system-access.repository.d.ts +0 -5
  115. package/dist/src/components/system-access/system-access.repository.js +0 -12
  116. package/dist/src/components/system-access/system-access.repository.js.map +0 -1
  117. package/dist/src/components/system-privilege/privilege.d.ts +0 -6
  118. package/dist/src/components/system-privilege/privilege.js +0 -77
  119. package/dist/src/components/system-privilege/privilege.js.map +0 -1
  120. package/dist/src/components/system-privilege/system-privilege.repository.d.ts +0 -6
  121. package/dist/src/components/system-privilege/system-privilege.repository.js +0 -35
  122. package/dist/src/components/system-privilege/system-privilege.repository.js.map +0 -1
  123. package/dist/src/components/user-group/index.d.ts +0 -1
  124. package/dist/src/components/user-group/index.js +0 -18
  125. package/dist/src/components/user-group/index.js.map +0 -1
  126. package/dist/src/components/user-group/user-group.repository.d.ts +0 -5
  127. package/dist/src/components/user-group/user-group.repository.js +0 -12
  128. package/dist/src/components/user-group/user-group.repository.js.map +0 -1
  129. package/dist/src/components/user-user-group/index.d.ts +0 -1
  130. package/dist/src/components/user-user-group/index.js +0 -18
  131. package/dist/src/components/user-user-group/index.js.map +0 -1
  132. package/dist/src/components/user-user-group/user-user-group.repository.d.ts +0 -5
  133. package/dist/src/components/user-user-group/user-user-group.repository.js +0 -12
  134. package/dist/src/components/user-user-group/user-user-group.repository.js.map +0 -1
  135. package/dist/src/database.d.ts +0 -4
  136. package/dist/src/database.js +0 -15
  137. package/dist/src/database.js.map +0 -1
  138. package/dist/src/index.d.ts +0 -5
  139. package/dist/src/index.js +0 -24
  140. package/dist/src/index.js.map +0 -1
  141. package/dist/src/interfaces/index.d.ts +0 -2
  142. package/dist/src/interfaces/index.js +0 -19
  143. package/dist/src/interfaces/index.js.map +0 -1
  144. package/dist/src/interfaces/system-login.interface.d.ts +0 -6
  145. package/dist/src/interfaces/system-login.interface.js +0 -3
  146. package/dist/src/interfaces/system-login.interface.js.map +0 -1
  147. package/dist/src/interfaces/user-session.interface.d.ts +0 -4
  148. package/dist/src/interfaces/user-session.interface.js +0 -3
  149. package/dist/src/interfaces/user-session.interface.js.map +0 -1
  150. package/dist/src/models/authorization-code.entity.d.ts +0 -14
  151. package/dist/src/models/authorization-code.entity.js +0 -86
  152. package/dist/src/models/authorization-code.entity.js.map +0 -1
  153. package/dist/src/models/bearer-token.entity.d.ts +0 -11
  154. package/dist/src/models/bearer-token.entity.js +0 -72
  155. package/dist/src/models/bearer-token.entity.js.map +0 -1
  156. package/dist/src/models/building-type.entity.d.ts +0 -7
  157. package/dist/src/models/building-type.entity.js +0 -50
  158. package/dist/src/models/building-type.entity.js.map +0 -1
  159. package/dist/src/models/building.entity.d.ts +0 -39
  160. package/dist/src/models/building.entity.js +0 -251
  161. package/dist/src/models/building.entity.js.map +0 -1
  162. package/dist/src/models/city.entity.d.ts +0 -11
  163. package/dist/src/models/city.entity.js +0 -72
  164. package/dist/src/models/city.entity.js.map +0 -1
  165. package/dist/src/models/company.entity.d.ts +0 -18
  166. package/dist/src/models/company.entity.js +0 -114
  167. package/dist/src/models/company.entity.js.map +0 -1
  168. package/dist/src/models/country.entity.d.ts +0 -13
  169. package/dist/src/models/country.entity.js +0 -76
  170. package/dist/src/models/country.entity.js.map +0 -1
  171. package/dist/src/models/department.entity.d.ts +0 -19
  172. package/dist/src/models/department.entity.js +0 -112
  173. package/dist/src/models/department.entity.js.map +0 -1
  174. package/dist/src/models/group-role-privilege.entity.d.ts +0 -17
  175. package/dist/src/models/group-role-privilege.entity.js +0 -90
  176. package/dist/src/models/group-role-privilege.entity.js.map +0 -1
  177. package/dist/src/models/group-system-access.entity.d.ts +0 -11
  178. package/dist/src/models/group-system-access.entity.js +0 -62
  179. package/dist/src/models/group-system-access.entity.js.map +0 -1
  180. package/dist/src/models/group-system-privilege.entity.d.ts +0 -11
  181. package/dist/src/models/group-system-privilege.entity.js +0 -62
  182. package/dist/src/models/group-system-privilege.entity.js.map +0 -1
  183. package/dist/src/models/group-system-role.entity.d.ts +0 -11
  184. package/dist/src/models/group-system-role.entity.js +0 -62
  185. package/dist/src/models/group-system-role.entity.js.map +0 -1
  186. package/dist/src/models/login-history.entity.d.ts +0 -12
  187. package/dist/src/models/login-history.entity.js +0 -70
  188. package/dist/src/models/login-history.entity.js.map +0 -1
  189. package/dist/src/models/oauth-token.entity.d.ts +0 -14
  190. package/dist/src/models/oauth-token.entity.js +0 -86
  191. package/dist/src/models/oauth-token.entity.js.map +0 -1
  192. package/dist/src/models/role.entity.d.ts +0 -17
  193. package/dist/src/models/role.entity.js +0 -102
  194. package/dist/src/models/role.entity.js.map +0 -1
  195. package/dist/src/models/staff-type.entity.d.ts +0 -7
  196. package/dist/src/models/staff-type.entity.js +0 -50
  197. package/dist/src/models/staff-type.entity.js.map +0 -1
  198. package/dist/src/models/staff.entity.d.ts +0 -39
  199. package/dist/src/models/staff.entity.js +0 -250
  200. package/dist/src/models/staff.entity.js.map +0 -1
  201. package/dist/src/models/state.entity.d.ts +0 -10
  202. package/dist/src/models/state.entity.js +0 -64
  203. package/dist/src/models/state.entity.js.map +0 -1
  204. package/dist/src/models/system-accesss.entity.d.ts +0 -6
  205. package/dist/src/models/system-accesss.entity.js +0 -51
  206. package/dist/src/models/system-accesss.entity.js.map +0 -1
  207. package/dist/src/models/system-privilege.entity.d.ts +0 -16
  208. package/dist/src/models/system-privilege.entity.js +0 -90
  209. package/dist/src/models/system-privilege.entity.js.map +0 -1
  210. package/dist/src/models/system-role-privilege.entity.d.ts +0 -11
  211. package/dist/src/models/system-role-privilege.entity.js +0 -60
  212. package/dist/src/models/system-role-privilege.entity.js.map +0 -1
  213. package/dist/src/models/system-role.entity.d.ts +0 -11
  214. package/dist/src/models/system-role.entity.js +0 -83
  215. package/dist/src/models/system-role.entity.js.map +0 -1
  216. package/dist/src/models/system.entity.d.ts +0 -19
  217. package/dist/src/models/system.entity.js +0 -146
  218. package/dist/src/models/system.entity.js.map +0 -1
  219. package/dist/src/models/user-group.entity.d.ts +0 -23
  220. package/dist/src/models/user-group.entity.js +0 -140
  221. package/dist/src/models/user-group.entity.js.map +0 -1
  222. package/dist/src/models/user-role.entity.d.ts +0 -12
  223. package/dist/src/models/user-role.entity.js +0 -73
  224. package/dist/src/models/user-role.entity.js.map +0 -1
  225. package/dist/src/models/user-system-privileges.entity.d.ts +0 -13
  226. package/dist/src/models/user-system-privileges.entity.js +0 -89
  227. package/dist/src/models/user-system-privileges.entity.js.map +0 -1
  228. package/dist/src/models/user-system-role.entity.d.ts +0 -11
  229. package/dist/src/models/user-system-role.entity.js +0 -60
  230. package/dist/src/models/user-system-role.entity.js.map +0 -1
  231. package/dist/src/models/user-user-group.entity.d.ts +0 -14
  232. package/dist/src/models/user-user-group.entity.js +0 -73
  233. package/dist/src/models/user-user-group.entity.js.map +0 -1
  234. package/dist/src/models/user.entity.d.ts +0 -30
  235. package/dist/src/models/user.entity.js +0 -131
  236. package/dist/src/models/user.entity.js.map +0 -1
  237. package/dist/src/redis-client/__mocks__/jest-initial-setup.d.ts +0 -1
  238. package/dist/src/redis-client/__mocks__/jest-initial-setup.js +0 -5
  239. package/dist/src/redis-client/__mocks__/jest-initial-setup.js.map +0 -1
  240. package/dist/src/redis-client/__mocks__/redis-mock.d.ts +0 -2
  241. package/dist/src/redis-client/__mocks__/redis-mock.js +0 -23
  242. package/dist/src/redis-client/__mocks__/redis-mock.js.map +0 -1
  243. package/dist/src/redis-client/index.d.ts +0 -1
  244. package/dist/src/redis-client/index.js +0 -18
  245. package/dist/src/redis-client/index.js.map +0 -1
  246. package/dist/src/redis-client/redis.service.d.ts +0 -7
  247. package/dist/src/redis-client/redis.service.js +0 -61
  248. package/dist/src/redis-client/redis.service.js.map +0 -1
  249. package/dist/src/session/index.d.ts +0 -2
  250. package/dist/src/session/index.js +0 -19
  251. package/dist/src/session/index.js.map +0 -1
  252. package/dist/src/session/interfaces/index.d.ts +0 -1
  253. package/dist/src/session/interfaces/index.js +0 -18
  254. package/dist/src/session/interfaces/index.js.map +0 -1
  255. package/dist/src/session/interfaces/session-service.interface.d.ts +0 -6
  256. package/dist/src/session/interfaces/session-service.interface.js +0 -3
  257. package/dist/src/session/interfaces/session-service.interface.js.map +0 -1
  258. package/dist/src/session/session.service.d.ts +0 -10
  259. package/dist/src/session/session.service.js +0 -63
  260. package/dist/src/session/session.service.js.map +0 -1
  261. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,78 +1,78 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- return queryInterface.sequelize.transaction(async (t) => {
6
- return await Promise.all([
7
- queryInterface.addColumn(
8
- 'sso_usergroup',
9
- 'AllowInheritFromParentYN',
10
- {
11
- type: Sequelize.ENUM(['Y', 'N']),
12
- defaultValue: 'N',
13
- },
14
- { transaction: t },
15
- ),
16
- queryInterface.addColumn(
17
- 'sso_usergroup',
18
- 'FullPath',
19
- {
20
- type: Sequelize.STRING(1000),
21
- allowNull: true,
22
- },
23
- { transaction: t },
24
- ),
25
- queryInterface.addColumn(
26
- 'sso_usergroup',
27
- 'GroupLevel',
28
- {
29
- type: Sequelize.INTEGER,
30
- allowNull: false,
31
- defaultValue: 0,
32
- },
33
- { transaction: t },
34
- ),
35
- queryInterface.addColumn(
36
- 'sso_usergroup',
37
- 'GroupType',
38
- {
39
- type: Sequelize.STRING(10),
40
- allowNull: true,
41
- },
42
- { transaction: t },
43
- ),
44
- queryInterface.addColumn(
45
- 'sso_usergroup',
46
- 'ParentGroupCode',
47
- {
48
- type: Sequelize.STRING(10),
49
- allowNull: true,
50
- },
51
- { transaction: t },
52
- ),
53
- queryInterface.addColumn(
54
- 'sso_usergroup',
55
- 'PersonInCharge',
56
- {
57
- type: Sequelize.STRING(100),
58
- allowNull: true,
59
- },
60
- { transaction: t },
61
- ),
62
- ]);
63
- });
64
- },
65
-
66
- down: async (queryInterface) => {
67
- return queryInterface.sequelize.transaction(async (t) => {
68
- return await Promise.all([
69
- queryInterface.removeColumn('sso_usergroup', 'AllowInheritFromParentYN', { transaction: t }),
70
- queryInterface.removeColumn('sso_usergroup', 'FullPath', { transaction: t }),
71
- queryInterface.removeColumn('sso_usergroup', 'GroupLevel', { transaction: t }),
72
- queryInterface.removeColumn('sso_usergroup', 'GroupType', { transaction: t }),
73
- queryInterface.removeColumn('sso_usergroup', 'ParentGroupCode', { transaction: t }),
74
- queryInterface.removeColumn('sso_usergroup', 'PersonInCharge', { transaction: t }),
75
- ]);
76
- });
77
- },
78
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ return queryInterface.sequelize.transaction(async (t) => {
6
+ return await Promise.all([
7
+ queryInterface.addColumn(
8
+ 'sso_usergroup',
9
+ 'AllowInheritFromParentYN',
10
+ {
11
+ type: Sequelize.ENUM(['Y', 'N']),
12
+ defaultValue: 'N',
13
+ },
14
+ { transaction: t },
15
+ ),
16
+ queryInterface.addColumn(
17
+ 'sso_usergroup',
18
+ 'FullPath',
19
+ {
20
+ type: Sequelize.STRING(1000),
21
+ allowNull: true,
22
+ },
23
+ { transaction: t },
24
+ ),
25
+ queryInterface.addColumn(
26
+ 'sso_usergroup',
27
+ 'GroupLevel',
28
+ {
29
+ type: Sequelize.INTEGER,
30
+ allowNull: false,
31
+ defaultValue: 0,
32
+ },
33
+ { transaction: t },
34
+ ),
35
+ queryInterface.addColumn(
36
+ 'sso_usergroup',
37
+ 'GroupType',
38
+ {
39
+ type: Sequelize.STRING(10),
40
+ allowNull: true,
41
+ },
42
+ { transaction: t },
43
+ ),
44
+ queryInterface.addColumn(
45
+ 'sso_usergroup',
46
+ 'ParentGroupCode',
47
+ {
48
+ type: Sequelize.STRING(10),
49
+ allowNull: true,
50
+ },
51
+ { transaction: t },
52
+ ),
53
+ queryInterface.addColumn(
54
+ 'sso_usergroup',
55
+ 'PersonInCharge',
56
+ {
57
+ type: Sequelize.STRING(100),
58
+ allowNull: true,
59
+ },
60
+ { transaction: t },
61
+ ),
62
+ ]);
63
+ });
64
+ },
65
+
66
+ down: async (queryInterface) => {
67
+ return queryInterface.sequelize.transaction(async (t) => {
68
+ return await Promise.all([
69
+ queryInterface.removeColumn('sso_usergroup', 'AllowInheritFromParentYN', { transaction: t }),
70
+ queryInterface.removeColumn('sso_usergroup', 'FullPath', { transaction: t }),
71
+ queryInterface.removeColumn('sso_usergroup', 'GroupLevel', { transaction: t }),
72
+ queryInterface.removeColumn('sso_usergroup', 'GroupType', { transaction: t }),
73
+ queryInterface.removeColumn('sso_usergroup', 'ParentGroupCode', { transaction: t }),
74
+ queryInterface.removeColumn('sso_usergroup', 'PersonInCharge', { transaction: t }),
75
+ ]);
76
+ });
77
+ },
78
+ };
@@ -1,38 +1,38 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- return queryInterface.sequelize.transaction(async (t) => {
6
- return await Promise.all([
7
- queryInterface.addColumn(
8
- 'sso_usersystemprivilege',
9
- 'IsInheritedYN',
10
- {
11
- type: Sequelize.ENUM(['Y', 'N']),
12
- defaultValue: 'N',
13
- },
14
- { transaction: t },
15
- ),
16
- queryInterface.addColumn(
17
- 'sso_usersystemprivilege',
18
- 'IsRevokedYN',
19
- {
20
- type: Sequelize.ENUM(['Y', 'N']),
21
- defaultValue: 'N',
22
- },
23
- { transaction: t },
24
- ),
25
- ]);
26
- });
27
- },
28
-
29
- down: async (queryInterface) => {
30
- return queryInterface.sequelize.transaction(async (t) => {
31
- return await Promise.all([
32
- queryInterface.removeColumn('sso_usersystemprivilege', 'IsInheritedYN', { transaction: t }),
33
- queryInterface.removeColumn('sso_usersystemprivilege', 'IsRevokedYN', { transaction: t }),
34
- ]);
35
- });
36
- },
37
- };
38
- 'use strict';
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ return queryInterface.sequelize.transaction(async (t) => {
6
+ return await Promise.all([
7
+ queryInterface.addColumn(
8
+ 'sso_usersystemprivilege',
9
+ 'IsInheritedYN',
10
+ {
11
+ type: Sequelize.ENUM(['Y', 'N']),
12
+ defaultValue: 'N',
13
+ },
14
+ { transaction: t },
15
+ ),
16
+ queryInterface.addColumn(
17
+ 'sso_usersystemprivilege',
18
+ 'IsRevokedYN',
19
+ {
20
+ type: Sequelize.ENUM(['Y', 'N']),
21
+ defaultValue: 'N',
22
+ },
23
+ { transaction: t },
24
+ ),
25
+ ]);
26
+ });
27
+ },
28
+
29
+ down: async (queryInterface) => {
30
+ return queryInterface.sequelize.transaction(async (t) => {
31
+ return await Promise.all([
32
+ queryInterface.removeColumn('sso_usersystemprivilege', 'IsInheritedYN', { transaction: t }),
33
+ queryInterface.removeColumn('sso_usersystemprivilege', 'IsRevokedYN', { transaction: t }),
34
+ ]);
35
+ });
36
+ },
37
+ };
38
+ 'use strict';
@@ -1,55 +1,55 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- queryInterface.createTable('sso_UserUserGroup', {
6
- UserId: {
7
- primaryKey: true,
8
- type: Sequelize.INTEGER,
9
- allowNull: false,
10
- references: {
11
- model: 'sso_users',
12
- key: 'id',
13
- },
14
- onDelete: 'CASCADE',
15
- onUpdate: 'CASCADE',
16
- },
17
- GroupCode: {
18
- primaryKey: true,
19
- type: Sequelize.STRING(191),
20
- allowNull: false,
21
- references: {
22
- model: 'sso_usergroup',
23
- key: 'GroupCode',
24
- },
25
- onDelete: 'CASCADE',
26
- onUpdate: 'CASCADE',
27
- },
28
- SystemId: {
29
- type: Sequelize.INTEGER,
30
- allowNull: true,
31
- references: {
32
- model: 'sso_systems',
33
- key: 'id',
34
- },
35
- onDelete: 'CASCADE',
36
- onUpdate: 'CASCADE',
37
- },
38
- CreatedAt: {
39
- allowNull: false,
40
- defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
41
- type: Sequelize.DATE,
42
- },
43
- UpdatedAt: {
44
- allowNull: false,
45
- defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
46
- type: Sequelize.DATE,
47
- },
48
- });
49
-
50
- },
51
-
52
- down: async (queryInterface) => {
53
- await queryInterface.dropTable('sso_UserUserGroup');
54
- },
55
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ queryInterface.createTable('sso_UserUserGroup', {
6
+ UserId: {
7
+ primaryKey: true,
8
+ type: Sequelize.INTEGER,
9
+ allowNull: false,
10
+ references: {
11
+ model: 'sso_users',
12
+ key: 'id',
13
+ },
14
+ onDelete: 'CASCADE',
15
+ onUpdate: 'CASCADE',
16
+ },
17
+ GroupCode: {
18
+ primaryKey: true,
19
+ type: Sequelize.STRING(191),
20
+ allowNull: false,
21
+ references: {
22
+ model: 'sso_usergroup',
23
+ key: 'GroupCode',
24
+ },
25
+ onDelete: 'CASCADE',
26
+ onUpdate: 'CASCADE',
27
+ },
28
+ SystemId: {
29
+ type: Sequelize.INTEGER,
30
+ allowNull: true,
31
+ references: {
32
+ model: 'sso_systems',
33
+ key: 'id',
34
+ },
35
+ onDelete: 'CASCADE',
36
+ onUpdate: 'CASCADE',
37
+ },
38
+ CreatedAt: {
39
+ allowNull: false,
40
+ defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
41
+ type: Sequelize.DATE,
42
+ },
43
+ UpdatedAt: {
44
+ allowNull: false,
45
+ defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
46
+ type: Sequelize.DATE,
47
+ },
48
+ });
49
+
50
+ },
51
+
52
+ down: async (queryInterface) => {
53
+ await queryInterface.dropTable('sso_UserUserGroup');
54
+ },
55
+ };
@@ -1,49 +1,49 @@
1
- 'use strict';
2
-
3
-
4
- module.exports = {
5
- up: async (queryInterface, Sequelize) => {
6
- queryInterface.createTable('sso_LoginHistories', {
7
- Id: {
8
- primaryKey: true,
9
- autoIncrement: true,
10
- type: Sequelize.INTEGER,
11
- allowNull: false,
12
- },
13
- UserId: {
14
- type: Sequelize.INTEGER,
15
- allowNull: false,
16
- references: {
17
- model: 'sso_users',
18
- key: 'id',
19
- },
20
- onDelete: 'CASCADE',
21
- onUpdate: 'CASCADE',
22
- },
23
- SystemId: {
24
- type: Sequelize.INTEGER,
25
- allowNull: false,
26
- references: {
27
- model: 'sso_systems',
28
- key: 'id',
29
- },
30
- onDelete: 'CASCADE',
31
- onUpdate: 'CASCADE',
32
- },
33
- OriginIP: {
34
- type: Sequelize.STRING(191),
35
- allowNull: false,
36
- },
37
- CreatedAt: {
38
- type: Sequelize.DATE(3),
39
- allowNull: false,
40
- defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
41
- },
42
- });
43
-
44
- },
45
-
46
- down: async (queryInterface) => {
47
- await queryInterface.dropTable('sso_LoginHistories');
48
- },
49
- };
1
+ 'use strict';
2
+
3
+
4
+ module.exports = {
5
+ up: async (queryInterface, Sequelize) => {
6
+ queryInterface.createTable('sso_LoginHistories', {
7
+ Id: {
8
+ primaryKey: true,
9
+ autoIncrement: true,
10
+ type: Sequelize.INTEGER,
11
+ allowNull: false,
12
+ },
13
+ UserId: {
14
+ type: Sequelize.INTEGER,
15
+ allowNull: false,
16
+ references: {
17
+ model: 'sso_users',
18
+ key: 'id',
19
+ },
20
+ onDelete: 'CASCADE',
21
+ onUpdate: 'CASCADE',
22
+ },
23
+ SystemId: {
24
+ type: Sequelize.INTEGER,
25
+ allowNull: false,
26
+ references: {
27
+ model: 'sso_systems',
28
+ key: 'id',
29
+ },
30
+ onDelete: 'CASCADE',
31
+ onUpdate: 'CASCADE',
32
+ },
33
+ OriginIP: {
34
+ type: Sequelize.STRING(191),
35
+ allowNull: false,
36
+ },
37
+ CreatedAt: {
38
+ type: Sequelize.DATE(3),
39
+ allowNull: false,
40
+ defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
41
+ },
42
+ });
43
+
44
+ },
45
+
46
+ down: async (queryInterface) => {
47
+ await queryInterface.dropTable('sso_LoginHistories');
48
+ },
49
+ };
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "name": "@tomei/sso",
3
- "version": "0.15.2",
4
- "description": "Tomei SSO Package",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "start:dev": "tsc -w",
8
- "build": "tsc",
9
- "prepare": "husky install",
10
- "format": "prettier --write \"src/**/*.ts\"",
11
- "lint": "npx eslint . --fix",
12
- "test": "jest --forceExit --detectOpenHandles"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "git+ssh://git@gitlab.com/tomei-package/sso.git"
17
- },
18
- "keywords": [
19
- "tomei",
20
- "sso"
21
- ],
22
- "author": "Tomei",
23
- "license": "ISC",
24
- "bugs": {
25
- "url": "https://gitlab.com/tomei-package/sso/issues"
26
- },
27
- "homepage": "https://gitlab.com/tomei-package/sso#readme",
28
- "devDependencies": {
29
- "@commitlint/cli": "^17.6.3",
30
- "@commitlint/config-conventional": "^17.6.3",
31
- "@tsconfig/node18": "^2.0.1",
32
- "@types/bcrypt": "^5.0.0",
33
- "@types/jest": "^29.5.2",
34
- "@types/node": "^18.17.5",
35
- "@types/redis": "^4.0.11",
36
- "@types/validator": "^13.11.1",
37
- "@typescript-eslint/eslint-plugin": "^5.33.0",
38
- "dotenv": "^16.1.4",
39
- "eslint": "^8.40.0",
40
- "eslint-config-prettier": "^8.5.0",
41
- "eslint-plugin-prettier": "^4.2.1",
42
- "husky": "^8.0.3",
43
- "jest": "^29.5.0",
44
- "jest-mock-extended": "^3.0.4",
45
- "lint-staged": "^13.2.2",
46
- "prettier": "^2.7.1",
47
- "prisma": "^4.14.0",
48
- "redis-mock": "^0.56.3",
49
- "ts-jest": "^29.1.0",
50
- "ts-node": "^10.9.1",
51
- "tsc-watch": "^5.0.3",
52
- "tsconfig-paths": "^4.0.0",
53
- "tslint": "^6.1.3",
54
- "typescript": "^4.7.4"
55
- },
56
- "publishConfig": {
57
- "access": "public"
58
- },
59
- "peerDependencies": {
60
- "@tomei/config": "^0.3.5",
61
- "@tomei/general": "^0.5.1",
62
- "@tomei/mailer": "^0.5.6",
63
- "@types/jest": "^29.5.2",
64
- "argon2": "^0.30.3",
65
- "cls-hooked": "^4.2.2",
66
- "cuid": "^3.0.0",
67
- "nodemailer": "^6.9.3",
68
- "redis": "^4.6.7",
69
- "reflect-metadata": "^0.1.13",
70
- "sequelize": "^6.32.1",
71
- "sequelize-typescript": "^2.1.5"
72
- },
73
- "lint-staged": {
74
- "*/**/*.{js,ts,tsx}": [
75
- "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
76
- "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
77
- ]
78
- }
79
- }
1
+ {
2
+ "name": "@tomei/sso",
3
+ "version": "0.15.3",
4
+ "description": "Tomei SSO Package",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "start:dev": "tsc -w",
8
+ "build": "tsc",
9
+ "prepare": "husky install",
10
+ "format": "prettier --write \"src/**/*.ts\"",
11
+ "lint": "npx eslint . --fix",
12
+ "test": "jest --forceExit --detectOpenHandles"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+ssh://git@gitlab.com/tomei-package/sso.git"
17
+ },
18
+ "keywords": [
19
+ "tomei",
20
+ "sso"
21
+ ],
22
+ "author": "Tomei",
23
+ "license": "ISC",
24
+ "bugs": {
25
+ "url": "https://gitlab.com/tomei-package/sso/issues"
26
+ },
27
+ "homepage": "https://gitlab.com/tomei-package/sso#readme",
28
+ "devDependencies": {
29
+ "@commitlint/cli": "^17.6.3",
30
+ "@commitlint/config-conventional": "^17.6.3",
31
+ "@tsconfig/node18": "^2.0.1",
32
+ "@types/bcrypt": "^5.0.0",
33
+ "@types/jest": "^29.5.2",
34
+ "@types/node": "^18.17.5",
35
+ "@types/redis": "^4.0.11",
36
+ "@types/validator": "^13.11.1",
37
+ "@typescript-eslint/eslint-plugin": "^5.33.0",
38
+ "dotenv": "^16.1.4",
39
+ "eslint": "^8.40.0",
40
+ "eslint-config-prettier": "^8.5.0",
41
+ "eslint-plugin-prettier": "^4.2.1",
42
+ "husky": "^8.0.3",
43
+ "jest": "^29.5.0",
44
+ "jest-mock-extended": "^3.0.4",
45
+ "lint-staged": "^13.2.2",
46
+ "prettier": "^2.7.1",
47
+ "prisma": "^4.14.0",
48
+ "redis-mock": "^0.56.3",
49
+ "ts-jest": "^29.1.0",
50
+ "ts-node": "^10.9.1",
51
+ "tsc-watch": "^5.0.3",
52
+ "tsconfig-paths": "^4.0.0",
53
+ "tslint": "^6.1.3",
54
+ "typescript": "^4.7.4"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "peerDependencies": {
60
+ "@tomei/config": "^0.3.8",
61
+ "@tomei/general": "^0.7.1",
62
+ "@tomei/mailer": "^0.5.9",
63
+ "@types/jest": "^29.5.2",
64
+ "argon2": "^0.30.3",
65
+ "cls-hooked": "^4.2.2",
66
+ "cuid": "^3.0.0",
67
+ "nodemailer": "^6.9.3",
68
+ "redis": "^4.6.7",
69
+ "reflect-metadata": "^0.1.13",
70
+ "sequelize": "^6.32.1",
71
+ "sequelize-typescript": "^2.1.5"
72
+ },
73
+ "lint-staged": {
74
+ "*/**/*.{js,ts,tsx}": [
75
+ "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
76
+ "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
77
+ ]
78
+ }
79
+ }
package/sampledotenv CHANGED
@@ -1,8 +1,8 @@
1
- DATABASE_URL=
2
- SHADOW_DATABASE_URL=
3
- REDIS_URL=
4
- REDIS_PASSWORD=
5
- SMTP_HOST=
6
- SMTP_PORT=
7
- EMAIL_SENDER=
1
+ DATABASE_URL=
2
+ SHADOW_DATABASE_URL=
3
+ REDIS_URL=
4
+ REDIS_PASSWORD=
5
+ SMTP_HOST=
6
+ SMTP_PORT=
7
+ EMAIL_SENDER=
8
8
  EMAIL_PASSWORD=
@@ -28,6 +28,7 @@ export class LoginUser extends LoginUserBase {
28
28
  ObjectId: string;
29
29
  ObjectName = 'User';
30
30
  TableName = 'sso_users';
31
+ ObjectType = 'User';
31
32
  staffs: any;
32
33
 
33
34
  private _OriginIP: string;
@@ -12,6 +12,7 @@ export class Staff extends ObjectBase implements IPerson {
12
12
  ObjectId: string;
13
13
  ObjectName: string;
14
14
  TableName: 'sso_Staff';
15
+ ObjectType: 'Staff';
15
16
 
16
17
  FullName: string;
17
18
  IDNo: string;
@@ -1,6 +1,6 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": ["**/*.ts"],
4
- "exclude": ["node_modules", "__test__", "dist", "**/*spec.ts"]
5
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["**/*.ts"],
4
+ "exclude": ["node_modules", "__test__", "dist", "dist/**/*", "**/*spec.ts"]
5
+ }
6
6