@opengis/fastify-table 2.0.163 → 2.1.1
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/server/plugins/access/funcs/getUserPermissions.d.ts +2 -1
- package/dist/server/plugins/access/funcs/getUserPermissions.d.ts.map +1 -1
- package/dist/server/plugins/access/funcs/getUserPermissions.js +4 -1
- package/dist/server/plugins/crud/funcs/getAccess.d.ts.map +1 -1
- package/dist/server/plugins/crud/funcs/getAccess.js +4 -2
- package/dist/server/plugins/file/providers/fs.d.ts +1 -1
- package/dist/server/plugins/logger/getLogger.d.ts +2 -2
- package/dist/server/plugins/logger/getLogger.d.ts.map +1 -1
- package/dist/server/plugins/logger/getLogger.js +6 -2
- package/dist/server/plugins/logger/serializers.js +6 -6
- package/dist/server/plugins/policy/funcs/checkPermissions.d.ts.map +1 -1
- package/dist/server/plugins/policy/funcs/checkPermissions.js +1 -1
- package/dist/server/routes/auth/controllers/2factor/providers/totp.d.ts.map +1 -1
- package/dist/server/routes/auth/controllers/2factor/providers/totp.js +7 -2
- package/dist/server/routes/auth/controllers/core/getUserInfo.d.ts.map +1 -1
- package/dist/server/routes/auth/controllers/core/getUserInfo.js +2 -1
- package/dist/server/routes/auth/controllers/euSign/authByData.js +1 -1
- package/dist/server/routes/table/functions/getData.d.ts +2 -1
- package/dist/server/routes/table/functions/getData.d.ts.map +1 -1
- package/dist/server/routes/table/functions/getData.js +2 -1
- package/package.json +27 -27
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export default function getUserPermissions({ uid, resource }: {
|
|
1
|
+
export default function getUserPermissions({ uid, resource, userType, }: {
|
|
2
2
|
uid?: string;
|
|
3
3
|
resource?: string;
|
|
4
|
+
userType?: string;
|
|
4
5
|
}, pg?: any): Promise<any>;
|
|
5
6
|
//# sourceMappingURL=getUserPermissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserPermissions.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/access/funcs/getUserPermissions.ts"],"names":[],"mappings":"AAYA,wBAA8B,kBAAkB,CAC9C,
|
|
1
|
+
{"version":3,"file":"getUserPermissions.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/access/funcs/getUserPermissions.ts"],"names":[],"mappings":"AAYA,wBAA8B,kBAAkB,CAC9C,EACE,GAAG,EACH,QAAQ,EACR,QAAQ,GACT,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EACzD,EAAE,MAAmB,gBAsCtB"}
|
|
@@ -7,9 +7,12 @@ from admin.role_access a
|
|
|
7
7
|
left join admin.roles b on a.role_id=b.role_id and b.enabled
|
|
8
8
|
left join admin.user_roles c on a.role_id=c.role_id
|
|
9
9
|
where resource_id is not null and $1 in (a.user_uid, c.user_uid)`;
|
|
10
|
-
export default async function getUserPermissions({ uid, resource }, pg = pgClients.client) {
|
|
10
|
+
export default async function getUserPermissions({ uid, resource, userType, }, pg = pgClients.client) {
|
|
11
11
|
if (!uid)
|
|
12
12
|
return [];
|
|
13
|
+
if (userType === "admin") {
|
|
14
|
+
return resourcesList;
|
|
15
|
+
}
|
|
13
16
|
// ? in case pg.pk not set yet
|
|
14
17
|
const pks = await pg
|
|
15
18
|
.query(`SELECT json_object_agg(conrelid::regclass, (SELECT attname FROM pg_attribute WHERE attrelid = c.conrelid AND attnum = c.conkey[1]) )
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccess.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/crud/funcs/getAccess.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;GASG;AAEH,wBAA8B,SAAS,CACrC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAS,EAAE,MAAc,EAAE,EAAE,GAAG,EACzD,EAAE,MAAmB,
|
|
1
|
+
{"version":3,"file":"getAccess.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/crud/funcs/getAccess.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;GASG;AAEH,wBAA8B,SAAS,CACrC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAS,EAAE,MAAc,EAAE,EAAE,GAAG,EACzD,EAAE,MAAmB,sBA8GtB"}
|
|
@@ -55,8 +55,10 @@ export default async function getAccess({ resource, table, form, user = {}, meth
|
|
|
55
55
|
return { actions: ["view"], query: "1=1" };
|
|
56
56
|
}
|
|
57
57
|
if (resource) {
|
|
58
|
-
const permissions = await getUserPermissions({ resource, uid }, pg);
|
|
59
|
-
const actions = (permissions || [])
|
|
58
|
+
const permissions = await getUserPermissions({ resource, uid, userType }, pg);
|
|
59
|
+
const actions = (permissions || [])
|
|
60
|
+
.flatMap((el) => el.actions.map((e) => matches[e] || e))
|
|
61
|
+
.filter((el, idx, arr) => arr.indexOf(el) === idx);
|
|
60
62
|
return {
|
|
61
63
|
scope: permissions?.scope,
|
|
62
64
|
actions,
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import { type FastifyRequest } from "fastify";
|
|
2
|
-
import {
|
|
3
|
-
interface ExtendedLogger extends
|
|
2
|
+
import { Logger } from "pino";
|
|
3
|
+
interface ExtendedLogger extends Logger {
|
|
4
4
|
file: (logfolder: string, msg: any, req?: FastifyRequest) => void;
|
|
5
5
|
metrics: (key: string, val?: any, dbName?: string) => void;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLogger.d.ts","sourceRoot":"","sources":["../../../../server/plugins/logger/getLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,
|
|
1
|
+
{"version":3,"file":"getLogger.d.ts","sourceRoot":"","sources":["../../../../server/plugins/logger/getLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAa,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,UAAU,cAAe,SAAQ,MAAM;IACrC,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAClE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5D;AAmDD,QAAA,MAAM,MAAM,EAAE,cAAgD,CAAC;AAqC/D,eAAe,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import pino from "pino";
|
|
2
2
|
import config from "../../../config.js";
|
|
3
3
|
import redactionList from "../../../redactionList.js";
|
|
4
4
|
import getRedis from "../redis/funcs/getRedis.js";
|
|
@@ -42,7 +42,11 @@ const options = {
|
|
|
42
42
|
};
|
|
43
43
|
const logger = pino(options);
|
|
44
44
|
logger.file = function userFile(logfolder, msg, req) {
|
|
45
|
-
logger.info({
|
|
45
|
+
logger.info({
|
|
46
|
+
logfolder,
|
|
47
|
+
...(typeof msg === "string" ? { msg } : msg),
|
|
48
|
+
req,
|
|
49
|
+
});
|
|
46
50
|
};
|
|
47
51
|
if (config.debug) {
|
|
48
52
|
logger.file("test/redaction", {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const serializers = {
|
|
2
2
|
req(request) {
|
|
3
|
-
const { method, url,
|
|
3
|
+
const { method, url, headers, params, query, body, session } = request;
|
|
4
4
|
const { uid = undefined, user_name: userName = undefined } = session?.passport?.user || {};
|
|
5
5
|
return {
|
|
6
6
|
method,
|
|
7
7
|
url,
|
|
8
|
-
referer,
|
|
9
|
-
ip: request.headers?.[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
referer: headers?.referer,
|
|
9
|
+
ip: request.headers?.["x-real-ip"] ||
|
|
10
|
+
request.headers?.["x-forwarded-for"] ||
|
|
11
|
+
request.ip ||
|
|
12
|
+
request.connection?.remoteAddress,
|
|
13
13
|
uid,
|
|
14
14
|
dbName: request.pg?.options?.database,
|
|
15
15
|
user_name: userName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkPermissions.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/policy/funcs/checkPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAMhC,wBAA8B,gBAAgB,CAC5C,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"checkPermissions.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/policy/funcs/checkPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAMhC,wBAA8B,gBAAgB,CAC5C,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,YAAY,iBAkEpB"}
|
|
@@ -16,7 +16,7 @@ export default async function checkPermissions(req, reply) {
|
|
|
16
16
|
if (!permissions?.length) {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
const userPermissions = await getUserPermissions({ uid: user?.uid }, pg).then((arr) => arr.reduce((acc, curr) => ({ ...acc, [curr.name]: curr.actions }), {}));
|
|
19
|
+
const userPermissions = await getUserPermissions({ uid: user?.uid, userType: user?.user_type }, pg).then((arr) => arr.reduce((acc, curr) => ({ ...acc, [curr.name]: curr.actions }), {}));
|
|
20
20
|
const havePermission = Object.keys(userPermissions).length &&
|
|
21
21
|
permissions?.length &&
|
|
22
22
|
permissions.length ===
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"totp.d.ts","sourceRoot":"","sources":["../../../../../../../server/routes/auth/controllers/2factor/providers/totp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAU1D,UAAU,OAAO;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,UAAU,CAAC;CAChB;AAED,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"totp.d.ts","sourceRoot":"","sources":["../../../../../../../server/routes/auth/controllers/2factor/providers/totp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAU1D,UAAU,OAAO;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,UAAU,CAAC;CAChB;AAED,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAuBD,QAAA,MAAM,YAAY,GAAU,aAAa,OAAO,kBAK/C,CAAC;AAEF,QAAA,MAAM,YAAY,GAAU,aAAa,OAAO,kBAK/C,CAAC;AAEF,QAAA,MAAM,SAAS,GAAU,aAAa,OAAO;;;;EAc5C,CAAC;AAuBF,QAAA,MAAM,QAAQ,GAAU,aAAa,OAAO;;;;;;;;;;;;EA0D3C,CAAC;AAEF,QAAA,MAAM,MAAM,GAAU,0BAA0B,KAAK;;;EAiBpD,CAAC;AAKF,QAAA,MAAM,MAAM,GAAU,2BAA2B,KAAK,iBAqBrD,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;;AAE3E,wBAAoB"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import qrcode from "qrcode";
|
|
3
|
-
import
|
|
3
|
+
import * as authenticator from "otplib";
|
|
4
4
|
import config from "../../../../../../config.js";
|
|
5
5
|
const TYPE = "TOTP";
|
|
6
|
-
|
|
6
|
+
// equivalent to otplib@12.0.1 authenticator.keyuri(id,prefix,secret)
|
|
7
|
+
// "otpauth://totp/SOFTPRO:777?secret=secret&period=30&digits=6&algorithm=SHA1&issuer=SOFTPRO"
|
|
8
|
+
const getOTP = (id, secret) => {
|
|
9
|
+
const issuer = config.auth?.["2fa"]?.prefix || "SOFTPRO";
|
|
10
|
+
return `otpauth://totp/${issuer}:${encodeURIComponent(id.toString())}?secret=${secret}&period=30&digits=6&algorithm=SHA1&issuer=${encodeURIComponent(issuer)}`;
|
|
11
|
+
};
|
|
7
12
|
const enableSecret = async ({ uid, pg }) => {
|
|
8
13
|
await pg.query("update admin.users_social_auth set enabled=true where uid = $1 and social_auth_type = $2", [uid, TYPE]);
|
|
9
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserInfo.d.ts","sourceRoot":"","sources":["../../../../../../server/routes/auth/controllers/core/getUserInfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getUserInfo.d.ts","sourceRoot":"","sources":["../../../../../../server/routes/auth/controllers/core/getUserInfo.ts"],"names":[],"mappings":"AAoCA,wBAA8B,WAAW,CAAC,GAAG,EAAE,GAAG,eAkFjD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import config from "../../../../../config.js";
|
|
2
|
+
// import logger from "../../../../plugins/logger/getLogger.js";
|
|
2
3
|
import pgClients from "../../../../plugins/pg/pgClients.js";
|
|
3
4
|
import applyHook from "../../../../plugins/hook/applyHook.js";
|
|
4
5
|
import getRedis from "../../../../plugins/redis/funcs/getRedis.js";
|
|
@@ -74,7 +75,7 @@ export default async function getUserInfo(req) {
|
|
|
74
75
|
req.user?.uid
|
|
75
76
|
? await pg.query(q, [user.uid]).then((el) => el.rows || [])
|
|
76
77
|
: [];
|
|
77
|
-
const permissions = await getUserPermissions({ uid: user?.uid }, pg);
|
|
78
|
+
const permissions = await getUserPermissions({ uid: user?.uid, userType: user?.user_type }, pg);
|
|
78
79
|
Object.assign(payload, {
|
|
79
80
|
user: userInfo,
|
|
80
81
|
settings,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastifyReply } from "fastify";
|
|
2
2
|
import type { ExtendedPG } from "../../../types/core.js";
|
|
3
|
-
export default function dataAPI({ pg, params, table, id, headers, query, user, contextQuery, sufix, filterList, actions: actionsParam, accessQuery: accessQueryParam, columns: columnsParam, isExport, }: {
|
|
3
|
+
export default function dataAPI({ pg, params, table, id, headers, query, user, contextQuery, searchColumn, sufix, filterList, actions: actionsParam, accessQuery: accessQueryParam, columns: columnsParam, isExport, }: {
|
|
4
4
|
pg?: ExtendedPG;
|
|
5
5
|
params?: {
|
|
6
6
|
id?: string;
|
|
@@ -13,6 +13,7 @@ export default function dataAPI({ pg, params, table, id, headers, query, user, c
|
|
|
13
13
|
query?: Record<string, any>;
|
|
14
14
|
user?: Record<string, any>;
|
|
15
15
|
contextQuery?: string;
|
|
16
|
+
searchColumn?: string;
|
|
16
17
|
sufix?: boolean;
|
|
17
18
|
filterList?: any[];
|
|
18
19
|
actions?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getData.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/functions/getData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAkFzD,wBAA8B,OAAO,CACnC,EACE,EAAqB,EACrB,MAAM,EACN,KAAK,EACL,EAAE,EACF,OAAY,EACZ,KAAU,EACV,IAAS,EACT,YAAY,EACZ,KAAY,EACZ,UAAU,EACV,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,gBAAgB,EAC7B,OAAO,EAAE,YAAY,EACrB,QAAgB,GACjB,EAAE;IACD,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,MAAM,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,EACD,MAAM,CAAC,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"getData.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/functions/getData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAkFzD,wBAA8B,OAAO,CACnC,EACE,EAAqB,EACrB,MAAM,EACN,KAAK,EACL,EAAE,EACF,OAAY,EACZ,KAAU,EACV,IAAS,EACT,YAAY,EACZ,YAAY,EACZ,KAAY,EACZ,UAAU,EACV,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,gBAAgB,EAC7B,OAAO,EAAE,YAAY,EACrB,QAAgB,GACjB,EAAE;IACD,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,MAAM,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,EACD,MAAM,CAAC,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,GAAG,gBA42Bb"}
|
|
@@ -53,7 +53,7 @@ function getOrder(queryOrder, queryDesc, defaultOrder, columnList, sqlColumns, i
|
|
|
53
53
|
const checkInline = {};
|
|
54
54
|
const maxLimit = 100;
|
|
55
55
|
const defaultLimit = 20;
|
|
56
|
-
export default async function dataAPI({ pg = pgClients.client, params, table, id, headers = {}, query = {}, user = {}, contextQuery, sufix = true, filterList, actions: actionsParam, accessQuery: accessQueryParam, columns: columnsParam, isExport = false, }, reply1, called) {
|
|
56
|
+
export default async function dataAPI({ pg = pgClients.client, params, table, id, headers = {}, query = {}, user = {}, contextQuery, searchColumn, sufix = true, filterList, actions: actionsParam, accessQuery: accessQueryParam, columns: columnsParam, isExport = false, }, reply1, called) {
|
|
57
57
|
const time = Date.now();
|
|
58
58
|
const timeArr = [Date.now()];
|
|
59
59
|
const { uid } = user;
|
|
@@ -263,6 +263,7 @@ export default async function dataAPI({ pg = pgClients.client, params, table, id
|
|
|
263
263
|
table: loadTable ? tokenData?.table || paramsTable : table1,
|
|
264
264
|
filter: query?.filter,
|
|
265
265
|
search: query?.search,
|
|
266
|
+
searchColumn,
|
|
266
267
|
state: query?.state,
|
|
267
268
|
custom: query?.custom,
|
|
268
269
|
uid,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/fastify-table",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "core-plugins",
|
|
6
6
|
"keywords": [
|
|
@@ -39,55 +39,55 @@
|
|
|
39
39
|
"start": "LOG_LEVEL=trace bun server"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@aws-sdk/client-s3": "3.
|
|
43
|
-
"@aws-sdk/lib-storage": "3.
|
|
42
|
+
"@aws-sdk/client-s3": "3.1018.0",
|
|
43
|
+
"@aws-sdk/lib-storage": "3.1018.0",
|
|
44
44
|
"@fastify/cookie": "11.0.2",
|
|
45
|
-
"@fastify/http-proxy": "11.
|
|
46
|
-
"@fastify/multipart": "9.0
|
|
45
|
+
"@fastify/http-proxy": "11.4.3",
|
|
46
|
+
"@fastify/multipart": "9.4.0",
|
|
47
47
|
"@fastify/passport": "3.0.2",
|
|
48
48
|
"@fastify/rate-limit": "10.3.0",
|
|
49
|
-
"@fastify/session": "11.1.
|
|
50
|
-
"@grpc/grpc-js": "1.
|
|
51
|
-
"@grpc/proto-loader": "0.
|
|
49
|
+
"@fastify/session": "11.1.1",
|
|
50
|
+
"@grpc/grpc-js": "1.14.3",
|
|
51
|
+
"@grpc/proto-loader": "0.8.0",
|
|
52
52
|
"apache-crypt": "1.2.6",
|
|
53
53
|
"better-sqlite3": "12.2.0",
|
|
54
|
-
"dotenv": "
|
|
55
|
-
"fastify": "5.
|
|
56
|
-
"fastify-plugin": "5.0
|
|
54
|
+
"dotenv": "17.3.1",
|
|
55
|
+
"fastify": "5.8.4",
|
|
56
|
+
"fastify-plugin": "5.1.0",
|
|
57
57
|
"fastify-session-redis-store": "7.1.2",
|
|
58
|
-
"handlebars": "4.7.
|
|
59
|
-
"image-size": "
|
|
60
|
-
"ioredis": "5.
|
|
61
|
-
"js-yaml": "4.1.
|
|
62
|
-
"markdown-it": "14.1.
|
|
63
|
-
"nodemailer": "
|
|
64
|
-
"otplib": "
|
|
65
|
-
"pg": "8.
|
|
66
|
-
"pino": "
|
|
67
|
-
"pino-abstract-transport": "
|
|
58
|
+
"handlebars": "4.7.9",
|
|
59
|
+
"image-size": "2.0.2",
|
|
60
|
+
"ioredis": "5.10.1",
|
|
61
|
+
"js-yaml": "4.1.1",
|
|
62
|
+
"markdown-it": "14.1.1",
|
|
63
|
+
"nodemailer": "8.0.4",
|
|
64
|
+
"otplib": "13.4.0",
|
|
65
|
+
"pg": "8.20.0",
|
|
66
|
+
"pino": "10.3.1",
|
|
67
|
+
"pino-abstract-transport": "3.0.0",
|
|
68
68
|
"promised-handlebars": "2.0.1",
|
|
69
69
|
"qrcode": "1.5.4",
|
|
70
70
|
"sharp": "0.34.5",
|
|
71
71
|
"uglify-js": "3.19.3",
|
|
72
|
-
"undici": "7.
|
|
72
|
+
"undici": "7.24.6"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/better-sqlite3": "^7.6.13",
|
|
76
76
|
"@types/bun": "^1.3.5",
|
|
77
77
|
"@types/js-yaml": "^4.0.9",
|
|
78
78
|
"@types/markdown-it": "^14.1.2",
|
|
79
|
-
"@types/node": "^24.
|
|
79
|
+
"@types/node": "^24.12.0",
|
|
80
80
|
"@types/nodemailer": "^7.0.1",
|
|
81
81
|
"@types/passport": "^1.0.17",
|
|
82
82
|
"@types/passport-local": "^1.0.38",
|
|
83
83
|
"@types/pg": "^8.15.5",
|
|
84
84
|
"@types/qrcode": "^1.5.5",
|
|
85
85
|
"copyfiles": "^2.4.1",
|
|
86
|
-
"eslint": "^
|
|
87
|
-
"eslint-config-airbnb-extended": "^
|
|
86
|
+
"eslint": "^10.1.0",
|
|
87
|
+
"eslint-config-airbnb-extended": "^3.0.1",
|
|
88
88
|
"ts-migrate": "^0.1.35",
|
|
89
|
-
"typescript": "^
|
|
90
|
-
"vitest": "^
|
|
89
|
+
"typescript": "^6.0.2",
|
|
90
|
+
"vitest": "^4.1.2"
|
|
91
91
|
},
|
|
92
92
|
"author": "Softpro",
|
|
93
93
|
"license": "ISC"
|