@opengis/fastify-table 1.0.8 → 1.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.
Files changed (58) hide show
  1. package/.eslintrc.cjs +42 -42
  2. package/Changelog.md +47 -0
  3. package/README.md +26 -26
  4. package/config.js +11 -3
  5. package/crud/controllers/deleteCrud.js +10 -10
  6. package/crud/controllers/insert.js +28 -9
  7. package/crud/controllers/update.js +29 -10
  8. package/crud/controllers/utils/checkXSS.js +45 -0
  9. package/crud/controllers/utils/xssInjection.js +72 -0
  10. package/crud/funcs/dataDelete.js +15 -15
  11. package/crud/funcs/dataInsert.js +24 -24
  12. package/crud/funcs/getIdByToken.js +29 -0
  13. package/crud/funcs/isFileExists.js +13 -13
  14. package/crud/funcs/setTokenById.js +55 -0
  15. package/helper.js +28 -28
  16. package/index.js +32 -22
  17. package/package.json +22 -22
  18. package/pg/funcs/autoIndex.js +89 -89
  19. package/pg/funcs/getMeta.js +27 -27
  20. package/pg/funcs/init.js +42 -42
  21. package/pg/funcs/pgClients.js +2 -2
  22. package/pg/index.js +35 -35
  23. package/pg/pgClients.js +17 -17
  24. package/policy/funcs/checkPolicy.js +74 -0
  25. package/policy/funcs/sqlInjection.js +33 -0
  26. package/policy/index.js +14 -0
  27. package/redis/client.js +8 -8
  28. package/redis/funcs/redisClients.js +2 -2
  29. package/redis/index.js +19 -19
  30. package/server/templates/form/test.dataset.form.json +412 -0
  31. package/server.js +14 -14
  32. package/table/controllers/data.js +55 -55
  33. package/table/controllers/filter.js +24 -24
  34. package/table/controllers/form.js +10 -10
  35. package/table/controllers/suggest.js +60 -60
  36. package/table/controllers/utils/getSelect.js +20 -20
  37. package/table/controllers/utils/getSelectMeta.js +66 -66
  38. package/table/funcs/getFilterSQL/index.js +75 -75
  39. package/table/funcs/getFilterSQL/util/formatValue.js +142 -142
  40. package/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
  41. package/table/funcs/getFilterSQL/util/getFilterQuery.js +73 -73
  42. package/table/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -12
  43. package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
  44. package/table/index.js +14 -14
  45. package/test/api/crud.test.js +50 -48
  46. package/test/api/crud.xss.test.js +70 -0
  47. package/test/api/table.test.js +49 -49
  48. package/test/config.example +18 -18
  49. package/test/funcs/crud.test.js +77 -51
  50. package/test/funcs/pg.test.js +32 -32
  51. package/test/funcs/redis.test.js +19 -19
  52. package/test/funcs/table.test.js +48 -48
  53. package/test/templates/cls/test.json +9 -9
  54. package/test/templates/form/cp_building.form.json +32 -32
  55. package/test/templates/select/account_id.json +3 -3
  56. package/test/templates/select/storage.data.json +2 -2
  57. package/test/templates/table/gis.dataset.table.json +20 -20
  58. package/changelog.md +0 -26
