@xeno-js/shared 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +274 -0
- package/dist/application/cqrs/command/command.d.ts +8 -0
- package/dist/application/cqrs/command/command.d.ts.map +1 -0
- package/dist/application/cqrs/command/command.js +9 -0
- package/dist/application/cqrs/command/command.js.map +1 -0
- package/dist/application/cqrs/command/index.d.ts +2 -0
- package/dist/application/cqrs/command/index.d.ts.map +1 -0
- package/dist/application/cqrs/command/index.js +2 -0
- package/dist/application/cqrs/command/index.js.map +1 -0
- package/dist/application/cqrs/index.d.ts +3 -0
- package/dist/application/cqrs/index.d.ts.map +1 -0
- package/dist/application/cqrs/index.js +3 -0
- package/dist/application/cqrs/index.js.map +1 -0
- package/dist/application/cqrs/query/index.d.ts +2 -0
- package/dist/application/cqrs/query/index.d.ts.map +1 -0
- package/dist/application/cqrs/query/index.js +2 -0
- package/dist/application/cqrs/query/index.js.map +1 -0
- package/dist/application/cqrs/query/query.d.ts +9 -0
- package/dist/application/cqrs/query/query.d.ts.map +1 -0
- package/dist/application/cqrs/query/query.js +11 -0
- package/dist/application/cqrs/query/query.js.map +1 -0
- package/dist/application/index.d.ts +3 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +3 -0
- package/dist/application/index.js.map +1 -0
- package/dist/application/loggers/__tests__/base.logger.test.d.ts +2 -0
- package/dist/application/loggers/__tests__/base.logger.test.d.ts.map +1 -0
- package/dist/application/loggers/__tests__/base.logger.test.js +132 -0
- package/dist/application/loggers/__tests__/base.logger.test.js.map +1 -0
- package/dist/application/loggers/base.logger.d.ts +48 -0
- package/dist/application/loggers/base.logger.d.ts.map +1 -0
- package/dist/application/loggers/base.logger.js +68 -0
- package/dist/application/loggers/base.logger.js.map +1 -0
- package/dist/application/loggers/index.d.ts +2 -0
- package/dist/application/loggers/index.d.ts.map +1 -0
- package/dist/application/loggers/index.js +2 -0
- package/dist/application/loggers/index.js.map +1 -0
- package/dist/domain/config/auth.config.d.ts +14 -0
- package/dist/domain/config/auth.config.d.ts.map +1 -0
- package/dist/domain/config/auth.config.js +2 -0
- package/dist/domain/config/auth.config.js.map +1 -0
- package/dist/domain/config/cache.config.d.ts +92 -0
- package/dist/domain/config/cache.config.d.ts.map +1 -0
- package/dist/domain/config/cache.config.js +2 -0
- package/dist/domain/config/cache.config.js.map +1 -0
- package/dist/domain/config/db.config.d.ts +29 -0
- package/dist/domain/config/db.config.d.ts.map +1 -0
- package/dist/domain/config/db.config.js +2 -0
- package/dist/domain/config/db.config.js.map +1 -0
- package/dist/domain/config/http.config.d.ts +148 -0
- package/dist/domain/config/http.config.d.ts.map +1 -0
- package/dist/domain/config/http.config.js +2 -0
- package/dist/domain/config/http.config.js.map +1 -0
- package/dist/domain/config/index.d.ts +5 -0
- package/dist/domain/config/index.d.ts.map +1 -0
- package/dist/domain/config/index.js +2 -0
- package/dist/domain/config/index.js.map +1 -0
- package/dist/domain/config/resilience.config.d.ts +94 -0
- package/dist/domain/config/resilience.config.d.ts.map +1 -0
- package/dist/domain/config/resilience.config.js +2 -0
- package/dist/domain/config/resilience.config.js.map +1 -0
- package/dist/domain/contracts/cache/icache.contracts.d.ts +93 -0
- package/dist/domain/contracts/cache/icache.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/cache/icache.contracts.js +2 -0
- package/dist/domain/contracts/cache/icache.contracts.js.map +1 -0
- package/dist/domain/contracts/cache/ikey-builder.contracts.d.ts +34 -0
- package/dist/domain/contracts/cache/ikey-builder.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/cache/ikey-builder.contracts.js +2 -0
- package/dist/domain/contracts/cache/ikey-builder.contracts.js.map +1 -0
- package/dist/domain/contracts/cache/index.d.ts +3 -0
- package/dist/domain/contracts/cache/index.d.ts.map +1 -0
- package/dist/domain/contracts/cache/index.js +2 -0
- package/dist/domain/contracts/cache/index.js.map +1 -0
- package/dist/domain/contracts/configuration/iconfiguration.contracts.d.ts +61 -0
- package/dist/domain/contracts/configuration/iconfiguration.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/configuration/iconfiguration.contracts.js +2 -0
- package/dist/domain/contracts/configuration/iconfiguration.contracts.js.map +1 -0
- package/dist/domain/contracts/configuration/index.d.ts +2 -0
- package/dist/domain/contracts/configuration/index.d.ts.map +1 -0
- package/dist/domain/contracts/configuration/index.js +2 -0
- package/dist/domain/contracts/configuration/index.js.map +1 -0
- package/dist/domain/contracts/context/context_types/identity-context.types.d.ts +63 -0
- package/dist/domain/contracts/context/context_types/identity-context.types.d.ts.map +1 -0
- package/dist/domain/contracts/context/context_types/identity-context.types.js +2 -0
- package/dist/domain/contracts/context/context_types/identity-context.types.js.map +1 -0
- package/dist/domain/contracts/context/context_types/index.d.ts +6 -0
- package/dist/domain/contracts/context/context_types/index.d.ts.map +1 -0
- package/dist/domain/contracts/context/context_types/index.js +2 -0
- package/dist/domain/contracts/context/context_types/index.js.map +1 -0
- package/dist/domain/contracts/context/context_types/messaging-context.types.d.ts +70 -0
- package/dist/domain/contracts/context/context_types/messaging-context.types.d.ts.map +1 -0
- package/dist/domain/contracts/context/context_types/messaging-context.types.js +2 -0
- package/dist/domain/contracts/context/context_types/messaging-context.types.js.map +1 -0
- package/dist/domain/contracts/context/context_types/network-context.types.d.ts +82 -0
- package/dist/domain/contracts/context/context_types/network-context.types.d.ts.map +1 -0
- package/dist/domain/contracts/context/context_types/network-context.types.js +2 -0
- package/dist/domain/contracts/context/context_types/network-context.types.js.map +1 -0
- package/dist/domain/contracts/context/context_types/request-context.types.d.ts +48 -0
- package/dist/domain/contracts/context/context_types/request-context.types.d.ts.map +1 -0
- package/dist/domain/contracts/context/context_types/request-context.types.js +2 -0
- package/dist/domain/contracts/context/context_types/request-context.types.js.map +1 -0
- package/dist/domain/contracts/context/context_types/tracing-context.types.d.ts +54 -0
- package/dist/domain/contracts/context/context_types/tracing-context.types.d.ts.map +1 -0
- package/dist/domain/contracts/context/context_types/tracing-context.types.js +2 -0
- package/dist/domain/contracts/context/context_types/tracing-context.types.js.map +1 -0
- package/dist/domain/contracts/context/index.d.ts +3 -0
- package/dist/domain/contracts/context/index.d.ts.map +1 -0
- package/dist/domain/contracts/context/index.js +2 -0
- package/dist/domain/contracts/context/index.js.map +1 -0
- package/dist/domain/contracts/context/irequest-context.contracts.d.ts +68 -0
- package/dist/domain/contracts/context/irequest-context.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/context/irequest-context.contracts.js +2 -0
- package/dist/domain/contracts/context/irequest-context.contracts.js.map +1 -0
- package/dist/domain/contracts/controllers/icontroller.contracts.d.ts +25 -0
- package/dist/domain/contracts/controllers/icontroller.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/controllers/icontroller.contracts.js +2 -0
- package/dist/domain/contracts/controllers/icontroller.contracts.js.map +1 -0
- package/dist/domain/contracts/controllers/index.d.ts +2 -0
- package/dist/domain/contracts/controllers/index.d.ts.map +1 -0
- package/dist/domain/contracts/controllers/index.js +2 -0
- package/dist/domain/contracts/controllers/index.js.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.d.ts +30 -0
- package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.js +2 -0
- package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.js.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/index.d.ts +4 -0
- package/dist/domain/contracts/cqrs/cqrs_types/index.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/index.js +2 -0
- package/dist/domain/contracts/cqrs/cqrs_types/index.js.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.d.ts +32 -0
- package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.js +2 -0
- package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.js.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.d.ts +30 -0
- package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.js +2 -0
- package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.js.map +1 -0
- package/dist/domain/contracts/cqrs/ihandler.contracts.d.ts +30 -0
- package/dist/domain/contracts/cqrs/ihandler.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/ihandler.contracts.js +2 -0
- package/dist/domain/contracts/cqrs/ihandler.contracts.js.map +1 -0
- package/dist/domain/contracts/cqrs/imediator.contracts.d.ts +41 -0
- package/dist/domain/contracts/cqrs/imediator.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/imediator.contracts.js +2 -0
- package/dist/domain/contracts/cqrs/imediator.contracts.js.map +1 -0
- package/dist/domain/contracts/cqrs/index.d.ts +5 -0
- package/dist/domain/contracts/cqrs/index.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/index.js +2 -0
- package/dist/domain/contracts/cqrs/index.js.map +1 -0
- package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.d.ts +42 -0
- package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.js +2 -0
- package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.js.map +1 -0
- package/dist/domain/contracts/datasources/index.d.ts +4 -0
- package/dist/domain/contracts/datasources/index.d.ts.map +1 -0
- package/dist/domain/contracts/datasources/index.js +2 -0
- package/dist/domain/contracts/datasources/index.js.map +1 -0
- package/dist/domain/contracts/datasources/iread-datasource.contracts.d.ts +41 -0
- package/dist/domain/contracts/datasources/iread-datasource.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/datasources/iread-datasource.contracts.js +2 -0
- package/dist/domain/contracts/datasources/iread-datasource.contracts.js.map +1 -0
- package/dist/domain/contracts/datasources/iremote-datasource.contracts.d.ts +73 -0
- package/dist/domain/contracts/datasources/iremote-datasource.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/datasources/iremote-datasource.contracts.js +2 -0
- package/dist/domain/contracts/datasources/iremote-datasource.contracts.js.map +1 -0
- package/dist/domain/contracts/datasources/iwrite-datasource.contracts.d.ts +82 -0
- package/dist/domain/contracts/datasources/iwrite-datasource.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/datasources/iwrite-datasource.contracts.js +2 -0
- package/dist/domain/contracts/datasources/iwrite-datasource.contracts.js.map +1 -0
- package/dist/domain/contracts/disposables/idisposable.contracts.d.ts +23 -0
- package/dist/domain/contracts/disposables/idisposable.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/disposables/idisposable.contracts.js +6 -0
- package/dist/domain/contracts/disposables/idisposable.contracts.js.map +1 -0
- package/dist/domain/contracts/disposables/index.d.ts +2 -0
- package/dist/domain/contracts/disposables/index.d.ts.map +1 -0
- package/dist/domain/contracts/disposables/index.js +2 -0
- package/dist/domain/contracts/disposables/index.js.map +1 -0
- package/dist/domain/contracts/factories/ifactory.contracts.d.ts +29 -0
- package/dist/domain/contracts/factories/ifactory.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/factories/ifactory.contracts.js +2 -0
- package/dist/domain/contracts/factories/ifactory.contracts.js.map +1 -0
- package/dist/domain/contracts/factories/index.d.ts +2 -0
- package/dist/domain/contracts/factories/index.d.ts.map +1 -0
- package/dist/domain/contracts/factories/index.js +2 -0
- package/dist/domain/contracts/factories/index.js.map +1 -0
- package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.d.ts +27 -0
- package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.js +2 -0
- package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.js.map +1 -0
- package/dist/domain/contracts/gate_keepers/index.d.ts +2 -0
- package/dist/domain/contracts/gate_keepers/index.d.ts.map +1 -0
- package/dist/domain/contracts/gate_keepers/index.js +2 -0
- package/dist/domain/contracts/gate_keepers/index.js.map +1 -0
- package/dist/domain/contracts/http/iallow-origin.contracts.d.ts +1 -0
- package/dist/domain/contracts/http/iallow-origin.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/http/iallow-origin.contracts.js +2 -0
- package/dist/domain/contracts/http/iallow-origin.contracts.js.map +1 -0
- package/dist/domain/contracts/http/ihttp-client.contracts.d.ts +81 -0
- package/dist/domain/contracts/http/ihttp-client.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/http/ihttp-client.contracts.js +2 -0
- package/dist/domain/contracts/http/ihttp-client.contracts.js.map +1 -0
- package/dist/domain/contracts/http/index.d.ts +2 -0
- package/dist/domain/contracts/http/index.d.ts.map +1 -0
- package/dist/domain/contracts/http/index.js +2 -0
- package/dist/domain/contracts/http/index.js.map +1 -0
- package/dist/domain/contracts/idempotency/idempotency-store.contracts.d.ts +71 -0
- package/dist/domain/contracts/idempotency/idempotency-store.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/idempotency/idempotency-store.contracts.js +2 -0
- package/dist/domain/contracts/idempotency/idempotency-store.contracts.js.map +1 -0
- package/dist/domain/contracts/idempotency/index.d.ts +2 -0
- package/dist/domain/contracts/idempotency/index.d.ts.map +1 -0
- package/dist/domain/contracts/idempotency/index.js +2 -0
- package/dist/domain/contracts/idempotency/index.js.map +1 -0
- package/dist/domain/contracts/index.d.ts +22 -0
- package/dist/domain/contracts/index.d.ts.map +1 -0
- package/dist/domain/contracts/index.js +2 -0
- package/dist/domain/contracts/index.js.map +1 -0
- package/dist/domain/contracts/loggers/ilogger-client.contracts.d.ts +27 -0
- package/dist/domain/contracts/loggers/ilogger-client.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/loggers/ilogger-client.contracts.js +2 -0
- package/dist/domain/contracts/loggers/ilogger-client.contracts.js.map +1 -0
- package/dist/domain/contracts/loggers/ilogger.contracts.d.ts +62 -0
- package/dist/domain/contracts/loggers/ilogger.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/loggers/ilogger.contracts.js +2 -0
- package/dist/domain/contracts/loggers/ilogger.contracts.js.map +1 -0
- package/dist/domain/contracts/loggers/index.d.ts +3 -0
- package/dist/domain/contracts/loggers/index.d.ts.map +1 -0
- package/dist/domain/contracts/loggers/index.js +2 -0
- package/dist/domain/contracts/loggers/index.js.map +1 -0
- package/dist/domain/contracts/mappers/ibase-mapper.contracts.d.ts +33 -0
- package/dist/domain/contracts/mappers/ibase-mapper.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/mappers/ibase-mapper.contracts.js +2 -0
- package/dist/domain/contracts/mappers/ibase-mapper.contracts.js.map +1 -0
- package/dist/domain/contracts/mappers/imapper.contracts.d.ts +53 -0
- package/dist/domain/contracts/mappers/imapper.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/mappers/imapper.contracts.js +2 -0
- package/dist/domain/contracts/mappers/imapper.contracts.js.map +1 -0
- package/dist/domain/contracts/mappers/index.d.ts +3 -0
- package/dist/domain/contracts/mappers/index.d.ts.map +1 -0
- package/dist/domain/contracts/mappers/index.js +2 -0
- package/dist/domain/contracts/mappers/index.js.map +1 -0
- package/dist/domain/contracts/middlewares/imiddleware.contracts.d.ts +34 -0
- package/dist/domain/contracts/middlewares/imiddleware.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/middlewares/imiddleware.contracts.js +2 -0
- package/dist/domain/contracts/middlewares/imiddleware.contracts.js.map +1 -0
- package/dist/domain/contracts/middlewares/index.d.ts +2 -0
- package/dist/domain/contracts/middlewares/index.d.ts.map +1 -0
- package/dist/domain/contracts/middlewares/index.js +2 -0
- package/dist/domain/contracts/middlewares/index.js.map +1 -0
- package/dist/domain/contracts/policies/index.d.ts +2 -0
- package/dist/domain/contracts/policies/index.d.ts.map +1 -0
- package/dist/domain/contracts/policies/index.js +2 -0
- package/dist/domain/contracts/policies/index.js.map +1 -0
- package/dist/domain/contracts/policies/ipolicy-registry.contracts.d.ts +38 -0
- package/dist/domain/contracts/policies/ipolicy-registry.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/policies/ipolicy-registry.contracts.js +2 -0
- package/dist/domain/contracts/policies/ipolicy-registry.contracts.js.map +1 -0
- package/dist/domain/contracts/repositories/index.d.ts +3 -0
- package/dist/domain/contracts/repositories/index.d.ts.map +1 -0
- package/dist/domain/contracts/repositories/index.js +2 -0
- package/dist/domain/contracts/repositories/index.js.map +1 -0
- package/dist/domain/contracts/repositories/iread-dao.contracts.d.ts +41 -0
- package/dist/domain/contracts/repositories/iread-dao.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/repositories/iread-dao.contracts.js +2 -0
- package/dist/domain/contracts/repositories/iread-dao.contracts.js.map +1 -0
- package/dist/domain/contracts/repositories/irepository.contracts.d.ts +95 -0
- package/dist/domain/contracts/repositories/irepository.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/repositories/irepository.contracts.js +2 -0
- package/dist/domain/contracts/repositories/irepository.contracts.js.map +1 -0
- package/dist/domain/contracts/services/auth/iauth-service.contracts.d.ts +71 -0
- package/dist/domain/contracts/services/auth/iauth-service.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/services/auth/iauth-service.contracts.js +2 -0
- package/dist/domain/contracts/services/auth/iauth-service.contracts.js.map +1 -0
- package/dist/domain/contracts/services/auth/index.d.ts +2 -0
- package/dist/domain/contracts/services/auth/index.d.ts.map +1 -0
- package/dist/domain/contracts/services/auth/index.js +2 -0
- package/dist/domain/contracts/services/auth/index.js.map +1 -0
- package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.d.ts +25 -0
- package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.js +2 -0
- package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.js.map +1 -0
- package/dist/domain/contracts/services/concurrency/index.d.ts +2 -0
- package/dist/domain/contracts/services/concurrency/index.d.ts.map +1 -0
- package/dist/domain/contracts/services/concurrency/index.js +2 -0
- package/dist/domain/contracts/services/concurrency/index.js.map +1 -0
- package/dist/domain/contracts/services/extractors/iextractor-service.contracts.d.ts +24 -0
- package/dist/domain/contracts/services/extractors/iextractor-service.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/services/extractors/iextractor-service.contracts.js +2 -0
- package/dist/domain/contracts/services/extractors/iextractor-service.contracts.js.map +1 -0
- package/dist/domain/contracts/services/extractors/index.d.ts +2 -0
- package/dist/domain/contracts/services/extractors/index.d.ts.map +1 -0
- package/dist/domain/contracts/services/extractors/index.js +2 -0
- package/dist/domain/contracts/services/extractors/index.js.map +1 -0
- package/dist/domain/contracts/services/index.d.ts +6 -0
- package/dist/domain/contracts/services/index.d.ts.map +1 -0
- package/dist/domain/contracts/services/index.js +2 -0
- package/dist/domain/contracts/services/index.js.map +1 -0
- package/dist/domain/contracts/services/resiliences/index.d.ts +2 -0
- package/dist/domain/contracts/services/resiliences/index.d.ts.map +1 -0
- package/dist/domain/contracts/services/resiliences/index.js +2 -0
- package/dist/domain/contracts/services/resiliences/index.js.map +1 -0
- package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.d.ts +26 -0
- package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.js +2 -0
- package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.js.map +1 -0
- package/dist/domain/contracts/services/validators/index.d.ts +2 -0
- package/dist/domain/contracts/services/validators/index.d.ts.map +1 -0
- package/dist/domain/contracts/services/validators/index.js +2 -0
- package/dist/domain/contracts/services/validators/index.js.map +1 -0
- package/dist/domain/contracts/services/validators/ivalidator-service.contracts.d.ts +38 -0
- package/dist/domain/contracts/services/validators/ivalidator-service.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/services/validators/ivalidator-service.contracts.js +2 -0
- package/dist/domain/contracts/services/validators/ivalidator-service.contracts.js.map +1 -0
- package/dist/domain/contracts/specifications/index.d.ts +2 -0
- package/dist/domain/contracts/specifications/index.d.ts.map +1 -0
- package/dist/domain/contracts/specifications/index.js +2 -0
- package/dist/domain/contracts/specifications/index.js.map +1 -0
- package/dist/domain/contracts/specifications/ispecification.contracts.d.ts +58 -0
- package/dist/domain/contracts/specifications/ispecification.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/specifications/ispecification.contracts.js +2 -0
- package/dist/domain/contracts/specifications/ispecification.contracts.js.map +1 -0
- package/dist/domain/contracts/storage/index.d.ts +2 -0
- package/dist/domain/contracts/storage/index.d.ts.map +1 -0
- package/dist/domain/contracts/storage/index.js +2 -0
- package/dist/domain/contracts/storage/index.js.map +1 -0
- package/dist/domain/contracts/storage/istorage.contracts.d.ts +6 -0
- package/dist/domain/contracts/storage/istorage.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/storage/istorage.contracts.js +2 -0
- package/dist/domain/contracts/storage/istorage.contracts.js.map +1 -0
- package/dist/domain/contracts/strategies/index.d.ts +2 -0
- package/dist/domain/contracts/strategies/index.d.ts.map +1 -0
- package/dist/domain/contracts/strategies/index.js +2 -0
- package/dist/domain/contracts/strategies/index.js.map +1 -0
- package/dist/domain/contracts/strategies/istrategy.contracts.d.ts +25 -0
- package/dist/domain/contracts/strategies/istrategy.contracts.d.ts.map +1 -0
- package/dist/domain/contracts/strategies/istrategy.contracts.js +2 -0
- package/dist/domain/contracts/strategies/istrategy.contracts.js.map +1 -0
- package/dist/domain/contracts/transaction/index.d.ts +3 -0
- package/dist/domain/contracts/transaction/index.d.ts.map +1 -0
- package/dist/domain/contracts/transaction/index.js +2 -0
- package/dist/domain/contracts/transaction/index.js.map +1 -0
- package/dist/domain/contracts/transaction/itransaction-state.types.d.ts +44 -0
- package/dist/domain/contracts/transaction/itransaction-state.types.d.ts.map +1 -0
- package/dist/domain/contracts/transaction/itransaction-state.types.js +2 -0
- package/dist/domain/contracts/transaction/itransaction-state.types.js.map +1 -0
- package/dist/domain/contracts/transaction/iunit-of-work.types.d.ts +25 -0
- package/dist/domain/contracts/transaction/iunit-of-work.types.d.ts.map +1 -0
- package/dist/domain/contracts/transaction/iunit-of-work.types.js +2 -0
- package/dist/domain/contracts/transaction/iunit-of-work.types.js.map +1 -0
- package/dist/domain/entities/__tests__/entity.test.d.ts +2 -0
- package/dist/domain/entities/__tests__/entity.test.d.ts.map +1 -0
- package/dist/domain/entities/__tests__/entity.test.js +53 -0
- package/dist/domain/entities/__tests__/entity.test.js.map +1 -0
- package/dist/domain/entities/entity.d.ts +43 -0
- package/dist/domain/entities/entity.d.ts.map +1 -0
- package/dist/domain/entities/entity.js +55 -0
- package/dist/domain/entities/entity.js.map +1 -0
- package/dist/domain/entities/ientity.contracts.d.ts +43 -0
- package/dist/domain/entities/ientity.contracts.d.ts.map +1 -0
- package/dist/domain/entities/ientity.contracts.js +2 -0
- package/dist/domain/entities/ientity.contracts.js.map +1 -0
- package/dist/domain/entities/index.d.ts +3 -0
- package/dist/domain/entities/index.d.ts.map +1 -0
- package/dist/domain/entities/index.js +2 -0
- package/dist/domain/entities/index.js.map +1 -0
- package/dist/domain/errors/__tests__/app-error.test.d.ts +2 -0
- package/dist/domain/errors/__tests__/app-error.test.d.ts.map +1 -0
- package/dist/domain/errors/__tests__/app-error.test.js +94 -0
- package/dist/domain/errors/__tests__/app-error.test.js.map +1 -0
- package/dist/domain/errors/app-error.d.ts +243 -0
- package/dist/domain/errors/app-error.d.ts.map +1 -0
- package/dist/domain/errors/app-error.js +259 -0
- package/dist/domain/errors/app-error.js.map +1 -0
- package/dist/domain/errors/index.d.ts +2 -0
- package/dist/domain/errors/index.d.ts.map +1 -0
- package/dist/domain/errors/index.js +2 -0
- package/dist/domain/errors/index.js.map +1 -0
- package/dist/domain/index.d.ts +8 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +6 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/results/__tests__/result.test.d.ts +2 -0
- package/dist/domain/results/__tests__/result.test.d.ts.map +1 -0
- package/dist/domain/results/__tests__/result.test.js +109 -0
- package/dist/domain/results/__tests__/result.test.js.map +1 -0
- package/dist/domain/results/index.d.ts +3 -0
- package/dist/domain/results/index.d.ts.map +1 -0
- package/dist/domain/results/index.js +2 -0
- package/dist/domain/results/index.js.map +1 -0
- package/dist/domain/results/result.d.ts +125 -0
- package/dist/domain/results/result.d.ts.map +1 -0
- package/dist/domain/results/result.js +144 -0
- package/dist/domain/results/result.js.map +1 -0
- package/dist/domain/results/result.types.d.ts +15 -0
- package/dist/domain/results/result.types.d.ts.map +1 -0
- package/dist/domain/results/result.types.js +2 -0
- package/dist/domain/results/result.types.js.map +1 -0
- package/dist/domain/unique_id/__tests__/unique-id.test.d.ts +2 -0
- package/dist/domain/unique_id/__tests__/unique-id.test.d.ts.map +1 -0
- package/dist/domain/unique_id/__tests__/unique-id.test.js +29 -0
- package/dist/domain/unique_id/__tests__/unique-id.test.js.map +1 -0
- package/dist/domain/unique_id/index.d.ts +2 -0
- package/dist/domain/unique_id/index.d.ts.map +1 -0
- package/dist/domain/unique_id/index.js +2 -0
- package/dist/domain/unique_id/index.js.map +1 -0
- package/dist/domain/unique_id/unique-id.d.ts +72 -0
- package/dist/domain/unique_id/unique-id.d.ts.map +1 -0
- package/dist/domain/unique_id/unique-id.js +87 -0
- package/dist/domain/unique_id/unique-id.js.map +1 -0
- package/dist/domain/value_objects/__tests__/value-object.test.d.ts +2 -0
- package/dist/domain/value_objects/__tests__/value-object.test.d.ts.map +1 -0
- package/dist/domain/value_objects/__tests__/value-object.test.js +43 -0
- package/dist/domain/value_objects/__tests__/value-object.test.js.map +1 -0
- package/dist/domain/value_objects/index.d.ts +3 -0
- package/dist/domain/value_objects/index.d.ts.map +1 -0
- package/dist/domain/value_objects/index.js +2 -0
- package/dist/domain/value_objects/index.js.map +1 -0
- package/dist/domain/value_objects/ivalue-object.contracts.d.ts +46 -0
- package/dist/domain/value_objects/ivalue-object.contracts.d.ts.map +1 -0
- package/dist/domain/value_objects/ivalue-object.contracts.js +2 -0
- package/dist/domain/value_objects/ivalue-object.contracts.js.map +1 -0
- package/dist/domain/value_objects/value-object.d.ts +26 -0
- package/dist/domain/value_objects/value-object.d.ts.map +1 -0
- package/dist/domain/value_objects/value-object.js +37 -0
- package/dist/domain/value_objects/value-object.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.d.ts +2 -0
- package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.d.ts.map +1 -0
- package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.js +128 -0
- package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.js.map +1 -0
- package/dist/infrastructure/auth/index.d.ts +3 -0
- package/dist/infrastructure/auth/index.d.ts.map +1 -0
- package/dist/infrastructure/auth/index.js +3 -0
- package/dist/infrastructure/auth/index.js.map +1 -0
- package/dist/infrastructure/auth/storage/cookie.storage.d.ts +4 -0
- package/dist/infrastructure/auth/storage/cookie.storage.d.ts.map +1 -0
- package/dist/infrastructure/auth/storage/cookie.storage.js +31 -0
- package/dist/infrastructure/auth/storage/cookie.storage.js.map +1 -0
- package/dist/infrastructure/auth/storage/index.d.ts +4 -0
- package/dist/infrastructure/auth/storage/index.d.ts.map +1 -0
- package/dist/infrastructure/auth/storage/index.js +4 -0
- package/dist/infrastructure/auth/storage/index.js.map +1 -0
- package/dist/infrastructure/auth/storage/memory.storage.d.ts +3 -0
- package/dist/infrastructure/auth/storage/memory.storage.d.ts.map +1 -0
- package/dist/infrastructure/auth/storage/memory.storage.js +14 -0
- package/dist/infrastructure/auth/storage/memory.storage.js.map +1 -0
- package/dist/infrastructure/auth/storage/storage.utils.d.ts +10 -0
- package/dist/infrastructure/auth/storage/storage.utils.d.ts.map +1 -0
- package/dist/infrastructure/auth/storage/storage.utils.js +22 -0
- package/dist/infrastructure/auth/storage/storage.utils.js.map +1 -0
- package/dist/infrastructure/auth/supabase-auth.service.d.ts +31 -0
- package/dist/infrastructure/auth/supabase-auth.service.d.ts.map +1 -0
- package/dist/infrastructure/auth/supabase-auth.service.js +90 -0
- package/dist/infrastructure/auth/supabase-auth.service.js.map +1 -0
- package/dist/infrastructure/cache/__tests__/in-memory.cache.test.d.ts +2 -0
- package/dist/infrastructure/cache/__tests__/in-memory.cache.test.d.ts.map +1 -0
- package/dist/infrastructure/cache/__tests__/in-memory.cache.test.js +69 -0
- package/dist/infrastructure/cache/__tests__/in-memory.cache.test.js.map +1 -0
- package/dist/infrastructure/cache/in-memory.cache.d.ts +34 -0
- package/dist/infrastructure/cache/in-memory.cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/in-memory.cache.js +66 -0
- package/dist/infrastructure/cache/in-memory.cache.js.map +1 -0
- package/dist/infrastructure/cache/index.d.ts +3 -0
- package/dist/infrastructure/cache/index.d.ts.map +1 -0
- package/dist/infrastructure/cache/index.js +3 -0
- package/dist/infrastructure/cache/index.js.map +1 -0
- package/dist/infrastructure/cache/key-builder.cache.d.ts +25 -0
- package/dist/infrastructure/cache/key-builder.cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/key-builder.cache.js +39 -0
- package/dist/infrastructure/cache/key-builder.cache.js.map +1 -0
- package/dist/infrastructure/datasources/__tests__/remote.datasource.test.d.ts +2 -0
- package/dist/infrastructure/datasources/__tests__/remote.datasource.test.d.ts.map +1 -0
- package/dist/infrastructure/datasources/__tests__/remote.datasource.test.js +176 -0
- package/dist/infrastructure/datasources/__tests__/remote.datasource.test.js.map +1 -0
- package/dist/infrastructure/datasources/index.d.ts +2 -0
- package/dist/infrastructure/datasources/index.d.ts.map +1 -0
- package/dist/infrastructure/datasources/index.js +2 -0
- package/dist/infrastructure/datasources/index.js.map +1 -0
- package/dist/infrastructure/datasources/remote.datasource.d.ts +43 -0
- package/dist/infrastructure/datasources/remote.datasource.d.ts.map +1 -0
- package/dist/infrastructure/datasources/remote.datasource.js +111 -0
- package/dist/infrastructure/datasources/remote.datasource.js.map +1 -0
- package/dist/infrastructure/factories/axios.factory.d.ts +15 -0
- package/dist/infrastructure/factories/axios.factory.d.ts.map +1 -0
- package/dist/infrastructure/factories/axios.factory.js +26 -0
- package/dist/infrastructure/factories/axios.factory.js.map +1 -0
- package/dist/infrastructure/factories/cockatiel-resilience.factory.d.ts +16 -0
- package/dist/infrastructure/factories/cockatiel-resilience.factory.d.ts.map +1 -0
- package/dist/infrastructure/factories/cockatiel-resilience.factory.js +114 -0
- package/dist/infrastructure/factories/cockatiel-resilience.factory.js.map +1 -0
- package/dist/infrastructure/factories/index.d.ts +2 -0
- package/dist/infrastructure/factories/index.d.ts.map +1 -0
- package/dist/infrastructure/factories/index.js +2 -0
- package/dist/infrastructure/factories/index.js.map +1 -0
- package/dist/infrastructure/http/__tests__/axios.http.test.d.ts +2 -0
- package/dist/infrastructure/http/__tests__/axios.http.test.d.ts.map +1 -0
- package/dist/infrastructure/http/__tests__/axios.http.test.js +196 -0
- package/dist/infrastructure/http/__tests__/axios.http.test.js.map +1 -0
- package/dist/infrastructure/http/allow-origin.http.d.ts +8 -0
- package/dist/infrastructure/http/allow-origin.http.d.ts.map +1 -0
- package/dist/infrastructure/http/allow-origin.http.js +13 -0
- package/dist/infrastructure/http/allow-origin.http.js.map +1 -0
- package/dist/infrastructure/http/axios.http.d.ts +17 -0
- package/dist/infrastructure/http/axios.http.d.ts.map +1 -0
- package/dist/infrastructure/http/axios.http.js +89 -0
- package/dist/infrastructure/http/axios.http.js.map +1 -0
- package/dist/infrastructure/http/index.d.ts +2 -0
- package/dist/infrastructure/http/index.d.ts.map +1 -0
- package/dist/infrastructure/http/index.js +2 -0
- package/dist/infrastructure/http/index.js.map +1 -0
- package/dist/infrastructure/index.d.ts +7 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +7 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/infrastructure/mappers/index.d.ts +3 -0
- package/dist/infrastructure/mappers/index.d.ts.map +1 -0
- package/dist/infrastructure/mappers/index.js +3 -0
- package/dist/infrastructure/mappers/index.js.map +1 -0
- package/dist/infrastructure/mappers/supabase-claims.mapper.d.ts +15 -0
- package/dist/infrastructure/mappers/supabase-claims.mapper.d.ts.map +1 -0
- package/dist/infrastructure/mappers/supabase-claims.mapper.js +30 -0
- package/dist/infrastructure/mappers/supabase-claims.mapper.js.map +1 -0
- package/dist/infrastructure/mappers/supabase-session.mapper.d.ts +8 -0
- package/dist/infrastructure/mappers/supabase-session.mapper.d.ts.map +1 -0
- package/dist/infrastructure/mappers/supabase-session.mapper.js +16 -0
- package/dist/infrastructure/mappers/supabase-session.mapper.js.map +1 -0
- package/dist/infrastructure/resiliences/__tests__/resilience.service.test.d.ts +2 -0
- package/dist/infrastructure/resiliences/__tests__/resilience.service.test.d.ts.map +1 -0
- package/dist/infrastructure/resiliences/__tests__/resilience.service.test.js +47 -0
- package/dist/infrastructure/resiliences/__tests__/resilience.service.test.js.map +1 -0
- package/dist/infrastructure/resiliences/index.d.ts +2 -0
- package/dist/infrastructure/resiliences/index.d.ts.map +1 -0
- package/dist/infrastructure/resiliences/index.js +2 -0
- package/dist/infrastructure/resiliences/index.js.map +1 -0
- package/dist/infrastructure/resiliences/resilience.service.d.ts +18 -0
- package/dist/infrastructure/resiliences/resilience.service.d.ts.map +1 -0
- package/dist/infrastructure/resiliences/resilience.service.js +21 -0
- package/dist/infrastructure/resiliences/resilience.service.js.map +1 -0
- package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.d.ts +2 -0
- package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.d.ts.map +1 -0
- package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.js +68 -0
- package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.js.map +1 -0
- package/dist/infrastructure/validators/__tests__/zod.validator.test.d.ts +2 -0
- package/dist/infrastructure/validators/__tests__/zod.validator.test.d.ts.map +1 -0
- package/dist/infrastructure/validators/__tests__/zod.validator.test.js +72 -0
- package/dist/infrastructure/validators/__tests__/zod.validator.test.js.map +1 -0
- package/dist/infrastructure/validators/base-schema.constant.d.ts +30 -0
- package/dist/infrastructure/validators/base-schema.constant.d.ts.map +1 -0
- package/dist/infrastructure/validators/base-schema.constant.js +41 -0
- package/dist/infrastructure/validators/base-schema.constant.js.map +1 -0
- package/dist/infrastructure/validators/constants/zod.constant.d.ts +24 -0
- package/dist/infrastructure/validators/constants/zod.constant.d.ts.map +1 -0
- package/dist/infrastructure/validators/constants/zod.constant.js +23 -0
- package/dist/infrastructure/validators/constants/zod.constant.js.map +1 -0
- package/dist/infrastructure/validators/index.d.ts +3 -0
- package/dist/infrastructure/validators/index.d.ts.map +1 -0
- package/dist/infrastructure/validators/index.js +3 -0
- package/dist/infrastructure/validators/index.js.map +1 -0
- package/dist/infrastructure/validators/schema-zod.utils.d.ts +27 -0
- package/dist/infrastructure/validators/schema-zod.utils.d.ts.map +1 -0
- package/dist/infrastructure/validators/schema-zod.utils.js +27 -0
- package/dist/infrastructure/validators/schema-zod.utils.js.map +1 -0
- package/dist/infrastructure/validators/zod.validator.d.ts +31 -0
- package/dist/infrastructure/validators/zod.validator.d.ts.map +1 -0
- package/dist/infrastructure/validators/zod.validator.js +53 -0
- package/dist/infrastructure/validators/zod.validator.js.map +1 -0
- package/dist/shared/constants/concurrency.constants.d.ts +42 -0
- package/dist/shared/constants/concurrency.constants.d.ts.map +1 -0
- package/dist/shared/constants/concurrency.constants.js +42 -0
- package/dist/shared/constants/concurrency.constants.js.map +1 -0
- package/dist/shared/constants/error.constants.d.ts +272 -0
- package/dist/shared/constants/error.constants.d.ts.map +1 -0
- package/dist/shared/constants/error.constants.js +278 -0
- package/dist/shared/constants/error.constants.js.map +1 -0
- package/dist/shared/constants/guest.constants.d.ts +52 -0
- package/dist/shared/constants/guest.constants.d.ts.map +1 -0
- package/dist/shared/constants/guest.constants.js +53 -0
- package/dist/shared/constants/guest.constants.js.map +1 -0
- package/dist/shared/constants/idempotency.constants.d.ts +72 -0
- package/dist/shared/constants/idempotency.constants.d.ts.map +1 -0
- package/dist/shared/constants/idempotency.constants.js +72 -0
- package/dist/shared/constants/idempotency.constants.js.map +1 -0
- package/dist/shared/constants/index.d.ts +11 -0
- package/dist/shared/constants/index.d.ts.map +1 -0
- package/dist/shared/constants/index.js +11 -0
- package/dist/shared/constants/index.js.map +1 -0
- package/dist/shared/constants/log-level.constants.d.ts +64 -0
- package/dist/shared/constants/log-level.constants.d.ts.map +1 -0
- package/dist/shared/constants/log-level.constants.js +89 -0
- package/dist/shared/constants/log-level.constants.js.map +1 -0
- package/dist/shared/constants/pagination.constants.d.ts +70 -0
- package/dist/shared/constants/pagination.constants.d.ts.map +1 -0
- package/dist/shared/constants/pagination.constants.js +88 -0
- package/dist/shared/constants/pagination.constants.js.map +1 -0
- package/dist/shared/constants/request.constants.d.ts +34 -0
- package/dist/shared/constants/request.constants.d.ts.map +1 -0
- package/dist/shared/constants/request.constants.js +26 -0
- package/dist/shared/constants/request.constants.js.map +1 -0
- package/dist/shared/constants/resilience.constants.d.ts +89 -0
- package/dist/shared/constants/resilience.constants.d.ts.map +1 -0
- package/dist/shared/constants/resilience.constants.js +89 -0
- package/dist/shared/constants/resilience.constants.js.map +1 -0
- package/dist/shared/constants/roles.constants.d.ts +84 -0
- package/dist/shared/constants/roles.constants.d.ts.map +1 -0
- package/dist/shared/constants/roles.constants.js +68 -0
- package/dist/shared/constants/roles.constants.js.map +1 -0
- package/dist/shared/constants/tokens.constants.d.ts +373 -0
- package/dist/shared/constants/tokens.constants.d.ts.map +1 -0
- package/dist/shared/constants/tokens.constants.js +373 -0
- package/dist/shared/constants/tokens.constants.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/types/api-response.types.d.ts +185 -0
- package/dist/shared/types/api-response.types.d.ts.map +1 -0
- package/dist/shared/types/api-response.types.js +2 -0
- package/dist/shared/types/api-response.types.js.map +1 -0
- package/dist/shared/types/auth-policy.types.d.ts +48 -0
- package/dist/shared/types/auth-policy.types.d.ts.map +1 -0
- package/dist/shared/types/auth-policy.types.js +2 -0
- package/dist/shared/types/auth-policy.types.js.map +1 -0
- package/dist/shared/types/auth.types.d.ts +106 -0
- package/dist/shared/types/auth.types.d.ts.map +1 -0
- package/dist/shared/types/auth.types.js +2 -0
- package/dist/shared/types/auth.types.js.map +1 -0
- package/dist/shared/types/cache.types.d.ts +64 -0
- package/dist/shared/types/cache.types.d.ts.map +1 -0
- package/dist/shared/types/cache.types.js +2 -0
- package/dist/shared/types/cache.types.js.map +1 -0
- package/dist/shared/types/common.types.d.ts +213 -0
- package/dist/shared/types/common.types.d.ts.map +1 -0
- package/dist/shared/types/common.types.js +3 -0
- package/dist/shared/types/common.types.js.map +1 -0
- package/dist/shared/types/http.types.d.ts +188 -0
- package/dist/shared/types/http.types.d.ts.map +1 -0
- package/dist/shared/types/http.types.js +2 -0
- package/dist/shared/types/http.types.js.map +1 -0
- package/dist/shared/types/index.d.ts +10 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/shared/types/index.js +2 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/shared/types/injection-token.types.d.ts +38 -0
- package/dist/shared/types/injection-token.types.d.ts.map +1 -0
- package/dist/shared/types/injection-token.types.js +2 -0
- package/dist/shared/types/injection-token.types.js.map +1 -0
- package/dist/shared/types/metadata.types.d.ts +150 -0
- package/dist/shared/types/metadata.types.d.ts.map +1 -0
- package/dist/shared/types/metadata.types.js +2 -0
- package/dist/shared/types/metadata.types.js.map +1 -0
- package/dist/shared/types/pagination.types.d.ts +88 -0
- package/dist/shared/types/pagination.types.d.ts.map +1 -0
- package/dist/shared/types/pagination.types.js +3 -0
- package/dist/shared/types/pagination.types.js.map +1 -0
- package/dist/shared/utils/__tests__/date.utils.test.d.ts +2 -0
- package/dist/shared/utils/__tests__/date.utils.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/date.utils.test.js +97 -0
- package/dist/shared/utils/__tests__/date.utils.test.js.map +1 -0
- package/dist/shared/utils/__tests__/guards.utils.test.d.ts +2 -0
- package/dist/shared/utils/__tests__/guards.utils.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/guards.utils.test.js +324 -0
- package/dist/shared/utils/__tests__/guards.utils.test.js.map +1 -0
- package/dist/shared/utils/__tests__/guid.utils.test.d.ts +2 -0
- package/dist/shared/utils/__tests__/guid.utils.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/guid.utils.test.js +97 -0
- package/dist/shared/utils/__tests__/guid.utils.test.js.map +1 -0
- package/dist/shared/utils/__tests__/http.utils.test.d.ts +2 -0
- package/dist/shared/utils/__tests__/http.utils.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/http.utils.test.js +230 -0
- package/dist/shared/utils/__tests__/http.utils.test.js.map +1 -0
- package/dist/shared/utils/__tests__/math.utils.test.d.ts +2 -0
- package/dist/shared/utils/__tests__/math.utils.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/math.utils.test.js +93 -0
- package/dist/shared/utils/__tests__/math.utils.test.js.map +1 -0
- package/dist/shared/utils/__tests__/promise.utils.test.d.ts +2 -0
- package/dist/shared/utils/__tests__/promise.utils.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/promise.utils.test.js +101 -0
- package/dist/shared/utils/__tests__/promise.utils.test.js.map +1 -0
- package/dist/shared/utils/__tests__/string.utils.test.d.ts +2 -0
- package/dist/shared/utils/__tests__/string.utils.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/string.utils.test.js +153 -0
- package/dist/shared/utils/__tests__/string.utils.test.js.map +1 -0
- package/dist/shared/utils/abort.utils.d.ts +34 -0
- package/dist/shared/utils/abort.utils.d.ts.map +1 -0
- package/dist/shared/utils/abort.utils.js +55 -0
- package/dist/shared/utils/abort.utils.js.map +1 -0
- package/dist/shared/utils/date.utils.d.ts +75 -0
- package/dist/shared/utils/date.utils.d.ts.map +1 -0
- package/dist/shared/utils/date.utils.js +88 -0
- package/dist/shared/utils/date.utils.js.map +1 -0
- package/dist/shared/utils/enumerable.utils.d.ts +43 -0
- package/dist/shared/utils/enumerable.utils.d.ts.map +1 -0
- package/dist/shared/utils/enumerable.utils.js +52 -0
- package/dist/shared/utils/enumerable.utils.js.map +1 -0
- package/dist/shared/utils/guards.utils.d.ts +245 -0
- package/dist/shared/utils/guards.utils.d.ts.map +1 -0
- package/dist/shared/utils/guards.utils.js +308 -0
- package/dist/shared/utils/guards.utils.js.map +1 -0
- package/dist/shared/utils/guid.utils.d.ts +73 -0
- package/dist/shared/utils/guid.utils.d.ts.map +1 -0
- package/dist/shared/utils/guid.utils.js +89 -0
- package/dist/shared/utils/guid.utils.js.map +1 -0
- package/dist/shared/utils/http.utils.d.ts +75 -0
- package/dist/shared/utils/http.utils.d.ts.map +1 -0
- package/dist/shared/utils/http.utils.js +144 -0
- package/dist/shared/utils/http.utils.js.map +1 -0
- package/dist/shared/utils/index.d.ts +11 -0
- package/dist/shared/utils/index.d.ts.map +1 -0
- package/dist/shared/utils/index.js +11 -0
- package/dist/shared/utils/index.js.map +1 -0
- package/dist/shared/utils/math.utils.d.ts +79 -0
- package/dist/shared/utils/math.utils.d.ts.map +1 -0
- package/dist/shared/utils/math.utils.js +97 -0
- package/dist/shared/utils/math.utils.js.map +1 -0
- package/dist/shared/utils/promise.utils.d.ts +40 -0
- package/dist/shared/utils/promise.utils.d.ts.map +1 -0
- package/dist/shared/utils/promise.utils.js +45 -0
- package/dist/shared/utils/promise.utils.js.map +1 -0
- package/dist/shared/utils/sanitize.utils.d.ts +39 -0
- package/dist/shared/utils/sanitize.utils.d.ts.map +1 -0
- package/dist/shared/utils/sanitize.utils.js +67 -0
- package/dist/shared/utils/sanitize.utils.js.map +1 -0
- package/dist/shared/utils/string.utils.d.ts +102 -0
- package/dist/shared/utils/string.utils.d.ts.map +1 -0
- package/dist/shared/utils/string.utils.js +157 -0
- package/dist/shared/utils/string.utils.js.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { UniqueId } from '../../../domain';
|
|
3
|
+
import { GuidHelper } from '../../../shared';
|
|
4
|
+
import { Entity } from '../entity';
|
|
5
|
+
class SampleEntity extends Entity {
|
|
6
|
+
constructor(props, id) {
|
|
7
|
+
super(props, id);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
describe('Entity', () => {
|
|
11
|
+
it('creates a new UniqueId when no id is provided', () => {
|
|
12
|
+
const props = { name: 'alice', tags: ['admin'] };
|
|
13
|
+
const entity = new SampleEntity(props);
|
|
14
|
+
expect(entity.id).toBeInstanceOf(UniqueId);
|
|
15
|
+
expect(entity.getProps()).toEqual(props);
|
|
16
|
+
});
|
|
17
|
+
it('uses the provided UniqueId when it is valid', () => {
|
|
18
|
+
const props = { name: 'bob', tags: ['user'] };
|
|
19
|
+
const id = GuidHelper.generate();
|
|
20
|
+
const entity = new SampleEntity(props, id);
|
|
21
|
+
expect(entity.id.getValue()).toBe(id);
|
|
22
|
+
expect(entity.getProps()).toEqual(props);
|
|
23
|
+
});
|
|
24
|
+
it('throws when an invalid UniqueId is provided', () => {
|
|
25
|
+
const props = { name: 'carol', tags: [] };
|
|
26
|
+
const invalidId = 'not-a-guid';
|
|
27
|
+
expect(() => new SampleEntity(props, invalidId)).toThrow(`Invalid UniqueId provided: ${invalidId}.`);
|
|
28
|
+
});
|
|
29
|
+
it('getProps returns the properties of the entity', () => {
|
|
30
|
+
const props = { name: 'dave', tags: ['editor'] };
|
|
31
|
+
const entity = new SampleEntity(props);
|
|
32
|
+
expect(entity.getProps()).toEqual(props);
|
|
33
|
+
});
|
|
34
|
+
it('properties are immutable', () => {
|
|
35
|
+
const props = { name: 'eve', tags: ['viewer'] };
|
|
36
|
+
const entity = new SampleEntity(props);
|
|
37
|
+
const retrievedProps = entity.getProps();
|
|
38
|
+
retrievedProps.name = 'mallory';
|
|
39
|
+
retrievedProps.tags.push('hacker');
|
|
40
|
+
expect(entity.getProps()).toEqual(props);
|
|
41
|
+
});
|
|
42
|
+
it('entity instance is frozen', () => {
|
|
43
|
+
const props = { name: 'frank', tags: ['contributor'] };
|
|
44
|
+
const entity = new SampleEntity(props);
|
|
45
|
+
expect(Object.isFrozen(entity)).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
it('getId returns the UniqueId of the entity', () => {
|
|
48
|
+
const props = { name: 'grace', tags: ['moderator'] };
|
|
49
|
+
const entity = new SampleEntity(props);
|
|
50
|
+
expect(entity.getId()).toBe(entity.id);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=entity.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.test.js","sourceRoot":"","sources":["../../../../src/domain/entities/__tests__/entity.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAOlC,MAAM,YAAa,SAAQ,MAAmB;IAC5C,YAAY,KAAkB,EAAE,EAAW;QACzC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAClB,CAAC;CACF;AAED,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,KAAK,GAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAA;QAE7D,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAA;QAEtC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAA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queId } from '../unique_id/unique-id';
|
|
3
|
+
import type { IEntity } from './ientity.contracts';
|
|
4
|
+
/**
|
|
5
|
+
* A base class representing a generic entity in the domain. An entity is an object that has a unique identity and is defined by its properties.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of the properties of the entity.
|
|
8
|
+
|
|
9
|
+
*
|
|
10
|
+
* @author Xeno
|
|
11
|
+
* @version 1.0.0
|
|
12
|
+
* @since 2025-09-30
|
|
13
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class Entity<T> implements IEntity<T> {
|
|
16
|
+
readonly id: UniqueId;
|
|
17
|
+
/**
|
|
18
|
+
* The properties of the entity. This is a private property that holds the state of the entity. It should be accessed and modified through methods defined in the concrete entity classes to ensure encapsulation and maintain invariants.
|
|
19
|
+
|
|
20
|
+
*
|
|
21
|
+
* @author Xeno
|
|
22
|
+
* @version 1.0.0
|
|
23
|
+
* @since 2025-09-30
|
|
24
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
25
|
+
*/
|
|
26
|
+
private readonly props;
|
|
27
|
+
/**
|
|
28
|
+
* Protected constructor to prevent direct instantiation. Concrete entity classes should extend this base class and call this constructor with the appropriate properties and an optional unique identifier.
|
|
29
|
+
*
|
|
30
|
+
* @param props - The properties of the entity.
|
|
31
|
+
* @param id - An optional unique identifier for the entity. If not provided, a new UniqueId will be generated.
|
|
32
|
+
|
|
33
|
+
*
|
|
34
|
+
* @author Xeno
|
|
35
|
+
* @version 1.0.0
|
|
36
|
+
* @since 2025-09-30
|
|
37
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
38
|
+
*/
|
|
39
|
+
protected constructor(props: T, id?: Optional<string>);
|
|
40
|
+
getProps(): T;
|
|
41
|
+
getId(): UniqueId;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD;;;;;;;;;;KAUK;AACL,8BAAsB,MAAM,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACnD,SAAgB,EAAE,EAAE,QAAQ,CAAA;IAE5B;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAG;IAEzB;;;;;;;;;;;OAWG;IACH,SAAS,aAAa,KAAK,EAAE,CAAC,EAAE,EAAE,GAAE,QAAQ,CAAC,MAAM,CAAa;IAUzD,QAAQ,IAAI,CAAC;IAIb,KAAK,IAAI,QAAQ;CAGzB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Guards, GuidHelper } from '../../shared';
|
|
2
|
+
import { UniqueId } from '../unique_id/unique-id';
|
|
3
|
+
/**
|
|
4
|
+
* A base class representing a generic entity in the domain. An entity is an object that has a unique identity and is defined by its properties.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The type of the properties of the entity.
|
|
7
|
+
|
|
8
|
+
*
|
|
9
|
+
* @author Xeno
|
|
10
|
+
* @version 1.0.0
|
|
11
|
+
* @since 2025-09-30
|
|
12
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
13
|
+
*/
|
|
14
|
+
export class Entity {
|
|
15
|
+
id;
|
|
16
|
+
/**
|
|
17
|
+
* The properties of the entity. This is a private property that holds the state of the entity. It should be accessed and modified through methods defined in the concrete entity classes to ensure encapsulation and maintain invariants.
|
|
18
|
+
|
|
19
|
+
*
|
|
20
|
+
* @author Xeno
|
|
21
|
+
* @version 1.0.0
|
|
22
|
+
* @since 2025-09-30
|
|
23
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
24
|
+
*/
|
|
25
|
+
props;
|
|
26
|
+
/**
|
|
27
|
+
* Protected constructor to prevent direct instantiation. Concrete entity classes should extend this base class and call this constructor with the appropriate properties and an optional unique identifier.
|
|
28
|
+
*
|
|
29
|
+
* @param props - The properties of the entity.
|
|
30
|
+
* @param id - An optional unique identifier for the entity. If not provided, a new UniqueId will be generated.
|
|
31
|
+
|
|
32
|
+
*
|
|
33
|
+
* @author Xeno
|
|
34
|
+
* @version 1.0.0
|
|
35
|
+
* @since 2025-09-30
|
|
36
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
37
|
+
*/
|
|
38
|
+
constructor(props, id = undefined) {
|
|
39
|
+
if (Guards.isNullOrEmpty(id) || GuidHelper.isValid(id)) {
|
|
40
|
+
this.id = UniqueId.create(id);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw new Error(`Invalid UniqueId provided: ${id}.`);
|
|
44
|
+
}
|
|
45
|
+
this.props = Object.freeze({ ...props });
|
|
46
|
+
Object.freeze(this);
|
|
47
|
+
}
|
|
48
|
+
getProps() {
|
|
49
|
+
return structuredClone(this.props);
|
|
50
|
+
}
|
|
51
|
+
getId() {
|
|
52
|
+
return this.id;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/domain/entities/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD;;;;;;;;;;KAUK;AACL,MAAM,OAAgB,MAAM;IACV,EAAE,CAAU;IAE5B;;;;;;;;OAQG;IACc,KAAK,CAAG;IAEzB;;;;;;;;;;;OAWG;IACH,YAAsB,KAAQ,EAAE,KAAuB,SAAS;QAC9D,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;YACvD,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC/B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,8BAA8B,EAAE,GAAG,CAAC,CAAA;QACtD,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAEM,QAAQ;QACb,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;IAEM,KAAK;QACV,OAAO,IAAI,CAAC,EAAE,CAAA;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { UniqueId } from '../unique_id/unique-id';
|
|
2
|
+
/**
|
|
3
|
+
* An interface representing a generic entity in the domain. An entity is an object that has a unique identity and is defined by its properties.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of the properties of the entity.
|
|
6
|
+
|
|
7
|
+
*
|
|
8
|
+
* @author Xeno
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
* @since 2025-09-30
|
|
11
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
12
|
+
*/
|
|
13
|
+
export interface IEntity<T> {
|
|
14
|
+
/**
|
|
15
|
+
* The unique identifier of the entity. This is a read-only property that should be assigned when the entity is created and should not change throughout the lifecycle of the entity.
|
|
16
|
+
* @see UniqueId for more details on the unique identifier.
|
|
17
|
+
|
|
18
|
+
*
|
|
19
|
+
* @author Xeno
|
|
20
|
+
* @version 1.0.0
|
|
21
|
+
* @since 2025-09-30
|
|
22
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
23
|
+
*/
|
|
24
|
+
readonly id: UniqueId;
|
|
25
|
+
/** Retrieves the properties of the entity.
|
|
26
|
+
*
|
|
27
|
+
* @returns The properties of the entity.
|
|
28
|
+
* @throws An error if the entity is in an invalid state or if the properties cannot be retrieved.
|
|
29
|
+
|
|
30
|
+
*
|
|
31
|
+
* @author Xeno
|
|
32
|
+
* @version 1.0.0
|
|
33
|
+
* @since 2025-09-30
|
|
34
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
35
|
+
*/
|
|
36
|
+
getProps(): T;
|
|
37
|
+
/** Retrieves the unique identifier of the entity.
|
|
38
|
+
*
|
|
39
|
+
* @returns The unique identifier of the entity.
|
|
40
|
+
*/
|
|
41
|
+
getId(): UniqueId;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=ientity.contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ientity.contracts.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/ientity.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEtD;;;;;;;;;;KAUK;AACL,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAA;IAErB;;;;;;;;;;OAUG;IACH,QAAQ,IAAI,CAAC,CAAA;IAEb;;;OAGG;IACH,KAAK,IAAI,QAAQ,CAAA;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ientity.contracts.js","sourceRoot":"","sources":["../../../src/domain/entities/ientity.contracts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,mBAAmB,qBAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-error.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/errors/__tests__/app-error.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { AppError } from '../app-error';
|
|
3
|
+
describe('AppError', () => {
|
|
4
|
+
it('creates an AppError with the provided message, code, status, name, and cause', () => {
|
|
5
|
+
const error = AppError.create({
|
|
6
|
+
message: 'Something went wrong',
|
|
7
|
+
code: 'ERROR_CODE',
|
|
8
|
+
status: 400,
|
|
9
|
+
name: 'TestError',
|
|
10
|
+
cause: new Error('Underlying error'),
|
|
11
|
+
});
|
|
12
|
+
expect(error).toBeInstanceOf(AppError);
|
|
13
|
+
expect(error.name).toBe('TestError');
|
|
14
|
+
expect(error.message).toBe('Something went wrong');
|
|
15
|
+
expect(error.code).toBe('ERROR_CODE');
|
|
16
|
+
expect(error.status).toBe(400);
|
|
17
|
+
expect(error.cause).toBeInstanceOf(Error);
|
|
18
|
+
});
|
|
19
|
+
it('supports undefined as a valid cause', () => {
|
|
20
|
+
const error = AppError.create({
|
|
21
|
+
message: 'Failed to process request',
|
|
22
|
+
code: 'PROCESSING_ERROR',
|
|
23
|
+
status: 500,
|
|
24
|
+
name: 'TestError',
|
|
25
|
+
cause: undefined,
|
|
26
|
+
});
|
|
27
|
+
expect(error.cause).toBeUndefined();
|
|
28
|
+
});
|
|
29
|
+
it('supports null as a valid cause', () => {
|
|
30
|
+
const error = AppError.create({
|
|
31
|
+
message: 'Failed to process request',
|
|
32
|
+
code: 'PROCESSING_ERROR',
|
|
33
|
+
status: 500,
|
|
34
|
+
name: 'TestError',
|
|
35
|
+
cause: null,
|
|
36
|
+
});
|
|
37
|
+
expect(error.cause).toBeNull();
|
|
38
|
+
});
|
|
39
|
+
it('throws an AppError when using the throw method', () => {
|
|
40
|
+
expect(() => AppError.throw({
|
|
41
|
+
message: 'Unauthorized access',
|
|
42
|
+
code: 'UNAUTHORIZED',
|
|
43
|
+
status: 401,
|
|
44
|
+
name: 'TestError',
|
|
45
|
+
cause: new Error('Invalid credentials'),
|
|
46
|
+
})).toThrowError(AppError);
|
|
47
|
+
});
|
|
48
|
+
it('creates an aborted AppError with the correct properties', () => {
|
|
49
|
+
const error = AppError.aborted('TestContext');
|
|
50
|
+
expect(error).toBeInstanceOf(AppError);
|
|
51
|
+
expect(error.name).toBe('TestContext');
|
|
52
|
+
expect(error.message).toBe('errors.aborted');
|
|
53
|
+
expect(error.code).toBe('ABORTED');
|
|
54
|
+
expect(error.status).toBe(499);
|
|
55
|
+
expect(error.cause).toBeInstanceOf(Error);
|
|
56
|
+
expect(error.cause).toEqual(new Error('The client closed the connection before the server finished responding.'));
|
|
57
|
+
});
|
|
58
|
+
it('throws an AppError when signal is aborted', () => {
|
|
59
|
+
const abortController = new AbortController();
|
|
60
|
+
abortController.abort();
|
|
61
|
+
expect(() => AppError.throwIfAborted(abortController.signal, 'TestContext')).toThrowError(AppError);
|
|
62
|
+
});
|
|
63
|
+
it('does not throw when signal is not aborted', () => {
|
|
64
|
+
const abortController = new AbortController();
|
|
65
|
+
expect(() => AppError.throwIfAborted(abortController.signal, 'TestContext')).not.toThrow();
|
|
66
|
+
});
|
|
67
|
+
it('does not throw when signal is undefined', () => {
|
|
68
|
+
expect(() => AppError.throwIfAborted(undefined, 'TestContext')).not.toThrow();
|
|
69
|
+
});
|
|
70
|
+
it('does not throw when signal is null', () => {
|
|
71
|
+
expect(() => AppError.throwIfAborted(null, 'TestContext')).not.toThrow();
|
|
72
|
+
});
|
|
73
|
+
it('is an instance of the built-in Error class', () => {
|
|
74
|
+
const error = AppError.create({
|
|
75
|
+
message: 'An error occurred',
|
|
76
|
+
code: 'ERROR_CODE',
|
|
77
|
+
status: 500,
|
|
78
|
+
name: 'TestError',
|
|
79
|
+
cause: new Error('Underlying error'),
|
|
80
|
+
});
|
|
81
|
+
expect(error).toBeInstanceOf(Error);
|
|
82
|
+
});
|
|
83
|
+
it('has a stack trace', () => {
|
|
84
|
+
const error = AppError.create({
|
|
85
|
+
message: 'An error occurred',
|
|
86
|
+
code: 'ERROR_CODE',
|
|
87
|
+
status: 500,
|
|
88
|
+
name: 'TestError',
|
|
89
|
+
cause: new Error('Underlying error'),
|
|
90
|
+
});
|
|
91
|
+
expect(error.stack).toBeDefined();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=app-error.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-error.test.js","sourceRoot":"","sources":["../../../../src/domain/errors/__tests__/app-error.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,8EAA8E,EAAE,GAAG,EAAE;QACtF,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC5B,OAAO,EAAE,sBAAsB;YAC/B,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,IAAI,KAAK,CAAC,kBAAkB,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;QACtC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACpC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;QAClD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,C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AAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;IAC/E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;IAC1E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC5B,OAAO,EAAE,mBAAmB;YAC5B,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,IAAI,KAAK,CAAC,kBAAkB,CAAC;SACrC,CAAC,CAAA;QACF,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC5B,OAAO,EAAE,mBAAmB;YAC5B,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,IAAI,KAAK,CAAC,kBAAkB,CAAC;SACrC,CAAC,CAAA;QACF,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;IACnC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { Maybe, Optional } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* A class representing an application error, which extends the built-in Error class.
|
|
4
|
+
* It includes additional properties such as an error code and an HTTP status code.
|
|
5
|
+
|
|
6
|
+
*
|
|
7
|
+
* @author Xeno
|
|
8
|
+
* @version 1.0.0
|
|
9
|
+
* @since 2025-09-30
|
|
10
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
11
|
+
*/
|
|
12
|
+
interface ErrorPayload {
|
|
13
|
+
/** The error message describing the error.
|
|
14
|
+
*
|
|
15
|
+
* @author Xeno
|
|
16
|
+
* @version 1.0.0
|
|
17
|
+
* @since 2025-09-30
|
|
18
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
19
|
+
*/
|
|
20
|
+
message: string;
|
|
21
|
+
/** The error code representing the type of error.
|
|
22
|
+
*
|
|
23
|
+
* @author Xeno
|
|
24
|
+
* @version 1.0.0
|
|
25
|
+
* @since 2025-09-30
|
|
26
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
27
|
+
*/
|
|
28
|
+
code: string;
|
|
29
|
+
/** The HTTP status code associated with the error.
|
|
30
|
+
*
|
|
31
|
+
* @author Xeno
|
|
32
|
+
* @version 1.0.0
|
|
33
|
+
* @since 2025-09-30
|
|
34
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
35
|
+
*/
|
|
36
|
+
status: number;
|
|
37
|
+
/** The name of the error, typically the class name.
|
|
38
|
+
*
|
|
39
|
+
* @author Xeno
|
|
40
|
+
* @version 1.0.0
|
|
41
|
+
* @since 2025-09-30
|
|
42
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
43
|
+
*/
|
|
44
|
+
name: string;
|
|
45
|
+
/** An optional property to hold the original error or any additional context.
|
|
46
|
+
*
|
|
47
|
+
* @author Xeno
|
|
48
|
+
* @version 1.0.0
|
|
49
|
+
* @since 2025-09-30
|
|
50
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
51
|
+
*/
|
|
52
|
+
cause: Optional<unknown>;
|
|
53
|
+
/** A Dictionary to hold any additional context or information related to the error.
|
|
54
|
+
*
|
|
55
|
+
* @author Xeno
|
|
56
|
+
* @version 1.0.0
|
|
57
|
+
* @since 2025-09-30
|
|
58
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
59
|
+
*/
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A class representing an application error, which extends the built-in Error class.
|
|
64
|
+
* It includes additional properties such as an error code and an HTTP status code.
|
|
65
|
+
|
|
66
|
+
*
|
|
67
|
+
* @author Xeno
|
|
68
|
+
* @version 1.0.0
|
|
69
|
+
* @since 2025-09-30
|
|
70
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
71
|
+
*/
|
|
72
|
+
export declare class AppError extends Error {
|
|
73
|
+
/**
|
|
74
|
+
* The error code representing the type of error.
|
|
75
|
+
|
|
76
|
+
*
|
|
77
|
+
* @author Xeno
|
|
78
|
+
* @version 1.0.0
|
|
79
|
+
* @since 2025-09-30
|
|
80
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
81
|
+
*/
|
|
82
|
+
readonly code: string;
|
|
83
|
+
/**
|
|
84
|
+
* The HTTP status code associated with the error.
|
|
85
|
+
|
|
86
|
+
*
|
|
87
|
+
* @author Xeno
|
|
88
|
+
* @version 1.0.0
|
|
89
|
+
* @since 2025-09-30
|
|
90
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
91
|
+
*/
|
|
92
|
+
readonly status: number;
|
|
93
|
+
/**
|
|
94
|
+
* A Dictionary to hold any additional context or information related to the error.
|
|
95
|
+
*
|
|
96
|
+
* @author Xeno
|
|
97
|
+
* @version 1.0.0
|
|
98
|
+
* @since 2025-09-30
|
|
99
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
100
|
+
*/
|
|
101
|
+
readonly [key: string]: unknown;
|
|
102
|
+
/**
|
|
103
|
+
* Private constructor to prevent direct instantiation. Use the static methods `create` and `throw` to create instances.
|
|
104
|
+
*
|
|
105
|
+
* @param payload - The payload containing error details.
|
|
106
|
+
|
|
107
|
+
*
|
|
108
|
+
* @author Xeno
|
|
109
|
+
* @version 1.0.0
|
|
110
|
+
* @since 2025-09-30
|
|
111
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
112
|
+
*/
|
|
113
|
+
private constructor();
|
|
114
|
+
/**
|
|
115
|
+
* Creates an AppError instance with the given error payload.
|
|
116
|
+
*
|
|
117
|
+
* @param payload - The payload containing error details.
|
|
118
|
+
* @returns An AppError instance representing the error.
|
|
119
|
+
|
|
120
|
+
*
|
|
121
|
+
* @author Xeno
|
|
122
|
+
* @version 1.0.0
|
|
123
|
+
* @since 2025-09-30
|
|
124
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
125
|
+
*/
|
|
126
|
+
static create(payload: ErrorPayload): AppError;
|
|
127
|
+
/**
|
|
128
|
+
* Creates an AppError instance and throws it immediately.
|
|
129
|
+
* @param payload - The payload containing error details.
|
|
130
|
+
* @throws An AppError instance representing the error.
|
|
131
|
+
|
|
132
|
+
*
|
|
133
|
+
* @author Xeno
|
|
134
|
+
* @version 1.0.0
|
|
135
|
+
* @since 2025-09-30
|
|
136
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
137
|
+
*/
|
|
138
|
+
static throw(payload: ErrorPayload): never;
|
|
139
|
+
/**
|
|
140
|
+
* Creates an AppError instance representing an aborted request.
|
|
141
|
+
* @param name - The name of the error, typically the class name or context where the error occurred.
|
|
142
|
+
* @returns An AppError instance representing the aborted request error.
|
|
143
|
+
|
|
144
|
+
*
|
|
145
|
+
* @author Xeno
|
|
146
|
+
* @version 1.0.0
|
|
147
|
+
* @since 2025-09-30
|
|
148
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
149
|
+
*/
|
|
150
|
+
static aborted(name: string): AppError;
|
|
151
|
+
/**
|
|
152
|
+
* Utility method to check if an AbortSignal has been triggered and throw an AppError if it has.
|
|
153
|
+
* @param signal - The AbortSignal to check for abortion.
|
|
154
|
+
* @param name - The name of the error, typically the class name or context where the error occurred.
|
|
155
|
+
|
|
156
|
+
*
|
|
157
|
+
* @author Xeno
|
|
158
|
+
* @version 1.0.0
|
|
159
|
+
* @since 2025-09-30
|
|
160
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
161
|
+
*/
|
|
162
|
+
static throwIfAborted(signal: Maybe<AbortSignal>, name: string): void;
|
|
163
|
+
/** @description Creates an AppError instance representing an unauthorized access error. This method is used to generate a standardized error response when a user attempts to access a resource or perform an action without the necessary authentication or authorization.
|
|
164
|
+
* @param name The name of the error, typically the class name or context where the error occurred. This helps in identifying the source of the error in logs and error reports.
|
|
165
|
+
* @param message A custom message describing the reason for the unauthorized access. This message is included in the AppError's cause for detailed error reporting.
|
|
166
|
+
* @returns An AppError instance representing the unauthorized access error.
|
|
167
|
+
*
|
|
168
|
+
* @author Xeno
|
|
169
|
+
* @version 1.0.0
|
|
170
|
+
* @since 2025-09-30
|
|
171
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
172
|
+
*/
|
|
173
|
+
static unauthorized(name: string, message: string): AppError;
|
|
174
|
+
static notSupported(name: string, message: string): AppError;
|
|
175
|
+
/** @description Creates an AppError instance representing a forbidden access error. This method is used to generate a standardized error response when a user attempts to access a resource or perform an action that they are not authorized to access, even if they are authenticated.
|
|
176
|
+
* @param name The name of the error, typically the class name or context where the error occurred. This helps in identifying the source of the error in logs and error reports.
|
|
177
|
+
* @param message A custom message describing the reason for the forbidden access. This message is included in the AppError's cause for detailed error reporting.
|
|
178
|
+
* @returns An AppError instance representing the forbidden access error.
|
|
179
|
+
*
|
|
180
|
+
* @author Xeno
|
|
181
|
+
* @version 1.0.0
|
|
182
|
+
* @since 2025-09-30
|
|
183
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
184
|
+
*/
|
|
185
|
+
static forbidden(name: string, message: string): AppError;
|
|
186
|
+
/** @description Creates an AppError instance representing a bad request error. This method is used to generate a standardized error response when a request made by the client is invalid or cannot be processed due to client-side issues, such as validation errors or malformed requests.
|
|
187
|
+
* @param name The name of the error, typically the class name or context where the error occurred. This helps in identifying the source of the error in logs and error reports.
|
|
188
|
+
* @param message A custom message describing the reason for the bad request. This message is included in the AppError's cause for detailed error reporting.
|
|
189
|
+
* @returns An AppError instance representing the bad request error.
|
|
190
|
+
*
|
|
191
|
+
* @author Xeno
|
|
192
|
+
* @version 1.0.0
|
|
193
|
+
* @since 2025-09-30
|
|
194
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
195
|
+
*/
|
|
196
|
+
static badRequest(name: string, message: string): AppError;
|
|
197
|
+
/** @description Creates an AppError instance representing a validation error. This method is used to generate a standardized error response when one or more input fields fail invariant or schema validation, indicating that the request cannot be processed due to invalid data.
|
|
198
|
+
* @param name The name of the error, typically the class name or context where the error occurred. This helps in identifying the source of the error in logs and error reports.
|
|
199
|
+
* @param message A custom message describing the reason for the validation failure. This message is included in the AppError's cause for detailed error reporting.
|
|
200
|
+
* @returns An AppError instance representing the validation error.
|
|
201
|
+
*
|
|
202
|
+
* @author Xeno
|
|
203
|
+
* @version 1.0.0
|
|
204
|
+
* @since 2025-09-30
|
|
205
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
206
|
+
*/
|
|
207
|
+
static validationError(name: string, message: string): AppError;
|
|
208
|
+
/** @description Creates an AppError instance representing a conflict error. This method is used to generate a standardized error response when a request conflicts with the current state of the resource, such as when attempting to create a resource that already exists or update a resource that has been modified by another process.
|
|
209
|
+
* @param name The name of the error, typically the class name or context where the error occurred. This helps in identifying the source of the error in logs and error reports.
|
|
210
|
+
* @param message A custom message describing the reason for the conflict. This message is included in the AppError's cause for detailed error reporting.
|
|
211
|
+
* @returns An AppError instance representing the conflict error.
|
|
212
|
+
*
|
|
213
|
+
* @author Xeno
|
|
214
|
+
* @version 1.0.0
|
|
215
|
+
* @since 2025-09-30
|
|
216
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
217
|
+
*/
|
|
218
|
+
static conflict(name: string, message: string): AppError;
|
|
219
|
+
/** @description Creates an AppError instance representing a not found error. This method is used to generate a standardized error response when a requested resource does not exist, indicating that the client attempted to access a resource that could not be found on the server.
|
|
220
|
+
* @param name The name of the error, typically the class name or context where the error occurred. This helps in identifying the source of the error in logs and error reports.
|
|
221
|
+
* @param message A custom message describing the reason for the not found error. This message is included in the AppError's cause for detailed error reporting.
|
|
222
|
+
* @returns An AppError instance representing the not found error.
|
|
223
|
+
*
|
|
224
|
+
* @author Xeno
|
|
225
|
+
* @version 1.0.0
|
|
226
|
+
* @since 2025-09-30
|
|
227
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
228
|
+
*/
|
|
229
|
+
static notFound(name: string, message: string): AppError;
|
|
230
|
+
/** @description Creates an AppError instance representing a Authentication failed. This method is used to generate a standardized error response when an auth requested produce an error..
|
|
231
|
+
* @param name The name of the error, typically the class name or context where the error occurred. This helps in identifying the source of the error in logs and error reports.
|
|
232
|
+
* @param message A custom message describing the reason for the Authentication failed. This message is included in the AppError's cause for detailed error reporting.
|
|
233
|
+
* @returns An AppError instance representing the Authentication failed.
|
|
234
|
+
*
|
|
235
|
+
* @author Xeno
|
|
236
|
+
* @version 1.0.0
|
|
237
|
+
* @since 2025-09-30
|
|
238
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
239
|
+
*/
|
|
240
|
+
static authFailed(name: string, message: string): AppError;
|
|
241
|
+
}
|
|
242
|
+
export {};
|
|
243
|
+
//# sourceMappingURL=app-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-error.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/app-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE/C;;;;;;;;;KASK;AACL,UAAU,YAAY;IACpB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;OAMG;IACH,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACxB;;;;;;OAMG;IACH,CAAC,GAAG,EAAE,MAAM,GA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