@opengis/fastify-table 1.1.45 → 1.1.47

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 (129) hide show
  1. package/Changelog.md +1 -1
  2. package/README.md +26 -26
  3. package/config.js +10 -10
  4. package/cron/controllers/cronApi.js +22 -22
  5. package/cron/controllers/utils/cronList.js +1 -1
  6. package/cron/index.js +10 -10
  7. package/crud/controllers/deleteCrud.js +9 -4
  8. package/crud/controllers/insert.js +9 -6
  9. package/crud/controllers/update.js +13 -10
  10. package/crud/controllers/utils/checkXSS.js +3 -2
  11. package/crud/controllers/utils/xssInjection.js +72 -72
  12. package/crud/funcs/getAccess.js +14 -13
  13. package/crud/funcs/getToken.js +27 -27
  14. package/crud/funcs/isFileExists.js +13 -13
  15. package/crud/funcs/setToken.js +53 -53
  16. package/docs/.vitepress/abbr.mjs +26 -0
  17. package/docs/.vitepress/config.mjs +127 -0
  18. package/docs/.vitepress/navigation.mjs +82 -0
  19. package/docs/.vitepress/theme/Layout.vue +17 -0
  20. package/docs/.vitepress/theme/components/NavigationLinks.vue +102 -0
  21. package/docs/.vitepress/theme/components/Panzoom.vue +169 -0
  22. package/docs/.vitepress/theme/index.mjs +15 -0
  23. package/docs/.vitepress/theme/style.scss +163 -0
  24. package/docs/abbr.json +4 -0
  25. package/docs/api/cron/cronApi.md +56 -0
  26. package/docs/api/crud/deleteCrud.md +58 -0
  27. package/docs/api/crud/insert.md +82 -0
  28. package/docs/api/crud/update.md +85 -0
  29. package/docs/api/index.md +47 -0
  30. package/docs/api/notification/testEmail.md +91 -0
  31. package/docs/api/table/card.md +73 -0
  32. package/docs/api/table/data.md +134 -0
  33. package/docs/api/table/export.md +60 -0
  34. package/docs/api/table/filter.md +104 -0
  35. package/docs/api/table/form.md +126 -0
  36. package/docs/api/table/search.md +123 -0
  37. package/docs/api/table/suggest.md +156 -0
  38. package/docs/api/table/table.md +107 -0
  39. package/docs/api/user/user.cls.id.md +77 -0
  40. package/docs/api/user/user.cls.md +49 -0
  41. package/docs/api/user/user.cls.post.md +62 -0
  42. package/docs/api/user/user.info.md +37 -0
  43. package/docs/api/utils/logger.file.md +61 -0
  44. package/docs/api/utils/next.id.md +34 -0
  45. package/docs/api/utils/properties.add.md +127 -0
  46. package/docs/api/utils/properties.get.md +73 -0
  47. package/docs/api/utils/status.monitor.md +36 -0
  48. package/docs/api/widget/widget.del.md +76 -0
  49. package/docs/api/widget/widget.get.md +233 -0
  50. package/docs/api/widget/widget.set.md +88 -0
  51. package/docs/db/admin.md +947 -0
  52. package/docs/db/crm.md +564 -0
  53. package/docs/db/index.md +9 -0
  54. package/docs/db/log.md +204 -0
  55. package/docs/hook/card/afterCard.md +20 -0
  56. package/docs/hook/card/preCard.md +25 -0
  57. package/docs/hook/data/afterData.md +26 -0
  58. package/docs/hook/data/preData.md +26 -0
  59. package/docs/hook/deleteCrud/afterDelete.md +21 -0
  60. package/docs/hook/deleteCrud/preDelete.md +26 -0
  61. package/docs/hook/form/afterForm.md +19 -0
  62. package/docs/hook/form/preForm.md +26 -0
  63. package/docs/hook/getTemplate/afterTemplate.md +24 -0
  64. package/docs/hook/getTemplate/preTemplate.md +29 -0
  65. package/docs/hook/index.md +45 -0
  66. package/docs/hook/insert/afterInsert.md +41 -0
  67. package/docs/hook/insert/preInsert.md +25 -0
  68. package/docs/hook/table/afterTable.md +20 -0
  69. package/docs/hook/table/preTable.md +25 -0
  70. package/docs/hook/update/afterUpdate.md +41 -0
  71. package/docs/hook/update/preUpdate.md +25 -0
  72. package/docs/index.md +42 -0
  73. package/docs/public/fastify-dark.svg +4 -0
  74. package/docs/public/fastify.svg +1 -0
  75. package/docs/public/logo-short-dark.svg +12 -0
  76. package/docs/public/logo-short.svg +11 -0
  77. package/docs/public/logo.svg +19 -0
  78. package/docs/readme/index.md +121 -0
  79. package/docs/templates/card.md +83 -0
  80. package/docs/templates/cls.md +29 -0
  81. package/docs/templates/filters.md +91 -0
  82. package/docs/templates/forms.md +139 -0
  83. package/docs/templates/image.png +0 -0
  84. package/docs/templates/index.md +28 -0
  85. package/docs/templates/select.md +90 -0
  86. package/docs/templates/table.md +162 -0
  87. package/docs/utils/cron/addCron.md +29 -0
  88. package/docs/utils/crud/dataInsert.md +52 -0
  89. package/docs/utils/crud/dataUpdate.md +53 -0
  90. package/docs/utils/crud/getOpt.md +34 -0
  91. package/docs/utils/crud/isFileExists.md +38 -0
  92. package/docs/utils/crud/setOpt.md +38 -0
  93. package/docs/utils/hook/addHook.md +74 -0
  94. package/docs/utils/hook/applyHook.md +64 -0
  95. package/docs/utils/index.md +48 -0
  96. package/docs/utils/notification/addNotification.md +28 -0
  97. package/docs/utils/notification/notification.md +41 -0
  98. package/docs/utils/pg/autoIndex.md +22 -0
  99. package/docs/utils/pg/getMeta.md +59 -0
  100. package/docs/utils/pg/getPG.md +34 -0
  101. package/docs/utils/pg/init.md +30 -0
  102. package/docs/utils/pg/pg.md +70 -0
  103. package/docs/utils/redis/getRedis.md +36 -0
  104. package/docs/utils/redis/rclient.md +74 -0
  105. package/docs/utils/table/getForm.md +69 -0
  106. package/docs/utils/table/getMeta.md +56 -0
  107. package/docs/utils/table/getSelect.md +39 -0
  108. package/docs/utils/table/getSelectMeta.md +47 -0
  109. package/docs/utils/table/getTable.md +78 -0
  110. package/logger/createFileStream.js +1 -1
  111. package/package.json +15 -3
  112. package/redis/funcs/getRedis.js +23 -23
  113. package/server/migrations/log.sql +80 -80
  114. package/table/controllers/data.js +31 -23
  115. package/table/controllers/table.js +26 -22
  116. package/table/index.js +3 -50
  117. package/table/schema.js +54 -0
  118. package/test/api/crud.xss.test.js +38 -22
  119. package/test/config.example +18 -18
  120. package/test/funcs/pg.test.js +34 -34
  121. package/test/funcs/redis.test.js +19 -19
  122. package/test/templates/cls/test.json +9 -9
  123. package/test/templates/form/cp_building.form.json +32 -32
  124. package/test/templates/select/account_id.json +3 -3
  125. package/test/templates/select/storage.data.json +2 -2
  126. package/test/templates/table/gis.dataset.table.json +20 -20
  127. package/util/controllers/next.id.js +4 -4
  128. package/util/controllers/properties.get.js +19 -19
  129. package/util/index.js +23 -23
