@minimaltech/node-infra 0.5.9-21 → 0.5.9-23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/applications/base.application.js +41 -28
- package/dist/base/applications/base.application.js.map +1 -0
- package/dist/base/applications/default.application.js +9 -2
- package/dist/base/applications/default.application.js.map +1 -0
- package/dist/base/applications/index.js +1 -0
- package/dist/base/applications/index.js.map +1 -0
- package/dist/base/base.component.js +3 -2
- package/dist/base/base.component.js.map +1 -0
- package/dist/base/base.helper.js +4 -4
- package/dist/base/base.helper.js.map +1 -0
- package/dist/base/base.provider.js +3 -2
- package/dist/base/base.provider.js.map +1 -0
- package/dist/base/base.sequence.js +27 -17
- package/dist/base/base.sequence.js.map +1 -0
- package/dist/base/controllers/common.js +10 -8
- package/dist/base/controllers/common.js.map +1 -0
- package/dist/base/controllers/crud.controller.js +68 -55
- package/dist/base/controllers/crud.controller.js.map +1 -0
- package/dist/base/controllers/express-request-handler.js +1 -2
- package/dist/base/controllers/express-request-handler.js.map +1 -0
- package/dist/base/controllers/index.js +1 -0
- package/dist/base/controllers/index.js.map +1 -0
- package/dist/base/controllers/kv.controller.js +19 -7
- package/dist/base/controllers/kv.controller.js.map +1 -0
- package/dist/base/controllers/relational.controller.d.ts +3 -1
- package/dist/base/controllers/relational.controller.js +58 -40
- package/dist/base/controllers/relational.controller.js.map +1 -0
- package/dist/base/controllers/service-crud.controller.js +47 -46
- package/dist/base/controllers/service-crud.controller.js.map +1 -0
- package/dist/base/datasources/base.datasource.js +1 -1
- package/dist/base/datasources/base.datasource.js.map +1 -0
- package/dist/base/datasources/index.js +1 -0
- package/dist/base/datasources/index.js.map +1 -0
- package/dist/base/datasources/types.js +1 -0
- package/dist/base/datasources/types.js.map +1 -0
- package/dist/base/index.js +1 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/loopback/@lb/auth/index.js +1 -0
- package/dist/base/loopback/@lb/auth/index.js.map +1 -0
- package/dist/base/loopback/@lb/core/index.js +2 -0
- package/dist/base/loopback/@lb/core/index.js.map +1 -0
- package/dist/base/loopback/@lb/repository/index.js +2 -0
- package/dist/base/loopback/@lb/repository/index.js.map +1 -0
- package/dist/base/loopback/@lb/rest/index.js +1 -0
- package/dist/base/loopback/@lb/rest/index.js.map +1 -0
- package/dist/base/loopback/authentication/index.js +3 -0
- package/dist/base/loopback/authentication/index.js.map +1 -0
- package/dist/base/loopback/authorization/index.js +1 -0
- package/dist/base/loopback/authorization/index.js.map +1 -0
- package/dist/base/loopback/boot/index.js +1 -0
- package/dist/base/loopback/boot/index.js.map +1 -0
- package/dist/base/loopback/core/index.js +1 -0
- package/dist/base/loopback/core/index.js.map +1 -0
- package/dist/base/loopback/filter/index.js +3 -0
- package/dist/base/loopback/filter/index.js.map +1 -0
- package/dist/base/loopback/health-check/index.js +1 -0
- package/dist/base/loopback/health-check/index.js.map +1 -0
- package/dist/base/loopback/http-server/index.js +3 -0
- package/dist/base/loopback/http-server/index.js.map +1 -0
- package/dist/base/loopback/metadata/index.js +1 -0
- package/dist/base/loopback/metadata/index.js.map +1 -0
- package/dist/base/loopback/repository/index.js +1 -0
- package/dist/base/loopback/repository/index.js.map +1 -0
- package/dist/base/loopback/rest/index.js +1 -0
- package/dist/base/loopback/rest/index.js.map +1 -0
- package/dist/base/loopback/security/index.js +1 -0
- package/dist/base/loopback/security/index.js.map +1 -0
- package/dist/base/loopback/service-proxy/index.js +1 -0
- package/dist/base/loopback/service-proxy/index.js.map +1 -0
- package/dist/base/models/base.model.d.ts +7 -0
- package/dist/base/models/base.model.js +24 -5
- package/dist/base/models/base.model.js.map +1 -0
- package/dist/base/models/index.js +1 -0
- package/dist/base/models/index.js.map +1 -0
- package/dist/base/repositories/base.repository.d.ts +3 -0
- package/dist/base/repositories/base.repository.js +25 -5
- package/dist/base/repositories/base.repository.js.map +1 -0
- package/dist/base/repositories/index.js +1 -0
- package/dist/base/repositories/index.js.map +1 -0
- package/dist/base/repositories/relations/has-many-polymorphic/decorator.d.ts +8 -0
- package/dist/base/repositories/relations/has-many-polymorphic/decorator.js +11 -11
- package/dist/base/repositories/relations/has-many-polymorphic/decorator.js.map +1 -0
- package/dist/base/repositories/relations/has-many-polymorphic/factory.d.ts +9 -0
- package/dist/base/repositories/relations/has-many-polymorphic/factory.js +31 -12
- package/dist/base/repositories/relations/has-many-polymorphic/factory.js.map +1 -0
- package/dist/base/repositories/relations/has-many-polymorphic/index.js +1 -0
- package/dist/base/repositories/relations/has-many-polymorphic/index.js.map +1 -0
- package/dist/base/repositories/relations/has-many-polymorphic/types.js +1 -0
- package/dist/base/repositories/relations/has-many-polymorphic/types.js.map +1 -0
- package/dist/base/repositories/relations/index.js +1 -0
- package/dist/base/repositories/relations/index.js.map +1 -0
- package/dist/base/repositories/searchable-tz-crud.repository.js +161 -129
- package/dist/base/repositories/searchable-tz-crud.repository.js.map +1 -0
- package/dist/base/repositories/tz-crud.repository.js +59 -23
- package/dist/base/repositories/tz-crud.repository.js.map +1 -0
- package/dist/base/services/base-crud.service.js +10 -6
- package/dist/base/services/base-crud.service.js.map +1 -0
- package/dist/base/services/base.service.js +3 -2
- package/dist/base/services/base.service.js.map +1 -0
- package/dist/base/services/index.js +1 -0
- package/dist/base/services/index.js.map +1 -0
- package/dist/common/constants.js +90 -81
- package/dist/common/constants.js.map +1 -0
- package/dist/common/environments.js +26 -25
- package/dist/common/environments.js.map +1 -0
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/keys.js +3 -2
- package/dist/common/keys.js.map +1 -0
- package/dist/common/statuses.js +32 -28
- package/dist/common/statuses.js.map +1 -0
- package/dist/common/types.d.ts +3 -0
- package/dist/common/types.js +1 -0
- package/dist/common/types.js.map +1 -0
- package/dist/components/authenticate/common/constants.js +14 -11
- package/dist/components/authenticate/common/constants.js.map +1 -0
- package/dist/components/authenticate/common/index.js +1 -0
- package/dist/components/authenticate/common/index.js.map +1 -0
- package/dist/components/authenticate/common/keys.js +8 -7
- package/dist/components/authenticate/common/keys.js.map +1 -0
- package/dist/components/authenticate/common/types.js +4 -11
- package/dist/components/authenticate/common/types.js.map +1 -0
- package/dist/components/authenticate/component.js +29 -20
- package/dist/components/authenticate/component.js.map +1 -0
- package/dist/components/authenticate/controllers/auth.controller.js +12 -13
- package/dist/components/authenticate/controllers/auth.controller.js.map +1 -0
- package/dist/components/authenticate/controllers/index.js +1 -0
- package/dist/components/authenticate/controllers/index.js.map +1 -0
- package/dist/components/authenticate/controllers/oauth2.controller.js +21 -18
- package/dist/components/authenticate/controllers/oauth2.controller.js.map +1 -0
- package/dist/components/authenticate/index.js +1 -0
- package/dist/components/authenticate/index.js.map +1 -0
- package/dist/components/authenticate/middleware.js +36 -25
- package/dist/components/authenticate/middleware.js.map +1 -0
- package/dist/components/authenticate/models/index.js +1 -0
- package/dist/components/authenticate/models/index.js.map +1 -0
- package/dist/components/authenticate/models/oauth2-client.model.js +4 -8
- package/dist/components/authenticate/models/oauth2-client.model.js.map +1 -0
- package/dist/components/authenticate/models/oauth2-scope.model.js +1 -4
- package/dist/components/authenticate/models/oauth2-scope.model.js.map +1 -0
- package/dist/components/authenticate/models/oauth2-token.model.js +1 -7
- package/dist/components/authenticate/models/oauth2-token.model.js.map +1 -0
- package/dist/components/authenticate/oauth2-handlers/authorization-code.handler.js +6 -4
- package/dist/components/authenticate/oauth2-handlers/authorization-code.handler.js.map +1 -0
- package/dist/components/authenticate/oauth2-handlers/base.js +111 -95
- package/dist/components/authenticate/oauth2-handlers/base.js.map +1 -0
- package/dist/components/authenticate/oauth2-handlers/client-credential.handler.js +4 -2
- package/dist/components/authenticate/oauth2-handlers/client-credential.handler.js.map +1 -0
- package/dist/components/authenticate/oauth2-handlers/index.js +1 -0
- package/dist/components/authenticate/oauth2-handlers/index.js.map +1 -0
- package/dist/components/authenticate/oauth2-handlers/oauth2.js +3 -3
- package/dist/components/authenticate/oauth2-handlers/oauth2.js.map +1 -0
- package/dist/components/authenticate/oauth2-handlers/password.handler.js +1 -0
- package/dist/components/authenticate/oauth2-handlers/password.handler.js.map +1 -0
- package/dist/components/authenticate/repositories/index.js +1 -0
- package/dist/components/authenticate/repositories/index.js.map +1 -0
- package/dist/components/authenticate/repositories/oauth2.repository.js +1 -2
- package/dist/components/authenticate/repositories/oauth2.repository.js.map +1 -0
- package/dist/components/authenticate/services/basic-token.service.js +30 -18
- package/dist/components/authenticate/services/basic-token.service.js.map +1 -0
- package/dist/components/authenticate/services/basic.strategy.js +18 -7
- package/dist/components/authenticate/services/basic.strategy.js.map +1 -0
- package/dist/components/authenticate/services/index.js +1 -0
- package/dist/components/authenticate/services/index.js.map +1 -0
- package/dist/components/authenticate/services/jwt-token.service.js +41 -27
- package/dist/components/authenticate/services/jwt-token.service.js.map +1 -0
- package/dist/components/authenticate/services/jwt.strategy.js +2 -2
- package/dist/components/authenticate/services/jwt.strategy.js.map +1 -0
- package/dist/components/authenticate/services/oauth2.service.js +111 -98
- package/dist/components/authenticate/services/oauth2.service.js.map +1 -0
- package/dist/components/authenticate/services/oauth2.strategy.js +32 -19
- package/dist/components/authenticate/services/oauth2.strategy.js.map +1 -0
- package/dist/components/authorize/adapters/adapter-builder.js +1 -1
- package/dist/components/authorize/adapters/adapter-builder.js.map +1 -0
- package/dist/components/authorize/adapters/base.adapter.js +10 -2
- package/dist/components/authorize/adapters/base.adapter.js.map +1 -0
- package/dist/components/authorize/adapters/casbin-postgres-adapter.helper.js +56 -37
- package/dist/components/authorize/adapters/casbin-postgres-adapter.helper.js.map +1 -0
- package/dist/components/authorize/adapters/casbin-redis-adapter.helper.js +2 -0
- package/dist/components/authorize/adapters/casbin-redis-adapter.helper.js.map +1 -0
- package/dist/components/authorize/adapters/index.js +1 -0
- package/dist/components/authorize/adapters/index.js.map +1 -0
- package/dist/components/authorize/common/constants.js +13 -10
- package/dist/components/authorize/common/constants.js.map +1 -0
- package/dist/components/authorize/common/index.js +1 -0
- package/dist/components/authorize/common/index.js.map +1 -0
- package/dist/components/authorize/common/keys.js +16 -15
- package/dist/components/authorize/common/keys.js.map +1 -0
- package/dist/components/authorize/common/types.js +3 -2
- package/dist/components/authorize/common/types.js.map +1 -0
- package/dist/components/authorize/component.js +60 -44
- package/dist/components/authorize/component.js.map +1 -0
- package/dist/components/authorize/decorators/index.d.ts +11 -0
- package/dist/components/authorize/decorators/index.js +15 -1
- package/dist/components/authorize/decorators/index.js.map +1 -0
- package/dist/components/authorize/index.js +1 -0
- package/dist/components/authorize/index.js.map +1 -0
- package/dist/components/authorize/interceptor.js +81 -76
- package/dist/components/authorize/interceptor.js.map +1 -0
- package/dist/components/authorize/migrations/0000-create-view-policy.js +15 -3
- package/dist/components/authorize/migrations/0000-create-view-policy.js.map +1 -0
- package/dist/components/authorize/migrations/index.js +1 -0
- package/dist/components/authorize/migrations/index.js.map +1 -0
- package/dist/components/authorize/models/defs.js +6 -24
- package/dist/components/authorize/models/defs.js.map +1 -0
- package/dist/components/authorize/models/index.js +1 -0
- package/dist/components/authorize/models/index.js.map +1 -0
- package/dist/components/authorize/models/permission-mapping.model.js +1 -0
- package/dist/components/authorize/models/permission-mapping.model.js.map +1 -0
- package/dist/components/authorize/models/permission.model.js +1 -0
- package/dist/components/authorize/models/permission.model.js.map +1 -0
- package/dist/components/authorize/models/role.model.js +2 -1
- package/dist/components/authorize/models/role.model.js.map +1 -0
- package/dist/components/authorize/models/user-role.model.js +2 -0
- package/dist/components/authorize/models/user-role.model.js.map +1 -0
- package/dist/components/authorize/models/view-authorize-policy.model.js +2 -4
- package/dist/components/authorize/models/view-authorize-policy.model.js.map +1 -0
- package/dist/components/authorize/provider.js +97 -81
- package/dist/components/authorize/provider.js.map +1 -0
- package/dist/components/authorize/repositories/authorize.repository.js +7 -3
- package/dist/components/authorize/repositories/authorize.repository.js.map +1 -0
- package/dist/components/authorize/repositories/index.js +1 -0
- package/dist/components/authorize/repositories/index.js.map +1 -0
- package/dist/components/authorize/services/enforcer.service.js +28 -20
- package/dist/components/authorize/services/enforcer.service.js.map +1 -0
- package/dist/components/authorize/services/generator.service.d.ts +20 -0
- package/dist/components/authorize/services/generator.service.js +97 -62
- package/dist/components/authorize/services/generator.service.js.map +1 -0
- package/dist/components/authorize/services/index.js +1 -0
- package/dist/components/authorize/services/index.js.map +1 -0
- package/dist/components/crash-report/common/constants.js +1 -0
- package/dist/components/crash-report/common/constants.js.map +1 -0
- package/dist/components/crash-report/common/index.js +1 -0
- package/dist/components/crash-report/common/index.js.map +1 -0
- package/dist/components/crash-report/common/keys.js +11 -8
- package/dist/components/crash-report/common/keys.js.map +1 -0
- package/dist/components/crash-report/common/types.js +1 -0
- package/dist/components/crash-report/common/types.js.map +1 -0
- package/dist/components/crash-report/component.js +45 -31
- package/dist/components/crash-report/component.js.map +1 -0
- package/dist/components/crash-report/index.js +1 -0
- package/dist/components/crash-report/index.js.map +1 -0
- package/dist/components/crash-report/providers/index.js +1 -0
- package/dist/components/crash-report/providers/index.js.map +1 -0
- package/dist/components/crash-report/providers/provider.js +1 -1
- package/dist/components/crash-report/providers/provider.js.map +1 -0
- package/dist/components/crash-report/providers/third-parties/base.js +3 -2
- package/dist/components/crash-report/providers/third-parties/base.js.map +1 -0
- package/dist/components/crash-report/providers/third-parties/index.js +1 -0
- package/dist/components/crash-report/providers/third-parties/index.js.map +1 -0
- package/dist/components/crash-report/services/index.js +1 -0
- package/dist/components/crash-report/services/index.js.map +1 -0
- package/dist/components/crash-report/services/mt-crash-report.service.js +6 -5
- package/dist/components/crash-report/services/mt-crash-report.service.js.map +1 -0
- package/dist/components/grpc/common/constants.js +1 -0
- package/dist/components/grpc/common/constants.js.map +1 -0
- package/dist/components/grpc/common/index.js +1 -0
- package/dist/components/grpc/common/index.js.map +1 -0
- package/dist/components/grpc/common/keys.js +5 -4
- package/dist/components/grpc/common/keys.js.map +1 -0
- package/dist/components/grpc/common/types.js +1 -0
- package/dist/components/grpc/common/types.js.map +1 -0
- package/dist/components/grpc/components/index.js +1 -0
- package/dist/components/grpc/components/index.js.map +1 -0
- package/dist/components/grpc/components/server.component.js +9 -8
- package/dist/components/grpc/components/server.component.js.map +1 -0
- package/dist/components/grpc/controllers/base.js +1 -1
- package/dist/components/grpc/controllers/base.js.map +1 -0
- package/dist/components/grpc/controllers/index.js +1 -0
- package/dist/components/grpc/controllers/index.js.map +1 -0
- package/dist/components/grpc/decorators/index.js +1 -0
- package/dist/components/grpc/decorators/index.js.map +1 -0
- package/dist/components/grpc/helpers/grpc-client.js +4 -9
- package/dist/components/grpc/helpers/grpc-client.js.map +1 -0
- package/dist/components/grpc/helpers/grpc-server.js +18 -14
- package/dist/components/grpc/helpers/grpc-server.js.map +1 -0
- package/dist/components/grpc/helpers/index.js +1 -0
- package/dist/components/grpc/helpers/index.js.map +1 -0
- package/dist/components/grpc/index.js +1 -0
- package/dist/components/grpc/index.js.map +1 -0
- package/dist/components/grpc/persistents/grpc.connector.js +3 -8
- package/dist/components/grpc/persistents/grpc.connector.js.map +1 -0
- package/dist/components/grpc/persistents/grpc.datasource.js +4 -2
- package/dist/components/grpc/persistents/grpc.datasource.js.map +1 -0
- package/dist/components/grpc/persistents/grpc.repository.js +3 -3
- package/dist/components/grpc/persistents/grpc.repository.js.map +1 -0
- package/dist/components/grpc/persistents/index.js +1 -0
- package/dist/components/grpc/persistents/index.js.map +1 -0
- package/dist/components/health-check/component.js +1 -1
- package/dist/components/health-check/component.js.map +1 -0
- package/dist/components/health-check/index.js +1 -0
- package/dist/components/health-check/index.js.map +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/migration/common/index.js +1 -0
- package/dist/components/migration/common/index.js.map +1 -0
- package/dist/components/migration/common/keys.js +4 -3
- package/dist/components/migration/common/keys.js.map +1 -0
- package/dist/components/migration/common/types.js +1 -0
- package/dist/components/migration/common/types.js.map +1 -0
- package/dist/components/migration/component.js +9 -5
- package/dist/components/migration/component.js.map +1 -0
- package/dist/components/migration/index.js +1 -0
- package/dist/components/migration/index.js.map +1 -0
- package/dist/components/migration/models/index.js +1 -0
- package/dist/components/migration/models/index.js.map +1 -0
- package/dist/components/migration/models/migration.model.js +1 -2
- package/dist/components/migration/models/migration.model.js.map +1 -0
- package/dist/components/migration/repositories/index.js +1 -0
- package/dist/components/migration/repositories/index.js.map +1 -0
- package/dist/components/migration/repositories/migration.repository.js +1 -0
- package/dist/components/migration/repositories/migration.repository.js.map +1 -0
- package/dist/components/socket-io/common/constants.js +11 -10
- package/dist/components/socket-io/common/constants.js.map +1 -0
- package/dist/components/socket-io/common/index.js +1 -0
- package/dist/components/socket-io/common/index.js.map +1 -0
- package/dist/components/socket-io/common/keys.js +7 -6
- package/dist/components/socket-io/common/keys.js.map +1 -0
- package/dist/components/socket-io/component.js +9 -9
- package/dist/components/socket-io/component.js.map +1 -0
- package/dist/components/socket-io/helpers/index.js +1 -0
- package/dist/components/socket-io/helpers/index.js.map +1 -0
- package/dist/components/socket-io/helpers/socket-io-client.helper.js +12 -7
- package/dist/components/socket-io/helpers/socket-io-client.helper.js.map +1 -0
- package/dist/components/socket-io/helpers/socket-io-server.helper.js +42 -26
- package/dist/components/socket-io/helpers/socket-io-server.helper.js.map +1 -0
- package/dist/components/socket-io/index.js +1 -0
- package/dist/components/socket-io/index.js.map +1 -0
- package/dist/components/static-asset/common/index.js +1 -0
- package/dist/components/static-asset/common/index.js.map +1 -0
- package/dist/components/static-asset/common/keys.js +5 -4
- package/dist/components/static-asset/common/keys.js.map +1 -0
- package/dist/components/static-asset/component.js +9 -9
- package/dist/components/static-asset/component.js.map +1 -0
- package/dist/components/static-asset/controllers/asset.controller.d.ts +8 -0
- package/dist/components/static-asset/controllers/asset.controller.js +94 -71
- package/dist/components/static-asset/controllers/asset.controller.js.map +1 -0
- package/dist/components/static-asset/controllers/index.js +1 -0
- package/dist/components/static-asset/controllers/index.js.map +1 -0
- package/dist/components/static-asset/controllers/resource.controller.js +10 -8
- package/dist/components/static-asset/controllers/resource.controller.js.map +1 -0
- package/dist/components/static-asset/index.js +1 -0
- package/dist/components/static-asset/index.js.map +1 -0
- package/dist/datasources/index.js +1 -0
- package/dist/datasources/index.js.map +1 -0
- package/dist/datasources/memory/datasource.js +4 -3
- package/dist/datasources/memory/datasource.js.map +1 -0
- package/dist/datasources/memory/index.js +1 -0
- package/dist/datasources/memory/index.js.map +1 -0
- package/dist/datasources/postgres/datasource.js +11 -10
- package/dist/datasources/postgres/datasource.js.map +1 -0
- package/dist/datasources/postgres/index.js +1 -0
- package/dist/datasources/postgres/index.js.map +1 -0
- package/dist/datasources/postgres/types.js +1 -0
- package/dist/datasources/postgres/types.js.map +1 -0
- package/dist/datasources/redis/connector.js +8 -18
- package/dist/datasources/redis/connector.js.map +1 -0
- package/dist/datasources/redis/datasource.js +8 -7
- package/dist/datasources/redis/datasource.js.map +1 -0
- package/dist/datasources/redis/index.js +1 -0
- package/dist/datasources/redis/index.js.map +1 -0
- package/dist/datasources/redis/types.js +1 -0
- package/dist/datasources/redis/types.js.map +1 -0
- package/dist/helpers/application-environment.helper.js +4 -3
- package/dist/helpers/application-environment.helper.js.map +1 -0
- package/dist/helpers/cron.helper.js +15 -9
- package/dist/helpers/cron.helper.js.map +1 -0
- package/dist/helpers/crypto/algorithms/aes.algorithm.js +8 -8
- package/dist/helpers/crypto/algorithms/aes.algorithm.js.map +1 -0
- package/dist/helpers/crypto/algorithms/base.algorithm.js +5 -3
- package/dist/helpers/crypto/algorithms/base.algorithm.js.map +1 -0
- package/dist/helpers/crypto/algorithms/index.js +1 -0
- package/dist/helpers/crypto/algorithms/index.js.map +1 -0
- package/dist/helpers/crypto/algorithms/rsa.algorithm.js +6 -4
- package/dist/helpers/crypto/algorithms/rsa.algorithm.js.map +1 -0
- package/dist/helpers/crypto/common/constants.js +1 -0
- package/dist/helpers/crypto/common/constants.js.map +1 -0
- package/dist/helpers/crypto/common/index.js +1 -0
- package/dist/helpers/crypto/common/index.js.map +1 -0
- package/dist/helpers/crypto/common/types.js +1 -0
- package/dist/helpers/crypto/common/types.js.map +1 -0
- package/dist/helpers/crypto/index.js +1 -0
- package/dist/helpers/crypto/index.js.map +1 -0
- package/dist/helpers/database/index.js +1 -0
- package/dist/helpers/database/index.js.map +1 -0
- package/dist/helpers/database/query-builder.helper.js +6 -2
- package/dist/helpers/database/query-builder.helper.js.map +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/logger/application-logger.js +18 -7
- package/dist/helpers/logger/application-logger.js.map +1 -0
- package/dist/helpers/logger/common/index.js +1 -0
- package/dist/helpers/logger/common/index.js.map +1 -0
- package/dist/helpers/logger/common/types.js +23 -20
- package/dist/helpers/logger/common/types.js.map +1 -0
- package/dist/helpers/logger/default-logger.js +13 -2
- package/dist/helpers/logger/default-logger.js.map +1 -0
- package/dist/helpers/logger/factory.js +2 -1
- package/dist/helpers/logger/factory.js.map +1 -0
- package/dist/helpers/logger/index.js +1 -0
- package/dist/helpers/logger/index.js.map +1 -0
- package/dist/helpers/logger/transports/dgram.transport.js +26 -16
- package/dist/helpers/logger/transports/dgram.transport.js.map +1 -0
- package/dist/helpers/logger/transports/index.js +1 -0
- package/dist/helpers/logger/transports/index.js.map +1 -0
- package/dist/helpers/network/http-request/base-network-request.helper.js +35 -36
- package/dist/helpers/network/http-request/base-network-request.helper.js.map +1 -0
- package/dist/helpers/network/http-request/fetcher/axios-fetcher.js +23 -10
- package/dist/helpers/network/http-request/fetcher/axios-fetcher.js.map +1 -0
- package/dist/helpers/network/http-request/fetcher/base-fetcher.js +37 -13
- package/dist/helpers/network/http-request/fetcher/base-fetcher.js.map +1 -0
- package/dist/helpers/network/http-request/fetcher/index.js +1 -0
- package/dist/helpers/network/http-request/fetcher/index.js.map +1 -0
- package/dist/helpers/network/http-request/fetcher/node-fetcher.js +60 -37
- package/dist/helpers/network/http-request/fetcher/node-fetcher.js.map +1 -0
- package/dist/helpers/network/http-request/index.js +1 -0
- package/dist/helpers/network/http-request/index.js.map +1 -0
- package/dist/helpers/network/http-request/types.js +1 -0
- package/dist/helpers/network/http-request/types.js.map +1 -0
- package/dist/helpers/network/index.js +1 -0
- package/dist/helpers/network/index.js.map +1 -0
- package/dist/helpers/network/tcp-socket/base-tcp-client.helper.js +28 -30
- package/dist/helpers/network/tcp-socket/base-tcp-client.helper.js.map +1 -0
- package/dist/helpers/network/tcp-socket/base-tcp-server.helper.js +20 -21
- package/dist/helpers/network/tcp-socket/base-tcp-server.helper.js.map +1 -0
- package/dist/helpers/network/tcp-socket/index.js +1 -0
- package/dist/helpers/network/tcp-socket/index.js.map +1 -0
- package/dist/helpers/network/tcp-socket/network-tcp-client.helper.js +2 -5
- package/dist/helpers/network/tcp-socket/network-tcp-client.helper.js.map +1 -0
- package/dist/helpers/network/tcp-socket/network-tcp-server.helper.js +2 -5
- package/dist/helpers/network/tcp-socket/network-tcp-server.helper.js.map +1 -0
- package/dist/helpers/network/tcp-socket/network-tls-tcp-client.helper.js +2 -5
- package/dist/helpers/network/tcp-socket/network-tls-tcp-client.helper.js.map +1 -0
- package/dist/helpers/network/tcp-socket/network-tls-tcp-server.helper.js +2 -5
- package/dist/helpers/network/tcp-socket/network-tls-tcp-server.helper.js.map +1 -0
- package/dist/helpers/network/udp-socket/index.js +1 -0
- package/dist/helpers/network/udp-socket/index.js.map +1 -0
- package/dist/helpers/network/udp-socket/network-udp-client.helper.js +19 -21
- package/dist/helpers/network/udp-socket/network-udp-client.helper.js.map +1 -0
- package/dist/helpers/queue/bullmq.helper.js +23 -21
- package/dist/helpers/queue/bullmq.helper.js.map +1 -0
- package/dist/helpers/queue/index.js +1 -0
- package/dist/helpers/queue/index.js.map +1 -0
- package/dist/helpers/queue/mqtt.helper.js +18 -15
- package/dist/helpers/queue/mqtt.helper.js.map +1 -0
- package/dist/helpers/queue/queue.helper.js +146 -74
- package/dist/helpers/queue/queue.helper.js.map +1 -0
- package/dist/helpers/redis/default.helper.js +163 -117
- package/dist/helpers/redis/default.helper.js.map +1 -0
- package/dist/helpers/redis/index.js +1 -0
- package/dist/helpers/redis/index.js.map +1 -0
- package/dist/helpers/redis/redis-cluster.helper.js +3 -7
- package/dist/helpers/redis/redis-cluster.helper.js.map +1 -0
- package/dist/helpers/redis/redis.helper.js +6 -8
- package/dist/helpers/redis/redis.helper.js.map +1 -0
- package/dist/helpers/redis/types.js +1 -0
- package/dist/helpers/redis/types.js.map +1 -0
- package/dist/helpers/storage/di-container.helper.js +1 -2
- package/dist/helpers/storage/di-container.helper.js.map +1 -0
- package/dist/helpers/storage/index.js +1 -0
- package/dist/helpers/storage/index.js.map +1 -0
- package/dist/helpers/storage/minio.helper.js +129 -88
- package/dist/helpers/storage/minio.helper.js.map +1 -0
- package/dist/helpers/testing/common.js +4 -3
- package/dist/helpers/testing/common.js.map +1 -0
- package/dist/helpers/testing/describe.js +22 -14
- package/dist/helpers/testing/describe.js.map +1 -0
- package/dist/helpers/testing/index.js +1 -0
- package/dist/helpers/testing/index.js.map +1 -0
- package/dist/helpers/testing/test-case.js +1 -5
- package/dist/helpers/testing/test-case.js.map +1 -0
- package/dist/helpers/testing/test-handler.js +31 -23
- package/dist/helpers/testing/test-handler.js.map +1 -0
- package/dist/helpers/testing/test-plan/base.js +7 -9
- package/dist/helpers/testing/test-plan/base.js.map +1 -0
- package/dist/helpers/testing/test-plan/default.js +1 -0
- package/dist/helpers/testing/test-plan/default.js.map +1 -0
- package/dist/helpers/testing/test-plan/index.js +1 -0
- package/dist/helpers/testing/test-plan/index.js.map +1 -0
- package/dist/helpers/testing/types.js +1 -0
- package/dist/helpers/testing/types.js.map +1 -0
- package/dist/helpers/worker-thread/base.js +21 -10
- package/dist/helpers/worker-thread/base.js.map +1 -0
- package/dist/helpers/worker-thread/index.js +1 -0
- package/dist/helpers/worker-thread/index.js.map +1 -0
- package/dist/helpers/worker-thread/types.js +1 -0
- package/dist/helpers/worker-thread/types.js.map +1 -0
- package/dist/helpers/worker-thread/worker-bus.js +13 -11
- package/dist/helpers/worker-thread/worker-bus.js.map +1 -0
- package/dist/helpers/worker-thread/worker-pool.js +26 -17
- package/dist/helpers/worker-thread/worker-pool.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptors/content-range.interceptor.js +133 -115
- package/dist/interceptors/content-range.interceptor.js.map +1 -0
- package/dist/interceptors/index.js +1 -0
- package/dist/interceptors/index.js.map +1 -0
- package/dist/middlewares/index.js +1 -0
- package/dist/middlewares/index.js.map +1 -0
- package/dist/middlewares/request-body-parser.middleware.js +17 -4
- package/dist/middlewares/request-body-parser.middleware.js.map +1 -0
- package/dist/middlewares/request-spy.middleware.js +6 -4
- package/dist/middlewares/request-spy.middleware.js.map +1 -0
- package/dist/migrations/base-path.js +1 -0
- package/dist/migrations/base-path.js.map +1 -0
- package/dist/migrations/handler.js +23 -13
- package/dist/migrations/handler.js.map +1 -0
- package/dist/migrations/index.js +1 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/mixins/data-type.mixin.js +1 -5
- package/dist/mixins/data-type.mixin.js.map +1 -0
- package/dist/mixins/deprecated/user-audit.mixin.d.ts +3 -0
- package/dist/mixins/deprecated/user-audit.mixin.js +6 -2
- package/dist/mixins/deprecated/user-audit.mixin.js.map +1 -0
- package/dist/mixins/duplicatable.mixin.js +1 -1
- package/dist/mixins/duplicatable.mixin.js.map +1 -0
- package/dist/mixins/index.js +1 -0
- package/dist/mixins/index.js.map +1 -0
- package/dist/mixins/object-search.mixin.js +1 -1
- package/dist/mixins/object-search.mixin.js.map +1 -0
- package/dist/mixins/principal.mixin.js +1 -2
- package/dist/mixins/principal.mixin.js.map +1 -0
- package/dist/mixins/soft-delete.mixin.js +1 -1
- package/dist/mixins/soft-delete.mixin.js.map +1 -0
- package/dist/mixins/soft-persistent.mixin.js +1 -1
- package/dist/mixins/soft-persistent.mixin.js.map +1 -0
- package/dist/mixins/text-search.mixin.js +1 -1
- package/dist/mixins/text-search.mixin.js.map +1 -0
- package/dist/mixins/tz.mixin.js +1 -2
- package/dist/mixins/tz.mixin.js.map +1 -0
- package/dist/mixins/user-audit.mixin.js +4 -5
- package/dist/mixins/user-audit.mixin.js.map +1 -0
- package/dist/mixins/vector.mixin.js +7 -9
- package/dist/mixins/vector.mixin.js.map +1 -0
- package/dist/tsconfig.base.json +4 -11
- package/dist/utilities/crypto.utility.js +1 -0
- package/dist/utilities/crypto.utility.js.map +1 -0
- package/dist/utilities/date.utility.js +24 -5
- package/dist/utilities/date.utility.js.map +1 -0
- package/dist/utilities/error.utility.js +1 -2
- package/dist/utilities/error.utility.js.map +1 -0
- package/dist/utilities/index.js +1 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/model.utility.js +7 -2
- package/dist/utilities/model.utility.js.map +1 -0
- package/dist/utilities/parse.utility.d.ts +16 -0
- package/dist/utilities/parse.utility.js +42 -6
- package/dist/utilities/parse.utility.js.map +1 -0
- package/dist/utilities/performance.utility.js +3 -1
- package/dist/utilities/performance.utility.js.map +1 -0
- package/dist/utilities/promise.utility.d.ts +17 -0
- package/dist/utilities/promise.utility.js +32 -5
- package/dist/utilities/promise.utility.js.map +1 -0
- package/dist/utilities/query.utility.js +17 -8
- package/dist/utilities/query.utility.js.map +1 -0
- package/dist/utilities/request.utility.js +9 -2
- package/dist/utilities/request.utility.js.map +1 -0
- package/dist/utilities/url.utility.js +1 -0
- package/dist/utilities/url.utility.js.map +1 -0
- package/package.json +8 -10
|
@@ -7,27 +7,18 @@ exports.NetworkUdpClient = void 0;
|
|
|
7
7
|
const base_helper_1 = require("../../../base/base.helper");
|
|
8
8
|
const node_dgram_1 = __importDefault(require("node:dgram"));
|
|
9
9
|
class NetworkUdpClient extends base_helper_1.BaseHelper {
|
|
10
|
-
host;
|
|
11
|
-
port;
|
|
12
|
-
reuseAddr;
|
|
13
|
-
multicastAddress;
|
|
14
|
-
onConnected;
|
|
15
|
-
onData;
|
|
16
|
-
onClosed;
|
|
17
|
-
onError;
|
|
18
|
-
onBind;
|
|
19
|
-
client;
|
|
20
10
|
constructor(opts) {
|
|
11
|
+
var _a, _b, _c, _d;
|
|
21
12
|
super({ scope: NetworkUdpClient.name, identifier: opts.identifier });
|
|
22
13
|
this.host = opts.host;
|
|
23
14
|
this.port = opts.port;
|
|
24
15
|
this.reuseAddr = opts.reuseAddr;
|
|
25
16
|
this.multicastAddress = opts.multicastAddress;
|
|
26
|
-
this.onConnected = opts
|
|
27
|
-
this.onData = opts
|
|
28
|
-
this.onClosed = opts
|
|
29
|
-
this.onError = opts
|
|
30
|
-
this.onBind = opts
|
|
17
|
+
this.onConnected = (_a = opts === null || opts === void 0 ? void 0 : opts.onConnected) !== null && _a !== void 0 ? _a : this.handleConnected;
|
|
18
|
+
this.onData = (_b = opts === null || opts === void 0 ? void 0 : opts.onData) !== null && _b !== void 0 ? _b : this.handleData;
|
|
19
|
+
this.onClosed = (_c = opts === null || opts === void 0 ? void 0 : opts.onClosed) !== null && _c !== void 0 ? _c : this.handleClosed;
|
|
20
|
+
this.onError = (_d = opts === null || opts === void 0 ? void 0 : opts.onError) !== null && _d !== void 0 ? _d : this.handleError;
|
|
21
|
+
this.onBind = opts === null || opts === void 0 ? void 0 : opts.onBind;
|
|
31
22
|
}
|
|
32
23
|
static newInstance(opts) {
|
|
33
24
|
return new NetworkUdpClient(opts);
|
|
@@ -73,19 +64,24 @@ class NetworkUdpClient extends base_helper_1.BaseHelper {
|
|
|
73
64
|
this.logger.info('[connect][%s] New network udp client | Host: %s | Port: %s | multicastAddress: %j', this.identifier, this.host, this.port, this.multicastAddress);
|
|
74
65
|
this.client = node_dgram_1.default.createSocket({ type: 'udp4', reuseAddr: this.reuseAddr });
|
|
75
66
|
this.client.on('close', () => {
|
|
76
|
-
|
|
67
|
+
var _a;
|
|
68
|
+
(_a = this.onClosed) === null || _a === void 0 ? void 0 : _a.call(this, { identifier: this.identifier, host: this.host, port: this.port });
|
|
77
69
|
});
|
|
78
70
|
this.client.on('error', error => {
|
|
79
|
-
|
|
71
|
+
var _a;
|
|
72
|
+
(_a = this.onError) === null || _a === void 0 ? void 0 : _a.call(this, { identifier: this.identifier, host: this.host, port: this.port, error });
|
|
80
73
|
});
|
|
81
74
|
this.client.on('listening', () => {
|
|
82
|
-
|
|
75
|
+
var _a;
|
|
76
|
+
(_a = this.onConnected) === null || _a === void 0 ? void 0 : _a.call(this, { identifier: this.identifier, host: this.host, port: this.port });
|
|
83
77
|
});
|
|
84
78
|
this.client.on('message', (message, remoteInfo) => {
|
|
85
|
-
|
|
79
|
+
var _a;
|
|
80
|
+
(_a = this.onData) === null || _a === void 0 ? void 0 : _a.call(this, { identifier: this.identifier, message, remoteInfo });
|
|
86
81
|
});
|
|
87
82
|
this.client.bind({ port: this.port, address: this.host }, () => {
|
|
88
|
-
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = this.onBind) === null || _a === void 0 ? void 0 : _a.call(this, {
|
|
89
85
|
identifier: this.identifier,
|
|
90
86
|
socket: this.client,
|
|
91
87
|
host: this.host,
|
|
@@ -96,11 +92,12 @@ class NetworkUdpClient extends base_helper_1.BaseHelper {
|
|
|
96
92
|
});
|
|
97
93
|
}
|
|
98
94
|
disconnect() {
|
|
95
|
+
var _a;
|
|
99
96
|
if (!this.client) {
|
|
100
97
|
this.logger.info('[disconnect][%s] UdpClient is not initialized yet!', this.identifier);
|
|
101
98
|
return;
|
|
102
99
|
}
|
|
103
|
-
this.client
|
|
100
|
+
(_a = this.client) === null || _a === void 0 ? void 0 : _a.close();
|
|
104
101
|
this.client = null;
|
|
105
102
|
this.logger.info('[disconnect][%s] UdpClient is destroyed!', this.identifier);
|
|
106
103
|
}
|
|
@@ -109,3 +106,4 @@ class NetworkUdpClient extends base_helper_1.BaseHelper {
|
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
exports.NetworkUdpClient = NetworkUdpClient;
|
|
109
|
+
//# sourceMappingURL=network-udp-client.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-udp-client.helper.js","sourceRoot":"","sources":["../../../../src/helpers/network/udp-socket/network-udp-client.helper.ts"],"names":[],"mappings":";;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;QAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;;YAC7D,MAAA,IAAI,CAAC,MAAM,qDAAG;gBACZ,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAO;gBACpB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;aACxC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;;QACR,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACxF,OAAO;QACT,CAAC;QAED,MAAA,IAAI,CAAC,MAAM,0CAAE,KAAK,EAAE,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0CAA0C,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAChF,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAzKD,4CAyKC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.BullMQHelper = void 0;
|
|
4
13
|
const base_helper_1 = require("../../base/base.helper");
|
|
5
14
|
const bullmq_1 = require("bullmq");
|
|
6
15
|
class BullMQHelper extends base_helper_1.BaseHelper {
|
|
7
|
-
queueName;
|
|
8
|
-
role;
|
|
9
|
-
connection;
|
|
10
|
-
queue;
|
|
11
|
-
worker;
|
|
12
|
-
numberOfWorker = 1;
|
|
13
|
-
lockDuration = 90 * 60 * 1000;
|
|
14
|
-
onWorkerData;
|
|
15
|
-
onWorkerDataCompleted;
|
|
16
|
-
onWorkerDataFail;
|
|
17
16
|
constructor(options) {
|
|
18
17
|
super({ scope: BullMQHelper.name, identifier: options.identifier });
|
|
18
|
+
this.numberOfWorker = 1;
|
|
19
|
+
this.lockDuration = 90 * 60 * 1000;
|
|
19
20
|
const { queueName, connection, role, numberOfWorker = 1, lockDuration = 90 * 60 * 1000, onWorkerData, onWorkerDataCompleted, onWorkerDataFail, } = options;
|
|
20
21
|
this.queueName = queueName;
|
|
21
22
|
this.role = role;
|
|
@@ -48,31 +49,31 @@ class BullMQHelper extends base_helper_1.BaseHelper {
|
|
|
48
49
|
this.logger.error('[configureWorkers][%s] Invalid worker name', this.identifier);
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
|
-
this.worker = new bullmq_1.Worker(this.queueName,
|
|
52
|
+
this.worker = new bullmq_1.Worker(this.queueName, (job) => __awaiter(this, void 0, void 0, function* () {
|
|
52
53
|
if (this.onWorkerData) {
|
|
53
|
-
const rs =
|
|
54
|
+
const rs = yield this.onWorkerData(job);
|
|
54
55
|
return rs;
|
|
55
56
|
}
|
|
56
57
|
const { id, name, data } = job;
|
|
57
58
|
this.logger.info('[onWorkerData][%s] queue: %s | id: %s | name: %s | data: %j', this.identifier, this.queueName, id, name, data);
|
|
58
|
-
}, {
|
|
59
|
+
}), {
|
|
59
60
|
connection: this.connection,
|
|
60
61
|
concurrency: this.numberOfWorker,
|
|
61
62
|
lockDuration: this.lockDuration,
|
|
62
63
|
});
|
|
63
64
|
this.worker.on('completed', (job, result) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
var _a;
|
|
66
|
+
(_a = this.onWorkerDataCompleted) === null || _a === void 0 ? void 0 : _a.call(this, job, result).then(() => {
|
|
67
|
+
// Do something after processing completed job
|
|
68
|
+
}).catch(error => {
|
|
68
69
|
this.logger.error('[Worker][%s][completed] queue: %s | Error while processing completed job! Error: %s', this.identifier, this.queueName, error);
|
|
69
70
|
});
|
|
70
71
|
});
|
|
71
72
|
this.worker.on('failed', (job, reason) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = this.onWorkerDataFail) === null || _a === void 0 ? void 0 : _a.call(this, job, reason).then(() => {
|
|
75
|
+
// Do something after processing failed job
|
|
76
|
+
}).catch(error => {
|
|
76
77
|
this.logger.error('[Worker][%s][failed] queue: %s | Error while processing completed job! Error: %s', this.identifier, this.queueName, error);
|
|
77
78
|
});
|
|
78
79
|
});
|
|
@@ -95,3 +96,4 @@ class BullMQHelper extends base_helper_1.BaseHelper {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
exports.BullMQHelper = BullMQHelper;
|
|
99
|
+
//# sourceMappingURL=bullmq.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bullmq.helper.js","sourceRoot":"","sources":["../../../src/helpers/queue/bullmq.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgD;AAEhD,mCAA4C;AAoB5C,MAAa,YAAsD,SAAQ,wBAAU;IAqBnF,YAAY,OAAoD;QAC9D,KAAK,CAAC,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E,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;;YACvC,MAAA,IAAI,CAAC,gBAAgB,qDAAG,GAAG,EAAE,MAAM,EAChC,IAAI,CAAC,GAAG,EAAE;gBACT,2CAA2C;YAC7C,CAAC,EACA,KAAK,CAAC,KAAK,CAAC,EAAE;gBACb,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,kFAAkF,EAClF,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,SAAS,EACd,KAAK,CACN,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS;QACP,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,gFAAgF,EAChF,IAAI,CAAC,UAAU,CAChB,CAAC;YACF,OAAO;QACT,CAAC;QAED,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,OAAO,CAAC,CAAC,CAAC;gBACb,IAAI,CAAC,cAAc,EAAE,CAAC;gBACtB,MAAM;YACR,CAAC;YACD,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,IAAI,CAAC,eAAe,EAAE,CAAC;gBACvB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;CACF;AArJD,oCAqJC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/queue/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B"}
|
|
@@ -9,14 +9,6 @@ const utilities_1 = require("../../utilities");
|
|
|
9
9
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
10
10
|
const mqtt_1 = __importDefault(require("mqtt"));
|
|
11
11
|
class MQTTClientHelper extends base_helper_1.BaseHelper {
|
|
12
|
-
url;
|
|
13
|
-
options;
|
|
14
|
-
client;
|
|
15
|
-
onConnect;
|
|
16
|
-
onDisconnect;
|
|
17
|
-
onError;
|
|
18
|
-
onClose;
|
|
19
|
-
onMessage;
|
|
20
12
|
constructor(opts) {
|
|
21
13
|
super({ scope: MQTTClientHelper.name, identifier: opts.identifier });
|
|
22
14
|
this.url = opts.url;
|
|
@@ -28,6 +20,7 @@ class MQTTClientHelper extends base_helper_1.BaseHelper {
|
|
|
28
20
|
this.onMessage = opts.onMessage;
|
|
29
21
|
this.configure();
|
|
30
22
|
}
|
|
23
|
+
// -------------------------------------------------------------------------------
|
|
31
24
|
configure() {
|
|
32
25
|
if (this.client) {
|
|
33
26
|
this.logger.info('[configure][%s] MQTT Client already established! Client: %j', this.identifier, this.client);
|
|
@@ -42,24 +35,31 @@ class MQTTClientHelper extends base_helper_1.BaseHelper {
|
|
|
42
35
|
this.logger.info('[configure][%s] Start configuring mqtt client | Url: %s | Options: %j', this.identifier, this.url, this.options);
|
|
43
36
|
this.client = mqtt_1.default.connect(this.url, this.options);
|
|
44
37
|
this.client.on('connect', () => {
|
|
45
|
-
|
|
38
|
+
var _a;
|
|
39
|
+
(_a = this.onConnect) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
46
40
|
});
|
|
47
41
|
this.client.on('disconnect', () => {
|
|
48
|
-
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = this.onDisconnect) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
49
44
|
});
|
|
50
45
|
this.client.on('message', (topic, message) => {
|
|
51
|
-
|
|
46
|
+
var _a;
|
|
47
|
+
(_a = this.onMessage) === null || _a === void 0 ? void 0 : _a.call(this, { topic, message });
|
|
52
48
|
});
|
|
53
49
|
this.client.on('error', error => {
|
|
54
|
-
|
|
50
|
+
var _a;
|
|
51
|
+
(_a = this.onError) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
55
52
|
});
|
|
56
53
|
this.client.on('close', (error) => {
|
|
57
|
-
|
|
54
|
+
var _a;
|
|
55
|
+
(_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
58
56
|
});
|
|
59
57
|
}
|
|
58
|
+
// -------------------------------------------------------------------------------
|
|
60
59
|
subscribe(opts) {
|
|
61
60
|
return new Promise((resolve, reject) => {
|
|
62
|
-
|
|
61
|
+
var _a;
|
|
62
|
+
if (!((_a = this.client) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
63
63
|
reject((0, utilities_1.getError)({
|
|
64
64
|
statusCode: 400,
|
|
65
65
|
message: `[subscribe][${this.identifier}] MQTT Client is not available to subscribe topic!`,
|
|
@@ -74,9 +74,11 @@ class MQTTClientHelper extends base_helper_1.BaseHelper {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
+
// -------------------------------------------------------------------------------
|
|
77
78
|
publish(opts) {
|
|
78
79
|
return new Promise((resolve, reject) => {
|
|
79
|
-
|
|
80
|
+
var _a;
|
|
81
|
+
if (!((_a = this.client) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
80
82
|
reject((0, utilities_1.getError)({
|
|
81
83
|
statusCode: 400,
|
|
82
84
|
message: `[publish][${this.identifier}] MQTT Client is not available to subscribe topic!`,
|
|
@@ -93,3 +95,4 @@ class MQTTClientHelper extends base_helper_1.BaseHelper {
|
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
exports.MQTTClientHelper = MQTTClientHelper;
|
|
98
|
+
//# sourceMappingURL=mqtt.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mqtt.helper.js","sourceRoot":"","sources":["../../../src/helpers/queue/mqtt.helper.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAgD;AAChD,2CAAuC;AACvC,6DAAqC;AACrC,gDAAwB;AAaxB,MAAa,gBAAiB,SAAQ,wBAAU;IAW9C,YAAY,IAAwB;QAClC,KAAK,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;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AC;IAED,kFAAkF;IAClF,OAAO,CAAC,IAAiD;QACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;;YACrC,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAS,CAAA,EAAE,CAAC;gBAC5B,MAAM,CACJ,IAAA,oBAAQ,EAAC;oBACP,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,aAAa,IAAI,CAAC,UAAU,oDAAoD;iBAC1F,CAAC,CACH,CAAC;YACJ,CAAC;YAED,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YAChC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;gBAC1C,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;gBAED,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtHD,4CAsHC"}
|
|
@@ -1,42 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
14
|
+
var _a;
|
|
5
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
16
|
exports.QueueHelper = exports.QueueStatuses = void 0;
|
|
7
17
|
const base_helper_1 = require("../../base/base.helper");
|
|
8
18
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
19
|
+
// --------------------------------------------------------
|
|
9
20
|
class QueueStatuses {
|
|
10
|
-
static WAITING = '000_WAITING';
|
|
11
|
-
static PROCESSING = '100_PROCESSING';
|
|
12
|
-
static LOCKED = '200_LOCKED';
|
|
13
|
-
static SETTLED = '300_SETTLED';
|
|
14
|
-
static SCHEME_SET = new Set([this.WAITING, this.PROCESSING, this.LOCKED, this.SETTLED]);
|
|
15
21
|
static isValid(scheme) {
|
|
16
22
|
return this.SCHEME_SET.has(scheme);
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
25
|
exports.QueueStatuses = QueueStatuses;
|
|
26
|
+
_a = QueueStatuses;
|
|
27
|
+
QueueStatuses.WAITING = '000_WAITING';
|
|
28
|
+
QueueStatuses.PROCESSING = '100_PROCESSING';
|
|
29
|
+
QueueStatuses.LOCKED = '200_LOCKED';
|
|
30
|
+
QueueStatuses.SETTLED = '300_SETTLED';
|
|
31
|
+
QueueStatuses.SCHEME_SET = new Set([_a.WAITING, _a.PROCESSING, _a.LOCKED, _a.SETTLED]);
|
|
32
|
+
// --------------------------------------------------------
|
|
20
33
|
class QueueHelper extends base_helper_1.BaseHelper {
|
|
21
|
-
storage;
|
|
22
|
-
processingEvents;
|
|
23
|
-
generator;
|
|
24
|
-
totalEvent;
|
|
25
|
-
autoDispatch = true;
|
|
26
|
-
state = QueueStatuses.WAITING;
|
|
27
|
-
isSettleRequested;
|
|
28
|
-
onMessage;
|
|
29
|
-
onDataEnqueue;
|
|
30
|
-
onDataDequeue;
|
|
31
|
-
onStateChange;
|
|
32
34
|
constructor(opts) {
|
|
35
|
+
var _b;
|
|
33
36
|
super({ scope: `${QueueHelper.name}_${opts.identifier}`, identifier: opts.identifier });
|
|
37
|
+
this.autoDispatch = true;
|
|
38
|
+
this.state = QueueStatuses.WAITING;
|
|
34
39
|
this.identifier = opts.identifier;
|
|
35
40
|
this.storage = [];
|
|
36
41
|
this.processingEvents = new Set([]);
|
|
37
42
|
this.generator = this._messageListener();
|
|
38
43
|
this.totalEvent = 0;
|
|
39
|
-
this.autoDispatch = opts.autoDispatch
|
|
44
|
+
this.autoDispatch = (_b = opts.autoDispatch) !== null && _b !== void 0 ? _b : true;
|
|
40
45
|
this.state = QueueStatuses.WAITING;
|
|
41
46
|
this.isSettleRequested = false;
|
|
42
47
|
this.onMessage = opts.onMessage;
|
|
@@ -44,43 +49,46 @@ class QueueHelper extends base_helper_1.BaseHelper {
|
|
|
44
49
|
this.onDataDequeue = opts.onDataDequeue;
|
|
45
50
|
this.onStateChange = opts.onStateChange;
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
this.state
|
|
61
|
-
await this.onStateChange?.({ identifier: this.identifier, from: snap, to: this.state });
|
|
62
|
-
}
|
|
63
|
-
this.getElementAt(0).isLocked = true;
|
|
64
|
-
this.processingEvents.add(this.getElementAt(0));
|
|
65
|
-
await this.onMessage?.({ identifier: this.identifier, queueElement: this.getElementAt(0) });
|
|
66
|
-
const doneElement = this.dequeue();
|
|
67
|
-
if (doneElement) {
|
|
68
|
-
this.processingEvents.delete(doneElement);
|
|
69
|
-
}
|
|
70
|
-
if (this.state !== QueueStatuses.LOCKED && this.state !== QueueStatuses.SETTLED) {
|
|
71
|
-
const snap = this.state;
|
|
72
|
-
this.state = QueueStatuses.WAITING;
|
|
73
|
-
await this.onStateChange?.({ identifier: this.identifier, from: snap, to: this.state });
|
|
74
|
-
}
|
|
75
|
-
if (!this.storage.length) {
|
|
76
|
-
if (this.isSettleRequested) {
|
|
52
|
+
handleMessage() {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
var _b, _c, _d, _e;
|
|
55
|
+
const current = this.getElementAt(0);
|
|
56
|
+
if (!current) {
|
|
57
|
+
this.logger.warn('[handleMessage] current: %j | Invalid current message to handle!', current);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const { isLocked, payload } = current;
|
|
61
|
+
if (isLocked) {
|
|
62
|
+
this.logger.info('[handle] Skip LOCKED message | Payload: %j', payload);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (this.state !== QueueStatuses.LOCKED && this.state !== QueueStatuses.SETTLED) {
|
|
77
66
|
const snap = this.state;
|
|
78
|
-
this.state = QueueStatuses.
|
|
79
|
-
|
|
67
|
+
this.state = QueueStatuses.PROCESSING;
|
|
68
|
+
yield ((_b = this.onStateChange) === null || _b === void 0 ? void 0 : _b.call(this, { identifier: this.identifier, from: snap, to: this.state }));
|
|
80
69
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
this.getElementAt(0).isLocked = true;
|
|
71
|
+
this.processingEvents.add(this.getElementAt(0));
|
|
72
|
+
yield ((_c = this.onMessage) === null || _c === void 0 ? void 0 : _c.call(this, { identifier: this.identifier, queueElement: this.getElementAt(0) }));
|
|
73
|
+
const doneElement = this.dequeue();
|
|
74
|
+
if (doneElement) {
|
|
75
|
+
this.processingEvents.delete(doneElement);
|
|
76
|
+
}
|
|
77
|
+
if (this.state !== QueueStatuses.LOCKED && this.state !== QueueStatuses.SETTLED) {
|
|
78
|
+
const snap = this.state;
|
|
79
|
+
this.state = QueueStatuses.WAITING;
|
|
80
|
+
yield ((_d = this.onStateChange) === null || _d === void 0 ? void 0 : _d.call(this, { identifier: this.identifier, from: snap, to: this.state }));
|
|
81
|
+
}
|
|
82
|
+
if (!this.storage.length) {
|
|
83
|
+
if (this.isSettleRequested) {
|
|
84
|
+
const snap = this.state;
|
|
85
|
+
this.state = QueueStatuses.SETTLED;
|
|
86
|
+
yield ((_e = this.onStateChange) === null || _e === void 0 ? void 0 : _e.call(this, { identifier: this.identifier, from: snap, to: this.state }));
|
|
87
|
+
}
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.nextMessage();
|
|
91
|
+
});
|
|
84
92
|
}
|
|
85
93
|
*_messageListener() {
|
|
86
94
|
if (!this.onMessage) {
|
|
@@ -98,42 +106,48 @@ class QueueHelper extends base_helper_1.BaseHelper {
|
|
|
98
106
|
}
|
|
99
107
|
this.generator.next();
|
|
100
108
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this.
|
|
118
|
-
|
|
109
|
+
enqueue(payload) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
var _b;
|
|
112
|
+
if (this.isSettleRequested || this.state === QueueStatuses.SETTLED) {
|
|
113
|
+
this.logger.error('[enqueue] isSettled: %s | currentState: %s | Queue was SETTLED | No more element acceptable', this.isSettleRequested, this.state);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!this.storage) {
|
|
117
|
+
this.storage = [];
|
|
118
|
+
}
|
|
119
|
+
if (!payload) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const queueElement = { isLocked: false, payload };
|
|
123
|
+
this.storage.push(queueElement);
|
|
124
|
+
this.totalEvent++;
|
|
125
|
+
yield ((_b = this.onDataEnqueue) === null || _b === void 0 ? void 0 : _b.call(this, { identifier: this.identifier, queueElement: queueElement }));
|
|
126
|
+
if (this.autoDispatch) {
|
|
127
|
+
this.nextMessage();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
119
130
|
}
|
|
120
131
|
dequeue() {
|
|
132
|
+
var _b;
|
|
121
133
|
const value = this.storage.shift();
|
|
122
134
|
if (value && !(0, isEmpty_1.default)(value)) {
|
|
123
|
-
this.onDataDequeue
|
|
135
|
+
(_b = this.onDataDequeue) === null || _b === void 0 ? void 0 : _b.call(this, { identifier: this.identifier, queueElement: value });
|
|
124
136
|
}
|
|
125
137
|
return value;
|
|
126
138
|
}
|
|
127
139
|
lock() {
|
|
140
|
+
var _b;
|
|
128
141
|
if (this.state >= QueueStatuses.LOCKED) {
|
|
129
142
|
this.logger.error('[lock] isSettled | currentState: %s | Invalid queue state to request lock queue!', this.isSettleRequested, this.state);
|
|
130
143
|
return;
|
|
131
144
|
}
|
|
132
145
|
const snap = this.state;
|
|
133
146
|
this.state = QueueStatuses.LOCKED;
|
|
134
|
-
this.onStateChange
|
|
147
|
+
(_b = this.onStateChange) === null || _b === void 0 ? void 0 : _b.call(this, { identifier: this.identifier, from: snap, to: this.state });
|
|
135
148
|
}
|
|
136
149
|
unlock(opts) {
|
|
150
|
+
var _b;
|
|
137
151
|
if (this.state > QueueStatuses.LOCKED) {
|
|
138
152
|
this.logger.error('[unlock] isSettled | currentState: %s | Invalid queue state to request unlock queue!', this.isSettleRequested, this.state);
|
|
139
153
|
return;
|
|
@@ -141,18 +155,19 @@ class QueueHelper extends base_helper_1.BaseHelper {
|
|
|
141
155
|
const { shouldProcessNextElement = true } = opts;
|
|
142
156
|
const snap = this.state;
|
|
143
157
|
this.state = QueueStatuses.WAITING;
|
|
144
|
-
this.onStateChange
|
|
158
|
+
(_b = this.onStateChange) === null || _b === void 0 ? void 0 : _b.call(this, { identifier: this.identifier, from: snap, to: this.state });
|
|
145
159
|
if (!shouldProcessNextElement) {
|
|
146
160
|
return;
|
|
147
161
|
}
|
|
148
162
|
this.nextMessage();
|
|
149
163
|
}
|
|
150
164
|
settle() {
|
|
165
|
+
var _b;
|
|
151
166
|
this.isSettleRequested = true;
|
|
152
167
|
if (this.state !== QueueStatuses.PROCESSING) {
|
|
153
168
|
const snap = this.state;
|
|
154
169
|
this.state = QueueStatuses.SETTLED;
|
|
155
|
-
this.onStateChange
|
|
170
|
+
(_b = this.onStateChange) === null || _b === void 0 ? void 0 : _b.call(this, { identifier: this.identifier, from: snap, to: this.state });
|
|
156
171
|
}
|
|
157
172
|
}
|
|
158
173
|
isSettled() {
|
|
@@ -179,3 +194,60 @@ class QueueHelper extends base_helper_1.BaseHelper {
|
|
|
179
194
|
}
|
|
180
195
|
}
|
|
181
196
|
exports.QueueHelper = QueueHelper;
|
|
197
|
+
// --------------------------------------------------------
|
|
198
|
+
/* export class MultiQueueHelper<ElementType> {
|
|
199
|
+
public storage: Record<string, QueueHelper<ElementType>>;
|
|
200
|
+
|
|
201
|
+
private onDataEnqueue?: (identifier: string, payload: ElementType) => void;
|
|
202
|
+
private onDataDequeue?: (identifier: string, payload: ElementType) => void;
|
|
203
|
+
|
|
204
|
+
constructor(opts: IQueueCallback<ElementType>) {
|
|
205
|
+
const { onDataEnqueue, onDataDequeue } = opts;
|
|
206
|
+
this.onDataEnqueue = onDataEnqueue;
|
|
207
|
+
this.onDataDequeue = onDataDequeue;
|
|
208
|
+
this.storage = {};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
enqueue(identifier: string, value: ElementType) {
|
|
212
|
+
if (!this.storage[identifier]) {
|
|
213
|
+
this.storage[identifier] = new QueueHelper({ identifier });
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
this.storage[identifier].enqueue(value);
|
|
217
|
+
|
|
218
|
+
if (value && !isEmpty(value)) {
|
|
219
|
+
this.onDataEnqueue?.(identifier, value);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
dequeue(identifier: string): ElementType | undefined {
|
|
224
|
+
const value = this.storage[identifier]?.dequeue();
|
|
225
|
+
|
|
226
|
+
if (value && !isEmpty(value)) {
|
|
227
|
+
this.onDataDequeue?.(identifier, value);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return value;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
getElementAt(identifier: string, position = 0) {
|
|
234
|
+
return this.storage[identifier].getElementAt(position);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
getCurrentData(identifier: string) {
|
|
238
|
+
return this.storage[identifier]?.getElementAt(0);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
getQueue(identifier: string) {
|
|
242
|
+
return this.storage[identifier];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
removeQueue(queue: string) {
|
|
246
|
+
this.storage = omit(this.storage, [queue]);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
mapData() {
|
|
250
|
+
return this.storage;
|
|
251
|
+
}
|
|
252
|
+
} */
|
|
253
|
+
//# sourceMappingURL=queue.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.helper.js","sourceRoot":"","sources":["../../../src/helpers/queue/queue.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAgD;AAEhD,6DAAqC;AAErC,2DAA2D;AAC3D,MAAa,aAAa;IAQxB,MAAM,CAAC,OAAO,CAAC,MAAc;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;;AAVH,sCAWC;;AAViB,qBAAO,GAAG,aAAa,AAAhB,CAAiB;AACxB,wBAAU,GAAG,gBAAgB,AAAnB,CAAoB;AAC9B,oBAAM,GAAG,YAAY,AAAf,CAAgB;AACtB,qBAAO,GAAG,aAAa,AAAhB,CAAiB;AAExB,wBAAU,GAAG,IAAI,GAAG,CAAC,CAAC,EAAI,CAAC,OAAO,EAAE,EAAI,CAAC,UAAU,EAAE,EAAI,CAAC,MAAM,EAAE,EAAI,CAAC,OAAO,CAAC,CAAC,AAAtE,CAAuE;AAiCnG,2DAA2D;AAC3D,MAAa,WAA6B,SAAQ,wBAAU;IA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