@tomei/sso 0.37.4 → 0.38.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/__tests__/unit/components/group-object-privilege/group-object-privilege.spec.ts +4 -4
  2. package/__tests__/unit/components/group-privilege/group-privilege.spec.ts +3 -3
  3. package/__tests__/unit/components/user-object-privilege/user-object-privilege.spec.ts +3 -3
  4. package/__tests__/unit/components/user-privilege/user-privilege.spec.ts +3 -3
  5. package/dist/__tests__/unit/components/group-object-privilege/group-object-privilege.spec.js +4 -4
  6. package/dist/__tests__/unit/components/group-object-privilege/group-object-privilege.spec.js.map +1 -1
  7. package/dist/__tests__/unit/components/group-privilege/group-privilege.spec.js +3 -3
  8. package/dist/__tests__/unit/components/group-privilege/group-privilege.spec.js.map +1 -1
  9. package/dist/__tests__/unit/components/user-object-privilege/user-object-privilege.spec.js +3 -3
  10. package/dist/__tests__/unit/components/user-object-privilege/user-object-privilege.spec.js.map +1 -1
  11. package/dist/__tests__/unit/components/user-privilege/user-privilege.spec.js +3 -3
  12. package/dist/__tests__/unit/components/user-privilege/user-privilege.spec.js.map +1 -1
  13. package/dist/src/components/group/group.d.ts +24 -12
  14. package/dist/src/components/group/group.js +194 -42
  15. package/dist/src/components/group/group.js.map +1 -1
  16. package/dist/src/components/group-object-privilege/group-object-privilege.d.ts +1 -1
  17. package/dist/src/components/group-object-privilege/group-object-privilege.js +7 -7
  18. package/dist/src/components/group-object-privilege/group-object-privilege.js.map +1 -1
  19. package/dist/src/components/group-privilege/group-privilege.d.ts +1 -1
  20. package/dist/src/components/group-privilege/group-privilege.js +2 -2
  21. package/dist/src/components/group-privilege/group-privilege.js.map +1 -1
  22. package/dist/src/components/group-privilege/group-privilege.repository.d.ts +1 -1
  23. package/dist/src/components/group-privilege/group-privilege.repository.js +11 -3
  24. package/dist/src/components/group-privilege/group-privilege.repository.js.map +1 -1
  25. package/dist/src/components/login-user/login-user.js.map +1 -1
  26. package/dist/src/components/login-user/user.js +2 -2
  27. package/dist/src/components/login-user/user.js.map +1 -1
  28. package/dist/src/components/system/system.js +1 -1
  29. package/dist/src/components/system/system.js.map +1 -1
  30. package/dist/src/components/system-privilege/system-privilege.d.ts +4 -3
  31. package/dist/src/components/system-privilege/system-privilege.js +18 -11
  32. package/dist/src/components/system-privilege/system-privilege.js.map +1 -1
  33. package/dist/src/components/user-group/user-group.js +1 -1
  34. package/dist/src/components/user-group/user-group.js.map +1 -1
  35. package/dist/src/components/user-object-privilege/user-object-privilege.d.ts +1 -1
  36. package/dist/src/components/user-object-privilege/user-object-privilege.js +1 -1
  37. package/dist/src/components/user-object-privilege/user-object-privilege.js.map +1 -1
  38. package/dist/src/components/user-privilege/user-privilege.d.ts +1 -1
  39. package/dist/src/components/user-privilege/user-privilege.js +1 -1
  40. package/dist/src/components/user-privilege/user-privilege.js.map +1 -1
  41. package/dist/src/interfaces/group-object-privilege.interface.d.ts +1 -1
  42. package/dist/src/interfaces/group-privilege.interface.d.ts +1 -1
  43. package/dist/src/interfaces/group.interface.d.ts +1 -0
  44. package/dist/src/interfaces/system-privilege.interface.d.ts +1 -0
  45. package/dist/src/interfaces/user-object-privilege.interface.d.ts +1 -1
  46. package/dist/src/interfaces/user-privilege.interface.d.ts +1 -1
  47. package/dist/src/models/group-object-privilege.entity.d.ts +1 -1
  48. package/dist/src/models/group-object-privilege.entity.js +1 -1
  49. package/dist/src/models/group-object-privilege.entity.js.map +1 -1
  50. package/dist/src/models/group-privilege.entity.d.ts +1 -1
  51. package/dist/src/models/group-privilege.entity.js +1 -1
  52. package/dist/src/models/group-privilege.entity.js.map +1 -1
  53. package/dist/src/models/group.entity.d.ts +1 -0
  54. package/dist/src/models/group.entity.js +7 -0
  55. package/dist/src/models/group.entity.js.map +1 -1
  56. package/dist/src/models/system-privilege.entity.d.ts +1 -0
  57. package/dist/src/models/system-privilege.entity.js +8 -0
  58. package/dist/src/models/system-privilege.entity.js.map +1 -1
  59. package/dist/src/models/user-object-privilege.entity.d.ts +1 -1
  60. package/dist/src/models/user-object-privilege.entity.js +1 -1
  61. package/dist/src/models/user-object-privilege.entity.js.map +1 -1
  62. package/dist/src/models/user-privilege.entity.d.ts +1 -1
  63. package/dist/src/models/user-privilege.entity.js +1 -1
  64. package/dist/src/models/user-privilege.entity.js.map +1 -1
  65. package/dist/tsconfig.tsbuildinfo +1 -1
  66. package/migrations/20240527064926-create-system-privilege-table.js +66 -62
  67. package/migrations/20240527065342-create-group-table.js +4 -0
  68. package/migrations/20240528032229-user-privilege-table.js +2 -2
  69. package/migrations/20240528063003-create-group-privilege-table.js +12 -2
  70. package/migrations/20240528063051-create-group-object-privilege-table.js +2 -2
  71. package/migrations/20240528063107-create-user-object-privilege-table.js +2 -2
  72. package/package.json +8 -8
  73. package/src/components/group/group.ts +231 -60
  74. package/src/components/group-object-privilege/group-object-privilege.ts +9 -9
  75. package/src/components/group-privilege/group-privilege.repository.ts +16 -3
  76. package/src/components/group-privilege/group-privilege.ts +3 -3
  77. package/src/components/login-user/login-user.ts +0 -58
  78. package/src/components/login-user/user.ts +2 -4
  79. package/src/components/system/system.ts +1 -1
  80. package/src/components/system-privilege/system-privilege.ts +20 -12
  81. package/src/components/user-group/user-group.ts +1 -1
  82. package/src/components/user-object-privilege/user-object-privilege.ts +2 -2
  83. package/src/components/user-privilege/user-privilege.ts +2 -2
  84. package/src/interfaces/group-object-privilege.interface.ts +1 -1
  85. package/src/interfaces/group-privilege.interface.ts +1 -1
  86. package/src/interfaces/group.interface.ts +1 -0
  87. package/src/interfaces/system-privilege.interface.ts +1 -0
  88. package/src/interfaces/user-object-privilege.interface.ts +1 -1
  89. package/src/interfaces/user-privilege.interface.ts +1 -1
  90. package/src/models/group-object-privilege.entity.ts +1 -1
  91. package/src/models/group-privilege.entity.ts +1 -1
  92. package/src/models/group.entity.ts +6 -0
  93. package/src/models/system-privilege.entity.ts +7 -0
  94. package/src/models/user-object-privilege.entity.ts +1 -1
  95. package/src/models/user-privilege.entity.ts +1 -1