@@ -0,0 +1,48 @@
1
+ ---
2
+ order: -1
3
+ ---
4
+
5
+ # Список функцій
6
+
7
+ ## CRUD
8
+
9
+ - **[dataInsert](./crud/dataInsert.md)** - Імпорт даних у таблицю
10
+ - **[dataUpdate](./crud/dataUpdate.md)** - Оновлення даних у таблиці
11
+ - **[getOpt](./crud/getOpt.md)** - Отримання опцій (налаштувань) за токеном
12
+ - **[setOpt](./crud/setOpt.md)** - Для збереження опцій (налаштувань) в базі даних Redis
13
+ - **[isFileExists](./crud/isFileExists.md)** - Перевірка чи існує файл
14
+
15
+ ## PG
16
+
17
+ - **[pg](./pg/pg.md)** - Дозволяє виконувати запити до бази даних
18
+ - **[autoIndex](./pg/autoIndex.md)** - Для автоматичного створення індексів у базі даних
19
+ - **[getMeta](./pg/getMeta.md)** - Метадані таблиці
20
+ - **[getPG](./pg/getPG.md)** - Повертає об'єкт для взаємодії з базою даних
21
+ - **[init](./pg/init.md)** - Init
22
+
23
+ ## Notification
24
+
25
+ - **[addNotification](./notification/addNotification.md)** - додавання повідомлень до таблиці
26
+ - **[notification](./notification/notification.md)** - відправка повідомлень
27
+
28
+ ## Cron
29
+
30
+ - **[addCron](./cron/addCron.md)** - додавання планувальника
31
+
32
+ ## Redis
33
+
34
+ - **[rclient](./redis/rclient.md)** - Дозволяє виконувати [redis command](https://redis.io/commands/)
35
+ - **[getRedis](./redis//getRedis.md)** - Отримує конфіг Redis
36
+
37
+ ## Table
38
+
39
+ - **[getForm](./table/getForm.md)** - Для отримання форм
40
+ - **[getMeta](./table/getMeta.md)** - Метадані таблиці
41
+ - **[getSelect](./table/getSelect.md)** - Отримує дані селекту
42
+ - **[getSelectMeta](./table/getSelectMeta.md)** - Отримує дані з таблиці
43
+ - **[getTable](./table/getTable.md)** - Завантажує таблицю
44
+
45
+ ## Hook
46
+
47
+ - **[addHook](./hook/addHook.md)** - Додає кастомний хук
48
+ - **[applyHook](./hook/applyHook.md)** - Виконує кастомний хук
@@ -0,0 +1,28 @@
1
+ # addNotification
2
+
3
+ ## Опис
4
+
5
+ Функція `addNotification` призначена для додавання даних до таблиці `crm.notifications` з метою відправки повідомлень
6
+
7
+ ``` js
8
+ addNotification({
9
+ pg, funcs, session, subject, body, link, uid,
10
+ });
11
+ ```
12
+
13
+ ## Параметри
14
+
15
+ :::tabs
16
+ == params
17
+
18
+ | Параметр | Тип | Опис |
19
+ | -------- | ------ | --------------------------------------------------- |
20
+ | `pg` | String | Клієнт postgres |
21
+ | `funcs` | Object | Функції |
22
+ | `session` | Object | Сесія користувача |
23
+ | `subject` | String | Заголовок повідомлення |
24
+ | `body` | String | Текст повідомлення |
25
+ | `link` | String | Посилання |
26
+ | `uid` | String | Отримувач повідомлення |
27
+
28
+ :::
@@ -0,0 +1,41 @@
1
+ # notification
2
+
3
+ ## Опис
4
+
5
+ Функція `notification` призначена для відправки повідомлень
6
+
7
+ ``` js
8
+ notification({
9
+ pg,
10
+ funcs,
11
+ log,
12
+ to,
13
+ title: `Test email title`,
14
+ message: `Lorem Ipsum Lorem Ipsum`,
15
+ template,
16
+ table,
17
+ id,
18
+ nocache,
19
+ file,
20
+ });
21
+ ```
22
+
23
+ ## Параметри
24
+
25
+ :::tabs
26
+ == params
27
+
28
+ | Параметр | Тип | Опис |
29
+ | -------- | ------ | ------------------------- |
30
+ | `pg` | Object | Клієнт postgres |
31
+ | `funcs` | Object | Функції |
32
+ | `log` | Object | Pino logger |
33
+ | `to` | String | Ел. пошта отримувача |
34
+ | `title` | String | Заголовок повідомлення |
35
+ | `message` | String | Текст повідомлення |
36
+ | `template` | String | Шаблон (pt) |
37
+ | `table` | String | Таблиця БД |
38
+ | `id` | String | ID об'єкту |
39
+ | `nocache` | Number | Відключити кешування |
40
+ | `file` | Array | Шляхи до файлів |
41
+ :::
@@ -0,0 +1,22 @@
1
+ # autoindex
2
+
3
+ ## Опис
4
+
5
+ Функція `autoIndex` призначена для автоматичного створення індексів у базі даних на основі заданих фільтрів. Вона використовує клієнт PostgreSQL та Redis для управління індексами.
6
+
7
+ ``` js
8
+ autoIndex({
9
+ table, columns: filter,
10
+ });
11
+ ```
12
+
13
+ ## Параметри
14
+
15
+ :::tabs
16
+ == params
17
+
18
+ | Параметр | Тип | Опис |
19
+ | -------- | ------ | --------------------------------------------------- |
20
+ | `table` | String | Назва таблиці в базі даних |
21
+ | `columns` | Array | Масив фільтрів, на основі яких створюються індекси |
22
+ :::
@@ -0,0 +1,59 @@
1
+ # getMeta
2
+
3
+ ## Опис
4
+
5
+ Метадані таблиці
6
+
7
+ ```js
8
+ getMeta({table: 'data_user.work'});
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ :::tabs
14
+ == params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ------- |
18
+ | table | string | Таблиця |
19
+
20
+ :::
21
+
22
+ ## Відповідь
23
+
24
+ :::details Приклад відповіді
25
+
26
+ ```json
27
+ {
28
+ "res": {
29
+ "pk": "id_work",
30
+ "columns": [
31
+ {
32
+ "name": "id_work",
33
+ "tableID": 8966220,
34
+ "columnID": 1,
35
+ "dataTypeID": 25,
36
+ "dataTypeSize": -1,
37
+ "dataTypeModifier": -1,
38
+ "format": "text"
39
+ },
40
+ {
41
+ "name": "type_work",
42
+ "tableID": 8966220,
43
+ "columnID": 2,
44
+ "dataTypeID": 23,
45
+ "dataTypeSize": 4,
46
+ "dataTypeModifier": -1,
47
+ "format": "text"
48
+ }
49
+ ],
50
+ "geom": {
51
+ "bounds": null,
52
+ "count": "0",
53
+ "srid": null,
54
+ "geometry": null
55
+ }
56
+ }
57
+ }
58
+ ```
59
+ :::
@@ -0,0 +1,34 @@
1
+ # getPG
2
+
3
+ ## Опис
4
+
5
+ Функція створює та повертає об'єкт для взаємодії з базою даних PostgreSQL. Використовується для отримання екземпляру підключення до бази даних.
6
+
7
+ ```js
8
+ getPG({ db: 'mbk_rivne_dma' });
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ :::tabs
14
+ == params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ---------- |
18
+ | user | object | Користувач |
19
+ | password | object | Пароль |
20
+ | host | object | Хост |
21
+ | port | object | Порт |
22
+ | db | object | База даних |
23
+
24
+ :::
25
+
26
+ ## Відповідь
27
+
28
+ :::details Приклад відповіді
29
+
30
+ ```txt
31
+ pg client function
32
+ ```
33
+
34
+ :::
@@ -0,0 +1,30 @@
1
+ # init
2
+
3
+ ## Опис
4
+
5
+ Init
6
+
7
+ ```js
8
+ init(client);
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ :::tabs
14
+ == params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ------ |
18
+ | client | String | Клієнт |
19
+
20
+
21
+ :::
22
+
23
+ ## Відповідь
24
+
25
+ :::details Приклад відповіді
26
+
27
+ ```json
28
+
29
+ ```
30
+ :::
@@ -0,0 +1,70 @@
1
+ # pg
2
+
3
+ [node pg](https://node-postgres.com/features/queries) - документація модуля `pg`
4
+
5
+ ## PG Props
6
+
7
+ ```js
8
+ pg.pk["admin.cls"] // cls_id ; pk[table]
9
+ pg.pgType[12] // int; type[typeid]
10
+ pg.procList.includes("admin.next_id") // true
11
+ pg.tableList.includes("admin.cls") // true
12
+ pg.geom["admin.cls"] // false
13
+ ```
14
+
15
+ ## Параметри
16
+
17
+ ```js
18
+ pg.query(query, args?)
19
+ ```
20
+
21
+ | Назва | Тип | Опис |
22
+ | -------- | ------- | -------------------------------- |
23
+ | query | string | Запит sql |
24
+ | args | array | Параметри запиту |
25
+
26
+ ```js
27
+ const query = 'INSERT INTO users(name, email) VALUES($1, $2) RETURNING *'
28
+ const args = ['brianc', 'brian.m.carlson@gmail.com']
29
+ const querySelect = 'select * from users where name = $1 and email = $2'
30
+
31
+ pg.query(query) // Query Native
32
+ pg.query(query, args) // Parameterized query Native
33
+
34
+ pg.queryCache(querySelect) // Query with Cache Result
35
+ pg.queryCache(querySelect, args) // Parameterized query with Cache Result
36
+ ```
37
+
38
+ ## pg.queryCache
39
+
40
+ Повертає один рядок/об'єкт => `object`
41
+
42
+ Отримай запит кешує в редіс. Якщо вже є кеш по цьому запиту, то повертає кеш.
43
+ Якщо кеша немає то робить новий запит до бази даних.
44
+
45
+ ```js
46
+ const { sid } = await pg.queryCache('select sid from admin.site');
47
+ console.log(sid); // 35
48
+ ```
49
+
50
+ ## pg.query
51
+
52
+ Повертає масив рядків/об'єктів та структуру => `object`
53
+
54
+ ```js
55
+ const { rows, fields } = await pg.query('select sid from admin.site');
56
+ console.log(rows); // [{sid:35}]
57
+ console.log(fields); // опис полів запиту
58
+
59
+ ```
60
+
61
+ ## pg.queryNotice
62
+
63
+ Повертає масив рядків /об'єктів, а також дозволяє вивести notice при відпрацюванні функції БД => `object`
64
+
65
+ ```js
66
+ const send = (txt) => { console.log(txt); };
67
+ const { rows } = await pg.queryNotice('select gis_sync_sandbox.upload_data_check($1)', [{ din, uid }], send);
68
+ console.log(rows); // [{ status: 2 }]
69
+
70
+ ```
@@ -0,0 +1,36 @@
1
+ # getRedis
2
+
3
+ ## Опис
4
+
5
+ Отримує конфіг Redis
6
+
7
+ ```js
8
+ getRedis({ db: 0 });
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ ::: tabs
14
+ ==params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ---------- |
18
+ | db | Object | База даних |
19
+
20
+ :::
21
+
22
+ ## Приклад
23
+
24
+ ```js
25
+ getRedis({ db: 0 })
26
+ ```
27
+
28
+ ## Відповідь
29
+
30
+ :::details Приклад відповіді
31
+
32
+ ```txt
33
+ rclient function
34
+ ```
35
+
36
+ :::
@@ -0,0 +1,74 @@
1
+ # rclient
2
+
3
+ Дозволяє виконувати [redis command](https://redis.io/commands/)
4
+
5
+ ```js
6
+ const data = await rclient.get(`auth:${params.token}`); // отримує з cache
7
+ ```
8
+
9
+ ::: details Робота з `object`, `array` / об'єктами та масивами
10
+
11
+ Redis підтримує роботу з даними у форматі `string`
12
+
13
+ Для запису `object` або `array` можна
14
+
15
+ - зробити `JSON.stringify` - для запису, `JSON.parse` - для читання.
16
+ - використати функції `setJSON`, `getJSON`
17
+ - використати `hgetall`, `hmset` - для `object`
18
+ - використати `sadd` - для `array`
19
+ :::
20
+
21
+ ## Key / Ключі
22
+
23
+ Робота з ключами key
24
+
25
+ | Команда | Опис |
26
+ | ---------------- | ---------------------------------- |
27
+ | [get](https://redis.io/commands/get) | Get the value of key. If the key does not exist the special value nil is returned. |
28
+ | [del](https://redis.io/commands/del) | Removes the specified keys. A key is ignored if it does not exist. |
29
+ | [set](https://redis.io/commands/set) | Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. |
30
+ | [setnx](https://redis.io/commands/setnx) | Set key to hold string value if key does not exist. In that case, it is equal to SET. When key already holds a value, no operation is performed. |
31
+ | [expire](https://redis.io/commands/expire) | Set a timeout on key. After the timeout has expired, the key will automatically be deleted. |
32
+ | [incr](https://redis.io/commands/incr) | Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. |
33
+ | [exists](https://redis.io/commands/exists) | The user should be aware that if the same existing key is mentioned in the arguments multiple times, it will be counted multiple times. |
34
+ | [scan](https://redis.io/commands/scan) | Iterates the set of keys in the currently selected Redis database. |
35
+
36
+ ## Hash stored / Hash об'єкти
37
+
38
+ Команди роботи з асоціативними масивами
39
+
40
+ | Команда | Опис |
41
+ | ---------------- | ---------------------------------- |
42
+ | [hget](https://redis.io/commands/hget) | Returns the value associated with field in the hash stored at key. |
43
+ | [hgetall](https://redis.io/commands/hget) | Returns the value associated with field in the hash stored at key. |
44
+ | [hmget](https://redis.io/commands/hmget) | Returns the values associated with the specified fields in the hash stored at key. For every field that does not exist in the hash, a nil value is returned. |
45
+ | [hmset](https://redis.io/commands/hmset) | Sets the specified fields to their respective values in the hash stored at key. This command overwrites any specified fields already existing in the hash. If key does not exist, a new key holding a hash is created. |
46
+
47
+ ## Set / Списки
48
+
49
+ Запис масивів унікальних значень
50
+
51
+ | Команда | Опис |
52
+ | ---------------- | ---------------------------------- |
53
+ | [sadd](https://redis.io/commands/sadd) | Add the specified members to the set stored at key. Specified members that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified members. |
54
+ | [rpush](https://redis.io/commands/rpush) | Insert all the specified values at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation. |
55
+ | [smembers](https://redis.io/commands/smembers) | Returns all the members of the set value stored at key. |
56
+ | [llen](https://redis.io/commands/llen) | Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. |
57
+
58
+ ## Sorted set / Сортовані списки
59
+
60
+ Використовується в `suggest` в пошуку по тексту
61
+
62
+ | Команда | Опис |
63
+ | ---------------- | ---------------------------------- |
64
+ | [zadd](https://redis.io/commands/zadd) | Adds all the specified members with the specified scores to the sorted set stored at key. If key does not exist, a new sorted set with the specified members as sole members is created, like if the sorted set was empty. |
65
+ | [zcard](https://redis.io/commands/zcard) | Returns the sorted set cardinality (number of elements) of the sorted set stored at key. |
66
+ | [lrange](https://redis.io/commands/lrange) | Returns the specified elements of the list stored at key. |
67
+ | [zrangebylex](https://redis.io/commands/zrange) | Returns the specified range of elements in the sorted set stored at key. |
68
+
69
+ ## Службові команди
70
+
71
+ | Команда | Опис |
72
+ | ---------------- | ---------------------------------- |
73
+ | [latency](https://redis.io/commands/latency) | This is a container command for latency diagnostics commands. |
74
+ | [flushdb](https://redis.io/commands/flushdb) | Delete all the keys of the currently selected DB. This command never fails. |
@@ -0,0 +1,69 @@
1
+ # getForm
2
+
3
+ ## Опис
4
+
5
+ Функція для отримання форм
6
+
7
+ ```js
8
+ getForm(name)
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ :::tabs
14
+ == params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ------------- |
18
+ | name | String | Форма `.json` |
19
+
20
+ :::
21
+
22
+ ## Приклад
23
+
24
+ ```js
25
+ getForm('cp_building.form')
26
+ ```
27
+
28
+
29
+ ## Відповідь
30
+
31
+ ::: details Приклад відповіді
32
+
33
+ ```json
34
+ {
35
+ "schema": {
36
+
37
+ "cp_umuni_id": {
38
+ "type": "Text",
39
+ "ua": "ID UMUNI"
40
+ },
41
+ "cp_year": {
42
+ "type": "Text",
43
+ "ua": "Рік будівництва"
44
+ },
45
+ "cp_date_en_audit": {
46
+ "type": "DatePicker",
47
+ "ua": "Дата проведення останнього енергоаудиту"
48
+ },
49
+ "cp_certificate": {
50
+ "type": "Text",
51
+ "ua": "Сертифікат енергоефективності будівлі",
52
+ "help": "Вкажіть посилання"
53
+ },
54
+ "cp_pkd": {
55
+ "type": "Autocomplete",
56
+ "data": "customer_name",
57
+ "add": {
58
+ "model": "crm_acc.crm_account",
59
+ "ua": "Додати",
60
+ "form": "account_light.form"
61
+ },
62
+ "ua": "Замовник ПКД"
63
+ }
64
+ },
65
+ "label_style": "vertical"
66
+ }
67
+ ```
68
+
69
+ :::
@@ -0,0 +1,56 @@
1
+ # getMeta
2
+
3
+ ## Опис
4
+
5
+ Метадані таблиці
6
+
7
+ ```js
8
+ getMeta(table);
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ :::tabs
14
+ == params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ------- |
18
+ | table | String | Таблиця |
19
+
20
+ :::
21
+
22
+ ## Приклад
23
+
24
+ ```js
25
+ getMeta('gis.dataset')
26
+ ```
27
+
28
+ ## Відповідь
29
+
30
+ :::details Приклад відповіді
31
+
32
+ ```json
33
+ {
34
+ "pk": "dataset_id",
35
+ "columns": [
36
+ {
37
+ "name": "dataset_id",
38
+ "tableID": 7649248,
39
+ "columnID": 1,
40
+ "dataTypeID": 25,
41
+ "dataTypeSize": -1,
42
+ "dataTypeModifier": -1,
43
+ "format": "text"
44
+ },
45
+ {
46
+ "name": "dataset_name",
47
+ "tableID": 7649248,
48
+ "columnID": 2,
49
+ "dataTypeID": 25,
50
+ "dataTypeSize": -1,
51
+ "dataTypeModifier": -1,
52
+ "format": "text"
53
+ },
54
+
55
+ ```
56
+ :::
@@ -0,0 +1,39 @@
1
+ # getSelect
2
+
3
+ ## Опис
4
+
5
+ Отримує дані селекту.
6
+
7
+ ```js
8
+ getSelect(name)
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ :::tabs
14
+ == params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ------------- |
18
+ | name | String | Назва таблиці |
19
+
20
+ :::
21
+
22
+ ## Приклад
23
+
24
+ ```js
25
+ getSelect('storage.data')
26
+ ```
27
+
28
+ ## Відповідь
29
+
30
+ ::: details Приклад відповіді
31
+
32
+ ```json
33
+ {
34
+ "key": "data_id",
35
+ "original": "select data_id from storage.data"
36
+ }
37
+ ```
38
+
39
+ :::
@@ -0,0 +1,47 @@
1
+ # getSelectMeta
2
+
3
+ ## Опис
4
+
5
+ Отримує дані з класифікатора або селекта.
6
+
7
+ ```js
8
+ getSelectMeta(name)
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ :::tabs
14
+ == params
15
+
16
+ | Параметр | Тип | Опис |
17
+ | -------- | ------ | ------------- |
18
+ | name | String | Назва класифікатора/селекта |
19
+
20
+ :::
21
+ ## Приклад
22
+
23
+ ```js
24
+ getSelectMeta({name: 'test'})
25
+ ```
26
+
27
+ ## Відповідь
28
+
29
+ ::: details Приклад відповіді
30
+
31
+ ```json
32
+ {
33
+ "arr": [
34
+ {
35
+ "id": 1,
36
+ "text": "test"
37
+ },
38
+ {
39
+ "id": 2,
40
+ "text": "test2"
41
+ }
42
+ ]
43
+ }
44
+
45
+ ```
46
+
47
+ :::