dt-common-device 11.0.1 → 11.0.2

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.
@@ -11,6 +11,10 @@ async function pushAudit(data) {
11
11
  const audit = await typedi_1.default.get(AuditUtils_1.AuditUtils).buildAuditProperties(data.auditData);
12
12
  await (0, dt_audit_library_1.publishAudit)({
13
13
  eventType: data.auditType,
14
- properties: { ...audit, timestamp: new Date().toISOString() },
14
+ properties: {
15
+ ...audit,
16
+ timestamp: new Date().toISOString(),
17
+ env_type: process.env.NODE_ENV,
18
+ },
15
19
  });
16
20
  }
@@ -212,17 +212,15 @@ function ensureAuditInitialized() {
212
212
  const database = process.env.CLICKHOUSE_DATABASE;
213
213
  const username = process.env.CLICKHOUSE_USERNAME;
214
214
  const password = process.env.CLICKHOUSE_PASSWORD;
215
- const env_type = process.env.NODE_ENV;
216
- if (!host || !database || !username || !password || !env_type) {
217
- getConfig().LOGGER.error("CLICKHOUSE_HOST, CLICKHOUSE_DATABASE, CLICKHOUSE_USERNAME, CLICKHOUSE_PASSWORD, and NODE_ENV must be set in environment variables");
218
- throw new Error("dt-common-device: CLICKHOUSE_HOST, CLICKHOUSE_DATABASE, CLICKHOUSE_USERNAME, CLICKHOUSE_PASSWORD, and NODE_ENV must be set in environment variables");
215
+ if (!host || !database || !username || !password) {
216
+ getConfig().LOGGER.error("CLICKHOUSE_HOST, CLICKHOUSE_DATABASE, CLICKHOUSE_USERNAME, CLICKHOUSE_PASSWORD must be set in environment variables");
217
+ throw new Error("dt-common-device: CLICKHOUSE_HOST, CLICKHOUSE_DATABASE, CLICKHOUSE_USERNAME, CLICKHOUSE_PASSWORD must be set in environment variables");
219
218
  }
220
219
  (0, dt_audit_library_1.initializeAudit)({
221
220
  host,
222
221
  database,
223
222
  username,
224
223
  password,
225
- env_type,
226
224
  });
227
225
  auditInitialized = true;
228
226
  }
@@ -14,6 +14,7 @@ exports.REQUIRED = {
14
14
  "DEVICE_SERVICE",
15
15
  "DT_API_KEY",
16
16
  "MONITORING_SERVICE_PYTHON",
17
+ "NODE_ENV",
17
18
  ],
18
19
  };
19
20
  exports.CONFIG_KEYS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "11.0.1",
3
+ "version": "11.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "axios": "1.10.0",
47
47
  "bullmq": "5.56.4",
48
- "dt-audit-library": "1.0.7",
48
+ "dt-audit-library": "1.7.1",
49
49
  "dt-pub-sub": "^1.0.0",
50
50
  "ioredis": "5.6.1",
51
51
  "lodash": "^4.17.21",