@opengis/fastify-table 2.0.7 → 2.0.9
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 +39 -32
- package/dist/server/plugins/auth/funcs/authorizeUser.js +1 -1
- package/dist/server/plugins/auth/index.js +6 -6
- package/dist/server/plugins/crud/funcs/getAccess.js +1 -1
- package/dist/server/plugins/grpc/utils/server/plugins/grpc/utils/convertp.proto +137 -0
- package/dist/server/plugins/grpc/utils/server/plugins/grpc/utils/office2pdf.proto +14 -0
- package/dist/server/plugins/hook/addHook.js +7 -0
- package/dist/server/plugins/hook/applyHook.js +18 -0
- package/dist/server/plugins/hook/applyHookSync.js +7 -0
- package/dist/server/plugins/hook/funcs/addHook.js +7 -0
- package/dist/server/plugins/hook/funcs/applyHook.js +25 -0
- package/dist/server/plugins/hook/funcs/applyHookSync.js +7 -0
- package/dist/server/plugins/hook/hookList.js +1 -0
- package/dist/server/plugins/hook/index.js +6 -38
- package/dist/server/plugins/logger/errorMessage.js +1 -1
- package/dist/server/plugins/logger/errorStatus.js +1 -1
- package/dist/server/plugins/pg/index.js +2 -2
- package/dist/server/plugins/table/funcs/getFilterSQL/util/formatValue.js +1 -1
- package/dist/utils.js +2 -1
- package/package.json +88 -88
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import fp from
|
|
1
|
+
import fp from 'fastify-plugin';
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -17,20 +17,29 @@ import metricPlugin from "./server/plugins/metric/index.js";
|
|
|
17
17
|
import redisPlugin from "./server/plugins/redis/index.js";
|
|
18
18
|
import loggerPlugin from "./server/plugins/logger/index.js";
|
|
19
19
|
import authPlugin from "./server/plugins/auth/index.js";
|
|
20
|
+
// routes
|
|
21
|
+
import cronRoutes from "./server/routes/cron/index.js";
|
|
22
|
+
import crudRoutes from "./server/routes/crud/index.js";
|
|
23
|
+
import loggerRoutes from "./server/routes/logger/index.js";
|
|
24
|
+
import propertiesRoutes from "./server/routes/properties/index.js";
|
|
25
|
+
import tableRoutes from "./server/routes/table/index.js";
|
|
26
|
+
import utilRoutes from "./server/routes/util/index.js";
|
|
27
|
+
import accessRoutes from "./server/routes/access/index.js";
|
|
20
28
|
// utils
|
|
21
29
|
import addTemplateDir from "./server/plugins/table/funcs/addTemplateDir.js";
|
|
22
30
|
import execMigrations from "./server/plugins/migration/exec.migrations.js";
|
|
23
31
|
import locales from "./server/routes/table/controllers/utils/locales.js";
|
|
24
32
|
import pgClients from "./server/plugins/pg/pgClients.js";
|
|
33
|
+
import dblistRoutes from "./server/routes/dblist/index.js";
|
|
34
|
+
import menuRoutes from "./server/routes/menu/index.js";
|
|
35
|
+
import templatesRoutes from "./server/routes/templates/index.js";
|
|
36
|
+
import widgetRoutes from "./server/routes/widget/index.js";
|
|
37
|
+
import authRoutes from "./server/routes/auth/index.js";
|
|
25
38
|
// core templates && cls
|
|
26
39
|
const filename = fileURLToPath(import.meta.url);
|
|
27
40
|
const cwd = path.dirname(filename);
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
config.pg = opt.pg || config.pg;
|
|
31
|
-
config.redis = opt.redis || config.redis;
|
|
32
|
-
config.root = opt.root || config.root;
|
|
33
|
-
config.mapServerRoot = opt.mapServerRoot || config.mapServerRoot;
|
|
41
|
+
function plugin(fastify) {
|
|
42
|
+
const opt = { prefix: '/api' };
|
|
34
43
|
// fastify.register(import('@fastify/sensible'), {
|
|
35
44
|
// errorHandler: false,
|
|
36
45
|
// });
|
|
@@ -69,18 +78,17 @@ async function plugin(fastify, opt) {
|
|
|
69
78
|
// core templates && cls
|
|
70
79
|
config.templates?.forEach((el) => addTemplateDir(el));
|
|
71
80
|
addTemplateDir(path.join(cwd, "module/core"));
|
|
72
|
-
// plugins
|
|
73
|
-
policyPlugin(fastify);
|
|
74
|
-
//
|
|
75
|
-
await authPlugin(fastify); // ! session, before any route
|
|
81
|
+
// plugins / utils / funcs
|
|
82
|
+
policyPlugin(fastify);
|
|
83
|
+
authPlugin(fastify); // fastify-auth api + hooks integrated to core
|
|
76
84
|
metricPlugin();
|
|
77
85
|
redisPlugin(fastify);
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
pgPlugin(fastify);
|
|
87
|
+
sqlitePlugin(fastify);
|
|
80
88
|
cronPlugin();
|
|
81
89
|
loggerPlugin(fastify);
|
|
82
90
|
if (config.rateLimit !== false) {
|
|
83
|
-
|
|
91
|
+
fastify.register(import("@fastify/rate-limit"), {
|
|
84
92
|
max: parseInt(config.rateLimit?.max || 100),
|
|
85
93
|
timeWindow: config.rateLimit?.timeWindow || 60000,
|
|
86
94
|
hook: "preHandler",
|
|
@@ -88,30 +96,29 @@ async function plugin(fastify, opt) {
|
|
|
88
96
|
keyGenerator: (req) => `${req.ip}-${req.raw.url.split("?")[0]}`,
|
|
89
97
|
});
|
|
90
98
|
}
|
|
91
|
-
// routes / api
|
|
92
99
|
if (config.dblist) {
|
|
93
|
-
fastify
|
|
100
|
+
dblistRoutes(fastify);
|
|
94
101
|
}
|
|
95
|
-
|
|
96
|
-
fastify
|
|
97
|
-
fastify.register(
|
|
98
|
-
fastify
|
|
99
|
-
fastify.register(
|
|
100
|
-
fastify.register(
|
|
101
|
-
fastify
|
|
102
|
-
fastify.register(
|
|
103
|
-
fastify.register(
|
|
104
|
-
fastify.register(
|
|
105
|
-
|
|
106
|
-
fastify.register(
|
|
107
|
-
//
|
|
108
|
-
|
|
102
|
+
// routes / api
|
|
103
|
+
cronRoutes(fastify);
|
|
104
|
+
fastify.register(crudRoutes, opt);
|
|
105
|
+
loggerRoutes(fastify);
|
|
106
|
+
fastify.register(propertiesRoutes, opt);
|
|
107
|
+
fastify.register(tableRoutes, opt);
|
|
108
|
+
utilRoutes(fastify);
|
|
109
|
+
fastify.register(accessRoutes, opt);
|
|
110
|
+
fastify.register(widgetRoutes, opt);
|
|
111
|
+
fastify.register(menuRoutes, opt);
|
|
112
|
+
fastify.register(templatesRoutes, opt);
|
|
113
|
+
fastify.register(authRoutes); // from fastify-auth
|
|
114
|
+
// from fastify-file
|
|
115
|
+
fastify.register(import("@fastify/multipart"), {
|
|
109
116
|
limits: {
|
|
110
117
|
fileSize: maxFileSize * 1024 * 1024,
|
|
111
118
|
},
|
|
112
119
|
}); // content parser, await before adding upload routes
|
|
113
|
-
fastify.register(import("./server/routes/file/index.js"));
|
|
114
|
-
fastify.register(import("./server/routes/grpc/index.js"));
|
|
120
|
+
fastify.register(import("./server/routes/file/index.js"), opt);
|
|
121
|
+
fastify.register(import("./server/routes/grpc/index.js"), opt);
|
|
115
122
|
config.proxy?.forEach?.((el) => {
|
|
116
123
|
if (execName === "bun") {
|
|
117
124
|
fastify.all(`${el.source}/*`, async (req, reply) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import config from "../../../../config.js";
|
|
2
2
|
import logger from "../../logger/getLogger.js";
|
|
3
|
-
import
|
|
3
|
+
import applyHook from "../../hook/applyHook.js";
|
|
4
4
|
import logAuth from "./logAuth.js";
|
|
5
5
|
/*
|
|
6
6
|
session duration by default
|
|
@@ -7,22 +7,22 @@ import config from "../../../config.js";
|
|
|
7
7
|
import getRedis from "../redis/funcs/getRedis.js";
|
|
8
8
|
const fastifyPassport = new Authenticator();
|
|
9
9
|
const { prefix = "/api" } = config;
|
|
10
|
-
|
|
10
|
+
function plugin(fastify) {
|
|
11
11
|
if (!config.redis) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
fastify.register(cookie, {
|
|
15
15
|
parseOptions: config?.auth?.cookieOptions || { secure: false },
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
fastify.register(session, {
|
|
18
18
|
secret: config?.auth?.secret || "61b820e12858570a4b0633020d4394a17903d9a9",
|
|
19
19
|
cookieName: "session_auth",
|
|
20
20
|
cookie: config?.auth?.cookieOptions || { secure: false },
|
|
21
21
|
store: new RedisStore({ client: getRedis({ db: 10 }) }),
|
|
22
22
|
});
|
|
23
23
|
// register passport AFTER session is ready
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
fastify.register(fastifyPassport.initialize());
|
|
25
|
+
fastify.register(fastifyPassport.secureSession());
|
|
26
26
|
// serialize user used to store user info in session store
|
|
27
27
|
fastifyPassport.registerUserSerializer(async (user) => ({ user }));
|
|
28
28
|
// deserialize user used to add user info from session store to req
|
|
@@ -68,7 +68,7 @@ async function plugin(fastify) {
|
|
|
68
68
|
req.user = req.user === null ? undefined : req.user; // fix for user.uid errors, by default user is null, while with express passport it was {}, unauthorized user does not trigger serializer
|
|
69
69
|
// already done by @fastify/passport serializer / deserializer
|
|
70
70
|
// req.user = passport.user;
|
|
71
|
-
if (config.trace) {
|
|
71
|
+
if (config.trace && false) {
|
|
72
72
|
console.log("req.user?.uid", req.user?.uid, "req.session?.passport?.user?.uid", req.session?.passport?.user?.uid, "config.auth", config.auth);
|
|
73
73
|
}
|
|
74
74
|
// currently 2factor + auth with passwd file not supported
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import pgClients from "../../pg/pgClients.js";
|
|
2
2
|
import getTemplate from "../../table/funcs/getTemplate.js";
|
|
3
|
-
import
|
|
3
|
+
import applyHook from "../../hook/applyHook.js";
|
|
4
4
|
const allActions = ["view", "edit", "add", "del"];
|
|
5
5
|
const q = `select a.route_id as id, d.actions as user_roles, d.actions as role_actions, coalesce(b.actions, array['view']) as interface_actions, b.scope, c.role_id
|
|
6
6
|
from admin.routes a
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
service Convert {
|
|
4
|
+
rpc csvToXls(csvToXlsParams) returns (FileBase64) {}
|
|
5
|
+
rpc jsonToXls(jsonToXlsParams) returns (FileBase64) {}
|
|
6
|
+
rpc pdfMerge(pdfMergeParams) returns (FileBase64) {}
|
|
7
|
+
rpc htmlToPdf(htmlToPdfParams) returns (FileBase64) {}
|
|
8
|
+
rpc excelToJson(excelToJsonParams) returns (FileBase64) {}
|
|
9
|
+
rpc xmlToJson(xmlToJsonParams) returns (FileBase64) {}
|
|
10
|
+
rpc htmlToDoc(htmlToDocParams) returns (FileBase64) {}
|
|
11
|
+
rpc htmlToImage(htmlToImageParams) returns (FileBase64) {}
|
|
12
|
+
rpc geojsonToShp(geojsonToShpParams) returns (FileBase64) {}
|
|
13
|
+
rpc shpToGeojson(shpToGeojsonParams) returns (FileBase64) {}
|
|
14
|
+
rpc docToPDF(docToPDFParams) returns (FileBase64) {}
|
|
15
|
+
rpc mergeImages(mergeImagesIn) returns (FileBase64) {}
|
|
16
|
+
rpc resizeImage(resizeImageIn) returns (FileBase64) {}
|
|
17
|
+
rpc jsonToYaml(jsonToYamlIn) returns (FileBase64) {}
|
|
18
|
+
rpc yamlToJson(yamlToJsonIn) returns (FileBase64) {}
|
|
19
|
+
rpc log(log_in) returns (log_out) {}
|
|
20
|
+
rpc geojsonToGpkg(geojsonToShpParams) returns (FileBase64) {}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message jsonToYamlIn {
|
|
24
|
+
string json = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message yamlToJsonIn {
|
|
28
|
+
string yaml = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message resizeImageIn {
|
|
32
|
+
string base64 = 1;
|
|
33
|
+
uint64 width = 2;
|
|
34
|
+
uint64 height = 3;
|
|
35
|
+
uint32 quality = 4;
|
|
36
|
+
uint32 subsampling = 5;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message pdfToImgIn {
|
|
40
|
+
string pdfPath = 1;
|
|
41
|
+
string imgPath = 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message pdfToImgOut {
|
|
45
|
+
string imgPath = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message log_in {
|
|
49
|
+
uint32 rows = 1;
|
|
50
|
+
string level = 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message log_out {
|
|
54
|
+
repeated string logs = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
enum mergeImageFormat {
|
|
58
|
+
VERTICAL = 0;
|
|
59
|
+
HORIZONTAL = 1;
|
|
60
|
+
OVERLAY = 2;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message imageMeta {
|
|
64
|
+
string base64 = 1;
|
|
65
|
+
mergeImageFormat mergeFormat = 2;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message mergeImagesIn {
|
|
69
|
+
repeated string images = 1;
|
|
70
|
+
repeated imageMeta imagesMeta = 2;
|
|
71
|
+
string background = 3;
|
|
72
|
+
string mergeFormat = 4;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message docToPDFParams {
|
|
76
|
+
string base64 = 1;
|
|
77
|
+
string to = 2;
|
|
78
|
+
string ext = 3;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message shpToGeojsonParams {
|
|
82
|
+
string base64 = 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message geojsonToShpParams {
|
|
86
|
+
string geojson = 1;
|
|
87
|
+
string proj = 2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message xmlToJsonParams {
|
|
91
|
+
string xml = 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message jsonToXlsParams {
|
|
95
|
+
string json = 1;
|
|
96
|
+
string header = 2;
|
|
97
|
+
string subheader = 3;
|
|
98
|
+
string colmodel = 4;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message csvToXlsParams {
|
|
102
|
+
string csv = 1;
|
|
103
|
+
string header = 2;
|
|
104
|
+
string subheader = 3;
|
|
105
|
+
string separator = 4;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message excelToJsonParams {
|
|
109
|
+
string base64 = 1;
|
|
110
|
+
string type = 2;
|
|
111
|
+
string delimiter = 3;
|
|
112
|
+
string encoding = 4;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message htmlToPdfParams {
|
|
116
|
+
string html = 1;
|
|
117
|
+
string pdfPageConfig = 2;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message pdfMergeParams {
|
|
121
|
+
repeated string mergeFiles = 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
message htmlToImageParams {
|
|
125
|
+
string html = 1;
|
|
126
|
+
string format = 2;
|
|
127
|
+
uint64 width = 3;
|
|
128
|
+
uint64 height = 4;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
message htmlToDocParams {
|
|
132
|
+
string html = 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
message FileBase64 {
|
|
136
|
+
string result = 1;
|
|
137
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
service OfficeConverterService {
|
|
4
|
+
rpc OfficeToPdf(OfficeToPdfRequest) returns (OfficeToPdfResponse) {}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
message OfficeToPdfRequest {
|
|
8
|
+
string file = 1;
|
|
9
|
+
string ext = 2;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message OfficeToPdfResponse {
|
|
13
|
+
string file = 1;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import hookList from './hookList.js';
|
|
2
|
+
export default async function applyHook(name, data) {
|
|
3
|
+
if (!hookList[name]?.length)
|
|
4
|
+
return null;
|
|
5
|
+
const result = {};
|
|
6
|
+
await Promise.all(hookList[name].map(async (hook) => {
|
|
7
|
+
const hookData = await hook({ ...data });
|
|
8
|
+
if (hookData) {
|
|
9
|
+
Object.assign(result, hookData);
|
|
10
|
+
}
|
|
11
|
+
})).catch((err) => {
|
|
12
|
+
console.error("applyHook", name, err.toString());
|
|
13
|
+
});
|
|
14
|
+
if (Object.keys(result).length) {
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import config from "../../../../config.js";
|
|
3
|
+
import hookList from "../hookList.js";
|
|
4
|
+
export default async function applyHook(name, data) {
|
|
5
|
+
const { trace } = config;
|
|
6
|
+
if (trace)
|
|
7
|
+
console.log("applyHook", name);
|
|
8
|
+
if (!hookList[name]?.length)
|
|
9
|
+
return null;
|
|
10
|
+
const result = {};
|
|
11
|
+
await Promise.all(hookList[name].map(async (hook) => {
|
|
12
|
+
const hookData = await hook({ ...data, config });
|
|
13
|
+
if (hookData) {
|
|
14
|
+
if (trace)
|
|
15
|
+
console.log("applyHook", name, hookData);
|
|
16
|
+
Object.assign(result, hookData);
|
|
17
|
+
}
|
|
18
|
+
})).catch((err) => {
|
|
19
|
+
console.error("applyHook", name, err.toString());
|
|
20
|
+
});
|
|
21
|
+
if (Object.keys(result).length) {
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (!hookList[name]?.length)
|
|
7
|
-
return null;
|
|
8
|
-
const result = {};
|
|
9
|
-
await Promise.all(hookList[name].map(async (hook) => {
|
|
10
|
-
const hookData = await hook({ ...data, config });
|
|
11
|
-
if (hookData) {
|
|
12
|
-
if (config.trace)
|
|
13
|
-
console.log("applyHook", name, hookData);
|
|
14
|
-
Object.assign(result, hookData);
|
|
15
|
-
}
|
|
16
|
-
})).catch((err) => {
|
|
17
|
-
console.error("applyHook", name, err.toString());
|
|
18
|
-
});
|
|
19
|
-
if (Object.keys(result).length) {
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
export function addHook(name, fn) {
|
|
25
|
-
if (!hookList[name]) {
|
|
26
|
-
hookList[name] = [];
|
|
27
|
-
}
|
|
28
|
-
if (config.trace)
|
|
29
|
-
console.log("addHook", name);
|
|
30
|
-
hookList[name].push(fn);
|
|
31
|
-
}
|
|
32
|
-
export function applyHookSync(name, data) {
|
|
33
|
-
if (!hookList[name]?.length)
|
|
34
|
-
return null;
|
|
35
|
-
if (config.trace)
|
|
36
|
-
console.log("applyHookSync", name);
|
|
37
|
-
const hookData = hookList[name].map((hook) => hook(data))[0];
|
|
38
|
-
return hookData;
|
|
1
|
+
// import addHook from './funcs/addHook.js';
|
|
2
|
+
// import applyHook from './funcs/applyHook.js';
|
|
3
|
+
async function plugin() {
|
|
4
|
+
// fastify.decorate('addHook', addHook);
|
|
5
|
+
// fastify.decorate('applyHook', applyHook);
|
|
39
6
|
}
|
|
7
|
+
export default plugin;
|
|
@@ -22,10 +22,10 @@ async function getHeadersPG(req) {
|
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
const client = await getPGAsync({ ...(config.pg || {}), name: "client" });
|
|
25
|
+
function plugin(fastify) {
|
|
27
26
|
fastify.addHook("onRequest", async (req) => {
|
|
28
27
|
const headersPG = await getHeadersPG(req);
|
|
28
|
+
const client = await getPGAsync({ ...(config.pg || {}), name: "client" });
|
|
29
29
|
req.pg = headersPG || req.pg || client || pgClients.client;
|
|
30
30
|
if (headersPG) {
|
|
31
31
|
req.user = { uid: req.headers?.uid };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import applyHookSync from "../../../../hook/applyHookSync.js";
|
|
2
2
|
import getRangeQuery from "./getRangeQuery.js";
|
|
3
3
|
export default function formatValue({ pg, table, filter = {}, name, value, dataTypeID, uid = 1, optimize, }) {
|
|
4
4
|
const { extra, sql, select, strict, options /* default: defaultValue, */ } = filter;
|
package/dist/utils.js
CHANGED
|
@@ -52,7 +52,8 @@ export { default as validateData } from "./server/plugins/crud/funcs/validateDat
|
|
|
52
52
|
// policy
|
|
53
53
|
export { default as checkXSS } from "./server/plugins/policy/funcs/checkXSS.js";
|
|
54
54
|
// hook
|
|
55
|
-
export
|
|
55
|
+
export { default as addHook } from "./server/plugins/hook/addHook.js";
|
|
56
|
+
export { default as applyHook } from "./server/plugins/hook/applyHook.js";
|
|
56
57
|
export { default as execMigrations } from "./server/plugins/migration/exec.migrations.js";
|
|
57
58
|
export { default as execSql } from "./server/plugins/migration/exec.sql.js";
|
|
58
59
|
// cron
|
package/package.json
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
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
|
-
"prepublishOnly": "npm run build",
|
|
25
|
-
"clean": "tsc -b --clean",
|
|
26
|
-
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist && copyfiles server/migrations/*.sql dist && copyfiles server/templates/**/*.html dist",
|
|
27
|
-
"prod": "NODE_ENV=production bun dist/server",
|
|
28
|
-
"patch": "npm version patch && git push && npm publish",
|
|
29
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
30
|
-
"test": "bun test",
|
|
31
|
-
"compress": "node compress.js",
|
|
32
|
-
"dev1": "bun --hot dist/server",
|
|
33
|
-
"dev": "NODE_ENV=production bun start",
|
|
34
|
-
"start": "bun server"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"@aws-sdk/client-s3": "3.879.0",
|
|
38
|
-
"@aws-sdk/lib-storage": "3.879.0",
|
|
39
|
-
"@fastify/cookie": "11.0.2",
|
|
40
|
-
"@fastify/http-proxy": "11.1.2",
|
|
41
|
-
"@fastify/multipart": "9.0.3",
|
|
42
|
-
"@fastify/passport": "3.0.2",
|
|
43
|
-
"@fastify/rate-limit": "10.3.0",
|
|
44
|
-
"@fastify/session": "11.1.0",
|
|
45
|
-
"@grpc/grpc-js": "1.10.11",
|
|
46
|
-
"@grpc/proto-loader": "0.7.15",
|
|
47
|
-
"apache-crypt": "1.2.6",
|
|
48
|
-
"better-sqlite3": "12.2.0",
|
|
49
|
-
"dotenv": "16.5.0",
|
|
50
|
-
"fastify": "5.3.3",
|
|
51
|
-
"fastify-plugin": "5.0.1",
|
|
52
|
-
"fastify-session-redis-store": "7.1.2",
|
|
53
|
-
"handlebars": "4.7.8",
|
|
54
|
-
"image-size": "1.2.0",
|
|
55
|
-
"ioredis": "5.3.2",
|
|
56
|
-
"js-yaml": "4.1.0",
|
|
57
|
-
"markdown-it": "14.1.0",
|
|
58
|
-
"nodemailer": "7.0.6",
|
|
59
|
-
"otplib": "12.0.1",
|
|
60
|
-
"pg": "8.11.6",
|
|
61
|
-
"pino": "9.5.0",
|
|
62
|
-
"pino-abstract-transport": "2.0.0",
|
|
63
|
-
"promised-handlebars": "2.0.1",
|
|
64
|
-
"qrcode": "1.5.4",
|
|
65
|
-
"uglify-js": "3.19.3",
|
|
66
|
-
"undici": "7.16.0"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
70
|
-
"@types/bun": "^1.2.21",
|
|
71
|
-
"@types/js-yaml": "^4.0.9",
|
|
72
|
-
"@types/markdown-it": "^14.1.2",
|
|
73
|
-
"@types/node": "^24.3.1",
|
|
74
|
-
"@types/nodemailer": "^7.0.1",
|
|
75
|
-
"@types/passport": "^1.0.17",
|
|
76
|
-
"@types/passport-local": "^1.0.38",
|
|
77
|
-
"@types/pg": "^8.15.5",
|
|
78
|
-
"@types/qrcode": "^1.5.5",
|
|
79
|
-
"copyfiles": "^2.4.1",
|
|
80
|
-
"eslint": "^9.35.0",
|
|
81
|
-
"eslint-config-airbnb-extended": "^2.3.1",
|
|
82
|
-
"ts-migrate": "^0.1.35",
|
|
83
|
-
"typescript": "^5.9.2",
|
|
84
|
-
"vitest": "^3.2.4"
|
|
85
|
-
},
|
|
86
|
-
"author": "Softpro",
|
|
87
|
-
"license": "ISC"
|
|
88
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/fastify-table",
|
|
3
|
+
"version": "2.0.9",
|
|
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
|
+
"prepublishOnly": "npm run build",
|
|
25
|
+
"clean": "tsc -b --clean",
|
|
26
|
+
"build": "tsc -b --clean && tsc && copyfiles server/plugins/grpc/utils/*.proto dist && copyfiles server/migrations/*.sql dist && copyfiles server/templates/**/*.html dist",
|
|
27
|
+
"prod": "NODE_ENV=production bun dist/server",
|
|
28
|
+
"patch": "npm version patch && git push && npm publish",
|
|
29
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
30
|
+
"test": "bun test",
|
|
31
|
+
"compress": "node compress.js",
|
|
32
|
+
"dev1": "bun --hot dist/server",
|
|
33
|
+
"dev": "NODE_ENV=production bun start",
|
|
34
|
+
"start": "bun server"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@aws-sdk/client-s3": "3.879.0",
|
|
38
|
+
"@aws-sdk/lib-storage": "3.879.0",
|
|
39
|
+
"@fastify/cookie": "11.0.2",
|
|
40
|
+
"@fastify/http-proxy": "11.1.2",
|
|
41
|
+
"@fastify/multipart": "9.0.3",
|
|
42
|
+
"@fastify/passport": "3.0.2",
|
|
43
|
+
"@fastify/rate-limit": "10.3.0",
|
|
44
|
+
"@fastify/session": "11.1.0",
|
|
45
|
+
"@grpc/grpc-js": "1.10.11",
|
|
46
|
+
"@grpc/proto-loader": "0.7.15",
|
|
47
|
+
"apache-crypt": "1.2.6",
|
|
48
|
+
"better-sqlite3": "12.2.0",
|
|
49
|
+
"dotenv": "16.5.0",
|
|
50
|
+
"fastify": "5.3.3",
|
|
51
|
+
"fastify-plugin": "5.0.1",
|
|
52
|
+
"fastify-session-redis-store": "7.1.2",
|
|
53
|
+
"handlebars": "4.7.8",
|
|
54
|
+
"image-size": "1.2.0",
|
|
55
|
+
"ioredis": "5.3.2",
|
|
56
|
+
"js-yaml": "4.1.0",
|
|
57
|
+
"markdown-it": "14.1.0",
|
|
58
|
+
"nodemailer": "7.0.6",
|
|
59
|
+
"otplib": "12.0.1",
|
|
60
|
+
"pg": "8.11.6",
|
|
61
|
+
"pino": "9.5.0",
|
|
62
|
+
"pino-abstract-transport": "2.0.0",
|
|
63
|
+
"promised-handlebars": "2.0.1",
|
|
64
|
+
"qrcode": "1.5.4",
|
|
65
|
+
"uglify-js": "3.19.3",
|
|
66
|
+
"undici": "7.16.0"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
70
|
+
"@types/bun": "^1.2.21",
|
|
71
|
+
"@types/js-yaml": "^4.0.9",
|
|
72
|
+
"@types/markdown-it": "^14.1.2",
|
|
73
|
+
"@types/node": "^24.3.1",
|
|
74
|
+
"@types/nodemailer": "^7.0.1",
|
|
75
|
+
"@types/passport": "^1.0.17",
|
|
76
|
+
"@types/passport-local": "^1.0.38",
|
|
77
|
+
"@types/pg": "^8.15.5",
|
|
78
|
+
"@types/qrcode": "^1.5.5",
|
|
79
|
+
"copyfiles": "^2.4.1",
|
|
80
|
+
"eslint": "^9.35.0",
|
|
81
|
+
"eslint-config-airbnb-extended": "^2.3.1",
|
|
82
|
+
"ts-migrate": "^0.1.35",
|
|
83
|
+
"typescript": "^5.9.2",
|
|
84
|
+
"vitest": "^3.2.4"
|
|
85
|
+
},
|
|
86
|
+
"author": "Softpro",
|
|
87
|
+
"license": "ISC"
|
|
88
|
+
}
|