@opengis/fastify-table 1.4.69 → 1.4.71
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/package.json +61 -61
- package/server/helpers/core/token.js +18 -18
- package/server/plugins/cron/funcs/addCron.js +52 -52
- package/server/plugins/crud/funcs/getOpt.js +14 -14
- package/server/plugins/crud/funcs/utils/getFolder.js +11 -11
- package/server/plugins/logger/errorStatus.js +19 -19
- package/server/plugins/migration/exec.migrations.js +1 -1
- package/server/plugins/pg/funcs/autoIndex.js +5 -5
- package/server/plugins/redis/client.js +8 -8
- package/server/plugins/redis/funcs/redisClients.js +3 -3
- package/server/plugins/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
- package/server/plugins/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
- package/server/plugins/table/funcs/getTemplates.js +19 -19
- package/server/plugins/table/funcs/gisIRColumn.js +82 -82
- package/server/plugins/table/funcs/loadTemplate.js +1 -1
- package/server/plugins/table/funcs/loadTemplatePath.js +1 -1
- package/server/plugins/table/funcs/userTemplateDir.js +1 -1
- package/server/routes/table/controllers/getFormByTable.js +14 -10
- package/server/routes/table/controllers/search.js +74 -74
- package/server/routes/table/controllers/tableData.js +3 -1
- package/server/routes/table/functions/getData.js +3 -2
- package/server/routes/widget/controllers/widget.del.js +89 -89
- package/server/routes/widget/hook/onWidgetSet.js +13 -13
- package/server/routes/widget/index.mjs +38 -38
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import addHook from '../../plugins/hook/funcs/addHook.js';
|
|
2
|
-
|
|
3
|
-
import widgetDel from './controllers/widget.del.js';
|
|
4
|
-
import widgetSet from './controllers/widget.set.js';
|
|
5
|
-
import widgetGet from './controllers/widget.get.js';
|
|
6
|
-
import fileEdit from './controllers/file.edit.js';
|
|
7
|
-
|
|
8
|
-
import onWidgetSet from './hook/onWidgetSet.js';
|
|
9
|
-
|
|
10
|
-
const tableSchema = {
|
|
11
|
-
params: {
|
|
12
|
-
type: 'object',
|
|
13
|
-
properties: {
|
|
14
|
-
// type: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
15
|
-
objectid: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
16
|
-
id: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
querystring: {
|
|
20
|
-
type: 'object',
|
|
21
|
-
properties: {
|
|
22
|
-
debug: { type: 'string', pattern: '^(\\d+)$' },
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
addHook('onWidgetSet', onWidgetSet);
|
|
28
|
-
|
|
29
|
-
const policy = ['site'];
|
|
30
|
-
const params = { config: { policy }, schema: tableSchema };
|
|
31
|
-
|
|
32
|
-
export default async function route(app, config = {}) {
|
|
33
|
-
const { prefix = '/api' } = config;
|
|
34
|
-
app.delete(`${prefix}/widget/:type/:objectid/:id`, params, widgetDel);
|
|
35
|
-
app.post(`${prefix}/widget/:type/:objectid/:id?`, params, widgetSet);
|
|
36
|
-
app.put(`${prefix}/file-edit/:id`, params, fileEdit);
|
|
37
|
-
app.get(`${prefix}/widget/:type/:objectid`, { config: { policy: ['public'] }, schema: tableSchema }, widgetGet);
|
|
38
|
-
}
|
|
1
|
+
import addHook from '../../plugins/hook/funcs/addHook.js';
|
|
2
|
+
|
|
3
|
+
import widgetDel from './controllers/widget.del.js';
|
|
4
|
+
import widgetSet from './controllers/widget.set.js';
|
|
5
|
+
import widgetGet from './controllers/widget.get.js';
|
|
6
|
+
import fileEdit from './controllers/file.edit.js';
|
|
7
|
+
|
|
8
|
+
import onWidgetSet from './hook/onWidgetSet.js';
|
|
9
|
+
|
|
10
|
+
const tableSchema = {
|
|
11
|
+
params: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
// type: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
15
|
+
objectid: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
16
|
+
id: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
querystring: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
debug: { type: 'string', pattern: '^(\\d+)$' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
addHook('onWidgetSet', onWidgetSet);
|
|
28
|
+
|
|
29
|
+
const policy = ['site'];
|
|
30
|
+
const params = { config: { policy }, schema: tableSchema };
|
|
31
|
+
|
|
32
|
+
export default async function route(app, config = {}) {
|
|
33
|
+
const { prefix = '/api' } = config;
|
|
34
|
+
app.delete(`${prefix}/widget/:type/:objectid/:id`, params, widgetDel);
|
|
35
|
+
app.post(`${prefix}/widget/:type/:objectid/:id?`, params, widgetSet);
|
|
36
|
+
app.put(`${prefix}/file-edit/:id`, params, fileEdit);
|
|
37
|
+
app.get(`${prefix}/widget/:type/:objectid`, { config: { policy: ['public'] }, schema: tableSchema }, widgetGet);
|
|
38
|
+
}
|