@@ -1,67 +1,71 @@
1
1
  'use strict';
2
2
 
3
-
4
3
  module.exports = {
5
- up: async (queryInterface, Sequelize) => {
6
- queryInterface.createTable('sso_SystemPrivilege', {
7
- PrivilegeCode: {
8
- primaryKey: true,
9
- type: Sequelize.STRING(50),
10
- allowNull: false,
11
- },
12
- SystemCode: {
13
- type: Sequelize.STRING(10),
14
- allowNull: false,
15
- references: {
16
- model: 'sso_System',
17
- key: 'SystemCode',
18
- },
19
- onDelete: 'CASCADE',
20
- onUpdate: 'CASCADE',
21
- },
22
- Description: {
23
- type: Sequelize.STRING(3000),
24
- },
25
- Status: {
26
- type: Sequelize.STRING(10),
27
- allowNull: false,
28
- defaultValue: 'Active',
29
- },
30
- CreatedAt: {
31
- allowNull: false,
32
- defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
33
- type: Sequelize.DATE,
34
- },
35
- CreatedById: {
36
- type: Sequelize.INTEGER,
37
- allowNull: true,
38
- references: {
39
- model: 'sso_User',
40
- key: 'UserId',
41
- },
42
- onDelete: 'CASCADE',
43
- onUpdate: 'CASCADE',
44
- },
45
- UpdatedAt: {
46
- allowNull: false,
47
- defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)'),
48
- type: Sequelize.DATE,
49
- },
50
- UpdatedById: {
51
- type: Sequelize.INTEGER,
52
- allowNull: true,
53
- references: {
54
- model: 'sso_User',
55
- key: 'UserId',
56
- },
57
- onDelete: 'CASCADE',
58
- onUpdate: 'CASCADE',
59
- },
60
- });
61
-
62
- },
4
+ up: async (queryInterface, Sequelize) => {
5
+ queryInterface.createTable('sso_SystemPrivilege', {
6
+ SystemPrivilegeId: {
7
+ primaryKey: true,
8
+ type: Sequelize.STRING(30),
9
+ allowNull: false,
10
+ },
11
+ PrivilegeCode: {
12
+ type: Sequelize.STRING(50),
13
+ allowNull: false,
14
+ },
15
+ SystemCode: {
16
+ type: Sequelize.STRING(10),
17
+ allowNull: false,
18
+ references: {
19
+ model: 'sso_System',
20
+ key: 'SystemCode',
21
+ },
22
+ onDelete: 'CASCADE',
23
+ onUpdate: 'CASCADE',
24
+ },
25
+ Description: {
26
+ type: Sequelize.STRING(3000),
27
+ },
28
+ Status: {
29
+ type: Sequelize.STRING(10),
30
+ allowNull: false,
31
+ defaultValue: 'Active',
32
+ },
33
+ CreatedAt: {
34
+ allowNull: false,
35
+ defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
36
+ type: Sequelize.DATE,
37
+ },
38
+ CreatedById: {
39
+ type: Sequelize.INTEGER,
40
+ allowNull: true,
41
+ references: {
42
+ model: 'sso_User',
43
+ key: 'UserId',
44
+ },
45
+ onDelete: 'CASCADE',
46
+ onUpdate: 'CASCADE',
47
+ },
48
+ UpdatedAt: {
49
+ allowNull: false,
50
+ defaultValue: Sequelize.literal(
51
+ 'CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)',
52
+ ),
53
+ type: Sequelize.DATE,
54
+ },
55
+ UpdatedById: {
56
+ type: Sequelize.INTEGER,
57
+ allowNull: true,
58
+ references: {
59
+ model: 'sso_User',
60
+ key: 'UserId',
61
+ },
62
+ onDelete: 'CASCADE',
63
+ onUpdate: 'CASCADE',
64
+ },
65
+ });
66
+ },
63
67
 
