@scpxl/nodejs-framework 1.0.22 → 1.0.25
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/README.md +264 -26
- package/dist/api-requester/api-requester.d.ts +32 -0
- package/dist/api-requester/api-requester.d.ts.map +1 -0
- package/dist/api-requester/api-requester.js +2 -1
- package/dist/api-requester/api-requester.js.map +2 -2
- package/dist/api-requester/index.d.ts +3 -0
- package/dist/api-requester/index.d.ts.map +1 -0
- package/dist/application/base-application.d.ts +106 -0
- package/dist/application/base-application.d.ts.map +1 -0
- package/dist/application/base-application.interface.d.ts +162 -0
- package/dist/application/base-application.interface.d.ts.map +1 -0
- package/dist/application/base-application.js +7 -3
- package/dist/application/base-application.js.map +2 -2
- package/dist/application/command-application.d.ts +18 -0
- package/dist/application/command-application.d.ts.map +1 -0
- package/dist/application/command-application.interface.d.ts +26 -0
- package/dist/application/command-application.interface.d.ts.map +1 -0
- package/dist/application/index.d.ts +5 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/web-application.d.ts +43 -0
- package/dist/application/web-application.d.ts.map +1 -0
- package/dist/application/web-application.interface.d.ts +21 -0
- package/dist/application/web-application.interface.d.ts.map +1 -0
- package/dist/application/web-application.js +1 -0
- package/dist/application/web-application.js.map +2 -2
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/jwt.d.ts +25 -0
- package/dist/auth/jwt.d.ts.map +1 -0
- package/dist/cache/index.d.ts +2 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/manager.d.ts +107 -0
- package/dist/cache/manager.d.ts.map +1 -0
- package/dist/cache/manager.js +2 -1
- package/dist/cache/manager.js.map +2 -2
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +12591 -0
- package/dist/cli/index.js.map +7 -0
- package/dist/cluster/cluster-manager.d.ts +18 -0
- package/dist/cluster/cluster-manager.d.ts.map +1 -0
- package/dist/cluster/cluster-manager.interface.d.ts +23 -0
- package/dist/cluster/cluster-manager.interface.d.ts.map +1 -0
- package/dist/cluster/cluster-manager.js +45 -8
- package/dist/cluster/cluster-manager.js.map +2 -2
- package/dist/cluster/index.d.ts +2 -0
- package/dist/cluster/index.d.ts.map +1 -0
- package/dist/command/command-manager.d.ts +19 -0
- package/dist/command/command-manager.d.ts.map +1 -0
- package/dist/command/command.d.ts +27 -0
- package/dist/command/command.d.ts.map +1 -0
- package/dist/command/command.interface.d.ts +11 -0
- package/dist/command/command.interface.d.ts.map +1 -0
- package/dist/command/index.d.ts +3 -0
- package/dist/command/index.d.ts.map +1 -0
- package/dist/config/env.d.ts +11 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/schema.d.ts +432 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/database/dynamic-entity-form-decorators.d.ts +31 -0
- package/dist/database/dynamic-entity-form-decorators.d.ts.map +1 -0
- package/dist/database/dynamic-entity-form-decorators.js.map +1 -1
- package/dist/database/dynamic-entity.d.ts +18 -0
- package/dist/database/dynamic-entity.d.ts.map +1 -0
- package/dist/database/dynamic-entity.js +11 -1
- package/dist/database/dynamic-entity.js.map +2 -2
- package/dist/database/index.d.ts +5 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/instance.d.ts +36 -0
- package/dist/database/instance.d.ts.map +1 -0
- package/dist/database/instance.interface.d.ts +5 -0
- package/dist/database/instance.interface.d.ts.map +1 -0
- package/dist/database/manager.d.ts +27 -0
- package/dist/database/manager.d.ts.map +1 -0
- package/dist/database/manager.interface.d.ts +18 -0
- package/dist/database/manager.interface.d.ts.map +1 -0
- package/dist/database/manager.js +3 -2
- package/dist/database/manager.js.map +2 -2
- package/dist/error/error-reporter.d.ts +109 -0
- package/dist/error/error-reporter.d.ts.map +1 -0
- package/dist/error/error-reporter.js +32 -29
- package/dist/error/error-reporter.js.map +2 -2
- package/dist/error/error.interface.d.ts +126 -0
- package/dist/error/error.interface.d.ts.map +1 -0
- package/dist/error/framework-errors.d.ts +113 -0
- package/dist/error/framework-errors.d.ts.map +1 -0
- package/dist/error/index.d.ts +6 -0
- package/dist/error/index.d.ts.map +1 -0
- package/dist/error/index.js +3 -2
- package/dist/error/index.js.map +2 -2
- package/dist/event/controller/base.d.ts +23 -0
- package/dist/event/controller/base.d.ts.map +1 -0
- package/dist/event/controller/base.interface.d.ts +11 -0
- package/dist/event/controller/base.interface.d.ts.map +1 -0
- package/dist/event/controller/base.js +2 -1
- package/dist/event/controller/base.js.map +2 -2
- package/dist/event/index.d.ts +5 -0
- package/dist/event/index.d.ts.map +1 -0
- package/dist/event/manager.d.ts +21 -0
- package/dist/event/manager.d.ts.map +1 -0
- package/dist/event/manager.interface.d.ts +137 -0
- package/dist/event/manager.interface.d.ts.map +1 -0
- package/dist/event/manager.js +5 -4
- package/dist/event/manager.js.map +2 -2
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lifecycle/exit.d.ts +11 -0
- package/dist/lifecycle/exit.d.ts.map +1 -0
- package/dist/lifecycle/exit.js.map +2 -2
- package/dist/lifecycle/index.d.ts +7 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/lifecycle-manager.d.ts +66 -0
- package/dist/lifecycle/lifecycle-manager.d.ts.map +1 -0
- package/dist/lifecycle/lifecycle-manager.js +6 -11
- package/dist/lifecycle/lifecycle-manager.js.map +2 -2
- package/dist/lifecycle/shutdown-controller.d.ts +15 -0
- package/dist/lifecycle/shutdown-controller.d.ts.map +1 -0
- package/dist/lifecycle/types.d.ts +28 -0
- package/dist/lifecycle/types.d.ts.map +1 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/logger.d.ts +59 -0
- package/dist/logger/logger.d.ts.map +1 -0
- package/dist/logger/logger.interface.d.ts +2 -0
- package/dist/logger/logger.interface.d.ts.map +1 -0
- package/dist/logger/logger.js +11 -3
- package/dist/logger/logger.js.map +2 -2
- package/dist/performance/cache-performance.d.ts +64 -0
- package/dist/performance/cache-performance.d.ts.map +1 -0
- package/dist/performance/database-performance.d.ts +40 -0
- package/dist/performance/database-performance.d.ts.map +1 -0
- package/dist/performance/index.d.ts +8 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/performance-monitor.d.ts +68 -0
- package/dist/performance/performance-monitor.d.ts.map +1 -0
- package/dist/performance/performance-monitor.js +10 -3
- package/dist/performance/performance-monitor.js.map +2 -2
- package/dist/performance/performance-monitor.plugin.d.ts +24 -0
- package/dist/performance/performance-monitor.plugin.d.ts.map +1 -0
- package/dist/performance/queue-performance.d.ts +46 -0
- package/dist/performance/queue-performance.d.ts.map +1 -0
- package/dist/performance/webserver-performance.d.ts +69 -0
- package/dist/performance/webserver-performance.d.ts.map +1 -0
- package/dist/performance/websocket-performance.d.ts +44 -0
- package/dist/performance/websocket-performance.d.ts.map +1 -0
- package/dist/queue/index.d.ts +6 -0
- package/dist/queue/index.d.ts.map +1 -0
- package/dist/queue/index.interface.d.ts +10 -0
- package/dist/queue/index.interface.d.ts.map +1 -0
- package/dist/queue/job.interface.d.ts +43 -0
- package/dist/queue/job.interface.d.ts.map +1 -0
- package/dist/queue/manager.d.ts +44 -0
- package/dist/queue/manager.d.ts.map +1 -0
- package/dist/queue/manager.interface.d.ts +18 -0
- package/dist/queue/manager.interface.d.ts.map +1 -0
- package/dist/queue/processor/base.d.ts +29 -0
- package/dist/queue/processor/base.d.ts.map +1 -0
- package/dist/queue/processor/base.js +2 -1
- package/dist/queue/processor/base.js.map +2 -2
- package/dist/queue/processor/processor.interface.d.ts +16 -0
- package/dist/queue/processor/processor.interface.d.ts.map +1 -0
- package/dist/queue/worker.d.ts +14 -0
- package/dist/queue/worker.d.ts.map +1 -0
- package/dist/queue/worker.interface.d.ts +13 -0
- package/dist/queue/worker.interface.d.ts.map +1 -0
- package/dist/redis/index.d.ts +3 -0
- package/dist/redis/index.d.ts.map +1 -0
- package/dist/redis/instance.d.ts +32 -0
- package/dist/redis/instance.d.ts.map +1 -0
- package/dist/redis/instance.interface.d.ts +9 -0
- package/dist/redis/instance.interface.d.ts.map +1 -0
- package/dist/redis/manager.d.ts +15 -0
- package/dist/redis/manager.d.ts.map +1 -0
- package/dist/redis/manager.interface.d.ts +8 -0
- package/dist/redis/manager.interface.d.ts.map +1 -0
- package/dist/redis/manager.js +16 -16
- package/dist/redis/manager.js.map +2 -2
- package/dist/request-context/index.d.ts +3 -0
- package/dist/request-context/index.d.ts.map +1 -0
- package/dist/request-context/request-context.d.ts +108 -0
- package/dist/request-context/request-context.d.ts.map +1 -0
- package/dist/request-context/request-context.interface.d.ts +46 -0
- package/dist/request-context/request-context.interface.d.ts.map +1 -0
- package/dist/schemas/common.d.ts +197 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +108 -0
- package/dist/schemas/common.js.map +7 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +7 -0
- package/dist/services/aws/index.d.ts +2 -0
- package/dist/services/aws/index.d.ts.map +1 -0
- package/dist/services/aws/s3.d.ts +54 -0
- package/dist/services/aws/s3.d.ts.map +1 -0
- package/dist/services/aws/s3.interface.d.ts +14 -0
- package/dist/services/aws/s3.interface.d.ts.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/util/file.d.ts +58 -0
- package/dist/util/file.d.ts.map +1 -0
- package/dist/util/helper.d.ts +51 -0
- package/dist/util/helper.d.ts.map +1 -0
- package/dist/util/helper.js +72 -10
- package/dist/util/helper.js.map +2 -2
- package/dist/util/image.d.ts +12 -0
- package/dist/util/image.d.ts.map +1 -0
- package/dist/util/index.d.ts +11 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/loader.d.ts +21 -0
- package/dist/util/loader.d.ts.map +1 -0
- package/dist/util/loader.js +5 -2
- package/dist/util/loader.js.map +2 -2
- package/dist/util/num.d.ts +13 -0
- package/dist/util/num.d.ts.map +1 -0
- package/dist/util/os.d.ts +6 -0
- package/dist/util/os.d.ts.map +1 -0
- package/dist/util/str.d.ts +39 -0
- package/dist/util/str.d.ts.map +1 -0
- package/dist/util/time.d.ts +19 -0
- package/dist/util/time.d.ts.map +1 -0
- package/dist/util/time.interface.d.ts +12 -0
- package/dist/util/time.interface.d.ts.map +1 -0
- package/dist/util/timing.d.ts +36 -0
- package/dist/util/timing.d.ts.map +1 -0
- package/dist/util/timing.interface.d.ts +47 -0
- package/dist/util/timing.interface.d.ts.map +1 -0
- package/dist/util/url.d.ts +7 -0
- package/dist/util/url.d.ts.map +1 -0
- package/dist/webserver/controller/auth-middleware.d.ts +21 -0
- package/dist/webserver/controller/auth-middleware.d.ts.map +1 -0
- package/dist/webserver/controller/base.d.ts +41 -0
- package/dist/webserver/controller/base.d.ts.map +1 -0
- package/dist/webserver/controller/base.interface.d.ts +50 -0
- package/dist/webserver/controller/base.interface.d.ts.map +1 -0
- package/dist/webserver/controller/base.js +4 -4
- package/dist/webserver/controller/base.js.map +2 -2
- package/dist/webserver/controller/entity.d.ts +94 -0
- package/dist/webserver/controller/entity.d.ts.map +1 -0
- package/dist/webserver/controller/entity.js.map +2 -2
- package/dist/webserver/controller/example-auth.d.ts +12 -0
- package/dist/webserver/controller/example-auth.d.ts.map +1 -0
- package/dist/webserver/controller/health.d.ts +13 -0
- package/dist/webserver/controller/health.d.ts.map +1 -0
- package/dist/webserver/controller/health.js +0 -14
- package/dist/webserver/controller/health.js.map +2 -2
- package/dist/webserver/define-action.d.ts +26 -0
- package/dist/webserver/define-action.d.ts.map +1 -0
- package/dist/webserver/define-action.js +16 -0
- package/dist/webserver/define-action.js.map +7 -0
- package/dist/webserver/define-route.d.ts +53 -0
- package/dist/webserver/define-route.d.ts.map +1 -0
- package/dist/webserver/define-route.js +11 -6
- package/dist/webserver/define-route.js.map +2 -2
- package/dist/webserver/index.d.ts +14 -0
- package/dist/webserver/index.d.ts.map +1 -0
- package/dist/webserver/index.js +2 -0
- package/dist/webserver/index.js.map +2 -2
- package/dist/webserver/util.d.ts +10 -0
- package/dist/webserver/util.d.ts.map +1 -0
- package/dist/webserver/util.js +5 -2
- package/dist/webserver/util.js.map +2 -2
- package/dist/webserver/webserver.d.ts +93 -0
- package/dist/webserver/webserver.d.ts.map +1 -0
- package/dist/webserver/webserver.interface.d.ts +181 -0
- package/dist/webserver/webserver.interface.d.ts.map +1 -0
- package/dist/webserver/webserver.interface.js.map +1 -1
- package/dist/webserver/webserver.js +30 -33
- package/dist/webserver/webserver.js.map +2 -2
- package/dist/websocket/controller/client/base.d.ts +12 -0
- package/dist/websocket/controller/client/base.d.ts.map +1 -0
- package/dist/websocket/controller/client/base.interface.d.ts +12 -0
- package/dist/websocket/controller/client/base.interface.d.ts.map +1 -0
- package/dist/websocket/controller/server/base.d.ts +13 -0
- package/dist/websocket/controller/server/base.d.ts.map +1 -0
- package/dist/websocket/controller/server/base.interface.d.ts +13 -0
- package/dist/websocket/controller/server/base.interface.d.ts.map +1 -0
- package/dist/websocket/controllers/client/system.d.ts +6 -0
- package/dist/websocket/controllers/client/system.d.ts.map +1 -0
- package/dist/websocket/controllers/server/system.d.ts +7 -0
- package/dist/websocket/controllers/server/system.d.ts.map +1 -0
- package/dist/websocket/index.d.ts +9 -0
- package/dist/websocket/index.d.ts.map +1 -0
- package/dist/websocket/index.js +2 -0
- package/dist/websocket/index.js.map +2 -2
- package/dist/websocket/routes/client/system.d.ts +3 -0
- package/dist/websocket/routes/client/system.d.ts.map +1 -0
- package/dist/websocket/routes/server/system.d.ts +3 -0
- package/dist/websocket/routes/server/system.d.ts.map +1 -0
- package/dist/websocket/utils.d.ts +9 -0
- package/dist/websocket/utils.d.ts.map +1 -0
- package/dist/websocket/websocket-auth.d.ts +17 -0
- package/dist/websocket/websocket-auth.d.ts.map +1 -0
- package/dist/websocket/websocket-auth.js +46 -0
- package/dist/websocket/websocket-auth.js.map +7 -0
- package/dist/websocket/websocket-base.d.ts +19 -0
- package/dist/websocket/websocket-base.d.ts.map +1 -0
- package/dist/websocket/websocket-client-manager.d.ts +53 -0
- package/dist/websocket/websocket-client-manager.d.ts.map +1 -0
- package/dist/websocket/websocket-client-manager.interface.d.ts +8 -0
- package/dist/websocket/websocket-client-manager.interface.d.ts.map +1 -0
- package/dist/websocket/websocket-client-manager.js +6 -5
- package/dist/websocket/websocket-client-manager.js.map +2 -2
- package/dist/websocket/websocket-client.d.ts +64 -0
- package/dist/websocket/websocket-client.d.ts.map +1 -0
- package/dist/websocket/websocket-client.interface.d.ts +14 -0
- package/dist/websocket/websocket-client.interface.d.ts.map +1 -0
- package/dist/websocket/websocket-client.js +97 -3
- package/dist/websocket/websocket-client.js.map +2 -2
- package/dist/websocket/websocket-room-manager.d.ts +32 -0
- package/dist/websocket/websocket-room-manager.d.ts.map +1 -0
- package/dist/websocket/websocket-server.d.ts +102 -0
- package/dist/websocket/websocket-server.d.ts.map +1 -0
- package/dist/websocket/websocket-server.interface.d.ts +16 -0
- package/dist/websocket/websocket-server.interface.d.ts.map +1 -0
- package/dist/websocket/websocket-server.js +62 -50
- package/dist/websocket/websocket-server.js.map +2 -2
- package/dist/websocket/websocket-service.d.ts +44 -0
- package/dist/websocket/websocket-service.d.ts.map +1 -0
- package/dist/websocket/websocket.interface.d.ts +137 -0
- package/dist/websocket/websocket.interface.d.ts.map +1 -0
- package/dist/websocket/websocket.interface.js.map +2 -2
- package/package.json +21 -24
- package/pxl.js +0 -4
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RedisConfigSchema: z.ZodObject<{
|
|
3
|
+
host: z.ZodString;
|
|
4
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
password: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const DatabaseConfigSchema: z.ZodObject<{
|
|
8
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
host: z.ZodString;
|
|
10
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
username: z.ZodString;
|
|
12
|
+
password: z.ZodString;
|
|
13
|
+
databaseName: z.ZodString;
|
|
14
|
+
entitiesDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const QueueLogConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
jobRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
jobAdded: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
jobCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
queueRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
queuesRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
queueWaiting: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
export declare const QueueJobSchema: z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const QueueItemSchema: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
isExternal: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
jobs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export declare const QueueConfigSchema: z.ZodObject<{
|
|
37
|
+
queues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
isExternal: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
jobs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
}, z.core.$strip>>>;
|
|
44
|
+
}, z.core.$strip>>>;
|
|
45
|
+
processorsDirectory: z.ZodString;
|
|
46
|
+
log: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
jobRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
jobAdded: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
jobCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
queueRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
queuesRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
queueWaiting: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export declare const EventDefinitionSchema: z.ZodObject<{
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export declare const EventConfigSchema: z.ZodObject<{
|
|
59
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
60
|
+
controllersDirectory: z.ZodString;
|
|
61
|
+
events: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export declare const LogConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
startUp: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
shutdown: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
export declare const PerformanceThresholdsSchema: z.ZodObject<{
|
|
70
|
+
httpMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
71
|
+
dbMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
72
|
+
queueMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
73
|
+
cacheMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
74
|
+
wsMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const PerformanceMonitoringSchema: z.ZodObject<{
|
|
77
|
+
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
78
|
+
thresholds: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
79
|
+
httpMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
80
|
+
dbMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
81
|
+
queueMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
82
|
+
cacheMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
83
|
+
wsMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
84
|
+
}, z.core.$strip>>>;
|
|
85
|
+
maxMetricsHistory: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
86
|
+
logSlowOperations: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
87
|
+
logAllOperations: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
88
|
+
monitorHttpRequests: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
89
|
+
monitorDatabaseOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
90
|
+
monitorWebSocketOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
91
|
+
monitorQueueOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
92
|
+
monitorCacheOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
93
|
+
reportInterval: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
|
|
94
|
+
reportFormat: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
95
|
+
simple: "simple";
|
|
96
|
+
detailed: "detailed";
|
|
97
|
+
}>>>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export declare const AuthConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
jwtSecretKey: z.ZodString;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
export declare const SecurityConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
helmet: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
crossOriginEmbedderPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
crossOriginOpenerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
crossOriginResourcePolicy: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
dnsPrefetchControl: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
frameguard: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
hidePoweredBy: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
hsts: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
ieNoOpen: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
noSniff: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
originAgentCluster: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
permittedCrossDomainPolicies: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
referrerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
xssFilter: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
rateLimit: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
timeWindow: z.ZodOptional<z.ZodString>;
|
|
124
|
+
ban: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
cache: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
export declare const WebServerRouteSchema: z.ZodObject<{
|
|
129
|
+
type: z.ZodOptional<z.ZodString>;
|
|
130
|
+
method: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
131
|
+
path: z.ZodString;
|
|
132
|
+
url: z.ZodOptional<z.ZodString>;
|
|
133
|
+
controller: z.ZodOptional<z.ZodUnknown>;
|
|
134
|
+
controllerName: z.ZodOptional<z.ZodString>;
|
|
135
|
+
action: z.ZodOptional<z.ZodString>;
|
|
136
|
+
entityName: z.ZodOptional<z.ZodString>;
|
|
137
|
+
validation: z.ZodOptional<z.ZodUnknown>;
|
|
138
|
+
handler: z.ZodOptional<z.ZodUnknown>;
|
|
139
|
+
schema: z.ZodOptional<z.ZodUnknown>;
|
|
140
|
+
}, z.core.$loose>;
|
|
141
|
+
export declare const WebServerConfigSchema: z.ZodObject<{
|
|
142
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
143
|
+
host: z.ZodDefault<z.ZodString>;
|
|
144
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
145
|
+
bodyLimit: z.ZodDefault<z.ZodNumber>;
|
|
146
|
+
connectionTimeout: z.ZodDefault<z.ZodNumber>;
|
|
147
|
+
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
148
|
+
type: z.ZodOptional<z.ZodString>;
|
|
149
|
+
method: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
150
|
+
path: z.ZodString;
|
|
151
|
+
url: z.ZodOptional<z.ZodString>;
|
|
152
|
+
controller: z.ZodOptional<z.ZodUnknown>;
|
|
153
|
+
controllerName: z.ZodOptional<z.ZodString>;
|
|
154
|
+
action: z.ZodOptional<z.ZodString>;
|
|
155
|
+
entityName: z.ZodOptional<z.ZodString>;
|
|
156
|
+
validation: z.ZodOptional<z.ZodUnknown>;
|
|
157
|
+
handler: z.ZodOptional<z.ZodUnknown>;
|
|
158
|
+
schema: z.ZodOptional<z.ZodUnknown>;
|
|
159
|
+
}, z.core.$loose>>>;
|
|
160
|
+
controllersDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
161
|
+
routesDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
162
|
+
cors: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
163
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
164
|
+
urls: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
165
|
+
}, z.core.$strip>>>;
|
|
166
|
+
security: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
167
|
+
helmet: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
crossOriginEmbedderPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
crossOriginOpenerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
crossOriginResourcePolicy: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
dnsPrefetchControl: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
+
frameguard: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
hidePoweredBy: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
hsts: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
ieNoOpen: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
noSniff: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
originAgentCluster: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
permittedCrossDomainPolicies: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
+
referrerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
xssFilter: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
rateLimit: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
timeWindow: z.ZodOptional<z.ZodString>;
|
|
188
|
+
ban: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
cache: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
}, z.core.$strip>>;
|
|
191
|
+
}, z.core.$strip>>>>;
|
|
192
|
+
debug: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
193
|
+
logAllRegisteredRoutes: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
}, z.core.$strip>>>>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
export declare const WebSocketRouteSchema: z.ZodObject<{
|
|
197
|
+
type: z.ZodString;
|
|
198
|
+
controllerName: z.ZodString;
|
|
199
|
+
action: z.ZodString;
|
|
200
|
+
controller: z.ZodOptional<z.ZodUnknown>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
export declare const WebSocketConfigSchema: z.ZodObject<{
|
|
203
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
204
|
+
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
205
|
+
routes: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
206
|
+
type: z.ZodString;
|
|
207
|
+
controllerName: z.ZodString;
|
|
208
|
+
action: z.ZodString;
|
|
209
|
+
controller: z.ZodOptional<z.ZodUnknown>;
|
|
210
|
+
}, z.core.$strip>>>>;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
export declare const ClusterConfigSchema: z.ZodObject<{
|
|
213
|
+
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
214
|
+
workers: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
export declare const FrameworkConfigSchema: z.ZodObject<{
|
|
217
|
+
name: z.ZodString;
|
|
218
|
+
instanceId: z.ZodDefault<z.ZodString>;
|
|
219
|
+
rootDirectory: z.ZodString;
|
|
220
|
+
cluster: z.ZodOptional<z.ZodObject<{
|
|
221
|
+
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
222
|
+
workers: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
223
|
+
}, z.core.$strip>>;
|
|
224
|
+
redis: z.ZodObject<{
|
|
225
|
+
host: z.ZodString;
|
|
226
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
227
|
+
password: z.ZodOptional<z.ZodString>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
cache: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
230
|
+
database: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
232
|
+
host: z.ZodString;
|
|
233
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
234
|
+
username: z.ZodString;
|
|
235
|
+
password: z.ZodString;
|
|
236
|
+
databaseName: z.ZodString;
|
|
237
|
+
entitiesDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
queue: z.ZodObject<{
|
|
240
|
+
queues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
isExternal: z.ZodOptional<z.ZodBoolean>;
|
|
243
|
+
jobs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
246
|
+
}, z.core.$strip>>>;
|
|
247
|
+
}, z.core.$strip>>>;
|
|
248
|
+
processorsDirectory: z.ZodString;
|
|
249
|
+
log: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
jobRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
jobAdded: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
jobCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
+
queueRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
queuesRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
255
|
+
queueWaiting: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
}, z.core.$strip>>;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
event: z.ZodOptional<z.ZodObject<{
|
|
259
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
260
|
+
controllersDirectory: z.ZodString;
|
|
261
|
+
events: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
262
|
+
name: z.ZodString;
|
|
263
|
+
}, z.core.$strip>>>;
|
|
264
|
+
}, z.core.$strip>>;
|
|
265
|
+
log: z.ZodOptional<z.ZodObject<{
|
|
266
|
+
startUp: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
+
shutdown: z.ZodOptional<z.ZodBoolean>;
|
|
268
|
+
}, z.core.$strip>>;
|
|
269
|
+
performanceMonitoring: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
271
|
+
thresholds: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
272
|
+
httpMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
273
|
+
dbMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
274
|
+
queueMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
275
|
+
cacheMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
276
|
+
wsMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
277
|
+
}, z.core.$strip>>>;
|
|
278
|
+
maxMetricsHistory: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
279
|
+
logSlowOperations: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
280
|
+
logAllOperations: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
281
|
+
monitorHttpRequests: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
282
|
+
monitorDatabaseOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
283
|
+
monitorWebSocketOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
284
|
+
monitorQueueOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
285
|
+
monitorCacheOperations: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
286
|
+
reportInterval: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
|
|
287
|
+
reportFormat: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
288
|
+
simple: "simple";
|
|
289
|
+
detailed: "detailed";
|
|
290
|
+
}>>>>;
|
|
291
|
+
}, z.core.$strip>>;
|
|
292
|
+
email: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
293
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
294
|
+
jwtSecretKey: z.ZodString;
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
web: z.ZodOptional<z.ZodObject<{
|
|
297
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
298
|
+
host: z.ZodDefault<z.ZodString>;
|
|
299
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
300
|
+
bodyLimit: z.ZodDefault<z.ZodNumber>;
|
|
301
|
+
connectionTimeout: z.ZodDefault<z.ZodNumber>;
|
|
302
|
+
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
303
|
+
type: z.ZodOptional<z.ZodString>;
|
|
304
|
+
method: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
305
|
+
path: z.ZodString;
|
|
306
|
+
url: z.ZodOptional<z.ZodString>;
|
|
307
|
+
controller: z.ZodOptional<z.ZodUnknown>;
|
|
308
|
+
controllerName: z.ZodOptional<z.ZodString>;
|
|
309
|
+
action: z.ZodOptional<z.ZodString>;
|
|
310
|
+
entityName: z.ZodOptional<z.ZodString>;
|
|
311
|
+
validation: z.ZodOptional<z.ZodUnknown>;
|
|
312
|
+
handler: z.ZodOptional<z.ZodUnknown>;
|
|
313
|
+
schema: z.ZodOptional<z.ZodUnknown>;
|
|
314
|
+
}, z.core.$loose>>>;
|
|
315
|
+
controllersDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
316
|
+
routesDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
317
|
+
cors: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
318
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
319
|
+
urls: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
320
|
+
}, z.core.$strip>>>;
|
|
321
|
+
security: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
322
|
+
helmet: z.ZodOptional<z.ZodObject<{
|
|
323
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
324
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
325
|
+
crossOriginEmbedderPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
crossOriginOpenerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
+
crossOriginResourcePolicy: z.ZodOptional<z.ZodBoolean>;
|
|
328
|
+
dnsPrefetchControl: z.ZodOptional<z.ZodBoolean>;
|
|
329
|
+
frameguard: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
+
hidePoweredBy: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
+
hsts: z.ZodOptional<z.ZodBoolean>;
|
|
332
|
+
ieNoOpen: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
noSniff: z.ZodOptional<z.ZodBoolean>;
|
|
334
|
+
originAgentCluster: z.ZodOptional<z.ZodBoolean>;
|
|
335
|
+
permittedCrossDomainPolicies: z.ZodOptional<z.ZodBoolean>;
|
|
336
|
+
referrerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
+
xssFilter: z.ZodOptional<z.ZodBoolean>;
|
|
338
|
+
}, z.core.$strip>>;
|
|
339
|
+
rateLimit: z.ZodOptional<z.ZodObject<{
|
|
340
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
342
|
+
timeWindow: z.ZodOptional<z.ZodString>;
|
|
343
|
+
ban: z.ZodOptional<z.ZodNumber>;
|
|
344
|
+
cache: z.ZodOptional<z.ZodNumber>;
|
|
345
|
+
}, z.core.$strip>>;
|
|
346
|
+
}, z.core.$strip>>>>;
|
|
347
|
+
debug: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
348
|
+
logAllRegisteredRoutes: z.ZodOptional<z.ZodBoolean>;
|
|
349
|
+
}, z.core.$strip>>>>;
|
|
350
|
+
}, z.core.$strip>>;
|
|
351
|
+
webServer: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
353
|
+
host: z.ZodDefault<z.ZodString>;
|
|
354
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
355
|
+
bodyLimit: z.ZodDefault<z.ZodNumber>;
|
|
356
|
+
connectionTimeout: z.ZodDefault<z.ZodNumber>;
|
|
357
|
+
routes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
358
|
+
type: z.ZodOptional<z.ZodString>;
|
|
359
|
+
method: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
360
|
+
path: z.ZodString;
|
|
361
|
+
url: z.ZodOptional<z.ZodString>;
|
|
362
|
+
controller: z.ZodOptional<z.ZodUnknown>;
|
|
363
|
+
controllerName: z.ZodOptional<z.ZodString>;
|
|
364
|
+
action: z.ZodOptional<z.ZodString>;
|
|
365
|
+
entityName: z.ZodOptional<z.ZodString>;
|
|
366
|
+
validation: z.ZodOptional<z.ZodUnknown>;
|
|
367
|
+
handler: z.ZodOptional<z.ZodUnknown>;
|
|
368
|
+
schema: z.ZodOptional<z.ZodUnknown>;
|
|
369
|
+
}, z.core.$loose>>>;
|
|
370
|
+
controllersDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
371
|
+
routesDirectory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
372
|
+
cors: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
373
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
374
|
+
urls: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
375
|
+
}, z.core.$strip>>>;
|
|
376
|
+
security: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
377
|
+
helmet: z.ZodOptional<z.ZodObject<{
|
|
378
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
379
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
380
|
+
crossOriginEmbedderPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
381
|
+
crossOriginOpenerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
382
|
+
crossOriginResourcePolicy: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
+
dnsPrefetchControl: z.ZodOptional<z.ZodBoolean>;
|
|
384
|
+
frameguard: z.ZodOptional<z.ZodBoolean>;
|
|
385
|
+
hidePoweredBy: z.ZodOptional<z.ZodBoolean>;
|
|
386
|
+
hsts: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
+
ieNoOpen: z.ZodOptional<z.ZodBoolean>;
|
|
388
|
+
noSniff: z.ZodOptional<z.ZodBoolean>;
|
|
389
|
+
originAgentCluster: z.ZodOptional<z.ZodBoolean>;
|
|
390
|
+
permittedCrossDomainPolicies: z.ZodOptional<z.ZodBoolean>;
|
|
391
|
+
referrerPolicy: z.ZodOptional<z.ZodBoolean>;
|
|
392
|
+
xssFilter: z.ZodOptional<z.ZodBoolean>;
|
|
393
|
+
}, z.core.$strip>>;
|
|
394
|
+
rateLimit: z.ZodOptional<z.ZodObject<{
|
|
395
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
396
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
397
|
+
timeWindow: z.ZodOptional<z.ZodString>;
|
|
398
|
+
ban: z.ZodOptional<z.ZodNumber>;
|
|
399
|
+
cache: z.ZodOptional<z.ZodNumber>;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
}, z.core.$strip>>>>;
|
|
402
|
+
debug: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
403
|
+
logAllRegisteredRoutes: z.ZodOptional<z.ZodBoolean>;
|
|
404
|
+
}, z.core.$strip>>>>;
|
|
405
|
+
}, z.core.$strip>>;
|
|
406
|
+
webSocket: z.ZodOptional<z.ZodObject<{
|
|
407
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
408
|
+
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
409
|
+
routes: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
410
|
+
type: z.ZodString;
|
|
411
|
+
controllerName: z.ZodString;
|
|
412
|
+
action: z.ZodString;
|
|
413
|
+
controller: z.ZodOptional<z.ZodUnknown>;
|
|
414
|
+
}, z.core.$strip>>>>;
|
|
415
|
+
}, z.core.$strip>>;
|
|
416
|
+
}, z.core.$strip>;
|
|
417
|
+
export type InferFrameworkConfig = z.infer<typeof FrameworkConfigSchema>;
|
|
418
|
+
export interface ValidateConfigOptions {
|
|
419
|
+
collectAllErrors?: boolean;
|
|
420
|
+
}
|
|
421
|
+
export interface ValidationIssueDetail {
|
|
422
|
+
path: string;
|
|
423
|
+
message: string;
|
|
424
|
+
}
|
|
425
|
+
export declare class ConfigValidationError extends Error {
|
|
426
|
+
issues: ValidationIssueDetail[];
|
|
427
|
+
constructor(message: string, issues: ValidationIssueDetail[]);
|
|
428
|
+
}
|
|
429
|
+
export declare function validateFrameworkConfig(raw: unknown, _options?: ValidateConfigOptions): InferFrameworkConfig;
|
|
430
|
+
export declare function formatConfigIssues(issues: ValidationIssueDetail[]): string;
|
|
431
|
+
export default FrameworkConfigSchema;
|
|
432
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;iBAI5B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;iBAUM,CAAC;AAGxC,eAAO,MAAM,oBAAoB;;;;;;;kBASpB,CAAC;AAEd,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;iBAI1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;iBAI5B,CAAC;AAGH,eAAO,MAAM,qBAAqB;;iBAEhC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;iBAI5B,CAAC;AAGH,eAAO,MAAM,eAAe;;;kBAKf,CAAC;AAGd,eAAO,MAAM,2BAA2B;;;;;;iBAQ5B,CAAC;AAEb,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;iBAe5B,CAAC;AAGb,eAAO,MAAM,gBAAgB;;kBAIhB,CAAC;AAGd,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BpB,CAAC;AAGd,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAcjB,CAAC;AAEjB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCwE,CAAC;AAG3G,eAAO,MAAM,oBAAoB;;;;;iBAK/B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;iBAMtB,CAAC;AAGb,eAAO,MAAM,mBAAmB;;;iBAKpB,CAAC;AAGb,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBhC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEzE,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IACvC,MAAM,EAAE,qBAAqB,EAAE,CAAC;gBAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE;CAK7D;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,GAAE,qBAA0B,GAAG,oBAAoB,CAUhH;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAE1E;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
export declare enum FormFieldType {
|
|
4
|
+
Text = "text",
|
|
5
|
+
Email = "email",
|
|
6
|
+
Password = "password",
|
|
7
|
+
Number = "number",
|
|
8
|
+
Date = "date",
|
|
9
|
+
Select = "select",
|
|
10
|
+
Checkbox = "checkbox",
|
|
11
|
+
Textarea = "textarea",
|
|
12
|
+
Image = "image",
|
|
13
|
+
DynamicInput = "dynamicInput",
|
|
14
|
+
ReadOnly = "readonly"
|
|
15
|
+
}
|
|
16
|
+
export interface FormFieldOptions {
|
|
17
|
+
type: FormFieldType;
|
|
18
|
+
label: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
typeOptions?: any;
|
|
21
|
+
typeValues?: any;
|
|
22
|
+
}
|
|
23
|
+
export interface FormFieldOptionsExtended extends FormFieldOptions {
|
|
24
|
+
name: string;
|
|
25
|
+
validation: z.ZodSchema | null;
|
|
26
|
+
}
|
|
27
|
+
export declare const FormField: (options: FormFieldOptions) => (target: any, propertyKey: string) => void;
|
|
28
|
+
export declare const generateFormFields: ({ model }: {
|
|
29
|
+
model: any;
|
|
30
|
+
}) => FormFieldOptionsExtended[];
|
|
31
|
+
//# sourceMappingURL=dynamic-entity-form-decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-entity-form-decorators.d.ts","sourceRoot":"","sources":["../../src/database/dynamic-entity-form-decorators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAS1B,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,SAAS,GAAI,SAAS,gBAAgB,MACzC,QAAQ,GAAG,EAAE,aAAa,MAAM,SAgBzC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,WAAW;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,KAAG,wBAAwB,EAqCtF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/database/dynamic-entity-form-decorators.ts"],
|
|
4
|
-
"sourcesContent": ["import type
|
|
4
|
+
"sourcesContent": ["import type { z } from 'zod';\nimport 'reflect-metadata';\n\n// @FormField({\n// type: FormFieldType.DynamicInput,\n// label: 'Keywords',\n// typeOptions: { defaultMessage: 'Add Keyword' },\n// typeValues: [{ key: 'keyword', type: FormFieldType.Text, label: 'Keyword' }],\n// })\n\nexport enum FormFieldType {\n Text = 'text',\n Email = 'email',\n Password = 'password',\n Number = 'number',\n Date = 'date',\n Select = 'select',\n Checkbox = 'checkbox',\n Textarea = 'textarea',\n Image = 'image',\n DynamicInput = 'dynamicInput',\n ReadOnly = 'readonly',\n}\n\nexport interface FormFieldOptions {\n type: FormFieldType;\n label: string;\n placeholder?: string;\n typeOptions?: any;\n typeValues?: any;\n}\n\nexport interface FormFieldOptionsExtended extends FormFieldOptions {\n name: string;\n validation: z.ZodSchema | null;\n}\n\nexport const FormField = (options: FormFieldOptions) => {\n return (target: any, propertyKey: string) => {\n Reflect.defineMetadata('custom:formFieldType', options.type, target, propertyKey);\n Reflect.defineMetadata('custom:formFieldLabel', options.label, target, propertyKey);\n\n if (options.placeholder) {\n Reflect.defineMetadata('custom:formFieldPlaceholder', options.placeholder, target, propertyKey);\n }\n\n if (options.typeOptions) {\n Reflect.defineMetadata('custom:formFieldTypeOptions', options.typeOptions, target, propertyKey);\n }\n\n if (options.typeValues) {\n Reflect.defineMetadata('custom:formFieldTypeValues', options.typeValues, target, propertyKey);\n }\n };\n};\n\nexport const generateFormFields = ({ model }: { model: any }): FormFieldOptionsExtended[] => {\n const formFields: FormFieldOptionsExtended[] = [];\n\n const { prototype } = model;\n\n for (const propertyKey of Object.getOwnPropertyNames(prototype)) {\n const formFieldType = Reflect.getMetadata('custom:formFieldType', prototype, propertyKey);\n const formFieldLabel = Reflect.getMetadata('custom:formFieldLabel', prototype, propertyKey);\n const formFieldPlaceholder = Reflect.getMetadata('custom:formFieldPlaceholder', prototype, propertyKey);\n const formFieldTypeOptions = Reflect.getMetadata('custom:formFieldTypeOptions', prototype, propertyKey);\n const formFieldTypeValues = Reflect.getMetadata('custom:formFieldTypeValues', prototype, propertyKey);\n\n const validationRules = null;\n\n // if (schema && schema.describe) {\n // const schemaDescription = schema.describe();\n // const propertySchema = schemaDescription.keys?.[propertyKey];\n\n // if (propertySchema) {\n // validationRules = propertySchema;\n // }\n // }\n\n if (formFieldType && formFieldLabel) {\n formFields.push({\n name: propertyKey,\n type: formFieldType,\n label: formFieldLabel,\n placeholder: formFieldPlaceholder,\n validation: validationRules,\n typeOptions: formFieldTypeOptions,\n typeValues: formFieldTypeValues,\n });\n }\n }\n\n return formFields;\n};\n"],
|
|
5
5
|
"mappings": ";;AACA,OAAO;AASA,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,kBAAe;AACf,EAAAA,eAAA,cAAW;AAXD,SAAAA;AAAA,GAAA;AA2BL,MAAM,YAAY,wBAAC,YAA8B;AACtD,SAAO,CAAC,QAAa,gBAAwB;AAC3C,YAAQ,eAAe,wBAAwB,QAAQ,MAAM,QAAQ,WAAW;AAChF,YAAQ,eAAe,yBAAyB,QAAQ,OAAO,QAAQ,WAAW;AAElF,QAAI,QAAQ,aAAa;AACvB,cAAQ,eAAe,+BAA+B,QAAQ,aAAa,QAAQ,WAAW;AAAA,IAChG;AAEA,QAAI,QAAQ,aAAa;AACvB,cAAQ,eAAe,+BAA+B,QAAQ,aAAa,QAAQ,WAAW;AAAA,IAChG;AAEA,QAAI,QAAQ,YAAY;AACtB,cAAQ,eAAe,8BAA8B,QAAQ,YAAY,QAAQ,WAAW;AAAA,IAC9F;AAAA,EACF;AACF,GAjByB;AAmBlB,MAAM,qBAAqB,wBAAC,EAAE,MAAM,MAAkD;AAC3F,QAAM,aAAyC,CAAC;AAEhD,QAAM,EAAE,UAAU,IAAI;AAEtB,aAAW,eAAe,OAAO,oBAAoB,SAAS,GAAG;AAC/D,UAAM,gBAAgB,QAAQ,YAAY,wBAAwB,WAAW,WAAW;AACxF,UAAM,iBAAiB,QAAQ,YAAY,yBAAyB,WAAW,WAAW;AAC1F,UAAM,uBAAuB,QAAQ,YAAY,+BAA+B,WAAW,WAAW;AACtG,UAAM,uBAAuB,QAAQ,YAAY,+BAA+B,WAAW,WAAW;AACtG,UAAM,sBAAsB,QAAQ,YAAY,8BAA8B,WAAW,WAAW;AAEpG,UAAM,kBAAkB;AAWxB,QAAI,iBAAiB,gBAAgB;AACnC,iBAAW,KAAK;AAAA,QACd,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,YAAY;AAAA,MACd,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT,GArCkC;",
|
|
6
6
|
"names": ["FormFieldType"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseEntity } from '@mikro-orm/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare abstract class DynamicEntity extends BaseEntity {
|
|
4
|
+
static schema: z.ZodSchema;
|
|
5
|
+
static schemaUpdate: z.ZodSchema;
|
|
6
|
+
static get singularName(): string;
|
|
7
|
+
static get pluralName(): string;
|
|
8
|
+
static get singularNameLowerCase(): string;
|
|
9
|
+
static get pluralNameLowerCase(): string;
|
|
10
|
+
static get singularNameCapitalized(): string;
|
|
11
|
+
static get pluralNameCapitalized(): string;
|
|
12
|
+
static validate<T>(item: T, isCreating: boolean): {
|
|
13
|
+
error?: Error;
|
|
14
|
+
value?: T;
|
|
15
|
+
};
|
|
16
|
+
static getSearchFields(): string[];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=dynamic-entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-entity.d.ts","sourceRoot":"","sources":["../../src/database/dynamic-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8BAAsB,aAAc,SAAQ,UAAU;IACpD,OAAc,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC;IAClC,OAAc,YAAY,EAAE,CAAC,CAAC,SAAS,CAAC;IAExC,WAAkB,YAAY,IAAI,MAAM,CAEvC;IAED,WAAkB,UAAU,IAAI,MAAM,CAErC;IAED,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED,WAAkB,mBAAmB,IAAI,MAAM,CAE9C;IAED,WAAkB,uBAAuB,IAAI,MAAM,CAElD;IAED,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;WAEa,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,GAAG;QAAE,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,CAAA;KAAE;WAuBvE,eAAe,IAAI,MAAM,EAAE;CAG1C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { BaseEntity } from "@mikro-orm/core";
|
|
4
|
+
import { z } from "zod";
|
|
4
5
|
class DynamicEntity extends BaseEntity {
|
|
5
6
|
static {
|
|
6
7
|
__name(this, "DynamicEntity");
|
|
@@ -34,7 +35,16 @@ class DynamicEntity extends BaseEntity {
|
|
|
34
35
|
if (!selectedSchema) {
|
|
35
36
|
throw new Error("Schema not defined in entity.");
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
try {
|
|
39
|
+
const value = selectedSchema.parse(item);
|
|
40
|
+
return { value };
|
|
41
|
+
} catch (err) {
|
|
42
|
+
if (err instanceof z.ZodError) {
|
|
43
|
+
const error = new Error(err.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join(", "));
|
|
44
|
+
return { error };
|
|
45
|
+
}
|
|
46
|
+
return { error: err };
|
|
47
|
+
}
|
|
38
48
|
}
|
|
39
49
|
static getSearchFields() {
|
|
40
50
|
return [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/database/dynamic-entity.ts"],
|
|
4
|
-
"sourcesContent": ["import { BaseEntity } from '@mikro-orm/core';\nimport
|
|
5
|
-
"mappings": ";;AAAA,SAAS,kBAAkB;
|
|
4
|
+
"sourcesContent": ["import { BaseEntity } from '@mikro-orm/core';\nimport { z } from 'zod';\n\nexport abstract class DynamicEntity extends BaseEntity {\n public static schema: z.ZodSchema;\n public static schemaUpdate: z.ZodSchema;\n\n public static get singularName(): string {\n return 'Item';\n }\n\n public static get pluralName(): string {\n return 'Items';\n }\n\n public static get singularNameLowerCase(): string {\n return this.singularName.toLowerCase();\n }\n\n public static get pluralNameLowerCase(): string {\n return this.pluralName.toLowerCase();\n }\n\n public static get singularNameCapitalized(): string {\n return this.singularName.charAt(0).toUpperCase() + this.singularName.slice(1).toLowerCase();\n }\n\n public static get pluralNameCapitalized(): string {\n return this.pluralName.charAt(0).toUpperCase() + this.pluralName.slice(1).toLowerCase();\n }\n\n public static validate<T>(item: T, isCreating: boolean): { error?: Error; value?: T } {\n const schemaName = isCreating ? 'schema' : 'schemaUpdate';\n // Explicit whitelist of schema properties to prevent object injection\n if (!['schema', 'schemaUpdate'].includes(schemaName)) {\n throw new Error('Invalid schema reference');\n }\n const selectedSchema: z.ZodSchema | undefined = schemaName === 'schema' ? this.schema : this.schemaUpdate;\n if (!selectedSchema) {\n throw new Error('Schema not defined in entity.');\n }\n\n try {\n const value = selectedSchema.parse(item);\n return { value: value as T };\n } catch (err) {\n if (err instanceof z.ZodError) {\n const error = new Error(err.issues.map((e: z.ZodIssue) => `${e.path.join('.')}: ${e.message}`).join(', '));\n return { error };\n }\n return { error: err as Error };\n }\n }\n\n public static getSearchFields(): string[] {\n return [];\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA,SAAS,kBAAkB;AAC3B,SAAS,SAAS;AAEX,MAAe,sBAAsB,WAAW;AAAA,EAHvD,OAGuD;AAAA;AAAA;AAAA,EACrD,OAAc;AAAA,EACd,OAAc;AAAA,EAEd,WAAkB,eAAuB;AACvC,WAAO;AAAA,EACT;AAAA,EAEA,WAAkB,aAAqB;AACrC,WAAO;AAAA,EACT;AAAA,EAEA,WAAkB,wBAAgC;AAChD,WAAO,KAAK,aAAa,YAAY;AAAA,EACvC;AAAA,EAEA,WAAkB,sBAA8B;AAC9C,WAAO,KAAK,WAAW,YAAY;AAAA,EACrC;AAAA,EAEA,WAAkB,0BAAkC;AAClD,WAAO,KAAK,aAAa,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,aAAa,MAAM,CAAC,EAAE,YAAY;AAAA,EAC5F;AAAA,EAEA,WAAkB,wBAAgC;AAChD,WAAO,KAAK,WAAW,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,WAAW,MAAM,CAAC,EAAE,YAAY;AAAA,EACxF;AAAA,EAEA,OAAc,SAAY,MAAS,YAAmD;AACpF,UAAM,aAAa,aAAa,WAAW;AAE3C,QAAI,CAAC,CAAC,UAAU,cAAc,EAAE,SAAS,UAAU,GAAG;AACpD,YAAM,IAAI,MAAM,0BAA0B;AAAA,IAC5C;AACA,UAAM,iBAA0C,eAAe,WAAW,KAAK,SAAS,KAAK;AAC7F,QAAI,CAAC,gBAAgB;AACnB,YAAM,IAAI,MAAM,+BAA+B;AAAA,IACjD;AAEA,QAAI;AACF,YAAM,QAAQ,eAAe,MAAM,IAAI;AACvC,aAAO,EAAE,MAAkB;AAAA,IAC7B,SAAS,KAAK;AACZ,UAAI,eAAe,EAAE,UAAU;AAC7B,cAAM,QAAQ,IAAI,MAAM,IAAI,OAAO,IAAI,CAAC,MAAkB,GAAG,EAAE,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,IAAI,CAAC;AACzG,eAAO,EAAE,MAAM;AAAA,MACjB;AACA,aAAO,EAAE,OAAO,IAAa;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,OAAc,kBAA4B;AACxC,WAAO,CAAC;AAAA,EACV;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as DatabaseManager } from './manager.js';
|
|
2
|
+
export { default as DatabaseInstance } from './instance.js';
|
|
3
|
+
export { FormField, FormFieldType } from './dynamic-entity-form-decorators.js';
|
|
4
|
+
export { DynamicEntity } from './dynamic-entity.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { EntityManager, MikroORM } from '@mikro-orm/postgresql';
|
|
2
|
+
import type { ApplicationConfig } from '../application/base-application.interface.js';
|
|
3
|
+
import type DatabaseManager from './manager.js';
|
|
4
|
+
/**
|
|
5
|
+
* Database Instance
|
|
6
|
+
*/
|
|
7
|
+
export default class DatabaseInstance {
|
|
8
|
+
/** Database manager */
|
|
9
|
+
private databaseManager;
|
|
10
|
+
/** Application config */
|
|
11
|
+
private applicationConfig;
|
|
12
|
+
/** MikroORM instance */
|
|
13
|
+
private orm;
|
|
14
|
+
/**
|
|
15
|
+
* Database Instance constructor
|
|
16
|
+
* @param orm MikroORM instance
|
|
17
|
+
*/
|
|
18
|
+
constructor({ databaseManager, applicationConfig, orm, }: {
|
|
19
|
+
databaseManager: DatabaseManager;
|
|
20
|
+
applicationConfig: ApplicationConfig;
|
|
21
|
+
orm: MikroORM;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Check if database is connected
|
|
25
|
+
*/
|
|
26
|
+
isConnected(): Promise<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* Get EntityManager
|
|
29
|
+
*/
|
|
30
|
+
getEntityManager(): EntityManager;
|
|
31
|
+
/**
|
|
32
|
+
* Disconnect
|
|
33
|
+
*/
|
|
34
|
+
disconnect(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/database/instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,uBAAuB;IACvB,OAAO,CAAC,eAAe,CAAkB;IAEzC,yBAAyB;IACzB,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,wBAAwB;IACxB,OAAO,CAAC,GAAG,CAAW;IAEtB;;;OAGG;gBACS,EACV,eAAe,EACf,iBAAiB,EACjB,GAAG,GACJ,EAAE;QACD,eAAe,EAAE,eAAe,CAAC;QACjC,iBAAiB,EAAE,iBAAiB,CAAC;QACrC,GAAG,EAAE,QAAQ,CAAC;KACf;IAMD;;OAEG;IACI,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAItC;;OAEG;IACI,gBAAgB,IAAI,aAAa;IAIxC;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAKzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance.interface.d.ts","sourceRoot":"","sources":["../../src/database/instance.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,iCAAiC;IAChD,GAAG,EAAE,QAAQ,CAAC;CACf"}
|