@opengis/fastify-table 2.0.109 → 2.0.110
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/config.d.ts.map +1 -1
- package/dist/config.js +2 -1
- package/dist/server/plugins/logger/index.d.ts.map +1 -1
- package/dist/server/plugins/logger/index.js +11 -1
- package/dist/server/plugins/pg/funcs/init.d.ts.map +1 -1
- package/dist/server/plugins/pg/funcs/init.js +1 -1
- package/dist/server/routes/auth/controllers/core/getUserInfo.d.ts.map +1 -1
- package/dist/server/routes/auth/controllers/core/getUserInfo.js +4 -2
- package/dist/test.setup.d.ts +2 -0
- package/dist/test.setup.d.ts.map +1 -0
- package/dist/test.setup.js +18 -0
- package/package.json +1 -1
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../config.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,MAAM,KAA8D,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../config.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,MAAM,KAA8D,CAAC;AAsC3E,eAAe,MAAM,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -9,7 +9,8 @@ const { skipKeys = ["windir"] } = config;
|
|
|
9
9
|
Object.assign(config, {
|
|
10
10
|
storageList: {},
|
|
11
11
|
allTemplates: config?.allTemplates || {},
|
|
12
|
-
env: process.env
|
|
12
|
+
env: process.env.NODE_ENV,
|
|
13
|
+
port: process.env.PORT,
|
|
13
14
|
});
|
|
14
15
|
if (existsSync(`.env.local`)) {
|
|
15
16
|
dotenv.config({ path: `.env.local` }); // ! load .env.local
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/plugins/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/plugins/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAmD7E,iBAAe,MAAM,CAAC,OAAO,EAAE,eAAe,iBAwC7C;AACD,eAAe,MAAM,CAAC"}
|
|
@@ -9,7 +9,8 @@ process.on("uncaughtException", (err) => {
|
|
|
9
9
|
console.warn("⚠️ Ignored pg connection drop:", err.toString());
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
logger.file("uncaughtException", { error: err.toString(), stack: err.stack });
|
|
13
|
+
// throw err; // keep normal behavior
|
|
13
14
|
});
|
|
14
15
|
// avoid process exit with rejection during client connect at process start
|
|
15
16
|
process.on("unhandledRejection", (err) => {
|
|
@@ -27,6 +28,15 @@ process.on("unhandledRejection", (err) => {
|
|
|
27
28
|
console.warn("⚠️ Ignored redis connection close:", err.toString());
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
31
|
+
if (err.code === "ERR_HTTP_HEADERS_SENT") {
|
|
32
|
+
logger.file("fastify", { error: err.code, stack: err.stack });
|
|
33
|
+
console.warn("Ignored fastify reply sent exception:", err.toString());
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
logger.file("unhandledRejection", {
|
|
37
|
+
error: err.toString(),
|
|
38
|
+
stack: err.stack,
|
|
39
|
+
});
|
|
30
40
|
throw err;
|
|
31
41
|
});
|
|
32
42
|
async function plugin(fastify) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,iBAAe,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,iBAAe,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,iBA0NtC;AAGD,eAAe,IAAI,CAAC"}
|
|
@@ -176,7 +176,7 @@ async function init(client) {
|
|
|
176
176
|
queryNotice,
|
|
177
177
|
querySafe,
|
|
178
178
|
});
|
|
179
|
-
console.log("New client init finished", client.database);
|
|
179
|
+
console.log("New client init finished", client.database, new Date().toISOString());
|
|
180
180
|
logger.file("pg", {
|
|
181
181
|
message: "client init finished",
|
|
182
182
|
database: client.database,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserInfo.d.ts","sourceRoot":"","sources":["../../../../../../server/routes/auth/controllers/core/getUserInfo.ts"],"names":[],"mappings":"AAiCA,wBAA8B,WAAW,CAAC,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"getUserInfo.d.ts","sourceRoot":"","sources":["../../../../../../server/routes/auth/controllers/core/getUserInfo.ts"],"names":[],"mappings":"AAiCA,wBAA8B,WAAW,CAAC,GAAG,EAAE,GAAG,eA4DjD"}
|
|
@@ -39,8 +39,10 @@ export default async function getUserInfo(req) {
|
|
|
39
39
|
cookies: req.cookies,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
if (!req.user)
|
|
43
|
-
|
|
42
|
+
if (!req.user) {
|
|
43
|
+
const hookData1 = await applyHook("afterUser", { payload });
|
|
44
|
+
return hookData1 || payload;
|
|
45
|
+
}
|
|
44
46
|
const userInfo = Object.fromEntries(Object.entries(req.user).filter(([key]) => !["salt", "password"].includes(key)));
|
|
45
47
|
const { rows = [] } = req.pg?.pk?.["admin.properties"]
|
|
46
48
|
? await req.pg.query(`select property_key as key,property_text as val from admin.properties where property_key~'^(${config.settingKeys || "site|map|admin"})'`)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.setup.d.ts","sourceRoot":"","sources":["../test.setup.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { beforeEach, afterEach, afterAll } from "vitest";
|
|
2
|
+
// @ts-expect-error required for unit tests only
|
|
3
|
+
import { build, teardown } from "./helper.js";
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
console.log("build after each bun test start...");
|
|
6
|
+
await build();
|
|
7
|
+
console.log("build after each bun test finished");
|
|
8
|
+
});
|
|
9
|
+
afterEach(async () => {
|
|
10
|
+
console.log("teardown after each bun test start...");
|
|
11
|
+
// await teardown();
|
|
12
|
+
console.log("teardown after each bun test finished");
|
|
13
|
+
});
|
|
14
|
+
afterAll(async () => {
|
|
15
|
+
console.log("teardown after all bun test start...");
|
|
16
|
+
await teardown();
|
|
17
|
+
console.log("teardown after all bun test finished");
|
|
18
|
+
});
|