@opengis/fastify-table 1.0.31 → 1.0.32
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/.eslintrc.cjs +42 -42
- package/Changelog.md +101 -101
- package/README.md +26 -26
- package/config.js +11 -11
- package/crud/controllers/deleteCrud.js +14 -14
- package/crud/controllers/insert.js +29 -29
- package/crud/controllers/update.js +31 -31
- package/crud/controllers/utils/checkXSS.js +45 -45
- package/crud/controllers/utils/xssInjection.js +72 -72
- package/crud/funcs/dataDelete.js +15 -15
- package/crud/funcs/dataInsert.js +24 -24
- package/crud/funcs/dataUpdate.js +24 -24
- package/crud/funcs/getOpt.js +10 -10
- package/crud/funcs/getToken.js +27 -27
- package/crud/funcs/isFileExists.js +13 -13
- package/crud/funcs/setOpt.js +16 -16
- package/crud/funcs/setToken.js +53 -53
- package/crud/index.js +29 -29
- package/helper.js +28 -28
- package/index.js +39 -41
- package/notification/controllers/userNotifications.js +19 -19
- package/notification/funcs/addNotification.js +8 -8
- package/notification/index.js +19 -19
- package/package.json +22 -22
- package/pg/funcs/getPG.js +29 -29
- package/pg/index.js +1 -1
- package/pg/pgClients.js +20 -20
- package/policy/funcs/checkPolicy.js +74 -74
- package/policy/funcs/sqlInjection.js +33 -33
- package/policy/index.js +14 -14
- package/redis/client.js +8 -8
- package/redis/funcs/getRedis.js +23 -23
- package/redis/funcs/redisClients.js +2 -2
- package/redis/index.js +19 -19
- package/server/migrations/crm.sql +95 -79
- package/server/migrations/log.sql +41 -41
- package/server/templates/form/test.dataset.form.json +411 -411
- package/server/templates/select/test.storage.data.json +2 -2
- package/server/templates/table/test.dataset.table.json +24 -24
- package/server.js +14 -14
- package/table/controllers/data.js +57 -57
- package/table/controllers/filter.js +32 -32
- package/table/controllers/form.js +10 -10
- package/table/controllers/search.js +41 -41
- package/table/controllers/suggest.js +60 -60
- package/table/controllers/utils/getSelect.js +20 -20
- package/table/controllers/utils/getSelectMeta.js +66 -66
- package/table/controllers/utils/getTemplate.js +28 -28
- package/table/funcs/getFilterSQL/index.js +75 -75
- package/table/funcs/getFilterSQL/util/formatValue.js +142 -142
- package/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
- package/table/funcs/getFilterSQL/util/getFilterQuery.js +73 -73
- package/table/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -12
- package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
- package/table/funcs/metaFormat/getSelectVal.js +20 -20
- package/table/funcs/metaFormat/index.js +26 -26
- package/table/index.js +42 -42
- package/test/api/crud.test.js +56 -56
- package/test/api/crud.xss.test.js +71 -71
- package/test/api/notification.test.js +37 -37
- package/test/api/table.test.js +57 -57
- package/test/api/widget.test.js +114 -114
- package/test/config.example +18 -18
- package/test/funcs/crud.test.js +76 -76
- package/test/funcs/notification.test.js +31 -31
- package/test/funcs/pg.test.js +34 -34
- package/test/funcs/redis.test.js +19 -19
- package/test/templates/cls/test.json +9 -9
- package/test/templates/form/cp_building.form.json +32 -32
- package/test/templates/select/account_id.json +3 -3
- package/test/templates/select/storage.data.json +2 -2
- package/test/templates/table/gis.dataset.table.json +20 -20
- package/widget/controllers/utils/historyFormat.js +76 -76
- package/widget/controllers/utils/obj2db.js +13 -13
- package/widget/controllers/widget.del.js +41 -41
- package/widget/controllers/widget.get.js +77 -77
- package/widget/controllers/widget.set.js +64 -64
- package/widget/index.js +29 -29
- package/dblist/controllers/createItem.js +0 -32
- package/dblist/controllers/deleteItem.js +0 -14
- package/dblist/controllers/readItems.js +0 -10
- package/dblist/controllers/setItem.js +0 -21
- package/dblist/controllers/updateItem.js +0 -25
- package/dblist/controllers/utils/checkItem.js +0 -24
- package/dblist/controllers/utils/formatData.js +0 -7
- package/dblist/index.js +0 -49
- package/test/api/dblist.test.js +0 -59
package/test/api/dblist.test.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { test } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
|
|
4
|
-
import build from '../../helper.js';
|
|
5
|
-
import config from '../config.js';
|
|
6
|
-
|
|
7
|
-
const prefix = config.prefix || '/api';
|
|
8
|
-
|
|
9
|
-
test('api dblist', async (t) => {
|
|
10
|
-
const app = await build(t);
|
|
11
|
-
await t.test('GET /list', async () => {
|
|
12
|
-
const res = await app.inject({
|
|
13
|
-
method: 'GET',
|
|
14
|
-
url: `${prefix}/list`,
|
|
15
|
-
});
|
|
16
|
-
const rep = JSON.parse(res?.body);
|
|
17
|
-
assert.ok(rep.data);
|
|
18
|
-
});
|
|
19
|
-
let id;
|
|
20
|
-
await t.test('POST /list', async () => {
|
|
21
|
-
const res = await app.inject({
|
|
22
|
-
method: 'POST',
|
|
23
|
-
url: `${prefix}/list`,
|
|
24
|
-
body: {
|
|
25
|
-
key: 'testDB', name: 'testTitle', host: '192.168.3.160', database: 'mbk_kr_prod', port: 5432,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
const rep = JSON.parse(res?.body);
|
|
29
|
-
id = rep.data?.find((el) => el.key === 'testDB')?.id;
|
|
30
|
-
assert.ok(id);
|
|
31
|
-
});
|
|
32
|
-
await t.test('PUT /list/:id', async () => {
|
|
33
|
-
const res = await app.inject({
|
|
34
|
-
method: 'PUT',
|
|
35
|
-
url: `${prefix}/list/${id}`,
|
|
36
|
-
body: {
|
|
37
|
-
key: 'testDB1', name: 'testTitle1', host: '192.168.3.160', database: 'mbk_kr_prod', port: 5434,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
const rep = JSON.parse(res?.body);
|
|
41
|
-
assert.ok(rep.data);
|
|
42
|
-
});
|
|
43
|
-
await t.test('SET /list/:id', async () => {
|
|
44
|
-
const res = await app.inject({
|
|
45
|
-
method: 'GET',
|
|
46
|
-
url: `${prefix}/list/${id}`,
|
|
47
|
-
});
|
|
48
|
-
const rep = JSON.parse(res?.body);
|
|
49
|
-
assert.ok(rep.current);
|
|
50
|
-
});
|
|
51
|
-
await t.test('DELETE /list/:id', async () => {
|
|
52
|
-
const res = await app.inject({
|
|
53
|
-
method: 'DELETE',
|
|
54
|
-
url: `${prefix}/list/${id}`,
|
|
55
|
-
});
|
|
56
|
-
const rep = JSON.parse(res?.body);
|
|
57
|
-
assert.ok(rep.data);
|
|
58
|
-
});
|
|
59
|
-
});
|