@autofleet/sadot 0.5.4-beta.7 → 0.5.4-beta.9

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.
@@ -85,7 +85,7 @@ router.get('/', async (req, res) => {
85
85
  where.entityId = entityIds;
86
86
  }
87
87
  logger_1.default.info('sadot Fetching custom field definitions', { modelType, entityIds, where });
88
- const customFieldDefinitions = await DefinitionRepo.findAll({ ...where }, { withDisabled: true });
88
+ const customFieldDefinitions = await DefinitionRepo.findAll(where, { withDisabled: true });
89
89
  logger_1.default.info('sadot Fetched custom field definitions customFieldDefinitions', { customFieldDefinitions });
90
90
  return res.json(customFieldDefinitions);
91
91
  }
@@ -31,6 +31,7 @@ const initTables = async (sequelize, getUser) => {
31
31
  CustomFieldDefinition_1.default.addScope('userScope', () => {
32
32
  const user = getUser();
33
33
  if (user?.permissions) {
34
+ console.log('custom fields scope added', { user, permissions: user.permissions });
34
35
  return {
35
36
  where: {
36
37
  entityId: [
@@ -13,6 +13,7 @@ const findAll = (where, options = { withDisabled: false }) => {
13
13
  where,
14
14
  transaction: options.transaction,
15
15
  raw: true,
16
+ logging: console.log,
16
17
  });
17
18
  };
18
19
  exports.findAll = findAll;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/sadot",
3
- "version": "0.5.4-beta.7",
3
+ "version": "0.5.4-beta.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -67,10 +67,8 @@ router.get('/', async (req, res) => {
67
67
  }
68
68
 
69
69
  logger.info('sadot Fetching custom field definitions', { modelType, entityIds, where });
70
- const customFieldDefinitions = await DefinitionRepo.findAll(
71
- { ...where },
72
- { withDisabled: true },
73
- );
70
+ const customFieldDefinitions = await DefinitionRepo.findAll(where,
71
+ { withDisabled: true });
74
72
  logger.info('sadot Fetched custom field definitions customFieldDefinitions', { customFieldDefinitions });
75
73
  return res.json(customFieldDefinitions);
76
74
  } catch (err) {
@@ -26,6 +26,7 @@ const initTables = async (sequelize: Sequelize, getUser): Promise<void> => {
26
26
  CustomFieldDefinition.addScope('userScope', () => {
27
27
  const user = getUser();
28
28
  if (user?.permissions) {
29
+ console.log('custom fields scope added', { user, permissions: user.permissions });
29
30
  return {
30
31
  where: {
31
32
  entityId: [
@@ -16,6 +16,7 @@ export const findAll = (
16
16
  where,
17
17
  transaction: options.transaction,
18
18
  raw: true,
19
+ logging: console.log,
19
20
  });
20
21
  };
21
22