@opengis/fastify-table 1.5.2 → 1.5.3
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.
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import loadTemplate from "./loadTemplate.js";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
async function getColumnCLSData(name) {
|
|
5
|
+
const exists = existsSync("module/cls.json");
|
|
6
|
+
const json = exists
|
|
7
|
+
? JSON.parse((await readFile("module/cls.json", "utf-8")) || "{}")
|
|
8
|
+
: {};
|
|
9
|
+
return name
|
|
10
|
+
? Object.keys(json)
|
|
11
|
+
.filter((key) => key.startsWith(`${name}.`))
|
|
12
|
+
.reduce((acc, curr) => ({
|
|
13
|
+
...acc,
|
|
14
|
+
[curr.replace(`${name}.`, "")]: json[curr],
|
|
15
|
+
}), {})
|
|
16
|
+
: json;
|
|
17
|
+
}
|
|
18
|
+
export default async function getColumnCLS(name) {
|
|
19
|
+
const key = [name, "column-cls"].filter(Boolean).join("-");
|
|
20
|
+
if (loadTemplate[key]) {
|
|
21
|
+
return loadTemplate[key];
|
|
22
|
+
}
|
|
23
|
+
loadTemplate[key] = await getColumnCLSData(name);
|
|
24
|
+
return loadTemplate[key];
|
|
25
|
+
}
|
package/dist/utils.js
CHANGED
|
@@ -19,6 +19,7 @@ export { default as redisClients } from "./server/plugins/redis/funcs/redisClien
|
|
|
19
19
|
// template
|
|
20
20
|
export { default as getTemplate } from "./server/plugins/table/funcs/getTemplate.js";
|
|
21
21
|
export { default as getTemplateSync } from "./server/plugins/table/funcs/getTemplateSync.js";
|
|
22
|
+
export { default as getColumnCLS } from "./server/plugins/table/funcs/getColumnCLS.js";
|
|
22
23
|
export { default as getTemplates } from "./server/plugins/table/funcs/getTemplates.js";
|
|
23
24
|
export { default as getTemplatePath } from "./server/plugins/table/funcs/getTemplatePath.js";
|
|
24
25
|
export { default as addTemplateDir } from "./server/plugins/table/funcs/addTemplateDir.js";
|
package/package.json
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@opengis/fastify-table",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "core-plugins",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"fastify",
|
|
8
|
-
"table",
|
|
9
|
-
"crud",
|
|
10
|
-
"pg",
|
|
11
|
-
"backend"
|
|
12
|
-
],
|
|
13
|
-
"main": "dist/index.js",
|
|
14
|
-
"exports": {
|
|
15
|
-
".": "./dist/index.js",
|
|
16
|
-
"./utils.js": "./dist/utils.js"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist/*"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"prepublishOnly": "npm run build",
|
|
23
|
-
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist/server/plugins/grpc/utils",
|
|
24
|
-
"patch": "npm version patch && git push && npm publish",
|
|
25
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
26
|
-
"test": "node --test",
|
|
27
|
-
"compress": "node compress.js",
|
|
28
|
-
"dev1": "set NODE_ENV=local&& node server.js",
|
|
29
|
-
"dev": "bun start",
|
|
30
|
-
"start": "bun server"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@aws-sdk/client-s3": "3.879.0",
|
|
34
|
-
"@aws-sdk/lib-storage": "3.879.0",
|
|
35
|
-
"@fastify/http-proxy": "11.1.2",
|
|
36
|
-
"@fastify/multipart": "9.0.3",
|
|
37
|
-
"@fastify/rate-limit": "10.3.0",
|
|
38
|
-
"@grpc/grpc-js": "1.10.6",
|
|
39
|
-
"@grpc/proto-loader": "0.7.12",
|
|
40
|
-
"better-sqlite3": "12.2.0",
|
|
41
|
-
"copyfiles": "^2.4.1",
|
|
42
|
-
"dotenv": "16.5.0",
|
|
43
|
-
"fastify": "5.3.3",
|
|
44
|
-
"fastify-plugin": "5.0.1",
|
|
45
|
-
"handlebars": "4.7.8",
|
|
46
|
-
"image-size": "1.2.0",
|
|
47
|
-
"ioredis": "5.3.2",
|
|
48
|
-
"js-yaml": "4.1.0",
|
|
49
|
-
"markdown-it": "14.1.0",
|
|
50
|
-
"pg": "8.11.3",
|
|
51
|
-
"pino": "9.5.0",
|
|
52
|
-
"pino-abstract-transport": "2.0.0",
|
|
53
|
-
"promised-handlebars": "2.0.1",
|
|
54
|
-
"qrcode": "1.5.4",
|
|
55
|
-
"uglify-js": "3.19.3"
|
|
56
|
-
},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
59
|
-
"@types/bun": "^1.2.21",
|
|
60
|
-
"@types/js-yaml": "^4.0.9",
|
|
61
|
-
"@types/markdown-it": "^14.1.2",
|
|
62
|
-
"@types/node": "^24.3.1",
|
|
63
|
-
"@types/pg": "^8.15.5",
|
|
64
|
-
"@types/qrcode": "^1.5.5",
|
|
65
|
-
"eslint": "^9.35.0",
|
|
66
|
-
"eslint-config-airbnb-extended": "^2.3.1",
|
|
67
|
-
"ts-migrate": "^0.1.35",
|
|
68
|
-
"typescript": "^5.9.2"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/fastify-table",
|
|
3
|
+
"version": "1.5.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "core-plugins",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"fastify",
|
|
8
|
+
"table",
|
|
9
|
+
"crud",
|
|
10
|
+
"pg",
|
|
11
|
+
"backend"
|
|
12
|
+
],
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./dist/index.js",
|
|
16
|
+
"./utils.js": "./dist/utils.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/*"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prepublishOnly": "npm run build",
|
|
23
|
+
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist/server/plugins/grpc/utils",
|
|
24
|
+
"patch": "npm version patch && git push && npm publish",
|
|
25
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
26
|
+
"test": "node --test",
|
|
27
|
+
"compress": "node compress.js",
|
|
28
|
+
"dev1": "set NODE_ENV=local&& node server.js",
|
|
29
|
+
"dev": "bun start",
|
|
30
|
+
"start": "bun server"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@aws-sdk/client-s3": "3.879.0",
|
|
34
|
+
"@aws-sdk/lib-storage": "3.879.0",
|
|
35
|
+
"@fastify/http-proxy": "11.1.2",
|
|
36
|
+
"@fastify/multipart": "9.0.3",
|
|
37
|
+
"@fastify/rate-limit": "10.3.0",
|
|
38
|
+
"@grpc/grpc-js": "1.10.6",
|
|
39
|
+
"@grpc/proto-loader": "0.7.12",
|
|
40
|
+
"better-sqlite3": "12.2.0",
|
|
41
|
+
"copyfiles": "^2.4.1",
|
|
42
|
+
"dotenv": "16.5.0",
|
|
43
|
+
"fastify": "5.3.3",
|
|
44
|
+
"fastify-plugin": "5.0.1",
|
|
45
|
+
"handlebars": "4.7.8",
|
|
46
|
+
"image-size": "1.2.0",
|
|
47
|
+
"ioredis": "5.3.2",
|
|
48
|
+
"js-yaml": "4.1.0",
|
|
49
|
+
"markdown-it": "14.1.0",
|
|
50
|
+
"pg": "8.11.3",
|
|
51
|
+
"pino": "9.5.0",
|
|
52
|
+
"pino-abstract-transport": "2.0.0",
|
|
53
|
+
"promised-handlebars": "2.0.1",
|
|
54
|
+
"qrcode": "1.5.4",
|
|
55
|
+
"uglify-js": "3.19.3"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
59
|
+
"@types/bun": "^1.2.21",
|
|
60
|
+
"@types/js-yaml": "^4.0.9",
|
|
61
|
+
"@types/markdown-it": "^14.1.2",
|
|
62
|
+
"@types/node": "^24.3.1",
|
|
63
|
+
"@types/pg": "^8.15.5",
|
|
64
|
+
"@types/qrcode": "^1.5.5",
|
|
65
|
+
"eslint": "^9.35.0",
|
|
66
|
+
"eslint-config-airbnb-extended": "^2.3.1",
|
|
67
|
+
"ts-migrate": "^0.1.35",
|
|
68
|
+
"typescript": "^5.9.2",
|
|
69
|
+
"vitest": "^3.2.4"
|
|
70
|
+
},
|
|
71
|
+
"author": "Softpro",
|
|
72
|
+
"license": "ISC"
|
|
73
|
+
}
|