@autofleet/shtinker 1.1.6-beta.4 → 1.1.6-beta.5

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.
@@ -27,11 +27,11 @@ const getChangedFields = (instance, options, loggerLocal) => {
27
27
  if (options.returning) {
28
28
  return options.fields;
29
29
  }
30
- const changedProperties = instance.changed();
31
- loggerLocal.info('changedProperties: ', { changedProperties });
32
- const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
33
- loggerLocal.info('changedPropertiesWithoutEmptyFields: ', { changedPropertiesWithoutEmptyFields });
34
- return changedPropertiesWithoutEmptyFields;
30
+ // const changedProperties = instance.changed();
31
+ // loggerLocal.info('changedProperties: ', { changedProperties });
32
+ // const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
33
+ // loggerLocal.info('changedPropertiesWithoutEmptyFields: ', { changedPropertiesWithoutEmptyFields });
34
+ return instance.changed();
35
35
  };
36
36
  class AuditLogger {
37
37
  constructor(options) {
@@ -47,9 +47,9 @@ class AuditLogger {
47
47
  this.logger.info('auditContext:', { auditContext });
48
48
  if (auditContext) {
49
49
  const changedProperties = getChangedFields(instance, options, this.logger);
50
- // this.logger.info('changedProperties:', { changedProperties });
51
- // const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
52
- // this.logger.info('changedPropertiesWithoutEmptyFields:', { changedPropertiesWithoutEmptyFields });
50
+ this.logger.info('changedProperties:', { changedProperties });
51
+ const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
52
+ this.logger.info('changedPropertiesWithoutEmptyFields:', { changedPropertiesWithoutEmptyFields });
53
53
  const payload = {
54
54
  entityType: modelName,
55
55
  entityId: instance.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/shtinker",
3
- "version": "1.1.6-beta.4",
3
+ "version": "1.1.6-beta.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -18,11 +18,11 @@ const getChangedFields = (instance, options, loggerLocal) => {
18
18
  if (options.returning) {
19
19
  return options.fields;
20
20
  }
21
- const changedProperties = instance.changed();
22
- loggerLocal.info('changedProperties: ', { changedProperties });
23
- const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
24
- loggerLocal.info('changedPropertiesWithoutEmptyFields: ', { changedPropertiesWithoutEmptyFields });
25
- return changedPropertiesWithoutEmptyFields;
21
+ // const changedProperties = instance.changed();
22
+ // loggerLocal.info('changedProperties: ', { changedProperties });
23
+ // const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
24
+ // loggerLocal.info('changedPropertiesWithoutEmptyFields: ', { changedPropertiesWithoutEmptyFields });
25
+ return instance.changed();
26
26
  };
27
27
 
28
28
  class AuditLogger {
@@ -46,9 +46,9 @@ class AuditLogger {
46
46
  this.logger.info('auditContext:', { auditContext });
47
47
  if (auditContext) {
48
48
  const changedProperties = getChangedFields(instance, options, this.logger);
49
- // this.logger.info('changedProperties:', { changedProperties });
50
- // const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
51
- // this.logger.info('changedPropertiesWithoutEmptyFields:', { changedPropertiesWithoutEmptyFields });
49
+ this.logger.info('changedProperties:', { changedProperties });
50
+ const changedPropertiesWithoutEmptyFields = changedProperties.filter((property) => instance.previous(property) != null || instance.get(property) != null);
51
+ this.logger.info('changedPropertiesWithoutEmptyFields:', { changedPropertiesWithoutEmptyFields });
52
52
  const payload: AuditLogPayload = {
53
53
  entityType: modelName,
54
54
  entityId: instance.id,