@autofleet/shtinker 1.1.6-beta.13 → 1.1.6-beta.14

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.
@@ -21,9 +21,7 @@ const getAuditContext = () => {
21
21
  const auditContext = (_a = currentTrace === null || currentTrace === void 0 ? void 0 : currentTrace.context) === null || _a === void 0 ? void 0 : _a.get(const_1.AUDIT_LOG_CONTEXT_KEY);
22
22
  return auditContext;
23
23
  };
24
- const isEmpty = (value) => {
25
- return Array.isArray(value) ? value.length === 0 : value == null;
26
- };
24
+ const isEmpty = value => Array.isArray(value) ? value.length === 0 : value == null;
27
25
  const filterOutEmptyFields = (fields, instance) => fields.filter(field => !isEmpty(instance.previous(field)) || !isEmpty(instance.get(field)));
28
26
  const getChangedFields = (instance, options) => {
29
27
  logger_1.default.info('START getChangedFields');
@@ -51,7 +49,6 @@ class AuditLogger {
51
49
  modelType.addHook('afterSave', (instance, options) => __awaiter(this, void 0, void 0, function* () {
52
50
  try {
53
51
  const auditContext = getAuditContext();
54
- this.logger.info('auditContext:', { auditContext });
55
52
  if (auditContext) {
56
53
  const changedProperties = getChangedFields(instance, options);
57
54
  const payload = {
@@ -65,9 +62,6 @@ class AuditLogger {
65
62
  };
66
63
  this.sendAuditLogRows(payload);
67
64
  }
68
- else {
69
- this.logger.info('NO AUDIT CONTEXT: ', { entityId: instance.id });
70
- }
71
65
  }
72
66
  catch (error) {
73
67
  logger_1.default.error('Failed to send audit log rows', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/shtinker",
3
- "version": "1.1.6-beta.13",
3
+ "version": "1.1.6-beta.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -12,11 +12,9 @@ const getAuditContext = () => {
12
12
  return auditContext;
13
13
  };
14
14
 
15
- const isEmpty = (value) => {
16
- return Array.isArray(value) ? value.length === 0 : value == null;
17
- };
15
+ const isEmpty = value => Array.isArray(value) ? value.length === 0 : value == null;
18
16
 
19
- const filterOutEmptyFields = (fields, instance) => fields.filter(field => !isEmpty(instance.previous(field)) || !isEmpty(instance.get(field)))
17
+ const filterOutEmptyFields = (fields, instance) => fields.filter(field => !isEmpty(instance.previous(field)) || !isEmpty(instance.get(field)));
20
18
 
21
19
  const getChangedFields = (instance, options) => {
22
20
  logger.info('START getChangedFields');
@@ -52,7 +50,6 @@ class AuditLogger {
52
50
  modelType.addHook('afterSave', async (instance: any, options: any) => {
53
51
  try {
54
52
  const auditContext = getAuditContext();
55
- this.logger.info('auditContext:', { auditContext });
56
53
  if (auditContext) {
57
54
  const changedProperties = getChangedFields(instance, options);
58
55
  const payload: AuditLogPayload = {
@@ -65,8 +62,6 @@ class AuditLogger {
65
62
  })),
66
63
  };
67
64
  this.sendAuditLogRows(payload);
68
- } else {
69
- this.logger.info('NO AUDIT CONTEXT: ', { entityId: instance.id });
70
65
  }
71
66
  } catch (error) {
72
67
  logger.error('Failed to send audit log rows', error);