@tomei/sso 0.51.5 → 0.51.8

Sign up to get free protection for your applications and to get access to all the features.
package/eslint.config.mjs CHANGED
@@ -1,6 +1,11 @@
1
1
  import eslintPlugin from "@typescript-eslint/eslint-plugin";
2
2
  import parser from "@typescript-eslint/parser";
3
3
  import importPlugin from 'eslint-plugin-import'
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
4
9
 
5
10
  export default [
6
11
  {
@@ -8,6 +13,10 @@ export default [
8
13
  parser: parser,
9
14
  ecmaVersion: "latest", // Allows modern ECMAScript features
10
15
  sourceType: "module", // Allows for the use of imports
16
+ parserOptions: {
17
+ tsconfigRootDir: __dirname,
18
+ project: './tsconfig.json'
19
+ },
11
20
  },
12
21
  plugins: {
13
22
  "@typescript-eslint": eslintPlugin,
@@ -33,17 +42,17 @@ export default [
33
42
  "@typescript-eslint/no-unsafe-return": "off",
34
43
  "@typescript-eslint/restrict-template-expressions": "off",
35
44
  "no-useless-escape": "off",
36
- // Disallow absolute paths
37
- "import/no-absolute-path": "error",
38
- // Enforce relative imports within the same parent directory
39
- 'no-restricted-imports': [
40
- 'error',
41
- {
42
- paths: [],
43
- patterns: ['*/src/*'], // Replace this with your base path if different
44
- },
45
- ],
45
+ "import/no-relative-parent-imports": "error", // Enforce relative imports only
46
+ "import/no-absolute-path": "error", // Block absolute imports outside aliases
47
+ "import/no-unresolved": ["error", { commonjs: true }],
48
+ },
49
+ settings: {
50
+ "import/resolver": {
51
+ typescript: {
52
+ alwaysTryTypes: true,
53
+ }
54
+ }
46
55
  },
47
- ignores: ["node_modules", "dist"],
56
+ ignores: ["node_modules", "dist/**/*", "eslint.config.mjs"],
48
57
  },
49
58
  ];
@@ -118,7 +118,7 @@ module.exports = {
118
118
  });
119
119
  },
120
120
 
121
- async down(queryInterface, Sequelize) {
121
+ async down(queryInterface) {
122
122
  await queryInterface.dropTable('sso_User');
123
123
  },
124
124
  };
@@ -72,7 +72,7 @@ module.exports = {
72
72
  });
73
73
  },
74
74
 
75
- async down(queryInterface, Sequelize) {
75
+ async down(queryInterface) {
76
76
  await queryInterface.dropTable('sso_System');
77
77
  },
78
78
  };
@@ -87,7 +87,7 @@ module.exports = {
87
87
  });
88
88
  },
89
89
 
90
- async down(queryInterface, Sequelize) {
90
+ async down(queryInterface) {
91
91
  await queryInterface.dropTable('sso_Group');
92
92
  },
93
93
  };
@@ -70,7 +70,7 @@ module.exports = {
70
70
  });
71
71
  },
72
72
 
73
- async down(queryInterface, Sequelize) {
73
+ async down(queryInterface) {
74
74
  await queryInterface.dropTable('sso_GroupReportingUser');
75
75
  },
76
76
  };
@@ -66,7 +66,7 @@ module.exports = {
66
66
  });
67
67
  },
68
68
 
69
- async down(queryInterface, Sequelize) {
69
+ async down(queryInterface) {
70
70
  await queryInterface.dropTable('sso_GroupSystemAccess');
71
71
  },
72
72
  };
@@ -69,7 +69,7 @@ module.exports = {
69
69
  });
70
70
  },
71
71
 
72
- async down(queryInterface, Sequelize) {
72
+ async down(queryInterface) {
73
73
  await queryInterface.dropTable('sso_UserSystemAccess');
74
74
  }
75
75
  };
@@ -70,7 +70,7 @@ module.exports = {
70
70
  });
71
71
  },
72
72
 
73
- async down(queryInterface, Sequelize) {
73
+ async down(queryInterface) {
74
74
  await queryInterface.dropTable('sso_UserPrivilege');
75
75
  },
76
76
  };
@@ -70,7 +70,7 @@ module.exports = {
70
70
  });
71
71
  },
72
72
 
73
- async down(queryInterface, Sequelize) {
73
+ async down(queryInterface) {
74
74
  await queryInterface.dropTable('sso_GroupPrivilege');
75
75
  },
76
76
  };
@@ -78,7 +78,7 @@ module.exports = {
78
78
  });
79
79
  },
80
80
 
81
- async down(queryInterface, Sequelize) {
81
+ async down(queryInterface) {
82
82
  await queryInterface.dropTable('sso_GroupObjectPrivilege');
83
83
  },
84
84
  };
@@ -78,7 +78,7 @@ module.exports = {
78
78
  });
