@tomei/sso 0.8.9 → 0.8.11

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 (176) 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 -5
  7. package/Jenkinsfile +57 -57
  8. package/README.md +23 -23
  9. package/__tests__/unit/components/login-history/login-history.repository.spec.ts +95 -95
  10. package/__tests__/unit/components/login-user/login-user.spec.ts +731 -731
  11. package/__tests__/unit/components/login-user/user.repository.spec.ts +81 -81
  12. package/__tests__/unit/components/password-hash/password-hash.service.spec.ts +31 -31
  13. package/__tests__/unit/components/system/system.repository.spec.ts +88 -88
  14. package/__tests__/unit/components/system-access/system-access.repository.spec.ts +78 -78
  15. package/__tests__/unit/redis-client/redis.service.spec.ts +23 -23
  16. package/__tests__/unit/session/session.service.spec.ts +47 -47
  17. package/create-sso-user.sql +39 -39
  18. package/dist/__tests__/unit/redis-client/redis.service.spec.d.ts +1 -1
  19. package/dist/__tests__/unit/redis-client/redis.service.spec.js +31 -31
  20. package/dist/__tests__/unit/session/session.service.spec.d.ts +1 -1
  21. package/dist/__tests__/unit/session/session.service.spec.js +54 -54
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +17 -17
  24. package/dist/src/components/index.d.ts +7 -7
  25. package/dist/src/components/index.js +23 -23
  26. package/dist/src/components/login-history/index.d.ts +1 -1
  27. package/dist/src/components/login-history/index.js +17 -17
  28. package/dist/src/components/login-history/login-history.repository.d.ts +5 -5
  29. package/dist/src/components/login-history/login-history.repository.js +11 -11
  30. package/dist/src/components/login-user/index.d.ts +3 -3
  31. package/dist/src/components/login-user/index.js +19 -19
  32. package/dist/src/components/login-user/interfaces/index.d.ts +1 -1
  33. package/dist/src/components/login-user/interfaces/index.js +17 -17
  34. package/dist/src/components/login-user/interfaces/user-info.interface.d.ts +9 -9
  35. package/dist/src/components/login-user/interfaces/user-info.interface.js +2 -2
  36. package/dist/src/components/login-user/login-user.d.ts +44 -44
  37. package/dist/src/components/login-user/login-user.js +416 -414
  38. package/dist/src/components/login-user/login-user.js.map +1 -1
  39. package/dist/src/components/login-user/user.repository.d.ts +5 -5
  40. package/dist/src/components/login-user/user.repository.js +11 -11
  41. package/dist/src/components/password-hash/index.d.ts +2 -2
  42. package/dist/src/components/password-hash/index.js +18 -18
  43. package/dist/src/components/password-hash/interfaces/index.d.ts +1 -1
  44. package/dist/src/components/password-hash/interfaces/index.js +17 -17
  45. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.d.ts +4 -4
  46. package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js +2 -2
  47. package/dist/src/components/password-hash/password-hash.service.d.ts +6 -6
  48. package/dist/src/components/password-hash/password-hash.service.js +27 -27
  49. package/dist/src/components/system/index.d.ts +1 -1
  50. package/dist/src/components/system/index.js +17 -17
  51. package/dist/src/components/system/system.repository.d.ts +5 -5
  52. package/dist/src/components/system/system.repository.js +11 -11
  53. package/dist/src/components/system-access/index.d.ts +1 -1
  54. package/dist/src/components/system-access/index.js +17 -17
  55. package/dist/src/components/system-access/system-access.repository.d.ts +5 -5
  56. package/dist/src/components/system-access/system-access.repository.js +11 -11
  57. package/dist/src/components/user-group/index.d.ts +1 -1
  58. package/dist/src/components/user-group/index.js +17 -17
  59. package/dist/src/components/user-group/user-group.repository.d.ts +5 -5
  60. package/dist/src/components/user-group/user-group.repository.js +11 -11
  61. package/dist/src/components/user-user-group/index.d.ts +1 -1
  62. package/dist/src/components/user-user-group/index.js +17 -17
  63. package/dist/src/components/user-user-group/user-user-group.repository.d.ts +5 -5
  64. package/dist/src/components/user-user-group/user-user-group.repository.js +11 -11
  65. package/dist/src/database.d.ts +4 -4
  66. package/dist/src/database.js +14 -14
  67. package/dist/src/index.d.ts +5 -5
  68. package/dist/src/index.js +23 -22
  69. package/dist/src/index.js.map +1 -1
  70. package/dist/src/interfaces/index.d.ts +2 -2
  71. package/dist/src/interfaces/index.js +18 -18
  72. package/dist/src/interfaces/system-login.interface.d.ts +6 -6
  73. package/dist/src/interfaces/system-login.interface.js +2 -2
  74. package/dist/src/interfaces/user-session.interface.d.ts +4 -4
  75. package/dist/src/interfaces/user-session.interface.js +2 -2
  76. package/dist/src/models/authorization-code.entity.d.ts +14 -14
  77. package/dist/src/models/authorization-code.entity.js +85 -85
  78. package/dist/src/models/bearer-token.entity.d.ts +11 -11
  79. package/dist/src/models/bearer-token.entity.js +71 -71
  80. package/dist/src/models/building-type.entity.d.ts +7 -7
  81. package/dist/src/models/building-type.entity.js +49 -49
  82. package/dist/src/models/building.entity.d.ts +39 -39
  83. package/dist/src/models/building.entity.js +250 -250
  84. package/dist/src/models/city.entity.d.ts +11 -11
  85. package/dist/src/models/city.entity.js +71 -71
  86. package/dist/src/models/company.entity.d.ts +18 -18
  87. package/dist/src/models/company.entity.js +113 -113
  88. package/dist/src/models/country.entity.d.ts +15 -15
  89. package/dist/src/models/country.entity.js +91 -91
  90. package/dist/src/models/department.entity.d.ts +19 -19
  91. package/dist/src/models/department.entity.js +111 -111
  92. package/dist/src/models/group-role-privilege.entity.d.ts +17 -17
  93. package/dist/src/models/group-role-privilege.entity.js +89 -89
  94. package/dist/src/models/group-system-access.entity.d.ts +11 -11
  95. package/dist/src/models/group-system-access.entity.js +61 -61
  96. package/dist/src/models/group-system-privilege.entity.d.ts +11 -11
  97. package/dist/src/models/group-system-privilege.entity.js +61 -61
  98. package/dist/src/models/group-system-role.entity.d.ts +11 -11
  99. package/dist/src/models/group-system-role.entity.js +61 -61
  100. package/dist/src/models/login-history.entity.d.ts +12 -12
  101. package/dist/src/models/login-history.entity.js +69 -69
  102. package/dist/src/models/oauth-token.entity.d.ts +14 -14
  103. package/dist/src/models/oauth-token.entity.js +85 -85
  104. package/dist/src/models/role.entity.d.ts +17 -17
  105. package/dist/src/models/role.entity.js +101 -101
  106. package/dist/src/models/staff-type.entity.d.ts +7 -7
  107. package/dist/src/models/staff-type.entity.js +49 -49
  108. package/dist/src/models/staff.entity.d.ts +39 -39
  109. package/dist/src/models/staff.entity.js +249 -249
  110. package/dist/src/models/state.entity.d.ts +10 -10
  111. package/dist/src/models/state.entity.js +63 -63
  112. package/dist/src/models/system-accesss.entity.d.ts +6 -6
  113. package/dist/src/models/system-accesss.entity.js +50 -50
  114. package/dist/src/models/system-privilege.entity.d.ts +16 -16
  115. package/dist/src/models/system-privilege.entity.js +89 -89
  116. package/dist/src/models/system-role-privilege.entity.d.ts +11 -11
  117. package/dist/src/models/system-role-privilege.entity.js +59 -59
  118. package/dist/src/models/system-role.entity.d.ts +11 -11
  119. package/dist/src/models/system-role.entity.js +82 -82
  120. package/dist/src/models/system.entity.d.ts +19 -19
  121. package/dist/src/models/system.entity.js +145 -145
  122. package/dist/src/models/user-group.entity.d.ts +23 -23
  123. package/dist/src/models/user-group.entity.js +139 -139
  124. package/dist/src/models/user-role.entity.d.ts +12 -12
  125. package/dist/src/models/user-role.entity.js +72 -72
  126. package/dist/src/models/user-system-privileges.entity.d.ts +13 -13
  127. package/dist/src/models/user-system-privileges.entity.js +88 -88
  128. package/dist/src/models/user-system-role.entity.d.ts +11 -11
  129. package/dist/src/models/user-system-role.entity.js +59 -59
  130. package/dist/src/models/user-user-group.entity.d.ts +14 -14
  131. package/dist/src/models/user-user-group.entity.js +72 -72
  132. package/dist/src/models/user.entity.d.ts +30 -30
  133. package/dist/src/models/user.entity.js +130 -130
  134. package/dist/src/prisma-client/__mocks__/prisma.d.ts +3 -3
  135. package/dist/src/prisma-client/__mocks__/prisma.js +13 -13
  136. package/dist/src/prisma-client/client.d.ts +3 -3
  137. package/dist/src/prisma-client/client.js +5 -5
  138. package/dist/src/prisma-client/index.d.ts +1 -1
  139. package/dist/src/prisma-client/index.js +17 -17
  140. package/dist/src/redis-client/__mocks__/jest-initial-setup.d.ts +1 -1
  141. package/dist/src/redis-client/__mocks__/jest-initial-setup.js +4 -4
  142. package/dist/src/redis-client/__mocks__/redis-mock.d.ts +2 -2
  143. package/dist/src/redis-client/__mocks__/redis-mock.js +22 -22
  144. package/dist/src/redis-client/index.d.ts +1 -1
  145. package/dist/src/redis-client/index.js +17 -17
  146. package/dist/src/redis-client/redis.service.d.ts +7 -7
  147. package/dist/src/redis-client/redis.service.js +55 -55
  148. package/dist/src/session/index.d.ts +2 -2
  149. package/dist/src/session/index.js +18 -18
  150. package/dist/src/session/interfaces/index.d.ts +1 -1
  151. package/dist/src/session/interfaces/index.js +17 -17
  152. package/dist/src/session/interfaces/session-service.interface.d.ts +6 -6
  153. package/dist/src/session/interfaces/session-service.interface.js +2 -2
  154. package/dist/src/session/session.service.d.ts +10 -10
  155. package/dist/src/session/session.service.js +63 -63
  156. package/dist/tsconfig.tsbuildinfo +1 -1
  157. package/jest.config.js +14 -14
  158. package/migrations/01-alter-system-privilege-table.js +13 -13
  159. package/migrations/02-alter-user-group-table.js +78 -78
  160. package/migrations/03-alter-user-system-privilege-table.js +38 -38
  161. package/migrations/04-create-user-user-group-table.js +55 -55
  162. package/migrations/05-create-login-history-table.js +49 -49
  163. package/package.json +77 -81
  164. package/sampledotenv +7 -7
  165. package/src/components/login-user/login-user.ts +4 -6
  166. package/src/index.ts +1 -1
  167. package/tsconfig.build.json +5 -5
  168. package/tsconfig.json +23 -23
  169. package/prisma/migrations/0_init/migration.sql +0 -512
  170. package/prisma/migrations/20230528161352_create_user_user_group_and_add_new_column/migration.sql +0 -35
  171. package/prisma/migrations/20230606091407_create_login_histories_table/migration.sql +0 -17
  172. package/prisma/migrations/migration_lock.toml +0 -3
  173. package/prisma/schema.prisma +0 -519
  174. package/src/prisma-client/__mocks__/prisma.ts +0 -15
  175. package/src/prisma-client/client.ts +0 -3
  176. package/src/prisma-client/index.ts +0 -1
