@opengis/fastify-table 2.0.115 → 2.0.117
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.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/module/core/pt/schemaItem.pt.hbs +1 -1
- package/dist/module/core/select/core.user_mentioned.sql +1 -1
- package/dist/server/plugins/file/providers/fs.d.ts +1 -1
- package/dist/server/routes/auth/controllers/core/getUserInfo.d.ts.map +1 -1
- package/dist/server/routes/auth/controllers/core/getUserInfo.js +9 -1
- package/package.json +93 -93
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA2FA,iBAAS,MAAM,CAAC,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA2FA,iBAAS,MAAM,CAAC,OAAO,EAAE,GAAG,QA4K3B;;AACD,wBAA0B"}
|
package/dist/index.js
CHANGED
|
@@ -68,9 +68,16 @@ function plugin(fastify) {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
if (!fastify.hasRoute({ method: "GET", url: "/api/list" })) {
|
|
71
|
-
fastify.get(`${opt.prefix}/list`, { config: { role: "admin" } }, () =>
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
fastify.get(`${opt.prefix}/list`, { config: { role: "admin" } }, ({ query }) => {
|
|
72
|
+
const { package: packageName, subdir } = query;
|
|
73
|
+
if (packageName) {
|
|
74
|
+
return { rows: routes.filter((r) => r.package === packageName) };
|
|
75
|
+
}
|
|
76
|
+
if (subdir) {
|
|
77
|
+
return { rows: routes.filter((r) => r.subdir === subdir) };
|
|
78
|
+
}
|
|
79
|
+
return { rows: routes };
|
|
80
|
+
});
|
|
74
81
|
}
|
|
75
82
|
fastify.addHook("onRoute", (r) => {
|
|
76
83
|
if (r.method === "HEAD")
|
|
@@ -82,9 +89,13 @@ function plugin(fastify) {
|
|
|
82
89
|
[curr]: r.schema?.querystring?.properties?.[curr]?.type,
|
|
83
90
|
}), {})
|
|
84
91
|
: undefined;
|
|
92
|
+
r.config = r.config || {};
|
|
93
|
+
r.config.package = r.config.package || "fastify-table";
|
|
85
94
|
routes.push({
|
|
86
95
|
method,
|
|
87
96
|
route: r.url,
|
|
97
|
+
subdir: r.config?.subdir,
|
|
98
|
+
package: r.config?.package,
|
|
88
99
|
description: r.config?.description,
|
|
89
100
|
query,
|
|
90
101
|
roles: r.config?.role?.split?.("|"),
|
|
@@ -11,7 +11,7 @@ CREATE TABLE if not exists {{nspname}}.{{relname}}
|
|
|
11
11
|
{{column_name}} {{data_type}} {{#unless is_nullable}}NOT NULL{{/unless}}{{#if column_default}}DEFAULT {{column_default}}{{/if}}{{#ifCond @index '!=' (_math ../columns.length '-' 1)}},{{/ifCond}} -- {{{coalesce description '-'}}}
|
|
12
12
|
{{/each}}{{#if constraints.length}},{{/if}}
|
|
13
13
|
{{#each constraints}}
|
|
14
|
-
CONSTRAINT {{constraint_name}} {{#ifCond constraint_type '==' 'c'}} {{check_definition}} {{/ifCond}} {{#ifCond constraint_type '==' 'f'}}FOREIGN KEY ({{foreign_column}}) REFERENCES {{foreign_table}} ({{foreign_column}}) MATCH {{select confmatchtype data="constraint_matchtype"}} ON UPDATE {{select confupdtype data="constraint_action"}} ON DELETE {{select confdeltype data="constraint_action"}}{{^}}{{select constraint_type data="constraint_type_full"}} ({{column_name}}){{/ifCond}}{{#ifCond @index '!=' (_math ../constraints.length '-' 1)}},{{/ifCond}}
|
|
14
|
+
CONSTRAINT {{constraint_name}} {{#ifCond constraint_type '==' 'c'}} {{check_definition}} {{/ifCond}} {{#ifCond constraint_type '==' 'f'}}FOREIGN KEY ({{foreign_column}}) REFERENCES {{foreign_table}} ({{foreign_column}}) MATCH {{select confmatchtype data="constraint_matchtype"}} ON UPDATE {{select confupdtype data="constraint_action"}} ON DELETE {{select confdeltype data="constraint_action"}}{{^}}{{#ifCond constraint_type '!=' 'c'}}{{select constraint_type data="constraint_type_full"}} ({{column_name}}){{/ifCond}}{{/ifCond}}{{#ifCond @index '!=' (_math ../constraints.length '-' 1)}},{{/ifCond}}
|
|
15
15
|
{{/each}}
|
|
16
16
|
);
|
|
17
17
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
select uid, coalesce(sur_name,'')||coalesce(' '||user_name,'') as text, email from admin.users
|
|
1
|
+
select uid, coalesce(sur_name,'')||coalesce(' '||user_name,'') as text, email from admin.users
|
|
2
2
|
where enabled order by coalesce(sur_name,'')||coalesce(' '||user_name,'')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
export default function fsStorage(): {
|
|
3
3
|
deleteFile: (fp: string) => Promise<void>;
|
|
4
|
-
downloadFile: (fp: string, options?: Record<string, any>) => Promise<
|
|
4
|
+
downloadFile: (fp: string, options?: Record<string, any>) => Promise<NonSharedBuffer | fs.ReadStream | {
|
|
5
5
|
original: string;
|
|
6
6
|
full: string | null;
|
|
7
7
|
} | null>;
|
|
@@ -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,eAkEjD"}
|
|
@@ -45,7 +45,15 @@ export default async function getUserInfo(req) {
|
|
|
45
45
|
}
|
|
46
46
|
const userInfo = Object.fromEntries(Object.entries(req.user).filter(([key]) => !["salt", "password"].includes(key)));
|
|
47
47
|
const { rows = [] } = req.pg?.pk?.["admin.properties"]
|
|
48
|
-
? await req.pg.query(`select
|
|
48
|
+
? await req.pg.query(`select
|
|
49
|
+
property_key as key,
|
|
50
|
+
case
|
|
51
|
+
when property_text is not null then to_jsonb(property_text)
|
|
52
|
+
when property_int is not null then to_jsonb(property_int)
|
|
53
|
+
when property_json is not null then property_json::jsonb
|
|
54
|
+
end as val
|
|
55
|
+
from admin.properties
|
|
56
|
+
where property_key~'^(${config.settingKeys || "site|map|admin"})'`)
|
|
49
57
|
: {};
|
|
50
58
|
const settings = rows.reduce((p, { key, val }) => {
|
|
51
59
|
const [k1, k2] = key.split(".");
|
package/package.json
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@opengis/fastify-table",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "core-plugins",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"fastify",
|
|
8
|
-
"table",
|
|
9
|
-
"crud",
|
|
10
|
-
"auth",
|
|
11
|
-
"pg",
|
|
12
|
-
"backend"
|
|
13
|
-
],
|
|
14
|
-
"main": "dist/index.js",
|
|
15
|
-
"exports": {
|
|
16
|
-
".": "./dist/index.js",
|
|
17
|
-
"./index.js": "./dist/index.js",
|
|
18
|
-
"./utils.js": "./dist/utils.js"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist/*"
|
|
22
|
-
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"dump": "bun ./script/dump.ts",
|
|
25
|
-
"migrate": "MIGRATE=true bun ./script/migrate.ts",
|
|
26
|
-
"dump1": "bun ./dist/script/dump.js",
|
|
27
|
-
"migrate1": "MIGRATE=true bun ./dist/script/migrate.js",
|
|
28
|
-
"prepublishOnly": "npm run build",
|
|
29
|
-
"clean": "tsc -b --clean",
|
|
30
|
-
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist && copyfiles server/migrations/*.sql dist && copyfiles server/templates/**/*.html dist && copyfiles server/templates/**/*.hbs dist && copyfiles script/* dist && copyfiles -u 2 module/core/*/* dist/module/core",
|
|
31
|
-
"prod": "NODE_ENV=production bun dist/server",
|
|
32
|
-
"patch": "npm version patch && git push && npm publish",
|
|
33
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
34
|
-
"test": "npx vitest run",
|
|
35
|
-
"compress": "node compress.js",
|
|
36
|
-
"dev1": "bun --hot dist/server",
|
|
37
|
-
"dev": "NODE_ENV=production bun start",
|
|
38
|
-
"start": "LOG_LEVEL=trace bun server"
|
|
39
|
-
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"@aws-sdk/client-s3": "3.879.0",
|
|
42
|
-
"@aws-sdk/lib-storage": "3.879.0",
|
|
43
|
-
"@fastify/cookie": "11.0.2",
|
|
44
|
-
"@fastify/http-proxy": "11.1.2",
|
|
45
|
-
"@fastify/multipart": "9.0.3",
|
|
46
|
-
"@fastify/passport": "3.0.2",
|
|
47
|
-
"@fastify/rate-limit": "10.3.0",
|
|
48
|
-
"@fastify/session": "11.1.0",
|
|
49
|
-
"@grpc/grpc-js": "1.10.11",
|
|
50
|
-
"@grpc/proto-loader": "0.7.15",
|
|
51
|
-
"apache-crypt": "1.2.6",
|
|
52
|
-
"better-sqlite3": "12.2.0",
|
|
53
|
-
"dotenv": "16.5.0",
|
|
54
|
-
"fastify": "5.3.3",
|
|
55
|
-
"fastify-plugin": "5.0.1",
|
|
56
|
-
"fastify-session-redis-store": "7.1.2",
|
|
57
|
-
"handlebars": "4.7.8",
|
|
58
|
-
"image-size": "1.2.0",
|
|
59
|
-
"ioredis": "5.3.2",
|
|
60
|
-
"js-yaml": "4.1.0",
|
|
61
|
-
"markdown-it": "14.1.0",
|
|
62
|
-
"nodemailer": "7.0.6",
|
|
63
|
-
"otplib": "12.0.1",
|
|
64
|
-
"pg": "8.11.6",
|
|
65
|
-
"pino": "9.5.0",
|
|
66
|
-
"pino-abstract-transport": "2.0.0",
|
|
67
|
-
"promised-handlebars": "2.0.1",
|
|
68
|
-
"qrcode": "1.5.4",
|
|
69
|
-
"sharp": "0.34.5",
|
|
70
|
-
"uglify-js": "3.19.3",
|
|
71
|
-
"undici": "7.16.0"
|
|
72
|
-
},
|
|
73
|
-
"devDependencies": {
|
|
74
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
75
|
-
"@types/bun": "^1.3.5",
|
|
76
|
-
"@types/js-yaml": "^4.0.9",
|
|
77
|
-
"@types/markdown-it": "^14.1.2",
|
|
78
|
-
"@types/node": "^24.3.1",
|
|
79
|
-
"@types/nodemailer": "^7.0.1",
|
|
80
|
-
"@types/passport": "^1.0.17",
|
|
81
|
-
"@types/passport-local": "^1.0.38",
|
|
82
|
-
"@types/pg": "^8.15.5",
|
|
83
|
-
"@types/qrcode": "^1.5.5",
|
|
84
|
-
"copyfiles": "^2.4.1",
|
|
85
|
-
"eslint": "^9.35.0",
|
|
86
|
-
"eslint-config-airbnb-extended": "^2.3.1",
|
|
87
|
-
"ts-migrate": "^0.1.35",
|
|
88
|
-
"typescript": "^5.9.2",
|
|
89
|
-
"vitest": "^3.2.4"
|
|
90
|
-
},
|
|
91
|
-
"author": "Softpro",
|
|
92
|
-
"license": "ISC"
|
|
93
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/fastify-table",
|
|
3
|
+
"version": "2.0.117",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "core-plugins",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"fastify",
|
|
8
|
+
"table",
|
|
9
|
+
"crud",
|
|
10
|
+
"auth",
|
|
11
|
+
"pg",
|
|
12
|
+
"backend"
|
|
13
|
+
],
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./dist/index.js",
|
|
17
|
+
"./index.js": "./dist/index.js",
|
|
18
|
+
"./utils.js": "./dist/utils.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/*"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dump": "bun ./script/dump.ts",
|
|
25
|
+
"migrate": "MIGRATE=true bun ./script/migrate.ts",
|
|
26
|
+
"dump1": "bun ./dist/script/dump.js",
|
|
27
|
+
"migrate1": "MIGRATE=true bun ./dist/script/migrate.js",
|
|
28
|
+
"prepublishOnly": "npm run build",
|
|
29
|
+
"clean": "tsc -b --clean",
|
|
30
|
+
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist && copyfiles server/migrations/*.sql dist && copyfiles server/templates/**/*.html dist && copyfiles server/templates/**/*.hbs dist && copyfiles script/* dist && copyfiles -u 2 module/core/*/* dist/module/core",
|
|
31
|
+
"prod": "NODE_ENV=production bun dist/server",
|
|
32
|
+
"patch": "npm version patch && git push && npm publish",
|
|
33
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
34
|
+
"test": "npx vitest run",
|
|
35
|
+
"compress": "node compress.js",
|
|
36
|
+
"dev1": "bun --hot dist/server",
|
|
37
|
+
"dev": "NODE_ENV=production bun start",
|
|
38
|
+
"start": "LOG_LEVEL=trace bun server"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@aws-sdk/client-s3": "3.879.0",
|
|
42
|
+
"@aws-sdk/lib-storage": "3.879.0",
|
|
43
|
+
"@fastify/cookie": "11.0.2",
|
|
44
|
+
"@fastify/http-proxy": "11.1.2",
|
|
45
|
+
"@fastify/multipart": "9.0.3",
|
|
46
|
+
"@fastify/passport": "3.0.2",
|
|
47
|
+
"@fastify/rate-limit": "10.3.0",
|
|
48
|
+
"@fastify/session": "11.1.0",
|
|
49
|
+
"@grpc/grpc-js": "1.10.11",
|
|
50
|
+
"@grpc/proto-loader": "0.7.15",
|
|
51
|
+
"apache-crypt": "1.2.6",
|
|
52
|
+
"better-sqlite3": "12.2.0",
|
|
53
|
+
"dotenv": "16.5.0",
|
|
54
|
+
"fastify": "5.3.3",
|
|
55
|
+
"fastify-plugin": "5.0.1",
|
|
56
|
+
"fastify-session-redis-store": "7.1.2",
|
|
57
|
+
"handlebars": "4.7.8",
|
|
58
|
+
"image-size": "1.2.0",
|
|
59
|
+
"ioredis": "5.3.2",
|
|
60
|
+
"js-yaml": "4.1.0",
|
|
61
|
+
"markdown-it": "14.1.0",
|
|
62
|
+
"nodemailer": "7.0.6",
|
|
63
|
+
"otplib": "12.0.1",
|
|
64
|
+
"pg": "8.11.6",
|
|
65
|
+
"pino": "9.5.0",
|
|
66
|
+
"pino-abstract-transport": "2.0.0",
|
|
67
|
+
"promised-handlebars": "2.0.1",
|
|
68
|
+
"qrcode": "1.5.4",
|
|
69
|
+
"sharp": "0.34.5",
|
|
70
|
+
"uglify-js": "3.19.3",
|
|
71
|
+
"undici": "7.16.0"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
75
|
+
"@types/bun": "^1.3.5",
|
|
76
|
+
"@types/js-yaml": "^4.0.9",
|
|
77
|
+
"@types/markdown-it": "^14.1.2",
|
|
78
|
+
"@types/node": "^24.3.1",
|
|
79
|
+
"@types/nodemailer": "^7.0.1",
|
|
80
|
+
"@types/passport": "^1.0.17",
|
|
81
|
+
"@types/passport-local": "^1.0.38",
|
|
82
|
+
"@types/pg": "^8.15.5",
|
|
83
|
+
"@types/qrcode": "^1.5.5",
|
|
84
|
+
"copyfiles": "^2.4.1",
|
|
85
|
+
"eslint": "^9.35.0",
|
|
86
|
+
"eslint-config-airbnb-extended": "^2.3.1",
|
|
87
|
+
"ts-migrate": "^0.1.35",
|
|
88
|
+
"typescript": "^5.9.2",
|
|
89
|
+
"vitest": "^3.2.4"
|
|
90
|
+
},
|
|
91
|
+
"author": "Softpro",
|
|
92
|
+
"license": "ISC"
|
|
93
|
+
}
|