79
79
  },
80
80
 
81
- async down(queryInterface, Sequelize) {
81
+ async down(queryInterface) {
82
82
  await queryInterface.dropTable('sso_UserObjectPrivilege');
83
83
  },
84
84
  };
@@ -79,7 +79,7 @@ module.exports = {
79
79
  });
80
80
  },
81
81
 
82
- async down(queryInterface, Sequelize) {
82
+ async down(queryInterface) {
83
83
  await queryInterface.dropTable('sso_APIKey');
84
84
  },
85
85
  };
@@ -85,7 +85,7 @@ module.exports = {
85
85
  });
86
86
  },
87
87
 
88
- down: async (queryInterface, Sequelize) => {
88
+ down: async (queryInterface) => {
89
89
  // Drop the trigger before dropping the table
90
90
  await queryInterface.sequelize.query(
91
91
  `DROP TRIGGER IF EXISTS update_GroupCode_ObjectId`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/sso",
3
- "version": "0.51.5",
3
+ "version": "0.51.8",
4
4
  "description": "Tomei SSO Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -63,10 +63,10 @@
63
63
  "access": "public"
64
64
  },
65
65
  "peerDependencies": {
66
- "@tomei/activity-history": "^0.2.22",
67
- "@tomei/config": "^0.3.20",
68
- "@tomei/general": "^0.21.2",
69
- "@tomei/mailer": "^0.5.20",
66
+ "@tomei/activity-history": "^0.2.23",
67
+ "@tomei/config": "^0.3.21",
68
+ "@tomei/general": "^0.21.3",
69
+ "@tomei/mailer": "^0.5.21",
70
70
  "argon2": "^0.41.1",
71
71
  "redis": "^4.7.0",
72
72
  "reflect-metadata": "^0.2.2",
@@ -574,7 +574,12 @@ export class User extends UserBase {
574
574
  const sessionId: string = randomUUID();
575
575
 
576
576
  if (systemLogin) {
577
+ const privileges = await this.getPrivileges(
578
+ system.SystemCode,
579
+ dbTransaction,
580
+ );
577
581
  systemLogin.sessionId = sessionId;
582
+ systemLogin.privileges = privileges;
578
583
  userSession.systemLogins.map((system) =>
579
584
  system.code === systemCode ? systemLogin : system,
580
585
  );
package/tsconfig.json CHANGED
@@ -20,4 +20,5 @@
20
20
  "noFallthroughCasesInSwitch": false,
21
21
  "strictNullChecks": false,
22
22
  },
23
+ "exclude": ["node_modules", "dist"]
23
24
  }
package/.eslintignore DELETED
@@ -1 +0,0 @@
1
- dist
package/.eslintrc DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "parser": "@typescript-eslint/parser",
3
- "parserOptions": {
4
- "ecmaVersion": "latest",
5
- "sourceType": "module" // Allows for the use of imports
6
- },
7
- "extends": ["plugin:@typescript-eslint/recommended"],
8
- "env": {
9
- "node": true // Enable Node.js global variables
10
- },
11
- "rules": {
12
- "no-console": "off",
13
- "import/prefer-default-export": "off",
14
- "@typescript-eslint/no-unused-vars": "warn"
15
- }
16
- }
package/.eslintrc.js DELETED
@@ -1,35 +0,0 @@
1
- module.exports = {
2
- parser: "@typescript-eslint/parser",
3
- plugins: ["@typescript-eslint"],
4
-
5
- parserOptions: {
6
- ecmaVersion: "latest", // Allows the use of modern ECMAScript features
7
- sourceType: "module", // Allows for the use of imports
8
- },
9
-
10
- extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
11
- env: {
12
- node: true, // Enable Node.js global variables
13
- },
14
- rules: {
15
- "no-console": "off",
16
- "@typescript-eslint/no-explicit-any": "off",
17
- "@typescript-eslint/no-var-requires": "off",
18
- "@typescript-eslint/explicit-module-boundary-types": "off",
19
- "import/prefer-default-export": "off",
20
- "@typescript-eslint/no-unused-vars": "warn",
21
- "no-useless-catch": "off",
22
- "@typescript-eslint/no-non-null-assertion": "off",
23
- "@typescript-eslint/no-empty-function": "off",
24
- "@typescript-eslint/no-empty-interface": "off",
25
- "@typescript-eslint/no-inferrable-types": "off",
26
- "@typescript-eslint/no-namespace": "off",
27
- "@typescript-eslint/no-use-before-define": "off",
28
- "@typescript-eslint/no-unsafe-assignment": "off",
29
- "@typescript-eslint/no-unsafe-call": "off",
30
- "@typescript-eslint/no-unsafe-member-access": "off",
31
- "@typescript-eslint/no-unsafe-return": "off",
32
- "@typescript-eslint/restrict-template-expressions": "off",
33
- "no-useless-escape": "off",
34
- },
35
- };