@@ -1,48 +1,50 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert';
3
-
4
- import build from '../../helper.js';
5
- import pgClients from '../../pg/pgClients.js';
6
-
7
- test('api crud', async (t) => {
8
- const app = await build(t);
9
-
10
- await t.test('POST /insert', async () => {
11
- const res = await app.inject({
12
- method: 'POST',
13
- url: '/api/crud/gis.dataset',
14
- body: { dataset_name: '111', dataset_id: '5400000' },
15
- });
16
-
17
- const rep = JSON.parse(res?.body);
18
- // rep.dataset_id
19
- // console.log(rep);
20
- // pgClients.client.query('delete from gis.dataset where dataset_id=$1', [rep.dataset_id]);
21
- assert.ok(rep.dataset_id);
22
- });
23
-
24
- await t.test('PUT /update', async () => {
25
- const res = await app.inject({
26
- method: 'PUT',
27
- url: '/api/crud/gis.dataset/5400000',
28
- body: { editor_id: '11' },
29
- });
30
-
31
- const rep = JSON.parse(res?.body);
32
- // rep.dataset_id
33
- // console.log(rep);
34
- assert.equal(rep.editor_id, '11')
35
- });
36
-
37
- await t.test('DELETE /delete', async () => {
38
- const res = await app.inject({
39
- method: 'DELETE',
40
- url: '/api/crud/gis.dataset/5400000',
41
- });
42
-
43
- const rep = JSON.parse(res?.body);
44
- // rep.dataset_id
45
- // console.log(rep);
46
- assert.ok(rep);
47
- });
48
- });
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert';
3
+
4
+ import build from '../../helper.js';
5
+
6
+ import config from '../config.js';
7
+
8
+ test('api crud', async (t) => {
9
+ const app = await build(t);
10
+ const prefix = config.prefix || '/api';
11
+
12
+ await t.test('POST /insert', async () => {
13
+ const res = await app.inject({
14
+ method: 'POST',
15
+ url: `${prefix}/crud/gis.dataset`,
16
+ body: { dataset_name: '111', dataset_id: '5400000' },
17
+ });
18
+
19
+ const rep = JSON.parse(res?.body);
20
+ // rep.dataset_id
21
+ // console.log(rep);
22
+ // pgClients.client.query('delete from gis.dataset where dataset_id=$1', [rep.dataset_id]);
23
+ assert.ok(rep.dataset_id);
24
+ });
25
+
26
+ await t.test('PUT /update', async () => {
27
+ const res = await app.inject({
28
+ method: 'PUT',
29
+ url: `${prefix}/crud/gis.dataset/5400000`,
30
+ body: { editor_id: '11' },
31
+ });
32
+
33
+ const rep = JSON.parse(res?.body);
34
+ // rep.dataset_id
35
+ // console.log(rep);
36
+ assert.equal(rep.editor_id, '11');
37
+ });
38
+
39
+ await t.test('DELETE /delete', async () => {
40
+ const res = await app.inject({
41
+ method: 'DELETE',
42
+ url: `${prefix}/crud/gis.dataset/5400000`,
43
+ });
44
+
45
+ const rep = JSON.parse(res?.body);
46
+ // rep.dataset_id
47
+ // console.log(rep);
48
+ assert.ok(rep);
49
+ });
50
+ });
@@ -0,0 +1,70 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert';
3
+
4
+ import build from '../../helper.js';
5
+
6
+ import setTokenById from '../../crud/funcs/setTokenById.js';
7
+ import config from '../config.js';
8
+
9
+ test('api crud xss', async (t) => {
10
+ const app = await build(t);
11
+ const session = { passport: { user: { uid: '1' } } };
12
+ app.decorateRequest('session', session);
13
+
14
+ const prefix = config.prefix || '/api';
15
+
16
+ let addTokens;
17
+ let editTokens;
18
+
19
+ // before
20
+ t.test('setTokenById', async () => {
21
+ addTokens = setTokenById({
22
+ funcs: { config },
23
+ ids: [JSON.stringify({ add: 'gis.dataset', form: 'test.dataset.form' })],
24
+ mode: 'a',
25
+ session,
26
+ array: 1,
27
+ });
28
+ editTokens = setTokenById({
29
+ funcs: { config },
30
+ ids: [JSON.stringify({ id: '5400000', table: 'gis.dataset', form: 'test.dataset.form' })],
31
+ mode: 'w',
32
+ session,
33
+ array: 1,
34
+ });
35
+ assert.ok(addTokens.length === 1 && editTokens.length === 1, 'invalid token');
36
+ });
37
+
38
+ await t.test('POST /insert', async () => {
39
+ const res = await app.inject({
40
+ method: 'POST',
41
+ url: `${prefix}/crud/${addTokens[0]}`,
42
+ body: { dataset_name: '<a onClick="alert("XSS Injection")">xss injection</a>', dataset_id: '5400000' },
43
+ });
44
+
45
+ const rep = JSON.parse(res?.body);
46
+
47
+ assert.ok(rep.status, 409);
48
+ });
49
+
50
+ await t.test('PUT /update', async () => {
51
+ const res = await app.inject({
52
+ method: 'PUT',
53
+ url: `${prefix}/crud/${editTokens[0]}/${editTokens[0]}`,
54
+ body: { editor_id: '11', dataset_name: '<a onClick="alert("XSS Injection")">xss injection</a>' },
55
+ });
56
+
57
+ const rep = JSON.parse(res?.body);
58
+
59
+ assert.equal(rep.status, 409);
60
+ });
61
+ await t.test('DELETE /delete', async () => {
62
+ const res = await app.inject({
63
+ method: 'DELETE',
64
+ url: `${prefix}/crud/gis.dataset/5400000`,
65
+ });
66
+
67
+ const rep = JSON.parse(res?.body);
68
+ assert.ok(rep);
69
+ });
70
+ });
@@ -1,49 +1,49 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert';
3
-
4
- import build from '../../helper.js';
5
-
6
- test('api table', async (t) => {
7
- const app = await build(t);
8
- // assert.ok(1);
9
- await t.test('GET /suggest', async () => {
10
- const res = await app.inject({
11
- method: 'GET',
12
- url: '/api/suggest/storage.data',
13
- });
14
- // console.log(res?.body);
15
- const rep = JSON.parse(res?.body);
16
- // console.log(rep.total);
17
- assert.ok(rep.total);
18
- });
19
- await t.test('GET /data', async () => {
20
- const res = await app.inject({
21
- method: 'GET',
22
- url: '/api/data/gis.dataset.table',
23
- });
24
- // console.log(res);
25
- const rep = JSON.parse(res?.body);
26
- // console.log(rep.total);
27
- assert.ok(rep.total);
28
- });
29
- await t.test('GET /form', async () => {
30
- const res = await app.inject({
31
- method: 'GET',
32
- url: '/api/form/cp_building.form',
33
- });
34
- // console.log(res);
35
- const rep = JSON.parse(res?.body);
36
- // console.log(rep.total);
37
- assert.ok(rep);
38
- });
39
- await t.test('GET /filter', async () => {
40
- const res = await app.inject({
41
- method: 'GET',
42
- url: '/api/filter/gis.dataset.table',
43
- });
44
- // console.log(res);
45
- const rep = JSON.parse(res?.body);
46
- // console.log(rep.total);
47
- assert.ok(rep);
48
- });
49
- });
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert';
3
+
4
+ import build from '../../helper.js';
5
+
6
+ test('api table', async (t) => {
7
+ const app = await build(t);
8
+ // assert.ok(1);
9
+ await t.test('GET /suggest', async () => {
10
+ const res = await app.inject({
11
+ method: 'GET',
12
+ url: '/api/suggest/storage.data',
13
+ });
14
+ // console.log(res?.body);
15
+ const rep = JSON.parse(res?.body);
16
+ // console.log(rep.total);
17
+ assert.ok(rep.total);
18
+ });
19
+ await t.test('GET /data', async () => {
20
+ const res = await app.inject({
21
+ method: 'GET',
22
+ url: '/api/data/gis.dataset.table',
23
+ });
24
+ // console.log(res);
25
+ const rep = JSON.parse(res?.body);
26
+ // console.log(rep.total);
27
+ assert.ok(rep.total);
28
+ });
29
+ await t.test('GET /form', async () => {
30
+ const res = await app.inject({
31
+ method: 'GET',
32
+ url: '/api/form/cp_building.form',
33
+ });
34
+ // console.log(res);
35
+ const rep = JSON.parse(res?.body);
36
+ // console.log(rep.total);
37
+ assert.ok(rep);
38
+ });
39
+ await t.test('GET /filter', async () => {
40
+ const res = await app.inject({
41
+ method: 'GET',
42
+ url: '/api/filter/gis.dataset.table',
43
+ });
44
+ // console.log(res);
45
+ const rep = JSON.parse(res?.body);
46
+ // console.log(rep.total);
47
+ assert.ok(rep);
48
+ });
49
+ });
@@ -1,18 +1,18 @@
1
- import config from '../config.js';
2
-
3
- Object.assign(config, {
4
- templateDir: 'test/templates',
5
- pg: {
6
- host: '192.168.3.160',
7
- port: 5434,
8
- database: 'mbk_rivne_dma',
9
- user: 'postgres',
10
- password: 'postgres',
11
- },
12
- redis: {
13
- host: '192.168.3.160',
14
- port: 6379,
15
- family: 4,
16
- },
17
- });
18
- export default config;
1
+ import config from '../config.js';
2
+
3
+ Object.assign(config, {
4
+ templateDir: 'test/templates',
5
+ pg: {
6
+ host: '192.168.3.160',
7
+ port: 5434,
8
+ database: 'mbk_rivne_dma',
9
+ user: 'postgres',
10
+ password: 'postgres',
11
+ },
12
+ redis: {
13
+ host: '192.168.3.160',
14
+ port: 6379,
15
+ family: 4,
16
+ },
17
+ });
18
+ export default config;
@@ -1,51 +1,77 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert';
3
- import '../config.js';
4
-
5
- import pgClients from '../../pg/pgClients.js';
6
- import rclient from '../../redis/client.js';
7
-
8
- import dataInsert from '../../crud/funcs/dataInsert.js';
9
- import dataUpdate from '../../crud/funcs/dataUpdate.js';
10
- import dataDelete from '../../crud/funcs/dataDelete.js';
11
- import isFileExists from '../../crud/funcs/isFileExists.js';
12
-
13
- import getOpt from '../../crud/funcs/getOpt.js';
14
- import setOpt from '../../crud/funcs/setOpt.js';
15
-
16
- test('funcs crud', async (t) => {
17
-
18
- await t.test('getOpt/setOpt', async () => {
19
- const opt = await setOpt({ table: 'gis.dataset' });
20
- const data = await getOpt(opt);
21
- // console.log(data);
22
- assert.equal(data.table, 'gis.dataset');
23
- });
24
-
25
- const id = (Math.random() * 10000).toFixed();
26
- await t.test('dataInsert', async () => {
27
- const data = await dataInsert({ table: 'gis.dataset', data: { dataset_id: id, dataset_name: '222' } });
28
- assert.equal(data.dataset_id, id);
29
- });
30
-
31
- await t.test('dataUpdate', async () => {
32
- const data = await dataUpdate({ table: 'gis.dataset', id, data: { dataset_name: '22211' } });
33
- assert.equal(data.dataset_name, '22211');
34
- });
35
-
36
- await t.test('dataDelete', async () => {
37
- const data = await dataDelete({ table: 'gis.dataset', id });
38
- assert.ok(data);
39
- });
40
-
41
- await t.test('isFileExists', async () => {
42
- const data = await isFileExists({filepath: '../../crud/funcs/isFileExists.js'});
43
- assert.equal(data, false);
44
- });
45
-
46
- // pgClients.client.query('delete from gis.dataset where dataset_id=$1', [id]);
47
- t.after(() => {
48
- pgClients.client?.end();
49
- rclient.quit();
50
- });
51
- });
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert';
3
+
4
+ import pgClients from '../../pg/pgClients.js';
5
+ import rclient from '../../redis/client.js';
6
+
7
+ import dataInsert from '../../crud/funcs/dataInsert.js';
8
+ import dataUpdate from '../../crud/funcs/dataUpdate.js';
9
+ import dataDelete from '../../crud/funcs/dataDelete.js';
10
+ import isFileExists from '../../crud/funcs/isFileExists.js';
11
+
12
+ import getOpt from '../../crud/funcs/getOpt.js';
13
+ import setOpt from '../../crud/funcs/setOpt.js';
14
+
15
+ import getIdByToken from '../../crud/funcs/getIdByToken.js';
16
+ import setTokenById from '../../crud/funcs/setTokenById.js';
17
+ import config from '../config.js';
18
+
19
+ test('funcs crud', async (t) => {
20
+ await t.test('getOpt/setOpt', async () => {
21
+ const opt = await setOpt({ table: 'gis.dataset' });
22
+ const data = await getOpt(opt);
23
+ // console.log(data);
24
+ assert.equal(data.table, 'gis.dataset');
25
+ });
26
+
27
+ const id = (Math.random() * 10000).toFixed();
28
+ await t.test('dataInsert', async () => {
29
+ const data = await dataInsert({ table: 'gis.dataset', data: { dataset_id: id, dataset_name: '222' } });
30
+ assert.equal(data.dataset_id, id);
31
+ });
32
+
33
+ await t.test('dataUpdate', async () => {
34
+ const data = await dataUpdate({ table: 'gis.dataset', id, data: { dataset_name: '22211' } });
35
+ assert.equal(data.dataset_name, '22211');
36
+ });
37
+
38
+ await t.test('dataDelete', async () => {
39
+ const data = await dataDelete({ table: 'gis.dataset', id });
40
+ assert.ok(data);
41
+ });
42
+
43
+ await t.test('isFileExists', async () => {
44
+ const data = await isFileExists({ filepath: '../../crud/funcs/isFileExists.js' });
45
+ assert.equal(data, false);
46
+ });
47
+
48
+ let tokens;
49
+ const session = { passport: { user: { uid: '1' } } };
50
+ const tokenData = JSON.stringify({ add: 'gis.dataset', form: 'test.dataset.form' });
51
+
52
+ await t.test('setTokenById', async () => {
53
+ tokens = setTokenById({
54
+ funcs: { config },
55
+ ids: [tokenData],
56
+ mode: 'a',
57
+ session,
58
+ array: 1,
59
+ });
60
+ assert.equal(tokens.length, 1);
61
+ });
62
+ await t.test('getIdByToken', async () => {
63
+ const data = await getIdByToken({
64
+ funcs: { config },
65
+ session,
66
+ token: tokens[0],
67
+ mode: 'a',
68
+ });
69
+ assert.equal(data, tokenData);
70
+ });
71
+
72
+ // pgClients.client.query('delete from gis.dataset where dataset_id=$1', [id]);
73
+ t.after(() => {
74
+ pgClients.client?.end();
75
+ rclient.quit();
76
+ });
77
+ });
@@ -1,32 +1,32 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert';
3
-
4
- import '../config.js';
5
-
6
- import getMeta from '../../pg/funcs/getMeta.js';
7
- import autoIndex from '../../pg/funcs/autoIndex.js';
8
- import pgClients from '../../pg/pgClients.js';
9
- import rclient from '../../redis/client.js';
10
- import getPG from '../../pg/funcs/getPG.js'
11
-
12
- test('funcs pg', async (t) => {
13
- await t.test('getMeta', async () => {
14
- const { columns } = await getMeta({ table: 'gis.dataset' });
15
- // console.log(columns)
16
- assert.ok(columns);
17
- });
18
-
19
- await t.test('getPG', async (t) => {
20
- const data = await getPG({});
21
- assert.ok(data);
22
- });
23
-
24
- await t.test('autoIndex', async () => {
25
- await autoIndex({ table: 'gis.dataset', columns: ['service_type'] });
26
- assert.ok(1);
27
- });
28
- t.after(() => {
29
- pgClients.client.end();
30
- rclient.quit();
31
- });
32
- });
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert';
3
+
4
+ import '../config.js';
5
+
6
+ import getMeta from '../../pg/funcs/getMeta.js';
7
+ import autoIndex from '../../pg/funcs/autoIndex.js';
8
+ import pgClients from '../../pg/pgClients.js';
9
+ import rclient from '../../redis/client.js';
10
+ import getPG from '../../pg/funcs/getPG.js'
11
+
12
+ test('funcs pg', async (t) => {
13
+ await t.test('getMeta', async () => {
14
+ const { columns } = await getMeta({ table: 'gis.dataset' });
15
+ // console.log(columns)
16
+ assert.ok(columns);
17
+ });
18
+
19
+ await t.test('getPG', async (t) => {
20
+ const data = await getPG({});
21
+ assert.ok(data);
22
+ });
23
+
24
+ await t.test('autoIndex', async () => {
25
+ await autoIndex({ table: 'gis.dataset', columns: ['service_type'] });
26
+ assert.ok(1);
27
+ });
28
+ t.after(() => {
29
+ pgClients.client.end();
30
+ rclient.quit();
31
+ });
32
+ });
@@ -1,19 +1,19 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert';
3
-
4
- import '../config.js';
5
-
6
- import rclient from '../../redis/client.js';
7
-
8
- test('funcs redis', async (t) => {
9
- await t.test('get/set', async () => {
10
- await rclient.set('test', '1');
11
- const d = await rclient.get('test');
12
- // console.log(columns)
13
- assert.equal(d, '1');
14
- });
15
-
16
- t.after(() => {
17
- rclient.quit();
18
- });
19
- });
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert';
3
+
4
+ import '../config.js';
5
+
6
+ import rclient from '../../redis/client.js';
7
+
8
+ test('funcs redis', async (t) => {
9
+ await t.test('get/set', async () => {
10
+ await rclient.set('test', '1');
11
+ const d = await rclient.get('test');
12
+ // console.log(columns)
13
+ assert.equal(d, '1');
14
+ });
15
+
16
+ t.after(() => {
17
+ rclient.quit();
18
+ });
19
+ });
@@ -1,48 +1,48 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert';
3
- import '../config.js';
4
- import pgClients from '../../pg/pgClients.js';
5
- import rclient from '../../redis/client.js';
6
- import getFilterSQL from '../../table/funcs/getFilterSQL/index.js';
7
- import getTableSql from '../../table/funcs/getFilterSQL/index.js';
8
- import getCustomQuery from '../../table/funcs/getFilterSQL/index.js';
9
- import getFilterQuery from '../../table/funcs/getFilterSQL/index.js';
10
- import formatValue from '../../table/funcs/getFilterSQL/index.js';
11
- import getOptimizedQuery from '../../table/funcs/getFilterSQL/index.js';
12
-
13
- test('fucns table', async (t) => {
14
- await t.test('getMeta', async () => {
15
- const data = await getFilterSQL({ table: 'gis.dataset', filter: 'service_type=1' });
16
- // console.log(data);
17
- assert.ok(data.q);
18
- });
19
-
20
- await t.test('formatValue', async (t) => {
21
- const data = await formatValue( {table: 'gis.dataset'} );
22
- assert.ok(data);
23
- });
24
-
25
- await t.test('getCustomQuery', async (t) => {
26
- const data = await getCustomQuery( {table: 'gis.dataset'} );
27
- assert.ok(data);
28
- });
29
-
30
- await t.test('getFilterQuery', async (t) => {
31
- const data = await getFilterQuery( {table: 'gis.dataset'} );
32
- assert.ok(data);
33
- });
34
-
35
- await t.test('getOptimizedQuery', async (t) => {
36
- const data = await getOptimizedQuery( {table: 'gis.dataset'} );
37
- assert.ok(data);
38
- });
39
-
40
- await t.test('getTableSql', async (t) => {
41
- const data = await getTableSql( {table: 'gis.dataset'} );
42
- assert.ok(data);
43
- });
44
- t.after(() => {
45
- pgClients.client.end();
46
- rclient.quit();
47
- });
48
- });
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert';
3
+ import '../config.js';
4
+ import pgClients from '../../pg/pgClients.js';
5
+ import rclient from '../../redis/client.js';
6
+ import getFilterSQL from '../../table/funcs/getFilterSQL/index.js';
7
+ import getTableSql from '../../table/funcs/getFilterSQL/index.js';
8
+ import getCustomQuery from '../../table/funcs/getFilterSQL/index.js';
9
+ import getFilterQuery from '../../table/funcs/getFilterSQL/index.js';
10
+ import formatValue from '../../table/funcs/getFilterSQL/index.js';
11
+ import getOptimizedQuery from '../../table/funcs/getFilterSQL/index.js';
12
+
13
+ test('fucns table', async (t) => {
14
+ await t.test('getMeta', async () => {
15
+ const data = await getFilterSQL({ table: 'gis.dataset', filter: 'service_type=1' });
16
+ // console.log(data);
17
+ assert.ok(data.q);
18
+ });
19
+
20
+ await t.test('formatValue', async (t) => {
21
+ const data = await formatValue( {table: 'gis.dataset'} );
22
+ assert.ok(data);
23
+ });
24
+
25
+ await t.test('getCustomQuery', async (t) => {
26
+ const data = await getCustomQuery( {table: 'gis.dataset'} );
27
+ assert.ok(data);
28
+ });
29
+
30
+ await t.test('getFilterQuery', async (t) => {
31
+ const data = await getFilterQuery( {table: 'gis.dataset'} );
32
+ assert.ok(data);
33
+ });
34
+
35
+ await t.test('getOptimizedQuery', async (t) => {
36
+ const data = await getOptimizedQuery( {table: 'gis.dataset'} );
37
+ assert.ok(data);
38
+ });
39
+
40
+ await t.test('getTableSql', async (t) => {
41
+ const data = await getTableSql( {table: 'gis.dataset'} );
42
+ assert.ok(data);
43
+ });
44
+ t.after(() => {
45
+ pgClients.client.end();
46
+ rclient.quit();
47
+ });
48
+ });
@@ -1,10 +1,10 @@
1
- [
2
- {
3
- "id": 1,
4
- "text": "test"
5
- },
6
- {
7
- "id": 2,
8
- "text": "test2"
9
- }
1
+ [
2
+ {
3
+ "id": 1,
4
+ "text": "test"
5
+ },
6
+ {
7
+ "id": 2,
8
+ "text": "test2"
9
+ }
10
10
  ]