@zyno-io/ts-server-foundation 26.712.36
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 +31 -0
- package/dist/devconsole/assets/index-BlWLbczn.css +1 -0
- package/dist/devconsole/assets/index-lSF6DUY3.js +3 -0
- package/dist/devconsole/index.html +13 -0
- package/dist/src/app/base.d.ts +66 -0
- package/dist/src/app/base.d.ts.map +1 -0
- package/dist/src/app/base.js +577 -0
- package/dist/src/app/base.js.map +1 -0
- package/dist/src/app/commands.d.ts +20 -0
- package/dist/src/app/commands.d.ts.map +1 -0
- package/dist/src/app/commands.js +17 -0
- package/dist/src/app/commands.js.map +1 -0
- package/dist/src/app/config-loader.d.ts +9 -0
- package/dist/src/app/config-loader.d.ts.map +1 -0
- package/dist/src/app/config-loader.js +91 -0
- package/dist/src/app/config-loader.js.map +1 -0
- package/dist/src/app/config.d.ts +96 -0
- package/dist/src/app/config.d.ts.map +1 -0
- package/dist/src/app/config.js +114 -0
- package/dist/src/app/config.js.map +1 -0
- package/dist/src/app/const.d.ts +5 -0
- package/dist/src/app/const.d.ts.map +1 -0
- package/dist/src/app/const.js +17 -0
- package/dist/src/app/const.js.map +1 -0
- package/dist/src/app/current.d.ts +5 -0
- package/dist/src/app/current.d.ts.map +1 -0
- package/dist/src/app/current.js +14 -0
- package/dist/src/app/current.js.map +1 -0
- package/dist/src/app/index.d.ts +8 -0
- package/dist/src/app/index.d.ts.map +1 -0
- package/dist/src/app/index.js +13 -0
- package/dist/src/app/index.js.map +1 -0
- package/dist/src/app/lifecycle.d.ts +9 -0
- package/dist/src/app/lifecycle.d.ts.map +1 -0
- package/dist/src/app/lifecycle.js +21 -0
- package/dist/src/app/lifecycle.js.map +1 -0
- package/dist/src/app/migrations-entrypoint.d.ts +3 -0
- package/dist/src/app/migrations-entrypoint.d.ts.map +1 -0
- package/dist/src/app/migrations-entrypoint.js +35 -0
- package/dist/src/app/migrations-entrypoint.js.map +1 -0
- package/dist/src/app/resolver.d.ts +6 -0
- package/dist/src/app/resolver.d.ts.map +1 -0
- package/dist/src/app/resolver.js +15 -0
- package/dist/src/app/resolver.js.map +1 -0
- package/dist/src/auth/index.d.ts +3 -0
- package/dist/src/auth/index.d.ts.map +1 -0
- package/dist/src/auth/index.js +15 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/auth/jwt.d.ts +61 -0
- package/dist/src/auth/jwt.d.ts.map +1 -0
- package/dist/src/auth/jwt.js +379 -0
- package/dist/src/auth/jwt.js.map +1 -0
- package/dist/src/auth/provider.d.ts +21 -0
- package/dist/src/auth/provider.d.ts.map +1 -0
- package/dist/src/auth/provider.js +148 -0
- package/dist/src/auth/provider.js.map +1 -0
- package/dist/src/cli/common.d.ts +13 -0
- package/dist/src/cli/common.d.ts.map +1 -0
- package/dist/src/cli/common.js +99 -0
- package/dist/src/cli/common.js.map +1 -0
- package/dist/src/cli/tsf-create-app.d.ts +3 -0
- package/dist/src/cli/tsf-create-app.d.ts.map +1 -0
- package/dist/src/cli/tsf-create-app.js +89 -0
- package/dist/src/cli/tsf-create-app.js.map +1 -0
- package/dist/src/cli/tsf-dev.d.ts +3 -0
- package/dist/src/cli/tsf-dev.d.ts.map +1 -0
- package/dist/src/cli/tsf-dev.js +753 -0
- package/dist/src/cli/tsf-dev.js.map +1 -0
- package/dist/src/cli/tsf-gen-proto.d.ts +3 -0
- package/dist/src/cli/tsf-gen-proto.d.ts.map +1 -0
- package/dist/src/cli/tsf-gen-proto.js +134 -0
- package/dist/src/cli/tsf-gen-proto.js.map +1 -0
- package/dist/src/cli/tsf-install.d.ts +8 -0
- package/dist/src/cli/tsf-install.d.ts.map +1 -0
- package/dist/src/cli/tsf-install.js +424 -0
- package/dist/src/cli/tsf-install.js.map +1 -0
- package/dist/src/cli/tsf-migrate.d.ts +3 -0
- package/dist/src/cli/tsf-migrate.d.ts.map +1 -0
- package/dist/src/cli/tsf-migrate.js +271 -0
- package/dist/src/cli/tsf-migrate.js.map +1 -0
- package/dist/src/cli/tsf-test.d.ts +4 -0
- package/dist/src/cli/tsf-test.d.ts.map +1 -0
- package/dist/src/cli/tsf-test.js +350 -0
- package/dist/src/cli/tsf-test.js.map +1 -0
- package/dist/src/cli/tsf-update.d.ts +3 -0
- package/dist/src/cli/tsf-update.d.ts.map +1 -0
- package/dist/src/cli/tsf-update.js +12 -0
- package/dist/src/cli/tsf-update.js.map +1 -0
- package/dist/src/cli/tsf.d.ts +3 -0
- package/dist/src/cli/tsf.d.ts.map +1 -0
- package/dist/src/cli/tsf.js +29 -0
- package/dist/src/cli/tsf.js.map +1 -0
- package/dist/src/database/database.d.ts +54 -0
- package/dist/src/database/database.d.ts.map +1 -0
- package/dist/src/database/database.js +695 -0
- package/dist/src/database/database.js.map +1 -0
- package/dist/src/database/driver.d.ts +28 -0
- package/dist/src/database/driver.d.ts.map +1 -0
- package/dist/src/database/driver.js +5 -0
- package/dist/src/database/driver.js.map +1 -0
- package/dist/src/database/drivers/index.d.ts +4 -0
- package/dist/src/database/drivers/index.d.ts.map +1 -0
- package/dist/src/database/drivers/index.js +9 -0
- package/dist/src/database/drivers/index.js.map +1 -0
- package/dist/src/database/drivers/mysql-session-rpc.d.ts +40 -0
- package/dist/src/database/drivers/mysql-session-rpc.d.ts.map +1 -0
- package/dist/src/database/drivers/mysql-session-rpc.js +180 -0
- package/dist/src/database/drivers/mysql-session-rpc.js.map +1 -0
- package/dist/src/database/drivers/mysql-session.d.ts +25 -0
- package/dist/src/database/drivers/mysql-session.d.ts.map +1 -0
- package/dist/src/database/drivers/mysql-session.js +124 -0
- package/dist/src/database/drivers/mysql-session.js.map +1 -0
- package/dist/src/database/drivers/mysql.d.ts +20 -0
- package/dist/src/database/drivers/mysql.d.ts.map +1 -0
- package/dist/src/database/drivers/mysql.js +84 -0
- package/dist/src/database/drivers/mysql.js.map +1 -0
- package/dist/src/database/drivers/postgres.d.ts +22 -0
- package/dist/src/database/drivers/postgres.d.ts.map +1 -0
- package/dist/src/database/drivers/postgres.js +80 -0
- package/dist/src/database/drivers/postgres.js.map +1 -0
- package/dist/src/database/entity.d.ts +112 -0
- package/dist/src/database/entity.d.ts.map +1 -0
- package/dist/src/database/entity.js +333 -0
- package/dist/src/database/entity.js.map +1 -0
- package/dist/src/database/errors.d.ts +7 -0
- package/dist/src/database/errors.d.ts.map +1 -0
- package/dist/src/database/errors.js +34 -0
- package/dist/src/database/errors.js.map +1 -0
- package/dist/src/database/factory.d.ts +48 -0
- package/dist/src/database/factory.d.ts.map +1 -0
- package/dist/src/database/factory.js +139 -0
- package/dist/src/database/factory.js.map +1 -0
- package/dist/src/database/identifiers.d.ts +8 -0
- package/dist/src/database/identifiers.d.ts.map +1 -0
- package/dist/src/database/identifiers.js +46 -0
- package/dist/src/database/identifiers.js.map +1 -0
- package/dist/src/database/index.d.ts +14 -0
- package/dist/src/database/index.d.ts.map +1 -0
- package/dist/src/database/index.js +33 -0
- package/dist/src/database/index.js.map +1 -0
- package/dist/src/database/metadata.d.ts +27 -0
- package/dist/src/database/metadata.d.ts.map +1 -0
- package/dist/src/database/metadata.js +70 -0
- package/dist/src/database/metadata.js.map +1 -0
- package/dist/src/database/migration/create/comparator.d.ts +3 -0
- package/dist/src/database/migration/create/comparator.d.ts.map +1 -0
- package/dist/src/database/migration/create/comparator.js +302 -0
- package/dist/src/database/migration/create/comparator.js.map +1 -0
- package/dist/src/database/migration/create/db-reader.d.ts +9 -0
- package/dist/src/database/migration/create/db-reader.d.ts.map +1 -0
- package/dist/src/database/migration/create/db-reader.js +478 -0
- package/dist/src/database/migration/create/db-reader.js.map +1 -0
- package/dist/src/database/migration/create/ddl-generator.d.ts +4 -0
- package/dist/src/database/migration/create/ddl-generator.d.ts.map +1 -0
- package/dist/src/database/migration/create/ddl-generator.js +431 -0
- package/dist/src/database/migration/create/ddl-generator.js.map +1 -0
- package/dist/src/database/migration/create/entity-reader.d.ts +7 -0
- package/dist/src/database/migration/create/entity-reader.d.ts.map +1 -0
- package/dist/src/database/migration/create/entity-reader.js +169 -0
- package/dist/src/database/migration/create/entity-reader.js.map +1 -0
- package/dist/src/database/migration/create/file-generator.d.ts +7 -0
- package/dist/src/database/migration/create/file-generator.d.ts.map +1 -0
- package/dist/src/database/migration/create/file-generator.js +60 -0
- package/dist/src/database/migration/create/file-generator.js.map +1 -0
- package/dist/src/database/migration/create/index.d.ts +19 -0
- package/dist/src/database/migration/create/index.d.ts.map +1 -0
- package/dist/src/database/migration/create/index.js +102 -0
- package/dist/src/database/migration/create/index.js.map +1 -0
- package/dist/src/database/migration/create/schema-model.d.ts +99 -0
- package/dist/src/database/migration/create/schema-model.d.ts.map +1 -0
- package/dist/src/database/migration/create/schema-model.js +24 -0
- package/dist/src/database/migration/create/schema-model.js.map +1 -0
- package/dist/src/database/migration/create/type-mapper.d.ts +13 -0
- package/dist/src/database/migration/create/type-mapper.d.ts.map +1 -0
- package/dist/src/database/migration/create/type-mapper.js +293 -0
- package/dist/src/database/migration/create/type-mapper.js.map +1 -0
- package/dist/src/database/migration/index.d.ts +33 -0
- package/dist/src/database/migration/index.d.ts.map +1 -0
- package/dist/src/database/migration/index.js +165 -0
- package/dist/src/database/migration/index.js.map +1 -0
- package/dist/src/database/migration/maintenance.d.ts +26 -0
- package/dist/src/database/migration/maintenance.d.ts.map +1 -0
- package/dist/src/database/migration/maintenance.js +65 -0
- package/dist/src/database/migration/maintenance.js.map +1 -0
- package/dist/src/database/query.d.ts +79 -0
- package/dist/src/database/query.d.ts.map +1 -0
- package/dist/src/database/query.js +435 -0
- package/dist/src/database/query.js.map +1 -0
- package/dist/src/database/schema.d.ts +147 -0
- package/dist/src/database/schema.d.ts.map +1 -0
- package/dist/src/database/schema.js +709 -0
- package/dist/src/database/schema.js.map +1 -0
- package/dist/src/database/session.d.ts +63 -0
- package/dist/src/database/session.d.ts.map +1 -0
- package/dist/src/database/session.js +226 -0
- package/dist/src/database/session.js.map +1 -0
- package/dist/src/database/sql.d.ts +37 -0
- package/dist/src/database/sql.d.ts.map +1 -0
- package/dist/src/database/sql.js +143 -0
- package/dist/src/database/sql.js.map +1 -0
- package/dist/src/database/values.d.ts +6 -0
- package/dist/src/database/values.d.ts.map +1 -0
- package/dist/src/database/values.js +237 -0
- package/dist/src/database/values.js.map +1 -0
- package/dist/src/devconsole/controller.d.ts +11 -0
- package/dist/src/devconsole/controller.d.ts.map +1 -0
- package/dist/src/devconsole/controller.js +78 -0
- package/dist/src/devconsole/controller.js.map +1 -0
- package/dist/src/devconsole/generated/devconsole.d.ts +306 -0
- package/dist/src/devconsole/generated/devconsole.d.ts.map +1 -0
- package/dist/src/devconsole/generated/devconsole.js +4029 -0
- package/dist/src/devconsole/generated/devconsole.js.map +1 -0
- package/dist/src/devconsole/index.d.ts +10 -0
- package/dist/src/devconsole/index.d.ts.map +1 -0
- package/dist/src/devconsole/index.js +26 -0
- package/dist/src/devconsole/index.js.map +1 -0
- package/dist/src/devconsole/observers.d.ts +4 -0
- package/dist/src/devconsole/observers.d.ts.map +1 -0
- package/dist/src/devconsole/observers.js +170 -0
- package/dist/src/devconsole/observers.js.map +1 -0
- package/dist/src/devconsole/runtime.d.ts +16 -0
- package/dist/src/devconsole/runtime.d.ts.map +1 -0
- package/dist/src/devconsole/runtime.js +48 -0
- package/dist/src/devconsole/runtime.js.map +1 -0
- package/dist/src/devconsole/security.d.ts +8 -0
- package/dist/src/devconsole/security.d.ts.map +1 -0
- package/dist/src/devconsole/security.js +33 -0
- package/dist/src/devconsole/security.js.map +1 -0
- package/dist/src/devconsole/server.d.ts +25 -0
- package/dist/src/devconsole/server.d.ts.map +1 -0
- package/dist/src/devconsole/server.js +452 -0
- package/dist/src/devconsole/server.js.map +1 -0
- package/dist/src/devconsole/store.d.ts +111 -0
- package/dist/src/devconsole/store.d.ts.map +1 -0
- package/dist/src/devconsole/store.js +177 -0
- package/dist/src/devconsole/store.js.map +1 -0
- package/dist/src/di/container.d.ts +38 -0
- package/dist/src/di/container.d.ts.map +1 -0
- package/dist/src/di/container.js +252 -0
- package/dist/src/di/container.js.map +1 -0
- package/dist/src/di/errors.d.ts +18 -0
- package/dist/src/di/errors.d.ts.map +1 -0
- package/dist/src/di/errors.js +71 -0
- package/dist/src/di/errors.js.map +1 -0
- package/dist/src/di/index.d.ts +5 -0
- package/dist/src/di/index.d.ts.map +1 -0
- package/dist/src/di/index.js +10 -0
- package/dist/src/di/index.js.map +1 -0
- package/dist/src/di/module.d.ts +29 -0
- package/dist/src/di/module.d.ts.map +1 -0
- package/dist/src/di/module.js +42 -0
- package/dist/src/di/module.js.map +1 -0
- package/dist/src/di/provider.d.ts +34 -0
- package/dist/src/di/provider.d.ts.map +1 -0
- package/dist/src/di/provider.js +24 -0
- package/dist/src/di/provider.js.map +1 -0
- package/dist/src/env.d.ts +122 -0
- package/dist/src/env.d.ts.map +1 -0
- package/dist/src/env.js +61 -0
- package/dist/src/env.js.map +1 -0
- package/dist/src/events/event-bus.d.ts +26 -0
- package/dist/src/events/event-bus.d.ts.map +1 -0
- package/dist/src/events/event-bus.js +67 -0
- package/dist/src/events/event-bus.js.map +1 -0
- package/dist/src/events/index.d.ts +2 -0
- package/dist/src/events/index.d.ts.map +1 -0
- package/dist/src/events/index.js +7 -0
- package/dist/src/events/index.js.map +1 -0
- package/dist/src/health/healthcheck.controller.d.ts +9 -0
- package/dist/src/health/healthcheck.controller.d.ts.map +1 -0
- package/dist/src/health/healthcheck.controller.js +33 -0
- package/dist/src/health/healthcheck.controller.js.map +1 -0
- package/dist/src/health/healthcheck.service.d.ts +13 -0
- package/dist/src/health/healthcheck.service.d.ts.map +1 -0
- package/dist/src/health/healthcheck.service.js +37 -0
- package/dist/src/health/healthcheck.service.js.map +1 -0
- package/dist/src/health/index.d.ts +3 -0
- package/dist/src/health/index.d.ts.map +1 -0
- package/dist/src/health/index.js +8 -0
- package/dist/src/health/index.js.map +1 -0
- package/dist/src/helpers/async/context.d.ts +10 -0
- package/dist/src/helpers/async/context.d.ts.map +1 -0
- package/dist/src/helpers/async/context.js +52 -0
- package/dist/src/helpers/async/context.js.map +1 -0
- package/dist/src/helpers/async/process.d.ts +16 -0
- package/dist/src/helpers/async/process.d.ts.map +1 -0
- package/dist/src/helpers/async/process.js +62 -0
- package/dist/src/helpers/async/process.js.map +1 -0
- package/dist/src/helpers/async/promise.d.ts +11 -0
- package/dist/src/helpers/async/promise.d.ts.map +1 -0
- package/dist/src/helpers/async/promise.js +32 -0
- package/dist/src/helpers/async/promise.js.map +1 -0
- package/dist/src/helpers/data/array.d.ts +5 -0
- package/dist/src/helpers/data/array.d.ts.map +1 -0
- package/dist/src/helpers/data/array.js +27 -0
- package/dist/src/helpers/data/array.js.map +1 -0
- package/dist/src/helpers/data/objects.d.ts +13 -0
- package/dist/src/helpers/data/objects.d.ts.map +1 -0
- package/dist/src/helpers/data/objects.js +55 -0
- package/dist/src/helpers/data/objects.js.map +1 -0
- package/dist/src/helpers/data/serialization.d.ts +5 -0
- package/dist/src/helpers/data/serialization.d.ts.map +1 -0
- package/dist/src/helpers/data/serialization.js +25 -0
- package/dist/src/helpers/data/serialization.js.map +1 -0
- package/dist/src/helpers/data/transformer.d.ts +13 -0
- package/dist/src/helpers/data/transformer.d.ts.map +1 -0
- package/dist/src/helpers/data/transformer.js +50 -0
- package/dist/src/helpers/data/transformer.js.map +1 -0
- package/dist/src/helpers/index.d.ts +19 -0
- package/dist/src/helpers/index.d.ts.map +1 -0
- package/dist/src/helpers/index.js +30 -0
- package/dist/src/helpers/index.js.map +1 -0
- package/dist/src/helpers/io/package.d.ts +10 -0
- package/dist/src/helpers/io/package.d.ts.map +1 -0
- package/dist/src/helpers/io/package.js +35 -0
- package/dist/src/helpers/io/package.js.map +1 -0
- package/dist/src/helpers/io/stream.d.ts +18 -0
- package/dist/src/helpers/io/stream.d.ts.map +1 -0
- package/dist/src/helpers/io/stream.js +131 -0
- package/dist/src/helpers/io/stream.js.map +1 -0
- package/dist/src/helpers/redis/broadcast.d.ts +15 -0
- package/dist/src/helpers/redis/broadcast.d.ts.map +1 -0
- package/dist/src/helpers/redis/broadcast.js +93 -0
- package/dist/src/helpers/redis/broadcast.js.map +1 -0
- package/dist/src/helpers/redis/cache.d.ts +20 -0
- package/dist/src/helpers/redis/cache.d.ts.map +1 -0
- package/dist/src/helpers/redis/cache.js +57 -0
- package/dist/src/helpers/redis/cache.js.map +1 -0
- package/dist/src/helpers/redis/mutex.d.ts +45 -0
- package/dist/src/helpers/redis/mutex.d.ts.map +1 -0
- package/dist/src/helpers/redis/mutex.js +446 -0
- package/dist/src/helpers/redis/mutex.js.map +1 -0
- package/dist/src/helpers/redis/redis.d.ts +12 -0
- package/dist/src/helpers/redis/redis.d.ts.map +1 -0
- package/dist/src/helpers/redis/redis.js +62 -0
- package/dist/src/helpers/redis/redis.js.map +1 -0
- package/dist/src/helpers/security/crypto.d.ts +31 -0
- package/dist/src/helpers/security/crypto.d.ts.map +1 -0
- package/dist/src/helpers/security/crypto.js +108 -0
- package/dist/src/helpers/security/crypto.js.map +1 -0
- package/dist/src/helpers/security/validation.d.ts +3 -0
- package/dist/src/helpers/security/validation.d.ts.map +1 -0
- package/dist/src/helpers/security/validation.js +14 -0
- package/dist/src/helpers/security/validation.js.map +1 -0
- package/dist/src/helpers/utils/date.d.ts +4 -0
- package/dist/src/helpers/utils/date.d.ts.map +1 -0
- package/dist/src/helpers/utils/date.js +16 -0
- package/dist/src/helpers/utils/date.js.map +1 -0
- package/dist/src/helpers/utils/error.d.ts +20 -0
- package/dist/src/helpers/utils/error.d.ts.map +1 -0
- package/dist/src/helpers/utils/error.js +164 -0
- package/dist/src/helpers/utils/error.js.map +1 -0
- package/dist/src/helpers/utils/uuid.d.ts +5 -0
- package/dist/src/helpers/utils/uuid.d.ts.map +1 -0
- package/dist/src/helpers/utils/uuid.js +13 -0
- package/dist/src/helpers/utils/uuid.js.map +1 -0
- package/dist/src/http/auth.d.ts +20 -0
- package/dist/src/http/auth.d.ts.map +1 -0
- package/dist/src/http/auth.js +68 -0
- package/dist/src/http/auth.js.map +1 -0
- package/dist/src/http/base.d.ts +57 -0
- package/dist/src/http/base.d.ts.map +1 -0
- package/dist/src/http/base.js +331 -0
- package/dist/src/http/base.js.map +1 -0
- package/dist/src/http/context.d.ts +6 -0
- package/dist/src/http/context.d.ts.map +1 -0
- package/dist/src/http/context.js +26 -0
- package/dist/src/http/context.js.map +1 -0
- package/dist/src/http/cors.d.ts +25 -0
- package/dist/src/http/cors.d.ts.map +1 -0
- package/dist/src/http/cors.js +124 -0
- package/dist/src/http/cors.js.map +1 -0
- package/dist/src/http/decorators.d.ts +64 -0
- package/dist/src/http/decorators.d.ts.map +1 -0
- package/dist/src/http/decorators.js +102 -0
- package/dist/src/http/decorators.js.map +1 -0
- package/dist/src/http/errors.d.ts +50 -0
- package/dist/src/http/errors.d.ts.map +1 -0
- package/dist/src/http/errors.js +158 -0
- package/dist/src/http/errors.js.map +1 -0
- package/dist/src/http/index.d.ts +31 -0
- package/dist/src/http/index.d.ts.map +1 -0
- package/dist/src/http/index.js +33 -0
- package/dist/src/http/index.js.map +1 -0
- package/dist/src/http/middleware.d.ts +12 -0
- package/dist/src/http/middleware.d.ts.map +1 -0
- package/dist/src/http/middleware.js +31 -0
- package/dist/src/http/middleware.js.map +1 -0
- package/dist/src/http/parameter-resolvers.d.ts +3 -0
- package/dist/src/http/parameter-resolvers.d.ts.map +1 -0
- package/dist/src/http/parameter-resolvers.js +8 -0
- package/dist/src/http/parameter-resolvers.js.map +1 -0
- package/dist/src/http/request-logging.d.ts +34 -0
- package/dist/src/http/request-logging.d.ts.map +1 -0
- package/dist/src/http/request-logging.js +130 -0
- package/dist/src/http/request-logging.js.map +1 -0
- package/dist/src/http/request.d.ts +69 -0
- package/dist/src/http/request.d.ts.map +1 -0
- package/dist/src/http/request.js +366 -0
- package/dist/src/http/request.js.map +1 -0
- package/dist/src/http/response.d.ts +98 -0
- package/dist/src/http/response.d.ts.map +1 -0
- package/dist/src/http/response.js +292 -0
- package/dist/src/http/response.js.map +1 -0
- package/dist/src/http/router.d.ts +100 -0
- package/dist/src/http/router.d.ts.map +1 -0
- package/dist/src/http/router.js +1085 -0
- package/dist/src/http/router.js.map +1 -0
- package/dist/src/http/startup-logging.d.ts +8 -0
- package/dist/src/http/startup-logging.d.ts.map +1 -0
- package/dist/src/http/startup-logging.js +55 -0
- package/dist/src/http/startup-logging.js.map +1 -0
- package/dist/src/http/static-files.d.ts +15 -0
- package/dist/src/http/static-files.d.ts.map +1 -0
- package/dist/src/http/static-files.js +110 -0
- package/dist/src/http/static-files.js.map +1 -0
- package/dist/src/http/store.d.ts +8 -0
- package/dist/src/http/store.d.ts.map +1 -0
- package/dist/src/http/store.js +47 -0
- package/dist/src/http/store.js.map +1 -0
- package/dist/src/http/types.d.ts +23 -0
- package/dist/src/http/types.d.ts.map +1 -0
- package/dist/src/http/types.js +3 -0
- package/dist/src/http/types.js.map +1 -0
- package/dist/src/http/upgrade.d.ts +22 -0
- package/dist/src/http/upgrade.d.ts.map +1 -0
- package/dist/src/http/upgrade.js +164 -0
- package/dist/src/http/upgrade.js.map +1 -0
- package/dist/src/http/uploads.d.ts +36 -0
- package/dist/src/http/uploads.d.ts.map +1 -0
- package/dist/src/http/uploads.js +287 -0
- package/dist/src/http/uploads.js.map +1 -0
- package/dist/src/http/workflow.d.ts +34 -0
- package/dist/src/http/workflow.d.ts.map +1 -0
- package/dist/src/http/workflow.js +40 -0
- package/dist/src/http/workflow.js.map +1 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +88 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/openapi/controller.d.ts +9 -0
- package/dist/src/openapi/controller.d.ts.map +1 -0
- package/dist/src/openapi/controller.js +45 -0
- package/dist/src/openapi/controller.js.map +1 -0
- package/dist/src/openapi/index.d.ts +5 -0
- package/dist/src/openapi/index.d.ts.map +1 -0
- package/dist/src/openapi/index.js +21 -0
- package/dist/src/openapi/index.js.map +1 -0
- package/dist/src/openapi/schema.d.ts +26 -0
- package/dist/src/openapi/schema.d.ts.map +1 -0
- package/dist/src/openapi/schema.js +1128 -0
- package/dist/src/openapi/schema.js.map +1 -0
- package/dist/src/openapi/serializer.d.ts +16 -0
- package/dist/src/openapi/serializer.d.ts.map +1 -0
- package/dist/src/openapi/serializer.js +506 -0
- package/dist/src/openapi/serializer.js.map +1 -0
- package/dist/src/openapi/types.d.ts +84 -0
- package/dist/src/openapi/types.d.ts.map +1 -0
- package/dist/src/openapi/types.js +5 -0
- package/dist/src/openapi/types.js.map +1 -0
- package/dist/src/reflection/annotations.d.ts +15 -0
- package/dist/src/reflection/annotations.d.ts.map +1 -0
- package/dist/src/reflection/annotations.js +228 -0
- package/dist/src/reflection/annotations.js.map +1 -0
- package/dist/src/reflection/conversion.d.ts +15 -0
- package/dist/src/reflection/conversion.d.ts.map +1 -0
- package/dist/src/reflection/conversion.js +360 -0
- package/dist/src/reflection/conversion.js.map +1 -0
- package/dist/src/reflection/deserializer.d.ts +15 -0
- package/dist/src/reflection/deserializer.d.ts.map +1 -0
- package/dist/src/reflection/deserializer.js +42 -0
- package/dist/src/reflection/deserializer.js.map +1 -0
- package/dist/src/reflection/entity.d.ts +9 -0
- package/dist/src/reflection/entity.d.ts.map +1 -0
- package/dist/src/reflection/entity.js +74 -0
- package/dist/src/reflection/entity.js.map +1 -0
- package/dist/src/reflection/errors.d.ts +8 -0
- package/dist/src/reflection/errors.d.ts.map +1 -0
- package/dist/src/reflection/errors.js +21 -0
- package/dist/src/reflection/errors.js.map +1 -0
- package/dist/src/reflection/index.d.ts +8 -0
- package/dist/src/reflection/index.d.ts.map +1 -0
- package/dist/src/reflection/index.js +13 -0
- package/dist/src/reflection/index.js.map +1 -0
- package/dist/src/reflection/metadata-store.d.ts +14 -0
- package/dist/src/reflection/metadata-store.d.ts.map +1 -0
- package/dist/src/reflection/metadata-store.js +18 -0
- package/dist/src/reflection/metadata-store.js.map +1 -0
- package/dist/src/reflection/model.d.ts +271 -0
- package/dist/src/reflection/model.d.ts.map +1 -0
- package/dist/src/reflection/model.js +36 -0
- package/dist/src/reflection/model.js.map +1 -0
- package/dist/src/reflection/reflection-class.d.ts +60 -0
- package/dist/src/reflection/reflection-class.d.ts.map +1 -0
- package/dist/src/reflection/reflection-class.js +263 -0
- package/dist/src/reflection/reflection-class.js.map +1 -0
- package/dist/src/reflection/type-utils.d.ts +34 -0
- package/dist/src/reflection/type-utils.d.ts.map +1 -0
- package/dist/src/reflection/type-utils.js +485 -0
- package/dist/src/reflection/type-utils.js.map +1 -0
- package/dist/src/reflection.d.ts +2 -0
- package/dist/src/reflection.d.ts.map +1 -0
- package/dist/src/reflection.js +5 -0
- package/dist/src/reflection.js.map +1 -0
- package/dist/src/services/cli.d.ts +9 -0
- package/dist/src/services/cli.d.ts.map +1 -0
- package/dist/src/services/cli.js +47 -0
- package/dist/src/services/cli.js.map +1 -0
- package/dist/src/services/index.d.ts +8 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +13 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/services/leader.d.ts +31 -0
- package/dist/src/services/leader.d.ts.map +1 -0
- package/dist/src/services/leader.js +176 -0
- package/dist/src/services/leader.js.map +1 -0
- package/dist/src/services/logger.d.ts +60 -0
- package/dist/src/services/logger.d.ts.map +1 -0
- package/dist/src/services/logger.js +349 -0
- package/dist/src/services/logger.js.map +1 -0
- package/dist/src/services/mail/index.d.ts +57 -0
- package/dist/src/services/mail/index.d.ts.map +1 -0
- package/dist/src/services/mail/index.js +89 -0
- package/dist/src/services/mail/index.js.map +1 -0
- package/dist/src/services/mail/postmark.d.ts +11 -0
- package/dist/src/services/mail/postmark.d.ts.map +1 -0
- package/dist/src/services/mail/postmark.js +41 -0
- package/dist/src/services/mail/postmark.js.map +1 -0
- package/dist/src/services/mail/smtp.d.ts +11 -0
- package/dist/src/services/mail/smtp.d.ts.map +1 -0
- package/dist/src/services/mail/smtp.js +50 -0
- package/dist/src/services/mail/smtp.js.map +1 -0
- package/dist/src/services/mesh-client/index.d.ts +9 -0
- package/dist/src/services/mesh-client/index.d.ts.map +1 -0
- package/dist/src/services/mesh-client/index.js +18 -0
- package/dist/src/services/mesh-client/index.js.map +1 -0
- package/dist/src/services/mesh-client/mesh-client-redis-registry.d.ts +23 -0
- package/dist/src/services/mesh-client/mesh-client-redis-registry.d.ts.map +1 -0
- package/dist/src/services/mesh-client/mesh-client-redis-registry.js +360 -0
- package/dist/src/services/mesh-client/mesh-client-redis-registry.js.map +1 -0
- package/dist/src/services/mesh-client/mesh-client-registry.d.ts +16 -0
- package/dist/src/services/mesh-client/mesh-client-registry.d.ts.map +1 -0
- package/dist/src/services/mesh-client/mesh-client-registry.js +44 -0
- package/dist/src/services/mesh-client/mesh-client-registry.js.map +1 -0
- package/dist/src/services/mesh-client/mesh-client-service.d.ts +88 -0
- package/dist/src/services/mesh-client/mesh-client-service.d.ts.map +1 -0
- package/dist/src/services/mesh-client/mesh-client-service.js +222 -0
- package/dist/src/services/mesh-client/mesh-client-service.js.map +1 -0
- package/dist/src/services/mesh-client/mesh-srpc-server.d.ts +95 -0
- package/dist/src/services/mesh-client/mesh-srpc-server.d.ts.map +1 -0
- package/dist/src/services/mesh-client/mesh-srpc-server.js +475 -0
- package/dist/src/services/mesh-client/mesh-srpc-server.js.map +1 -0
- package/dist/src/services/mesh-client/types.d.ts +36 -0
- package/dist/src/services/mesh-client/types.d.ts.map +1 -0
- package/dist/src/services/mesh-client/types.js +38 -0
- package/dist/src/services/mesh-client/types.js.map +1 -0
- package/dist/src/services/mesh.d.ts +73 -0
- package/dist/src/services/mesh.d.ts.map +1 -0
- package/dist/src/services/mesh.js +511 -0
- package/dist/src/services/mesh.js.map +1 -0
- package/dist/src/services/worker/entity.d.ts +26 -0
- package/dist/src/services/worker/entity.d.ts.map +1 -0
- package/dist/src/services/worker/entity.js +30 -0
- package/dist/src/services/worker/entity.js.map +1 -0
- package/dist/src/services/worker/index.d.ts +25 -0
- package/dist/src/services/worker/index.d.ts.map +1 -0
- package/dist/src/services/worker/index.js +52 -0
- package/dist/src/services/worker/index.js.map +1 -0
- package/dist/src/services/worker/observer.d.ts +13 -0
- package/dist/src/services/worker/observer.d.ts.map +1 -0
- package/dist/src/services/worker/observer.js +22 -0
- package/dist/src/services/worker/observer.js.map +1 -0
- package/dist/src/services/worker/queue.d.ts +38 -0
- package/dist/src/services/worker/queue.d.ts.map +1 -0
- package/dist/src/services/worker/queue.js +227 -0
- package/dist/src/services/worker/queue.js.map +1 -0
- package/dist/src/services/worker/recorder.d.ts +17 -0
- package/dist/src/services/worker/recorder.d.ts.map +1 -0
- package/dist/src/services/worker/recorder.js +88 -0
- package/dist/src/services/worker/recorder.js.map +1 -0
- package/dist/src/services/worker/runner.d.ts +37 -0
- package/dist/src/services/worker/runner.d.ts.map +1 -0
- package/dist/src/services/worker/runner.js +319 -0
- package/dist/src/services/worker/runner.js.map +1 -0
- package/dist/src/services/worker/types.d.ts +63 -0
- package/dist/src/services/worker/types.d.ts.map +1 -0
- package/dist/src/services/worker/types.js +38 -0
- package/dist/src/services/worker/types.js.map +1 -0
- package/dist/src/srpc/SrpcByteStream.d.ts +60 -0
- package/dist/src/srpc/SrpcByteStream.d.ts.map +1 -0
- package/dist/src/srpc/SrpcByteStream.js +237 -0
- package/dist/src/srpc/SrpcByteStream.js.map +1 -0
- package/dist/src/srpc/SrpcClient.d.ts +67 -0
- package/dist/src/srpc/SrpcClient.d.ts.map +1 -0
- package/dist/src/srpc/SrpcClient.js +406 -0
- package/dist/src/srpc/SrpcClient.js.map +1 -0
- package/dist/src/srpc/SrpcServer.d.ts +56 -0
- package/dist/src/srpc/SrpcServer.d.ts.map +1 -0
- package/dist/src/srpc/SrpcServer.js +519 -0
- package/dist/src/srpc/SrpcServer.js.map +1 -0
- package/dist/src/srpc/index.d.ts +9 -0
- package/dist/src/srpc/index.d.ts.map +1 -0
- package/dist/src/srpc/index.js +17 -0
- package/dist/src/srpc/index.js.map +1 -0
- package/dist/src/srpc/observer.d.ts +21 -0
- package/dist/src/srpc/observer.d.ts.map +1 -0
- package/dist/src/srpc/observer.js +22 -0
- package/dist/src/srpc/observer.js.map +1 -0
- package/dist/src/srpc/types.d.ts +92 -0
- package/dist/src/srpc/types.d.ts.map +1 -0
- package/dist/src/srpc/types.js +28 -0
- package/dist/src/srpc/types.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +3 -0
- package/dist/src/telemetry/index.d.ts.map +1 -0
- package/dist/src/telemetry/index.js +22 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/otel/helpers.d.ts +45 -0
- package/dist/src/telemetry/otel/helpers.d.ts.map +1 -0
- package/dist/src/telemetry/otel/helpers.js +142 -0
- package/dist/src/telemetry/otel/helpers.js.map +1 -0
- package/dist/src/telemetry/otel/index.d.ts +22 -0
- package/dist/src/telemetry/otel/index.d.ts.map +1 -0
- package/dist/src/telemetry/otel/index.js +268 -0
- package/dist/src/telemetry/otel/index.js.map +1 -0
- package/dist/src/telemetry/otel/metrics.controller.d.ts +5 -0
- package/dist/src/telemetry/otel/metrics.controller.d.ts.map +1 -0
- package/dist/src/telemetry/otel/metrics.controller.js +82 -0
- package/dist/src/telemetry/otel/metrics.controller.js.map +1 -0
- package/dist/src/telemetry/otel/metrics.d.ts +2 -0
- package/dist/src/telemetry/otel/metrics.d.ts.map +1 -0
- package/dist/src/telemetry/otel/metrics.js +16 -0
- package/dist/src/telemetry/otel/metrics.js.map +1 -0
- package/dist/src/telemetry/sentry.d.ts +9 -0
- package/dist/src/telemetry/sentry.d.ts.map +1 -0
- package/dist/src/telemetry/sentry.js +63 -0
- package/dist/src/telemetry/sentry.js.map +1 -0
- package/dist/src/testing/database-readiness.d.ts +11 -0
- package/dist/src/testing/database-readiness.d.ts.map +1 -0
- package/dist/src/testing/database-readiness.js +102 -0
- package/dist/src/testing/database-readiness.js.map +1 -0
- package/dist/src/testing/expect.d.ts +21 -0
- package/dist/src/testing/expect.d.ts.map +1 -0
- package/dist/src/testing/expect.js +110 -0
- package/dist/src/testing/expect.js.map +1 -0
- package/dist/src/testing/fixtures.d.ts +18 -0
- package/dist/src/testing/fixtures.d.ts.map +1 -0
- package/dist/src/testing/fixtures.js +46 -0
- package/dist/src/testing/fixtures.js.map +1 -0
- package/dist/src/testing/index.d.ts +143 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +993 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/testing/mysql-session-manager-process.d.ts +3 -0
- package/dist/src/testing/mysql-session-manager-process.d.ts.map +1 -0
- package/dist/src/testing/mysql-session-manager-process.js +77 -0
- package/dist/src/testing/mysql-session-manager-process.js.map +1 -0
- package/dist/src/testing/mysql-session-manager.d.ts +59 -0
- package/dist/src/testing/mysql-session-manager.d.ts.map +1 -0
- package/dist/src/testing/mysql-session-manager.js +910 -0
- package/dist/src/testing/mysql-session-manager.js.map +1 -0
- package/dist/src/testing/sql.d.ts +47 -0
- package/dist/src/testing/sql.d.ts.map +1 -0
- package/dist/src/testing/sql.js +313 -0
- package/dist/src/testing/sql.js.map +1 -0
- package/dist/src/type-compiler/go/ast_expression.go +161 -0
- package/dist/src/type-compiler/go/ast_metadata.go +355 -0
- package/dist/src/type-compiler/go/collect.go +806 -0
- package/dist/src/type-compiler/go/emission_plan.go +205 -0
- package/dist/src/type-compiler/go/emit_ast.go +406 -0
- package/dist/src/type-compiler/go/emit_ast_test.go +248 -0
- package/dist/src/type-compiler/go/go.mod +10 -0
- package/dist/src/type-compiler/go/plugin.go +308 -0
- package/dist/src/type-compiler/go/plugin_test.go +752 -0
- package/dist/src/type-compiler/go/precompute.go +86 -0
- package/dist/src/type-compiler/go/receive_type.go +837 -0
- package/dist/src/type-compiler/go/resolve.go +265 -0
- package/dist/src/type-compiler/go/source_scan.go +51 -0
- package/dist/src/type-compiler/go/text_parse.go +671 -0
- package/dist/src/type-compiler/go/type_expr.go +1227 -0
- package/dist/src/type-compiler/go/typia_expr.go +2119 -0
- package/dist/src/type-compiler/index.cjs +6 -0
- package/dist/src/types/index.d.ts +7 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +14 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/phone.d.ts +6 -0
- package/dist/src/types/phone.d.ts.map +1 -0
- package/dist/src/types/phone.js +64 -0
- package/dist/src/types/phone.js.map +1 -0
- package/dist/src/types/primitives.d.ts +33 -0
- package/dist/src/types/primitives.d.ts.map +1 -0
- package/dist/src/types/primitives.js +5 -0
- package/dist/src/types/primitives.js.map +1 -0
- package/dist/src/types/runtime.d.ts +5 -0
- package/dist/src/types/runtime.d.ts.map +1 -0
- package/dist/src/types/runtime.js +20 -0
- package/dist/src/types/runtime.js.map +1 -0
- package/dist/src/types/type-annotations.d.ts +28 -0
- package/dist/src/types/type-annotations.d.ts.map +1 -0
- package/dist/src/types/type-annotations.js +33 -0
- package/dist/src/types/type-annotations.js.map +1 -0
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +7 -0
- package/dist/src/types.js.map +1 -0
- package/docs/.vitepress/config.mts +85 -0
- package/docs/content/CONTRIBUTING.md +53 -0
- package/docs/content/README-DEV.md +59 -0
- package/docs/content/README.md +52 -0
- package/docs/content/authentication.md +213 -0
- package/docs/content/cli.md +214 -0
- package/docs/content/configuration.md +191 -0
- package/docs/content/database.md +476 -0
- package/docs/content/devconsole.md +148 -0
- package/docs/content/di.md +212 -0
- package/docs/content/documentation-plan.md +182 -0
- package/docs/content/env.md +120 -0
- package/docs/content/getting-started.md +324 -0
- package/docs/content/health.md +64 -0
- package/docs/content/helpers.md +294 -0
- package/docs/content/http.md +402 -0
- package/docs/content/index.md +109 -0
- package/docs/content/leader-service.md +98 -0
- package/docs/content/logging.md +225 -0
- package/docs/content/mail.md +171 -0
- package/docs/content/mesh-client.md +333 -0
- package/docs/content/mesh-service.md +255 -0
- package/docs/content/migrations.md +190 -0
- package/docs/content/openapi.md +134 -0
- package/docs/content/overview.md +98 -0
- package/docs/content/public/images/devconsole/01-dashboard.png +0 -0
- package/docs/content/public/images/devconsole/02-routes.png +0 -0
- package/docs/content/public/images/devconsole/03-openapi.png +0 -0
- package/docs/content/public/images/devconsole/04-requests.png +0 -0
- package/docs/content/public/images/devconsole/05-srpc.png +0 -0
- package/docs/content/public/images/devconsole/06-database.png +0 -0
- package/docs/content/public/images/devconsole/06b-database-log.png +0 -0
- package/docs/content/public/images/devconsole/07-health.png +0 -0
- package/docs/content/public/images/devconsole/08-mutex.png +0 -0
- package/docs/content/public/images/devconsole/09-repl.png +0 -0
- package/docs/content/public/images/devconsole/10-workers.png +0 -0
- package/docs/content/public-api.md +84 -0
- package/docs/content/redis.md +174 -0
- package/docs/content/reflection.md +180 -0
- package/docs/content/release.md +100 -0
- package/docs/content/sql.md +121 -0
- package/docs/content/srpc.md +292 -0
- package/docs/content/telemetry.md +173 -0
- package/docs/content/testing.md +327 -0
- package/docs/content/type-reflection-architecture.md +149 -0
- package/docs/content/types.md +286 -0
- package/docs/content/uploads.md +145 -0
- package/docs/content/worker.md +182 -0
- package/docs/openapi.md +3 -0
- package/package.json +124 -0
- package/resources/proto/devconsole.proto +286 -0
- package/template-app/.env.development +10 -0
- package/template-app/gitignore.tmpl +11 -0
- package/template-app/package.json.tmpl +25 -0
- package/template-app/src/app.ts +13 -0
- package/template-app/src/config.ts +5 -0
- package/template-app/src/controllers/Example.controller.ts +19 -0
- package/template-app/src/database.ts +5 -0
- package/template-app/src/entities/Example.entity.ts +9 -0
- package/template-app/src/index.ts +7 -0
- package/template-app/src/migrations/.gitkeep +2 -0
- package/template-app/src/services/Example.service.ts +20 -0
- package/template-app/tests/app.spec.ts +8 -0
- package/template-app/tsconfig.json +26 -0
- package/template-app/tsconfig.test.json +5 -0
- package/types.d.ts +4 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__tsfTypeAliases = exports.validationRegistry = void 0;
|
|
4
|
+
exports.validate = validate;
|
|
5
|
+
exports.deserialize = deserialize;
|
|
6
|
+
exports.validatedDeserialize = validatedDeserialize;
|
|
7
|
+
exports.assert = assert;
|
|
8
|
+
exports.is = is;
|
|
9
|
+
exports.cast = cast;
|
|
10
|
+
exports.resolveReceiveType = resolveReceiveType;
|
|
11
|
+
const annotations_1 = require("./annotations");
|
|
12
|
+
const errors_1 = require("./errors");
|
|
13
|
+
const reflection_class_1 = require("./reflection-class");
|
|
14
|
+
const deserializer_1 = require("./deserializer");
|
|
15
|
+
const type_utils_1 = require("./type-utils");
|
|
16
|
+
const model_1 = require("./model");
|
|
17
|
+
const runtimeValidators = new Map();
|
|
18
|
+
exports.validationRegistry = {
|
|
19
|
+
register(name, validator) {
|
|
20
|
+
runtimeValidators.set(name, validator);
|
|
21
|
+
},
|
|
22
|
+
get(name) {
|
|
23
|
+
return runtimeValidators.get(name);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function validate(value, target) {
|
|
27
|
+
const type = resolveTargetType(value, target);
|
|
28
|
+
if (!type)
|
|
29
|
+
return [];
|
|
30
|
+
return validateValue(value, type);
|
|
31
|
+
}
|
|
32
|
+
function deserialize(value, type) {
|
|
33
|
+
if (!type)
|
|
34
|
+
throw new Error('deserialize<T>() was not transformed by the metadata compiler');
|
|
35
|
+
(0, type_utils_1.normalizeTypeMetadata)(type);
|
|
36
|
+
return deserializeValue(value, type);
|
|
37
|
+
}
|
|
38
|
+
function validatedDeserialize(value, _a, _b, _c, type) {
|
|
39
|
+
if (!type)
|
|
40
|
+
throw new Error('validatedDeserialize<T>() requires reflected type metadata');
|
|
41
|
+
(0, type_utils_1.normalizeTypeMetadata)(type);
|
|
42
|
+
const result = deserializeValue(value, type);
|
|
43
|
+
const errors = validateValue(result, type);
|
|
44
|
+
if (errors.length)
|
|
45
|
+
throw errors[0];
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
function assert(value, _deserializer, type) {
|
|
49
|
+
if (!type)
|
|
50
|
+
throw new Error('assert<T>() requires explicit reflected type metadata');
|
|
51
|
+
(0, type_utils_1.normalizeTypeMetadata)(type);
|
|
52
|
+
const errors = validateValue(value, type);
|
|
53
|
+
if (errors.length)
|
|
54
|
+
throw errors[0];
|
|
55
|
+
}
|
|
56
|
+
function is(value, _deserializer, type) {
|
|
57
|
+
if (!type)
|
|
58
|
+
throw new Error('is<T>() requires explicit reflected type metadata');
|
|
59
|
+
(0, type_utils_1.normalizeTypeMetadata)(type);
|
|
60
|
+
return validateValue(value, type).length === 0;
|
|
61
|
+
}
|
|
62
|
+
function cast(value, _deserializer, _a, _b, type) {
|
|
63
|
+
if (!type)
|
|
64
|
+
throw new Error('cast<T>() requires explicit reflected type metadata');
|
|
65
|
+
(0, type_utils_1.normalizeTypeMetadata)(type);
|
|
66
|
+
return deserializeValue(value, type);
|
|
67
|
+
}
|
|
68
|
+
function resolveReceiveType(value) {
|
|
69
|
+
if ((0, model_1.isReflectedType)(value))
|
|
70
|
+
return value;
|
|
71
|
+
throw new Error('Unsupported receive type payload');
|
|
72
|
+
}
|
|
73
|
+
function resolveTargetType(value, target) {
|
|
74
|
+
if ((0, model_1.isReflectedType)(target)) {
|
|
75
|
+
(0, type_utils_1.normalizeTypeMetadata)(target);
|
|
76
|
+
return target;
|
|
77
|
+
}
|
|
78
|
+
if (typeof target === 'function')
|
|
79
|
+
return (0, reflection_class_1.readClassMetadata)(target);
|
|
80
|
+
if (value && typeof value === 'object')
|
|
81
|
+
return (0, reflection_class_1.readClassMetadata)(value.constructor);
|
|
82
|
+
}
|
|
83
|
+
function validateValue(value, type, path = '') {
|
|
84
|
+
const errors = [];
|
|
85
|
+
const concrete = (0, type_utils_1.unwrapValueType)(type);
|
|
86
|
+
const knownPrimitive = (0, annotations_1.knownPrimitiveKind)(concrete);
|
|
87
|
+
if (value === undefined) {
|
|
88
|
+
if (!(0, type_utils_1.allowsUndefined)(type))
|
|
89
|
+
errors.push(new errors_1.ValidatorError('required', 'The value is required.', path));
|
|
90
|
+
return errors;
|
|
91
|
+
}
|
|
92
|
+
if (value === null) {
|
|
93
|
+
if (!(0, type_utils_1.allowsNull)(type))
|
|
94
|
+
errors.push(new errors_1.ValidatorError('required', 'The value cannot be null.', path));
|
|
95
|
+
return errors;
|
|
96
|
+
}
|
|
97
|
+
if (knownPrimitive === model_1.ReflectionKind.string) {
|
|
98
|
+
if (typeof value !== 'string')
|
|
99
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be a string.', path));
|
|
100
|
+
}
|
|
101
|
+
else if (knownPrimitive === model_1.ReflectionKind.number) {
|
|
102
|
+
if (typeof value !== 'number' || Number.isNaN(value))
|
|
103
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be a number.', path));
|
|
104
|
+
}
|
|
105
|
+
else if (knownPrimitive === model_1.ReflectionKind.boolean) {
|
|
106
|
+
if (typeof value !== 'boolean')
|
|
107
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be a boolean.', path));
|
|
108
|
+
}
|
|
109
|
+
else if (concrete.kind === model_1.ReflectionKind.undefined || concrete.kind === model_1.ReflectionKind.null || concrete.kind === model_1.ReflectionKind.never) {
|
|
110
|
+
errors.push(new errors_1.ValidatorError('type', 'The value does not match the required type.', path));
|
|
111
|
+
}
|
|
112
|
+
else if (concrete.kind === model_1.ReflectionKind.string || concrete.kind === model_1.ReflectionKind.templateLiteral) {
|
|
113
|
+
if (typeof value !== 'string')
|
|
114
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be a string.', path));
|
|
115
|
+
}
|
|
116
|
+
else if (concrete.kind === model_1.ReflectionKind.number) {
|
|
117
|
+
if (typeof value !== 'number' || Number.isNaN(value))
|
|
118
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be a number.', path));
|
|
119
|
+
}
|
|
120
|
+
else if (concrete.kind === model_1.ReflectionKind.boolean) {
|
|
121
|
+
if (typeof value !== 'boolean')
|
|
122
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be a boolean.', path));
|
|
123
|
+
}
|
|
124
|
+
else if (concrete.kind === model_1.ReflectionKind.array) {
|
|
125
|
+
if (!Array.isArray(value)) {
|
|
126
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be an array.', path));
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
value.forEach((item, index) => {
|
|
130
|
+
errors.push(...validateValue(item, concrete.type, (0, type_utils_1.joinPath)(path, String(index))));
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (concrete.kind === model_1.ReflectionKind.tuple) {
|
|
135
|
+
if (!Array.isArray(value)) {
|
|
136
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be an array.', path));
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
concrete.types.forEach((item, index) => {
|
|
140
|
+
errors.push(...validateValue(value[index], item.type, (0, type_utils_1.joinPath)(path, String(index))));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else if (concrete.kind === model_1.ReflectionKind.union) {
|
|
145
|
+
const branchErrors = concrete.types.map(item => validateValue(value, item, path));
|
|
146
|
+
const matches = branchErrors.some(item => item.length === 0);
|
|
147
|
+
if (!matches) {
|
|
148
|
+
const best = branchErrors.filter(item => item.length > 0).sort((a, b) => a.length - b.length)[0];
|
|
149
|
+
if (best?.length)
|
|
150
|
+
errors.push(...best);
|
|
151
|
+
else
|
|
152
|
+
errors.push(new errors_1.ValidatorError('type', 'The value does not match any allowed type.', path));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (concrete.kind === model_1.ReflectionKind.objectLiteral) {
|
|
156
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
157
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be an object.', path));
|
|
158
|
+
return errors;
|
|
159
|
+
}
|
|
160
|
+
const record = value;
|
|
161
|
+
const propertyNames = new Set();
|
|
162
|
+
for (const property of (0, type_utils_1.objectLiteralPropertiesFromType)(concrete)) {
|
|
163
|
+
propertyNames.add(String(property.name));
|
|
164
|
+
const propertyPath = (0, type_utils_1.joinPath)(path, String(property.name));
|
|
165
|
+
if (record[property.name] === undefined && property.optional)
|
|
166
|
+
continue;
|
|
167
|
+
errors.push(...validateValue(record[property.name], property.type, propertyPath));
|
|
168
|
+
}
|
|
169
|
+
const indexType = (0, type_utils_1.objectLiteralIndexType)(concrete);
|
|
170
|
+
if (indexType) {
|
|
171
|
+
for (const [key, item] of Object.entries(record)) {
|
|
172
|
+
if (!propertyNames.has(key))
|
|
173
|
+
errors.push(...validateValue(item, indexType, (0, type_utils_1.joinPath)(path, key)));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (concrete.kind === model_1.ReflectionKind.literal) {
|
|
178
|
+
if (value !== concrete.literal)
|
|
179
|
+
errors.push(new errors_1.ValidatorError('type', `The value must be ${String(concrete.literal)}.`, path));
|
|
180
|
+
}
|
|
181
|
+
else if (concrete.kind === model_1.ReflectionKind.enum) {
|
|
182
|
+
if (!concrete.values.includes(value))
|
|
183
|
+
errors.push(new errors_1.ValidatorError('type', 'The value does not match any allowed enum value.', path));
|
|
184
|
+
}
|
|
185
|
+
else if (concrete.kind === model_1.ReflectionKind.class) {
|
|
186
|
+
const Target = (0, type_utils_1.tryResolveClassType)(concrete.classType);
|
|
187
|
+
if (!Target) {
|
|
188
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
189
|
+
errors.push(new errors_1.ValidatorError('type', 'The value must be an object.', path));
|
|
190
|
+
}
|
|
191
|
+
return errors;
|
|
192
|
+
}
|
|
193
|
+
if (Target === Date) {
|
|
194
|
+
// Built-ins can carry validation annotations but do not have project metadata.
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
const reflection = reflection_class_1.ReflectionClass.from(Target);
|
|
198
|
+
const record = value;
|
|
199
|
+
for (const property of reflection.getProperties()) {
|
|
200
|
+
if (record[String(property.name)] === undefined && property.isOptional())
|
|
201
|
+
continue;
|
|
202
|
+
errors.push(...validateValue(record[String(property.name)], property.getType(), (0, type_utils_1.joinPath)(path, String(property.name))));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
for (const annotation of annotations_1.validationAnnotation.getAnnotations(type)) {
|
|
207
|
+
if (annotation.name === 'minLength' && typeof value === 'string') {
|
|
208
|
+
const min = (0, type_utils_1.literalNumber)(annotation.args[0]);
|
|
209
|
+
if (min !== undefined && value.length < min)
|
|
210
|
+
errors.push(new errors_1.ValidatorError('minLength', `The value must be at least ${min} characters.`, path));
|
|
211
|
+
}
|
|
212
|
+
else if (annotation.name === 'maxLength' && typeof value === 'string') {
|
|
213
|
+
const max = (0, type_utils_1.literalNumber)(annotation.args[0]);
|
|
214
|
+
if (max !== undefined && value.length > max)
|
|
215
|
+
errors.push(new errors_1.ValidatorError('maxLength', `The value must be at most ${max} characters.`, path));
|
|
216
|
+
}
|
|
217
|
+
else if (annotation.name === 'minimum' && typeof value === 'number') {
|
|
218
|
+
const min = (0, type_utils_1.literalNumber)(annotation.args[0]);
|
|
219
|
+
if (min !== undefined && value < min)
|
|
220
|
+
errors.push(new errors_1.ValidatorError('minimum', `The value must be at least ${min}.`, path));
|
|
221
|
+
}
|
|
222
|
+
else if (annotation.name === 'greaterThan' && typeof value === 'number') {
|
|
223
|
+
const min = (0, type_utils_1.literalNumber)(annotation.args[0]);
|
|
224
|
+
if (min !== undefined && value <= min)
|
|
225
|
+
errors.push(new errors_1.ValidatorError('greaterThan', `The value must be greater than ${min}.`, path));
|
|
226
|
+
}
|
|
227
|
+
else if (annotation.name === 'maximum' && typeof value === 'number') {
|
|
228
|
+
const max = (0, type_utils_1.literalNumber)(annotation.args[0]);
|
|
229
|
+
if (max !== undefined && value > max)
|
|
230
|
+
errors.push(new errors_1.ValidatorError('maximum', `The value must be at most ${max}.`, path));
|
|
231
|
+
}
|
|
232
|
+
else if (annotation.name === 'lessThan' && typeof value === 'number') {
|
|
233
|
+
const max = (0, type_utils_1.literalNumber)(annotation.args[0]);
|
|
234
|
+
if (max !== undefined && value >= max)
|
|
235
|
+
errors.push(new errors_1.ValidatorError('lessThan', `The value must be less than ${max}.`, path));
|
|
236
|
+
}
|
|
237
|
+
else if (annotation.name === 'pattern' && typeof value === 'string') {
|
|
238
|
+
const pattern = (0, type_utils_1.resolveRuntimeValue)(annotation.args[0]);
|
|
239
|
+
const regexp = typeof pattern === 'string' ? new RegExp(pattern) : pattern instanceof RegExp ? pattern : undefined;
|
|
240
|
+
if (regexp && !regexp.test(value))
|
|
241
|
+
errors.push(new errors_1.ValidatorError('pattern', 'The value does not match the required pattern.', path));
|
|
242
|
+
}
|
|
243
|
+
else if (annotation.name === 'validate') {
|
|
244
|
+
const validator = (0, type_utils_1.resolveRuntimeValue)(annotation.args[0]);
|
|
245
|
+
if (typeof validator === 'function') {
|
|
246
|
+
const result = validator(value);
|
|
247
|
+
if (result instanceof errors_1.ValidatorError)
|
|
248
|
+
errors.push(new errors_1.ValidatorError(result.code, result.message, path));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else if (annotation.name === 'validator') {
|
|
252
|
+
const name = (0, type_utils_1.resolveRuntimeValue)(annotation.args[0]);
|
|
253
|
+
const validator = typeof name === 'string' ? exports.validationRegistry.get(name) : undefined;
|
|
254
|
+
if (validator) {
|
|
255
|
+
const result = validator(value);
|
|
256
|
+
if (result instanceof errors_1.ValidatorError)
|
|
257
|
+
errors.push(new errors_1.ValidatorError(result.code, result.message, path));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return errors;
|
|
262
|
+
}
|
|
263
|
+
function deserializeValue(value, type) {
|
|
264
|
+
if (value === null || value === undefined)
|
|
265
|
+
return value;
|
|
266
|
+
if (type.kind === model_1.ReflectionKind.intersection) {
|
|
267
|
+
const mergedObject = (0, type_utils_1.mergedIntersectionObjectLiteral)(type);
|
|
268
|
+
if (mergedObject && value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {
|
|
269
|
+
return deserializer_1.deserializer.apply(type, deserializeValue(value, mergedObject));
|
|
270
|
+
}
|
|
271
|
+
let result = value;
|
|
272
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {
|
|
273
|
+
const output = {};
|
|
274
|
+
let merged = false;
|
|
275
|
+
for (const item of type.types) {
|
|
276
|
+
const part = deserializeValue(value, item);
|
|
277
|
+
if (part && typeof part === 'object' && !Array.isArray(part) && !(part instanceof Date)) {
|
|
278
|
+
Object.assign(output, part);
|
|
279
|
+
merged = true;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
result = merged ? output : value;
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
for (const item of type.types)
|
|
286
|
+
result = deserializeValue(result, item);
|
|
287
|
+
}
|
|
288
|
+
return deserializer_1.deserializer.apply(type, result);
|
|
289
|
+
}
|
|
290
|
+
const concrete = (0, type_utils_1.unwrapValueType)(type);
|
|
291
|
+
let result = value;
|
|
292
|
+
if (concrete.kind === model_1.ReflectionKind.number && typeof value === 'string' && value.trim() !== '') {
|
|
293
|
+
result = Number(value);
|
|
294
|
+
}
|
|
295
|
+
else if (concrete.kind === model_1.ReflectionKind.boolean && typeof value === 'string') {
|
|
296
|
+
if (value === 'true' || value === '1')
|
|
297
|
+
result = true;
|
|
298
|
+
else if (value === 'false' || value === '0')
|
|
299
|
+
result = false;
|
|
300
|
+
}
|
|
301
|
+
else if (concrete.kind === model_1.ReflectionKind.enum && typeof value === 'string') {
|
|
302
|
+
const numeric = Number(value);
|
|
303
|
+
if (!Number.isNaN(numeric) && concrete.values.includes(numeric))
|
|
304
|
+
result = numeric;
|
|
305
|
+
}
|
|
306
|
+
else if (concrete.kind === model_1.ReflectionKind.array && Array.isArray(value)) {
|
|
307
|
+
result = value.map(item => deserializeValue(item, concrete.type));
|
|
308
|
+
}
|
|
309
|
+
else if (concrete.kind === model_1.ReflectionKind.tuple && Array.isArray(value)) {
|
|
310
|
+
result = concrete.types.map((item, index) => deserializeValue(value[index], item.type));
|
|
311
|
+
}
|
|
312
|
+
else if (concrete.kind === model_1.ReflectionKind.union) {
|
|
313
|
+
for (const item of concrete.types) {
|
|
314
|
+
const candidate = deserializeValue(value, item);
|
|
315
|
+
if (validateValue(candidate, item).length === 0) {
|
|
316
|
+
result = candidate;
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else if (concrete.kind === model_1.ReflectionKind.class) {
|
|
322
|
+
const Target = (0, type_utils_1.tryResolveClassType)(concrete.classType);
|
|
323
|
+
if (!Target)
|
|
324
|
+
return deserializer_1.deserializer.apply(type, value);
|
|
325
|
+
if (Target === Date)
|
|
326
|
+
return deserializer_1.deserializer.apply(type, value instanceof Date ? value : new Date(value));
|
|
327
|
+
if (typeof value !== 'object')
|
|
328
|
+
return deserializer_1.deserializer.apply(type, value);
|
|
329
|
+
const output = new Target();
|
|
330
|
+
const input = value;
|
|
331
|
+
for (const property of reflection_class_1.ReflectionClass.from(Target).getProperties()) {
|
|
332
|
+
output[String(property.name)] = deserializeValue(input[String(property.name)], property.getType());
|
|
333
|
+
}
|
|
334
|
+
result = output;
|
|
335
|
+
}
|
|
336
|
+
else if (concrete.kind === model_1.ReflectionKind.objectLiteral && typeof value === 'object') {
|
|
337
|
+
const properties = (0, type_utils_1.objectLiteralPropertiesFromType)(concrete);
|
|
338
|
+
const indexType = (0, type_utils_1.objectLiteralIndexType)(concrete);
|
|
339
|
+
if (properties.length === 0 && !indexType)
|
|
340
|
+
return deserializer_1.deserializer.apply(type, value);
|
|
341
|
+
const input = value;
|
|
342
|
+
const output = {};
|
|
343
|
+
const propertyNames = new Set();
|
|
344
|
+
for (const property of properties) {
|
|
345
|
+
const name = String(property.name);
|
|
346
|
+
propertyNames.add(name);
|
|
347
|
+
output[name] = deserializeValue(input[name], property.type);
|
|
348
|
+
}
|
|
349
|
+
if (indexType) {
|
|
350
|
+
for (const [key, item] of Object.entries(input)) {
|
|
351
|
+
if (!propertyNames.has(key))
|
|
352
|
+
output[key] = deserializeValue(item, indexType);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
result = output;
|
|
356
|
+
}
|
|
357
|
+
return deserializer_1.deserializer.apply(type, result);
|
|
358
|
+
}
|
|
359
|
+
exports.__tsfTypeAliases = ({ "RuntimeValidator": { kind: 2, typeName: "(value: unknown) => ValidatorError | undefined | void", typeName: "RuntimeValidator" } });
|
|
360
|
+
//# sourceMappingURL=conversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversion.js","sourceRoot":"","sources":["../../../src/reflection/conversion.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,+CAAyE;AACzE,qCAA0C;AAC1C,yDAAwE;AACxE,iDAA8C;AAC9C,6CAYsB;AACtB,mCAAqF;AAIrF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEjD,QAAA,kBAAkB,GAAG;IAC9B,QAAQ,CAAC,IAAY,EAAE,SAA2B;QAC9C,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED,GAAG,CAAC,IAAY;QACZ,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAC;AAEF,kBAA4B,KAAc,EAAE,MAA4B;IACpE,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,qBAA+B,KAAc,EAAE,IAAW;IACtD,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IAC5F,IAAA,kCAAqB,EAAC,IAAI,CAAC,CAAC;IAC5B,OAA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are class DeserializerRegistry {
|
|
4
|
+
private readonly decorators;
|
|
5
|
+
addDecorator(predicate: (type: Type) => boolean, handler: DeserializeHandler): void;
|
|
6
|
+
apply(type: Type, value: unknown): unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare class DeserializerState {
|
|
9
|
+
private transforms;
|
|
10
|
+
addTransform(transform: (value: unknown) => unknown): void;
|
|
11
|
+
apply(value: unknown): unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare const deserializer: DeserializerRegistry;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=deserializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deserializer.d.ts","sourceRoot":"","sources":["../../../src/reflection/deserializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAEzE,qBAAa,oBAAoB;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAGlB;IAET,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAElF;IAED,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CASzC;CACJ;AAED,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,UAAU,CAAuC;IAEzD,YAAY,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,CAEzD;IAED,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE7B;CACJ;AAED,eAAO,MAAM,YAAY,sBAA6B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__tsfTypeAliases = exports.deserializer = exports.DeserializerState = exports.DeserializerRegistry = void 0;
|
|
4
|
+
let _DeserializerRegistryMetadata_1;
|
|
5
|
+
class DeserializerRegistry {
|
|
6
|
+
decorators = [];
|
|
7
|
+
addDecorator(predicate, handler) {
|
|
8
|
+
this.decorators.push({ predicate, handler });
|
|
9
|
+
}
|
|
10
|
+
apply(type, value) {
|
|
11
|
+
let result = value;
|
|
12
|
+
for (const decorator of this.decorators) {
|
|
13
|
+
if (!decorator.predicate(type))
|
|
14
|
+
continue;
|
|
15
|
+
const state = new DeserializerState();
|
|
16
|
+
decorator.handler(type, state);
|
|
17
|
+
result = state.apply(result);
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
static __tsfType = _DeserializerRegistryMetadata_1 = ({ kind: 16, name: "DeserializerRegistry", typeName: "DeserializerRegistry", classType: () => DeserializerRegistry, properties: [], methods: [{ name: "addDecorator", parameters: [{ name: "predicate", type: { kind: 2, typeName: "(type: Type) => boolean" }, optional: false, default: false }, { name: "handler", type: { kind: 2, typeName: "(type: Type, state: DeserializerState) => void", typeName: "DeserializeHandler" }, optional: false, default: false }], returnType: { kind: 3 } }, { name: "apply", parameters: [{ name: "type", type: { kind: 12, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 12, types: [{ kind: 16, typeName: "ReflectionKind.never", classType: () => ReflectionKind.never }, { kind: 16, typeName: "ReflectionKind.any", classType: () => ReflectionKind.any }, { kind: 16, typeName: "ReflectionKind.unknown", classType: () => ReflectionKind.unknown }, { kind: 16, typeName: "ReflectionKind.void", classType: () => ReflectionKind.void }, { kind: 16, typeName: "ReflectionKind.undefined", classType: () => ReflectionKind.undefined }, { kind: 16, typeName: "ReflectionKind.null", classType: () => ReflectionKind.null }, { kind: 16, typeName: "ReflectionKind.string", classType: () => ReflectionKind.string }, { kind: 16, typeName: "ReflectionKind.number", classType: () => ReflectionKind.number }, { kind: 16, typeName: "ReflectionKind.boolean", classType: () => ReflectionKind.boolean }, { kind: 16, typeName: "ReflectionKind.bigint", classType: () => ReflectionKind.bigint }, { kind: 16, typeName: "ReflectionKind.object", classType: () => ReflectionKind.object }, { kind: 16, typeName: "ReflectionKind.method", classType: () => ReflectionKind.method }, { kind: 16, typeName: "ReflectionKind.templateLiteral", classType: () => ReflectionKind.templateLiteral }], typeName: "PrimitiveReflectionKind" }], typeName: "TypePrimitive" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.literal", classType: () => ReflectionKind.literal }] }, { kind: 18, types: [{ kind: 20, name: "literal", type: { kind: 2 }, optional: false }] }], typeName: "TypeLiteral" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.enum", classType: () => ReflectionKind.enum }] }, { kind: 18, types: [{ kind: 20, name: "values", type: { kind: 14, type: { kind: 2 } }, optional: false }] }], typeName: "TypeEnum" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.union", classType: () => ReflectionKind.union }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" } }, optional: false }] }], typeName: "TypeUnion" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.intersection", classType: () => ReflectionKind.intersection }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" } }, optional: false }] }], typeName: "TypeIntersection" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.array", classType: () => ReflectionKind.array }] }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, optional: false }] }], typeName: "TypeArray" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.promise", classType: () => ReflectionKind.promise }] }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, optional: false }] }], typeName: "TypePromise" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.tuple", classType: () => ReflectionKind.tuple }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 13, types: [{ kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, optional: false }] }], typeName: "TypeTupleEntry" } }, optional: false }] }], typeName: "TypeTuple" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.class", classType: () => ReflectionKind.class }] }, { kind: 18, types: [{ kind: 20, name: "classType", type: { kind: 2, typeName: "ClassType" }, optional: false }] }], typeName: "TypeClass" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.objectLiteral", classType: () => ReflectionKind.objectLiteral }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 18, typeName: "TypePropertySignature", types: [{ kind: 20, name: "kind", type: { kind: 2, typeName: "K" }, optional: false }, { kind: 20, name: "typeName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "description", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "parent", type: { kind: 12, types: [{ kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "annotations", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }], index: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "validation", type: { kind: 12, types: [{ kind: 14, type: { kind: 18, typeName: "ValidationAnnotation", types: [{ kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "args", type: { kind: 14, type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" } }, optional: false }] } }, { kind: 4 }] }, optional: true }, { kind: 20, name: "database", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }], index: { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "kind", type: { kind: 16, typeName: "ReflectionKind.propertySignature", classType: () => ReflectionKind.propertySignature }, optional: false }, { kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 7 }, { kind: 2, typeName: "symbol" }] }, optional: false }, { kind: 20, name: "type", type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, optional: false }, { kind: 20, name: "optional", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }] } }, optional: false }, { kind: 20, name: "index", type: { kind: 12, types: [{ kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "implements", type: { kind: 12, types: [{ kind: 14, type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" } }, { kind: 4 }] }, optional: true }] }], typeName: "TypeObjectLiteral" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.property", classType: () => ReflectionKind.property }] }, { kind: 18, types: [{ kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 7 }, { kind: 2, typeName: "symbol" }] }, optional: false }, { kind: 20, name: "type", type: { kind: 12, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 12, types: [{ kind: 16, typeName: "ReflectionKind.never", classType: () => ReflectionKind.never }, { kind: 16, typeName: "ReflectionKind.any", classType: () => ReflectionKind.any }, { kind: 16, typeName: "ReflectionKind.unknown", classType: () => ReflectionKind.unknown }, { kind: 16, typeName: "ReflectionKind.void", classType: () => ReflectionKind.void }, { kind: 16, typeName: "ReflectionKind.undefined", classType: () => ReflectionKind.undefined }, { kind: 16, typeName: "ReflectionKind.null", classType: () => ReflectionKind.null }, { kind: 16, typeName: "ReflectionKind.string", classType: () => ReflectionKind.string }, { kind: 16, typeName: "ReflectionKind.number", classType: () => ReflectionKind.number }, { kind: 16, typeName: "ReflectionKind.boolean", classType: () => ReflectionKind.boolean }, { kind: 16, typeName: "ReflectionKind.bigint", classType: () => ReflectionKind.bigint }, { kind: 16, typeName: "ReflectionKind.object", classType: () => ReflectionKind.object }, { kind: 16, typeName: "ReflectionKind.method", classType: () => ReflectionKind.method }, { kind: 16, typeName: "ReflectionKind.templateLiteral", classType: () => ReflectionKind.templateLiteral }], typeName: "PrimitiveReflectionKind" }], typeName: "TypePrimitive" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.literal", classType: () => ReflectionKind.literal }] }, { kind: 18, types: [{ kind: 20, name: "literal", type: { kind: 2 }, optional: false }] }], typeName: "TypeLiteral" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.enum", classType: () => ReflectionKind.enum }] }, { kind: 18, types: [{ kind: 20, name: "values", type: { kind: 14, type: { kind: 2 } }, optional: false }] }], typeName: "TypeEnum" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.union", classType: () => ReflectionKind.union }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 2, typeName: "Type" } }, optional: false }] }], typeName: "TypeUnion" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.intersection", classType: () => ReflectionKind.intersection }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 2, typeName: "Type" } }, optional: false }] }], typeName: "TypeIntersection" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.array", classType: () => ReflectionKind.array }] }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 2, typeName: "Type" }, optional: false }] }], typeName: "TypeArray" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.promise", classType: () => ReflectionKind.promise }] }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 2, typeName: "Type" }, optional: false }] }], typeName: "TypePromise" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.tuple", classType: () => ReflectionKind.tuple }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 13, types: [{ kind: 2, typeName: "Type" }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 2, typeName: "Type" }, optional: false }] }], typeName: "TypeTupleEntry" } }, optional: false }] }], typeName: "TypeTuple" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.class", classType: () => ReflectionKind.class }] }, { kind: 18, types: [{ kind: 20, name: "classType", type: { kind: 2, typeName: "ClassType" }, optional: false }] }], typeName: "TypeClass" }, { kind: 13, types: [{ kind: 16, typeName: "TypeBase", classType: () => (typeof TypeBase !== "undefined" ? TypeBase : (typeof exports !== "undefined" ? exports.TypeBase : undefined)), typeArguments: [{ kind: 16, typeName: "ReflectionKind.objectLiteral", classType: () => ReflectionKind.objectLiteral }] }, { kind: 18, types: [{ kind: 20, name: "types", type: { kind: 14, type: { kind: 18, typeName: "TypePropertySignature", types: [{ kind: 20, name: "kind", type: { kind: 2, typeName: "K" }, optional: false }, { kind: 20, name: "typeName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "description", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "parent", type: { kind: 12, types: [{ kind: 2, typeName: "Type" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "annotations", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2, typeName: "Type" }], index: { kind: 2, typeName: "Type" }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "validation", type: { kind: 12, types: [{ kind: 14, type: { kind: 18, typeName: "ValidationAnnotation", types: [{ kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "args", type: { kind: 14, type: { kind: 2, typeName: "Type" } }, optional: false }] } }, { kind: 4 }] }, optional: true }, { kind: 20, name: "database", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }], index: { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "kind", type: { kind: 16, typeName: "ReflectionKind.propertySignature", classType: () => ReflectionKind.propertySignature }, optional: false }, { kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 7 }, { kind: 2, typeName: "symbol" }] }, optional: false }, { kind: 20, name: "type", type: { kind: 2, typeName: "Type" }, optional: false }, { kind: 20, name: "optional", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }] } }, optional: false }, { kind: 20, name: "index", type: { kind: 12, types: [{ kind: 2, typeName: "Type" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "implements", type: { kind: 12, types: [{ kind: 14, type: { kind: 2, typeName: "Type" } }, { kind: 4 }] }, optional: true }] }], typeName: "TypeObjectLiteral" }, { kind: 2, typeName: "TypeBase<ReflectionKind.property> & {\n name: string | number | symbol;\n type: Type;\n optional?: boolean;\n}", typeName: "TypeProperty" }, { kind: 18, typeName: "TypePropertySignature", types: [{ kind: 20, name: "kind", type: { kind: 2, typeName: "K" }, optional: false }, { kind: 20, name: "typeName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "description", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "parent", type: { kind: 12, types: [{ kind: 2, typeName: "Type" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "annotations", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2, typeName: "Type" }], index: { kind: 2, typeName: "Type" }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "validation", type: { kind: 12, types: [{ kind: 14, type: { kind: 18, typeName: "ValidationAnnotation", types: [{ kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "args", type: { kind: 14, type: { kind: 2, typeName: "Type" } }, optional: false }] } }, { kind: 4 }] }, optional: true }, { kind: 20, name: "database", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }], index: { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "kind", type: { kind: 16, typeName: "ReflectionKind.propertySignature", classType: () => ReflectionKind.propertySignature }, optional: false }, { kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 7 }, { kind: 2, typeName: "symbol" }] }, optional: false }, { kind: 20, name: "type", type: { kind: 2, typeName: "Type" }, optional: false }, { kind: 20, name: "optional", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }] }], typeName: "Type" }, optional: false }, { kind: 20, name: "optional", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }] }], typeName: "TypeProperty" }, { kind: 18, typeName: "TypePropertySignature", types: [{ kind: 20, name: "kind", type: { kind: 2, typeName: "K" }, optional: false }, { kind: 20, name: "typeName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "description", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "parent", type: { kind: 12, types: [{ kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "annotations", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }], index: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "validation", type: { kind: 12, types: [{ kind: 14, type: { kind: 18, typeName: "ValidationAnnotation", types: [{ kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "args", type: { kind: 14, type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" } }, optional: false }] } }, { kind: 4 }] }, optional: true }, { kind: 20, name: "database", type: { kind: 12, types: [{ kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }], index: { kind: 18, typeName: "Record", utilityType: "Record", typeArguments: [{ kind: 6 }, { kind: 1 }], index: { kind: 1 }, types: [] }, types: [] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "kind", type: { kind: 16, typeName: "ReflectionKind.propertySignature", classType: () => ReflectionKind.propertySignature }, optional: false }, { kind: 20, name: "name", type: { kind: 12, types: [{ kind: 6 }, { kind: 7 }, { kind: 2, typeName: "symbol" }] }, optional: false }, { kind: 20, name: "type", type: { kind: 2, typeName: "| TypePrimitive\n | TypeLiteral\n | TypeEnum\n | TypeUnion\n | TypeIntersection\n | TypeArray\n | TypePromise\n | TypeTuple\n | TypeClass\n | TypeObjectLiteral\n | TypeProperty\n | TypePropertySignature", typeName: "Type" }, optional: false }, { kind: 20, name: "optional", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }] }], typeName: "Type" }, optional: false, default: false }, { name: "value", type: { kind: 2 }, optional: false, default: false }], returnType: { kind: 2 } }], hasConstructor: false, constructorParameters: [] });
|
|
22
|
+
}
|
|
23
|
+
exports.DeserializerRegistry = DeserializerRegistry;
|
|
24
|
+
_DeserializerRegistryMetadata_1.classType = DeserializerRegistry;
|
|
25
|
+
DeserializerRegistry.__tsfType = _DeserializerRegistryMetadata_1;
|
|
26
|
+
let _DeserializerStateMetadata_1;
|
|
27
|
+
class DeserializerState {
|
|
28
|
+
transforms = [];
|
|
29
|
+
addTransform(transform) {
|
|
30
|
+
this.transforms.push(transform);
|
|
31
|
+
}
|
|
32
|
+
apply(value) {
|
|
33
|
+
return this.transforms.reduce((current, transform) => transform(current), value);
|
|
34
|
+
}
|
|
35
|
+
static __tsfType = _DeserializerStateMetadata_1 = ({ kind: 16, name: "DeserializerState", typeName: "DeserializerState", classType: () => DeserializerState, properties: [], methods: [{ name: "addTransform", parameters: [{ name: "transform", type: { kind: 2, typeName: "(value: unknown) => unknown" }, optional: false, default: false }], returnType: { kind: 3 } }, { name: "apply", parameters: [{ name: "value", type: { kind: 2 }, optional: false, default: false }], returnType: { kind: 2 } }], hasConstructor: false, constructorParameters: [] });
|
|
36
|
+
}
|
|
37
|
+
exports.DeserializerState = DeserializerState;
|
|
38
|
+
_DeserializerStateMetadata_1.classType = DeserializerState;
|
|
39
|
+
DeserializerState.__tsfType = _DeserializerStateMetadata_1;
|
|
40
|
+
exports.deserializer = new DeserializerRegistry();
|
|
41
|
+
exports.__tsfTypeAliases = ({ "DeserializeHandler": { kind: 2, typeName: "(type: Type, state: DeserializerState) => void", typeName: "DeserializeHandler" } });
|
|
42
|
+
//# sourceMappingURL=deserializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deserializer.js","sourceRoot":"","sources":["../../../src/reflection/deserializer.ts"],"names":[],"mappings":";;;;AAIA;IACqB,UAAU,GAGrB,EAAE,CAAC;IAET,YAAY,CAAC,SAAkC,EAAE,OAA2B;QACxE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,IAAU,EAAE,KAAc;QAC5B,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACtC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC;gBAAE,SAAS;YACzC,MAAM,KAAK,GAAG,IAAI,iBAAiB,EAAE,CAAC;YACtC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC/B,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;;CACJ;;;;;AAED;IACY,UAAU,GAAoC,EAAE,CAAC;IAEzD,YAAY,CAAC,SAAsC;QAC/C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,KAAc;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;IACrF,CAAC;;CACJ;;;;AAEY,QAAA,YAAY,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type EntityClassDecorator } from './metadata-store';
|
|
2
|
+
type EntityDecorator = (<T extends Function>(target: T) => T) & {
|
|
3
|
+
name(name: string): EntityClassDecorator;
|
|
4
|
+
index(names: readonly (string | number | symbol)[], options?: Record<string, any>): EntityClassDecorator;
|
|
5
|
+
excludeMigration(): EntityClassDecorator;
|
|
6
|
+
};
|
|
7
|
+
export declare const entity: EntityDecorator;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/reflection/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAsC,KAAK,oBAAoB,EAAsB,MAAM,kBAAkB,CAAC;AAErH,KAAK,eAAe,GAAG,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG;IAC5D,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACzC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,oBAAoB,CAAC;IACzG,gBAAgB,IAAI,oBAAoB,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,MAAM,EAGd,eAAe,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__tsfTypeAliases = exports.entity = void 0;
|
|
4
|
+
const reflection_class_1 = require("./reflection-class");
|
|
5
|
+
const metadata_store_1 = require("./metadata-store");
|
|
6
|
+
exports.entity = function entityDecorator(target) {
|
|
7
|
+
applyClassOptions(target, {});
|
|
8
|
+
return target;
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports.entity, 'name', {
|
|
11
|
+
configurable: true,
|
|
12
|
+
value(name) {
|
|
13
|
+
return createEntityDecorator({ collectionName: name });
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports.entity, 'index', {
|
|
17
|
+
configurable: true,
|
|
18
|
+
value(names, options = {}) {
|
|
19
|
+
return createEntityDecorator({ indexes: [{ names: [...names], options }] });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports.entity, 'excludeMigration', {
|
|
23
|
+
configurable: true,
|
|
24
|
+
value() {
|
|
25
|
+
return createEntityDecorator({ excludeMigration: true });
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
function ensureClassOptions(target) {
|
|
29
|
+
let options = metadata_store_1.classOptions.get(target);
|
|
30
|
+
if (!options) {
|
|
31
|
+
options = {};
|
|
32
|
+
metadata_store_1.classOptions.set(target, options);
|
|
33
|
+
}
|
|
34
|
+
return options;
|
|
35
|
+
}
|
|
36
|
+
function createEntityDecorator(options) {
|
|
37
|
+
const decorator = function compatibleEntityDecorator(target) {
|
|
38
|
+
applyClassOptions(target, options);
|
|
39
|
+
return target;
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(decorator, 'index', {
|
|
42
|
+
configurable: true,
|
|
43
|
+
value(names, indexOptions = {}) {
|
|
44
|
+
return createEntityDecorator({
|
|
45
|
+
...options,
|
|
46
|
+
indexes: [...(options.indexes ?? []), { names: [...names], options: indexOptions }]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(decorator, 'excludeMigration', {
|
|
51
|
+
configurable: true,
|
|
52
|
+
value() {
|
|
53
|
+
return createEntityDecorator({
|
|
54
|
+
...options,
|
|
55
|
+
excludeMigration: true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return decorator;
|
|
60
|
+
}
|
|
61
|
+
function applyClassOptions(target, incoming) {
|
|
62
|
+
const options = ensureClassOptions(target);
|
|
63
|
+
if (incoming.collectionName)
|
|
64
|
+
options.collectionName = incoming.collectionName;
|
|
65
|
+
if (incoming.indexes?.length)
|
|
66
|
+
options.indexes = [...(options.indexes ?? []), ...incoming.indexes];
|
|
67
|
+
if (incoming.excludeMigration)
|
|
68
|
+
options.excludeMigration = true;
|
|
69
|
+
const metadata = (0, reflection_class_1.readClassMetadata)(target);
|
|
70
|
+
if (metadata)
|
|
71
|
+
(0, metadata_store_1.applyMetadataOptions)(metadata, options);
|
|
72
|
+
}
|
|
73
|
+
exports.__tsfTypeAliases = ({ "EntityDecorator": { kind: 2, typeName: "(<T extends Function>(target: T) => T) & {\n name(name: string): EntityClassDecorator;\n index(names: readonly (string | number | symbol)[], options?: Record<string, any>): EntityClassDecorator;\n excludeMigration(): EntityClassDecorator;\n}", typeName: "EntityDecorator" } });
|
|
74
|
+
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/reflection/entity.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AACvD,qDAAqH;AAQxG,QAAA,MAAM,GAAG,SAAS,eAAe,CAAqB,MAAS;IACxE,iBAAiB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9B,OAAO,MAAM,CAAC;AAClB,CAAoB,CAAC;AAErB,MAAM,CAAC,cAAc,CAAC,QAAA,MAAM,EAAE,MAAM,EAAE;IAClC,YAAY,EAAE,IAAI;IAClB,KAAK,CAAC,IAAY;QACd,OAAO,qBAAqB,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAA,MAAM,EAAE,OAAO,EAAE;IACnC,YAAY,EAAE,IAAI;IAClB,KAAK,CAAC,KAA4C,EAAE,OAAO,GAAwB,EAAE;QACjF,OAAO,qBAAqB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAChF,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAA,MAAM,EA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C;AAED,SAAS,iBAAiB,CAAC,MAAgB,EAAE,QAAuB;IAChE,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,QAAQ,CAAC,cAAc;QAAE,OAAO,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAC9E,IAAI,QAAQ,CAAC,OAAO,EAAE,MAAM;QAAE,OAAO,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClG,IAAI,QAAQ,CAAC,gBAAgB;QAAE,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE/D,MAAM,QAAQ,GAAG,IAAA,oCAAiB,EAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,QAAQ;QAAE,IAAA,qCAAoB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class ValidatorError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly errors: ValidatorError[];
|
|
5
|
+
constructor(code: string, message: string, path?: string);
|
|
6
|
+
}
|
|
7
|
+
export { ValidatorError as ValidationError };
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/reflection/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAe,SAAQ,KAAK;aAIjB,IAAI,EAAE,MAAM;aAEZ,IAAI,EAAE,MAAM;IALhC,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IAElC,YACoB,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM,EACC,IAAI,GAAE,MAAW,EAIpC;CACJ;AAED,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,CAAC"}
|