@opengis/fastify-table 1.4.88 → 1.5.0
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/dist/config.js +33 -0
- package/dist/dblist.js +5 -0
- package/dist/index.js +170 -0
- package/dist/redactionList.js +6 -0
- package/dist/server/helpers/core/badge.js +16 -0
- package/dist/server/helpers/core/buttonFilePreview.js +12 -0
- package/dist/server/helpers/core/buttonHelper.js +20 -0
- package/{server → dist/server}/helpers/core/token.js +16 -18
- package/dist/server/helpers/format/formatAuto.js +14 -0
- package/dist/server/helpers/format/formatDate.js +231 -0
- package/{server → dist/server}/helpers/format/formatDigit.js +21 -21
- package/dist/server/helpers/format/formatNum.js +331 -0
- package/{server → dist/server}/helpers/format/formatNumber.js +50 -55
- package/dist/server/helpers/format/formatRelative.js +180 -0
- package/{server → dist/server}/helpers/format/formatUnit.js +41 -40
- package/{server → dist/server}/helpers/format/num_format.js +40 -44
- package/{server → dist/server}/helpers/format/set.js +26 -27
- package/{server → dist/server}/helpers/funcs/_math.js +49 -50
- package/{server → dist/server}/helpers/funcs/contentList.js +52 -57
- package/{server → dist/server}/helpers/funcs/empty.js +21 -21
- package/dist/server/helpers/funcs/ifCond.js +109 -0
- package/dist/server/helpers/funcs/ifCondAnd.js +109 -0
- package/dist/server/helpers/funcs/ifCondOr.js +110 -0
- package/{server → dist/server}/helpers/funcs/inc.js +19 -20
- package/{server → dist/server}/helpers/funcs/json.js +3 -3
- package/dist/server/helpers/funcs/qrcode.js +65 -0
- package/{server → dist/server}/helpers/funcs/round.js +27 -29
- package/dist/server/helpers/funcs/select.js +39 -0
- package/dist/server/helpers/index.js +125 -0
- package/dist/server/helpers/list/buttonHelper.js +20 -0
- package/{server → dist/server}/helpers/list/descriptionList.js +39 -45
- package/dist/server/helpers/list/tableList.js +104 -0
- package/{server → dist/server}/helpers/list/utils/button.js +3 -3
- package/{server → dist/server}/helpers/list/utils/buttonDel.js +8 -9
- package/{server → dist/server}/helpers/list/utils/buttonEdit.js +8 -9
- package/{server → dist/server}/helpers/string/coalesce.js +33 -39
- package/{server → dist/server}/helpers/string/concat.js +25 -28
- package/{server → dist/server}/helpers/string/split.js +19 -20
- package/{server → dist/server}/helpers/string/str_replace.js +57 -62
- package/{server → dist/server}/helpers/string/substr.js +28 -32
- package/{server → dist/server}/helpers/string/translit.js +20 -23
- package/dist/server/helpers/string/utils/alphabet.js +76 -0
- package/{server → dist/server}/helpers/utils/button.js +3 -3
- package/{server → dist/server}/helpers/utils/buttonAdd.js +4 -4
- package/{server → dist/server}/helpers/utils/buttonDel.js +11 -15
- package/{server → dist/server}/helpers/utils/buttonDownload.js +3 -3
- package/dist/server/helpers/utils/buttonEdit.js +14 -0
- package/{server → dist/server}/helpers/utils/buttonPreview.js +3 -3
- package/{server → dist/server}/helpers/utils/mdToHTML.js +16 -17
- package/{server → dist/server}/helpers/utils/paddingNumber.js +5 -5
- package/dist/server/plugins/access/funcs/getAdminAccess.js +11 -0
- package/dist/server/plugins/cron/cronList.js +2 -0
- package/dist/server/plugins/cron/funcs/addCron.js +41 -0
- package/{server → dist/server}/plugins/cron/funcs/interval2ms.js +36 -40
- package/dist/server/plugins/cron/funcs/runCron.js +20 -0
- package/{server → dist/server}/plugins/cron/funcs/verifyUnique.js +19 -23
- package/dist/server/plugins/cron/index.js +75 -0
- package/dist/server/plugins/crud/funcs/dataDelete.js +87 -0
- package/dist/server/plugins/crud/funcs/dataInsert.js +134 -0
- package/dist/server/plugins/crud/funcs/dataUpdate.js +198 -0
- package/dist/server/plugins/crud/funcs/getAccess.js +82 -0
- package/dist/server/plugins/crud/funcs/getOpt.js +13 -0
- package/dist/server/plugins/crud/funcs/getToken.js +24 -0
- package/dist/server/plugins/crud/funcs/isFileExists.js +11 -0
- package/dist/server/plugins/crud/funcs/setOpt.js +19 -0
- package/dist/server/plugins/crud/funcs/setToken.js +41 -0
- package/dist/server/plugins/crud/funcs/utils/getFolder.js +13 -0
- package/dist/server/plugins/crud/funcs/utils/getInsertQuery.js +54 -0
- package/dist/server/plugins/crud/funcs/utils/logChanges.js +144 -0
- package/{server → dist/server}/plugins/crud/funcs/validateData.js +91 -83
- package/dist/server/plugins/extra/extraData.js +81 -0
- package/dist/server/plugins/extra/extraDataGet.js +52 -0
- package/dist/server/plugins/file/downloadFile.js +15 -0
- package/{server → dist/server}/plugins/file/getExport.js +18 -38
- package/dist/server/plugins/file/isFileExists.js +13 -0
- package/dist/server/plugins/file/providers/fs.js +86 -0
- package/dist/server/plugins/file/providers/index.js +28 -0
- package/dist/server/plugins/file/providers/mime/index.js +7 -0
- package/dist/server/plugins/file/providers/mime/mimes.js +1179 -0
- package/dist/server/plugins/file/providers/s3/client.js +26 -0
- package/dist/server/plugins/file/providers/s3/funcs/downloadFile.js +42 -0
- package/dist/server/plugins/file/providers/s3/funcs/fileExists.js +24 -0
- package/dist/server/plugins/file/providers/s3/funcs/uploadFile.js +35 -0
- package/dist/server/plugins/file/providers/s3/funcs/utils/getS3FilePath.js +18 -0
- package/{server → dist/server}/plugins/file/providers/s3/index.js +11 -12
- package/dist/server/plugins/file/providers/utils/getDataSize.js +19 -0
- package/dist/server/plugins/file/providers/utils/getValidData.js +30 -0
- package/dist/server/plugins/file/providers/utils/handlers/dataTypes.js +7 -0
- package/dist/server/plugins/file/providers/utils/handlers/index.js +50 -0
- package/dist/server/plugins/file/providers/utils/handlers/sizeHandlers.js +9 -0
- package/dist/server/plugins/file/providers/utils/streamToBuffer.js +7 -0
- package/{server → dist/server}/plugins/file/providers/utils/typeguards/isArray.js +2 -3
- package/{server → dist/server}/plugins/file/providers/utils/typeguards/isBuffer.js +2 -3
- package/dist/server/plugins/file/providers/utils/typeguards/isPath.js +3 -0
- package/dist/server/plugins/file/providers/utils/typeguards/isReadableStream.js +7 -0
- package/{server → dist/server}/plugins/file/providers/utils/typeguards/isText.js +2 -3
- package/dist/server/plugins/file/uploadFile.js +14 -0
- package/dist/server/plugins/file/uploadMultiPart.js +101 -0
- package/dist/server/plugins/file/utils/allowedExtensions.js +60 -0
- package/{server → dist/server}/plugins/file/utils/getFileType.js +12 -10
- package/dist/server/plugins/file/utils/getPath.js +30 -0
- package/dist/server/plugins/file/utils/isFileExists.js +15 -0
- package/dist/server/plugins/grpc/file2json.js +50 -0
- package/dist/server/plugins/grpc/grpc.js +103 -0
- package/dist/server/plugins/grpc/office2pdf.js +78 -0
- package/dist/server/plugins/grpc/utils/csv2xls.js +6 -0
- package/dist/server/plugins/grpc/utils/excel2Json.js +10 -0
- package/dist/server/plugins/grpc/utils/html2doc.js +17 -0
- package/dist/server/plugins/grpc/utils/html2img.js +17 -0
- package/dist/server/plugins/grpc/utils/html2pdf.js +19 -0
- package/{server → dist/server}/plugins/grpc/utils/htmlTemplate.js +3 -4
- package/dist/server/plugins/grpc/utils/json2xls.js +11 -0
- package/dist/server/plugins/grpc/utils/mergePdf.js +18 -0
- package/dist/server/plugins/hook/funcs/addHook.js +7 -0
- package/dist/server/plugins/hook/funcs/applyHook.js +25 -0
- package/dist/server/plugins/hook/funcs/applyHookSync.js +7 -0
- package/dist/server/plugins/hook/hookList.js +2 -0
- package/{server → dist/server}/plugins/hook/index.js +7 -8
- package/dist/server/plugins/logger/createFileStream.js +79 -0
- package/dist/server/plugins/logger/errorMessage.js +24 -0
- package/dist/server/plugins/logger/errorStatus.js +17 -0
- package/dist/server/plugins/logger/getHooks.js +17 -0
- package/dist/server/plugins/logger/getLogger.js +52 -0
- package/dist/server/plugins/logger/index.js +37 -0
- package/dist/server/plugins/logger/labels.js +10 -0
- package/dist/server/plugins/logger/serializers.js +22 -0
- package/{server → dist/server}/plugins/logger/timestampWithTimeZone.js +5 -5
- package/dist/server/plugins/md/funcs/formatMdoc.js +45 -0
- package/{server → dist/server}/plugins/md/funcs/mdToHTML.js +16 -17
- package/dist/server/plugins/metric/index.js +6 -0
- package/dist/server/plugins/metric/loggerSystem.js +127 -0
- package/dist/server/plugins/metric/systemMetricsFifthly.js +20 -0
- package/dist/server/plugins/migration/exec.migrations.js +59 -0
- package/dist/server/plugins/migration/exec.sql.js +61 -0
- package/{server → dist/server}/plugins/migration/index.js +5 -7
- package/dist/server/plugins/pg/funcs/autoIndex.js +102 -0
- package/{server → dist/server}/plugins/pg/funcs/getDBParams.js +16 -15
- package/dist/server/plugins/pg/funcs/getMeta.js +48 -0
- package/dist/server/plugins/pg/funcs/getPG.js +39 -0
- package/dist/server/plugins/pg/funcs/getPGAsync.js +45 -0
- package/dist/server/plugins/pg/funcs/init.js +157 -0
- package/dist/server/plugins/pg/index.js +47 -0
- package/dist/server/plugins/pg/pgClients.js +20 -0
- package/dist/server/plugins/policy/funcs/checkPolicy.js +173 -0
- package/dist/server/plugins/policy/funcs/checkXSS.js +44 -0
- package/dist/server/plugins/policy/index.js +11 -0
- package/dist/server/plugins/policy/sqlInjection.js +33 -0
- package/dist/server/plugins/policy/xssInjection.js +72 -0
- package/{server → dist/server}/plugins/redis/client.js +6 -8
- package/dist/server/plugins/redis/funcs/getRedis.js +23 -0
- package/{server → dist/server}/plugins/redis/funcs/redisClients.js +2 -3
- package/dist/server/plugins/redis/index.js +8 -0
- package/dist/server/plugins/sqlite/funcs/getSqlite.js +27 -0
- package/dist/server/plugins/sqlite/funcs/init.js +45 -0
- package/dist/server/plugins/sqlite/index.js +8 -0
- package/dist/server/plugins/sqlite/sqliteClients.js +24 -0
- package/dist/server/plugins/table/funcs/addMenu.js +12 -0
- package/dist/server/plugins/table/funcs/addTemplateDir.js +16 -0
- package/dist/server/plugins/table/funcs/customTokens.js +2 -0
- package/dist/server/plugins/table/funcs/getData.js +25 -0
- package/dist/server/plugins/table/funcs/getFilter.js +18 -0
- package/dist/server/plugins/table/funcs/getFilterSQL/index.js +201 -0
- package/dist/server/plugins/table/funcs/getFilterSQL/util/formatValue.js +131 -0
- package/dist/server/plugins/table/funcs/getFilterSQL/util/getCustomQuery.js +11 -0
- package/dist/server/plugins/table/funcs/getFilterSQL/util/getFilterQuery.js +84 -0
- package/dist/server/plugins/table/funcs/getFilterSQL/util/getOptimizedQuery.js +11 -0
- package/dist/server/plugins/table/funcs/getFilterSQL/util/getRangeQuery.js +161 -0
- package/dist/server/plugins/table/funcs/getFilterSQL/util/getTableSql.js +40 -0
- package/dist/server/plugins/table/funcs/getSelect.js +37 -0
- package/dist/server/plugins/table/funcs/getSelectMeta.js +77 -0
- package/dist/server/plugins/table/funcs/getTemplate.js +86 -0
- package/dist/server/plugins/table/funcs/getTemplatePath.js +60 -0
- package/dist/server/plugins/table/funcs/getTemplateSync.js +84 -0
- package/dist/server/plugins/table/funcs/getTemplates.js +15 -0
- package/dist/server/plugins/table/funcs/gisIRColumn.js +81 -0
- package/dist/server/plugins/table/funcs/loadTemplate.js +2 -0
- package/dist/server/plugins/table/funcs/loadTemplatePath.js +2 -0
- package/dist/server/plugins/table/funcs/menuDirs.js +2 -0
- package/dist/server/plugins/table/funcs/metaFormat/getSelectVal.js +75 -0
- package/dist/server/plugins/table/funcs/metaFormat/index.js +64 -0
- package/dist/server/plugins/table/funcs/userTemplateDir.js +2 -0
- package/dist/server/plugins/table/funcs/userTokens.js +2 -0
- package/dist/server/plugins/util/funcs/eventStream.js +28 -0
- package/{server → dist/server}/plugins/util/funcs/flattenObject.js +14 -12
- package/{server → dist/server}/plugins/util/funcs/unflattenObject.js +48 -46
- package/{server → dist/server}/plugins/yml/funcs/json2yml.js +3 -5
- package/{server → dist/server}/plugins/yml/funcs/yml2json.js +11 -14
- package/{server → dist/server}/routes/access/controllers/access.group.js +17 -23
- package/{server → dist/server}/routes/access/controllers/access.group.post.js +46 -53
- package/dist/server/routes/access/controllers/access.interface.js +36 -0
- package/{server/routes/access/index.mjs → dist/server/routes/access/index.js} +10 -12
- package/{server/routes/access/schema.mjs → dist/server/routes/access/schema.js} +65 -68
- package/dist/server/routes/cron/controllers/cronApi.js +16 -0
- package/dist/server/routes/cron/index.js +15 -0
- package/dist/server/routes/crud/controllers/deleteCrud.js +90 -0
- package/dist/server/routes/crud/controllers/insert.js +110 -0
- package/dist/server/routes/crud/controllers/table.js +144 -0
- package/dist/server/routes/crud/controllers/update.js +113 -0
- package/dist/server/routes/crud/index.js +22 -0
- package/dist/server/routes/dblist/controllers/readItems.js +25 -0
- package/dist/server/routes/dblist/controllers/setItem.js +20 -0
- package/dist/server/routes/dblist/index.js +17 -0
- package/dist/server/routes/dblist/utils/formatData.js +8 -0
- package/dist/server/routes/file/controllers/delete.js +99 -0
- package/dist/server/routes/file/controllers/download.js +56 -0
- package/dist/server/routes/file/controllers/export.js +294 -0
- package/dist/server/routes/file/controllers/files.js +57 -0
- package/dist/server/routes/file/controllers/resize.js +86 -0
- package/dist/server/routes/file/controllers/resizeAll.js +140 -0
- package/dist/server/routes/file/controllers/upload.js +56 -0
- package/dist/server/routes/file/controllers/uploadImage.js +45 -0
- package/dist/server/routes/file/controllers/utils/formatResult.js +13 -0
- package/dist/server/routes/file/controllers/utils/jsonToCsv.js +40 -0
- package/dist/server/routes/file/controllers/utils/jsonToXls.js +37 -0
- package/dist/server/routes/file/index.js +22 -0
- package/dist/server/routes/file/schema.js +14 -0
- package/dist/server/routes/grpc/controllers/file2geojson.js +54 -0
- package/dist/server/routes/grpc/controllers/filePreview.js +87 -0
- package/dist/server/routes/grpc/index.js +9 -0
- package/dist/server/routes/logger/controllers/logger.file.js +81 -0
- package/dist/server/routes/logger/controllers/logger.test.api.js +42 -0
- package/dist/server/routes/logger/controllers/utils/checkUserAccess.js +22 -0
- package/dist/server/routes/logger/controllers/utils/getRootDir.js +25 -0
- package/dist/server/routes/logger/index.js +18 -0
- package/dist/server/routes/menu/controllers/getMenu.js +98 -0
- package/dist/server/routes/menu/controllers/interfaces.js +18 -0
- package/dist/server/routes/menu/index.js +7 -0
- package/dist/server/routes/properties/controllers/properties.get.js +23 -0
- package/dist/server/routes/properties/controllers/properties.post.js +68 -0
- package/dist/server/routes/properties/index.js +21 -0
- package/dist/server/routes/table/controllers/card.js +79 -0
- package/dist/server/routes/table/controllers/cardData.js +161 -0
- package/dist/server/routes/table/controllers/cardTabData.js +49 -0
- package/dist/server/routes/table/controllers/dataInfo.js +57 -0
- package/dist/server/routes/table/controllers/filter.js +181 -0
- package/dist/server/routes/table/controllers/form.js +41 -0
- package/{server → dist/server}/routes/table/controllers/getFormByTable.js +105 -125
- package/dist/server/routes/table/controllers/search.js +80 -0
- package/dist/server/routes/table/controllers/suggest.js +242 -0
- package/dist/server/routes/table/controllers/tableData.js +88 -0
- package/dist/server/routes/table/controllers/tableInfo.js +112 -0
- package/dist/server/routes/table/controllers/tokenInfo.js +10 -0
- package/dist/server/routes/table/controllers/utils/conditions.js +30 -0
- package/dist/server/routes/table/controllers/utils/formatSchema.js +35 -0
- package/dist/server/routes/table/controllers/utils/locales.js +2 -0
- package/dist/server/routes/table/functions/getData.js +584 -0
- package/dist/server/routes/table/index.js +44 -0
- package/dist/server/routes/table/schema.js +117 -0
- package/dist/server/routes/templates/controllers/getTemplate.js +65 -0
- package/dist/server/routes/templates/index.js +7 -0
- package/{server → dist/server}/routes/templates/schema.js +11 -12
- package/dist/server/routes/util/controllers/code.generator.js +75 -0
- package/dist/server/routes/util/controllers/next.id.js +4 -0
- package/dist/server/routes/util/controllers/status.monitor.js +6 -0
- package/dist/server/routes/util/controllers/user.tokens.js +32 -0
- package/dist/server/routes/util/index.js +13 -0
- package/dist/server/routes/widget/controllers/file.edit.js +48 -0
- package/dist/server/routes/widget/controllers/widget.del.js +84 -0
- package/dist/server/routes/widget/controllers/widget.get.js +164 -0
- package/dist/server/routes/widget/controllers/widget.set.js +117 -0
- package/dist/server/routes/widget/hook/onWidgetSet.js +10 -0
- package/dist/server/routes/widget/index.js +42 -0
- package/dist/server/types/core.js +12 -0
- package/dist/utils.js +93 -0
- package/package.json +24 -17
- package/config.js +0 -37
- package/dblist.js +0 -5
- package/index.js +0 -193
- package/redactionList.js +0 -7
- package/server/helpers/core/badge.js +0 -14
- package/server/helpers/core/buttonFilePreview.js +0 -12
- package/server/helpers/core/buttonHelper.js +0 -22
- package/server/helpers/format/formatAuto.js +0 -13
- package/server/helpers/format/formatDate.js +0 -258
- package/server/helpers/format/formatNum.js +0 -365
- package/server/helpers/format/formatRelative.js +0 -106
- package/server/helpers/funcs/ifCond.js +0 -109
- package/server/helpers/funcs/ifCondAnd.js +0 -114
- package/server/helpers/funcs/ifCondOr.js +0 -115
- package/server/helpers/funcs/qrcode.js +0 -68
- package/server/helpers/funcs/select.js +0 -46
- package/server/helpers/index.js +0 -137
- package/server/helpers/list/buttonHelper.js +0 -22
- package/server/helpers/list/tableList.js +0 -87
- package/server/helpers/string/utils/alphabet.js +0 -76
- package/server/helpers/utils/buttonEdit.js +0 -17
- package/server/migrations/0.sql +0 -84
- package/server/migrations/cls.sql +0 -40
- package/server/migrations/context.sql +0 -135
- package/server/migrations/crm.sql +0 -155
- package/server/migrations/log.sql +0 -87
- package/server/migrations/properties.sql +0 -115
- package/server/migrations/roles.sql +0 -191
- package/server/migrations/template.sql +0 -44
- package/server/migrations/users.sql +0 -176
- package/server/plugins/access/funcs/getAdminAccess.js +0 -14
- package/server/plugins/access/index.mjs +0 -6
- package/server/plugins/cron/cronList.js +0 -1
- package/server/plugins/cron/funcs/addCron.js +0 -52
- package/server/plugins/cron/funcs/runCron.js +0 -24
- package/server/plugins/cron/index.js +0 -77
- package/server/plugins/crud/funcs/dataDelete.js +0 -86
- package/server/plugins/crud/funcs/dataInsert.js +0 -131
- package/server/plugins/crud/funcs/dataUpdate.js +0 -179
- package/server/plugins/crud/funcs/getAccess.js +0 -94
- package/server/plugins/crud/funcs/getOpt.js +0 -14
- package/server/plugins/crud/funcs/getToken.js +0 -33
- package/server/plugins/crud/funcs/isFileExists.js +0 -13
- package/server/plugins/crud/funcs/setOpt.js +0 -21
- package/server/plugins/crud/funcs/setToken.js +0 -43
- package/server/plugins/crud/funcs/utils/getFolder.js +0 -11
- package/server/plugins/crud/funcs/utils/getInsertQuery.js +0 -44
- package/server/plugins/crud/funcs/utils/logChanges.js +0 -121
- package/server/plugins/crud/index.js +0 -23
- package/server/plugins/extra/extraData.js +0 -79
- package/server/plugins/extra/extraDataGet.js +0 -56
- package/server/plugins/file/downloadFile.js +0 -18
- package/server/plugins/file/isFileExists.js +0 -17
- package/server/plugins/file/providers/fs.js +0 -100
- package/server/plugins/file/providers/index.d.ts +0 -49
- package/server/plugins/file/providers/index.js +0 -36
- package/server/plugins/file/providers/mime/index.js +0 -12
- package/server/plugins/file/providers/mime/mimes.js +0 -1180
- package/server/plugins/file/providers/s3/client.js +0 -41
- package/server/plugins/file/providers/s3/funcs/downloadFile.js +0 -50
- package/server/plugins/file/providers/s3/funcs/fileExists.js +0 -32
- package/server/plugins/file/providers/s3/funcs/uploadFile.js +0 -46
- package/server/plugins/file/providers/s3/funcs/utils/getS3FilePath.js +0 -23
- package/server/plugins/file/providers/utils/getDataSize.js +0 -20
- package/server/plugins/file/providers/utils/getValidData.js +0 -32
- package/server/plugins/file/providers/utils/handlers/dataTypes.js +0 -8
- package/server/plugins/file/providers/utils/handlers/index.js +0 -53
- package/server/plugins/file/providers/utils/handlers/sizeHandlers.js +0 -11
- package/server/plugins/file/providers/utils/streamToBuffer.js +0 -8
- package/server/plugins/file/providers/utils/typeguards/isPath.js +0 -5
- package/server/plugins/file/providers/utils/typeguards/isReadableStream.js +0 -8
- package/server/plugins/file/uploadFile.js +0 -19
- package/server/plugins/file/uploadMultiPart.js +0 -131
- package/server/plugins/file/utils/allowedExtensions.js +0 -25
- package/server/plugins/file/utils/getPath.js +0 -25
- package/server/plugins/file/utils/isFileExists.js +0 -16
- package/server/plugins/grpc/file2json.js +0 -54
- package/server/plugins/grpc/grpc.js +0 -125
- package/server/plugins/grpc/office2pdf.js +0 -91
- package/server/plugins/grpc/utils/csv2xls.js +0 -8
- package/server/plugins/grpc/utils/excel2Json.js +0 -8
- package/server/plugins/grpc/utils/html2doc.js +0 -19
- package/server/plugins/grpc/utils/html2img.js +0 -18
- package/server/plugins/grpc/utils/html2pdf.js +0 -23
- package/server/plugins/grpc/utils/json2xls.js +0 -13
- package/server/plugins/grpc/utils/mergePdf.js +0 -20
- package/server/plugins/hook/funcs/addHook.js +0 -8
- package/server/plugins/hook/funcs/applyHook.js +0 -25
- package/server/plugins/hook/funcs/applyHookSync.js +0 -9
- package/server/plugins/hook/hookList.js +0 -1
- package/server/plugins/logger/createFileStream.js +0 -88
- package/server/plugins/logger/errorMessage.js +0 -25
- package/server/plugins/logger/errorStatus.js +0 -19
- package/server/plugins/logger/getHooks.js +0 -21
- package/server/plugins/logger/getLogger.js +0 -58
- package/server/plugins/logger/index.js +0 -33
- package/server/plugins/logger/labels.js +0 -11
- package/server/plugins/logger/serializers.js +0 -25
- package/server/plugins/md/funcs/formatMdoc.js +0 -40
- package/server/plugins/metric/index.js +0 -8
- package/server/plugins/metric/loggerSystem.js +0 -131
- package/server/plugins/metric/systemMetricsFifthly.js +0 -24
- package/server/plugins/migration/exec.migrations.js +0 -63
- package/server/plugins/migration/exec.sql.js +0 -67
- package/server/plugins/pg/funcs/autoIndex.js +0 -103
- package/server/plugins/pg/funcs/getMeta.js +0 -49
- package/server/plugins/pg/funcs/getPG.js +0 -42
- package/server/plugins/pg/funcs/getPGAsync.js +0 -62
- package/server/plugins/pg/funcs/init.js +0 -117
- package/server/plugins/pg/index.js +0 -54
- package/server/plugins/pg/pgClients.js +0 -22
- package/server/plugins/policy/funcs/checkPolicy.js +0 -127
- package/server/plugins/policy/funcs/checkXSS.js +0 -37
- package/server/plugins/policy/index.js +0 -11
- package/server/plugins/policy/sqlInjection.js +0 -34
- package/server/plugins/policy/xssInjection.js +0 -73
- package/server/plugins/redis/funcs/getRedis.js +0 -25
- package/server/plugins/redis/index.js +0 -17
- package/server/plugins/sqlite/funcs/getSqlite.js +0 -39
- package/server/plugins/sqlite/funcs/init.js +0 -53
- package/server/plugins/sqlite/index.js +0 -11
- package/server/plugins/sqlite/sqliteClients.js +0 -26
- package/server/plugins/table/funcs/addMenu.js +0 -16
- package/server/plugins/table/funcs/addTemplateDir.js +0 -19
- package/server/plugins/table/funcs/customTokens.js +0 -1
- package/server/plugins/table/funcs/getData.js +0 -14
- package/server/plugins/table/funcs/getFilter.js +0 -14
- package/server/plugins/table/funcs/getFilterSQL/index.js +0 -163
- package/server/plugins/table/funcs/getFilterSQL/util/formatValue.js +0 -136
- package/server/plugins/table/funcs/getFilterSQL/util/getCustomQuery.js +0 -13
- package/server/plugins/table/funcs/getFilterSQL/util/getFilterQuery.js +0 -75
- package/server/plugins/table/funcs/getFilterSQL/util/getOptimizedQuery.js +0 -12
- package/server/plugins/table/funcs/getFilterSQL/util/getRangeQuery.js +0 -156
- package/server/plugins/table/funcs/getFilterSQL/util/getTableSql.js +0 -34
- package/server/plugins/table/funcs/getSelect.js +0 -31
- package/server/plugins/table/funcs/getSelectMeta.js +0 -74
- package/server/plugins/table/funcs/getTemplate.js +0 -88
- package/server/plugins/table/funcs/getTemplatePath.js +0 -60
- package/server/plugins/table/funcs/getTemplateSync.js +0 -87
- package/server/plugins/table/funcs/getTemplates.js +0 -19
- package/server/plugins/table/funcs/gisIRColumn.js +0 -82
- package/server/plugins/table/funcs/loadTemplate.js +0 -1
- package/server/plugins/table/funcs/loadTemplatePath.js +0 -1
- package/server/plugins/table/funcs/menuDirs.js +0 -1
- package/server/plugins/table/funcs/metaFormat/getSelectVal.js +0 -61
- package/server/plugins/table/funcs/metaFormat/index.js +0 -49
- package/server/plugins/table/funcs/userTemplateDir.js +0 -1
- package/server/plugins/table/funcs/userTokens.js +0 -1
- package/server/plugins/table/index.js +0 -13
- package/server/plugins/util/funcs/eventStream.js +0 -29
- package/server/plugins/util/index.js +0 -7
- package/server/routes/access/controllers/access.interface.js +0 -37
- package/server/routes/cron/controllers/cronApi.js +0 -22
- package/server/routes/cron/index.js +0 -19
- package/server/routes/crud/controllers/deleteCrud.js +0 -84
- package/server/routes/crud/controllers/insert.js +0 -103
- package/server/routes/crud/controllers/table.js +0 -116
- package/server/routes/crud/controllers/update.js +0 -108
- package/server/routes/crud/index.js +0 -26
- package/server/routes/dblist/controllers/readItems.js +0 -28
- package/server/routes/dblist/controllers/setItem.js +0 -25
- package/server/routes/dblist/index.mjs +0 -19
- package/server/routes/dblist/utils/formatData.js +0 -7
- package/server/routes/file/controllers/delete.js +0 -108
- package/server/routes/file/controllers/download.js +0 -66
- package/server/routes/file/controllers/export.js +0 -290
- package/server/routes/file/controllers/files.js +0 -72
- package/server/routes/file/controllers/resize.js +0 -96
- package/server/routes/file/controllers/resizeAll.js +0 -165
- package/server/routes/file/controllers/upload.js +0 -55
- package/server/routes/file/controllers/uploadImage.js +0 -47
- package/server/routes/file/controllers/utils/formatResult.js +0 -17
- package/server/routes/file/controllers/utils/jsonToCsv.js +0 -36
- package/server/routes/file/controllers/utils/jsonToXls.js +0 -42
- package/server/routes/file/index.mjs +0 -26
- package/server/routes/file/schema.js +0 -16
- package/server/routes/grpc/controllers/file2geojson.js +0 -60
- package/server/routes/grpc/controllers/filePreview.js +0 -89
- package/server/routes/grpc/index.mjs +0 -12
- package/server/routes/logger/controllers/logger.file.js +0 -97
- package/server/routes/logger/controllers/logger.test.api.js +0 -48
- package/server/routes/logger/controllers/utils/checkUserAccess.js +0 -24
- package/server/routes/logger/controllers/utils/getRootDir.js +0 -27
- package/server/routes/logger/index.js +0 -22
- package/server/routes/menu/controllers/getMenu.js +0 -98
- package/server/routes/menu/controllers/interfaces.js +0 -21
- package/server/routes/menu/index.mjs +0 -8
- package/server/routes/menu/schema.js +0 -0
- package/server/routes/properties/controllers/properties.get.js +0 -33
- package/server/routes/properties/controllers/properties.post.js +0 -76
- package/server/routes/properties/index.js +0 -25
- package/server/routes/table/controllers/card.js +0 -77
- package/server/routes/table/controllers/cardData.js +0 -155
- package/server/routes/table/controllers/cardTabData.js +0 -57
- package/server/routes/table/controllers/dataInfo.js +0 -56
- package/server/routes/table/controllers/filter.js +0 -154
- package/server/routes/table/controllers/form.js +0 -42
- package/server/routes/table/controllers/search.js +0 -74
- package/server/routes/table/controllers/suggest.js +0 -246
- package/server/routes/table/controllers/tableData.js +0 -62
- package/server/routes/table/controllers/tableInfo.js +0 -110
- package/server/routes/table/controllers/tokenInfo.js +0 -12
- package/server/routes/table/controllers/utils/conditions.js +0 -21
- package/server/routes/table/controllers/utils/formatSchema.js +0 -23
- package/server/routes/table/controllers/utils/locales.js +0 -1
- package/server/routes/table/functions/getData.js +0 -436
- package/server/routes/table/index.js +0 -57
- package/server/routes/table/schema.js +0 -127
- package/server/routes/templates/controllers/getTemplate.js +0 -51
- package/server/routes/templates/index.mjs +0 -10
- package/server/routes/util/controllers/code.generator.js +0 -94
- package/server/routes/util/controllers/next.id.js +0 -4
- package/server/routes/util/controllers/status.monitor.js +0 -8
- package/server/routes/util/controllers/user.tokens.js +0 -45
- package/server/routes/util/index.js +0 -14
- package/server/routes/widget/controllers/file.edit.js +0 -55
- package/server/routes/widget/controllers/widget.del.js +0 -99
- package/server/routes/widget/controllers/widget.get.js +0 -156
- package/server/routes/widget/controllers/widget.set.js +0 -108
- package/server/routes/widget/hook/onWidgetSet.js +0 -13
- package/server/routes/widget/index.mjs +0 -38
- package/utils.js +0 -112
- /package/{server → dist/server}/plugins/grpc/utils/convertp.proto +0 -0
- /package/{server → dist/server}/plugins/grpc/utils/office2pdf.proto +0 -0
package/server/helpers/index.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/* eslint-disable prefer-rest-params */
|
|
2
|
-
import handlebarsSync from 'handlebars';
|
|
3
|
-
import promisedHandlebars from 'promised-handlebars';
|
|
4
|
-
|
|
5
|
-
import logger from '../plugins/logger/getLogger.js';
|
|
6
|
-
|
|
7
|
-
const handlebars = promisedHandlebars(handlebarsSync);
|
|
8
|
-
|
|
9
|
-
// funcs
|
|
10
|
-
import _math from './funcs/_math.js';
|
|
11
|
-
import ifCond from './funcs/ifCond.js';
|
|
12
|
-
import ifCondAnd from './funcs/ifCondAnd.js';
|
|
13
|
-
import ifCondOr from './funcs/ifCondOr.js';
|
|
14
|
-
import qrcode from './funcs/qrcode.js';
|
|
15
|
-
import select from './funcs/select.js';
|
|
16
|
-
import json from './funcs/json.js';
|
|
17
|
-
import empty from './funcs/empty.js';
|
|
18
|
-
import round from './funcs/round.js';
|
|
19
|
-
import contentList from './funcs/contentList.js';
|
|
20
|
-
import inc from './funcs/inc.js';
|
|
21
|
-
|
|
22
|
-
// format
|
|
23
|
-
import formatAuto from './format/formatAuto.js';
|
|
24
|
-
import formatDate from './format/formatDate.js';
|
|
25
|
-
import formatDigit from './format/formatDigit.js';
|
|
26
|
-
import formatNum from './format/formatNum.js';
|
|
27
|
-
import formatNumber from './format/formatNumber.js';
|
|
28
|
-
import formatRelative from './format/formatRelative.js';
|
|
29
|
-
import formatUnit from './format/formatUnit.js';
|
|
30
|
-
import numFormat from './format/num_format.js';
|
|
31
|
-
import set from './format/set.js';
|
|
32
|
-
|
|
33
|
-
// string
|
|
34
|
-
import strReplace from './string/str_replace.js';
|
|
35
|
-
import coalesce from './string/coalesce.js';
|
|
36
|
-
import concat from './string/concat.js';
|
|
37
|
-
import split from './string/split.js';
|
|
38
|
-
import translit from './string/translit.js';
|
|
39
|
-
import substr from './string/substr.js';
|
|
40
|
-
|
|
41
|
-
// from npm/admin
|
|
42
|
-
import token from './core/token.js';
|
|
43
|
-
import descriptionList from './list/descriptionList.js';
|
|
44
|
-
import tableList from './list/tableList.js';
|
|
45
|
-
import buttonHelper from './core/buttonHelper.js';
|
|
46
|
-
import buttonFilePreview from './core/buttonFilePreview.js';
|
|
47
|
-
import badge from './core/badge.js';
|
|
48
|
-
import mdToHTML from './utils/mdToHTML.js';
|
|
49
|
-
import paddingNumber from './utils/paddingNumber.js';
|
|
50
|
-
|
|
51
|
-
function getKeysRecursive(obj, prefix = '') {
|
|
52
|
-
if (!obj || typeof obj !== 'object' || obj?.constructor?.name !== 'Object') return [];
|
|
53
|
-
const obj1 = Array.isArray(obj) ? obj[0] : obj;
|
|
54
|
-
return Object.keys(obj1 || {}).reduce((acc, curr) => {
|
|
55
|
-
const fullKey = prefix ? `${prefix}.${curr}` : curr;
|
|
56
|
-
acc.push(curr);
|
|
57
|
-
if (obj1[curr] && typeof obj1[curr] === 'object' && curr !== 'coordinates') {
|
|
58
|
-
acc.push(...(getKeysRecursive(obj1[curr], fullKey)));
|
|
59
|
-
}
|
|
60
|
-
return acc;
|
|
61
|
-
}, []);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// avoid unhandled exception if helper not registered
|
|
65
|
-
handlebars.registerHelper('helperMissing', function hm() {
|
|
66
|
-
const options = arguments[arguments.length - 1];
|
|
67
|
-
const args = Array.prototype.slice.call(arguments, 0, arguments.length - 1);
|
|
68
|
-
const keys = getKeysRecursive(options.data?.root);
|
|
69
|
-
if (args.length || !keys.includes(options.name)) {
|
|
70
|
-
logger.file('handlebars/error', { message: `Missing helper "${options.name}" at "${JSON.stringify(args).substring(0, 10)}"` });
|
|
71
|
-
return args;
|
|
72
|
-
}
|
|
73
|
-
return args;
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// format
|
|
77
|
-
handlebars.registerHelper('formatAuto', formatAuto);
|
|
78
|
-
handlebars.registerHelper('formatDate', formatDate);
|
|
79
|
-
handlebars.registerHelper('formatDigit', formatDigit);
|
|
80
|
-
handlebars.registerHelper('formatNum', formatNum);
|
|
81
|
-
handlebars.registerHelper('formatNumber', formatNumber);
|
|
82
|
-
handlebars.registerHelper('formatRelative', formatRelative);
|
|
83
|
-
handlebars.registerHelper('formatUnit', formatUnit);
|
|
84
|
-
handlebars.registerHelper('num_format', numFormat);
|
|
85
|
-
handlebars.registerHelper('set', set);
|
|
86
|
-
|
|
87
|
-
// string
|
|
88
|
-
handlebars.registerHelper('str_replace', strReplace);
|
|
89
|
-
handlebars.registerHelper('coalesce', coalesce);
|
|
90
|
-
handlebars.registerHelper('concat', concat);
|
|
91
|
-
handlebars.registerHelper('split', split);
|
|
92
|
-
handlebars.registerHelper('translit', translit);
|
|
93
|
-
handlebars.registerHelper('substr', substr);
|
|
94
|
-
handlebars.registerHelper('mls', (value) => value);
|
|
95
|
-
|
|
96
|
-
// funcs
|
|
97
|
-
handlebars.registerHelper('json', json);
|
|
98
|
-
handlebars.registerHelper('_math', _math);
|
|
99
|
-
handlebars.registerHelper('ifCond', ifCond);
|
|
100
|
-
handlebars.registerHelper('ifCondAnd', ifCondAnd);
|
|
101
|
-
handlebars.registerHelper('ifCondOr', ifCondOr);
|
|
102
|
-
handlebars.registerHelper('select', select);
|
|
103
|
-
handlebars.registerHelper('empty', empty);
|
|
104
|
-
handlebars.registerHelper('round', round);
|
|
105
|
-
handlebars.registerHelper('contentList', contentList);
|
|
106
|
-
handlebars.registerHelper('inc', inc);
|
|
107
|
-
handlebars.registerHelper('qrcode', qrcode);
|
|
108
|
-
|
|
109
|
-
// Підтримка старого коду
|
|
110
|
-
handlebars.registerHelper('qrcode-generator-base64', qrcode);
|
|
111
|
-
|
|
112
|
-
// from npm/admin
|
|
113
|
-
handlebars.registerHelper('token', token);
|
|
114
|
-
handlebars.registerHelper('mdToHTML', mdToHTML);
|
|
115
|
-
handlebars.registerHelper('descriptionList', descriptionList);
|
|
116
|
-
handlebars.registerHelper('tableList', tableList);
|
|
117
|
-
handlebars.registerHelper('button', buttonHelper);
|
|
118
|
-
handlebars.registerHelper('buttonFilePreview', buttonFilePreview);
|
|
119
|
-
handlebarsSync.registerHelper('buttonFilePreview', buttonFilePreview);
|
|
120
|
-
handlebars.registerHelper('select', select);
|
|
121
|
-
handlebars.registerHelper('badge', badge);
|
|
122
|
-
handlebars.registerHelper('contentList', contentList);
|
|
123
|
-
handlebarsSync.registerHelper('ifCond', ifCond);
|
|
124
|
-
handlebarsSync.registerHelper('button', buttonHelper);
|
|
125
|
-
handlebars.registerHelper('ifCond', ifCond);
|
|
126
|
-
handlebars.registerHelper('empty', () => { });
|
|
127
|
-
handlebarsSync.registerHelper('empty', () => { });
|
|
128
|
-
handlebars.registerHelper('coalesce', coalesce);
|
|
129
|
-
handlebarsSync.registerHelper('coalesce', coalesce);
|
|
130
|
-
|
|
131
|
-
handlebarsSync.registerHelper('paddingNumber', paddingNumber);
|
|
132
|
-
handlebars.registerHelper('paddingNumber', paddingNumber);
|
|
133
|
-
|
|
134
|
-
export {
|
|
135
|
-
handlebars,
|
|
136
|
-
handlebarsSync,
|
|
137
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import buttonAdd from '../utils/buttonAdd.js';
|
|
2
|
-
import buttonDel from '../utils/buttonDel.js';
|
|
3
|
-
import buttonEdit from '../utils/buttonEdit.js';
|
|
4
|
-
import button from '../utils/button.js';
|
|
5
|
-
|
|
6
|
-
export default function buttonHelper(data, opt) {
|
|
7
|
-
const { hash } = opt;
|
|
8
|
-
|
|
9
|
-
// console.log(params)
|
|
10
|
-
|
|
11
|
-
if (!hash.token) return 'token empty';
|
|
12
|
-
if (hash.add) {
|
|
13
|
-
return buttonAdd(hash.token, hash.title);
|
|
14
|
-
}
|
|
15
|
-
if (hash.del) {
|
|
16
|
-
return buttonDel(hash.token, hash.title);
|
|
17
|
-
}
|
|
18
|
-
if (hash.edit) {
|
|
19
|
-
return buttonEdit(hash.token, hash.title);
|
|
20
|
-
}
|
|
21
|
-
return button(hash.token, hash.title);
|
|
22
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
|
|
3
|
-
import setToken from '../../plugins/crud/funcs/setToken.js';
|
|
4
|
-
|
|
5
|
-
import { handlebars } from '../index.js';
|
|
6
|
-
|
|
7
|
-
import buttonEdit from './utils/buttonEdit.js';
|
|
8
|
-
import buttonDel from './utils/buttonDel.js';
|
|
9
|
-
|
|
10
|
-
function format(d, key, data, hash) {
|
|
11
|
-
if (!key?.includes) return '';
|
|
12
|
-
if (d === true) return 'Так';
|
|
13
|
-
if (d === false) return 'Ні';
|
|
14
|
-
if (key === 'actions') {
|
|
15
|
-
return `<div class="flex items-center gap-2">${(hash.form ? buttonEdit(d, 'Редагувати') : '') + buttonDel(d)}</div>`;
|
|
16
|
-
}
|
|
17
|
-
if (key.startsWith('{{')) {
|
|
18
|
-
return handlebars.compile(key)(data);
|
|
19
|
-
} if (key.startsWith('{{') && key.includes(' ') && !(key.match(/\{\{([^\s]+)/)?.[1] in handlebars.helpers)) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
if (!d) return '-';
|
|
23
|
-
return d;
|
|
24
|
-
}
|
|
25
|
-
export default async function tableList(data, opt) {
|
|
26
|
-
const { hash } = opt;
|
|
27
|
-
// no data
|
|
28
|
-
// const time = Date.now();
|
|
29
|
-
if (hash.nodata && !data?.length) {
|
|
30
|
-
const noDataText = typeof hash.nodata === 'string' ? hash.nodata : '<div class="bg-gray-200 text-center p-6 rounded-xl"><h3 class="text-lg font-semibold">Інформація відсутня</h3></div>';
|
|
31
|
-
return noDataText;
|
|
32
|
-
}
|
|
33
|
-
if (!hash.columns) return 'columns empty';
|
|
34
|
-
const keys = hash.columns.split(hash.divider || ',').map(el => (hash.comma ? el.trim().replace(new RegExp(hash.comma, 'g'), ',') : el.trim())).concat(hash.uid && hash.table && hash.id && !hash.noactions ? ['Дії', 'actions'] : []);
|
|
35
|
-
|
|
36
|
-
const result = [];
|
|
37
|
-
result.push('<thead class="text-left font-medium text-gray-700"> <tr>');
|
|
38
|
-
|
|
39
|
-
// thead
|
|
40
|
-
const skip = {};
|
|
41
|
-
for (let i = 0; i < keys.length; i += 2) {
|
|
42
|
-
const name = keys[i];
|
|
43
|
-
|
|
44
|
-
// check hbs
|
|
45
|
-
if (name.includes('{{')) {
|
|
46
|
-
console.log(hash);
|
|
47
|
-
}
|
|
48
|
-
const nameHBS = name.includes('{{') ? await handlebars.compile(name)({ ...data, hash }) : false;
|
|
49
|
-
// console.log(name, data, nameHBS)
|
|
50
|
-
skip[name] = name.includes('{{') && !nameHBS;
|
|
51
|
-
if (skip[name]) continue;
|
|
52
|
-
|
|
53
|
-
const isActionsColumn = hash.noactions && i === keys.length - 2;
|
|
54
|
-
result.push(`<th class="py-2 min-w-[200px] ${isActionsColumn ? 'last:min-w-[60px] last:max-w-[60px] last:bg-white last:sticky last:right-0' : ''}">
|
|
55
|
-
${nameHBS || name}
|
|
56
|
-
</th>`);
|
|
57
|
-
}
|
|
58
|
-
result.push('</tr></thead><tbody class="divide-y divide-gray-200">');
|
|
59
|
-
|
|
60
|
-
// body
|
|
61
|
-
for (let k = 0; k < data.length; k += 1) {
|
|
62
|
-
const row = data[k];
|
|
63
|
-
result.push('<tr class="bg-white odd:bg-gray-50 ">');
|
|
64
|
-
const obj = { form: hash.form, table: hash.table, id: row[hash.id] };
|
|
65
|
-
const token = hash.table ? setToken({ ids: [JSON.stringify(obj)], uid: hash.uid, array: 1 })[0] : null;
|
|
66
|
-
for (let i = 0; i < keys.length; i += 2) {
|
|
67
|
-
const name = keys[i];
|
|
68
|
-
const key = keys[i + 1];
|
|
69
|
-
if (!key) continue;
|
|
70
|
-
if (skip[name]) continue;
|
|
71
|
-
|
|
72
|
-
const tokenData = key === 'actions' ? token : null;
|
|
73
|
-
const d1 = key.includes('{{') ? await handlebars.compile(key)({ ...row, token, hash }) || '-' : null;
|
|
74
|
-
const isActionsColumn = hash.noactions && i === keys.length - 2;
|
|
75
|
-
result.push(`<td class="py-2 pr-5 ${isActionsColumn ? 'last:sticky last:right-0' : ''}">
|
|
76
|
-
${d1 || format(tokenData || row[key], key, row, hash)}
|
|
77
|
-
</td>`);
|
|
78
|
-
}
|
|
79
|
-
// action token
|
|
80
|
-
|
|
81
|
-
result.push('</tr>');
|
|
82
|
-
}
|
|
83
|
-
result.push('</tbody>');
|
|
84
|
-
|
|
85
|
-
// console.log(Date.now() - time)
|
|
86
|
-
return `<table class="min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600">${result.join('')}</table>`;
|
|
87
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
А: 'A',
|
|
3
|
-
а: 'a',
|
|
4
|
-
Б: 'B',
|
|
5
|
-
б: 'b',
|
|
6
|
-
В: 'V',
|
|
7
|
-
в: 'v',
|
|
8
|
-
Г: 'H',
|
|
9
|
-
г: 'h',
|
|
10
|
-
Д: 'D',
|
|
11
|
-
д: 'd',
|
|
12
|
-
Е: 'E',
|
|
13
|
-
е: 'e',
|
|
14
|
-
Ё: 'Yo',
|
|
15
|
-
ё: 'yo',
|
|
16
|
-
Ж: 'Zh',
|
|
17
|
-
ж: 'zh',
|
|
18
|
-
З: 'Z',
|
|
19
|
-
з: 'z',
|
|
20
|
-
И: 'Y',
|
|
21
|
-
и: 'y',
|
|
22
|
-
Й: 'Y',
|
|
23
|
-
й: 'i',
|
|
24
|
-
К: 'K',
|
|
25
|
-
к: 'k',
|
|
26
|
-
Л: 'L',
|
|
27
|
-
л: 'l',
|
|
28
|
-
М: 'M',
|
|
29
|
-
м: 'm',
|
|
30
|
-
Н: 'N',
|
|
31
|
-
н: 'n',
|
|
32
|
-
О: 'O',
|
|
33
|
-
о: 'o',
|
|
34
|
-
П: 'P',
|
|
35
|
-
п: 'p',
|
|
36
|
-
Р: 'R',
|
|
37
|
-
р: 'r',
|
|
38
|
-
С: 'S',
|
|
39
|
-
с: 's',
|
|
40
|
-
Т: 'T',
|
|
41
|
-
т: 't',
|
|
42
|
-
У: 'U',
|
|
43
|
-
у: 'u',
|
|
44
|
-
Ф: 'F',
|
|
45
|
-
ф: 'f',
|
|
46
|
-
Х: 'Kh',
|
|
47
|
-
х: 'kh',
|
|
48
|
-
Ц: 'Ts',
|
|
49
|
-
ц: 'ts',
|
|
50
|
-
Ч: 'Ch',
|
|
51
|
-
ч: 'ch',
|
|
52
|
-
Ш: 'Sh',
|
|
53
|
-
ш: 'sh',
|
|
54
|
-
Щ: 'Shch',
|
|
55
|
-
щ: 'shch',
|
|
56
|
-
Ъ: '',
|
|
57
|
-
ъ: '',
|
|
58
|
-
Ы: 'Y',
|
|
59
|
-
ы: 'y',
|
|
60
|
-
Ь: '',
|
|
61
|
-
ь: '',
|
|
62
|
-
Э: 'E',
|
|
63
|
-
э: 'e',
|
|
64
|
-
Ю: 'Yu',
|
|
65
|
-
ю: 'yu',
|
|
66
|
-
Я: 'Ya',
|
|
67
|
-
я: 'ia',
|
|
68
|
-
І: 'I',
|
|
69
|
-
і: 'i',
|
|
70
|
-
Ї: 'Yi',
|
|
71
|
-
ї: 'i',
|
|
72
|
-
Є: 'Ye',
|
|
73
|
-
є: 'ie',
|
|
74
|
-
Ґ: 'G',
|
|
75
|
-
ґ: 'g',
|
|
76
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const newColor = 'blue';
|
|
2
|
-
export default function button(token, title, icon) {
|
|
3
|
-
const formCall = `window.v3plugin.$form({ token: '${token}' })`;
|
|
4
|
-
|
|
5
|
-
const buttonClass = icon
|
|
6
|
-
? `size-8 inline-flex justify-center items-center gap-x-2 font-medium rounded-s-lg border border-stone-200 bg-${newColor}-100 text-stone-800 shadow-sm hover:bg-${newColor}-200 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-${newColor}-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 `
|
|
7
|
-
: `px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500`;
|
|
8
|
-
|
|
9
|
-
const buttonContent = icon
|
|
10
|
-
? `<svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="${newColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
11
|
-
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"></path>
|
|
12
|
-
<path d="m15 5 4 4"></path>
|
|
13
|
-
</svg>`
|
|
14
|
-
: `${title || 'Редагувати'}`;
|
|
15
|
-
|
|
16
|
-
return `<button onclick="${formCall}" class="${buttonClass}">${buttonContent}</button>`;
|
|
17
|
-
}
|
package/server/migrations/0.sql
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
-- fix error if function exists and return type not text i.e bigint
|
|
2
|
-
|
|
3
|
-
do $$
|
|
4
|
-
|
|
5
|
-
declare
|
|
6
|
-
m record;
|
|
7
|
-
_pk text;
|
|
8
|
-
_tables json;
|
|
9
|
-
_returnType text;
|
|
10
|
-
|
|
11
|
-
begin
|
|
12
|
-
|
|
13
|
-
select format_type(p.prorettype, null) as return_type
|
|
14
|
-
from pg_proc p
|
|
15
|
-
where p.proname = 'next_id'
|
|
16
|
-
and p.pronamespace = 'public'::regnamespace into _returnType;
|
|
17
|
-
|
|
18
|
-
if (_returnType != 'text') then
|
|
19
|
-
raise notice 'default reassign start: % -> text', _returnType;
|
|
20
|
-
|
|
21
|
-
CREATE EXTENSION if not exists "uuid-ossp";
|
|
22
|
-
|
|
23
|
-
SELECT json_object_agg(a.attrelid::regclass, a.attname)
|
|
24
|
-
FROM pg_catalog.pg_attribute a
|
|
25
|
-
LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid, a.attnum) = (d.adrelid, d.adnum)
|
|
26
|
-
WHERE NOT a.attisdropped -- no dropped (dead) columns
|
|
27
|
-
AND a.attnum > 0 -- no system columns
|
|
28
|
-
AND pg_get_expr(d.adbin, d.adrelid) = 'next_id()' into _tables;
|
|
29
|
-
|
|
30
|
-
FOR m in (select json_object_keys(_tables) as table) loop
|
|
31
|
-
_pk = _tables->>m.table;
|
|
32
|
-
raise notice 'drop default: %,%', m.table, _pk;
|
|
33
|
-
EXECUTE('alter table '|| m.table || ' alter column ' || _pk || ' set default null;');
|
|
34
|
-
end loop;
|
|
35
|
-
|
|
36
|
-
DROP FUNCTION IF EXISTS next_id();
|
|
37
|
-
|
|
38
|
-
/* CREATE EXTENSION if not exists "uuid-ossp";
|
|
39
|
-
ALTER EXTENSION "uuid-ossp" SET SCHEMA public; */
|
|
40
|
-
|
|
41
|
-
CREATE OR REPLACE FUNCTION next_id()
|
|
42
|
-
RETURNS text AS
|
|
43
|
-
$BODY$
|
|
44
|
-
DECLARE
|
|
45
|
-
|
|
46
|
-
BEGIN
|
|
47
|
-
-- return replace(public.uuid_generate_v4()::text, '-', '');
|
|
48
|
-
-- return replace(gen_random_uuid()::text, '-', ''); -- native from postgres 13 onward
|
|
49
|
-
return encode(public.gen_random_bytes(6), 'hex');
|
|
50
|
-
END;
|
|
51
|
-
$BODY$
|
|
52
|
-
LANGUAGE plpgsql VOLATILE
|
|
53
|
-
COST 100;
|
|
54
|
-
|
|
55
|
-
FOR m in (select json_object_keys(_tables) as table) loop
|
|
56
|
-
_pk = _tables->>m.table;
|
|
57
|
-
raise notice 'reassign default: %, %', m.table, _pk;
|
|
58
|
-
EXECUTE('alter table '|| m.table || ' alter column ' || _pk || ' set default next_id();');
|
|
59
|
-
end loop;
|
|
60
|
-
|
|
61
|
-
raise notice 'reassign default finish: %', _tables;
|
|
62
|
-
|
|
63
|
-
else
|
|
64
|
-
raise notice 'skip default reassign';
|
|
65
|
-
|
|
66
|
-
/* CREATE EXTENSION if not exists "uuid-ossp";
|
|
67
|
-
ALTER EXTENSION "uuid-ossp" SET SCHEMA public; */
|
|
68
|
-
|
|
69
|
-
CREATE OR REPLACE FUNCTION next_id()
|
|
70
|
-
RETURNS text AS
|
|
71
|
-
$BODY$
|
|
72
|
-
DECLARE
|
|
73
|
-
|
|
74
|
-
BEGIN
|
|
75
|
-
-- return replace(public.uuid_generate_v4()::text, '-', '');
|
|
76
|
-
-- return replace(gen_random_uuid()::text, '-', ''); -- native from postgres 13 onward
|
|
77
|
-
return encode(public.gen_random_bytes(6), 'hex');
|
|
78
|
-
END;
|
|
79
|
-
$BODY$
|
|
80
|
-
LANGUAGE plpgsql VOLATILE
|
|
81
|
-
COST 100;
|
|
82
|
-
end if;
|
|
83
|
-
|
|
84
|
-
end $$
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
create schema if not exists admin;
|
|
2
|
-
|
|
3
|
-
CREATE TABLE if not exists admin.cls();
|
|
4
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS clsid text;
|
|
5
|
-
ALTER TABLE admin.cls DROP CONSTRAINT IF EXISTS admin_cls_pkey;
|
|
6
|
-
ALTER TABLE admin.cls DROP CONSTRAINT IF EXISTS admin_cls_unique;
|
|
7
|
-
|
|
8
|
-
ALTER TABLE admin.cls ALTER COLUMN clsid SET NOT NULL;
|
|
9
|
-
ALTER TABLE admin.cls ALTER COLUMN clsid SET DEFAULT next_id();
|
|
10
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS name text;
|
|
11
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS data text;
|
|
12
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS type text;
|
|
13
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS code text;
|
|
14
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS parent text;
|
|
15
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS ua text;
|
|
16
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS en text;
|
|
17
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS module text;
|
|
18
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS files json;
|
|
19
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS cdate timestamp without time zone;
|
|
20
|
-
ALTER TABLE admin.cls ALTER COLUMN cdate SET DEFAULT (now())::timestamp without time zone;
|
|
21
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS editor_id text;
|
|
22
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
|
|
23
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS uid text;
|
|
24
|
-
ALTER TABLE admin.cls ALTER COLUMN uid SET NOT NULL;
|
|
25
|
-
ALTER TABLE admin.cls ALTER COLUMN uid SET DEFAULT '1'::text;
|
|
26
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS icon text;
|
|
27
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS color text;
|
|
28
|
-
ALTER TABLE admin.cls ADD COLUMN IF NOT EXISTS hash text;
|
|
29
|
-
|
|
30
|
-
ALTER TABLE admin.cls ADD CONSTRAINT admin_cls_pkey PRIMARY KEY (clsid);
|
|
31
|
-
ALTER TABLE admin.cls ADD CONSTRAINT admin_cls_unique UNIQUE (code, parent);
|
|
32
|
-
|
|
33
|
-
COMMENT ON COLUMN admin.cls.name IS 'Назва';
|
|
34
|
-
COMMENT ON COLUMN admin.cls.type IS 'Тип';
|
|
35
|
-
COMMENT ON COLUMN admin.cls.data IS 'SQL';
|
|
36
|
-
COMMENT ON COLUMN admin.cls.code IS 'Код';
|
|
37
|
-
COMMENT ON COLUMN admin.cls.parent IS 'Назва батьківського об''єкту';
|
|
38
|
-
COMMENT ON COLUMN admin.cls.module IS 'Модуль';
|
|
39
|
-
COMMENT ON COLUMN admin.cls.icon IS 'Іконка';
|
|
40
|
-
COMMENT ON COLUMN admin.cls.color IS 'Колір';
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
CREATE SCHEMA IF NOT EXISTS admin;
|
|
2
|
-
|
|
3
|
-
CREATE TABLE IF NOT EXISTS admin.rules();
|
|
4
|
-
CREATE TABLE IF NOT EXISTS admin.users( uid text not null constraint admin_user_uid_pkey PRIMARY KEY DEFAULT next_id() );
|
|
5
|
-
ALTER TABLE admin.rules DROP CONSTRAINT IF EXISTS admin_rules_pkey cascade;
|
|
6
|
-
ALTER TABLE admin.rules add column if not exists rule_id text NOT NULL DEFAULT next_id();
|
|
7
|
-
|
|
8
|
-
ALTER TABLE admin.rules add column if not exists rule_type text;
|
|
9
|
-
ALTER TABLE admin.rules add column if not exists rule_name text;
|
|
10
|
-
ALTER TABLE admin.rules add column if not exists attr text;
|
|
11
|
-
ALTER TABLE admin.rules add column if not exists routes text[];
|
|
12
|
-
ALTER TABLE admin.rules add column if not exists uid text;
|
|
13
|
-
ALTER TABLE admin.rules add column if not exists cdate timestamp without time zone;
|
|
14
|
-
ALTER TABLE admin.rules add column if not exists rule_query text;
|
|
15
|
-
ALTER TABLE admin.rules add column if not exists cls text;
|
|
16
|
-
COMMENT ON TABLE admin.rules IS 'Повноваження';
|
|
17
|
-
COMMENT ON COLUMN admin.rules.rule_type IS 'Тип повноваження';
|
|
18
|
-
COMMENT ON COLUMN admin.rules.rule_name IS 'Назва';
|
|
19
|
-
COMMENT ON COLUMN admin.rules.attr IS 'Атрибут';
|
|
20
|
-
COMMENT ON COLUMN admin.rules.routes IS 'Роути';
|
|
21
|
-
COMMENT ON COLUMN admin.rules.uid IS 'Хто створив';
|
|
22
|
-
COMMENT ON COLUMN admin.rules.cdate IS 'Дата створення';
|
|
23
|
-
COMMENT ON COLUMN admin.rules.rule_query IS 'Запит';
|
|
24
|
-
COMMENT ON COLUMN admin.rules.cls IS 'Класифікатор';
|
|
25
|
-
ALTER TABLE admin.rules ALTER COLUMN attr DROP NOT NULL;
|
|
26
|
-
ALTER TABLE admin.rules ALTER COLUMN cdate DROP NOT NULL;ALTER TABLE admin.rules ALTER COLUMN cdate SET DEFAULT (now())::timestamp without time zone;
|
|
27
|
-
ALTER TABLE admin.rules ALTER COLUMN cls DROP NOT NULL;
|
|
28
|
-
ALTER TABLE admin.rules ALTER COLUMN routes DROP NOT NULL;
|
|
29
|
-
ALTER TABLE admin.rules ALTER COLUMN rule_id SET NOT NULL;ALTER TABLE admin.rules ALTER COLUMN rule_id SET DEFAULT next_id();
|
|
30
|
-
ALTER TABLE admin.rules ALTER COLUMN rule_name DROP NOT NULL;
|
|
31
|
-
ALTER TABLE admin.rules ALTER COLUMN rule_query DROP NOT NULL;
|
|
32
|
-
ALTER TABLE admin.rules ALTER COLUMN rule_type DROP NOT NULL;
|
|
33
|
-
ALTER TABLE admin.rules ALTER COLUMN uid DROP NOT NULL;
|
|
34
|
-
ALTER TABLE admin.rules add CONSTRAINT admin_rules_pkey PRIMARY KEY (rule_id);
|
|
35
|
-
|
|
36
|
-
CREATE INDEX if not exists admin_rules_id_idx ON admin.rules USING btree (rule_id COLLATE pg_catalog."default");
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
CREATE TABLE IF NOT EXISTS admin.accounts();
|
|
40
|
-
ALTER TABLE admin.accounts DROP CONSTRAINT IF EXISTS admin_accounts_pkey cascade;
|
|
41
|
-
ALTER TABLE admin.accounts add column if not exists account_id text NOT NULL DEFAULT next_id();
|
|
42
|
-
|
|
43
|
-
ALTER TABLE admin.accounts add column if not exists account_name text;
|
|
44
|
-
ALTER TABLE admin.accounts add column if not exists description text;
|
|
45
|
-
ALTER TABLE admin.accounts add column if not exists uid text;
|
|
46
|
-
ALTER TABLE admin.accounts add column if not exists cdate timestamp without time zone;
|
|
47
|
-
COMMENT ON TABLE admin.accounts IS 'Організації';
|
|
48
|
-
COMMENT ON COLUMN admin.accounts.account_name IS 'Назва';
|
|
49
|
-
COMMENT ON COLUMN admin.accounts.description IS 'Опис';
|
|
50
|
-
COMMENT ON COLUMN admin.accounts.uid IS 'Хто створив';
|
|
51
|
-
COMMENT ON COLUMN admin.accounts.cdate IS 'Дата створення';
|
|
52
|
-
ALTER TABLE admin.accounts ALTER COLUMN account_id SET NOT NULL;ALTER TABLE admin.accounts ALTER COLUMN account_id SET DEFAULT next_id();
|
|
53
|
-
ALTER TABLE admin.accounts ALTER COLUMN account_name DROP NOT NULL;
|
|
54
|
-
ALTER TABLE admin.accounts ALTER COLUMN cdate DROP NOT NULL;ALTER TABLE admin.accounts ALTER COLUMN cdate SET DEFAULT (now())::timestamp without time zone;
|
|
55
|
-
ALTER TABLE admin.accounts ALTER COLUMN description DROP NOT NULL;
|
|
56
|
-
ALTER TABLE admin.accounts ALTER COLUMN uid DROP NOT NULL;
|
|
57
|
-
ALTER TABLE admin.accounts add CONSTRAINT admin_accounts_pkey PRIMARY KEY (account_id);
|
|
58
|
-
|
|
59
|
-
CREATE INDEX if not exists admin_accounts_id_idx ON admin.accounts USING btree (account_id COLLATE pg_catalog."default");
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
CREATE TABLE IF NOT EXISTS admin.account_users();
|
|
63
|
-
ALTER TABLE admin.account_users DROP CONSTRAINT IF EXISTS admin_account_users_pkey;
|
|
64
|
-
ALTER TABLE admin.account_users DROP CONSTRAINT IF EXISTS admin_au_account_fkey;
|
|
65
|
-
ALTER TABLE admin.account_users DROP CONSTRAINT IF EXISTS admin_au_user_fkey;
|
|
66
|
-
ALTER TABLE admin.account_users add column if not exists au_id text NOT NULL DEFAULT next_id();
|
|
67
|
-
|
|
68
|
-
ALTER TABLE admin.account_users add column if not exists account_id text;
|
|
69
|
-
ALTER TABLE admin.account_users add column if not exists user_uid text;
|
|
70
|
-
ALTER TABLE admin.account_users add column if not exists uid text;
|
|
71
|
-
ALTER TABLE admin.account_users add column if not exists cdate timestamp without time zone;
|
|
72
|
-
COMMENT ON TABLE admin.account_users IS 'Організації - Користувачі';
|
|
73
|
-
COMMENT ON COLUMN admin.account_users.account_id IS 'id Організації';
|
|
74
|
-
COMMENT ON COLUMN admin.account_users.user_uid IS 'id Користувача';
|
|
75
|
-
COMMENT ON COLUMN admin.account_users.uid IS 'Хто створив';
|
|
76
|
-
COMMENT ON COLUMN admin.account_users.cdate IS 'Дата створення';
|
|
77
|
-
ALTER TABLE admin.account_users ALTER COLUMN account_id DROP NOT NULL;
|
|
78
|
-
ALTER TABLE admin.account_users ALTER COLUMN au_id SET NOT NULL;ALTER TABLE admin.account_users ALTER COLUMN au_id SET DEFAULT next_id();
|
|
79
|
-
ALTER TABLE admin.account_users ALTER COLUMN cdate DROP NOT NULL;ALTER TABLE admin.account_users ALTER COLUMN cdate SET DEFAULT (now())::timestamp without time zone;
|
|
80
|
-
ALTER TABLE admin.account_users ALTER COLUMN uid DROP NOT NULL;
|
|
81
|
-
ALTER TABLE admin.account_users ALTER COLUMN user_uid DROP NOT NULL;
|
|
82
|
-
ALTER TABLE admin.account_users add CONSTRAINT admin_account_users_pkey PRIMARY KEY (au_id);
|
|
83
|
-
ALTER TABLE admin.account_users ADD CONSTRAINT admin_au_account_fkey FOREIGN KEY (account_id) REFERENCES admin.accounts (account_id) MATCH SIMPLE;
|
|
84
|
-
ALTER TABLE admin.account_users ADD CONSTRAINT admin_au_user_fkey FOREIGN KEY (user_uid) REFERENCES admin.users (uid) MATCH SIMPLE;
|
|
85
|
-
|
|
86
|
-
CREATE INDEX if not exists admin_account_users_id_idx ON admin.account_users USING btree (au_id COLLATE pg_catalog."default");
|
|
87
|
-
CREATE INDEX if not exists admin_au_account_id_idx ON admin.account_users USING btree (account_id COLLATE pg_catalog."default");
|
|
88
|
-
CREATE INDEX if not exists admin_au_user_uid_idx ON admin.account_users USING btree (user_uid COLLATE pg_catalog."default");
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
CREATE TABLE IF NOT EXISTS admin.account_grants();
|
|
92
|
-
ALTER TABLE admin.account_grants DROP CONSTRAINT IF EXISTS admin_account_grants_pkey;
|
|
93
|
-
ALTER TABLE admin.account_grants DROP CONSTRAINT IF EXISTS admin_ag_account_fkey;
|
|
94
|
-
ALTER TABLE admin.account_grants DROP CONSTRAINT IF EXISTS admin_ag_user_fkey;
|
|
95
|
-
ALTER TABLE admin.account_grants add column if not exists ag_id text NOT NULL DEFAULT next_id();
|
|
96
|
-
|
|
97
|
-
ALTER TABLE admin.account_grants add column if not exists account_id text;
|
|
98
|
-
ALTER TABLE admin.account_grants add column if not exists rule_id text;
|
|
99
|
-
ALTER TABLE admin.account_grants add column if not exists routes text[];
|
|
100
|
-
ALTER TABLE admin.account_grants add column if not exists rule_values text[];
|
|
101
|
-
ALTER TABLE admin.account_grants add column if not exists grants_doc_id text;
|
|
102
|
-
ALTER TABLE admin.account_grants add column if not exists grant_scan text;
|
|
103
|
-
ALTER TABLE admin.account_grants add column if not exists expire_date date;
|
|
104
|
-
ALTER TABLE admin.account_grants add column if not exists actions text[];
|
|
105
|
-
ALTER TABLE admin.account_grants add column if not exists uid text;
|
|
106
|
-
ALTER TABLE admin.account_grants add column if not exists cdate timestamp without time zone;
|
|
107
|
-
COMMENT ON TABLE admin.account_grants IS 'Організації - Повноваження';
|
|
108
|
-
COMMENT ON COLUMN admin.account_grants.account_id IS 'id Організації';
|
|
109
|
-
COMMENT ON COLUMN admin.account_grants.rule_id IS 'id Правила';
|
|
110
|
-
COMMENT ON COLUMN admin.account_grants.routes IS 'Роути';
|
|
111
|
-
COMMENT ON COLUMN admin.account_grants.rule_values IS 'Значення';
|
|
112
|
-
COMMENT ON COLUMN admin.account_grants.grants_doc_id IS 'id Документу';
|
|
113
|
-
COMMENT ON COLUMN admin.account_grants.grant_scan IS 'id Скану';
|
|
114
|
-
COMMENT ON COLUMN admin.account_grants.expire_date IS 'Дата закінчення дії дозволу';
|
|
115
|
-
COMMENT ON COLUMN admin.account_grants.actions IS 'Дії';
|
|
116
|
-
COMMENT ON COLUMN admin.account_grants.uid IS 'Хто створив';
|
|
117
|
-
COMMENT ON COLUMN admin.account_grants.cdate IS 'Дата створення';
|
|
118
|
-
ALTER TABLE admin.account_grants ALTER COLUMN account_id DROP NOT NULL;
|
|
119
|
-
ALTER TABLE admin.account_grants ALTER COLUMN actions DROP NOT NULL;
|
|
120
|
-
ALTER TABLE admin.account_grants ALTER COLUMN ag_id SET NOT NULL;ALTER TABLE admin.account_grants ALTER COLUMN ag_id SET DEFAULT next_id();
|
|
121
|
-
ALTER TABLE admin.account_grants ALTER COLUMN cdate DROP NOT NULL;ALTER TABLE admin.account_grants ALTER COLUMN cdate SET DEFAULT (now())::timestamp without time zone;
|
|
122
|
-
ALTER TABLE admin.account_grants ALTER COLUMN expire_date DROP NOT NULL;
|
|
123
|
-
ALTER TABLE admin.account_grants ALTER COLUMN grant_scan DROP NOT NULL;
|
|
124
|
-
ALTER TABLE admin.account_grants ALTER COLUMN grants_doc_id DROP NOT NULL;
|
|
125
|
-
ALTER TABLE admin.account_grants ALTER COLUMN routes DROP NOT NULL;
|
|
126
|
-
ALTER TABLE admin.account_grants ALTER COLUMN rule_id DROP NOT NULL;
|
|
127
|
-
ALTER TABLE admin.account_grants ALTER COLUMN rule_values DROP NOT NULL;
|
|
128
|
-
ALTER TABLE admin.account_grants ALTER COLUMN uid DROP NOT NULL;
|
|
129
|
-
ALTER TABLE admin.account_grants add CONSTRAINT admin_account_grants_pkey PRIMARY KEY (ag_id);
|
|
130
|
-
ALTER TABLE admin.account_grants ADD CONSTRAINT admin_ag_account_fkey FOREIGN KEY (account_id) REFERENCES admin.accounts (account_id) MATCH SIMPLE;
|
|
131
|
-
ALTER TABLE admin.account_grants ADD CONSTRAINT admin_ag_user_fkey FOREIGN KEY (rule_id) REFERENCES admin.rules (rule_id) MATCH SIMPLE;
|
|
132
|
-
|
|
133
|
-
CREATE INDEX if not exists admin_account_users_id_idx ON admin.account_grants USING btree (ag_id COLLATE pg_catalog."default");
|
|
134
|
-
CREATE INDEX if not exists admin_ag_account_id_idx ON admin.account_grants USING btree (account_id COLLATE pg_catalog."default");
|
|
135
|
-
CREATE INDEX if not exists admin_ag_rule_id_idx ON admin.account_grants USING btree (rule_id COLLATE pg_catalog."default");
|