@opengis/fcore 0.0.1-beta.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/LICENSE +3 -0
- package/README.md +72 -0
- package/dist/config.d.ts +79 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/context.d.ts +29 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +1 -0
- package/dist/fastify.d.ts +8 -0
- package/dist/fastify.d.ts.map +1 -0
- package/dist/fastify.js +1 -0
- package/dist/fcore.d.ts +13 -0
- package/dist/fcore.d.ts.map +1 -0
- package/dist/fcore.js +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/migrations/cli.d.ts +3 -0
- package/dist/migrations/cli.d.ts.map +1 -0
- package/dist/migrations/cli.js +2 -0
- package/dist/migrations/runner.d.ts +12 -0
- package/dist/migrations/runner.d.ts.map +1 -0
- package/dist/migrations/runner.js +1 -0
- package/dist/modules/auth/index.d.ts +9 -0
- package/dist/modules/auth/index.d.ts.map +1 -0
- package/dist/modules/auth/index.js +1 -0
- package/dist/modules/auth/route.d.ts +7 -0
- package/dist/modules/auth/route.d.ts.map +1 -0
- package/dist/modules/auth/route.js +1 -0
- package/dist/modules/auth/schema.d.ts +15 -0
- package/dist/modules/auth/schema.d.ts.map +1 -0
- package/dist/modules/auth/schema.js +1 -0
- package/dist/modules/auth/services/get-current-user.d.ts +8 -0
- package/dist/modules/auth/services/get-current-user.d.ts.map +1 -0
- package/dist/modules/auth/services/get-current-user.js +1 -0
- package/dist/modules/auth/services/login.d.ts +10 -0
- package/dist/modules/auth/services/login.d.ts.map +1 -0
- package/dist/modules/auth/services/login.js +1 -0
- package/dist/modules/auth/services/logout.d.ts +9 -0
- package/dist/modules/auth/services/logout.d.ts.map +1 -0
- package/dist/modules/auth/services/logout.js +1 -0
- package/dist/modules/auth/services/verify-two-factor.d.ts +9 -0
- package/dist/modules/auth/services/verify-two-factor.d.ts.map +1 -0
- package/dist/modules/auth/services/verify-two-factor.js +1 -0
- package/dist/modules/auth/services/verifyPassword.d.ts +11 -0
- package/dist/modules/auth/services/verifyPassword.d.ts.map +1 -0
- package/dist/modules/auth/services/verifyPassword.js +1 -0
- package/dist/modules/file/index.d.ts +8 -0
- package/dist/modules/file/index.d.ts.map +1 -0
- package/dist/modules/file/index.js +1 -0
- package/dist/modules/file/route.d.ts +7 -0
- package/dist/modules/file/route.d.ts.map +1 -0
- package/dist/modules/file/route.js +1 -0
- package/dist/modules/file/schema.d.ts +30 -0
- package/dist/modules/file/schema.d.ts.map +1 -0
- package/dist/modules/file/schema.js +1 -0
- package/dist/modules/file/services/get-file.d.ts +8 -0
- package/dist/modules/file/services/get-file.d.ts.map +1 -0
- package/dist/modules/file/services/get-file.js +1 -0
- package/dist/modules/file/services/resize-file.d.ts +13 -0
- package/dist/modules/file/services/resize-file.d.ts.map +1 -0
- package/dist/modules/file/services/resize-file.js +1 -0
- package/dist/modules/file/services/upload-file.d.ts +16 -0
- package/dist/modules/file/services/upload-file.d.ts.map +1 -0
- package/dist/modules/file/services/upload-file.js +1 -0
- package/dist/modules/resource/index.d.ts +20 -0
- package/dist/modules/resource/index.d.ts.map +1 -0
- package/dist/modules/resource/index.js +1 -0
- package/dist/modules/resource/route.d.ts +7 -0
- package/dist/modules/resource/route.d.ts.map +1 -0
- package/dist/modules/resource/route.js +1 -0
- package/dist/modules/resource/schema.d.ts +67 -0
- package/dist/modules/resource/schema.d.ts.map +1 -0
- package/dist/modules/resource/schema.js +1 -0
- package/dist/modules/resource/services/add-note.d.ts +6 -0
- package/dist/modules/resource/services/add-note.d.ts.map +1 -0
- package/dist/modules/resource/services/add-note.js +1 -0
- package/dist/modules/resource/services/add-resource-file.d.ts +6 -0
- package/dist/modules/resource/services/add-resource-file.d.ts.map +1 -0
- package/dist/modules/resource/services/add-resource-file.js +1 -0
- package/dist/modules/resource/services/create-resource-relation.d.ts +6 -0
- package/dist/modules/resource/services/create-resource-relation.d.ts.map +1 -0
- package/dist/modules/resource/services/create-resource-relation.js +1 -0
- package/dist/modules/resource/services/create-resource.d.ts +6 -0
- package/dist/modules/resource/services/create-resource.d.ts.map +1 -0
- package/dist/modules/resource/services/create-resource.js +1 -0
- package/dist/modules/resource/services/delete-resource-relation.d.ts +6 -0
- package/dist/modules/resource/services/delete-resource-relation.d.ts.map +1 -0
- package/dist/modules/resource/services/delete-resource-relation.js +1 -0
- package/dist/modules/resource/services/delete-resource.d.ts +6 -0
- package/dist/modules/resource/services/delete-resource.d.ts.map +1 -0
- package/dist/modules/resource/services/delete-resource.js +1 -0
- package/dist/modules/resource/services/export-resource.d.ts +6 -0
- package/dist/modules/resource/services/export-resource.d.ts.map +1 -0
- package/dist/modules/resource/services/export-resource.js +1 -0
- package/dist/modules/resource/services/get-resource.d.ts +6 -0
- package/dist/modules/resource/services/get-resource.d.ts.map +1 -0
- package/dist/modules/resource/services/get-resource.js +1 -0
- package/dist/modules/resource/services/list-children.d.ts +6 -0
- package/dist/modules/resource/services/list-children.d.ts.map +1 -0
- package/dist/modules/resource/services/list-children.js +1 -0
- package/dist/modules/resource/services/list-resource-relation.d.ts +6 -0
- package/dist/modules/resource/services/list-resource-relation.d.ts.map +1 -0
- package/dist/modules/resource/services/list-resource-relation.js +1 -0
- package/dist/modules/resource/services/list-resources.d.ts +6 -0
- package/dist/modules/resource/services/list-resources.d.ts.map +1 -0
- package/dist/modules/resource/services/list-resources.js +1 -0
- package/dist/modules/resource/services/search-resource.d.ts +6 -0
- package/dist/modules/resource/services/search-resource.d.ts.map +1 -0
- package/dist/modules/resource/services/search-resource.js +1 -0
- package/dist/modules/resource/services/suggest-resource.d.ts +6 -0
- package/dist/modules/resource/services/suggest-resource.d.ts.map +1 -0
- package/dist/modules/resource/services/suggest-resource.js +1 -0
- package/dist/modules/resource/services/update-resource.d.ts +6 -0
- package/dist/modules/resource/services/update-resource.d.ts.map +1 -0
- package/dist/modules/resource/services/update-resource.js +1 -0
- package/dist/modules/resource/services/upload-resource-file.d.ts +13 -0
- package/dist/modules/resource/services/upload-resource-file.d.ts.map +1 -0
- package/dist/modules/resource/services/upload-resource-file.js +1 -0
- package/dist/modules/system/index.d.ts +13 -0
- package/dist/modules/system/index.d.ts.map +1 -0
- package/dist/modules/system/index.js +1 -0
- package/dist/modules/system/route.d.ts +7 -0
- package/dist/modules/system/route.d.ts.map +1 -0
- package/dist/modules/system/route.js +1 -0
- package/dist/modules/system/schema.d.ts +14 -0
- package/dist/modules/system/schema.d.ts.map +1 -0
- package/dist/modules/system/schema.js +1 -0
- package/dist/modules/system/services/check-system.d.ts +8 -0
- package/dist/modules/system/services/check-system.d.ts.map +1 -0
- package/dist/modules/system/services/check-system.js +1 -0
- package/dist/modules/system/services/get-api-list.d.ts +8 -0
- package/dist/modules/system/services/get-api-list.d.ts.map +1 -0
- package/dist/modules/system/services/get-api-list.js +1 -0
- package/dist/modules/system/services/get-audit-log.d.ts +10 -0
- package/dist/modules/system/services/get-audit-log.d.ts.map +1 -0
- package/dist/modules/system/services/get-audit-log.js +1 -0
- package/dist/modules/system/services/get-dictionary.d.ts +8 -0
- package/dist/modules/system/services/get-dictionary.d.ts.map +1 -0
- package/dist/modules/system/services/get-dictionary.js +1 -0
- package/dist/modules/system/services/get-system-log.d.ts +6 -0
- package/dist/modules/system/services/get-system-log.d.ts.map +1 -0
- package/dist/modules/system/services/get-system-log.js +1 -0
- package/dist/modules/system/services/get-system-settings.d.ts +8 -0
- package/dist/modules/system/services/get-system-settings.d.ts.map +1 -0
- package/dist/modules/system/services/get-system-settings.js +1 -0
- package/dist/modules/system/services/list-dictionaries.d.ts +6 -0
- package/dist/modules/system/services/list-dictionaries.d.ts.map +1 -0
- package/dist/modules/system/services/list-dictionaries.js +1 -0
- package/dist/modules/system/services/update-system-settings.d.ts +11 -0
- package/dist/modules/system/services/update-system-settings.d.ts.map +1 -0
- package/dist/modules/system/services/update-system-settings.js +1 -0
- package/dist/modules/utils/get-user-permissions.d.ts +3 -0
- package/dist/modules/utils/get-user-permissions.d.ts.map +1 -0
- package/dist/modules/utils/get-user-permissions.js +1 -0
- package/dist/modules/utils/require-admin.d.ts +3 -0
- package/dist/modules/utils/require-admin.d.ts.map +1 -0
- package/dist/modules/utils/require-admin.js +1 -0
- package/dist/modules/utils/safe-user.d.ts +2 -0
- package/dist/modules/utils/safe-user.d.ts.map +1 -0
- package/dist/modules/utils/safe-user.js +1 -0
- package/dist/modules/utils/unsupported.d.ts +2 -0
- package/dist/modules/utils/unsupported.d.ts.map +1 -0
- package/dist/modules/utils/unsupported.js +1 -0
- package/dist/plugins/audit/audit.d.ts +11 -0
- package/dist/plugins/audit/audit.d.ts.map +1 -0
- package/dist/plugins/audit/audit.js +1 -0
- package/dist/plugins/audit/audit.types.d.ts +27 -0
- package/dist/plugins/audit/audit.types.d.ts.map +1 -0
- package/dist/plugins/audit/audit.types.js +1 -0
- package/dist/plugins/audit/index.d.ts +6 -0
- package/dist/plugins/audit/index.d.ts.map +1 -0
- package/dist/plugins/audit/index.js +1 -0
- package/dist/plugins/audit/services/write-audit.d.ts +11 -0
- package/dist/plugins/audit/services/write-audit.d.ts.map +1 -0
- package/dist/plugins/audit/services/write-audit.js +1 -0
- package/dist/plugins/auth/auth.types.d.ts +16 -0
- package/dist/plugins/auth/auth.types.d.ts.map +1 -0
- package/dist/plugins/auth/auth.types.js +1 -0
- package/dist/plugins/auth/index.d.ts +5 -0
- package/dist/plugins/auth/index.d.ts.map +1 -0
- package/dist/plugins/auth/index.js +1 -0
- package/dist/plugins/dictionary.d.ts +30 -0
- package/dist/plugins/dictionary.d.ts.map +1 -0
- package/dist/plugins/dictionary.js +1 -0
- package/dist/plugins/file.d.ts +30 -0
- package/dist/plugins/file.d.ts.map +1 -0
- package/dist/plugins/file.js +1 -0
- package/dist/plugins/index.d.ts +11 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/logger/checkUserAccess.d.ts +11 -0
- package/dist/plugins/logger/checkUserAccess.d.ts.map +1 -0
- package/dist/plugins/logger/checkUserAccess.js +1 -0
- package/dist/plugins/logger/createFileStream.d.ts +3 -0
- package/dist/plugins/logger/createFileStream.d.ts.map +1 -0
- package/dist/plugins/logger/createFileStream.js +1 -0
- package/dist/plugins/logger/createLogger.d.ts +9 -0
- package/dist/plugins/logger/createLogger.d.ts.map +1 -0
- package/dist/plugins/logger/createLogger.js +1 -0
- package/dist/plugins/logger/errorStatus.d.ts +2 -0
- package/dist/plugins/logger/errorStatus.d.ts.map +1 -0
- package/dist/plugins/logger/errorStatus.js +1 -0
- package/dist/plugins/logger/getHooks.d.ts +5 -0
- package/dist/plugins/logger/getHooks.d.ts.map +1 -0
- package/dist/plugins/logger/getHooks.js +1 -0
- package/dist/plugins/logger/getRootDir.d.ts +3 -0
- package/dist/plugins/logger/getRootDir.d.ts.map +1 -0
- package/dist/plugins/logger/getRootDir.js +1 -0
- package/dist/plugins/logger/index.d.ts +5 -0
- package/dist/plugins/logger/index.d.ts.map +1 -0
- package/dist/plugins/logger/index.js +1 -0
- package/dist/plugins/logger/labels.d.ts +3 -0
- package/dist/plugins/logger/labels.d.ts.map +1 -0
- package/dist/plugins/logger/labels.js +1 -0
- package/dist/plugins/logger/serializers.d.ts +14 -0
- package/dist/plugins/logger/serializers.d.ts.map +1 -0
- package/dist/plugins/logger/serializers.js +1 -0
- package/dist/plugins/logger/timestampWithTimeZone.d.ts +2 -0
- package/dist/plugins/logger/timestampWithTimeZone.d.ts.map +1 -0
- package/dist/plugins/logger/timestampWithTimeZone.js +1 -0
- package/dist/plugins/pg.d.ts +15 -0
- package/dist/plugins/pg.d.ts.map +1 -0
- package/dist/plugins/pg.js +1 -0
- package/dist/plugins/redis.d.ts +19 -0
- package/dist/plugins/redis.d.ts.map +1 -0
- package/dist/plugins/redis.js +1 -0
- package/dist/plugins/resource/index.d.ts +7 -0
- package/dist/plugins/resource/index.d.ts.map +1 -0
- package/dist/plugins/resource/index.js +1 -0
- package/dist/plugins/resource/resource.d.ts +3 -0
- package/dist/plugins/resource/resource.d.ts.map +1 -0
- package/dist/plugins/resource/resource.js +1 -0
- package/dist/plugins/resource/resource.registry.d.ts +10 -0
- package/dist/plugins/resource/resource.registry.d.ts.map +1 -0
- package/dist/plugins/resource/resource.registry.js +1 -0
- package/dist/plugins/resource/resource.types.d.ts +98 -0
- package/dist/plugins/resource/resource.types.d.ts.map +1 -0
- package/dist/plugins/resource/resource.types.js +1 -0
- package/dist/plugins/resource/services/create.d.ts +8 -0
- package/dist/plugins/resource/services/create.d.ts.map +1 -0
- package/dist/plugins/resource/services/create.js +1 -0
- package/dist/plugins/resource/services/delete.d.ts +11 -0
- package/dist/plugins/resource/services/delete.d.ts.map +1 -0
- package/dist/plugins/resource/services/delete.js +1 -0
- package/dist/plugins/resource/services/find-one.d.ts +11 -0
- package/dist/plugins/resource/services/find-one.d.ts.map +1 -0
- package/dist/plugins/resource/services/find-one.js +1 -0
- package/dist/plugins/resource/services/find.d.ts +8 -0
- package/dist/plugins/resource/services/find.d.ts.map +1 -0
- package/dist/plugins/resource/services/find.js +1 -0
- package/dist/plugins/resource/services/update.d.ts +9 -0
- package/dist/plugins/resource/services/update.d.ts.map +1 -0
- package/dist/plugins/resource/services/update.js +1 -0
- package/dist/plugins/resource/utils/fields.d.ts +5 -0
- package/dist/plugins/resource/utils/fields.d.ts.map +1 -0
- package/dist/plugins/resource/utils/fields.js +1 -0
- package/dist/plugins/resource/utils/filters.d.ts +9 -0
- package/dist/plugins/resource/utils/filters.d.ts.map +1 -0
- package/dist/plugins/resource/utils/filters.js +1 -0
- package/dist/plugins/resource/utils/permissions.d.ts +3 -0
- package/dist/plugins/resource/utils/permissions.d.ts.map +1 -0
- package/dist/plugins/resource/utils/permissions.js +1 -0
- package/dist/plugins/resource/utils/sort.d.ts +6 -0
- package/dist/plugins/resource/utils/sort.d.ts.map +1 -0
- package/dist/plugins/resource/utils/sort.js +1 -0
- package/dist/plugins/resource/utils/sql.d.ts +14 -0
- package/dist/plugins/resource/utils/sql.d.ts.map +1 -0
- package/dist/plugins/resource/utils/sql.js +1 -0
- package/dist/shared/getIP.d.ts +3 -0
- package/dist/shared/getIP.d.ts.map +1 -0
- package/dist/shared/getIP.js +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exports the public surface of this FCore module.
|
|
3
|
+
*/
|
|
4
|
+
export * from './route.js';
|
|
5
|
+
export * from './services/get-system-settings.js';
|
|
6
|
+
export * from './services/update-system-settings.js';
|
|
7
|
+
export * from './services/get-system-log.js';
|
|
8
|
+
export * from './services/get-audit-log.js';
|
|
9
|
+
export * from './services/check-system.js';
|
|
10
|
+
export * from './services/get-api-list.js';
|
|
11
|
+
export * from './services/list-dictionaries.js';
|
|
12
|
+
export * from './services/get-dictionary.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/system/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){var G=b,E=n();while(!![]){try{var M=-parseInt(G(0xf0))/0x1*(-parseInt(G(0xef))/0x2)+parseInt(G(0xf3))/0x3*(-parseInt(G(0xed))/0x4)+-parseInt(G(0xf1))/0x5+parseInt(G(0xeb))/0x6*(-parseInt(G(0xec))/0x7)+-parseInt(G(0xea))/0x8*(-parseInt(G(0xee))/0x9)+-parseInt(G(0xe9))/0xa+parseInt(G(0xf2))/0xb;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xe58f2));export*from'./route.js';export*from'./services/get-system-settings.js';export*from'./services/update-system-settings.js';export*from'./services/get-system-log.js';function b(n,a){n=n-0xe9;var E=I();var M=E[n];return M;}export*from'./services/get-audit-log.js';export*from'./services/check-system.js';export*from'./services/get-api-list.js';function I(){var j=['741QsgvwW','18311340MHSgLl','3399376zNtcGa','6oaVuif','7813407rVfcOr','14216DjFvYN','9djSxGx','216UVTVoa','15893UhLAJj','3315420gZtGbI','36158815pRaupY'];I=function(){return j;};return I();}export*from'./services/list-dictionaries.js';export*from'./services/get-dictionary.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers HTTP routes for this FCore module and delegates operations to application services.
|
|
3
|
+
*/
|
|
4
|
+
import type { FastifyPluginAsync } from "fastify";
|
|
5
|
+
import type { AppContext } from "../../context.js";
|
|
6
|
+
export declare function systemRoutes(ctx: AppContext): FastifyPluginAsync;
|
|
7
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/modules/system/route.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAYnD,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,kBAAkB,CAkHhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const Iy=b;(function(n,a){const IT=b,E=n();while(!![]){try{const M=parseInt(IT(0x151))/0x1+parseInt(IT(0x143))/0x2+parseInt(IT(0x164))/0x3+-parseInt(IT(0x16f))/0x4*(-parseInt(IT(0x186))/0x5)+parseInt(IT(0x159))/0x6*(parseInt(IT(0x163))/0x7)+-parseInt(IT(0x160))/0x8+-parseInt(IT(0x15a))/0x9;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x4e2cb));import{getSystemSettings}from'./services/get-system-settings.js';import{updateSystemSettings}from'./services/update-system-settings.js';import{getAuditLog}from'./services/get-audit-log.js';import{checkSystem}from'./services/check-system.js';import{getApiList}from'./services/get-api-list.js';function I(){const Iz=['body','Returns\x20the\x20system\x20audit\x20log\x20entries.','926084hLRyfw','EGZEe','Get\x20system\x20log','Lfjut','WYpZT','ppWqR','YuBtk','GoULe','params','Get\x20audit\x20log','split','post','Get\x20platform\x20dictionary','dictionaryName','518858SOvrzp','Returns\x20all\x20available\x20dictionaries\x20registered\x20by\x20the\x20platform.','system:settings:update','ewMsS','settings','SZkwi','WjPUY','XRGUf','6CJQtOx','13445460TylSzy','4|2|7|5|0|6|3|1','Returns\x20the\x20list\x20of\x20registered\x20platform\x20APIs.','system:api:read','Get\x20system\x20settings','system:check','781448CYOffy','/api/system/api-list','/api/system/audit/','2694727qNliRJ','1633158xFGAHF','tags','Updates\x20system\x20settings\x20using\x20flat\x20dot-notation\x20keys.','Update\x20system\x20settings','sTdHX','RAepx','/api/dictionaries/:name','query','permissions','jZMul','schema','2308KPJaUi','Returns\x20system\x20settings\x20as\x20nested\x20JSON.','HuYvX','user','AlWDL','aYVlF','fcore','ULcdu','/api/system/settings','HnQyi','/api/system/logger/*','system:settings:read','Checks\x20the\x20availability\x20of\x20system\x20dependencies.','Returns\x20a\x20registered\x20platform\x20dictionary\x20by\x20name.','List\x20APIs','List\x20platform\x20dictionaries','Check\x20system\x20health','get','piSut','BAXbN','system','yISov','logger','5hUFbgj','access','zTXMi','CsHTx','evAYT','/api/system/check','zxQpA','audit:read','system:logs:read','EDdNJ','description','summary','Returns\x20system\x20logger\x20entries\x20for\x20the\x20requested\x20path.','/api/dictionaries','admin'];I=function(){return Iz;};return I();}import{getSystemLog}from'./services/get-system-log.js';import{listDictionaries}from'./services/list-dictionaries.js';function b(n,a){n=n-0x143;const E=I();let M=E[n];return M;}import{getDictionary}from'./services/get-dictionary.js';import{systemSchemas}from'./schema.js';const u=n=>n[Iy(0x172)];export function systemRoutes(a){const Is=Iy,E={};E[Is(0x173)]=Is(0x15b),E[Is(0x182)]=Is(0x179),E[Is(0x157)]=Is(0x175),E[Is(0x168)]=Is(0x192),E[Is(0x189)]=Is(0x194),E[Is(0x178)]=Is(0x18e),E[Is(0x16d)]=Is(0x161),E[Is(0x154)]=Is(0x183),E[Is(0x156)]=Is(0x17d),E[Is(0x14a)]=Is(0x15c),E[Is(0x148)]=Is(0x14f),E[Is(0x176)]=Is(0x17c),E[Is(0x188)]=Is(0x18b),E[Is(0x18a)]=Is(0x17b),E[Is(0x171)]=Is(0x15f),E[Is(0x158)]=Is(0x193),E[Is(0x146)]=Is(0x17e),E[Is(0x174)]=Is(0x152),E[Is(0x18c)]=Is(0x177),E[Is(0x149)]=Is(0x153),E[Is(0x147)]=Is(0x162),E[Is(0x144)]=Is(0x14c),E[Is(0x169)]=Is(0x196),E[Is(0x184)]=Is(0x18d),E[Is(0x181)]=Is(0x15e),E[Is(0x18f)]=Is(0x17a);const M=E;return async G=>{const IN=Is,j=M[IN(0x173)][IN(0x14d)]('|');let Y=0x0;while(!![]){switch(j[Y++]){case'0':G[IN(0x180)](M[IN(0x182)],{'schema':{'tags':[M[IN(0x157)],IN(0x183)],'summary':IN(0x145),'description':M[IN(0x168)],'access':M[IN(0x189)],'permissions':[M[IN(0x178)]],'params':systemSchemas[IN(0x185)]}},async H=>getSystemLog({...H[IN(0x16b)],...H[IN(0x14b)],'user':u(H)},a));continue;case'1':G[IN(0x180)](M[IN(0x16d)],{'schema':{'tags':[M[IN(0x157)],M[IN(0x154)]],'summary':M[IN(0x156)],'description':M[IN(0x14a)],'access':M[IN(0x189)],'permissions':[IN(0x15d)]}},async H=>getApiList({'user':u(H)},a));continue;case'2':const g={};g[IN(0x165)]=[IN(0x175),M[IN(0x154)]],g[IN(0x191)]=M[IN(0x148)],g[IN(0x190)]=M[IN(0x176)],g[IN(0x187)]=M[IN(0x189)],g[IN(0x16c)]=[],g[IN(0x14b)]=systemSchemas[IN(0x150)];const e={};e[IN(0x16e)]=g,G[IN(0x180)](IN(0x16a),e,async H=>getDictionary({...H[IN(0x14b)],'user':u(H)},a));continue;case'3':G[IN(0x180)](M[IN(0x188)],{'schema':{'tags':[M[IN(0x157)],M[IN(0x154)]],'summary':IN(0x17f),'description':M[IN(0x18a)],'access':M[IN(0x189)],'permissions':[M[IN(0x171)]]}},async H=>checkSystem({'user':u(H)},a));continue;case'4':G[IN(0x180)](M[IN(0x158)],{'schema':{'tags':[M[IN(0x157)],IN(0x183)],'summary':M[IN(0x146)],'description':M[IN(0x174)],'access':IN(0x194),'permissions':[]}},async H=>listDictionaries({'user':u(H)},a));continue;case'5':G[IN(0x14e)](M[IN(0x18c)],{'schema':{'tags':[M[IN(0x157)],M[IN(0x154)]],'summary':IN(0x167),'description':IN(0x166),'access':IN(0x194),'permissions':[M[IN(0x149)]],'body':systemSchemas[IN(0x155)]}},async H=>updateSystemSettings({...H[IN(0x14b)],'patch':H[IN(0x195)],'user':u(H)},a));continue;case'6':G[IN(0x180)](M[IN(0x147)],{'schema':{'tags':[M[IN(0x157)],IN(0x183)],'summary':M[IN(0x144)],'description':M[IN(0x169)],'access':M[IN(0x189)],'permissions':[M[IN(0x184)]]}},async H=>getAuditLog({...H[IN(0x16b)],'user':u(H)},a));continue;case'7':const h={};h[IN(0x165)]=[IN(0x175),M[IN(0x154)]],h[IN(0x191)]=M[IN(0x181)],h[IN(0x190)]=IN(0x170),h[IN(0x187)]=M[IN(0x189)],h[IN(0x16c)]=[M[IN(0x18f)]];const Z={};Z[IN(0x16e)]=h,G[IN(0x180)](IN(0x177),Z,async H=>getSystemSettings({...H[IN(0x14b)],'user':u(H)},a));continue;}break;}};}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const identifier: import("@sinclair/typebox").TString;
|
|
2
|
+
export declare const systemSchemas: {
|
|
3
|
+
dictionaryName: import("@sinclair/typebox").TObject<{
|
|
4
|
+
name: import("@sinclair/typebox").TString;
|
|
5
|
+
}>;
|
|
6
|
+
settingsEntity: import("@sinclair/typebox").TObject<{
|
|
7
|
+
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
+
}>;
|
|
9
|
+
settings: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
10
|
+
logger: import("@sinclair/typebox").TObject<{
|
|
11
|
+
"*": import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/system/schema.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,qCAIrB,CAAC;AAEH,eAAO,MAAM,aAAa;IACxB,cAAc;;;IAGd,cAAc;;;IACd,QAAQ;IACR,MAAM;;;CACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=b;(function(X,G){const g=b,j=X();while(!![]){try{const u=parseInt(g(0x1ec))/0x1+-parseInt(g(0x1ea))/0x2+-parseInt(g(0x1fa))/0x3*(parseInt(g(0x1fb))/0x4)+-parseInt(g(0x1ed))/0x5+parseInt(g(0x1f3))/0x6+parseInt(g(0x1f1))/0x7*(-parseInt(g(0x1f8))/0x8)+-parseInt(g(0x1f7))/0x9*(-parseInt(g(0x1f6))/0xa);if(u===G)break;else j['push'](j['shift']());}catch(Y){j['push'](j['shift']());}}}(I,0xbc64f));import{Type}from'@sinclair/typebox';function b(n,a){n=n-0x1e8;const E=I();let M=E[n];return M;}const n={};n[e(0x1e9)]=0x1,n[e(0x1eb)]=0x80,n[e(0x1f5)]=e(0x1e8);export const identifier=Type[e(0x1f9)](n);const a={};a[e(0x1f2)]=identifier;const E={};E[e(0x1e9)]=0x1;const M={};function I(){const h=['71520XxAvAR','152TyfhGg','^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$','minLength','765974TljGlL','maxLength','323064DovxPP','4313930vHCWXf','Object','Record','Unknown','11697qHGKEi','name','1560870qnKghy','Optional','pattern','2515910jgvksI','135ISrnLC','6864ldkHaj','String'];I=function(){return h;};return I();}M[e(0x1e9)]=0x1;export const systemSchemas={'dictionaryName':Type[e(0x1ee)](a),'settingsEntity':Type[e(0x1ee)]({'entity':Type[e(0x1f4)](identifier)}),'settings':Type[e(0x1ef)](Type[e(0x1f9)](E),Type[e(0x1f0)]()),'logger':Type[e(0x1ee)]({'*':Type[e(0x1f4)](Type[e(0x1f9)](M))})};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the check system application service for its module.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext, User } from "../../../context.js";
|
|
5
|
+
export declare function checkSystem(params: {
|
|
6
|
+
user: User;
|
|
7
|
+
}, ctx: AppContext): Promise<any>;
|
|
8
|
+
//# sourceMappingURL=check-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-system.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/check-system.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;CACZ,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAed"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(n,a){n=n-0xe5;const E=I();let M=E[n];return M;}(function(n,a){const e=b,E=n();while(!![]){try{const M=-parseInt(e(0xfc))/0x1+-parseInt(e(0xec))/0x2*(-parseInt(e(0xef))/0x3)+parseInt(e(0xf9))/0x4+-parseInt(e(0xf3))/0x5+-parseInt(e(0xeb))/0x6+parseInt(e(0xee))/0x7+parseInt(e(0xf7))/0x8;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xcd699));import{requireAdmin}from'../../utils/require-admin.js';function I(){const Z=['5141712wrXsyE','2bqSNKt','degraded','9199960GuJECs','2845083kxDWFg','redis','query','DZgfK','8383560QZDYwd','FnPQp','status','qmnLO','8129504dGsMMt','urqfz','5653292WygZHj','SELECT\x201','ping','1317119ZwpxnY','eWmyR','permissions','allSettled','system:check','fulfilled','user'];I=function(){return Z;};return I();}export async function checkSystem(a,E){const h=b,M={};M[h(0xf6)]=h(0xe8),M[h(0xf2)]=h(0xfa),M[h(0xe5)]=h(0xe9),M[h(0xf8)]=function(Y,g){return Y===g;},M[h(0xf4)]=h(0xed);const X=M,G=a;requireAdmin(a[h(0xea)],X[h(0xf6)],G?.[h(0xe6)]);const [j,u]=await Promise[h(0xe7)]([E['pg']?.[h(0xf1)](X[h(0xf2)]),E[h(0xf0)][h(0xfb)]()]);return{'status':j[h(0xf5)]===X[h(0xe5)]&&X[h(0xf8)](u[h(0xf5)],X[h(0xe5)])?'ok':X[h(0xf4)],'pg':j[h(0xf5)],'redis':u[h(0xf5)]};}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the get API list application service for the System module.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext, User } from "../../../context.js";
|
|
5
|
+
export declare function getApiList(params: {
|
|
6
|
+
user: User;
|
|
7
|
+
}, ctx: AppContext): Promise<string[]>;
|
|
8
|
+
//# sourceMappingURL=get-api-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-api-list.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-api-list.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,UAAU,CAC9B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;CACZ,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAcnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(n,a){n=n-0x172;const E=I();let M=E[n];return M;}(function(n,a){const Y=b,E=n();while(!![]){try{const M=parseInt(Y(0x172))/0x1+parseInt(Y(0x187))/0x2+-parseInt(Y(0x17a))/0x3+parseInt(Y(0x17d))/0x4+parseInt(Y(0x18c))/0x5+parseInt(Y(0x180))/0x6+-parseInt(Y(0x182))/0x7;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xb1fc8));import{requireAdmin}from'../../utils/require-admin.js';function I(){const e=['system:api:read','4288180MIocwT','aGAMr','lsJXt','6394998PQOOJe','lVkYI','24761611QUUOBK','DtENA','/api/resource/:resource/:id','user','/api/logout','2327374MXrRQM','permissions','gmBGm','/files/*','/api/dictionaries','1819505NqndSW','/api/templates','752961ULJibx','/api/resource/:resource','nBHPO','LRZQr','/api/system/check','wnaXV','/api/login','CbKet','456066uJfgoX','/api/user'];I=function(){return e;};return I();}export async function getApiList(n,a){const g=b,E={'DtENA':function(X,G,j,u){return X(G,j,u);},'aGAMr':g(0x17c),'LRZQr':g(0x178),'lVkYI':g(0x186),'nBHPO':g(0x184),'gmBGm':g(0x18b),'lsJXt':g(0x18a),'CbKet':g(0x18d),'wnaXV':g(0x176)},M=n;return E[g(0x183)](requireAdmin,n[g(0x185)],E[g(0x17e)],M?.[g(0x188)]),[E[g(0x175)],E[g(0x181)],g(0x17b),g(0x173),E[g(0x174)],E[g(0x189)],E[g(0x17f)],E[g(0x179)],E[g(0x177)]];}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the get audit log application service for its module.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext, User } from "../../../context.js";
|
|
5
|
+
export declare function getAuditLog(params: {
|
|
6
|
+
user: User;
|
|
7
|
+
page?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
}, ctx: AppContext): Promise<any>;
|
|
10
|
+
//# sourceMappingURL=get-audit-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-audit-log.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-audit-log.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAmBd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){const H=b,E=n();while(!![]){try{const M=-parseInt(H(0xa1))/0x1*(parseInt(H(0xa9))/0x2)+-parseInt(H(0xa5))/0x3+parseInt(H(0xae))/0x4+parseInt(H(0xa0))/0x5+parseInt(H(0xad))/0x6*(-parseInt(H(0xa4))/0x7)+-parseInt(H(0x9f))/0x8+parseInt(H(0xa6))/0x9;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x42c08));import{requireAdmin}from'../../utils/require-admin.js';function b(n,a){n=n-0x96;const E=I();let M=E[n];return M;}export async function getAuditLog(a,E){const t=b,M={'dmQpQ':function(g,e,h,Z){return g(e,h,Z);},'ETtso':t(0x9b),'AaZnN':function(g,e){return g-e;},'TwsQH':t(0xa7),'kcXtf':t(0xab)},X=a;M[t(0xa2)](requireAdmin,a[t(0x97)],M[t(0x98)],X?.[t(0x96)]);const G=Math[t(0x9e)](Math[t(0xa3)](a[t(0xaa)]??0x32,0x1),0xc8),j=Math[t(0xa3)](M[t(0x99)](a[t(0x9c)]??0x1,0x1),0x0)*G;if(!E['pg'])throw new Error(M[t(0x9a)]);const u=await E['pg'][t(0xac)](M[t(0x9d)],[G,j]),Y={};return Y[t(0xa8)]=u[t(0xa8)],Y[t(0x9c)]=a[t(0x9c)]??0x1,Y[t(0xaa)]=G,Y;}function I(){const B=['3999328hDmQQC','2147830iwadGi','188350yAYOOE','dmQpQ','max','915439VjIDBj','1011660wtzhlZ','6129396gSzYjh','empty\x20pg','rows','4CVtiIL','limit','SELECT\x20*\x20FROM\x20admin.audit_log\x20ORDER\x20BY\x20id\x20DESC\x20LIMIT\x20$1\x20OFFSET\x20$2','query','6eYsHjA','2029676cwezMv','permissions','user','ETtso','AaZnN','TwsQH','audit:read','page','kcXtf','min'];I=function(){return B;};return I();}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the get dictionary application service for the System module.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext } from '../../../context.js';
|
|
5
|
+
export declare function getDictionary(params: {
|
|
6
|
+
name: string;
|
|
7
|
+
}, ctx: AppContext): Promise<any[]>;
|
|
8
|
+
//# sourceMappingURL=get-dictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-dictionary.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-dictionary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAE7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function I(){var u=['840120ZzfzNJ','725214tXnggJ','2246208cutiEd','92LdlZuH','get','dictionary','1673544ocgYaO','40280hydjxn','name','18JTZEyX','93STOCrN','6756ZMepdF','1204830UVtcPQ'];I=function(){return u;};return I();}(function(n,a){var G=b,E=n();while(!![]){try{var M=parseInt(G(0x76))/0x1*(-parseInt(G(0x77))/0x2)+parseInt(G(0x79))/0x3+-parseInt(G(0x7c))/0x4*(-parseInt(G(0x80))/0x5)+-parseInt(G(0x7b))/0x6+-parseInt(G(0x7a))/0x7+-parseInt(G(0x7f))/0x8*(-parseInt(G(0x82))/0x9)+parseInt(G(0x78))/0xa;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x33c69));function b(n,a){n=n-0x76;var E=I();var M=E[n];return M;}export async function getDictionary(n,a){var j=b;return a[j(0x7e)][j(0x7d)](n[j(0x81)]);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-system-log.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-system-log.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAE/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){var G=b,E=n();while(!![]){try{var M=-parseInt(G(0xfe))/0x1*(parseInt(G(0xf6))/0x2)+-parseInt(G(0xf3))/0x3*(parseInt(G(0xfc))/0x4)+-parseInt(G(0xf1))/0x5*(parseInt(G(0xf7))/0x6)+-parseInt(G(0xf8))/0x7*(-parseInt(G(0xf4))/0x8)+-parseInt(G(0xf2))/0x9+-parseInt(G(0xfd))/0xa+-parseInt(G(0xfb))/0xb*(-parseInt(G(0xff))/0xc);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x9bef8));import{unsupported}from'../../utils/unsupported.js';function b(n,a){n=n-0xf1;var E=I();var M=E[n];return M;}export async function getSystemLog(n,a){var j=b,E={'mjvLr':function(M,X){return M(X);},'TIsmg':j(0xf5)};return E[j(0xf9)](unsupported,E[j(0xfa)]);}function I(){var u=['TIsmg','10909283cvmnvO','1100876OTpgUK','6939330nHWQUs','152CJczBF','36jhGsLx','218980ACgMsH','7689159LHHVxi','6RMtzAj','8siPJRs','File\x20logger\x20backend','9258fASjgK','66UgCjYG','6632773gIgqyz','mjvLr'];I=function(){return u;};return I();}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the get system settings application service for the System module.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext, User } from "../../../context.js";
|
|
5
|
+
export declare function getSystemSettings(params: {
|
|
6
|
+
user: User;
|
|
7
|
+
}, ctx: AppContext): Promise<Record<string, unknown>>;
|
|
8
|
+
//# sourceMappingURL=get-system-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-system-settings.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-system-settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,iBAAiB,CACrC,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;CACZ,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA0BlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(n,a){n=n-0xf7;const E=I();let M=E[n];return M;}function I(){const A=['ggLOg','query','80VUQJPm','76951MIYiRT','empty\x20pg','TiDDZ','value','700322PJIuyQ','3394950bceXLD','1839284vutmaN','rows','slice','323016RoiwqZ','DJiGU','2210430cZOXGB','3527696bpHRKX','split','permissions','seNdq','system:settings:read','user','key','\x0a\x20\x20\x20\x20\x20\x20SELECT\x20key,\x20value\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.settings\x0a\x20\x20\x20\x20\x20\x20WHERE\x20resource\x20=\x20\x27system\x27\x20AND\x20resource_id\x20IS\x20NULL\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20key\x0a\x20\x20\x20\x20','reduce'];I=function(){return A;};return I();}(function(n,a){const H=b,E=n();while(!![]){try{const M=-parseInt(H(0x106))/0x1+-parseInt(H(0x10c))/0x2+parseInt(H(0xf9))/0x3+-parseInt(H(0xfa))/0x4+parseInt(H(0x10b))/0x5+-parseInt(H(0xf7))/0x6+-parseInt(H(0x10a))/0x7*(-parseInt(H(0x105))/0x8);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x76243));import{requireAdmin}from'../../utils/require-admin.js';export async function getSystemSettings(n,a){const t=b,E={'ggLOg':function(X,G){return X(G);},'DJiGU':function(X,G,j,u){return X(G,j,u);},'TiDDZ':t(0xfe),'seNdq':t(0x107)};E[t(0xf8)](requireAdmin,n[t(0xff)],E[t(0x108)],n[t(0xff)][t(0xfc)]);if(!a['pg'])throw new Error(E[t(0xfd)]);const M=await a['pg'][t(0x104)](t(0x101));return M[t(0x10d)][t(0x102)]((X,G)=>{const B=t,j=E[B(0x103)](String,G[B(0x100)])[B(0xfb)]('.');let u=X;for(const Y of j[B(0x10e)](0x0,-0x1)){u[Y]??={},u=u[Y];}return u[j['at'](-0x1)]=G[B(0x109)],X;},{});}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the list dictionaries application service for the System module.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext } from '../../../context.js';
|
|
5
|
+
export declare function listDictionaries(_params: unknown, ctx: AppContext): Promise<any[]>;
|
|
6
|
+
//# sourceMappingURL=list-dictionaries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-dictionaries.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/list-dictionaries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAExF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(n,a){n=n-0x66;var E=I();var M=E[n];return M;}function I(){var u=['70YfeVRM','66ShGNiK','11363RIVjLS','1704MZeuHV','4047YaQtvJ','dictionary','30nDXwXV','list','158010BxFzMl','1350996UHihSc','953296OwoFxO','425448epcPxZ','90UmQIqs','4915284EfOKjw'];I=function(){return u;};return I();}(function(n,a){var G=b,E=n();while(!![]){try{var M=-parseInt(G(0x6c))/0x1*(-parseInt(G(0x6b))/0x2)+parseInt(G(0x6e))/0x3*(parseInt(G(0x6d))/0x4)+-parseInt(G(0x72))/0x5*(-parseInt(G(0x68))/0x6)+parseInt(G(0x6a))/0x7*(-parseInt(G(0x66))/0x8)+parseInt(G(0x67))/0x9*(-parseInt(G(0x70))/0xa)+parseInt(G(0x69))/0xb+parseInt(G(0x73))/0xc;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x9e9ca));export async function listDictionaries(n,a){var j=b;return a[j(0x6f)][j(0x71)]();}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the update system settings application service for its module.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext, User } from "../../../context.js";
|
|
5
|
+
export declare function updateSystemSettings(params: {
|
|
6
|
+
user: User;
|
|
7
|
+
patch: Record<string, unknown>;
|
|
8
|
+
}, ctx: AppContext): Promise<{
|
|
9
|
+
success: true;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=update-system-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-system-settings.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/update-system-settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAsB,oBAAoB,CACxC,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC,CA8B5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){const g=b,E=n();while(!![]){try{const M=parseInt(g(0x10b))/0x1*(parseInt(g(0x111))/0x2)+-parseInt(g(0xfb))/0x3+parseInt(g(0xfd))/0x4*(parseInt(g(0xff))/0x5)+parseInt(g(0x10a))/0x6*(-parseInt(g(0x119))/0x7)+parseInt(g(0x118))/0x8*(parseInt(g(0xfe))/0x9)+parseInt(g(0x101))/0xa*(-parseInt(g(0x109))/0xb)+parseInt(g(0x10d))/0xc;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x8dd61));function b(n,a){n=n-0xfb;const E=I();let M=E[n];return M;}import{requireAdmin}from'../../utils/require-admin.js';import{ValidationError}from'../../../errors.js';export async function updateSystemSettings(a,E){const e=b,M={'mAlkj':function(G,j,u,Y){return G(j,u,Y);},'NZMUD':e(0x10c),'wwiWV':e(0x116)};M[e(0x108)](requireAdmin,a[e(0x117)],M[e(0x10f)],a[e(0x117)][e(0x113)]);if(!Object[e(0xfc)](a[e(0x10e)])[e(0x107)])throw new ValidationError(e(0x106));for(const [G,j]of Object[e(0x105)](a[e(0x10e)])){if(!G[e(0x100)]()||G[e(0x114)]('..'))throw new ValidationError(e(0x112)+G);if(!E['pg'])throw new Error(M[e(0x104)]);await E['pg'][e(0x110)](e(0x103),[G,JSON[e(0x115)](j),a[e(0x117)]['id']]);}const X={};return X[e(0x102)]=!![],X;}function I(){const h=['keys','28maNEUK','45eodlnK','324215XwrLOP','trim','980JoHhrU','success','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.settings\x20(resource,\x20resource_id,\x20key,\x20value,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(\x27system\x27,\x20NULL,\x20$1,\x20$2::jsonb,\x20$3)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT\x20(resource,\x20resource_id,\x20key)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20DO\x20UPDATE\x20SET\x20value\x20=\x20EXCLUDED.value,\x20updated_by\x20=\x20EXCLUDED.updated_by,\x20updated_at\x20=\x20now()\x0a\x20\x20\x20\x20\x20\x20\x20\x20','wwiWV','entries','Settings\x20patch\x20is\x20empty','length','mAlkj','65307cbkzCr','2892ibGJwS','337YKMALu','system:settings:update','1388328mGHzTL','patch','NZMUD','query','5982OTcLXg','Invalid\x20setting\x20key:\x20','permissions','includes','stringify','empty\x20pg','user','234248yoLmEu','1351pofbQQ','1404462jXtKaf'];I=function(){return h;};return I();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-permissions.d.ts","sourceRoot":"","sources":["../../../src/modules/utils/get-user-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(n,a){n=n-0x160;const E=I();let M=E[n];return M;}(function(n,a){const u=b,E=n();while(!![]){try{const M=-parseInt(u(0x164))/0x1*(-parseInt(u(0x161))/0x2)+-parseInt(u(0x167))/0x3+parseInt(u(0x162))/0x4+-parseInt(u(0x16d))/0x5+-parseInt(u(0x163))/0x6*(parseInt(u(0x160))/0x7)+-parseInt(u(0x16a))/0x8*(parseInt(u(0x168))/0x9)+parseInt(u(0x16b))/0xa;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xd7062));function I(){const g=['721LEoQmE','2aGBkwX','780316utPFfi','26328oHlTqQ','1199936YWqAKR','empty\x20pg','actions','875964ydxhqU','10113561ulfSSI','\x0a\x20\x20\x20\x20\x20\x20SELECT\x20ra.actions\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x20ON\x20ur.role_id\x20=\x20ra.role_id\x0a\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20','8KxXNPH','27069810PZpPIq','flatMap','6767885EeXrFY','rows','qDMTl','query'];I=function(){return g;};return I();}export async function getUserPermissions(a,E){const Y=b,M={};M[Y(0x16f)]=Y(0x165);const X=M;if(!a['pg'])throw new Error(X[Y(0x16f)]);const G=await a['pg'][Y(0x170)](Y(0x169),[E]);return[...new Set(G[Y(0x16e)][Y(0x16c)](j=>j[Y(0x166)]??[]))];}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-admin.d.ts","sourceRoot":"","sources":["../../../src/modules/utils/require-admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,IAAI,CAUN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){var T=b,E=n();while(!![]){try{var M=-parseInt(T(0x74))/0x1+-parseInt(T(0x78))/0x2+-parseInt(T(0x83))/0x3*(parseInt(T(0x76))/0x4)+parseInt(T(0x7b))/0x5*(parseInt(T(0x82))/0x6)+parseInt(T(0x85))/0x7*(parseInt(T(0x70))/0x8)+-parseInt(T(0x84))/0x9*(parseInt(T(0x7a))/0xa)+parseInt(T(0x7c))/0xb*(parseInt(T(0x71))/0xc);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xb7662));function I(){var s=['includes','nUbZX','Missing\x20permission:\x20','type','149766EIQSWX','3687816uUbgqx','2655xRiwII','7yfOdDS','2524504KLxzOQ','51123288AFpMXp','MwJRu','FEbeF','853234lrDegd','zzBZP','4WfdtWn','Admin\x20access\x20required','2612196DtXkeW','User\x20required','47780ZvDtGu','195QpbEkO','11QaZOIA','admin'];I=function(){return s;};return I();}import{ForbiddenError}from'../../errors.js';function b(n,a){n=n-0x70;var E=I();var M=E[n];return M;}export function requireAdmin(a,E,M){var y=b,X={};X[y(0x7f)]=function(j,u){return j!==u;},X[y(0x73)]=y(0x7d),X[y(0x72)]=y(0x77),X[y(0x75)]=function(j,u){return j&&u;};var G=X;if(!a)throw new ForbiddenError(y(0x79));if(G[y(0x7f)](a[y(0x81)],G[y(0x73)]))throw new ForbiddenError(G[y(0x72)]);if(G[y(0x75)](E,M)&&!M[y(0x7e)](E))throw new ForbiddenError(y(0x80)+E);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-user.d.ts","sourceRoot":"","sources":["../../../src/modules/utils/safe-user.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,SACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAQxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(n,a){n=n-0xa7;const E=I();let M=E[n];return M;}(function(n,a){const g=b,E=n();while(!![]){try{const M=-parseInt(g(0xaa))/0x1*(parseInt(g(0xab))/0x2)+-parseInt(g(0xbc))/0x3+parseInt(g(0xb3))/0x4*(parseInt(g(0xa8))/0x5)+-parseInt(g(0xb8))/0x6+parseInt(g(0xbd))/0x7+parseInt(g(0xb5))/0x8*(parseInt(g(0xad))/0x9)+-parseInt(g(0xaf))/0xa;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x275f7));function I(){const h=['1nuDaZS','110176UVtbhJ','password','3357wSziJt','credentials','160530xcZxML','salt','filter','toLowerCase','4HnbRGU','includes','2824ZBooiv','token','YuVpO','934758awVcdD','entries','SKZSF','secret','599337Vyfjtr','985747vtWBzT','oNCNl','some','fromEntries','1577470NOljAA','XMxRD'];I=function(){return h;};return I();}export const safeUser=a=>{const e=b,E={};E[e(0xba)]=e(0xac),E[e(0xb7)]=e(0xb0),E[e(0xbe)]=e(0xbb),E[e(0xa9)]=e(0xae);const M=E,X=[M[e(0xba)],M[e(0xb7)],e(0xb6),M[e(0xbe)],M[e(0xa9)]];return Object[e(0xa7)](Object[e(0xb9)](a)[e(0xb1)](([G])=>!X[e(0xbf)](j=>G[e(0xb2)]()[e(0xb4)](j))));};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsupported.d.ts","sourceRoot":"","sources":["../../../src/modules/utils/unsupported.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAElD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){var G=b,E=n();while(!![]){try{var M=parseInt(G(0x7d))/0x1+-parseInt(G(0x80))/0x2+parseInt(G(0x76))/0x3*(-parseInt(G(0x79))/0x4)+-parseInt(G(0x7e))/0x5*(-parseInt(G(0x7c))/0x6)+-parseInt(G(0x7a))/0x7+parseInt(G(0x77))/0x8*(-parseInt(G(0x7f))/0x9)+parseInt(G(0x7b))/0xa;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xe0113));import{UnsupportedError}from'../../errors.js';function I(){var u=['20555400zleXQK','12CTtzwZ','273230RisdVR','3392915saHccI','9AbXhep','42708eLiDvr','3tdTQxC','9986272EHPHmt','\x20requires\x20a\x20project/provider\x20implementation','2305624MdSEhE','6454791BnamHc'];I=function(){return u;};return I();}function b(n,a){n=n-0x76;var E=I();var M=E[n];return M;}export function unsupported(n){var j=b;throw new UnsupportedError(n+j(0x78));}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements reusable audit logging infrastructure.
|
|
3
|
+
*/
|
|
4
|
+
import type { DatabaseAdapter } from "../pg.js";
|
|
5
|
+
import type { ExtendedLogger } from "../logger/index.js";
|
|
6
|
+
import type { AuditPlugin } from "./audit.types.js";
|
|
7
|
+
export declare function createAudit(deps: {
|
|
8
|
+
pg: DatabaseAdapter | null;
|
|
9
|
+
logger: ExtendedLogger;
|
|
10
|
+
}): AuditPlugin;
|
|
11
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/plugins/audit/audit.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,EAAE,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,WAAW,CAGd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function I(){const g=['4213oNTPmY','2785426ZXCkpH','1807845QCnBWK','write','3PQVrZT','iXgoo','1552woQDyA','18710cqzmoq','96267eLiHgI','629984jGnirw','3815004Jjcyph','18tdHjHL','62694IWAInt'];I=function(){return g;};return I();}function b(n,a){n=n-0x174;const E=I();let M=E[n];return M;}(function(n,a){const u=b,E=n();while(!![]){try{const M=parseInt(u(0x17d))/0x1+parseInt(u(0x17e))/0x2*(parseInt(u(0x179))/0x3)+parseInt(u(0x17f))/0x4+-parseInt(u(0x177))/0x5*(-parseInt(u(0x180))/0x6)+parseInt(u(0x176))/0x7+-parseInt(u(0x17b))/0x8*(parseInt(u(0x174))/0x9)+-parseInt(u(0x17c))/0xa*(parseInt(u(0x175))/0xb);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xbe576));import{writeAudit}from'./services/write-audit.js';export function createAudit(a){const Y=b,E={'iXgoo':function(G,j){return G(j);}},M=E[Y(0x17a)](writeAudit,a),X={};return X[Y(0x178)]=M,X;}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements reusable audit logging infrastructure.
|
|
3
|
+
*/
|
|
4
|
+
export type AuditAction = string;
|
|
5
|
+
export interface AuditActor {
|
|
6
|
+
userId?: string | number;
|
|
7
|
+
requestId?: string;
|
|
8
|
+
ipAddress?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AuditChange {
|
|
11
|
+
field: string;
|
|
12
|
+
oldValue?: unknown;
|
|
13
|
+
newValue?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface AuditEvent extends AuditActor {
|
|
16
|
+
module: string;
|
|
17
|
+
resource: string;
|
|
18
|
+
resourceId?: string | number;
|
|
19
|
+
action: AuditAction;
|
|
20
|
+
fields?: string[];
|
|
21
|
+
changes?: AuditChange[];
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface AuditPlugin {
|
|
25
|
+
write(event: AuditEvent): Promise<number>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=audit.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.types.d.ts","sourceRoot":"","sources":["../../../src/plugins/audit/audit.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AACD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/audit/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){var G=b,E=n();while(!![]){try{var M=parseInt(G(0x16c))/0x1*(parseInt(G(0x16e))/0x2)+parseInt(G(0x16b))/0x3+-parseInt(G(0x169))/0x4+parseInt(G(0x168))/0x5+-parseInt(G(0x16a))/0x6+-parseInt(G(0x16f))/0x7+parseInt(G(0x16d))/0x8;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xdf5f9));export*from'./audit.types.js';function I(){var j=['1437504dfKAyp','177234YfdySn','1AAXJDA','177944TAdJBu','2347306nGhOWT','4709565urqjdY','5167335lEIgja','1844500wLiWCf'];I=function(){return j;};return I();}function b(n,a){n=n-0x168;var E=I();var M=E[n];return M;}export*from'./audit.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writes audit events and field-level changes while redacting secret values.
|
|
3
|
+
*/
|
|
4
|
+
import type { ExtendedLogger } from "../../logger/index.js";
|
|
5
|
+
import type { DatabaseAdapter } from "../../pg.js";
|
|
6
|
+
import type { AuditEvent } from "../audit.types.js";
|
|
7
|
+
export declare function writeAudit(deps: {
|
|
8
|
+
pg: DatabaseAdapter | null;
|
|
9
|
+
logger: ExtendedLogger;
|
|
10
|
+
}): (event: AuditEvent) => Promise<number>;
|
|
11
|
+
//# sourceMappingURL=write-audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-audit.d.ts","sourceRoot":"","sources":["../../../../src/plugins/audit/services/write-audit.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAgBpD,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAC/B,EAAE,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;CACxB,WA8CoC,UAAU,KAAG,OAAO,CAAC,MAAM,CAAC,CAiFhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){const U=b,E=n();while(!![]){try{const M=parseInt(U(0x1cf))/0x1*(parseInt(U(0x1ce))/0x2)+-parseInt(U(0x1f0))/0x3+-parseInt(U(0x1b3))/0x4+-parseInt(U(0x1f5))/0x5+parseInt(U(0x1ab))/0x6+parseInt(U(0x1ec))/0x7+-parseInt(U(0x1c2))/0x8*(-parseInt(U(0x1e4))/0x9);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xc3a7b));const secretPattern=/password|token|secret|credential|salt/i;function b(n,a){n=n-0x1a9;const E=I();let M=E[n];return M;}function clean(a){const W=b,E={};E[W(0x1d0)]=W(0x1e3),E[W(0x1b8)]=W(0x1ea),E[W(0x1ca)]=function(G,j){return G===j;},E[W(0x1ad)]=W(0x1b4),E[W(0x1bb)]=function(G,j){return G!==j;},E[W(0x1d1)]=W(0x1e8);const M=E;if(Array[W(0x1dd)](a))return a[W(0x1e1)](clean);if(a&&M[W(0x1ca)](typeof a,M[W(0x1ad)])){if(M[W(0x1bb)](M[W(0x1d1)],W(0x1f6)))return Object[W(0x1a9)](Object[W(0x1aa)](a)[W(0x1e1)](([G,j])=>[G,secretPattern[W(0x1f3)](G)?W(0x1e2):clean(j)]));else{const G={};G[W(0x1af)]=[W(0x1eb),M[W(0x1d0)]],G[W(0x1bf)]=[...M],E[W(0x1b0)][W(0x1d4)](G,M[W(0x1b8)]);}}return a;}export function writeAudit(n){const f=b,a={'dFRGq':function(G,j){return G===j;},'bpkhG':f(0x1b4),'vCIAe':f(0x1cd),'DYFJS':f(0x1e0),'IHlyv':function(G,j){return G!==j;},'MRbHu':f(0x1ed),'VElnV':f(0x1f2),'mtTvC':f(0x1eb),'etWvr':f(0x1e3),'hFwyI':f(0x1c6),'yOsgO':function(G){return G();},'cpekP':function(G,j){return G(j);},'YCiQd':f(0x1cc),'bPAyd':function(G,j){return G==j;},'emvbd':function(G,j){return G(j);},'xSEhi':function(G,j){return G(j);}};let E,M;async function X(){const x=f;if(!n['pg'])return![];if(a[x(0x1d8)](E,undefined)){if(a[x(0x1d8)](a[x(0x1df)],x(0x1cb)))return E;else{if(Z[x(0x1dd)](H))return T[x(0x1e1)](y);if(A&&bQROJj[x(0x1f9)](typeof r,bQROJj[x(0x1f7)]))return s[x(0x1a9)](N[x(0x1aa)](z)[x(0x1e1)](([S,c])=>[S,F[x(0x1f3)](S)?x(0x1e2):i(c)]));return m;}}return M??=n['pg'][x(0x1db)](x(0x1d9))[x(0x1ef)](j=>{const D=x,u=new Set(j[D(0x1b6)][D(0x1e1)](g=>g[D(0x1b9)]));E=u[D(0x1be)](a[D(0x1c0)])&&u[D(0x1be)](a[D(0x1d5)]);if(!E){if(a[D(0x1d8)](a[D(0x1bc)],a[D(0x1bd)])){const g={};g[D(0x1af)]=[a[D(0x1f1)],a[D(0x1ae)]],g[D(0x1bf)]=[...u],n[D(0x1b0)][D(0x1d4)](g,D(0x1ea));}else throw new a(D(0x1cc));}return E;})[x(0x1b5)](j=>{const L=x;E=![];const u={};return u[L(0x1f4)]=j,n[L(0x1b0)][L(0x1d4)](u,L(0x1dc)),![];}),M;}return async function G(j){const O=f;if(!await a[O(0x1d6)](X))return n[O(0x1b0)][O(0x1e5)]({'auditFallback':!![],'event':a[O(0x1c1)](clean,{...j,'changes':j[O(0x1b7)]?.[O(0x1e1)](g=>({...g,'oldValue':clean(g[O(0x1ee)]),'newValue':clean(g[O(0x1c3)])}))})},O(0x1e7)),0x0;if(!n['pg'])throw new Error(a[O(0x1da)]);const u=await n['pg'][O(0x1db)](O(0x1d7),[j[O(0x1f8)]??null,j[O(0x1de)],j[O(0x1c8)],a[O(0x1b2)](j[O(0x1e9)],null)?null:String(j[O(0x1e9)]),j[O(0x1ac)]??null,j[O(0x1c9)],j[O(0x1d2)]??null,j[O(0x1ba)]??null,a[O(0x1e6)](clean,j[O(0x1d3)]??{})]),Y=u[O(0x1b6)][0x0]['id'];for(const g of j[O(0x1b7)]??[]){if(secretPattern[O(0x1f3)](g[O(0x1c5)]))continue;await n['pg'][O(0x1db)](O(0x1b1),[Y,g[O(0x1c5)],JSON[O(0x1c7)](a[O(0x1c4)](clean,g[O(0x1ee)])),JSON[O(0x1c7)](a[O(0x1e6)](clean,g[O(0x1c3)]))]);}return Y;};}function I(){const q=['etWvr','expectedTables','logger','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log_data\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20audit_log_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20field,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20old_value,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20new_value\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20','bPAyd','1272988JJoBRI','object','catch','rows','changes','nVKBo','table_name','ipAddress','cPEBa','MRbHu','VElnV','has','foundTables','vCIAe','cpekP','8wfaNHX','newValue','xSEhi','field','CaLaN','stringify','resource','action','sAiaR','DCrPD','empty\x20pg','audit_log','1878qnomyX','753yAUAFv','rZNPw','PhPEx','requestId','metadata','warn','DYFJS','yOsgO','\x0a\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20user_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20module,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20fields,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20action,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20request_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ip_address,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20metadata\x0a\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5,\x20$6,\x20$7,\x20$8,\x20$9)\x0a\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20id\x0a\x20\x20\x20\x20\x20\x20','IHlyv','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_schema\x20=\x20\x27admin\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20IN\x20(\x27audit_log\x27,\x20\x27audit_log_data\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20','YCiQd','query','Unable\x20to\x20check\x20audit\x20tables;\x20audit\x20writes\x20are\x20disabled','isArray','module','hFwyI','audit_log_data','map','[REDACTED]','admin.audit_log_data','14861160rbaoeD','info','emvbd','audit','iepXY','resourceId','Audit\x20tables\x20are\x20unavailable;\x20audit\x20writes\x20are\x20disabled','admin.audit_log','326368ukpBXt','NXVsJ','oldValue','then','1896297VrBudJ','mtTvC','eMQfX','test','err','3295885rEVCxw','Yskjp','bpkhG','userId','dFRGq','fromEntries','entries','35970cbiCKn','fields','TctBB'];I=function(){return q;};return I();}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AuthUser {
|
|
2
|
+
id: string;
|
|
3
|
+
type: "regular" | "admin";
|
|
4
|
+
permissions: string[];
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface LoginParams {
|
|
8
|
+
login: string;
|
|
9
|
+
password: string;
|
|
10
|
+
ip: string;
|
|
11
|
+
}
|
|
12
|
+
export interface LoginResponse {
|
|
13
|
+
user: AuthUser;
|
|
14
|
+
redirecUrl: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=auth.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.types.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/auth.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./auth.types.js";
|
|
2
|
+
import { type FastifyInstance } from "fastify";
|
|
3
|
+
import { type ContextDependencies } from "../../context.js";
|
|
4
|
+
export declare function createSessionStore(app: FastifyInstance, ctx: ContextDependencies): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,mBAAmB,iBAsCzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){const t=b,G=n();while(!![]){try{const j=-parseInt(t(0x132))/0x1*(parseInt(t(0x12e))/0x2)+-parseInt(t(0x13d))/0x3*(parseInt(t(0x12d))/0x4)+-parseInt(t(0x13a))/0x5*(parseInt(t(0x136))/0x6)+-parseInt(t(0x124))/0x7+-parseInt(t(0x13c))/0x8+parseInt(t(0x12c))/0x9*(-parseInt(t(0x137))/0xa)+parseInt(t(0x13b))/0xb;if(j===a)break;else G['push'](G['shift']());}catch(u){G['push'](G['shift']());}}}(I,0x664d4));export*from'./auth.types.js';import E from'@fastify/cookie';function I(){const A=['user','xTHQC','database','5985cFLITz','10840wZVlsm','14026fVvONx','initialize','secret','warn','66dWoSKs','secureSession','register','registerUserDeserializer','30iSsPcF','1110ixbyyu','Missing\x20config\x20or\x20redis\x20-\x20skipping\x20session\x20store\x20creation','test','452875MHcWEB','22824439bIAsVW','2096096UXcSBS','15neshHD','cookieName','xkjFy','parseOptions','2735677wEKQjM','auth','cookieOptions','Igknv','registerUserSerializer'];I=function(){return A;};return I();}import M from'@fastify/session';import{Authenticator}from'@fastify/passport';import X from'fastify-session-redis-store';function b(n,a){n=n-0x121;const E=I();let M=E[n];return M;}const fastifyPassport=new Authenticator();export async function createSessionStore(G,j){const B=b,u={};u[B(0x122)]=function(Z,H){return Z||H;},u[B(0x127)]=function(Z,H){return Z===H;},u[B(0x12a)]=B(0x139);const Y=u,{config:g,redis:e}=j;if(Y[B(0x122)](!g,!e)){console[B(0x131)](B(0x138));return;}if(Y[B(0x127)](process.env.NODE_ENV,Y[B(0x12a)])||process.env.VITEST)return;const h={};h[B(0x123)]=g[B(0x125)][B(0x126)],await G[B(0x134)](E,h),await G[B(0x134)](M,{'secret':g[B(0x125)][B(0x130)],'cookieName':g[B(0x125)][B(0x121)],'cookie':g[B(0x125)][B(0x126)],'store':new X({'prefix':g[B(0x125)][B(0x121)]+':'+(g['pg']?.[B(0x12b)]||'db')+':','client':e})}),await G[B(0x134)](fastifyPassport[B(0x12f)]()),await G[B(0x134)](fastifyPassport[B(0x133)]()),fastifyPassport[B(0x128)](async Z=>({'user':Z})),fastifyPassport[B(0x135)](async Z=>Z?.[B(0x129)]||Z);}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DatabaseAdapter } from "./pg.js";
|
|
2
|
+
export interface DictionaryItem {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
code: string;
|
|
5
|
+
name: string;
|
|
6
|
+
parentId?: string | number | null;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface DictionaryDefinition {
|
|
10
|
+
code: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
items: DictionaryItem[];
|
|
13
|
+
}
|
|
14
|
+
export interface DictionaryPlugin {
|
|
15
|
+
register(input: DictionaryDefinition | DictionaryDefinition[]): void;
|
|
16
|
+
get(name: string): Promise<DictionaryItem[]>;
|
|
17
|
+
put(name: string, items: DictionaryItem[]): Promise<void>;
|
|
18
|
+
clear(name: string): boolean;
|
|
19
|
+
list(): Promise<Array<{
|
|
20
|
+
code: string;
|
|
21
|
+
name: string;
|
|
22
|
+
source: "static" | "database";
|
|
23
|
+
}>>;
|
|
24
|
+
}
|
|
25
|
+
export interface DictionaryDependencies {
|
|
26
|
+
pg: DatabaseAdapter | null;
|
|
27
|
+
dictionaries?: DictionaryDefinition[];
|
|
28
|
+
}
|
|
29
|
+
export declare function createDictionary({ pg, dictionaries, }: DictionaryDependencies): DictionaryPlugin;
|
|
30
|
+
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../src/plugins/dictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,GAAG,IAAI,CAAC;IACrE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC7C,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,IAAI,IAAI,OAAO,CACb,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;KAAE,CAAC,CACrE,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACvC;AAID,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,YAAiB,GAClB,EAAE,sBAAsB,GAAG,gBAAgB,CAmM3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){const f=b,E=n();while(!![]){try{const M=-parseInt(f(0x182))/0x1*(-parseInt(f(0x18e))/0x2)+parseInt(f(0x1b8))/0x3+parseInt(f(0x1a7))/0x4+-parseInt(f(0x185))/0x5*(parseInt(f(0x17e))/0x6)+parseInt(f(0x1ba))/0x7+-parseInt(f(0x197))/0x8+-parseInt(f(0x1be))/0x9;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x1d56c));function b(n,a){n=n-0x162;const E=I();let M=E[n];return M;}import{ConflictError,NotFoundError,ValidationError}from'../errors.js';const dictionaryName=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;function I(){const V=['dictionaries','YfBUT','1DLHghN','delete','IDmgy','1490Soqood','ROLLBACK','QTUCt','rveOC','hwzSO','Dictionary\x20items\x20must\x20be\x20an\x20array','GPjJn','qBFix','uIZMr','231674ulQwGJ','has','database','xgvaJ','list','connect','Dictionary\x20not\x20found:\x20','QXZum','EcNcg','625072yJyccH','qeeJD','custom','fcore','eKzob','code','jgmsD','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_schema\x20=\x20\x27admin\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20\x27dictionaries\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20LIMIT\x201\x0a\x20\x20\x20\x20\x20\x20\x20\x20','Lemuz','put','release','ZUbkG','IfGAA','tCAyk','table_name','parentId','336044jApzEi','bPlSG','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.dictionaries\x20(code,\x20name,\x20module,\x20source,\x20editable)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT\x20(code)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name\x20=\x20EXCLUDED.name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20module\x20=\x20EXCLUDED.module,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20source\x20=\x20EXCLUDED.source,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20editable\x20=\x20EXCLUDED.editable,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updated_at\x20=\x20now()\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','MSpjr','ldCkz','GSuiQ','SIIdq','isArray','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20di.id,\x20di.code,\x20di.name,\x20di.parent_id\x20AS\x20\x22parentId\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.dictionary_items\x20di\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20admin.dictionaries\x20d\x20ON\x20d.id\x20=\x20di.dictionary_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20d.code\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20di.name\x0a\x20\x20\x20\x20\x20\x20\x20\x20','SOSPj','clear','DELETE\x20FROM\x20admin.dictionary_items\x20WHERE\x20dictionary_id\x20=\x20$1','CaoNB','Dictionary\x20table\x20not\x20found','length','register','CTEkC','365673aUhNpQ','items','1585472EzxgpY','COMMIT','BVcra','push','1832499sXzZsd','empty\x20pg','GBllB','jfdwj','upFHs','Dictionary\x20already\x20registered:\x20','VXpbQ','lGXaP','Zykzp','vaRZf','CKeqI','qpMyW','Invalid\x20dictionary\x20name:\x20','set','values','then','Invalid\x20dictionary\x20items:\x20','kUmgU','rows','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20code,\x20name,\x20\x27database\x27\x20AS\x20source\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.dictionaries\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20name\x0a\x20\x20\x20\x20\x20\x20\x20\x20','cZJnT','query','static','oEqFS','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.dictionary_items\x20(dictionary_id,\x20code,\x20name,\x20parent_id)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','get','nvKJS','PayBO','opCOg','test','NWCZK','BEGIN','HhjFu','map','2946jBLqre','name'];I=function(){return V;};return I();}export function createDictionary({pg:a,dictionaries:dictionaries=[]}){const x=b,E={'SOSPj':function(t,B){return t===B;},'jgmsD':x(0x180),'HhjFu':function(t,B){return t!==B;},'rveOC':x(0x1bf),'upFHs':function(t,B){return t(B);},'GBllB':x(0x18c),'QTUCt':x(0x1aa),'GPjJn':function(t,B){return t!==B;},'kUmgU':x(0x196),'jfdwj':function(t,B){return t(B);},'qeeJD':function(t,B){return t===B;},'oEqFS':x(0x163),'eKzob':x(0x1a3),'BVcra':function(t){return t();},'SIIdq':x(0x191),'QXZum':function(t,B){return t(B);},'Lemuz':x(0x1b4),'qpMyW':x(0x1ab),'Zykzp':x(0x1ac),'YfBUT':x(0x17b),'tCAyk':x(0x19a),'PayBO':x(0x1b2),'nvKJS':x(0x165),'cZJnT':x(0x178),'CKeqI':x(0x1bb),'CaoNB':x(0x18a),'hwzSO':x(0x1a8),'VXpbQ':x(0x1b7),'NWCZK':function(t,B){return t(B);}};if(!a)throw new Error(E[x(0x188)]);const M=new Map();let X,G;async function j(){const D=x;if(E[D(0x17c)](X,undefined))return X;if(!a)throw new Error(E[D(0x188)]);return G??=a[D(0x171)](D(0x19e))[D(0x16b)](t=>{const L=D,B=t[L(0x16e)][0x0]?.[L(0x1a5)];X=E[L(0x1b0)](B,E[L(0x19d)])?B:null;}),await G,X;}function u(t){const O=x;if(!dictionaryName[O(0x179)](t))throw new ValidationError(O(0x168)+t);}function Y(t){const q=x;for(const B of Array[q(0x1ae)](t)?t:[t]){if(E[q(0x17c)](E[q(0x1c0)],E[q(0x187)])){E[q(0x1c2)](u,B[q(0x19c)]);if(!Array[q(0x1ae)](B[q(0x1b9)]))throw new ValidationError(q(0x16c)+B[q(0x19c)]);if(M[q(0x18f)](B[q(0x19c)]))throw new ConflictError(q(0x1c3)+B[q(0x19c)]);M[q(0x169)](B[q(0x19c)],{...B,'source':q(0x172)});}else return E[q(0x1c2)](X,G),j[q(0x183)](u);}}async function g(t){const K=x;if(E[K(0x18b)](K(0x196),E[K(0x16d)]))throw new a(K(0x1b4));else{E[K(0x1c1)](u,t);const A=M[K(0x175)](t);if(A){if(E[K(0x198)](E[K(0x173)],E[K(0x19b)]))throw new E(K(0x194)+M);else return A[K(0x1b9)];}const r=await E[K(0x1bc)](j);if(!r)throw new NotFoundError(K(0x1b4));if(!a){if(E[K(0x198)](K(0x1a2),E[K(0x1ad)]))throw new a(E[K(0x188)]);else throw new Error(E[K(0x188)]);}const k=await a[K(0x171)](K(0x1af),[t]);if(!k[K(0x16e)][K(0x1b5)])throw new NotFoundError(K(0x194)+t);const p=k[K(0x16e)];return M[K(0x169)](t,{'code':t,'name':t,'items':p,'source':K(0x190)}),p;}}async function e(t,B){const d=x;E[d(0x195)](u,t);if(!Array[d(0x1ae)](B))throw new ValidationError(d(0x18a));const A=await E[d(0x1bc)](j);if(!A){if(E[d(0x1b0)](d(0x18d),d(0x184)))a[d(0x1a1)]();else throw new NotFoundError(E[d(0x19f)]);}if(!a){if(E[d(0x18b)](E[d(0x167)],E[d(0x164)]))throw new Error(E[d(0x188)]);else return a;}const r=await a[d(0x193)]();try{await r[d(0x171)](E[d(0x181)]);const l=await r[d(0x171)](d(0x1a9),[t,t,E[d(0x1a4)],d(0x199),!![]]),P=l[d(0x16e)][0x0]['id'];await r[d(0x171)](E[d(0x177)],[P]);for(const J of B){if(E[d(0x1b0)](E[d(0x176)],E[d(0x170)]))return a;else await r[d(0x171)](d(0x174),[P,J[d(0x19c)],J[d(0x17f)],J[d(0x1a6)]??null]);}await r[d(0x171)](E[d(0x166)]);}catch(T){await r[d(0x171)](d(0x186));throw T;}finally{r[d(0x1a1)]();}h(t);}function h(t){const Q=x;return E[Q(0x195)](u,t),M[Q(0x183)](t);}async function Z(){const v=x,t=[...M[v(0x16a)]()][v(0x17d)](({code:r,name:k,source:p})=>({'code':r,'name':k??r,'source':p})),B=await E[v(0x1bc)](j);if(!B)return t;if(!a)throw new Error(E[v(0x188)]);const A=await a[v(0x171)](v(0x16f));for(const r of A[v(0x16e)]){if(E[v(0x17c)](E[v(0x189)],E[v(0x189)])){if(!X[v(0x179)](G))throw new Y(v(0x168)+g);}else{if(!M[v(0x18f)](r[v(0x19c)])){if(E[v(0x198)](E[v(0x162)],E[v(0x162)]))t[v(0x1bd)](r);else throw new a(E[v(0x1b3)]);}}}return t;}E[x(0x17a)](Y,dictionaries);const H={};return H[x(0x1b6)]=Y,H[x(0x175)]=g,H[x(0x1a0)]=e,H[x(0x1b1)]=h,H[x(0x192)]=Z,H;}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implements the S3-compatible file storage adapter and its contracts.
|
|
3
|
+
*/
|
|
4
|
+
export interface FileAdapter {
|
|
5
|
+
put(path: string, buffer: Buffer): Promise<void>;
|
|
6
|
+
get(path: string): Promise<Buffer>;
|
|
7
|
+
exists(path: string): Promise<boolean>;
|
|
8
|
+
delete(path: string): Promise<void>;
|
|
9
|
+
create(path: string, ttl?: number): string;
|
|
10
|
+
verify(token: string): FileTokenPayload;
|
|
11
|
+
}
|
|
12
|
+
export interface FileTokenPayload {
|
|
13
|
+
p: string;
|
|
14
|
+
exp: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FileS3Config {
|
|
17
|
+
endpoint?: string;
|
|
18
|
+
region?: string;
|
|
19
|
+
bucket: string;
|
|
20
|
+
accessKeyId?: string;
|
|
21
|
+
secretAccessKey?: string;
|
|
22
|
+
accessKey?: string;
|
|
23
|
+
secretKey?: string;
|
|
24
|
+
folder?: string;
|
|
25
|
+
forcePathStyle?: boolean;
|
|
26
|
+
tokenSecret?: string;
|
|
27
|
+
tokenTtl?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function createFileS3(config: FileS3Config): FileAdapter | null;
|
|
30
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/plugins/file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC3C;AACD,MAAM,WAAW,gBAAgB;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAgCD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,IAAI,CA6FrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,a){const l=b,E=n();while(!![]){try{const M=-parseInt(l(0xe8))/0x1+-parseInt(l(0xe7))/0x2*(-parseInt(l(0xe5))/0x3)+-parseInt(l(0x102))/0x4*(-parseInt(l(0xd3))/0x5)+parseInt(l(0xf3))/0x6*(-parseInt(l(0xdf))/0x7)+parseInt(l(0x120))/0x8+parseInt(l(0xc8))/0x9*(parseInt(l(0x10a))/0xa)+-parseInt(l(0xeb))/0xb;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x53632));import{DeleteObjectCommand,GetObjectCommand,HeadObjectCommand,PutObjectCommand,S3Client}from'@aws-sdk/client-s3';function b(n,a){n=n-0xb7;const E=I();let M=E[n];return M;}import p from'node:crypto';import{ValidationError}from'../errors.js';import{UnauthorizedError}from'../errors.js';function keyFor(a,E){const P=b,M={};M[P(0xe1)]=P(0x103),M[P(0x10c)]=function(u,Y){return u??Y;};const X=M;if(!E||E[P(0xc5)]('/')||E[P(0x116)]('..'))throw new ValidationError(X[P(0xe1)]);const G=E[P(0xe9)](/\\/g,'/')[P(0xe9)](/^\/+/,''),j=X[P(0x10c)](a,'')[P(0xe9)](/^\/+|\/+$/g,'');return j?j+'/'+G:G;}async function bodyToBuffer(a){const J=b,E={};E[J(0xda)]=function(j,u){return j===u;},E[J(0xd4)]=J(0x110),E[J(0x108)]=function(j,u){return j!==u;},E[J(0xc0)]=J(0x10e);const M=E;if(!a)return Buffer[J(0xd6)](0x0);const X=a;if(M[J(0xda)](typeof X[J(0xc4)],M[J(0xd4)]))return Buffer[J(0xcb)](await X[J(0xc4)]());const G=[];for await(const j of a){if(M[J(0x108)](M[J(0xc0)],M[J(0xc0)]))return![];else G[J(0xbe)](Buffer[J(0xcb)](j));}return Buffer[J(0x104)](G);}function I(){const R=['10YCvVrg','ReJmy','UHZzs','NPInp','uLQvW','NfuJT','function','stringify','Invalid\x20file\x20token','GDNWh','digest','createHmac','includes','pcgoY','httpStatusCode','LLIGa','region','toString','Body','name','QqPKG','qyfmc','4859696FWzKur','folder','FIuUq','us-east-1','send','KSNKB','luPFZ','qgqYA','push','split','OYNEd','timingSafeEqual','base64url','update','transformToByteArray','startsWith','isInteger','bucket','5597487dmCXyx','GiOFH','exp','from','NotFound','owkWx','tokenTtl','length','AMdNG','randomBytes','secretAccessKey','2785JxjHLl','PcqBv','oCvKa','alloc','forcePathStyle','FuUIg','$metadata','rDxzd','jInLL','nOfft','oRVXQ','sha256','41692aHiPVH','mvvnF','YBSnA','OYfoG','now','fFKYc','951NhODtQ','uIDvG','3296iNqyyN','352939ptEfEm','replace','endpoint','14450854IpsIWJ','hex','parse','bdXOF','UfnAd','yFjOb','scYji','credentials','84QHbsVh','wLGzu','accessKey','tokenSecret','utf8','nwvTx','rILqU','xYXOQ','floor','qHTWG','NEgpC','AEiNR','ouPki','gVtop','DidST','2440nhssAL','Invalid\x20file\x20path','concat','secretKey','accessKeyId','gSAQD','xjQJv','File\x20token\x20expired'];I=function(){return R;};return I();}export function createFileS3(a){const m=b,E={'NfuJT':function(u,Y){return u(Y);},'luPFZ':function(u,Y){return u+Y;},'OYfoG':function(u,Y){return u/Y;},'FuUIg':m(0xde),'qgqYA':m(0xc2),'FIuUq':m(0x112),'owkWx':function(u,Y){return u!==Y;},'oCvKa':m(0x117),'gVtop':function(u,Y){return u!==Y;},'KSNKB':function(u,Y){return u!==Y;},'UfnAd':m(0xfd),'rILqU':function(u,Y){return u===Y;},'AMdNG':function(u,Y){return u===Y;},'qHTWG':m(0xcc),'nwvTx':function(u,Y){return u+Y;},'LLIGa':m(0x103),'ouPki':m(0x107),'yFjOb':function(u,Y){return u||Y;},'fFKYc':function(u,Y){return u!==Y;},'mvvnF':m(0xdb),'xYXOQ':m(0xf1),'ReJmy':function(u,Y){return u<Y;},'QqPKG':function(u,Y){return u===Y;},'uIDvG':m(0x11f),'wLGzu':m(0x113),'GiOFH':m(0x109),'oRVXQ':m(0xec),'NPInp':m(0xb9)};if(!a[m(0xea)])return null;const M=a[m(0xf6)]??process.env.FILE_TOKEN_SECRET??p[m(0xd1)](0x20)[m(0x11b)](E[m(0xdd)]),X={};X[m(0xea)]=a[m(0xea)],X[m(0x11a)]=a[m(0x11a)]??E[m(0x10d)],X[m(0xd7)]=a[m(0xd7)]??!![],X[m(0xf2)]=a[m(0x106)]||a[m(0xf5)]?{'accessKeyId':a[m(0x106)]??a[m(0xf5)],'secretAccessKey':a[m(0xd2)]??a[m(0x105)]}:undefined;const G=new S3Client(X),j=u=>keyFor(a[m(0xb7)],u);return{async 'put'(u,Y){const T=m;await G[T(0xba)](new PutObjectCommand({'Bucket':a[T(0xc7)],'Key':j(u),'Body':Y}));},async 'get'(u){const y=m,Y=await G[y(0xba)](new GetObjectCommand({'Bucket':a[y(0xc7)],'Key':E[y(0x10f)](j,u)}));return E[y(0x10f)](bodyToBuffer,Y[y(0x11c)]);},async 'exists'(u){const s=m;if(E[s(0xcd)](s(0x101),E[s(0xd5)]))try{if(E[s(0x100)](s(0xfe),s(0xfe))){const g={'p':Y,'exp':E[s(0xbc)](g[s(0xfb)](E[s(0xe2)](e[s(0xe3)](),0x3e8)),h)},e=Z[s(0xcb)](H[s(0x111)](g))[s(0x11b)](s(0xc2)),h=t[s(0x115)](E[s(0xd8)],B)[s(0xc3)](e)[s(0x114)](E[s(0xbd)]);return e+'.'+h;}else return await G[s(0xba)](new HeadObjectCommand({'Bucket':a[s(0xc7)],'Key':E[s(0x10f)](j,u)})),!![];}catch(g){if(E[s(0xbb)](E[s(0xef)],s(0xee))){const e=g;if(E[s(0xf9)](e[s(0xd9)]?.[s(0x118)],0x194)||E[s(0xd0)](e[s(0x11d)],E[s(0xfc)]))return![];throw g;}else M[s(0xbe)](X[s(0xcb)](G));}else throw new a(E[s(0xb8)]);},async 'delete'(u){const N=m;await G[N(0xba)](new DeleteObjectCommand({'Bucket':a[N(0xc7)],'Key':E[N(0x10f)](j,u)}));},'create'(u,Y=a[m(0xce)]??0xe10){const z=m,g={'p':u,'exp':E[z(0xf8)](Math[z(0xfb)](Date[z(0xe3)]()/0x3e8),Y)},e=Buffer[z(0xcb)](JSON[z(0x111)](g))[z(0x11b)](E[z(0xbd)]),h=p[z(0x115)](E[z(0xd8)],M)[z(0xc3)](e)[z(0x114)](z(0xc2));return e+'.'+h;},'verify'(u){const w=m,Y={};Y[w(0xdc)]=E[w(0xb8)];const g=Y;if(E[w(0xd0)](E[w(0xff)],E[w(0xff)])){const [e,h]=u[w(0xbf)]('.');if(E[w(0xf0)](!e,!h))throw new UnauthorizedError(E[w(0xb8)]);const Z=p[w(0x115)](E[w(0xd8)],M)[w(0xc3)](e)[w(0x114)](),H=Buffer[w(0xcb)](h,E[w(0xbd)]);if(E[w(0xe4)](Z[w(0xcf)],H[w(0xcf)])||!p[w(0xc1)](Z,H))throw new UnauthorizedError(E[w(0xb8)]);let t;try{t=JSON[w(0xed)](Buffer[w(0xcb)](e,E[w(0xbd)])[w(0x11b)](w(0xf7)));}catch{if(E[w(0xe0)]!==E[w(0xfa)])throw new UnauthorizedError(E[w(0xb8)]);else{if(!j||u[w(0xc5)]('/')||Y[w(0x116)]('..'))throw new Z(FXXfIA[w(0x119)]);const A=e[w(0xe9)](/\\/g,'/')[w(0xe9)](/^\/+/,''),r=(h??'')[w(0xe9)](/^\/+|\/+$/g,'');return r?r+'/'+A:A;}}if(!t['p']||!Number[w(0xc6)](t[w(0xca)]))throw new UnauthorizedError(w(0x112));if(E[w(0x10b)](t[w(0xca)],Math[w(0xfb)](Date[w(0xe3)]()/0x3e8))){if(E[w(0x11e)](E[w(0xe6)],E[w(0xf4)])){const r=E;if(E[w(0xf9)](r[w(0xd9)]?.[w(0x118)],0x194)||r[w(0x11d)]===E[w(0xfc)])return![];throw M;}else throw new UnauthorizedError(E[w(0xc9)]);}return t;}else throw new Y(g[w(0xdc)]);}};}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exposes reusable FCore infrastructure plugins.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./logger/index.js";
|
|
5
|
+
export * from "./redis.js";
|
|
6
|
+
export * from "./pg.js";
|
|
7
|
+
export * from "./file.js";
|
|
8
|
+
export * from "./dictionary.js";
|
|
9
|
+
export * from "./audit/index.js";
|
|
10
|
+
export * from "./resource/index.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|