@heyhru/app-dms-server 0.9.1 → 0.9.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.
- package/dist/index.js +22 -4
- package/dist/otel.js +2 -6
- package/package.json +2 -2
- package/dist/chunk-Q4FLM4HF.js +0 -23
package/dist/index.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
config
|
|
3
|
-
} from "./chunk-Q4FLM4HF.js";
|
|
4
|
-
|
|
5
1
|
// src/index.ts
|
|
6
2
|
import { createPgDb } from "@heyhru/server-plugin-pg";
|
|
7
3
|
|
|
@@ -47,6 +43,28 @@ function refreshPoolMetrics() {
|
|
|
47
43
|
|
|
48
44
|
// src/auth/auth.middleware.ts
|
|
49
45
|
import { verifyToken as jwtVerify } from "@heyhru/server-plugin-jwt";
|
|
46
|
+
|
|
47
|
+
// src/config.ts
|
|
48
|
+
if (!process.env.DATABASE_URL) {
|
|
49
|
+
throw new Error("DATABASE_URL environment variable is required");
|
|
50
|
+
}
|
|
51
|
+
var config = {
|
|
52
|
+
port: Number(process.env.PORT) || 3001,
|
|
53
|
+
jwtSecret: process.env.JWT_SECRET || "dev-secret-change-in-production",
|
|
54
|
+
jwtExpiresIn: "24h",
|
|
55
|
+
encryptionKey: process.env.ENCRYPTION_KEY || "dev-encryption-key-32-bytes-long!",
|
|
56
|
+
dbUrl: process.env.DATABASE_URL,
|
|
57
|
+
dbSsl: process.env.DATABASE_SSL === "true",
|
|
58
|
+
dbPoolMin: Number(process.env.DATABASE_POOL_MIN) || 2,
|
|
59
|
+
dbPoolMax: Number(process.env.DATABASE_POOL_MAX) || 10,
|
|
60
|
+
dbIdleTimeoutMs: Number(process.env.DATABASE_IDLE_TIMEOUT) || 1e4,
|
|
61
|
+
nodeEnv: process.env.NODE_ENV || "development",
|
|
62
|
+
logDir: process.env.LOG_DIR || "",
|
|
63
|
+
otelEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || "http://localhost:4317",
|
|
64
|
+
otelEnabled: process.env.OTEL_ENABLED === "true"
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// src/auth/auth.middleware.ts
|
|
50
68
|
function verifyToken(token) {
|
|
51
69
|
return jwtVerify(token, config.jwtSecret);
|
|
52
70
|
}
|
package/dist/otel.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
config
|
|
3
|
-
} from "./chunk-Q4FLM4HF.js";
|
|
4
|
-
|
|
5
1
|
// src/otel.ts
|
|
6
2
|
import { initOtel } from "@heyhru/server-plugin-otel";
|
|
7
3
|
initOtel({
|
|
8
4
|
serviceName: "app-dms-server",
|
|
9
|
-
endpoint:
|
|
10
|
-
enabled:
|
|
5
|
+
endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? "http://localhost:4317",
|
|
6
|
+
enabled: process.env.OTEL_ENABLED === "true"
|
|
11
7
|
});
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.9.
|
|
6
|
+
"version": "0.9.2",
|
|
7
7
|
"description": "DMS backend API server built on Fastify",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.mjs",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"typescript": "^6.0.2",
|
|
44
44
|
"vitest": "^4.1.4"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "240fa2bfb20692d6d260961fa7b15de3b129118a"
|
|
47
47
|
}
|
package/dist/chunk-Q4FLM4HF.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// src/config.ts
|
|
2
|
-
if (!process.env.DATABASE_URL) {
|
|
3
|
-
throw new Error("DATABASE_URL environment variable is required");
|
|
4
|
-
}
|
|
5
|
-
var config = {
|
|
6
|
-
port: Number(process.env.PORT) || 3001,
|
|
7
|
-
jwtSecret: process.env.JWT_SECRET || "dev-secret-change-in-production",
|
|
8
|
-
jwtExpiresIn: "24h",
|
|
9
|
-
encryptionKey: process.env.ENCRYPTION_KEY || "dev-encryption-key-32-bytes-long!",
|
|
10
|
-
dbUrl: process.env.DATABASE_URL,
|
|
11
|
-
dbSsl: process.env.DATABASE_SSL === "true",
|
|
12
|
-
dbPoolMin: Number(process.env.DATABASE_POOL_MIN) || 2,
|
|
13
|
-
dbPoolMax: Number(process.env.DATABASE_POOL_MAX) || 10,
|
|
14
|
-
dbIdleTimeoutMs: Number(process.env.DATABASE_IDLE_TIMEOUT) || 1e4,
|
|
15
|
-
nodeEnv: process.env.NODE_ENV || "development",
|
|
16
|
-
logDir: process.env.LOG_DIR || "",
|
|
17
|
-
otelEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || "http://localhost:4317",
|
|
18
|
-
otelEnabled: process.env.OTEL_ENABLED === "true"
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
config
|
|
23
|
-
};
|