@opengis/admin 0.1.67 → 0.1.68
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{IconChevronDown-DN0s3TF_.js → IconChevronDown-Co0qOLyQ.js} +1 -1
- package/dist/{add-page-Cm4aSGoA.js → add-page-Bv-BNhYQ.js} +11 -8
- package/dist/{admin-interface-DUuz9KgB.js → admin-interface-j3f16Iy8.js} +252 -233
- package/dist/{admin-view-MSa57inW.js → admin-view-DykzQo5I.js} +198 -188
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +47 -47
- package/dist/{card-page-B1zuuqAR.js → card-page-DtXydAxe.js} +19 -19
- package/dist/{card-view-Bzt2AvI2.js → card-view-MpG-dhK0.js} +1 -1
- package/dist/{edit-page-DoY4S7v6.js → edit-page-DkD5JFQv.js} +13 -12
- package/dist/{import-file-B80Ws8by.js → import-file-DGI0k9si.js} +16 -18
- package/dist/style.css +1 -1
- package/package.json +4 -5
- package/server/plugins/hook.js +11 -44
- package/server/routes/calendar/index.mjs +2 -12
- package/server/routes/calendar/schema.js +22 -0
- package/server/routes/data/index.mjs +4 -4
- package/server/routes/data/schema.js +49 -2
- package/server/routes/menu/schema.js +0 -0
- package/server/routes/notifications/index.mjs +5 -30
- package/server/routes/notifications/schema.js +11 -0
- package/server/routes/properties/index.mjs +6 -18
- package/server/routes/properties/schema.js +11 -0
- package/server/routes/templates/scheme.js +9 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
const calendarDataSchema = {
|
2
|
+
params: {
|
3
|
+
name: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
|
4
|
+
},
|
5
|
+
querystring: {
|
6
|
+
date: { type: 'string', pattern: '^([\\d\\s\\/,.:-]+)$' },
|
7
|
+
sql: { type: 'string', pattern: '^(\\d)$' },
|
8
|
+
},
|
9
|
+
|
10
|
+
// query: {
|
11
|
+
// type: 'object',
|
12
|
+
// properties: {
|
13
|
+
// date: {
|
14
|
+
// type: 'string',
|
15
|
+
// format: 'date',
|
16
|
+
// },
|
17
|
+
// },
|
18
|
+
// },
|
19
|
+
};
|
20
|
+
|
21
|
+
export { calendarDataSchema }
|
22
|
+
export default null;
|
@@ -5,11 +5,11 @@ import cardData from "./controllers/cardData.js";
|
|
5
5
|
import cardTabData from './controllers/cardTabData.js';
|
6
6
|
import tableFilter from "./controllers/tableFilter.js";
|
7
7
|
|
8
|
-
import { tableDataSchema } from './schema.js';
|
8
|
+
import { tableDataSchema, tableDataIdSchema, tableFilterSchema, cardTabDataSchema } from './schema.js';
|
9
9
|
|
10
10
|
export default async function route(fastify) {
|
11
11
|
fastify.get(`/table-data/:table`, { schema: tableDataSchema }, tableData);
|
12
|
-
fastify.get(`/card-data/:token`, cardTabData);
|
13
|
-
fastify.get(`/table-data/:table/:id`, cardData);
|
14
|
-
fastify.get(`/table-filter/:name`, tableFilter);
|
12
|
+
fastify.get(`/card-data/:token`, { scheme: cardTabDataSchema }, cardTabData);
|
13
|
+
fastify.get(`/table-data/:table/:id`, { schema: tableDataIdSchema }, cardData);
|
14
|
+
fastify.get(`/table-filter/:name`, { schema: tableFilterSchema }, tableFilter);
|
15
15
|
}
|
@@ -1,7 +1,54 @@
|
|
1
1
|
const tableDataSchema = {
|
2
2
|
querystring: {
|
3
|
-
limit: { type: '
|
3
|
+
limit: { type: 'string', pattern: '^(\\d+)$' },
|
4
|
+
page: { type: 'string', pattern: '^(\\d+)$' },
|
5
|
+
filter: { type: 'string', pattern: '^([А-Яа-яҐґЄєІіЇї\\d\\w\\s(),.!?;:—_=-]+)$' },
|
6
|
+
search: { type: 'string', pattern: '^[А-Яа-яҐґЄєІіЇї\\d\\w\\s(),.!?;:—_=-]+$' },
|
7
|
+
order: { type: 'string', pattern: '^([\\d\\w_.-]+)$' },
|
8
|
+
desc: { type: 'string', pattern: '^(desc)|(asc)$' },
|
9
|
+
state: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
|
10
|
+
custom: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
|
11
|
+
bbox: { type: 'string', pattern: '^([\\d\\s,.-]+)$' },
|
12
|
+
polyline: { type: 'string', pattern: '^([\\d\\w|@{}~_`]+)$' },
|
13
|
+
// key: { type: 'string', pattern: '^([\\d\\w_]+)$' },
|
14
|
+
sql: { type: 'string', pattern: '^(\\d)$' },
|
15
|
+
},
|
16
|
+
params: {
|
17
|
+
id: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
18
|
+
table: { type: 'string', pattern: '^([\\d\\w_.-]+)$' },
|
4
19
|
}
|
5
20
|
};
|
6
|
-
|
21
|
+
|
22
|
+
const tableDataIdSchema = {
|
23
|
+
params: {
|
24
|
+
id: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
25
|
+
name: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
const tableFilterSchema = {
|
30
|
+
params: {
|
31
|
+
name: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
const cardDataSchema = {
|
36
|
+
params: {
|
37
|
+
id: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
38
|
+
table: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
const cardTabDataSchema = {
|
43
|
+
querystring: {
|
44
|
+
sql: { type: 'string', pattern: '^(\\d)$' }
|
45
|
+
},
|
46
|
+
params: {
|
47
|
+
token: { type: 'string', pattern: '^([\\d\\w]+)$' },
|
48
|
+
}
|
49
|
+
};
|
50
|
+
export {
|
51
|
+
tableDataSchema, tableDataIdSchema, tableFilterSchema,
|
52
|
+
cardDataSchema, cardTabDataSchema
|
53
|
+
}
|
7
54
|
export default null;
|
File without changes
|
@@ -6,35 +6,10 @@ import userNotifications from './controllers/userNotifications.js'; // check all
|
|
6
6
|
// hook
|
7
7
|
import onWidgetSet from './hook/onWidgetSet.js'; // send notification on comment
|
8
8
|
|
9
|
+
import { notificationSchema } from './schema.js';
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
querystring: {
|
15
|
-
nocache: { type: 'string', pattern: '^(\\d+)$' },
|
16
|
-
},
|
17
|
-
};
|
18
|
-
|
19
|
-
export default async function plugin(fastify, config = {}) {
|
20
|
-
const prefix = config.prefix || '/api';
|
21
|
-
fastify.route({
|
22
|
-
method: 'GET',
|
23
|
-
url: '/notification',
|
24
|
-
config: {
|
25
|
-
policy: ['user'],
|
26
|
-
},
|
27
|
-
schema: tableSchema,
|
28
|
-
handler: userNotifications,
|
29
|
-
});
|
30
|
-
fastify.route({
|
31
|
-
method: 'GET',
|
32
|
-
url: '/notification-read/:id?',
|
33
|
-
config: {
|
34
|
-
policy: ['user'],
|
35
|
-
},
|
36
|
-
schema: tableSchema,
|
37
|
-
handler: readNotifications,
|
38
|
-
});
|
39
|
-
addHook('onWidgetSet', onWidgetSet);
|
11
|
+
export default async function route(fastify) {
|
12
|
+
fastify.get(`/notification`, { config: { policy: ['user'] }, schema: notificationSchema }, userNotifications);
|
13
|
+
fastify.get(`/notification-read/:id?`, { config: { policy: ['user'] }, schema: notificationSchema }, readNotifications);
|
14
|
+
addHook('onWidgetSet', onWidgetSet);
|
40
15
|
}
|
@@ -4,23 +4,11 @@ import postAdminProperties from './controllers/admin.properties.post.js';
|
|
4
4
|
import getUserProperties from './controllers/user.properties.get.js';
|
5
5
|
import postUserProperties from './controllers/user.properties.post.js';
|
6
6
|
|
7
|
-
|
8
|
-
fastify.get('/admin-properties/:key?', {}, getAdminProperties);
|
9
|
-
|
10
|
-
fastify.route({
|
11
|
-
method: 'POST',
|
12
|
-
path: '/admin-properties',
|
13
|
-
config: {
|
14
|
-
policy: ['superadmin'],
|
15
|
-
},
|
16
|
-
handler: postAdminProperties,
|
17
|
-
});
|
7
|
+
import { propertiesSchema } from './schema.js';
|
18
8
|
|
19
|
-
|
20
|
-
|
21
|
-
fastify.
|
22
|
-
|
23
|
-
|
24
|
-
handler: postUserProperties,
|
25
|
-
});
|
9
|
+
export default async function route(fastify) {
|
10
|
+
fastify.get('/admin-properties/:key?', { scheme: propertiesSchema }, getAdminProperties);
|
11
|
+
fastify.get('/user-properties/:key?', { scheme: propertiesSchema }, getUserProperties);
|
12
|
+
fastify.post('/admin-properties', { config: { policy: ['superadmin'] } }, postAdminProperties);
|
13
|
+
fastify.post('/user-properties', postUserProperties);
|
26
14
|
}
|