@mondart/nestjs-common-module 2.9.1 → 3.0.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/dist/index.d.ts +2 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -0
- package/dist/lib/bottleneck/index.d.ts +2 -10
- package/dist/lib/bottleneck/index.d.ts.map +1 -0
- package/dist/lib/bottleneck/index.js +2 -10
- package/dist/lib/bottleneck/index.js.map +1 -0
- package/dist/lib/caching/index.d.ts +2 -3
- package/dist/lib/caching/index.d.ts.map +1 -0
- package/dist/lib/caching/index.js +2 -3
- package/dist/lib/caching/index.js.map +1 -0
- package/dist/lib/core-crud/index.d.ts +2 -3
- package/dist/lib/core-crud/index.d.ts.map +1 -0
- package/dist/lib/core-crud/index.js +2 -3
- package/dist/lib/core-crud/index.js.map +1 -0
- package/dist/lib/google-recaptcha/index.d.ts +2 -15
- package/dist/lib/google-recaptcha/index.d.ts.map +1 -0
- package/dist/lib/google-recaptcha/index.js +16 -29
- package/dist/lib/google-recaptcha/index.js.map +1 -0
- package/dist/lib/health-check/index.d.ts +2 -3
- package/dist/lib/health-check/index.d.ts.map +1 -0
- package/dist/lib/health-check/index.js +2 -3
- package/dist/lib/health-check/index.js.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/kafka/index.d.ts +2 -4
- package/dist/lib/kafka/index.d.ts.map +1 -0
- package/dist/lib/kafka/index.js +16 -5
- package/dist/lib/kafka/index.js.map +1 -0
- package/dist/lib/keycloak/index.d.ts +2 -6
- package/dist/lib/keycloak/index.d.ts.map +1 -0
- package/dist/lib/keycloak/index.js +2 -3
- package/dist/lib/keycloak/index.js.map +1 -0
- package/dist/lib/request/index.d.ts +2 -4
- package/dist/lib/request/index.d.ts.map +1 -0
- package/dist/lib/request/index.js +16 -7
- package/dist/lib/request/index.js.map +1 -0
- package/dist/lib/saga/index.d.ts +2 -7
- package/dist/lib/saga/index.d.ts.map +1 -0
- package/dist/lib/saga/index.js +16 -14
- package/dist/lib/saga/index.js.map +1 -0
- package/package.json +23 -87
- package/README.md +0 -8
- package/dist/constants/index.d.ts +0 -3
- package/dist/constants/index.js +0 -19
- package/dist/constants/nest-exceptions-api-response.const.d.ts +0 -2
- package/dist/constants/nest-exceptions-api-response.const.js +0 -39
- package/dist/constants/validation-constraints.const.d.ts +0 -14
- package/dist/constants/validation-constraints.const.js +0 -18
- package/dist/constants/validation-options.const.d.ts +0 -2
- package/dist/constants/validation-options.const.js +0 -23
- package/dist/decorators/entity-order.decorator.d.ts +0 -2
- package/dist/decorators/entity-order.decorator.js +0 -17
- package/dist/decorators/get-agent.decorator.d.ts +0 -1
- package/dist/decorators/get-agent.decorator.js +0 -24
- package/dist/decorators/get-store-id.decorator.d.ts +0 -1
- package/dist/decorators/get-store-id.decorator.js +0 -12
- package/dist/decorators/get-user.decorator.d.ts +0 -1
- package/dist/decorators/get-user.decorator.js +0 -23
- package/dist/decorators/iam-context.decorator.d.ts +0 -3
- package/dist/decorators/iam-context.decorator.js +0 -59
- package/dist/decorators/index.d.ts +0 -8
- package/dist/decorators/index.js +0 -24
- package/dist/decorators/kafka-timestamp.decorator.d.ts +0 -1
- package/dist/decorators/kafka-timestamp.decorator.js +0 -28
- package/dist/decorators/swagger-api-response.decorator.d.ts +0 -9
- package/dist/decorators/swagger-api-response.decorator.js +0 -43
- package/dist/decorators/validations/default/array-max-size.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/array-max-size.decorator.js +0 -11
- package/dist/decorators/validations/default/array-min-size.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/array-min-size.decorator.js +0 -11
- package/dist/decorators/validations/default/array-not-empty.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/array-not-empty.decorator.js +0 -9
- package/dist/decorators/validations/default/index.d.ts +0 -20
- package/dist/decorators/validations/default/index.js +0 -36
- package/dist/decorators/validations/default/is-array.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/is-array.decorator.js +0 -9
- package/dist/decorators/validations/default/is-boolean.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/is-boolean.decorator.js +0 -9
- package/dist/decorators/validations/default/is-date.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/is-date.decorator.js +0 -9
- package/dist/decorators/validations/default/is-enum.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/is-enum.decorator.js +0 -11
- package/dist/decorators/validations/default/is-int.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/is-int.decorator.js +0 -9
- package/dist/decorators/validations/default/is-not-empty-object.decorator.d.ts +0 -5
- package/dist/decorators/validations/default/is-not-empty-object.decorator.js +0 -12
- package/dist/decorators/validations/default/is-not-empty.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/is-not-empty.decorator.js +0 -9
- package/dist/decorators/validations/default/is-number-string.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/is-number-string.decorator.js +0 -9
- package/dist/decorators/validations/default/is-object.decorator.d.ts +0 -2
- package/dist/decorators/validations/default/is-object.decorator.js +0 -9
- package/dist/decorators/validations/default/is-positive.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/is-positive.decorator.js +0 -9
- package/dist/decorators/validations/default/is-string.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/is-string.decorator.js +0 -10
- package/dist/decorators/validations/default/is-uuid.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/is-uuid.decorator.js +0 -9
- package/dist/decorators/validations/default/matches.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/matches.decorator.js +0 -9
- package/dist/decorators/validations/default/max-length.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/max-length.decorator.js +0 -11
- package/dist/decorators/validations/default/max.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/max.decorator.js +0 -9
- package/dist/decorators/validations/default/min-length.decorator.d.ts +0 -1
- package/dist/decorators/validations/default/min-length.decorator.js +0 -11
- package/dist/decorators/validations/default/min.decorator.d.ts +0 -3
- package/dist/decorators/validations/default/min.decorator.js +0 -9
- package/dist/decorators/validations/depend-on-property.decorator.d.ts +0 -2
- package/dist/decorators/validations/depend-on-property.decorator.js +0 -28
- package/dist/decorators/validations/index.d.ts +0 -5
- package/dist/decorators/validations/index.js +0 -21
- package/dist/decorators/validations/is-id.decorator.d.ts +0 -4
- package/dist/decorators/validations/is-id.decorator.js +0 -20
- package/dist/decorators/validations/is-not-empty-string.decorator.d.ts +0 -4
- package/dist/decorators/validations/is-not-empty-string.decorator.js +0 -14
- package/dist/decorators/validations/is-one-of-property.decorator.d.ts +0 -2
- package/dist/decorators/validations/is-one-of-property.decorator.js +0 -25
- package/dist/dto/base/base-kafka-event.dto.d.ts +0 -10
- package/dist/dto/base/base-kafka-event.dto.js +0 -53
- package/dist/dto/base/index.d.ts +0 -1
- package/dist/dto/base/index.js +0 -17
- package/dist/dto/index.d.ts +0 -3
- package/dist/dto/index.js +0 -19
- package/dist/dto/request/base-request.dto.d.ts +0 -4
- package/dist/dto/request/base-request.dto.js +0 -28
- package/dist/dto/request/id.dto.d.ts +0 -3
- package/dist/dto/request/id.dto.js +0 -24
- package/dist/dto/request/ids.dto.d.ts +0 -3
- package/dist/dto/request/ids.dto.js +0 -27
- package/dist/dto/request/index.d.ts +0 -5
- package/dist/dto/request/index.js +0 -21
- package/dist/dto/request/kafka-request.dto.d.ts +0 -5
- package/dist/dto/request/kafka-request.dto.js +0 -20
- package/dist/dto/request/uuid.dto.d.ts +0 -3
- package/dist/dto/request/uuid.dto.js +0 -22
- package/dist/dto/response/base-response-with-action-dates.dto.d.ts +0 -7
- package/dist/dto/response/base-response-with-action-dates.dto.js +0 -35
- package/dist/dto/response/base-response.dto.d.ts +0 -4
- package/dist/dto/response/base-response.dto.js +0 -23
- package/dist/dto/response/error-response.dto.d.ts +0 -16
- package/dist/dto/response/error-response.dto.js +0 -42
- package/dist/dto/response/iam-context.dto.d.ts +0 -12
- package/dist/dto/response/iam-context.dto.js +0 -67
- package/dist/dto/response/index.d.ts +0 -9
- package/dist/dto/response/index.js +0 -25
- package/dist/dto/response/kafka-failed-response.dto.d.ts +0 -9
- package/dist/dto/response/kafka-failed-response.dto.js +0 -51
- package/dist/dto/response/kafka-success-response.dto.d.ts +0 -6
- package/dist/dto/response/kafka-success-response.dto.js +0 -21
- package/dist/dto/response/paginate-metadata-response.dto.d.ts +0 -12
- package/dist/dto/response/paginate-metadata-response.dto.js +0 -43
- package/dist/dto/response/success-response.dto.d.ts +0 -9
- package/dist/dto/response/success-response.dto.js +0 -43
- package/dist/dto/response/validation.dto.d.ts +0 -25
- package/dist/dto/response/validation.dto.js +0 -83
- package/dist/entities/base-model-with-admin-actions.entity.d.ts +0 -6
- package/dist/entities/base-model-with-admin-actions.entity.js +0 -33
- package/dist/entities/base-model-with-admin-and-user-actions.entity.d.ts +0 -9
- package/dist/entities/base-model-with-admin-and-user-actions.entity.js +0 -48
- package/dist/entities/base-model-with-dates.entity.d.ts +0 -7
- package/dist/entities/base-model-with-dates.entity.js +0 -38
- package/dist/entities/base-model-with-user-actions.entity.d.ts +0 -6
- package/dist/entities/base-model-with-user-actions.entity.js +0 -33
- package/dist/entities/base-model.entity.d.ts +0 -5
- package/dist/entities/base-model.entity.js +0 -33
- package/dist/entities/index.d.ts +0 -5
- package/dist/entities/index.js +0 -21
- package/dist/enums/environments.enum.d.ts +0 -6
- package/dist/enums/environments.enum.js +0 -10
- package/dist/enums/index.d.ts +0 -2
- package/dist/enums/index.js +0 -18
- package/dist/enums/shared-messages.enum.d.ts +0 -26
- package/dist/enums/shared-messages.enum.js +0 -30
- package/dist/filters/global-exception.filter.d.ts +0 -10
- package/dist/filters/global-exception.filter.js +0 -116
- package/dist/filters/index.d.ts +0 -1
- package/dist/filters/index.js +0 -17
- package/dist/helpers/convert-string-case.helper.d.ts +0 -8
- package/dist/helpers/convert-string-case.helper.js +0 -43
- package/dist/helpers/get-env.helper.d.ts +0 -1
- package/dist/helpers/get-env.helper.js +0 -6
- package/dist/helpers/index.d.ts +0 -6
- package/dist/helpers/index.js +0 -22
- package/dist/helpers/message-formatter.helper.d.ts +0 -3
- package/dist/helpers/message-formatter.helper.js +0 -28
- package/dist/helpers/multi-inheritance.helper.d.ts +0 -1
- package/dist/helpers/multi-inheritance.helper.js +0 -12
- package/dist/helpers/rxjs-catch-error.helper.d.ts +0 -2
- package/dist/helpers/rxjs-catch-error.helper.js +0 -28
- package/dist/helpers/rxjs-timeout-custom-callback.helper.d.ts +0 -2
- package/dist/helpers/rxjs-timeout-custom-callback.helper.js +0 -15
- package/dist/interceptors/global-logger.interceptor.d.ts +0 -5
- package/dist/interceptors/global-logger.interceptor.js +0 -59
- package/dist/interceptors/index.d.ts +0 -1
- package/dist/interceptors/index.js +0 -17
- package/dist/interfaces/custom-validation-arguments.interface.d.ts +0 -14
- package/dist/interfaces/custom-validation-arguments.interface.js +0 -2
- package/dist/interfaces/get-agent.interface.d.ts +0 -6
- package/dist/interfaces/get-agent.interface.js +0 -2
- package/dist/interfaces/get-user.interface.d.ts +0 -6
- package/dist/interfaces/get-user.interface.js +0 -2
- package/dist/interfaces/index.d.ts +0 -6
- package/dist/interfaces/index.js +0 -22
- package/dist/interfaces/kafka-failed-response.interface.d.ts +0 -10
- package/dist/interfaces/kafka-failed-response.interface.js +0 -2
- package/dist/interfaces/kafka-success-response.interface.d.ts +0 -10
- package/dist/interfaces/kafka-success-response.interface.js +0 -2
- package/dist/interfaces/pagination-query.d.ts +0 -13
- package/dist/interfaces/pagination-query.js +0 -54
- package/dist/lib/bottleneck/bottleneck.module.d.ts +0 -8
- package/dist/lib/bottleneck/bottleneck.module.js +0 -109
- package/dist/lib/bottleneck/constants/bottleneck.const.d.ts +0 -3
- package/dist/lib/bottleneck/constants/bottleneck.const.js +0 -6
- package/dist/lib/bottleneck/cqrs-wrapper/queued-command-bus.d.ts +0 -8
- package/dist/lib/bottleneck/cqrs-wrapper/queued-command-bus.js +0 -31
- package/dist/lib/bottleneck/cqrs-wrapper/queued-query-bus.d.ts +0 -8
- package/dist/lib/bottleneck/cqrs-wrapper/queued-query-bus.js +0 -31
- package/dist/lib/bottleneck/decorators/config-bottleneck.decorator.d.ts +0 -2
- package/dist/lib/bottleneck/decorators/config-bottleneck.decorator.js +0 -7
- package/dist/lib/bottleneck/decorators/skip-bottleneck.decorator.d.ts +0 -1
- package/dist/lib/bottleneck/decorators/skip-bottleneck.decorator.js +0 -7
- package/dist/lib/bottleneck/decorators/use-bottleneck.decorator.d.ts +0 -1
- package/dist/lib/bottleneck/decorators/use-bottleneck.decorator.js +0 -7
- package/dist/lib/bottleneck/interceptors/bottleneck.interceptor.d.ts +0 -12
- package/dist/lib/bottleneck/interceptors/bottleneck.interceptor.js +0 -82
- package/dist/lib/bottleneck/interfaces/bottleneck-options.interface.d.ts +0 -39
- package/dist/lib/bottleneck/interfaces/bottleneck-options.interface.js +0 -4
- package/dist/lib/bottleneck/services/bottleneck.service.d.ts +0 -14
- package/dist/lib/bottleneck/services/bottleneck.service.js +0 -93
- package/dist/lib/caching/caching.interface.d.ts +0 -22
- package/dist/lib/caching/caching.interface.js +0 -4
- package/dist/lib/caching/caching.module.d.ts +0 -8
- package/dist/lib/caching/caching.module.js +0 -142
- package/dist/lib/caching/caching.service.d.ts +0 -25
- package/dist/lib/caching/caching.service.js +0 -85
- package/dist/lib/core-crud/controllers/core-crud.controller.d.ts +0 -23
- package/dist/lib/core-crud/controllers/core-crud.controller.js +0 -55
- package/dist/lib/core-crud/interfaces/crud-service-option.interface.d.ts +0 -27
- package/dist/lib/core-crud/interfaces/crud-service-option.interface.js +0 -2
- package/dist/lib/core-crud/services/core-crud.service.d.ts +0 -36
- package/dist/lib/core-crud/services/core-crud.service.js +0 -343
- package/dist/lib/google-recaptcha/decorators/recaptcha-result.d.ts +0 -1
- package/dist/lib/google-recaptcha/decorators/recaptcha-result.js +0 -16
- package/dist/lib/google-recaptcha/decorators/recaptcha.d.ts +0 -2
- package/dist/lib/google-recaptcha/decorators/recaptcha.js +0 -9
- package/dist/lib/google-recaptcha/decorators/set-recaptcha-options.d.ts +0 -2
- package/dist/lib/google-recaptcha/decorators/set-recaptcha-options.js +0 -8
- package/dist/lib/google-recaptcha/enums/classification-reason.d.ts +0 -8
- package/dist/lib/google-recaptcha/enums/classification-reason.js +0 -12
- package/dist/lib/google-recaptcha/enums/error-code.d.ts +0 -16
- package/dist/lib/google-recaptcha/enums/error-code.js +0 -20
- package/dist/lib/google-recaptcha/enums/google-recaptcha-context.d.ts +0 -4
- package/dist/lib/google-recaptcha/enums/google-recaptcha-context.js +0 -8
- package/dist/lib/google-recaptcha/enums/google-recaptcha-enterprise-reason.d.ts +0 -10
- package/dist/lib/google-recaptcha/enums/google-recaptcha-enterprise-reason.js +0 -14
- package/dist/lib/google-recaptcha/enums/google-recaptcha-network.d.ts +0 -4
- package/dist/lib/google-recaptcha/enums/google-recaptcha-network.js +0 -8
- package/dist/lib/google-recaptcha/exceptions/google-recaptcha-network.exception.d.ts +0 -5
- package/dist/lib/google-recaptcha/exceptions/google-recaptcha-network.exception.js +0 -14
- package/dist/lib/google-recaptcha/exceptions/google-recaptcha.exception.d.ts +0 -8
- package/dist/lib/google-recaptcha/exceptions/google-recaptcha.exception.js +0 -54
- package/dist/lib/google-recaptcha/google-recaptcha.module.d.ts +0 -12
- package/dist/lib/google-recaptcha/google-recaptcha.module.js +0 -158
- package/dist/lib/google-recaptcha/guards/google-recaptcha.guard.d.ts +0 -15
- package/dist/lib/google-recaptcha/guards/google-recaptcha.guard.js +0 -89
- package/dist/lib/google-recaptcha/helpers/get-error-info.d.ts +0 -4
- package/dist/lib/google-recaptcha/helpers/get-error-info.js +0 -13
- package/dist/lib/google-recaptcha/helpers/load-module.d.ts +0 -2
- package/dist/lib/google-recaptcha/helpers/load-module.js +0 -15
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-enterprise-options.d.ts +0 -5
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-enterprise-options.js +0 -2
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-guard-options.d.ts +0 -7
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-guard-options.js +0 -2
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-module-options.d.ts +0 -21
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-module-options.js +0 -2
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-validator-options.d.ts +0 -12
- package/dist/lib/google-recaptcha/interfaces/google-recaptcha-validator-options.js +0 -2
- package/dist/lib/google-recaptcha/interfaces/literal-object.d.ts +0 -3
- package/dist/lib/google-recaptcha/interfaces/literal-object.js +0 -2
- package/dist/lib/google-recaptcha/interfaces/verify-response-decorator-options.d.ts +0 -13
- package/dist/lib/google-recaptcha/interfaces/verify-response-decorator-options.js +0 -2
- package/dist/lib/google-recaptcha/interfaces/verify-response-enterprise.d.ts +0 -30
- package/dist/lib/google-recaptcha/interfaces/verify-response-enterprise.js +0 -2
- package/dist/lib/google-recaptcha/interfaces/verify-response.d.ts +0 -11
- package/dist/lib/google-recaptcha/interfaces/verify-response.js +0 -2
- package/dist/lib/google-recaptcha/models/recaptcha-config-ref.d.ts +0 -12
- package/dist/lib/google-recaptcha/models/recaptcha-config-ref.js +0 -30
- package/dist/lib/google-recaptcha/models/recaptcha-verification-result.d.ts +0 -26
- package/dist/lib/google-recaptcha/models/recaptcha-verification-result.js +0 -34
- package/dist/lib/google-recaptcha/provider.declarations.d.ts +0 -4
- package/dist/lib/google-recaptcha/provider.declarations.js +0 -7
- package/dist/lib/google-recaptcha/services/enterprise-reason.transformer.d.ts +0 -5
- package/dist/lib/google-recaptcha/services/enterprise-reason.transformer.js +0 -38
- package/dist/lib/google-recaptcha/services/recaptcha-request.resolver.d.ts +0 -4
- package/dist/lib/google-recaptcha/services/recaptcha-request.resolver.js +0 -32
- package/dist/lib/google-recaptcha/services/recaptcha-validator.resolver.d.ts +0 -11
- package/dist/lib/google-recaptcha/services/recaptcha-validator.resolver.js +0 -40
- package/dist/lib/google-recaptcha/services/validators/abstract-google-recaptcha-validator.d.ts +0 -11
- package/dist/lib/google-recaptcha/services/validators/abstract-google-recaptcha-validator.js +0 -27
- package/dist/lib/google-recaptcha/services/validators/google-recaptcha-enterprise.validator.d.ts +0 -17
- package/dist/lib/google-recaptcha/services/validators/google-recaptcha-enterprise.validator.js +0 -126
- package/dist/lib/google-recaptcha/services/validators/google-recaptcha.validator.d.ts +0 -17
- package/dist/lib/google-recaptcha/services/validators/google-recaptcha.validator.js +0 -128
- package/dist/lib/google-recaptcha/types.d.ts +0 -6
- package/dist/lib/google-recaptcha/types.js +0 -2
- package/dist/lib/health-check/health-check-options.interface.d.ts +0 -40
- package/dist/lib/health-check/health-check-options.interface.js +0 -4
- package/dist/lib/health-check/health-check.controller.d.ts +0 -15
- package/dist/lib/health-check/health-check.controller.js +0 -136
- package/dist/lib/health-check/health-check.module.d.ts +0 -8
- package/dist/lib/health-check/health-check.module.js +0 -85
- package/dist/lib/kafka/constant/consumer.const.d.ts +0 -12
- package/dist/lib/kafka/constant/consumer.const.js +0 -17
- package/dist/lib/kafka/constant/kafka.const.d.ts +0 -9
- package/dist/lib/kafka/constant/kafka.const.js +0 -13
- package/dist/lib/kafka/kafka-admin.service.d.ts +0 -7
- package/dist/lib/kafka/kafka-admin.service.js +0 -46
- package/dist/lib/kafka/kafka-consumer.service.d.ts +0 -9
- package/dist/lib/kafka/kafka-consumer.service.js +0 -49
- package/dist/lib/kafka/kafka-instance.const.d.ts +0 -2
- package/dist/lib/kafka/kafka-instance.const.js +0 -11
- package/dist/lib/kafka/kafka-logger.d.ts +0 -2
- package/dist/lib/kafka/kafka-logger.js +0 -21
- package/dist/lib/kafka/kafka-producer.service.d.ts +0 -10
- package/dist/lib/kafka/kafka-producer.service.js +0 -75
- package/dist/lib/kafka/kafka.interface.d.ts +0 -15
- package/dist/lib/kafka/kafka.interface.js +0 -4
- package/dist/lib/kafka/kafka.module.d.ts +0 -10
- package/dist/lib/kafka/kafka.module.js +0 -76
- package/dist/lib/kafka/kafka.provider.d.ts +0 -7
- package/dist/lib/kafka/kafka.provider.js +0 -11
- package/dist/lib/kafka/kafka.service.d.ts +0 -38
- package/dist/lib/kafka/kafka.service.js +0 -123
- package/dist/lib/keycloak/interfaces/index.d.ts +0 -1
- package/dist/lib/keycloak/interfaces/index.js +0 -17
- package/dist/lib/keycloak/interfaces/keycloak.interface.d.ts +0 -23
- package/dist/lib/keycloak/interfaces/keycloak.interface.js +0 -10
- package/dist/lib/keycloak/keycloak.module.d.ts +0 -7
- package/dist/lib/keycloak/keycloak.module.js +0 -65
- package/dist/lib/keycloak/services/keycloak.service.d.ts +0 -29
- package/dist/lib/keycloak/services/keycloak.service.js +0 -137
- package/dist/lib/keycloak/utils/jwt.util.d.ts +0 -3
- package/dist/lib/keycloak/utils/jwt.util.js +0 -26
- package/dist/lib/request/enums/http-methods.enum.d.ts +0 -7
- package/dist/lib/request/enums/http-methods.enum.js +0 -11
- package/dist/lib/request/request.module.d.ts +0 -2
- package/dist/lib/request/request.module.js +0 -23
- package/dist/lib/request/request.service.d.ts +0 -31
- package/dist/lib/request/request.service.js +0 -75
- package/dist/lib/saga/constant/index.d.ts +0 -1
- package/dist/lib/saga/constant/index.js +0 -17
- package/dist/lib/saga/constant/saga-handler.const.d.ts +0 -1
- package/dist/lib/saga/constant/saga-handler.const.js +0 -4
- package/dist/lib/saga/decorators/index.d.ts +0 -1
- package/dist/lib/saga/decorators/index.js +0 -17
- package/dist/lib/saga/decorators/saga.decorator.d.ts +0 -4
- package/dist/lib/saga/decorators/saga.decorator.js +0 -15
- package/dist/lib/saga/enums/index.d.ts +0 -1
- package/dist/lib/saga/enums/index.js +0 -17
- package/dist/lib/saga/enums/saga-status.enum.d.ts +0 -8
- package/dist/lib/saga/enums/saga-status.enum.js +0 -12
- package/dist/lib/saga/exceptions/index.d.ts +0 -2
- package/dist/lib/saga/exceptions/index.js +0 -18
- package/dist/lib/saga/exceptions/saga-compensation.exception.d.ts +0 -5
- package/dist/lib/saga/exceptions/saga-compensation.exception.js +0 -13
- package/dist/lib/saga/exceptions/saga-invocation.exception.d.ts +0 -5
- package/dist/lib/saga/exceptions/saga-invocation.exception.js +0 -13
- package/dist/lib/saga/helpers/index.d.ts +0 -2
- package/dist/lib/saga/helpers/index.js +0 -18
- package/dist/lib/saga/helpers/saga-exception-converter.helper.d.ts +0 -3
- package/dist/lib/saga/helpers/saga-exception-converter.helper.js +0 -14
- package/dist/lib/saga/helpers/wrap-if-not-error.helper.d.ts +0 -1
- package/dist/lib/saga/helpers/wrap-if-not-error.helper.js +0 -9
- package/dist/lib/saga/interfaces/index.d.ts +0 -1
- package/dist/lib/saga/interfaces/index.js +0 -17
- package/dist/lib/saga/interfaces/saga-module-register.interface.d.ts +0 -6
- package/dist/lib/saga/interfaces/saga-module-register.interface.js +0 -3
- package/dist/lib/saga/saga.module.d.ts +0 -8
- package/dist/lib/saga/saga.module.js +0 -78
- package/dist/lib/saga/services/index.d.ts +0 -4
- package/dist/lib/saga/services/index.js +0 -20
- package/dist/lib/saga/services/saga-builder.service.d.ts +0 -8
- package/dist/lib/saga/services/saga-builder.service.js +0 -40
- package/dist/lib/saga/services/saga-flow.service.d.ts +0 -14
- package/dist/lib/saga/services/saga-flow.service.js +0 -39
- package/dist/lib/saga/services/saga-step.service.d.ts +0 -16
- package/dist/lib/saga/services/saga-step.service.js +0 -37
- package/dist/lib/saga/services/saga.service.d.ts +0 -11
- package/dist/lib/saga/services/saga.service.js +0 -44
- package/dist/lib/saga/types/builder-method-return-result.type.d.ts +0 -4
- package/dist/lib/saga/types/builder-method-return-result.type.js +0 -2
- package/dist/lib/saga/types/builder-method-step-result.type.d.ts +0 -7
- package/dist/lib/saga/types/builder-method-step-result.type.js +0 -2
- package/dist/lib/saga/types/condition.type.d.ts +0 -1
- package/dist/lib/saga/types/condition.type.js +0 -2
- package/dist/lib/saga/types/index.d.ts +0 -7
- package/dist/lib/saga/types/index.js +0 -23
- package/dist/lib/saga/types/next-options.type.d.ts +0 -12
- package/dist/lib/saga/types/next-options.type.js +0 -2
- package/dist/lib/saga/types/saga-fn.type.d.ts +0 -1
- package/dist/lib/saga/types/saga-fn.type.js +0 -2
- package/dist/lib/saga/types/saga-step-class.type.d.ts +0 -4
- package/dist/lib/saga/types/saga-step-class.type.js +0 -8
- package/dist/lib/saga/types/saga.type.d.ts +0 -4
- package/dist/lib/saga/types/saga.type.js +0 -2
- package/dist/strategy/index.d.ts +0 -2
- package/dist/strategy/index.js +0 -18
- package/dist/strategy/type-orm-logger.strategy.d.ts +0 -10
- package/dist/strategy/type-orm-logger.strategy.js +0 -75
- package/dist/strategy/type-orm-naming.strategy.d.ts +0 -4
- package/dist/strategy/type-orm-naming.strategy.js +0 -11
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/validators/does-exist.validator.d.ts +0 -8
- package/dist/validators/does-exist.validator.js +0 -47
- package/dist/validators/env.validator.d.ts +0 -5
- package/dist/validators/env.validator.js +0 -35
- package/dist/validators/index.d.ts +0 -4
- package/dist/validators/index.js +0 -20
- package/dist/validators/is-date-range.validator.d.ts +0 -4
- package/dist/validators/is-date-range.validator.js +0 -67
- package/dist/validators/is-unique.validator.d.ts +0 -7
- package/dist/validators/is-unique.validator.js +0 -57
- package/eslint.config.js +0 -49
- package/nest-cli.json +0 -8
|
@@ -1,17 +0,0 @@
|
|
|
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("./saga.decorator"), exports);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Saga = Saga;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
const constant_1 = require("../constant");
|
|
7
|
-
function Saga(command) {
|
|
8
|
-
return (target) => {
|
|
9
|
-
target.prototype.execute = function execute(cmd) {
|
|
10
|
-
return this.saga.execute(cmd);
|
|
11
|
-
};
|
|
12
|
-
Reflect.defineMetadata(constant_1.__SAGA_HANDLER__, command, target);
|
|
13
|
-
return (0, common_1.Injectable)({ scope: common_1.Scope.REQUEST })(target);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './saga-status.enum';
|
|
@@ -1,17 +0,0 @@
|
|
|
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("./saga-status.enum"), exports);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SagaStatus = void 0;
|
|
4
|
-
var SagaStatus;
|
|
5
|
-
(function (SagaStatus) {
|
|
6
|
-
SagaStatus["New"] = "New";
|
|
7
|
-
SagaStatus["InProgress"] = "In progress";
|
|
8
|
-
SagaStatus["InCompensation"] = "In compensation";
|
|
9
|
-
SagaStatus["Complete"] = "Complete";
|
|
10
|
-
SagaStatus["CompensationComplete"] = "Compensation complete";
|
|
11
|
-
SagaStatus["CompensationError"] = "Compensation error";
|
|
12
|
-
})(SagaStatus || (exports.SagaStatus = SagaStatus = {}));
|
|
@@ -1,18 +0,0 @@
|
|
|
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("./saga-invocation.exception"), exports);
|
|
18
|
-
__exportStar(require("./saga-compensation.exception"), exports);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SagaCompensationException = void 0;
|
|
4
|
-
class SagaCompensationException extends Error {
|
|
5
|
-
constructor(originalError, step) {
|
|
6
|
-
super(originalError.message);
|
|
7
|
-
this.originalError = originalError;
|
|
8
|
-
this.step = step;
|
|
9
|
-
Object.setPrototypeOf(this, SagaCompensationException.prototype);
|
|
10
|
-
this.stack = originalError.stack;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.SagaCompensationException = SagaCompensationException;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SagaInvocationException = void 0;
|
|
4
|
-
class SagaInvocationException extends Error {
|
|
5
|
-
constructor(originalError, step) {
|
|
6
|
-
super(`${step}: ${originalError.message}`);
|
|
7
|
-
this.originalError = originalError;
|
|
8
|
-
this.step = step;
|
|
9
|
-
Object.setPrototypeOf(this, SagaInvocationException.prototype);
|
|
10
|
-
this.stack = originalError.stack;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.SagaInvocationException = SagaInvocationException;
|
|
@@ -1,18 +0,0 @@
|
|
|
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("./wrap-if-not-error.helper"), exports);
|
|
18
|
-
__exportStar(require("./saga-exception-converter.helper"), exports);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SagaExceptionConverterHelper = void 0;
|
|
4
|
-
const exceptions = require("@nestjs/common/exceptions");
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
class SagaExceptionConverterHelper {
|
|
7
|
-
static toHttpException(exception) {
|
|
8
|
-
if (exceptions[exception?.name])
|
|
9
|
-
throw new exceptions[exception?.name](exception?.response);
|
|
10
|
-
else
|
|
11
|
-
throw new common_1.InternalServerErrorException(exception?.response);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.SagaExceptionConverterHelper = SagaExceptionConverterHelper;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function wrapIfNotError(x: unknown): Error;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './saga-module-register.interface';
|
|
@@ -1,17 +0,0 @@
|
|
|
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("./saga-module-register.interface"), exports);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DynamicModule, OnModuleDestroy } from '@nestjs/common';
|
|
2
|
-
import { SagaModuleRegisterParams } from './interfaces';
|
|
3
|
-
export declare class SagaModule implements OnModuleDestroy {
|
|
4
|
-
private static activeSagas;
|
|
5
|
-
private logger;
|
|
6
|
-
static register(params: SagaModuleRegisterParams): DynamicModule;
|
|
7
|
-
onModuleDestroy(): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SagaModule = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const cqrs_1 = require("@nestjs/cqrs");
|
|
15
|
-
const core_1 = require("@nestjs/core");
|
|
16
|
-
const constant_1 = require("./constant");
|
|
17
|
-
class SagaModule {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.logger = new common_1.Logger(SagaModule.name, { timestamp: true });
|
|
20
|
-
}
|
|
21
|
-
static register(params) {
|
|
22
|
-
return {
|
|
23
|
-
imports: [cqrs_1.CqrsModule, ...(params.imports || [])],
|
|
24
|
-
module: SagaModule,
|
|
25
|
-
providers: [
|
|
26
|
-
...(params.providers || []),
|
|
27
|
-
...params.sagas.flatMap((saga) => {
|
|
28
|
-
const cmdType = Reflect.getMetadata(constant_1.__SAGA_HANDLER__, saga);
|
|
29
|
-
let SagaCommandHandler = class SagaCommandHandler {
|
|
30
|
-
constructor(moduleRef) {
|
|
31
|
-
this.moduleRef = moduleRef;
|
|
32
|
-
}
|
|
33
|
-
async execute(cmd) {
|
|
34
|
-
const sagaId = new Date().getTime().toString();
|
|
35
|
-
SagaModule.activeSagas.push(sagaId);
|
|
36
|
-
try {
|
|
37
|
-
const s = await this.moduleRef.create(saga);
|
|
38
|
-
s.saga.bind(s);
|
|
39
|
-
return await s.execute(cmd);
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
throw err;
|
|
43
|
-
}
|
|
44
|
-
finally {
|
|
45
|
-
SagaModule.activeSagas.pop();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
SagaCommandHandler = __decorate([
|
|
50
|
-
(0, cqrs_1.CommandHandler)(cmdType),
|
|
51
|
-
__metadata("design:paramtypes", [core_1.ModuleRef])
|
|
52
|
-
], SagaCommandHandler);
|
|
53
|
-
Object.defineProperty(SagaCommandHandler, 'name', {
|
|
54
|
-
writable: true,
|
|
55
|
-
value: [cmdType.name, 'SagaDispatcher'].join(''),
|
|
56
|
-
});
|
|
57
|
-
return [saga, SagaCommandHandler];
|
|
58
|
-
}),
|
|
59
|
-
],
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
async onModuleDestroy() {
|
|
63
|
-
await new Promise((resolve) => {
|
|
64
|
-
const checkSagas = () => {
|
|
65
|
-
if (SagaModule.activeSagas.length) {
|
|
66
|
-
this.logger.warn('Waiting for sagas to complete...');
|
|
67
|
-
setTimeout(checkSagas, 5000);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
resolve('Done');
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
checkSagas();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.SagaModule = SagaModule;
|
|
78
|
-
SagaModule.activeSagas = [];
|
|
@@ -1,20 +0,0 @@
|
|
|
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("./saga-builder.service"), exports);
|
|
18
|
-
__exportStar(require("./saga-flow.service"), exports);
|
|
19
|
-
__exportStar(require("./saga-step.service"), exports);
|
|
20
|
-
__exportStar(require("./saga.service"), exports);
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SagaBuilder = void 0;
|
|
4
|
-
const saga_step_service_1 = require("./saga-step.service");
|
|
5
|
-
const saga_service_1 = require("./saga.service");
|
|
6
|
-
const saga_flow_service_1 = require("./saga-flow.service");
|
|
7
|
-
class SagaBuilder {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.steps = [];
|
|
10
|
-
this.returnFn = (() => void 0);
|
|
11
|
-
}
|
|
12
|
-
step(name = '') {
|
|
13
|
-
return {
|
|
14
|
-
invoke: (method) => {
|
|
15
|
-
const step = new saga_step_service_1.Step(name, this.steps.length, method);
|
|
16
|
-
this.steps.push(step);
|
|
17
|
-
const nextOptions = {
|
|
18
|
-
step: (name = '') => this.step(name),
|
|
19
|
-
return: (method) => this.return(method),
|
|
20
|
-
build: () => this.build(),
|
|
21
|
-
};
|
|
22
|
-
return {
|
|
23
|
-
...nextOptions,
|
|
24
|
-
withCompensation: (method) => {
|
|
25
|
-
step.setCompensation(method);
|
|
26
|
-
return nextOptions;
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return(method) {
|
|
33
|
-
this.returnFn = method;
|
|
34
|
-
return { build: () => this.build() };
|
|
35
|
-
}
|
|
36
|
-
build() {
|
|
37
|
-
return new saga_service_1.SagaCore(new saga_flow_service_1.SagaFlow(this.steps, this.returnFn));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.SagaBuilder = SagaBuilder;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Step } from './saga-step.service';
|
|
2
|
-
import { Fn } from '../types';
|
|
3
|
-
export declare class SagaFlow<T, R> {
|
|
4
|
-
private readonly steps;
|
|
5
|
-
private returnFn;
|
|
6
|
-
private readonly compensationSteps;
|
|
7
|
-
private __current;
|
|
8
|
-
private __returnFnName;
|
|
9
|
-
constructor(steps: Step<T>[], returnFn: Fn<T, R>);
|
|
10
|
-
get current(): Step<T>;
|
|
11
|
-
invoke(params: T): Promise<R>;
|
|
12
|
-
compensate(params: T): Promise<void>;
|
|
13
|
-
bind(ctx: unknown): this;
|
|
14
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SagaFlow = void 0;
|
|
4
|
-
const saga_step_service_1 = require("./saga-step.service");
|
|
5
|
-
class SagaFlow {
|
|
6
|
-
constructor(steps, returnFn) {
|
|
7
|
-
this.steps = steps;
|
|
8
|
-
this.returnFn = returnFn;
|
|
9
|
-
this.compensationSteps = [];
|
|
10
|
-
this.__returnFnName = returnFn.name || 'return';
|
|
11
|
-
}
|
|
12
|
-
get current() {
|
|
13
|
-
return this.__current;
|
|
14
|
-
}
|
|
15
|
-
async invoke(params) {
|
|
16
|
-
for (const step of this.steps) {
|
|
17
|
-
this.__current = step;
|
|
18
|
-
await step.invoke(params);
|
|
19
|
-
this.compensationSteps.push(step);
|
|
20
|
-
}
|
|
21
|
-
const step = new saga_step_service_1.Step(this.__returnFnName, this.steps.length, this.returnFn);
|
|
22
|
-
this.__current = step;
|
|
23
|
-
return step.invoke(params);
|
|
24
|
-
}
|
|
25
|
-
async compensate(params) {
|
|
26
|
-
for (const step of this.compensationSteps.reverse()) {
|
|
27
|
-
if (!step.hasCompensation)
|
|
28
|
-
continue;
|
|
29
|
-
this.__current = step;
|
|
30
|
-
await step.compensate(params);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
bind(ctx) {
|
|
34
|
-
this.steps.forEach((step) => step.bind(ctx));
|
|
35
|
-
this.returnFn = this.returnFn.bind(ctx);
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.SagaFlow = SagaFlow;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Fn } from '../types';
|
|
2
|
-
export declare class Step<T, R = void> {
|
|
3
|
-
private stepName;
|
|
4
|
-
private index;
|
|
5
|
-
invocation: Fn<T, R>;
|
|
6
|
-
private __compensate?;
|
|
7
|
-
private compensationName;
|
|
8
|
-
private finalName;
|
|
9
|
-
constructor(stepName: string, index: number, invocation: Fn<T, R>);
|
|
10
|
-
get name(): string;
|
|
11
|
-
get hasCompensation(): boolean;
|
|
12
|
-
invoke(params: T): Promise<R>;
|
|
13
|
-
compensate(i: T): Promise<R> | R;
|
|
14
|
-
setCompensation(value: Fn<T, R>): void;
|
|
15
|
-
bind(ctx: unknown): this;
|
|
16
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Step = void 0;
|
|
4
|
-
class Step {
|
|
5
|
-
constructor(stepName, index, invocation) {
|
|
6
|
-
this.stepName = stepName;
|
|
7
|
-
this.index = index;
|
|
8
|
-
this.invocation = invocation;
|
|
9
|
-
this.compensationName = '';
|
|
10
|
-
this.finalName = '';
|
|
11
|
-
this.finalName = this.stepName || invocation.name || `step${index}`;
|
|
12
|
-
}
|
|
13
|
-
get name() {
|
|
14
|
-
return this.finalName;
|
|
15
|
-
}
|
|
16
|
-
get hasCompensation() {
|
|
17
|
-
return !!this.__compensate;
|
|
18
|
-
}
|
|
19
|
-
async invoke(params) {
|
|
20
|
-
return this.invocation(params);
|
|
21
|
-
}
|
|
22
|
-
compensate(i) {
|
|
23
|
-
this.finalName = this.compensationName;
|
|
24
|
-
return this.__compensate(i);
|
|
25
|
-
}
|
|
26
|
-
setCompensation(value) {
|
|
27
|
-
this.compensationName = this.stepName || value.name || `step${this.index}`;
|
|
28
|
-
this.__compensate = value;
|
|
29
|
-
}
|
|
30
|
-
bind(ctx) {
|
|
31
|
-
this.invocation = this.invocation.bind(ctx);
|
|
32
|
-
if (this.__compensate)
|
|
33
|
-
this.__compensate = this.__compensate.bind(ctx);
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.Step = Step;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SagaStatus } from '../enums';
|
|
2
|
-
import { SagaFlow } from './saga-flow.service';
|
|
3
|
-
export declare class SagaCore<T, R> {
|
|
4
|
-
private sagaFlow;
|
|
5
|
-
private __status;
|
|
6
|
-
constructor(sagaFlow: SagaFlow<T, R>);
|
|
7
|
-
get status(): SagaStatus;
|
|
8
|
-
execute(params: T): Promise<R>;
|
|
9
|
-
bind(ctx: unknown): this;
|
|
10
|
-
private runCompensationFlow;
|
|
11
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SagaCore = void 0;
|
|
4
|
-
const enums_1 = require("../enums");
|
|
5
|
-
const exceptions_1 = require("../exceptions");
|
|
6
|
-
const helpers_1 = require("../helpers");
|
|
7
|
-
class SagaCore {
|
|
8
|
-
constructor(sagaFlow) {
|
|
9
|
-
this.sagaFlow = sagaFlow;
|
|
10
|
-
this.__status = enums_1.SagaStatus.New;
|
|
11
|
-
}
|
|
12
|
-
get status() {
|
|
13
|
-
return this.__status;
|
|
14
|
-
}
|
|
15
|
-
async execute(params) {
|
|
16
|
-
this.__status = enums_1.SagaStatus.InProgress;
|
|
17
|
-
try {
|
|
18
|
-
const result = await this.sagaFlow.invoke(params);
|
|
19
|
-
this.__status = enums_1.SagaStatus.Complete;
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
23
|
-
const invokeErrStepName = this.sagaFlow.current.name;
|
|
24
|
-
this.__status = enums_1.SagaStatus.InCompensation;
|
|
25
|
-
await this.runCompensationFlow(params);
|
|
26
|
-
throw new exceptions_1.SagaInvocationException((0, helpers_1.wrapIfNotError)(e), invokeErrStepName);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
bind(ctx) {
|
|
30
|
-
this.sagaFlow.bind(ctx);
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
async runCompensationFlow(params) {
|
|
34
|
-
try {
|
|
35
|
-
await this.sagaFlow.compensate(params);
|
|
36
|
-
this.__status = enums_1.SagaStatus.CompensationComplete;
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
this.__status = enums_1.SagaStatus.CompensationError;
|
|
40
|
-
throw new exceptions_1.SagaCompensationException((0, helpers_1.wrapIfNotError)(e), this.sagaFlow.current.name);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.SagaCore = SagaCore;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Condition<IF, THEN, ELSE> = IF extends void ? ELSE : THEN;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './saga.type';
|
|
2
|
-
export * from './saga-fn.type';
|
|
3
|
-
export * from './next-options.type';
|
|
4
|
-
export * from './condition.type';
|
|
5
|
-
export * from './builder-method-return-result.type';
|
|
6
|
-
export * from './builder-method-step-result.type';
|
|
7
|
-
export * from './saga-step-class.type';
|
|
@@ -1,23 +0,0 @@
|
|
|
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("./saga.type"), exports);
|
|
18
|
-
__exportStar(require("./saga-fn.type"), exports);
|
|
19
|
-
__exportStar(require("./next-options.type"), exports);
|
|
20
|
-
__exportStar(require("./condition.type"), exports);
|
|
21
|
-
__exportStar(require("./builder-method-return-result.type"), exports);
|
|
22
|
-
__exportStar(require("./builder-method-step-result.type"), exports);
|
|
23
|
-
__exportStar(require("./saga-step-class.type"), exports);
|