@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,259 @@
|
|
|
1
|
+
import { ERROR_CODE_MESSAGES, ERROR_CODES, Guards, STATUS_CODES } 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
|
+
export class AppError extends Error {
|
|
13
|
+
/**
|
|
14
|
+
* The error code representing the type of error.
|
|
15
|
+
|
|
16
|
+
*
|
|
17
|
+
* @author Xeno
|
|
18
|
+
* @version 1.0.0
|
|
19
|
+
* @since 2025-09-30
|
|
20
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
21
|
+
*/
|
|
22
|
+
code;
|
|
23
|
+
/**
|
|
24
|
+
* The HTTP status code associated with the error.
|
|
25
|
+
|
|
26
|
+
*
|
|
27
|
+
* @author Xeno
|
|
28
|
+
* @version 1.0.0
|
|
29
|
+
* @since 2025-09-30
|
|
30
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
31
|
+
*/
|
|
32
|
+
status;
|
|
33
|
+
/**
|
|
34
|
+
* Private constructor to prevent direct instantiation. Use the static methods `create` and `throw` to create instances.
|
|
35
|
+
*
|
|
36
|
+
* @param payload - The payload containing error details.
|
|
37
|
+
|
|
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
|
+
constructor(payload) {
|
|
45
|
+
super(payload.message);
|
|
46
|
+
this.code = payload.code;
|
|
47
|
+
this.status = payload.status;
|
|
48
|
+
Object.assign(this, payload);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates an AppError instance with the given error payload.
|
|
52
|
+
*
|
|
53
|
+
* @param payload - The payload containing error details.
|
|
54
|
+
* @returns An AppError instance representing the error.
|
|
55
|
+
|
|
56
|
+
*
|
|
57
|
+
* @author Xeno
|
|
58
|
+
* @version 1.0.0
|
|
59
|
+
* @since 2025-09-30
|
|
60
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
61
|
+
*/
|
|
62
|
+
static create(payload) {
|
|
63
|
+
return new AppError(payload);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates an AppError instance and throws it immediately.
|
|
67
|
+
* @param payload - The payload containing error details.
|
|
68
|
+
* @throws An AppError instance representing the error.
|
|
69
|
+
|
|
70
|
+
*
|
|
71
|
+
* @author Xeno
|
|
72
|
+
* @version 1.0.0
|
|
73
|
+
* @since 2025-09-30
|
|
74
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
75
|
+
*/
|
|
76
|
+
static throw(payload) {
|
|
77
|
+
throw new AppError(payload);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Creates an AppError instance representing an aborted request.
|
|
81
|
+
* @param name - The name of the error, typically the class name or context where the error occurred.
|
|
82
|
+
* @returns An AppError instance representing the aborted request error.
|
|
83
|
+
|
|
84
|
+
*
|
|
85
|
+
* @author Xeno
|
|
86
|
+
* @version 1.0.0
|
|
87
|
+
* @since 2025-09-30
|
|
88
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
89
|
+
*/
|
|
90
|
+
static aborted(name) {
|
|
91
|
+
return new AppError({
|
|
92
|
+
code: ERROR_CODES.ABORTED,
|
|
93
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.ABORTED],
|
|
94
|
+
status: STATUS_CODES.ABORTED,
|
|
95
|
+
name,
|
|
96
|
+
cause: new Error('The client closed the connection before the server finished responding.'),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Utility method to check if an AbortSignal has been triggered and throw an AppError if it has.
|
|
101
|
+
* @param signal - The AbortSignal to check for abortion.
|
|
102
|
+
* @param name - The name of the error, typically the class name or context where the error occurred.
|
|
103
|
+
|
|
104
|
+
*
|
|
105
|
+
* @author Xeno
|
|
106
|
+
* @version 1.0.0
|
|
107
|
+
* @since 2025-09-30
|
|
108
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
109
|
+
*/
|
|
110
|
+
static throwIfAborted(signal, name) {
|
|
111
|
+
if (Guards.isDefined(signal) && signal.aborted) {
|
|
112
|
+
throw AppError.aborted(name);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** @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.
|
|
116
|
+
* @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.
|
|
117
|
+
* @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.
|
|
118
|
+
* @returns An AppError instance representing the unauthorized access error.
|
|
119
|
+
*
|
|
120
|
+
* @author Xeno
|
|
121
|
+
* @version 1.0.0
|
|
122
|
+
* @since 2025-09-30
|
|
123
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
124
|
+
*/
|
|
125
|
+
static unauthorized(name, message) {
|
|
126
|
+
return AppError.create({
|
|
127
|
+
code: ERROR_CODES.UNAUTHORIZED,
|
|
128
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.UNAUTHORIZED],
|
|
129
|
+
status: STATUS_CODES.UNAUTHORIZED,
|
|
130
|
+
name,
|
|
131
|
+
cause: new Error(message),
|
|
132
|
+
header: { 'WWW-Authenticate': ['Bearer realm="api"'] },
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
static notSupported(name, message) {
|
|
136
|
+
return AppError.create({
|
|
137
|
+
code: ERROR_CODES.NOT_ALLOWED,
|
|
138
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.NOT_ALLOWED],
|
|
139
|
+
status: STATUS_CODES.NOT_ALLOWED,
|
|
140
|
+
name,
|
|
141
|
+
cause: new Error(message),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/** @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.
|
|
145
|
+
* @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.
|
|
146
|
+
* @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.
|
|
147
|
+
* @returns An AppError instance representing the forbidden access error.
|
|
148
|
+
*
|
|
149
|
+
* @author Xeno
|
|
150
|
+
* @version 1.0.0
|
|
151
|
+
* @since 2025-09-30
|
|
152
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
153
|
+
*/
|
|
154
|
+
static forbidden(name, message) {
|
|
155
|
+
return AppError.create({
|
|
156
|
+
code: ERROR_CODES.FORBIDDEN,
|
|
157
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.FORBIDDEN],
|
|
158
|
+
status: STATUS_CODES.FORBIDDEN,
|
|
159
|
+
name,
|
|
160
|
+
cause: new Error(message),
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/** @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.
|
|
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 bad request. This message is included in the AppError's cause for detailed error reporting.
|
|
166
|
+
* @returns An AppError instance representing the bad request 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 badRequest(name, message) {
|
|
174
|
+
return AppError.create({
|
|
175
|
+
code: ERROR_CODES.BAD_REQUEST,
|
|
176
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.BAD_REQUEST],
|
|
177
|
+
status: STATUS_CODES.BAD_REQUEST,
|
|
178
|
+
name,
|
|
179
|
+
cause: new Error(message),
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/** @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.
|
|
183
|
+
* @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.
|
|
184
|
+
* @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.
|
|
185
|
+
* @returns An AppError instance representing the validation error.
|
|
186
|
+
*
|
|
187
|
+
* @author Xeno
|
|
188
|
+
* @version 1.0.0
|
|
189
|
+
* @since 2025-09-30
|
|
190
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
191
|
+
*/
|
|
192
|
+
static validationError(name, message) {
|
|
193
|
+
return AppError.create({
|
|
194
|
+
code: ERROR_CODES.VALIDATION_FAILED,
|
|
195
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.VALIDATION_FAILED],
|
|
196
|
+
status: STATUS_CODES.BAD_REQUEST,
|
|
197
|
+
name,
|
|
198
|
+
cause: new Error(message),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/** @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.
|
|
202
|
+
* @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.
|
|
203
|
+
* @param message A custom message describing the reason for the conflict. This message is included in the AppError's cause for detailed error reporting.
|
|
204
|
+
* @returns An AppError instance representing the conflict error.
|
|
205
|
+
*
|
|
206
|
+
* @author Xeno
|
|
207
|
+
* @version 1.0.0
|
|
208
|
+
* @since 2025-09-30
|
|
209
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
210
|
+
*/
|
|
211
|
+
static conflict(name, message) {
|
|
212
|
+
return AppError.create({
|
|
213
|
+
code: ERROR_CODES.CONFLICT,
|
|
214
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.CONFLICT],
|
|
215
|
+
status: STATUS_CODES.CONFLICT,
|
|
216
|
+
name,
|
|
217
|
+
cause: new Error(message),
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/** @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.
|
|
221
|
+
* @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.
|
|
222
|
+
* @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.
|
|
223
|
+
* @returns An AppError instance representing the not found error.
|
|
224
|
+
*
|
|
225
|
+
* @author Xeno
|
|
226
|
+
* @version 1.0.0
|
|
227
|
+
* @since 2025-09-30
|
|
228
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
229
|
+
*/
|
|
230
|
+
static notFound(name, message) {
|
|
231
|
+
return AppError.create({
|
|
232
|
+
code: ERROR_CODES.NOT_FOUND,
|
|
233
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.NOT_FOUND],
|
|
234
|
+
status: STATUS_CODES.NOT_FOUND,
|
|
235
|
+
name,
|
|
236
|
+
cause: new Error(message),
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/** @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..
|
|
240
|
+
* @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.
|
|
241
|
+
* @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.
|
|
242
|
+
* @returns An AppError instance representing the Authentication failed.
|
|
243
|
+
*
|
|
244
|
+
* @author Xeno
|
|
245
|
+
* @version 1.0.0
|
|
246
|
+
* @since 2025-09-30
|
|
247
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
248
|
+
*/
|
|
249
|
+
static authFailed(name, message) {
|
|
250
|
+
return AppError.create({
|
|
251
|
+
code: ERROR_CODES.AUTHENTICATION_FAILED,
|
|
252
|
+
message: ERROR_CODE_MESSAGES[ERROR_CODES.AUTHENTICATION_FAILED],
|
|
253
|
+
name,
|
|
254
|
+
status: STATUS_CODES.UNAUTHORIZED,
|
|
255
|
+
cause: new Error(message),
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=app-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-error.js","sourceRoot":"","sources":["../../../src/domain/errors/app-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AA8DjF;;;;;;;;;KASK;AACL,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC;;;;;;;;OAQG;IACa,IAAI,CAAQ;IAC5B;;;;;;;;OAQG;IACa,MAAM,CAAQ;IAY9B;;;;;;;;;;OAUG;IACH,YAAoB,OAAqB;QACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;QAC5B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,MAAM,CAAC,OAAqB;QACxC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC9B,CAAC;IAED;;;;;;;;;;OAUG;IACI,MAAM,CAAC,KAAK,CAAC,OAAqB;QACvC,MAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC7B,CAAC;IAED;;;;;;;;;;OAUG;IACI,MAAM,CAAC,OAAO,CAAC,IAAY;Q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SAC1B,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;OASG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAY,EAAE,OAAe;QAClD,OAAO,QAAQ,CAAC,MAAM,CAAC;YACrB,IAAI,EAAE,WAAW,CAAC,SAAS;YAC3B,OAAO,EAAE,mBAAmB,CAAC,WAAW,CAAC,SAAS,CAAC;YACnD,MAAM,EAAE,YAAY,CAAC,SAAS;YAC9B,IAAI;YACJ,KAAK,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC;SAC1B,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;OASG;IACI,MAAM,CAAC,UAAU,CAAC,IAAY,EAAE,OAAe;QACpD,OAAO,QAAQ,CAAC,MAAM,CAAC;YACrB,IAAI,EAAE,WAAW,CAAC,qBAAqB;YACvC,OAAO,EAAE,mBAAmB,CAAC,WAAW,CAAC,qBAAqB,CAAC;YAC/D,IAAI;YACJ,MAAM,EAAE,YAAY,CAAC,YAAY;YACjC,KAAK,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC;SAC1B,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type * from './config/index';
|
|
2
|
+
export type * from './contracts/index';
|
|
3
|
+
export * from './entities/index';
|
|
4
|
+
export * from './errors/index';
|
|
5
|
+
export * from './results/index';
|
|
6
|
+
export * from './unique_id/index';
|
|
7
|
+
export * from './value_objects/index';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,mBAAmB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/results/__tests__/result.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { Result } from '../../../domain';
|
|
3
|
+
describe('Result', () => {
|
|
4
|
+
describe('ok', () => {
|
|
5
|
+
it('creates a successful result and returns its value', () => {
|
|
6
|
+
const result = Result.ok('value');
|
|
7
|
+
expect(result.isOk()).toBe(true);
|
|
8
|
+
expect(result.getValueOrThrow()).toBe('value');
|
|
9
|
+
});
|
|
10
|
+
it('supports undefined as a valid success payload', () => {
|
|
11
|
+
const result = Result.ok();
|
|
12
|
+
expect(result.isOk()).toBe(true);
|
|
13
|
+
expect(result.getValueOrThrow()).toBeUndefined();
|
|
14
|
+
});
|
|
15
|
+
it('throws when requesting value from a failed result', () => {
|
|
16
|
+
const result = Result.fail('domain-error');
|
|
17
|
+
expect(() => result.getValueOrThrow()).toThrowError('Cannot get the value of a failed result.');
|
|
18
|
+
});
|
|
19
|
+
it('supports complex objects as success payloads', () => {
|
|
20
|
+
const payload = { id: '123', name: 'Alice' };
|
|
21
|
+
const result = Result.ok(payload);
|
|
22
|
+
expect(result.isOk()).toBe(true);
|
|
23
|
+
expect(result.getValueOrThrow()).toEqual(payload);
|
|
24
|
+
});
|
|
25
|
+
it('supports generic type parameters for value and error', () => {
|
|
26
|
+
const result = Result.ok(42);
|
|
27
|
+
expect(result.isOk()).toBe(true);
|
|
28
|
+
expect(result.getValueOrThrow()).toBe(42);
|
|
29
|
+
});
|
|
30
|
+
it('supports null as a valid success payload', () => {
|
|
31
|
+
const result = Result.ok(null);
|
|
32
|
+
expect(result.isOk()).toBe(true);
|
|
33
|
+
expect(result.getValueOrThrow()).toBeNull();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('fail', () => {
|
|
37
|
+
it('creates a failed result and returns its error', () => {
|
|
38
|
+
const error = new Error('failure');
|
|
39
|
+
const result = Result.fail(error);
|
|
40
|
+
expect(result.isOk()).toBe(false);
|
|
41
|
+
expect(result.getErrorOrThrow()).toBe(error);
|
|
42
|
+
});
|
|
43
|
+
it('supports non-Error failure values', () => {
|
|
44
|
+
const result = Result.fail('domain-error');
|
|
45
|
+
expect(result.isOk()).toBe(false);
|
|
46
|
+
expect(result.getErrorOrThrow()).toBe('domain-error');
|
|
47
|
+
});
|
|
48
|
+
it('throws when requesting value from a failed result', () => {
|
|
49
|
+
const result = Result.fail('domain-error');
|
|
50
|
+
expect(() => result.getValueOrThrow()).toThrowError('Cannot get the value of a failed result.');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('isOk', () => {
|
|
54
|
+
it('returns true for successful results', () => {
|
|
55
|
+
const result = Result.ok('value');
|
|
56
|
+
expect(result.isOk()).toBe(true);
|
|
57
|
+
});
|
|
58
|
+
it('returns false for failed results', () => {
|
|
59
|
+
const result = Result.fail('domain-error');
|
|
60
|
+
expect(result.isOk()).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
it('returns true for successful results with undefined payload', () => {
|
|
63
|
+
const result = Result.ok();
|
|
64
|
+
expect(result.isOk()).toBe(true);
|
|
65
|
+
});
|
|
66
|
+
it('returns false for failed results with non-Error payload', () => {
|
|
67
|
+
const result = Result.fail('domain-error');
|
|
68
|
+
expect(result.isOk()).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
it('returns true for successful results with null payload', () => {
|
|
71
|
+
const result = Result.ok(null);
|
|
72
|
+
expect(result.isOk()).toBe(true);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
describe('getValueOrThrow', () => {
|
|
76
|
+
it('returns the value for successful results', () => {
|
|
77
|
+
const result = Result.ok('value');
|
|
78
|
+
expect(result.getValueOrThrow()).toBe('value');
|
|
79
|
+
});
|
|
80
|
+
it('throws an error when called on a failed result', () => {
|
|
81
|
+
const result = Result.fail('domain-error');
|
|
82
|
+
expect(() => result.getValueOrThrow()).toThrowError('Cannot get the value of a failed result.');
|
|
83
|
+
});
|
|
84
|
+
it('returns undefined for successful results with undefined payload', () => {
|
|
85
|
+
const result = Result.ok();
|
|
86
|
+
expect(result.getValueOrThrow()).toBeUndefined();
|
|
87
|
+
});
|
|
88
|
+
it('returns null for successful results with null payload', () => {
|
|
89
|
+
const result = Result.ok(null);
|
|
90
|
+
expect(result.getValueOrThrow()).toBeNull();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
describe('getErrorOrThrow', () => {
|
|
94
|
+
it('returns the error for failed results', () => {
|
|
95
|
+
const error = new Error('failure');
|
|
96
|
+
const result = Result.fail(error);
|
|
97
|
+
expect(result.getErrorOrThrow()).toBe(error);
|
|
98
|
+
});
|
|
99
|
+
it('throws an error when called on a successful result', () => {
|
|
100
|
+
const result = Result.ok('value');
|
|
101
|
+
expect(() => result.getErrorOrThrow()).toThrowError('Cannot get the error of a successful result.');
|
|
102
|
+
});
|
|
103
|
+
it('returns non-Error payloads for failed results', () => {
|
|
104
|
+
const result = Result.fail('domain-error');
|
|
105
|
+
expect(result.getErrorOrThrow()).toBe('domain-error');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=result.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.test.js","sourceRoot":"","sources":["../../../../src/domain/results/__tests__/result.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE;QAClB,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;YAEjC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,CAAA;YAE1B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,aAAa,EAAE,CAAA;QAClD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAiB,cAAc,CAAC,CAAA;YAE1D,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,YAAY,CACjD,0CAA0C,CAC3C,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC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@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/results/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,mBAAmB,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/results/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { Optional } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* A class representing the result of an operation, which can either be a success or a failure.
|
|
4
|
+
* It encapsulates the value of a successful operation or the error of a failed operation.
|
|
5
|
+
*
|
|
6
|
+
* @template TValue - The type of the value in case of a successful operation.
|
|
7
|
+
* @template TError - The type of the error in case of a failed operation (default is never).
|
|
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 class Result<TValue, TError = never> {
|
|
16
|
+
/**
|
|
17
|
+
* Indicates whether the operation was successful or not.
|
|
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
|
+
private readonly _isSuccess;
|
|
26
|
+
/**
|
|
27
|
+
* The error of the operation in case it failed.
|
|
28
|
+
|
|
29
|
+
*
|
|
30
|
+
* @author Xeno
|
|
31
|
+
* @version 1.0.0
|
|
32
|
+
* @since 2025-09-30
|
|
33
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
34
|
+
*/
|
|
35
|
+
private readonly _error;
|
|
36
|
+
/**
|
|
37
|
+
* The value of the operation in case it succeeded.
|
|
38
|
+
|
|
39
|
+
*
|
|
40
|
+
* @author Xeno
|
|
41
|
+
* @version 1.0.0
|
|
42
|
+
* @since 2025-09-30
|
|
43
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
44
|
+
*/
|
|
45
|
+
private readonly _value;
|
|
46
|
+
/**
|
|
47
|
+
* Private constructor to prevent direct instantiation. Use the static methods `ok` and `fail` to create instances.
|
|
48
|
+
*
|
|
49
|
+
* @param isSuccess - A boolean indicating whether the operation was successful.
|
|
50
|
+
* @param error - The error of the operation in case it failed (optional).
|
|
51
|
+
* @param value - The value of the operation in case it succeeded (optional).
|
|
52
|
+
|
|
53
|
+
*
|
|
54
|
+
* @author Xeno
|
|
55
|
+
* @version 1.0.0
|
|
56
|
+
* @since 2025-09-30
|
|
57
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
58
|
+
*/
|
|
59
|
+
private constructor();
|
|
60
|
+
/**
|
|
61
|
+
* Creates a successful result with the given value.
|
|
62
|
+
*
|
|
63
|
+
* @param value - The value of the successful operation.
|
|
64
|
+
* @returns A Result instance representing a successful operation.
|
|
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
|
+
static ok<U>(value?: U): Result<U>;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a failed result with the given error.
|
|
75
|
+
*
|
|
76
|
+
* @param error - The error of the failed operation.
|
|
77
|
+
* @returns A Result instance representing a failed operation.
|
|
78
|
+
|
|
79
|
+
*
|
|
80
|
+
* @author Xeno
|
|
81
|
+
* @version 1.0.0
|
|
82
|
+
* @since 2025-09-30
|
|
83
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
84
|
+
*/
|
|
85
|
+
static fail<U, V = never>(error: V): Result<U, V>;
|
|
86
|
+
/**
|
|
87
|
+
* Checks if the result is a success.
|
|
88
|
+
*
|
|
89
|
+
* @returns True if the result is a success, false otherwise.
|
|
90
|
+
|
|
91
|
+
*
|
|
92
|
+
* @author Xeno
|
|
93
|
+
* @version 1.0.0
|
|
94
|
+
* @since 2025-09-30
|
|
95
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
96
|
+
*/
|
|
97
|
+
isOk(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Gets the value of the result or throws an error if the result is a failure.
|
|
100
|
+
*
|
|
101
|
+
* @returns The value of the result.
|
|
102
|
+
* @throws An error if the result is a failure.
|
|
103
|
+
|
|
104
|
+
*
|
|
105
|
+
* @author Xeno
|
|
106
|
+
* @version 1.0.0
|
|
107
|
+
* @since 2025-09-30
|
|
108
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
109
|
+
*/
|
|
110
|
+
getValueOrThrow(): Optional<TValue>;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the error of the result or throws an error if the result is a success.
|
|
113
|
+
*
|
|
114
|
+
* @returns The error of the result.
|
|
115
|
+
* @throws An error if the result is a success.
|
|
116
|
+
|
|
117
|
+
*
|
|
118
|
+
* @author Xeno
|
|
119
|
+
* @version 1.0.0
|
|
120
|
+
* @since 2025-09-30
|
|
121
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
122
|
+
*/
|
|
123
|
+
getErrorOrThrow(): TError;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/domain/results/result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;;;;;;;KAYK;AACL,qBAAa,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK;IACxC;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;;;;;;;;OAYG;IACH,OAAO;IAMP;;;;;;;;;;;OAWG;WACW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IAIzC;;;;;;;;;;;OAWG;WACW,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IAIxD;;;;;;;;;;OAUG;IACI,IAAI,IAAI,OAAO;IAItB;;;;;;;;;;;OAWG;IACI,eAAe,IAAI,QAAQ,CAAC,MAAM,CAAC;IAO1C;;;;;;;;;;;OAWG;IACI,eAAe,IAAI,MAAM;CAMjC"}
|