@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,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JobEntity = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const reflection_1 = require("../../reflection");
|
|
6
|
+
const database_1 = require("../../database");
|
|
7
|
+
let _JobEntityMetadata_1;
|
|
8
|
+
let JobEntity = class JobEntity extends database_1.BaseEntity {
|
|
9
|
+
id;
|
|
10
|
+
queue;
|
|
11
|
+
queueId;
|
|
12
|
+
attempt;
|
|
13
|
+
name;
|
|
14
|
+
data;
|
|
15
|
+
traceId;
|
|
16
|
+
status;
|
|
17
|
+
result;
|
|
18
|
+
createdAt;
|
|
19
|
+
shouldExecuteAt;
|
|
20
|
+
executedAt;
|
|
21
|
+
completedAt;
|
|
22
|
+
static __tsfType = _JobEntityMetadata_1 = ({ kind: 16, name: "JobEntity", typeName: "JobEntity", classType: () => JobEntity, properties: [{ name: "id", type: { kind: 13, types: [{ kind: 6 }, { kind: 18, typeName: "PrimaryKey", types: [{ kind: 20, name: "typia.tag", type: { kind: 12, types: [{ kind: 18, types: [{ kind: 20, name: "target", type: { kind: 12, types: [{ kind: 10, literal: "boolean" }, { kind: 10, literal: "bigint" }, { kind: 10, literal: "number" }, { kind: 10, literal: "string" }, { kind: 10, literal: "array" }, { kind: 10, literal: "object" }], typeName: "TypiaTagTarget" }, optional: false }, { kind: 20, name: "kind", type: { kind: 10, literal: "database:primaryKey" }, optional: false }, { kind: 20, name: "value", type: { kind: 10, literal: true }, optional: false }] }, { kind: 4 }] }, optional: true }], typeName: "PrimaryKey" }, { kind: 2, typeName: "MaxLength", validation: [{ name: "maxLength", args: [{ kind: 10, literal: 191 }] }] }] }, optional: false, primaryKey: true }, { name: "queue", type: { kind: 13, types: [{ kind: 6 }, { kind: 2, typeName: "MaxLength", validation: [{ name: "maxLength", args: [{ kind: 10, literal: 191 }] }] }] }, optional: false }, { name: "queueId", type: { kind: 13, types: [{ kind: 6 }, { kind: 2, typeName: "MaxLength", validation: [{ name: "maxLength", args: [{ kind: 10, literal: 191 }] }] }] }, optional: false }, { name: "attempt", type: { kind: 13, types: [{ kind: 7 }, { kind: 2, typeName: "TypeAnnotation", annotations: { "tsf:type": { kind: 10, literal: "integer" } } }], typeName: "integer" }, optional: false }, { name: "name", type: { kind: 13, types: [{ kind: 6 }, { kind: 2, typeName: "MaxLength", validation: [{ name: "maxLength", args: [{ kind: 10, literal: 191 }] }] }] }, optional: false }, { name: "data", type: { kind: 12, types: [{ kind: 2 }, { kind: 5 }] }, optional: false }, { name: "traceId", type: { kind: 12, types: [{ kind: 13, types: [{ kind: 6 }, { kind: 2, typeName: "MaxLength", validation: [{ name: "maxLength", args: [{ kind: 10, literal: 64 }] }] }] }, { kind: 5 }] }, optional: false }, { name: "status", type: { kind: 13, types: [{ kind: 12, types: [{ kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }] }, { kind: 2, typeName: "MaxLength", validation: [{ name: "maxLength", args: [{ kind: 10, literal: 32 }] }] }] }, optional: false }, { name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 5 }] }, optional: false }, { name: "createdAt", type: { kind: 13, types: [{ kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, { kind: 2, typeName: "MySQL", database: { mysql: { type: "datetime(3)" } } }] }, optional: false }, { name: "shouldExecuteAt", type: { kind: 13, types: [{ kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, { kind: 2, typeName: "MySQL", database: { mysql: { type: "datetime(3)" } } }] }, optional: false }, { name: "executedAt", type: { kind: 13, types: [{ kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, { kind: 2, typeName: "MySQL", database: { mysql: { type: "datetime(3)" } } }] }, optional: false }, { name: "completedAt", type: { kind: 13, types: [{ kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, { kind: 2, typeName: "MySQL", database: { mysql: { type: "datetime(3)" } } }] }, optional: false }], methods: [], hasConstructor: false, constructorParameters: [] });
|
|
23
|
+
};
|
|
24
|
+
exports.JobEntity = JobEntity;
|
|
25
|
+
exports.JobEntity = JobEntity = tslib_1.__decorate([
|
|
26
|
+
reflection_1.entity.name('_jobs')
|
|
27
|
+
], JobEntity);
|
|
28
|
+
_JobEntityMetadata_1.classType = JobEntity;
|
|
29
|
+
JobEntity.__tsfType = _JobEntityMetadata_1;
|
|
30
|
+
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../../src/services/worker/entity.ts"],"names":[],"mappings":";;;;AAAA,iDAA0C;AAG1C,6CAA4C;;AAGrC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,qBAAU;IACrC,EAAE,CAAwC;IAC1C,KAAK,CAA2B;IAChC,OAAO,CAA2B;IAClC,OAAO,CAAW;IAClB,IAAI,CAA2B;IAC/B,IAAI,CAAkB;IACtB,OAAO,CAAmC;IAC1C,MAAM,CAA4C;IAClD,MAAM,CAAkB;IACxB,SAAS,CAAyC;IAClD,eAAe,CAAyC;IACxD,UAAU,CAAyC;IACnD,WAAW,CAAyC;;CACvD,CAAA;;oBAdY,SAAS;IADrB,mBAAM,CAAC,IAAI,CAAC,OAAO,CAAC;GACR,SAAS,CAcrB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseAppConfig } from '../../app';
|
|
2
|
+
import { ScopedLogger } from '../logger';
|
|
3
|
+
import { WorkerQueueRegistry } from './queue';
|
|
4
|
+
import { WorkerRunnerService, type WorkerExecutionResult } from './runner';
|
|
5
|
+
import { BaseJob, InputDataSymbol, type IJobOptions, type JobClass, type QueuedWorkerJob } from './types';
|
|
6
|
+
export * from './entity';
|
|
7
|
+
export * from './queue';
|
|
8
|
+
export * from './recorder';
|
|
9
|
+
export * from './runner';
|
|
10
|
+
export * from './types';
|
|
11
|
+
export * from './observer';
|
|
12
|
+
export declare class WorkerService {
|
|
13
|
+
private readonly config;
|
|
14
|
+
private readonly queueRegistry;
|
|
15
|
+
private readonly runner;
|
|
16
|
+
private readonly logger;
|
|
17
|
+
constructor(config: BaseAppConfig, queueRegistry: WorkerQueueRegistry, runner: WorkerRunnerService, logger: ScopedLogger);
|
|
18
|
+
queueJob<I extends object, O, T extends BaseJob<I, O>>(jobClass: JobClass<I, O> & {
|
|
19
|
+
prototype: T;
|
|
20
|
+
}, data: T[typeof InputDataSymbol], options?: IJobOptions): Promise<QueuedWorkerJob<I> | WorkerExecutionResult<I, O> | undefined>;
|
|
21
|
+
runJob<I extends object, O, T extends BaseJob<I, O>>(jobClass: JobClass<I, O> & {
|
|
22
|
+
prototype: T;
|
|
23
|
+
}, data: T[typeof InputDataSymbol], options?: IJobOptions): Promise<WorkerExecutionResult<I, O>>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1G,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAE3B,qBAAa,aAAa;IAElB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJ3B,YACqB,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,mBAAmB,EAClC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,YAAY,EACrC;IAEE,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACvD,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,SAAS,EAAE,CAAC,CAAA;KAAE,EAC3C,IAAI,EAAE,CAAC,CAAC,OAAO,eAAe,CAAC,EAC/B,OAAO,GAAE,WAAgB,GAC1B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAoBvE;IAEK,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACrD,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,SAAS,EAAE,CAAC,CAAA;KAAE,EAC3C,IAAI,EAAE,CAAC,CAAC,OAAO,eAAe,CAAC,EAC/B,OAAO,GAAE,WAAgB,GAC1B,OAAO,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAGtC;CACJ"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__tsfTypeAliases = exports.WorkerService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./entity"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./queue"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./recorder"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./runner"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./observer"), exports);
|
|
11
|
+
let _WorkerServiceMetadata_1;
|
|
12
|
+
class WorkerService {
|
|
13
|
+
config;
|
|
14
|
+
queueRegistry;
|
|
15
|
+
runner;
|
|
16
|
+
logger;
|
|
17
|
+
constructor(config, queueRegistry, runner, logger) {
|
|
18
|
+
this.config = config;
|
|
19
|
+
this.queueRegistry = queueRegistry;
|
|
20
|
+
this.runner = runner;
|
|
21
|
+
this.logger = logger;
|
|
22
|
+
}
|
|
23
|
+
async queueJob(jobClass, data, options = {}) {
|
|
24
|
+
if (this.config.APP_ENV === 'test' && options.runInTest !== true) {
|
|
25
|
+
this.logger.warn('Not queueing job in test environment', {
|
|
26
|
+
jobName: jobClass.name,
|
|
27
|
+
data,
|
|
28
|
+
options
|
|
29
|
+
});
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
if (options.runImmediately) {
|
|
33
|
+
const job = this.queueRegistry.add(jobClass, data, options);
|
|
34
|
+
return this.runner.executeQueuedJob(job, options);
|
|
35
|
+
}
|
|
36
|
+
const job = await this.queueRegistry.enqueue(jobClass, data, options);
|
|
37
|
+
this.logger.info('Queued job', { job: { name: job.name, id: job.id, queue: job.queue } });
|
|
38
|
+
if (!this.queueRegistry.usesBullMq())
|
|
39
|
+
this.runner.schedule(job);
|
|
40
|
+
return job;
|
|
41
|
+
}
|
|
42
|
+
async runJob(jobClass, data, options = {}) {
|
|
43
|
+
const job = this.queueRegistry.add(jobClass, data, options);
|
|
44
|
+
return this.runner.executeQueuedJob(job, options);
|
|
45
|
+
}
|
|
46
|
+
static __tsfType = _WorkerServiceMetadata_1 = ({ kind: 16, name: "WorkerService", typeName: "WorkerService", classType: () => WorkerService, properties: [], methods: [{ name: "queueJob", parameters: [{ name: "jobClass", type: { kind: 13, types: [{ kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }, { kind: 2, typeName: "O" }] }, { kind: 18, types: [{ kind: 20, name: "prototype", type: { kind: 2, typeName: "T" }, optional: false }] }] }, optional: false, default: false }, { name: "data", type: { kind: 2, typeName: "T[typeof InputDataSymbol]" }, optional: false, default: false }, { name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: true, default: true }], returnType: { kind: 22, type: { kind: 12, types: [{ kind: 16, typeName: "QueuedWorkerJob", classType: () => (typeof require !== "undefined" ? require("./types").QueuedWorkerJob : undefined), typeArguments: [{ kind: 2, typeName: "I" }] }, { kind: 16, typeName: "WorkerExecutionResult", classType: () => (typeof require !== "undefined" ? require("./runner").WorkerExecutionResult : undefined), typeArguments: [{ kind: 2, typeName: "I" }, { kind: 2, typeName: "O" }] }, { kind: 4 }] } } }, { name: "runJob", parameters: [{ name: "jobClass", type: { kind: 13, types: [{ kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }, { kind: 2, typeName: "O" }] }, { kind: 18, types: [{ kind: 20, name: "prototype", type: { kind: 2, typeName: "T" }, optional: false }] }] }, optional: false, default: false }, { name: "data", type: { kind: 2, typeName: "T[typeof InputDataSymbol]" }, optional: false, default: false }, { name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: true, default: true }], returnType: { kind: 22, type: { kind: 16, typeName: "WorkerExecutionResult", classType: () => (typeof require !== "undefined" ? require("./runner").WorkerExecutionResult : undefined), typeArguments: [{ kind: 2, typeName: "I" }, { kind: 2, typeName: "O" }] } } }], hasConstructor: true, constructorParameters: [{ name: "config", type: { kind: 16, typeName: "BaseAppConfig", classType: () => (typeof require !== "undefined" ? require("../../app/index").BaseAppConfig : undefined) }, optional: false, default: false }, { name: "queueRegistry", type: { kind: 16, typeName: "WorkerQueueRegistry", classType: () => (typeof require !== "undefined" ? require("./queue").WorkerQueueRegistry : undefined) }, optional: false, default: false }, { name: "runner", type: { kind: 16, typeName: "WorkerRunnerService", classType: () => (typeof require !== "undefined" ? require("./runner").WorkerRunnerService : undefined) }, optional: false, default: false }, { name: "logger", type: { kind: 16, typeName: "ScopedLogger", classType: () => (typeof require !== "undefined" ? require("../logger").ScopedLogger : undefined) }, optional: false, default: false }] });
|
|
47
|
+
}
|
|
48
|
+
exports.WorkerService = WorkerService;
|
|
49
|
+
_WorkerServiceMetadata_1.classType = WorkerService;
|
|
50
|
+
WorkerService.__tsfType = _WorkerServiceMetadata_1;
|
|
51
|
+
exports.__tsfTypeAliases = ({ "BaseJobClass": { kind: 18, typeName: "BaseJobClass", types: [{ kind: 20, name: "QUEUE_NAME", type: { kind: 6 }, optional: false }, { kind: 20, name: "CRON_SCHEDULE", type: { kind: 12, types: [{ kind: 6 }, { kind: 5 }] }, optional: false }] }, "BullMqWorkerJobData": { kind: 18, typeName: "BullMqWorkerJobData", types: [{ kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }] }, "IJobOptions": { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, "ParsedCron": { kind: 18, typeName: "ParsedCron", types: [{ kind: 20, name: "seconds", type: { kind: 14, type: { kind: 7 } }, optional: false }, { kind: 20, name: "minutes", type: { kind: 14, type: { kind: 7 } }, optional: false }, { kind: 20, name: "hours", type: { kind: 14, type: { kind: 7 } }, optional: false }, { kind: 20, name: "daysOfMonth", type: { kind: 14, type: { kind: 7 } }, optional: false }, { kind: 20, name: "months", type: { kind: 14, type: { kind: 7 } }, optional: false }, { kind: 20, name: "daysOfWeek", type: { kind: 14, type: { kind: 7 } }, optional: false }] }, "QueuedWorkerJob": { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, "WorkerExecutionResult": { kind: 18, typeName: "WorkerExecutionResult", types: [{ kind: 20, name: "job", type: { kind: 16, typeName: "QueuedWorkerJob", classType: () => (typeof require !== "undefined" ? require("./types").QueuedWorkerJob : undefined), typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "result", type: { kind: 2, typeName: "O" }, optional: false }] }, "WorkerJobOptions": { kind: 18, typeName: "WorkerJobOptions", types: [{ kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queue", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "cronSchedule", type: { kind: 12, types: [{ kind: 12, types: [{ kind: 6 }, { kind: 5 }] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "cron", type: { kind: 12, types: [{ kind: 12, types: [{ kind: 6 }, { kind: 5 }] }, { kind: 4 }] }, optional: true }] }, "WorkerJobRecord": { kind: 18, typeName: "WorkerJobRecord", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "queueId", type: { kind: 6 }, optional: false }, { kind: 20, name: "attempt", type: { kind: 7 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "traceId", type: { kind: 12, types: [{ kind: 6 }, { kind: 5 }] }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }] }, optional: false }, { kind: 20, name: "result", type: { kind: 2, typeName: "O" }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "executedAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "completedAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }] }, "WorkerJobStatus": { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, "WorkerObservation": { kind: 12, types: [{ kind: 18, types: [{ kind: 20, name: "type", type: { kind: 12, types: [{ kind: 10, literal: "added" }, { kind: 10, literal: "active" }, { kind: 10, literal: "delayed" }] }, optional: false }, { kind: 20, name: "job", type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, optional: false }] }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 12, types: [{ kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }] }, optional: false }, { kind: 20, name: "job", type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "record", type: { kind: 18, typeName: "WorkerJobRecord", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "queueId", type: { kind: 6 }, optional: false }, { kind: 20, name: "attempt", type: { kind: 7 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "traceId", type: { kind: 12, types: [{ kind: 6 }, { kind: 5 }] }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }] }, optional: false }, { kind: 20, name: "result", type: { kind: 2, typeName: "O" }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "executedAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "completedAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }] }, optional: false }] }], typeName: "WorkerObservation" }, "WorkerObserver": { kind: 2, typeName: "(entry: WorkerObservation) => void", typeName: "WorkerObserver" } });
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/worker/index.ts"],"names":[],"mappings":";;;;AAMA,mDAAyB;AACzB,kDAAwB;AACxB,qDAA2B;AAC3B,mDAAyB;AACzB,kDAAwB;AACxB,qDAA2B;;AAE3B;IAEyB,MAAM;IACN,aAAa;IACb,MAAM;IACN,MAAM;IAJ3B,YACqB,MAAqB,EACrB,aAAkC,EAClC,MAA2B,EAC3B,MAAoB;sBAHpB,MAAM;6BACN,aAAa;sBACb,MAAM;sBACN,MAAM;IACxB,CAAC;IAEJ,KAAK,CAAC,QAAQ,CACV,QAA2C,EAC3C,IAA+B,EAC/B,OAAO,GAAgB,EAAE;QAEzB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,MAAM,IAAI,OAAO,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YAC/D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE;gBACrD,OAAO,EAAE,QAAQ,CAAC,IAAI;gBACtB,IAAI;gBACJ,OAAO;aACV,CAAC,CAAC;YACH,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;YACzB,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAE1F,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;YAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAChE,OAAO,GAAG,CAAC;IACf,CAAC;IAED,KAAK,CAAC,MAAM,CACR,QAA2C,EAC3C,IAA+B,EAC/B,OAAO,GAAgB,EAAE;QAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { QueuedWorkerJob, WorkerJobRecord } from './types';
|
|
2
|
+
export type WorkerObservation = {
|
|
3
|
+
type: 'added' | 'active' | 'delayed';
|
|
4
|
+
job: QueuedWorkerJob;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'completed' | 'failed';
|
|
7
|
+
job: QueuedWorkerJob;
|
|
8
|
+
record: WorkerJobRecord;
|
|
9
|
+
};
|
|
10
|
+
export type WorkerObserver = (entry: WorkerObservation) => void;
|
|
11
|
+
export declare function registerWorkerObserver(observer: WorkerObserver): () => void;
|
|
12
|
+
export declare function notifyWorkerObservers(entry: WorkerObservation): void;
|
|
13
|
+
//# sourceMappingURL=observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/services/worker/observer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IAAC,GAAG,EAAE,eAAe,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC;IAAC,GAAG,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAEtF,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAIhE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI,CAG3E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAQpE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__tsfTypeAliases = void 0;
|
|
4
|
+
exports.registerWorkerObserver = registerWorkerObserver;
|
|
5
|
+
exports.notifyWorkerObservers = notifyWorkerObservers;
|
|
6
|
+
const workerObservers = new Set();
|
|
7
|
+
function registerWorkerObserver(observer) {
|
|
8
|
+
workerObservers.add(observer);
|
|
9
|
+
return () => workerObservers.delete(observer);
|
|
10
|
+
}
|
|
11
|
+
function notifyWorkerObservers(entry) {
|
|
12
|
+
for (const observer of workerObservers) {
|
|
13
|
+
try {
|
|
14
|
+
observer(entry);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Observers must never affect worker execution.
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.__tsfTypeAliases = ({ "WorkerObservation": { kind: 12, types: [{ kind: 18, types: [{ kind: 20, name: "type", type: { kind: 12, types: [{ kind: 10, literal: "added" }, { kind: 10, literal: "active" }, { kind: 10, literal: "delayed" }] }, optional: false }, { kind: 20, name: "job", type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, optional: false }] }, { kind: 18, types: [{ kind: 20, name: "type", type: { kind: 12, types: [{ kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }] }, optional: false }, { kind: 20, name: "job", type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "record", type: { kind: 18, typeName: "WorkerJobRecord", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "queueId", type: { kind: 6 }, optional: false }, { kind: 20, name: "attempt", type: { kind: 7 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "traceId", type: { kind: 12, types: [{ kind: 6 }, { kind: 5 }] }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }] }, optional: false }, { kind: 20, name: "result", type: { kind: 2, typeName: "O" }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "executedAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "completedAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }] }, optional: false }] }], typeName: "WorkerObservation" }, "WorkerObserver": { kind: 2, typeName: "(entry: WorkerObservation) => void", typeName: "WorkerObserver" } });
|
|
22
|
+
//# sourceMappingURL=observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.js","sourceRoot":"","sources":["../../../../src/services/worker/observer.ts"],"names":[],"mappings":";;;;;AAQA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAElD,gCAAuC,QAAwB;IAC3D,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,+BAAsC,KAAwB;IAC1D,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,CAAC;YACD,QAAQ,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACL,gDAAgD;QACpD,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseAppConfig } from '../../app';
|
|
2
|
+
import type { JobClass, QueuedWorkerJob, IJobOptions } from './types';
|
|
3
|
+
import { Queue, type Job as BullJob, type QueueOptions, type WorkerOptions } from 'bullmq';
|
|
4
|
+
export interface BullMqWorkerJobData<I = unknown> {
|
|
5
|
+
data: I;
|
|
6
|
+
options: IJobOptions;
|
|
7
|
+
}
|
|
8
|
+
export declare class WorkerQueueRegistry {
|
|
9
|
+
private readonly config?;
|
|
10
|
+
private static readonly queues;
|
|
11
|
+
private static readonly bullQueues;
|
|
12
|
+
private static nextId;
|
|
13
|
+
private readonly bullQueues;
|
|
14
|
+
constructor(config?: BaseAppConfig | undefined);
|
|
15
|
+
usesBullMq(): boolean;
|
|
16
|
+
getDefaultQueueName(): string;
|
|
17
|
+
getQueueName(jobClass: JobClass, options?: IJobOptions): string;
|
|
18
|
+
enqueue<I>(jobClass: JobClass<I>, data: I, options?: IJobOptions): Promise<QueuedWorkerJob<I>>;
|
|
19
|
+
add<I>(jobClass: JobClass<I>, data: I, options?: IJobOptions): QueuedWorkerJob<I>;
|
|
20
|
+
getQueuedJobs(queue?: string): QueuedWorkerJob[];
|
|
21
|
+
getAllQueuedJobs(): QueuedWorkerJob[];
|
|
22
|
+
markCompleted(job: QueuedWorkerJob, result: unknown): void;
|
|
23
|
+
markFailed(job: QueuedWorkerJob, result: unknown): void;
|
|
24
|
+
remove(job: QueuedWorkerJob): void;
|
|
25
|
+
clear(queue?: string): void;
|
|
26
|
+
getBullQueue(queueName: string): Queue<BullMqWorkerJobData>;
|
|
27
|
+
getBullQueues(): Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
queue: Queue<BullMqWorkerJobData>;
|
|
30
|
+
}>;
|
|
31
|
+
normalizeJobData<I>(data: I | null | undefined): I;
|
|
32
|
+
fromBullJob<I>(job: BullJob<BullMqWorkerJobData<I>>, jobClass: JobClass<I>): QueuedWorkerJob<I>;
|
|
33
|
+
shutdown(): Promise<void>;
|
|
34
|
+
static closeQueues(): Promise<void>;
|
|
35
|
+
getBullMqOptions(): QueueOptions & Pick<WorkerOptions, 'connection' | 'prefix'>;
|
|
36
|
+
private unwrapBullMqJobData;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/services/worker/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE3F,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,OAAO;IAC5C,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,WAAW,CAAC;CACxB;AAED,qBAAa,mBAAmB;IAMhB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IALpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAwC;IACtE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAyC;IAC3E,OAAO,CAAC,MAAM,CAAC,MAAM,CAAK;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiD;IAE5E,YAA6B,MAAM,CAAC,EAAE,aAAa,YAAA,EAAI;IAEvD,UAAU,IAAI,OAAO,CAGpB;IAED,mBAAmB,IAAI,MAAM,CAE5B;IAED,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAE,WAAgB,GAAG,MAAM,CAElE;IAEK,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAuBvG;IAED,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,WAAgB,GAAG,eAAe,CAAC,CAAC,CAAC,CAwBpF;IAED,aAAa,CAAC,KAAK,SAA6B,GAAG,eAAe,EAAE,CAEnE;IAED,gBAAgB,IAAI,eAAe,EAAE,CAEpC;IAED,aAAa,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAGzD;IAED,UAAU,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAGtD;IAED,MAAM,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAMjC;IAED,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAG1B;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAQ1D;IAED,aAAa,IAAI,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAA;KAAE,CAAC,CAE1E;IAED,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,CAEjD;IAED,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAgB9F;IAEK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAI9B;IAED,OAAa,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAKxC;IAED,gBAAgB,IAAI,YAAY,GAAG,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,QAAQ,CAAC,CAoB9E;IAED,OAAO,CAAC,mBAAmB;CAc9B"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__tsfTypeAliases = exports.WorkerQueueRegistry = void 0;
|
|
4
|
+
const redis_1 = require("../../helpers/redis/redis");
|
|
5
|
+
const observer_1 = require("./observer");
|
|
6
|
+
const bullmq_1 = require("bullmq");
|
|
7
|
+
let _WorkerQueueRegistryMetadata_1;
|
|
8
|
+
class WorkerQueueRegistry {
|
|
9
|
+
config;
|
|
10
|
+
static queues = new Map();
|
|
11
|
+
static bullQueues = new Set();
|
|
12
|
+
static nextId = 1;
|
|
13
|
+
bullQueues = new Map();
|
|
14
|
+
constructor(config) {
|
|
15
|
+
this.config = config;
|
|
16
|
+
}
|
|
17
|
+
usesBullMq() {
|
|
18
|
+
if (this.config?.APP_ENV === 'test')
|
|
19
|
+
return false;
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
getDefaultQueueName() {
|
|
23
|
+
return this.config?.BULL_QUEUE ?? 'default';
|
|
24
|
+
}
|
|
25
|
+
getQueueName(jobClass, options = {}) {
|
|
26
|
+
return options.queueName ?? getOwnQueueName(jobClass) ?? this.getDefaultQueueName();
|
|
27
|
+
}
|
|
28
|
+
async enqueue(jobClass, data, options = {}) {
|
|
29
|
+
if (!this.usesBullMq())
|
|
30
|
+
return this.add(jobClass, data, options);
|
|
31
|
+
const queueName = this.getQueueName(jobClass, options);
|
|
32
|
+
const bullJob = await this.getBullQueue(queueName).add(jobClass.name, {
|
|
33
|
+
data,
|
|
34
|
+
options: { ...options }
|
|
35
|
+
}, {
|
|
36
|
+
delay: options.delay,
|
|
37
|
+
removeOnComplete: 1000,
|
|
38
|
+
removeOnFail: 1000
|
|
39
|
+
});
|
|
40
|
+
const job = this.fromBullJob(bullJob, jobClass);
|
|
41
|
+
(0, observer_1.notifyWorkerObservers)({
|
|
42
|
+
type: job.shouldExecuteAt.getTime() > Date.now() ? 'delayed' : 'added',
|
|
43
|
+
job
|
|
44
|
+
});
|
|
45
|
+
return job;
|
|
46
|
+
}
|
|
47
|
+
add(jobClass, data, options = {}) {
|
|
48
|
+
const queue = this.getQueueName(jobClass, options);
|
|
49
|
+
const createdAt = new Date();
|
|
50
|
+
const job = {
|
|
51
|
+
id: String(WorkerQueueRegistry.nextId++),
|
|
52
|
+
queue,
|
|
53
|
+
name: jobClass.name,
|
|
54
|
+
data,
|
|
55
|
+
jobClass,
|
|
56
|
+
options: { ...options },
|
|
57
|
+
createdAt,
|
|
58
|
+
shouldExecuteAt: new Date(createdAt.getTime() + (options.delay ?? 0)),
|
|
59
|
+
attemptsMade: 0,
|
|
60
|
+
status: 'queued'
|
|
61
|
+
};
|
|
62
|
+
const jobs = WorkerQueueRegistry.queues.get(queue) ?? [];
|
|
63
|
+
jobs.push(job);
|
|
64
|
+
WorkerQueueRegistry.queues.set(queue, jobs);
|
|
65
|
+
(0, observer_1.notifyWorkerObservers)({
|
|
66
|
+
type: job.shouldExecuteAt.getTime() > Date.now() ? 'delayed' : 'added',
|
|
67
|
+
job
|
|
68
|
+
});
|
|
69
|
+
return job;
|
|
70
|
+
}
|
|
71
|
+
getQueuedJobs(queue = this.getDefaultQueueName()) {
|
|
72
|
+
return [...(WorkerQueueRegistry.queues.get(queue) ?? [])];
|
|
73
|
+
}
|
|
74
|
+
getAllQueuedJobs() {
|
|
75
|
+
return [...WorkerQueueRegistry.queues.values()].flat();
|
|
76
|
+
}
|
|
77
|
+
markCompleted(job, result) {
|
|
78
|
+
job.status = 'completed';
|
|
79
|
+
job.result = result;
|
|
80
|
+
}
|
|
81
|
+
markFailed(job, result) {
|
|
82
|
+
job.status = 'failed';
|
|
83
|
+
job.result = result;
|
|
84
|
+
}
|
|
85
|
+
remove(job) {
|
|
86
|
+
const jobs = WorkerQueueRegistry.queues.get(job.queue);
|
|
87
|
+
if (!jobs)
|
|
88
|
+
return;
|
|
89
|
+
const remaining = jobs.filter(item => item !== job);
|
|
90
|
+
if (remaining.length)
|
|
91
|
+
WorkerQueueRegistry.queues.set(job.queue, remaining);
|
|
92
|
+
else
|
|
93
|
+
WorkerQueueRegistry.queues.delete(job.queue);
|
|
94
|
+
}
|
|
95
|
+
clear(queue) {
|
|
96
|
+
if (queue)
|
|
97
|
+
WorkerQueueRegistry.queues.delete(queue);
|
|
98
|
+
else
|
|
99
|
+
WorkerQueueRegistry.queues.clear();
|
|
100
|
+
}
|
|
101
|
+
getBullQueue(queueName) {
|
|
102
|
+
const existing = this.bullQueues.get(queueName);
|
|
103
|
+
if (existing)
|
|
104
|
+
return existing;
|
|
105
|
+
const queue = new bullmq_1.Queue(queueName, this.getBullMqOptions());
|
|
106
|
+
this.bullQueues.set(queueName, queue);
|
|
107
|
+
WorkerQueueRegistry.bullQueues.add(queue);
|
|
108
|
+
return queue;
|
|
109
|
+
}
|
|
110
|
+
getBullQueues() {
|
|
111
|
+
return [...this.bullQueues.entries()].map(([name, queue]) => ({ name, queue }));
|
|
112
|
+
}
|
|
113
|
+
normalizeJobData(data) {
|
|
114
|
+
return (data === undefined ? {} : data);
|
|
115
|
+
}
|
|
116
|
+
fromBullJob(job, jobClass) {
|
|
117
|
+
const createdAt = new Date(job.timestamp);
|
|
118
|
+
const delay = typeof job.delay === 'number' ? job.delay : Number(job.opts.delay ?? 0);
|
|
119
|
+
const payload = this.unwrapBullMqJobData(job.data);
|
|
120
|
+
return {
|
|
121
|
+
id: String(job.id ?? ''),
|
|
122
|
+
queue: job.queueName,
|
|
123
|
+
name: job.name,
|
|
124
|
+
data: this.normalizeJobData(payload.data),
|
|
125
|
+
jobClass,
|
|
126
|
+
options: { ...payload.options },
|
|
127
|
+
createdAt,
|
|
128
|
+
shouldExecuteAt: new Date(createdAt.getTime() + delay),
|
|
129
|
+
attemptsMade: job.attemptsMade,
|
|
130
|
+
status: 'queued'
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
async shutdown() {
|
|
134
|
+
await Promise.all([...this.bullQueues.values()].map(queue => queue.close().catch(() => { })));
|
|
135
|
+
for (const queue of this.bullQueues.values())
|
|
136
|
+
WorkerQueueRegistry.bullQueues.delete(queue);
|
|
137
|
+
this.bullQueues.clear();
|
|
138
|
+
}
|
|
139
|
+
static async closeQueues() {
|
|
140
|
+
WorkerQueueRegistry.queues.clear();
|
|
141
|
+
const queues = [...WorkerQueueRegistry.bullQueues];
|
|
142
|
+
WorkerQueueRegistry.bullQueues.clear();
|
|
143
|
+
await Promise.all(queues.map(queue => queue.close().catch(() => { })));
|
|
144
|
+
}
|
|
145
|
+
getBullMqOptions() {
|
|
146
|
+
const config = this.config;
|
|
147
|
+
if (!config) {
|
|
148
|
+
throw new Error('BullMQ workers require app config');
|
|
149
|
+
}
|
|
150
|
+
let options;
|
|
151
|
+
let prefix;
|
|
152
|
+
try {
|
|
153
|
+
({ options, prefix } = (0, redis_1.createRedisOptions)('BULL'));
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
throw new Error('BullMQ workers require REDIS_HOST or REDIS_SENTINEL_HOST (or BULL_REDIS_HOST/BULL_REDIS_SENTINEL_HOST) to be configured', { cause: error });
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
connection: { ...options, maxRetriesPerRequest: null },
|
|
160
|
+
prefix: `${prefix}:bmq`
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
unwrapBullMqJobData(raw) {
|
|
164
|
+
if (isRecord(raw) && isWorkerPayloadWrapper(raw)) {
|
|
165
|
+
const wrapped = raw;
|
|
166
|
+
return {
|
|
167
|
+
data: wrapped.data,
|
|
168
|
+
options: isRecord(wrapped.options) ? { ...wrapped.options } : {}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return { data: raw, options: {} };
|
|
172
|
+
}
|
|
173
|
+
static __tsfType = _WorkerQueueRegistryMetadata_1 = ({ kind: 16, name: "WorkerQueueRegistry", typeName: "WorkerQueueRegistry", classType: () => WorkerQueueRegistry, properties: [], methods: [{ name: "usesBullMq", parameters: [], returnType: { kind: 8 } }, { name: "getDefaultQueueName", parameters: [], returnType: { kind: 6 } }, { name: "getQueueName", parameters: [{ name: "jobClass", type: { kind: 2, typeName: "JobClass" }, optional: false, default: false }, { name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: true, default: true }], returnType: { kind: 6 } }, { name: "enqueue", parameters: [{ name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false, default: false }, { name: "data", type: { kind: 2, typeName: "I" }, optional: false, default: false }, { name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: true, default: true }], returnType: { kind: 22, type: { kind: 16, typeName: "QueuedWorkerJob", classType: () => (typeof require !== "undefined" ? require("./types").QueuedWorkerJob : undefined), typeArguments: [{ kind: 2, typeName: "I" }] } } }, { name: "add", parameters: [{ name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false, default: false }, { name: "data", type: { kind: 2, typeName: "I" }, optional: false, default: false }, { name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: true, default: true }], returnType: { kind: 16, typeName: "QueuedWorkerJob", classType: () => (typeof require !== "undefined" ? require("./types").QueuedWorkerJob : undefined), typeArguments: [{ kind: 2, typeName: "I" }] } }, { name: "getQueuedJobs", parameters: [{ name: "queue", type: { kind: 2 }, optional: true, default: true }], returnType: { kind: 14, type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] } } }, { name: "getAllQueuedJobs", parameters: [], returnType: { kind: 14, type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] } } }, { name: "markCompleted", parameters: [{ name: "job", type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, optional: false, default: false }, { name: "result", type: { kind: 2 }, optional: false, default: false }], returnType: { kind: 3 } }, { name: "markFailed", parameters: [{ name: "job", type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, optional: false, default: false }, { name: "result", type: { kind: 2 }, optional: false, default: false }], returnType: { kind: 3 } }, { name: "remove", parameters: [{ name: "job", type: { kind: 18, typeName: "QueuedWorkerJob", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: { kind: 6 }, optional: false }, { kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }, { kind: 20, name: "createdAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "shouldExecuteAt", type: { kind: 16, typeName: "Date", classType: () => (typeof Date !== "undefined" ? Date : (typeof exports !== "undefined" ? exports.Date : undefined)) }, optional: false }, { kind: 20, name: "attemptsMade", type: { kind: 7 }, optional: false }, { kind: 20, name: "status", type: { kind: 12, types: [{ kind: 10, literal: "queued" }, { kind: 10, literal: "completed" }, { kind: 10, literal: "failed" }, { kind: 10, literal: "skipped" }], typeName: "WorkerJobStatus" }, optional: false }, { kind: 20, name: "result", type: { kind: 12, types: [{ kind: 2 }, { kind: 4 }] }, optional: true }] }, optional: false, default: false }], returnType: { kind: 3 } }, { name: "clear", parameters: [{ name: "queue", type: { kind: 6 }, optional: true, default: false }], returnType: { kind: 3 } }, { name: "getBullQueue", parameters: [{ name: "queueName", type: { kind: 6 }, optional: false, default: false }], returnType: Object.assign((() => { const __tsf_module = (() => {
|
|
174
|
+
try {
|
|
175
|
+
return typeof require !== "undefined" ? require("bullmq") : undefined;
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
})(); const __tsf_alias = __tsf_module && __tsf_module.__tsfTypeAliases && __tsf_module.__tsfTypeAliases["Queue"]; return __tsf_alias ? Object.assign({}, __tsf_alias, { typeName: "Queue" }) : { kind: 16, typeName: "Queue", classType: () => (__tsf_module ? __tsf_module["Queue"] : undefined) }; })(), { typeArguments: [{ kind: 18, typeName: "BullMqWorkerJobData", types: [{ kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }] }] }) }, { name: "getBullQueues", parameters: [], returnType: { kind: 14, type: { kind: 18, types: [{ kind: 20, name: "name", type: { kind: 6 }, optional: false }, { kind: 20, name: "queue", type: Object.assign((() => { const __tsf_module = (() => {
|
|
181
|
+
try {
|
|
182
|
+
return typeof require !== "undefined" ? require("bullmq") : undefined;
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
})(); const __tsf_alias = __tsf_module && __tsf_module.__tsfTypeAliases && __tsf_module.__tsfTypeAliases["Queue"]; return __tsf_alias ? Object.assign({}, __tsf_alias, { typeName: "Queue" }) : { kind: 16, typeName: "Queue", classType: () => (__tsf_module ? __tsf_module["Queue"] : undefined) }; })(), { typeArguments: [{ kind: 18, typeName: "BullMqWorkerJobData", types: [{ kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }] }] }), optional: false }] } } }, { name: "normalizeJobData", parameters: [{ name: "data", type: { kind: 12, types: [{ kind: 2, typeName: "I" }, { kind: 5 }, { kind: 4 }] }, optional: false, default: false }], returnType: { kind: 2, typeName: "I" } }, { name: "fromBullJob", parameters: [{ name: "job", type: Object.assign((() => { const __tsf_module = (() => {
|
|
188
|
+
try {
|
|
189
|
+
return typeof require !== "undefined" ? require("bullmq") : undefined;
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
})(); const __tsf_alias = __tsf_module && __tsf_module.__tsfTypeAliases && __tsf_module.__tsfTypeAliases["Job"]; return __tsf_alias ? Object.assign({}, __tsf_alias, { typeName: "BullJob" }) : { kind: 16, typeName: "BullJob", classType: () => (__tsf_module ? __tsf_module["Job"] : undefined) }; })(), { typeArguments: [{ kind: 16, typeName: "BullMqWorkerJobData", classType: () => (typeof BullMqWorkerJobData !== "undefined" ? BullMqWorkerJobData : (typeof exports !== "undefined" ? exports.BullMqWorkerJobData : undefined)), typeArguments: [{ kind: 2, typeName: "I" }] }] }), optional: false, default: false }, { name: "jobClass", type: { kind: 2, typeName: "JobClass", typeArguments: [{ kind: 2, typeName: "I" }] }, optional: false, default: false }], returnType: { kind: 16, typeName: "QueuedWorkerJob", classType: () => (typeof require !== "undefined" ? require("./types").QueuedWorkerJob : undefined), typeArguments: [{ kind: 2, typeName: "I" }] } }, { name: "shutdown", parameters: [], returnType: { kind: 22, type: { kind: 3 } } }, { name: "getBullMqOptions", parameters: [], returnType: { kind: 13, types: [(() => { const __tsf_module = (() => {
|
|
195
|
+
try {
|
|
196
|
+
return typeof require !== "undefined" ? require("bullmq") : undefined;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
})(); const __tsf_alias = __tsf_module && __tsf_module.__tsfTypeAliases && __tsf_module.__tsfTypeAliases["QueueOptions"]; return __tsf_alias ? Object.assign({}, __tsf_alias, { typeName: "QueueOptions" }) : { kind: 16, typeName: "QueueOptions", classType: () => (__tsf_module ? __tsf_module["QueueOptions"] : undefined) }; })(), { kind: 18, typeName: "Pick", utilityType: "Pick", typeArguments: [(() => { const __tsf_module = (() => {
|
|
202
|
+
try {
|
|
203
|
+
return typeof require !== "undefined" ? require("bullmq") : undefined;
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
})(); const __tsf_alias = __tsf_module && __tsf_module.__tsfTypeAliases && __tsf_module.__tsfTypeAliases["WorkerOptions"]; return __tsf_alias ? Object.assign({}, __tsf_alias, { typeName: "WorkerOptions" }) : { kind: 16, typeName: "WorkerOptions", classType: () => (__tsf_module ? __tsf_module["WorkerOptions"] : undefined) }; })()], utilityKeys: ["connection", "prefix"], types: [] }] } }], hasConstructor: true, constructorParameters: [{ name: "config", type: { kind: 16, typeName: "BaseAppConfig", classType: () => (typeof require !== "undefined" ? require("../../app/index").BaseAppConfig : undefined) }, optional: true, default: false }] });
|
|
209
|
+
}
|
|
210
|
+
exports.WorkerQueueRegistry = WorkerQueueRegistry;
|
|
211
|
+
_WorkerQueueRegistryMetadata_1.classType = WorkerQueueRegistry;
|
|
212
|
+
WorkerQueueRegistry.__tsfType = _WorkerQueueRegistryMetadata_1;
|
|
213
|
+
function getOwnQueueName(jobClass) {
|
|
214
|
+
return Object.prototype.hasOwnProperty.call(jobClass, 'QUEUE_NAME') ? jobClass.QUEUE_NAME : undefined;
|
|
215
|
+
}
|
|
216
|
+
function isRecord(value) {
|
|
217
|
+
return typeof value === 'object' && value !== null;
|
|
218
|
+
}
|
|
219
|
+
function isWorkerPayloadWrapper(value) {
|
|
220
|
+
if (!Object.prototype.hasOwnProperty.call(value, 'options'))
|
|
221
|
+
return false;
|
|
222
|
+
if (Object.prototype.hasOwnProperty.call(value, 'data'))
|
|
223
|
+
return true;
|
|
224
|
+
return isRecord(value.options) && Object.prototype.hasOwnProperty.call(value.options, 'repeatKey');
|
|
225
|
+
}
|
|
226
|
+
exports.__tsfTypeAliases = ({ "BullMqWorkerJobData": { kind: 18, typeName: "BullMqWorkerJobData", types: [{ kind: 20, name: "data", type: { kind: 2, typeName: "I" }, optional: false }, { kind: 20, name: "options", type: { kind: 18, typeName: "IJobOptions", types: [{ kind: 20, name: "delay", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queueName", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runInTest", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "runImmediately", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "recordToDatabase", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "repeatKey", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }] }, optional: false }] } });
|
|
227
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../../src/services/worker/queue.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseDatabase } from '../../database';
|
|
2
|
+
import type { QueuedWorkerJob, WorkerJobRecord } from './types';
|
|
3
|
+
export declare class WorkerRecorderService {
|
|
4
|
+
private readonly db?;
|
|
5
|
+
private readonly records;
|
|
6
|
+
constructor(db?: BaseDatabase | undefined);
|
|
7
|
+
getRecords(): WorkerJobRecord[];
|
|
8
|
+
recordCompleted(job: QueuedWorkerJob, result: unknown, options?: {
|
|
9
|
+
recordToDatabase?: boolean;
|
|
10
|
+
}): Promise<WorkerJobRecord>;
|
|
11
|
+
recordFailed(job: QueuedWorkerJob, result: unknown, options?: {
|
|
12
|
+
recordToDatabase?: boolean;
|
|
13
|
+
}): Promise<WorkerJobRecord>;
|
|
14
|
+
private record;
|
|
15
|
+
private insertRecord;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../src/services/worker/recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEhE,qBAAa,qBAAqB;IAGlB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IAFhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IAEjD,YAA6B,EAAE,CAAC,EAAE,YAAY,YAAA,EAE7C;IAED,UAAU,IAAI,eAAe,EAAE,CAE9B;IAEK,eAAe,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAEnI;IAEK,YAAY,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAEhI;YAEa,MAAM;YA6BN,YAAY;CAmC7B"}
|