64
- down: async (queryInterface) => {
65
- await queryInterface.dropTable('sso_SystemPrivilege');
66
- },
68
+ down: async (queryInterface) => {
69
+ await queryInterface.dropTable('sso_SystemPrivilege');
70
+ },
67
71
  };
@@ -39,6 +39,10 @@ module.exports = {
39
39
  onUpdate: 'CASCADE',
40
40
  onDelete: 'CASCADE',
41
41
  },
42
+ Path: {
43
+ type: Sequelize.STRING(100),
44
+ allowNull: false,
45
+ },
42
46
  InheritParentPrivilegeYN: {
43
47
  type: Sequelize.CHAR(1),
44
48
  defaultValue: 'N',
@@ -20,12 +20,12 @@ module.exports = {
20
20
  onDelete: 'CASCADE',
21
21
  onUpdate: 'CASCADE',
22
22
  },
23
- PrivilegeCode: {
23
+ SystemPrivilegeId: {
24
24
  type: Sequelize.STRING(10),
25
25
  allowNull: false,
26
26
  references: {
27
27
  model: 'sso_SystemPrivilege',
28
- key: 'PrivilegeCode',
28
+ key: 'SystemPrivilegeId',
29
29
  },
30
30
  onDelete: 'CASCADE',
31
31
  onUpdate: 'CASCADE',
@@ -20,12 +20,22 @@ module.exports = {
20
20
  onDelete: 'CASCADE',
21
21
  onUpdate: 'CASCADE',
22
22
  },
23
- PrivilegeCode: {
23
+ SystemPrivilegeId: {
24
24
  type: Sequelize.STRING(10),
25
25
  allowNull: false,
26
26
  references: {
27
27
  model: 'sso_SystemPrivilege',
28
- key: 'PrivilegeCode',
28
+ key: 'SystemPrivilegeId',
29
+ },
30
+ onDelete: 'CASCADE',
31
+ onUpdate: 'CASCADE',
32
+ },
33
+ SystemCode: {
34
+ type: Sequelize.STRING(10),
35
+ allowNull: false,
36
+ references: {
37
+ model: 'sso_System',
38
+ key: 'SystemCode',
29
39
  },
30
40
  onDelete: 'CASCADE',
31
41
  onUpdate: 'CASCADE',
@@ -20,12 +20,12 @@ module.exports = {
20
20
  onDelete: 'CASCADE',
21
21
  onUpdate: 'CASCADE',
22
22
  },
23
- PrivilegeCode: {
23
+ SystemPrivilegeId: {
24
24
  type: Sequelize.STRING(10),
25
25
  allowNull: false,
26
26
  references: {
27
27
  model: 'sso_SystemPrivilege',
28
- key: 'PrivilegeCode',
28
+ key: 'SystemPrivilegeId',
29
29
  },
30
30
  onDelete: 'CASCADE',
31
31
  onUpdate: 'CASCADE',
@@ -20,12 +20,12 @@ module.exports = {
20
20
  onDelete: 'CASCADE',
21
21
  onUpdate: 'CASCADE',
22
22
  },
23
- PrivilegeCode: {
23
+ SystemPrivilegeId: {
24
24
  type: Sequelize.STRING(10),
25
25
  allowNull: false,
26
26
  references: {
27
27
  model: 'sso_SystemPrivilege',
28
- key: 'PrivilegeCode',
28
+ key: 'SystemPrivilegeId',
29
29
  },
30
30
  onDelete: 'CASCADE',
31
31
  onUpdate: 'CASCADE',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/sso",
3
- "version": "0.37.4",
3
+ "version": "0.38.1",
4
4
  "description": "Tomei SSO Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -35,6 +35,7 @@
35
35
  "@types/redis": "^4.0.11",
36
36
  "@types/validator": "^13.11.1",
37
37
  "@typescript-eslint/eslint-plugin": "^5.33.0",
38
+ "@typescript-eslint/parser": "^5.0.0",
38
39
  "dotenv": "^16.1.4",
39
40
  "eslint": "^8.40.0",
40
41
  "eslint-config-prettier": "^8.5.0",
@@ -59,19 +60,18 @@
59
60
  "access": "public"
60
61
  },
61
62
  "peerDependencies": {
62
- "@tomei/activity-history": "^0.2.15",
63
- "@tomei/config": "^0.3.10",
64
- "@tomei/general": "^0.11.8",
65
- "@tomei/mailer": "^0.5.13",
66
- "@types/jest": "^29.5.2",
63
+ "@tomei/activity-history": "^0.2.18",
64
+ "@tomei/config": "^0.3.11",
65
+ "@tomei/general": "^0.14.2",
66
+ "@tomei/mailer": "^0.5.14",
67
67
  "argon2": "^0.30.3",
68
68
  "cls-hooked": "^4.2.2",
69
69
  "cuid": "^3.0.0",
70
70
  "nodemailer": "^6.9.3",
71
71
  "redis": "^4.6.7",
72
72
  "reflect-metadata": "^0.1.13",
73
- "sequelize": "^6.32.1",
74
- "sequelize-typescript": "^2.1.5",
73
+ "sequelize": "^6.37.3",
74
+ "sequelize-typescript": "^2.1.6",
75
75
  "speakeasy": "^2.0.0",
76
76
  "uuid": "^10.0.0"
77
77
  },