@nestjslatam/ddd-lib 1.0.34 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libs/ddd/src/command.base.d.ts +7 -0
- package/libs/ddd/src/command.base.js.map +1 -0
- package/{core → libs/ddd/src/core}/broken-rules/broken-rule-collection.d.ts +1 -1
- package/{core → libs/ddd/src/core}/broken-rules/broken-rule-collection.js +1 -1
- package/libs/ddd/src/core/broken-rules/broken-rule-collection.js.map +1 -0
- package/libs/ddd/src/core/broken-rules/broken-rule.js.map +1 -0
- package/libs/ddd/src/core/broken-rules/index.js.map +1 -0
- package/libs/ddd/src/core/index.js.map +1 -0
- package/libs/ddd/src/core/interfaces/command-bus.interface.d.ts +4 -0
- package/libs/ddd/src/core/interfaces/command-bus.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/command-handler.interface.d.ts +4 -0
- package/libs/ddd/src/core/interfaces/command-handler.interface.js.map +1 -0
- package/{core → libs/ddd/src/core}/interfaces/command-metadata.interface.d.ts +1 -1
- package/libs/ddd/src/core/interfaces/command-metadata.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/command-publisher.interface.d.ts +4 -0
- package/libs/ddd/src/core/interfaces/command-publisher.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/command.interface.d.ts +4 -0
- package/libs/ddd/src/core/interfaces/command.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-event-bus.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-event-handler.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-event-metadata.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-event-publisher.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-event.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-repository-read.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-repository-transaction.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/domain-repository-write.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/index.js.map +1 -0
- package/libs/ddd/src/core/interfaces/message-source.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/observable-bus.js.map +1 -0
- package/libs/ddd/src/core/interfaces/saga.interface.d.ts +4 -0
- package/libs/ddd/src/core/interfaces/saga.interface.js.map +1 -0
- package/libs/ddd/src/core/interfaces/tracking.interface.js.map +1 -0
- package/{core → libs/ddd/src/core}/interfaces/unhandled-exception-info.interface.d.ts +2 -2
- package/libs/ddd/src/core/interfaces/unhandled-exception-info.interface.js.map +1 -0
- package/{core → libs/ddd/src/core}/interfaces/unhandled-exception-publisher.interface.d.ts +2 -2
- package/libs/ddd/src/core/interfaces/unhandled-exception-publisher.interface.js.map +1 -0
- package/libs/ddd/src/core/of-type.js.map +1 -0
- package/libs/ddd/src/core/tracking-props.js.map +1 -0
- package/libs/ddd/src/core/validators/index.js.map +1 -0
- package/libs/ddd/src/core/validators/object.validator.js.map +1 -0
- package/libs/ddd/src/core/validators/value-object.validator.js.map +1 -0
- package/{ddd.module.d.ts → libs/ddd/src/ddd.module.d.ts} +2 -2
- package/{ddd.module.js → libs/ddd/src/ddd.module.js} +4 -4
- package/libs/ddd/src/ddd.module.js.map +1 -0
- package/{ddd.options.d.ts → libs/ddd/src/ddd.options.d.ts} +2 -2
- package/libs/ddd/src/ddd.options.js.map +1 -0
- package/{ddd.service.js → libs/ddd/src/ddd.service.js} +2 -2
- package/libs/ddd/src/ddd.service.js.map +1 -0
- package/libs/ddd/src/decorators/command-handler.decorator.d.ts +3 -0
- package/{decorators → libs/ddd/src/decorators}/command-handler.decorator.js +3 -3
- package/libs/ddd/src/decorators/command-handler.decorator.js.map +1 -0
- package/libs/ddd/src/decorators/constants.js.map +1 -0
- package/libs/ddd/src/decorators/events-handler.decorator.d.ts +3 -0
- package/{decorators → libs/ddd/src/decorators}/events-handler.decorator.js +3 -3
- package/libs/ddd/src/decorators/events-handler.decorator.js.map +1 -0
- package/libs/ddd/src/decorators/index.js.map +1 -0
- package/libs/ddd/src/decorators/saga.decorator.js.map +1 -0
- package/libs/ddd/src/domain-aggregate-root.js.map +1 -0
- package/libs/ddd/src/domain-command-bus.d.ts +21 -0
- package/libs/ddd/src/domain-command-bus.js.map +1 -0
- package/{domain-entity.d.ts → libs/ddd/src/domain-entity.d.ts} +7 -14
- package/{domain-entity.js → libs/ddd/src/domain-entity.js} +11 -50
- package/libs/ddd/src/domain-entity.js.map +1 -0
- package/libs/ddd/src/domain-event-bus.js.map +1 -0
- package/libs/ddd/src/domain-event-collection.js.map +1 -0
- package/libs/ddd/src/domain-event-publisher.js.map +1 -0
- package/libs/ddd/src/domain-event.js.map +1 -0
- package/libs/ddd/src/exceptions/broken-rules.exeption.js.map +1 -0
- package/libs/ddd/src/exceptions/constants.js.map +1 -0
- package/libs/ddd/src/exceptions/exception.base.js.map +1 -0
- package/{exceptions → libs/ddd/src/exceptions}/exceptions.d.ts +3 -0
- package/{exceptions → libs/ddd/src/exceptions}/exceptions.js +8 -1
- package/libs/ddd/src/exceptions/exceptions.js.map +1 -0
- package/libs/ddd/src/exceptions/index.js.map +1 -0
- package/libs/ddd/src/helpers/datetime.helper.js.map +1 -0
- package/libs/ddd/src/helpers/default-command-pubsub.helper.d.ts +7 -0
- package/{helpers → libs/ddd/src/helpers}/default-command-pubsub.helper.js +2 -2
- package/libs/ddd/src/helpers/default-command-pubsub.helper.js.map +1 -0
- package/libs/ddd/src/helpers/default-get-event-id.helper.js.map +1 -0
- package/libs/ddd/src/helpers/default-pubsub.helper.js.map +1 -0
- package/{helpers → libs/ddd/src/helpers}/default-unhandled-exception-pubsub.helper.d.ts +2 -2
- package/libs/ddd/src/helpers/default-unhandled-exception-pubsub.helper.js.map +1 -0
- package/{helpers → libs/ddd/src/helpers}/domain-guard.helper.d.ts +2 -0
- package/{helpers → libs/ddd/src/helpers}/domain-guard.helper.js +20 -0
- package/libs/ddd/src/helpers/domain-guard.helper.js.map +1 -0
- package/libs/ddd/src/helpers/domain-object.helper.js.map +1 -0
- package/libs/ddd/src/helpers/index.js.map +1 -0
- package/libs/ddd/src/index.js.map +1 -0
- package/{unhandled-exeption-bus.d.ts → libs/ddd/src/unhandled-exeption-bus.d.ts} +2 -2
- package/libs/ddd/src/unhandled-exeption-bus.js.map +1 -0
- package/{valueobjects → libs/ddd/src/valueobjects}/domain-audit.valueobject.d.ts +2 -3
- package/{valueobjects → libs/ddd/src/valueobjects}/domain-audit.valueobject.js +3 -7
- package/libs/ddd/src/valueobjects/domain-audit.valueobject.js.map +1 -0
- package/libs/ddd/src/valueobjects/domain-date.valueobject.js.map +1 -0
- package/libs/ddd/src/valueobjects/domain-enum.valueobject.d.ts +5 -0
- package/libs/ddd/src/valueobjects/domain-enum.valueobject.js +11 -0
- package/libs/ddd/src/valueobjects/domain-enum.valueobject.js.map +1 -0
- package/libs/ddd/src/valueobjects/domain-number.valueobject.js.map +1 -0
- package/libs/ddd/src/valueobjects/domain-string.valueobject.js.map +1 -0
- package/libs/ddd/src/valueobjects/domain-uid.valueobject.js.map +1 -0
- package/{valueobjects → libs/ddd/src/valueobjects}/domain-valueobject.js +1 -1
- package/libs/ddd/src/valueobjects/domain-valueobject.js.map +1 -0
- package/{valueobjects → libs/ddd/src/valueobjects}/index.d.ts +1 -0
- package/{valueobjects → libs/ddd/src/valueobjects}/index.js +1 -0
- package/libs/ddd/src/valueobjects/index.js.map +1 -0
- package/package.json +1 -1
- package/src/shared/application/commands/command-handler.base.d.ts +9 -0
- package/src/shared/application/commands/command-handler.base.js +20 -0
- package/src/shared/application/commands/command-handler.base.js.map +1 -0
- package/src/shared/application/commands/index.d.ts +1 -0
- package/src/shared/application/commands/index.js +18 -0
- package/src/shared/application/commands/index.js.map +1 -0
- package/src/shared/application/context/index.d.ts +4 -0
- package/src/shared/application/context/index.js +21 -0
- package/src/shared/application/context/index.js.map +1 -0
- package/src/shared/application/context/meta-context-request.interceptor.d.ts +5 -0
- package/src/shared/application/context/meta-context-request.interceptor.js +30 -0
- package/src/shared/application/context/meta-context-request.interceptor.js.map +1 -0
- package/src/shared/application/context/meta-context-request.model.d.ts +11 -0
- package/src/shared/application/context/meta-context-request.model.js +8 -0
- package/src/shared/application/context/meta-context-request.model.js.map +1 -0
- package/src/shared/application/context/meta-context-request.service.d.ts +10 -0
- package/src/shared/application/context/meta-context-request.service.js +37 -0
- package/src/shared/application/context/meta-context-request.service.js.map +1 -0
- package/src/shared/application/context/meta-request.helper.d.ts +5 -0
- package/src/shared/application/context/meta-request.helper.js +46 -0
- package/src/shared/application/context/meta-request.helper.js.map +1 -0
- package/src/shared/application/index.d.ts +3 -0
- package/src/shared/application/index.js +20 -0
- package/src/shared/application/index.js.map +1 -0
- package/src/shared/application/queries/index.d.ts +1 -0
- package/src/shared/application/queries/index.js +18 -0
- package/src/shared/application/queries/index.js.map +1 -0
- package/src/shared/application/queries/query.base.d.ts +27 -0
- package/src/shared/application/queries/query.base.js +26 -0
- package/src/shared/application/queries/query.base.js.map +1 -0
- package/src/shared/domain/id.d.ts +6 -0
- package/src/shared/domain/id.js +17 -0
- package/src/shared/domain/id.js.map +1 -0
- package/src/shared/domain/index.d.ts +6 -0
- package/src/shared/domain/index.js +14 -0
- package/src/shared/domain/index.js.map +1 -0
- package/src/shared/domain/name.d.ts +5 -0
- package/src/shared/domain/name.js +16 -0
- package/src/shared/domain/name.js.map +1 -0
- package/src/shared/domain/register-date.d.ts +5 -0
- package/src/shared/domain/register-date.js +13 -0
- package/src/shared/domain/register-date.js.map +1 -0
- package/src/shared/domain/subscribed-date.d.ts +5 -0
- package/src/shared/domain/subscribed-date.js +13 -0
- package/src/shared/domain/subscribed-date.js.map +1 -0
- package/src/shared/domain/url.d.ts +7 -0
- package/src/shared/domain/url.js +16 -0
- package/src/shared/domain/url.js.map +1 -0
- package/src/shared/exceptions/application.exception.d.ts +3 -0
- package/src/shared/exceptions/application.exception.js +11 -0
- package/src/shared/exceptions/application.exception.js.map +1 -0
- package/src/shared/exceptions/database.exception.d.ts +3 -0
- package/src/shared/exceptions/database.exception.js +11 -0
- package/src/shared/exceptions/database.exception.js.map +1 -0
- package/src/shared/exceptions/domain.exception.d.ts +3 -0
- package/src/shared/exceptions/domain.exception.js +11 -0
- package/src/shared/exceptions/domain.exception.js.map +1 -0
- package/src/shared/exceptions/index.d.ts +4 -0
- package/src/shared/exceptions/index.js +10 -0
- package/src/shared/exceptions/index.js.map +1 -0
- package/src/shared/index.d.ts +4 -0
- package/src/shared/index.js +21 -0
- package/src/shared/index.js.map +1 -0
- package/src/shared/infrastructure/db/index.d.ts +1 -0
- package/src/shared/infrastructure/db/index.js +18 -0
- package/src/shared/infrastructure/db/index.js.map +1 -0
- package/src/shared/infrastructure/db/repository.base.d.ts +15 -0
- package/src/shared/infrastructure/db/repository.base.js +63 -0
- package/src/shared/infrastructure/db/repository.base.js.map +1 -0
- package/src/shared/infrastructure/index.d.ts +1 -0
- package/src/shared/infrastructure/index.js +18 -0
- package/src/shared/infrastructure/index.js.map +1 -0
- package/tsconfig.lib.tsbuildinfo +1 -1
- package/command.base.d.ts +0 -7
- package/command.base.js.map +0 -1
- package/core/broken-rules/broken-rule-collection.js.map +0 -1
- package/core/broken-rules/broken-rule.js.map +0 -1
- package/core/broken-rules/index.js.map +0 -1
- package/core/index.js.map +0 -1
- package/core/interfaces/command-bus.interface.d.ts +0 -4
- package/core/interfaces/command-bus.interface.js.map +0 -1
- package/core/interfaces/command-handler.interface.d.ts +0 -4
- package/core/interfaces/command-handler.interface.js.map +0 -1
- package/core/interfaces/command-metadata.interface.js.map +0 -1
- package/core/interfaces/command-publisher.interface.d.ts +0 -4
- package/core/interfaces/command-publisher.interface.js.map +0 -1
- package/core/interfaces/command.interface.d.ts +0 -4
- package/core/interfaces/command.interface.js.map +0 -1
- package/core/interfaces/domain-event-bus.interface.js.map +0 -1
- package/core/interfaces/domain-event-handler.interface.js.map +0 -1
- package/core/interfaces/domain-event-metadata.interface.js.map +0 -1
- package/core/interfaces/domain-event-publisher.interface.js.map +0 -1
- package/core/interfaces/domain-event.interface.js.map +0 -1
- package/core/interfaces/domain-repository-read.interface.js.map +0 -1
- package/core/interfaces/domain-repository-transaction.interface.js.map +0 -1
- package/core/interfaces/domain-repository-write.interface.js.map +0 -1
- package/core/interfaces/index.js.map +0 -1
- package/core/interfaces/message-source.interface.js.map +0 -1
- package/core/interfaces/observable-bus.js.map +0 -1
- package/core/interfaces/saga.interface.d.ts +0 -4
- package/core/interfaces/saga.interface.js.map +0 -1
- package/core/interfaces/tracking.interface.js.map +0 -1
- package/core/interfaces/unhandled-exception-info.interface.js.map +0 -1
- package/core/interfaces/unhandled-exception-publisher.interface.js.map +0 -1
- package/core/of-type.js.map +0 -1
- package/core/tracking-props.js.map +0 -1
- package/core/validators/index.js.map +0 -1
- package/core/validators/object.validator.js.map +0 -1
- package/core/validators/value-object.validator.js.map +0 -1
- package/ddd.module.js.map +0 -1
- package/ddd.options.js.map +0 -1
- package/ddd.service.js.map +0 -1
- package/decorators/command-handler.decorator.d.ts +0 -3
- package/decorators/command-handler.decorator.js.map +0 -1
- package/decorators/constants.js.map +0 -1
- package/decorators/events-handler.decorator.d.ts +0 -3
- package/decorators/events-handler.decorator.js.map +0 -1
- package/decorators/index.js.map +0 -1
- package/decorators/saga.decorator.js.map +0 -1
- package/domain-aggregate-root.js.map +0 -1
- package/domain-command-bus.d.ts +0 -21
- package/domain-command-bus.js.map +0 -1
- package/domain-entity.js.map +0 -1
- package/domain-event-bus.js.map +0 -1
- package/domain-event-collection.js.map +0 -1
- package/domain-event-publisher.js.map +0 -1
- package/domain-event.js.map +0 -1
- package/exceptions/broken-rules.exeption.js.map +0 -1
- package/exceptions/constants.js.map +0 -1
- package/exceptions/exception.base.js.map +0 -1
- package/exceptions/exceptions.js.map +0 -1
- package/exceptions/index.js.map +0 -1
- package/helpers/datetime.helper.js.map +0 -1
- package/helpers/default-command-pubsub.helper.d.ts +0 -7
- package/helpers/default-command-pubsub.helper.js.map +0 -1
- package/helpers/default-get-event-id.helper.js.map +0 -1
- package/helpers/default-pubsub.helper.js.map +0 -1
- package/helpers/default-unhandled-exception-pubsub.helper.js.map +0 -1
- package/helpers/domain-guard.helper.js.map +0 -1
- package/helpers/domain-object.helper.js.map +0 -1
- package/helpers/index.js.map +0 -1
- package/index.js.map +0 -1
- package/unhandled-exeption-bus.js.map +0 -1
- package/valueobjects/domain-audit.valueobject.js.map +0 -1
- package/valueobjects/domain-date.valueobject.js.map +0 -1
- package/valueobjects/domain-number.valueobject.js.map +0 -1
- package/valueobjects/domain-string.valueobject.js.map +0 -1
- package/valueobjects/domain-uid.valueobject.js.map +0 -1
- package/valueobjects/domain-valueobject.js.map +0 -1
- package/valueobjects/index.js.map +0 -1
- /package/{command.base.js → libs/ddd/src/command.base.js} +0 -0
- /package/{core → libs/ddd/src/core}/broken-rules/broken-rule.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/broken-rules/broken-rule.js +0 -0
- /package/{core → libs/ddd/src/core}/broken-rules/index.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/broken-rules/index.js +0 -0
- /package/{core → libs/ddd/src/core}/index.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/index.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/command-bus.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/command-handler.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/command-metadata.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/command-publisher.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/command.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-bus.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-bus.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-handler.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-handler.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-metadata.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-metadata.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-publisher.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event-publisher.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-event.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-repository-read.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-repository-read.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-repository-transaction.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-repository-transaction.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-repository-write.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/domain-repository-write.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/index.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/index.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/message-source.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/message-source.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/observable-bus.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/observable-bus.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/saga.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/tracking.interface.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/tracking.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/unhandled-exception-info.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/interfaces/unhandled-exception-publisher.interface.js +0 -0
- /package/{core → libs/ddd/src/core}/of-type.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/of-type.js +0 -0
- /package/{core → libs/ddd/src/core}/tracking-props.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/tracking-props.js +0 -0
- /package/{core → libs/ddd/src/core}/validators/index.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/validators/index.js +0 -0
- /package/{core → libs/ddd/src/core}/validators/object.validator.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/validators/object.validator.js +0 -0
- /package/{core → libs/ddd/src/core}/validators/value-object.validator.d.ts +0 -0
- /package/{core → libs/ddd/src/core}/validators/value-object.validator.js +0 -0
- /package/{ddd.options.js → libs/ddd/src/ddd.options.js} +0 -0
- /package/{ddd.service.d.ts → libs/ddd/src/ddd.service.d.ts} +0 -0
- /package/{decorators → libs/ddd/src/decorators}/constants.d.ts +0 -0
- /package/{decorators → libs/ddd/src/decorators}/constants.js +0 -0
- /package/{decorators → libs/ddd/src/decorators}/index.d.ts +0 -0
- /package/{decorators → libs/ddd/src/decorators}/index.js +0 -0
- /package/{decorators → libs/ddd/src/decorators}/saga.decorator.d.ts +0 -0
- /package/{decorators → libs/ddd/src/decorators}/saga.decorator.js +0 -0
- /package/{domain-aggregate-root.d.ts → libs/ddd/src/domain-aggregate-root.d.ts} +0 -0
- /package/{domain-aggregate-root.js → libs/ddd/src/domain-aggregate-root.js} +0 -0
- /package/{domain-command-bus.js → libs/ddd/src/domain-command-bus.js} +0 -0
- /package/{domain-event-bus.d.ts → libs/ddd/src/domain-event-bus.d.ts} +0 -0
- /package/{domain-event-bus.js → libs/ddd/src/domain-event-bus.js} +0 -0
- /package/{domain-event-collection.d.ts → libs/ddd/src/domain-event-collection.d.ts} +0 -0
- /package/{domain-event-collection.js → libs/ddd/src/domain-event-collection.js} +0 -0
- /package/{domain-event-publisher.d.ts → libs/ddd/src/domain-event-publisher.d.ts} +0 -0
- /package/{domain-event-publisher.js → libs/ddd/src/domain-event-publisher.js} +0 -0
- /package/{domain-event.d.ts → libs/ddd/src/domain-event.d.ts} +0 -0
- /package/{domain-event.js → libs/ddd/src/domain-event.js} +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/broken-rules.exeption.d.ts +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/broken-rules.exeption.js +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/constants.d.ts +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/constants.js +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/exception.base.d.ts +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/exception.base.js +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/index.d.ts +0 -0
- /package/{exceptions → libs/ddd/src/exceptions}/index.js +0 -0
- /package/{helpers → libs/ddd/src/helpers}/datetime.helper.d.ts +0 -0
- /package/{helpers → libs/ddd/src/helpers}/datetime.helper.js +0 -0
- /package/{helpers → libs/ddd/src/helpers}/default-get-event-id.helper.d.ts +0 -0
- /package/{helpers → libs/ddd/src/helpers}/default-get-event-id.helper.js +0 -0
- /package/{helpers → libs/ddd/src/helpers}/default-pubsub.helper.d.ts +0 -0
- /package/{helpers → libs/ddd/src/helpers}/default-pubsub.helper.js +0 -0
- /package/{helpers → libs/ddd/src/helpers}/default-unhandled-exception-pubsub.helper.js +0 -0
- /package/{helpers → libs/ddd/src/helpers}/domain-object.helper.d.ts +0 -0
- /package/{helpers → libs/ddd/src/helpers}/domain-object.helper.js +0 -0
- /package/{helpers → libs/ddd/src/helpers}/index.d.ts +0 -0
- /package/{helpers → libs/ddd/src/helpers}/index.js +0 -0
- /package/{index.d.ts → libs/ddd/src/index.d.ts} +0 -0
- /package/{index.js → libs/ddd/src/index.js} +0 -0
- /package/{unhandled-exeption-bus.js → libs/ddd/src/unhandled-exeption-bus.js} +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-date.valueobject.d.ts +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-date.valueobject.js +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-number.valueobject.d.ts +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-number.valueobject.js +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-string.valueobject.d.ts +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-string.valueobject.js +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-uid.valueobject.d.ts +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-uid.valueobject.js +0 -0
- /package/{valueobjects → libs/ddd/src/valueobjects}/domain-valueobject.d.ts +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetaRequestHelper = void 0;
|
|
4
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
class MetaRequestHelper {
|
|
7
|
+
static getMetadata(context) {
|
|
8
|
+
const metadata = {
|
|
9
|
+
trackingId: '',
|
|
10
|
+
requestId: '',
|
|
11
|
+
user: '',
|
|
12
|
+
};
|
|
13
|
+
if (context.getType() === 'http') {
|
|
14
|
+
const request = context.switchToHttp().getRequest();
|
|
15
|
+
metadata.trackingId = request?.body?.trackingId || '';
|
|
16
|
+
metadata.requestId = request?.body?.requestId || (0, uuid_1.v4)();
|
|
17
|
+
metadata.user = request?.body?.user || 'admin';
|
|
18
|
+
return metadata;
|
|
19
|
+
}
|
|
20
|
+
if (context.getType() === 'graphql') {
|
|
21
|
+
const gqlContext = graphql_1.GqlExecutionContext.create(context);
|
|
22
|
+
const info = gqlContext.getInfo();
|
|
23
|
+
const parentType = info.parentType.name;
|
|
24
|
+
if (parentType === 'Query' || parentType === 'Mutation') {
|
|
25
|
+
metadata.trackingId =
|
|
26
|
+
gqlContext.getContext().req.body?.variables?.trackingId;
|
|
27
|
+
metadata.requestId =
|
|
28
|
+
gqlContext.getContext().req.body?.variables?.requestId;
|
|
29
|
+
metadata.user = gqlContext.getContext().req.body?.variables?.user;
|
|
30
|
+
return metadata;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
metadata.requestId === undefined || null
|
|
34
|
+
? (metadata.requestId = (0, uuid_1.v4)())
|
|
35
|
+
: (metadata.requestId = metadata.requestId);
|
|
36
|
+
metadata.trackingId === undefined || null
|
|
37
|
+
? (metadata.trackingId = (0, uuid_1.v4)())
|
|
38
|
+
: (metadata.trackingId = metadata.trackingId);
|
|
39
|
+
metadata.user === null
|
|
40
|
+
? (metadata.user = 'default')
|
|
41
|
+
: (metadata.user = metadata.user);
|
|
42
|
+
return metadata;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.MetaRequestHelper = MetaRequestHelper;
|
|
46
|
+
//# sourceMappingURL=meta-request.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-request.helper.js","sourceRoot":"","sources":["../../../../../../../src/shared/application/context/meta-request.helper.ts"],"names":[],"mappings":";;;AACA,6CAAsE;AACtE,+BAAoC;AAGpC,MAAa,iBAAiB;IAC5B,MAAM,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,QAAQ,GAAwB;YACpC,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,IAAI,EAAE,EAAE;SACT,CAAC;QAEF,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;YAEpD,QAAQ,CAAC,UAAU,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,IAAI,EAAE,CAAC;YACtD,QAAQ,CAAC,SAAS,GAAG,OAAO,EAAE,IAAI,EAAE,SAAS,IAAI,IAAA,SAAM,GAAE,CAAC;YAC1D,QAAQ,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC;YAG/C,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,IAAI,OAAO,CAAC,OAAO,EAAkB,KAAK,SAAS,EAAE,CAAC;YACpD,MAAM,UAAU,GAAG,6BAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACvD,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;YAClC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAExC,IAAI,UAAU,KAAK,OAAO,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;gBACxD,QAAQ,CAAC,UAAU;oBACjB,UAAU,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC;gBAC1D,QAAQ,CAAC,SAAS;oBAChB,UAAU,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC;gBACzD,QAAQ,CAAC,IAAI,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;gBAElE,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;QAGD,QAAQ,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI;YACtC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAA,SAAM,GAAE,CAAC;YACjC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9C,QAAQ,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI;YACvC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAA,SAAM,GAAE,CAAC;YAClC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;QAEhD,QAAQ,CAAC,IAAI,KAAK,IAAI;YACpB,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC;YAC7B,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEpC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAlDD,8CAkDC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./commands"), exports);
|
|
18
|
+
__exportStar(require("./queries"), exports);
|
|
19
|
+
__exportStar(require("./context"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/shared/application/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,4CAA0B;AAC1B,4CAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './query.base';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./query.base"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/shared/application/queries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare class Paginated<T> {
|
|
2
|
+
readonly count: number;
|
|
3
|
+
readonly limit: number;
|
|
4
|
+
readonly page: number;
|
|
5
|
+
readonly data: readonly T[];
|
|
6
|
+
constructor(props: Paginated<T>);
|
|
7
|
+
}
|
|
8
|
+
export type OrderBy = {
|
|
9
|
+
field: string | true;
|
|
10
|
+
param: 'asc' | 'desc';
|
|
11
|
+
};
|
|
12
|
+
export type PaginatedQueryParams = {
|
|
13
|
+
limit: number;
|
|
14
|
+
page: number;
|
|
15
|
+
offset: number;
|
|
16
|
+
orderBy: OrderBy;
|
|
17
|
+
};
|
|
18
|
+
export declare abstract class QueryBase {
|
|
19
|
+
}
|
|
20
|
+
export declare abstract class PaginatedQueryBase extends QueryBase {
|
|
21
|
+
limit: number;
|
|
22
|
+
offset: number;
|
|
23
|
+
orderBy: OrderBy;
|
|
24
|
+
page: number;
|
|
25
|
+
constructor(props: PaginatedParams<PaginatedQueryBase>);
|
|
26
|
+
}
|
|
27
|
+
export type PaginatedParams<T> = Omit<T, 'limit' | 'offset' | 'orderBy' | 'page'> & Partial<Omit<PaginatedQueryParams, 'offset'>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaginatedQueryBase = exports.QueryBase = exports.Paginated = void 0;
|
|
4
|
+
class Paginated {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
this.count = props.count;
|
|
7
|
+
this.limit = props.limit;
|
|
8
|
+
this.page = props.page;
|
|
9
|
+
this.data = props.data;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Paginated = Paginated;
|
|
13
|
+
class QueryBase {
|
|
14
|
+
}
|
|
15
|
+
exports.QueryBase = QueryBase;
|
|
16
|
+
class PaginatedQueryBase extends QueryBase {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super();
|
|
19
|
+
this.limit = props.limit || 20;
|
|
20
|
+
this.offset = props.page ? props.page * this.limit : 0;
|
|
21
|
+
this.page = props.page || 0;
|
|
22
|
+
this.orderBy = props.orderBy || { field: true, param: 'desc' };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.PaginatedQueryBase = PaginatedQueryBase;
|
|
26
|
+
//# sourceMappingURL=query.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.base.js","sourceRoot":"","sources":["../../../../../../../src/shared/application/queries/query.base.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAS;IAMpB,YAAY,KAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAZD,8BAYC;AAWD,MAAsB,SAAS;CAAG;AAAlC,8BAAkC;AAElC,MAAsB,kBAAmB,SAAQ,SAAS;IAMxD,YAAY,KAA0C;QACpD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IACjE,CAAC;CACF;AAbD,gDAaC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Id = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const src_1 = require("../../../libs/ddd/src");
|
|
6
|
+
class Id extends src_1.DomainUIdValueObject {
|
|
7
|
+
businessRules(props) {
|
|
8
|
+
}
|
|
9
|
+
static create() {
|
|
10
|
+
return new Id((0, uuid_1.v4)().toString());
|
|
11
|
+
}
|
|
12
|
+
static load(value) {
|
|
13
|
+
return new Id(value);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.Id = Id;
|
|
17
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../../../../src/shared/domain/id.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAE1B,+CAA+E;AAE/E,MAAa,EAAG,SAAQ,0BAAoB;IAEhC,aAAa,CAAC,KAA+B;IAEvD,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,EAAE,CAAC,IAAA,SAAE,GAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,KAAa;QACvB,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACF;AAbD,gBAaC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Name = exports.SubscribedDate = exports.RegisterDate = exports.Url = exports.Id = void 0;
|
|
4
|
+
const id_1 = require("./id");
|
|
5
|
+
Object.defineProperty(exports, "Id", { enumerable: true, get: function () { return id_1.Id; } });
|
|
6
|
+
const url_1 = require("./url");
|
|
7
|
+
Object.defineProperty(exports, "Url", { enumerable: true, get: function () { return url_1.Url; } });
|
|
8
|
+
const register_date_1 = require("./register-date");
|
|
9
|
+
Object.defineProperty(exports, "RegisterDate", { enumerable: true, get: function () { return register_date_1.RegisterDate; } });
|
|
10
|
+
const subscribed_date_1 = require("./subscribed-date");
|
|
11
|
+
Object.defineProperty(exports, "SubscribedDate", { enumerable: true, get: function () { return subscribed_date_1.SubscribedDate; } });
|
|
12
|
+
const name_1 = require("./name");
|
|
13
|
+
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return name_1.Name; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/shared/domain/index.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAMjB,mFANA,OAAE,OAMA;AALX,+BAA4B;AAKf,oFALJ,SAAG,OAKI;AAJhB,mDAA+C;AAI7B,6FAJT,4BAAY,OAIS;AAH9B,uDAAmD;AAGnB,+FAHvB,gCAAc,OAGuB;AAF9C,iCAA8B;AAEkB,qFAFvC,WAAI,OAEuC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Name = void 0;
|
|
4
|
+
const src_1 = require("../../../libs/ddd/src");
|
|
5
|
+
class Name extends src_1.DomainStringValueObject {
|
|
6
|
+
businessRules(props) {
|
|
7
|
+
if (!src_1.DomainGuard.lengthIsBetween(props.value, 3, 150) === false) {
|
|
8
|
+
this.addBrokenRule(new src_1.BrokenRule('name', 'name must be between 3 and 150 characters'));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
static create(value) {
|
|
12
|
+
return new Name(value);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Name = Name;
|
|
16
|
+
//# sourceMappingURL=name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name.js","sourceRoot":"","sources":["../../../../../../src/shared/domain/name.ts"],"names":[],"mappings":";;;AAAA,+CAK+B;AAE/B,MAAa,IAAK,SAAQ,6BAAuB;IACrC,aAAa,CAAC,KAA+B;QACrD,IAAI,CAAC,iBAAW,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC;YAChE,IAAI,CAAC,aAAa,CAChB,IAAI,gBAAU,CAAC,MAAM,EAAE,2CAA2C,CAAC,CACpE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAa;QACzB,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF;AAZD,oBAYC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegisterDate = void 0;
|
|
4
|
+
const src_1 = require("../../../libs/ddd/src");
|
|
5
|
+
class RegisterDate extends src_1.DomainDateValueObject {
|
|
6
|
+
businessRules(props) {
|
|
7
|
+
}
|
|
8
|
+
static create(value) {
|
|
9
|
+
return new RegisterDate(value);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.RegisterDate = RegisterDate;
|
|
13
|
+
//# sourceMappingURL=register-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-date.js","sourceRoot":"","sources":["../../../../../../src/shared/domain/register-date.ts"],"names":[],"mappings":";;;AACA,+CAAgF;AAEhF,MAAa,YAAa,SAAQ,2BAAqB;IAC3C,aAAa,CAAC,KAA6B;IAErD,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAW;QACvB,OAAO,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;CACF;AARD,oCAQC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscribedDate = void 0;
|
|
4
|
+
const src_1 = require("../../../libs/ddd/src");
|
|
5
|
+
class SubscribedDate extends src_1.DomainDateValueObject {
|
|
6
|
+
businessRules(props) {
|
|
7
|
+
}
|
|
8
|
+
static create(value) {
|
|
9
|
+
return new SubscribedDate(value);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.SubscribedDate = SubscribedDate;
|
|
13
|
+
//# sourceMappingURL=subscribed-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribed-date.js","sourceRoot":"","sources":["../../../../../../src/shared/domain/subscribed-date.ts"],"names":[],"mappings":";;;AACA,+CAAgF;AAEhF,MAAa,cAAe,SAAQ,2BAAqB;IAC7C,aAAa,CAAC,KAA6B;IAErD,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAW;QACvB,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF;AARD,wCAQC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Url = void 0;
|
|
4
|
+
const src_1 = require("../../../libs/ddd/src");
|
|
5
|
+
class Url extends src_1.DomainStringValueObject {
|
|
6
|
+
businessRules(props) {
|
|
7
|
+
if (!src_1.DomainGuard.lengthIsBetween(props.value, 3, 150)) {
|
|
8
|
+
this.addBrokenRule(new src_1.BrokenRule('url', 'url must be between 3 and 150 characters'));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
static create(value) {
|
|
12
|
+
return new Url(value);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Url = Url;
|
|
16
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../../../../src/shared/domain/url.ts"],"names":[],"mappings":";;;AAAA,+CAI+B;AAE/B,MAAa,GAAI,SAAQ,6BAAuB;IACpC,aAAa,CAAC,KAAwB;QAC9C,IAAI,CAAC,iBAAW,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;YACtD,IAAI,CAAC,aAAa,CAChB,IAAI,gBAAU,CAAC,KAAK,EAAE,0CAA0C,CAAC,CAClE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAa;QACzB,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF;AAZD,kBAYC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplicationException = void 0;
|
|
4
|
+
class ApplicationException extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'ApplicationException';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ApplicationException = ApplicationException;
|
|
11
|
+
//# sourceMappingURL=application.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.exception.js","sourceRoot":"","sources":["../../../../../../src/shared/exceptions/application.exception.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO;QACjB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,oDAKC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseException = void 0;
|
|
4
|
+
class DatabaseException extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'DatabaseException';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.DatabaseException = DatabaseException;
|
|
11
|
+
//# sourceMappingURL=database.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.exception.js","sourceRoot":"","sources":["../../../../../../src/shared/exceptions/database.exception.ts"],"names":[],"mappings":";;;AAAA,MAAa,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAO;QACjB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AALD,8CAKC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DomainException = void 0;
|
|
4
|
+
class DomainException extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'DomainException';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.DomainException = DomainException;
|
|
11
|
+
//# sourceMappingURL=domain.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain.exception.js","sourceRoot":"","sources":["../../../../../../src/shared/exceptions/domain.exception.ts"],"names":[],"mappings":";;;AAAA,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAO;QACjB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplicationException = exports.DomainException = exports.DatabaseException = void 0;
|
|
4
|
+
const application_exception_1 = require("./application.exception");
|
|
5
|
+
Object.defineProperty(exports, "ApplicationException", { enumerable: true, get: function () { return application_exception_1.ApplicationException; } });
|
|
6
|
+
const domain_exception_1 = require("./domain.exception");
|
|
7
|
+
Object.defineProperty(exports, "DomainException", { enumerable: true, get: function () { return domain_exception_1.DomainException; } });
|
|
8
|
+
const database_exception_1 = require("./database.exception");
|
|
9
|
+
Object.defineProperty(exports, "DatabaseException", { enumerable: true, get: function () { return database_exception_1.DatabaseException; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/shared/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,mEAA+D;AAIlB,qGAJpC,4CAAoB,OAIoC;AAHjE,yDAAqD;AAGzB,gGAHnB,kCAAe,OAGmB;AAF3C,6DAAyD;AAEhD,kGAFA,sCAAiB,OAEA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./domain"), exports);
|
|
18
|
+
__exportStar(require("./exceptions"), exports);
|
|
19
|
+
__exportStar(require("./infrastructure"), exports);
|
|
20
|
+
__exportStar(require("./application"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/shared/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,mDAAiC;AACjC,gDAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './repository.base';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./repository.base"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/shared/infrastructure/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ObjectLiteral, Repository } from 'typeorm';
|
|
2
|
+
import { IDomainReadRepository, IDomainWriteRepository } from '@nestjslatam/ddd-lib';
|
|
3
|
+
import { Paginated, PaginatedQueryParams } from '../../application';
|
|
4
|
+
export declare abstract class AbstractRepository<TKey, TTable extends ObjectLiteral> implements IDomainReadRepository<TKey, TTable>, IDomainWriteRepository<TKey, TTable> {
|
|
5
|
+
protected readonly repository: Repository<TTable>;
|
|
6
|
+
protected abstract tableName: string;
|
|
7
|
+
constructor(repository: Repository<TTable>);
|
|
8
|
+
abstract findAll(params: PaginatedQueryParams): Promise<Paginated<TTable>>;
|
|
9
|
+
find(): Promise<TTable[]>;
|
|
10
|
+
findById(id: any): Promise<TTable>;
|
|
11
|
+
insert(entity: TTable): Promise<void>;
|
|
12
|
+
insertBatch(entities: TTable[]): Promise<void>;
|
|
13
|
+
update(id: TKey, entity: TTable): Promise<void>;
|
|
14
|
+
delete(id: TKey): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractRepository = void 0;
|
|
4
|
+
const exceptions_1 = require("../../exceptions");
|
|
5
|
+
class AbstractRepository {
|
|
6
|
+
constructor(repository) {
|
|
7
|
+
this.repository = repository;
|
|
8
|
+
}
|
|
9
|
+
async find() {
|
|
10
|
+
try {
|
|
11
|
+
return await this.repository.find();
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
throw new exceptions_1.DatabaseException(error);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async findById(id) {
|
|
18
|
+
try {
|
|
19
|
+
const data = await this.repository.findOneBy(id);
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new exceptions_1.DatabaseException(error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async insert(entity) {
|
|
27
|
+
try {
|
|
28
|
+
await this.repository.insert(entity);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw new exceptions_1.DatabaseException(error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async insertBatch(entities) {
|
|
35
|
+
try {
|
|
36
|
+
await this.repository.insert(entities);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
throw new exceptions_1.DatabaseException(error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async update(id, entity) {
|
|
43
|
+
try {
|
|
44
|
+
const found = await this.findById(id);
|
|
45
|
+
if (!found)
|
|
46
|
+
throw new exceptions_1.DatabaseException(`Entity with id ${id} not found`);
|
|
47
|
+
await this.repository.update(id, entity);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw new exceptions_1.DatabaseException(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async delete(id) {
|
|
54
|
+
try {
|
|
55
|
+
await this.repository.delete(id);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw new exceptions_1.DatabaseException(error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.AbstractRepository = AbstractRepository;
|
|
63
|
+
//# sourceMappingURL=repository.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.base.js","sourceRoot":"","sources":["../../../../../../../src/shared/infrastructure/db/repository.base.ts"],"names":[],"mappings":";;;AAMA,iDAAqD;AAGrD,MAAsB,kBAAkB;IAOtC,YAA+B,UAA8B;QAA9B,eAAU,GAAV,UAAU,CAAoB;IAAG,CAAC;IAIjE,KAAK,CAAC,IAAI;QACR,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,8BAAiB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAO;QACpB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAEjD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,8BAAiB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,8BAAiB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAkB;QAClC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,8BAAiB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAQ,EAAE,MAAc;QACnC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAEtC,IAAI,CAAC,KAAK;gBAAE,MAAM,IAAI,8BAAiB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;YAE1E,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAY,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,8BAAiB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAQ;QACnB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAY,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,8BAAiB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;CACF;AAhED,gDAgEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './db';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./db"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/shared/infrastructure/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAqB"}
|