dt-common-device 1.0.16 → 1.0.18

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.
@@ -62,11 +62,11 @@ function ensureAuditInitialized() {
62
62
  * Throws an error if not set.
63
63
  */
64
64
  function getPostgresDbUri() {
65
- const uri = process.env.DATABASE_URL;
66
- if (!uri) {
67
- throw new Error("dt-common-device: POSTGRESQL_DB_URI must be set in environment variables or .env file");
65
+ const fullUri = process.env.ADMIN_DB_URI;
66
+ if (!fullUri) {
67
+ throw new Error("dt-common-device: ADMIN_DB_URI must be set in environment variables or .env file");
68
68
  }
69
- return uri;
69
+ return fullUri;
70
70
  }
71
71
  /**
72
72
  * Returns the Redis DB Host and port from environment variables.
package/dist/db/db.js CHANGED
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPostgresClient = getPostgresClient;
4
4
  const pg_1 = require("pg");
5
5
  const config_1 = require("../config/config");
6
- const dbUri = (0, config_1.getPostgresDbUri)();
6
+ const URI = (0, config_1.getPostgresDbUri)();
7
7
  let pool = null;
8
8
  function getPostgresClient() {
9
9
  if (!pool) {
10
10
  pool = new pg_1.Pool({
11
- connectionString: dbUri,
11
+ connectionString: URI,
12
12
  });
13
13
  }
14
14
  return pool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -69,13 +69,13 @@ export function ensureAuditInitialized() {
69
69
  * Throws an error if not set.
70
70
  */
71
71
  export function getPostgresDbUri(): string {
72
- const uri = process.env.DATABASE_URL;
73
- if (!uri) {
72
+ const fullUri = process.env.ADMIN_DB_URI;
73
+ if (!fullUri) {
74
74
  throw new Error(
75
- "dt-common-device: POSTGRESQL_DB_URI must be set in environment variables or .env file"
75
+ "dt-common-device: ADMIN_DB_URI must be set in environment variables or .env file"
76
76
  );
77
77
  }
78
- return uri;
78
+ return fullUri;
79
79
  }
80
80
 
81
81
  /**
package/src/db/db.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { Pool } from "pg";
2
2
  import { getPostgresDbUri } from "../config/config";
3
3
 
4
- const dbUri = getPostgresDbUri();
4
+ const URI = getPostgresDbUri();
5
5
 
6
6
  let pool: Pool | null = null;
7
7
 
8
8
  export function getPostgresClient() {
9
9
  if (!pool) {
10
10
  pool = new Pool({
11
- connectionString: dbUri,
11
+ connectionString: URI,
12
12
  });
13
13
  }
14
14
  return pool;