package/jest.config.js CHANGED
@@ -1,15 +1,15 @@
1
- /** @type {import('ts-jest').JestConfigWithTsJest} */
2
- module.exports = {
3
- clearMocks: true,
4
- preset: 'ts-jest',
5
- testTimeout: 20000,
6
- coverageDirectory: "coverage",
7
- testEnvironment: 'node',
8
- "modulePathIgnorePatterns": [
9
- "<rootDir>/dist"
10
- ],
11
- setupFilesAfterEnv: [
12
- '<rootDir>/src/prisma-client/__mocks__/prisma.ts',
13
- '<rootDir>/src/redis-client/__mocks__/jest-initial-setup.ts',
14
- ]
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
+ module.exports = {
3
+ clearMocks: true,
4
+ preset: 'ts-jest',
5
+ testTimeout: 20000,
6
+ coverageDirectory: "coverage",
7
+ testEnvironment: 'node',
8
+ "modulePathIgnorePatterns": [
9
+ "<rootDir>/dist"
10
+ ],
11
+ setupFilesAfterEnv: [
12
+ '<rootDir>/src/prisma-client/__mocks__/prisma.ts',
13
+ '<rootDir>/src/redis-client/__mocks__/jest-initial-setup.ts',
14
+ ]
15
15
  };
@@ -1,13 +1,13 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- async up(queryInterface, Sequelize) {
5
- await queryInterface.addColumn('sso_systemPrivilege','Module', {
6
- type: Sequelize.STRING(200),
7
- })
8
- },
9
-
10
- async down(queryInterface) {
11
- queryInterface.removeColumn('sso_systemPrivilege','Module')
12
- },
13
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ await queryInterface.addColumn('sso_systemPrivilege','Module', {
6
+ type: Sequelize.STRING(200),
7
+ })
8
+ },
9
+
10
+ async down(queryInterface) {
11
+ queryInterface.removeColumn('sso_systemPrivilege','Module')
12
+ },
13
+ };
@@ -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,81 +1,77 @@
1
- {
2
- "name": "@tomei/sso",
3
- "version": "0.8.9",
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
- "@prisma/client": "^4.14.1",
61
- "@tomei/general": "^0.4.0",
62
- "@types/jest": "^29.5.2",
63
- "argon2": "^0.30.3",
64
- "cls-hooked": "^4.2.2",
65
- "nodemailer": "^6.9.3",
66
- "prismock": "^1.14.0",
67
- "redis": "^4.6.7"
68
- },
69
- "lint-staged": {
70
- "*/**/*.{js,ts,tsx}": [
71
- "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
72
- "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
73
- ]
74
- },
75
- "dependencies": {
76
- "@tomei/mailer": "^0.5.2",
77
- "reflect-metadata": "^0.1.13",
78
- "sequelize": "^6.32.1",
79
- "sequelize-typescript": "^2.1.5"
80
- }
81
- }
1
+ {
2
+ "name": "@tomei/sso",
3
+ "version": "0.8.11",
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/general": "^0.4.3",
61
+ "@tomei/mailer": "^0.5.2",
62
+ "@types/jest": "^29.5.2",
63
+ "argon2": "^0.30.3",
64
+ "cls-hooked": "^4.2.2",
65
+ "nodemailer": "^6.9.3",
66
+ "redis": "^4.6.7",
67
+ "reflect-metadata": "^0.1.13",
68
+ "sequelize": "^6.32.1",
69
+ "sequelize-typescript": "^2.1.5"
70
+ },
71
+ "lint-staged": {
72
+ "*/**/*.{js,ts,tsx}": [
73
+ "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
74
+ "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
75
+ ]
76
+ }
77
+ }