@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,39 +0,0 @@
|
|
|
1
|
-
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
-
export declare const BOTTLENECK_MODULE_OPTIONS = "BOTTLENECK_MODULE_OPTIONS";
|
|
3
|
-
export interface BottleneckModuleOptions {
|
|
4
|
-
appName?: string;
|
|
5
|
-
basePath?: string;
|
|
6
|
-
paramKey?: string;
|
|
7
|
-
useGlobal?: boolean;
|
|
8
|
-
maxConcurrent?: number | null;
|
|
9
|
-
minTime?: number | null;
|
|
10
|
-
highWater?: number | null;
|
|
11
|
-
penalty?: number | null;
|
|
12
|
-
reservoir?: number | null;
|
|
13
|
-
reservoirRefreshInterval?: number | null;
|
|
14
|
-
reservoirRefreshAmount?: number | null;
|
|
15
|
-
reservoirIncreaseAmount?: number | null;
|
|
16
|
-
reservoirIncreaseInterval?: number | null;
|
|
17
|
-
reservoirIncreaseMaximum?: number | null;
|
|
18
|
-
rejectOnDrop?: boolean | null;
|
|
19
|
-
trackDoneStatus?: boolean | null;
|
|
20
|
-
useRedis?: boolean;
|
|
21
|
-
redis?: {
|
|
22
|
-
host: string;
|
|
23
|
-
port: number;
|
|
24
|
-
username?: string;
|
|
25
|
-
password?: string;
|
|
26
|
-
database?: number;
|
|
27
|
-
ttl?: number;
|
|
28
|
-
tls?: boolean;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export interface BottleneckModuleFactory {
|
|
32
|
-
createModuleOptions: () => Promise<BottleneckModuleOptions> | BottleneckModuleOptions;
|
|
33
|
-
}
|
|
34
|
-
export interface BottleneckModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
35
|
-
inject?: any[];
|
|
36
|
-
useClass?: Type<BottleneckModuleFactory>;
|
|
37
|
-
useExisting?: Type<BottleneckModuleFactory>;
|
|
38
|
-
useFactory?: (...args: any[]) => Promise<BottleneckModuleOptions> | BottleneckModuleOptions;
|
|
39
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OnModuleDestroy } from '@nestjs/common';
|
|
2
|
-
import Bottleneck from 'bottleneck';
|
|
3
|
-
import { BottleneckModuleOptions } from '../interfaces/bottleneck-options.interface';
|
|
4
|
-
export declare class BottleneckService implements OnModuleDestroy {
|
|
5
|
-
private readonly options;
|
|
6
|
-
private readonly logger;
|
|
7
|
-
private readonly group;
|
|
8
|
-
private readonly cache;
|
|
9
|
-
constructor(options: BottleneckModuleOptions);
|
|
10
|
-
private getLimiter;
|
|
11
|
-
scheduleForKey<T>(key: string, task: () => Promise<T>, opts?: Bottleneck.ConstructorOptions): Promise<T>;
|
|
12
|
-
runQueuedTask<T>(key: string, fn: () => Promise<T>): Promise<T>;
|
|
13
|
-
onModuleDestroy(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,93 +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
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var BottleneckService_1;
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.BottleneckService = void 0;
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const bottleneck_1 = require("bottleneck");
|
|
19
|
-
const bottleneck_options_interface_1 = require("../interfaces/bottleneck-options.interface");
|
|
20
|
-
const ioredis_1 = require("ioredis");
|
|
21
|
-
let BottleneckService = BottleneckService_1 = class BottleneckService {
|
|
22
|
-
constructor(options) {
|
|
23
|
-
this.options = options;
|
|
24
|
-
this.logger = new common_1.Logger(BottleneckService_1.name, {
|
|
25
|
-
timestamp: true,
|
|
26
|
-
});
|
|
27
|
-
this.cache = new Map();
|
|
28
|
-
const { useRedis, redis, appName, ...rest } = this.options;
|
|
29
|
-
const redisOptions = useRedis && redis
|
|
30
|
-
? {
|
|
31
|
-
datastore: 'ioredis',
|
|
32
|
-
Redis: ioredis_1.default,
|
|
33
|
-
clientOptions: {
|
|
34
|
-
host: redis.host,
|
|
35
|
-
port: redis.port,
|
|
36
|
-
username: redis.username,
|
|
37
|
-
password: redis.password,
|
|
38
|
-
db: redis.database,
|
|
39
|
-
tls: redis.tls ? {} : undefined,
|
|
40
|
-
},
|
|
41
|
-
timeout: redis.ttl,
|
|
42
|
-
}
|
|
43
|
-
: undefined;
|
|
44
|
-
this.group = new bottleneck_1.default.Group({
|
|
45
|
-
id: `bottleneck-${appName ?? 'app'}`,
|
|
46
|
-
maxConcurrent: 1,
|
|
47
|
-
minTime: 0,
|
|
48
|
-
clearDatastore: true,
|
|
49
|
-
...redisOptions,
|
|
50
|
-
...rest,
|
|
51
|
-
});
|
|
52
|
-
this.group.on('idle', (key) => {
|
|
53
|
-
setTimeout(() => this.group.deleteKey(key).catch(() => { }), 30_000);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
getLimiter(key, opts) {
|
|
57
|
-
const limiter = this.group.key(key);
|
|
58
|
-
if (opts)
|
|
59
|
-
limiter.updateSettings(opts);
|
|
60
|
-
return limiter;
|
|
61
|
-
}
|
|
62
|
-
scheduleForKey(key, task, opts) {
|
|
63
|
-
const limiter = this.getLimiter(key, opts);
|
|
64
|
-
this.logger.debug(`Scheduling task for key ${key}`);
|
|
65
|
-
return limiter.schedule(task);
|
|
66
|
-
}
|
|
67
|
-
async runQueuedTask(key, fn) {
|
|
68
|
-
if (this.cache.has(key)) {
|
|
69
|
-
this.logger.debug(`Cache hit for key ${key}`);
|
|
70
|
-
return this.cache.get(key);
|
|
71
|
-
}
|
|
72
|
-
const limiter = this.getLimiter(key);
|
|
73
|
-
const taskPromise = limiter.schedule(async () => {
|
|
74
|
-
try {
|
|
75
|
-
return await fn();
|
|
76
|
-
}
|
|
77
|
-
finally {
|
|
78
|
-
this.cache.delete(key);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
this.cache.set(key, taskPromise);
|
|
82
|
-
return taskPromise;
|
|
83
|
-
}
|
|
84
|
-
async onModuleDestroy() {
|
|
85
|
-
await this.group.disconnect();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
exports.BottleneckService = BottleneckService;
|
|
89
|
-
exports.BottleneckService = BottleneckService = BottleneckService_1 = __decorate([
|
|
90
|
-
(0, common_1.Injectable)(),
|
|
91
|
-
__param(0, (0, common_1.Inject)(bottleneck_options_interface_1.BOTTLENECK_MODULE_OPTIONS)),
|
|
92
|
-
__metadata("design:paramtypes", [Object])
|
|
93
|
-
], BottleneckService);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
-
export declare const CACHING_MODULE_OPTIONS = "CACHING_MODULE_OPTIONS";
|
|
3
|
-
export interface CachingModuleOptions {
|
|
4
|
-
host: string;
|
|
5
|
-
port: number;
|
|
6
|
-
username?: string;
|
|
7
|
-
password: string;
|
|
8
|
-
database?: number;
|
|
9
|
-
keepAlive?: boolean | undefined;
|
|
10
|
-
tls?: boolean;
|
|
11
|
-
namespace?: string;
|
|
12
|
-
ttl?: number;
|
|
13
|
-
}
|
|
14
|
-
export interface CachingModuleFactory {
|
|
15
|
-
createModuleOptions: () => Promise<CachingModuleOptions> | CachingModuleOptions;
|
|
16
|
-
}
|
|
17
|
-
export interface CachingModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
18
|
-
inject?: any[];
|
|
19
|
-
useClass?: Type<CachingModuleFactory>;
|
|
20
|
-
useExisting?: Type<CachingModuleFactory>;
|
|
21
|
-
useFactory?: (...args: any[]) => Promise<CachingModuleOptions> | CachingModuleOptions;
|
|
22
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { CachingModuleAsyncOptions, CachingModuleOptions } from './caching.interface';
|
|
3
|
-
export declare class CachingModule {
|
|
4
|
-
static register(options: CachingModuleOptions): DynamicModule;
|
|
5
|
-
static registerAsync(options: CachingModuleAsyncOptions): DynamicModule;
|
|
6
|
-
private static createAsyncOptionsProvider;
|
|
7
|
-
private static createAsyncProviders;
|
|
8
|
-
}
|
|
@@ -1,142 +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 CachingModule_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.CachingModule = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const caching_service_1 = require("./caching.service");
|
|
13
|
-
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
14
|
-
const caching_interface_1 = require("./caching.interface");
|
|
15
|
-
const redis_1 = require("@keyv/redis");
|
|
16
|
-
let CachingModule = CachingModule_1 = class CachingModule {
|
|
17
|
-
static register(options) {
|
|
18
|
-
return {
|
|
19
|
-
module: CachingModule_1,
|
|
20
|
-
imports: [
|
|
21
|
-
cache_manager_1.CacheModule.register({
|
|
22
|
-
isGlobal: true,
|
|
23
|
-
useFactory: async (cachingOptions) => ({
|
|
24
|
-
stores: [
|
|
25
|
-
new redis_1.Keyv({
|
|
26
|
-
store: new redis_1.default({
|
|
27
|
-
url: `redis://${cachingOptions.host}:${cachingOptions.port}`,
|
|
28
|
-
socket: {
|
|
29
|
-
host: cachingOptions.host,
|
|
30
|
-
port: cachingOptions.port,
|
|
31
|
-
keepAlive: cachingOptions.keepAlive,
|
|
32
|
-
tls: cachingOptions.tls || false,
|
|
33
|
-
},
|
|
34
|
-
database: cachingOptions.database,
|
|
35
|
-
username: cachingOptions.username || 'default',
|
|
36
|
-
password: cachingOptions.password,
|
|
37
|
-
}),
|
|
38
|
-
}, {
|
|
39
|
-
namespace: cachingOptions.namespace,
|
|
40
|
-
ttl: cachingOptions.ttl,
|
|
41
|
-
}),
|
|
42
|
-
],
|
|
43
|
-
}),
|
|
44
|
-
}),
|
|
45
|
-
],
|
|
46
|
-
providers: [
|
|
47
|
-
{
|
|
48
|
-
provide: caching_interface_1.CACHING_MODULE_OPTIONS,
|
|
49
|
-
useValue: options,
|
|
50
|
-
},
|
|
51
|
-
caching_service_1.CachingService,
|
|
52
|
-
],
|
|
53
|
-
exports: [caching_service_1.CachingService, cache_manager_1.CacheModule],
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
static registerAsync(options) {
|
|
57
|
-
const asyncOptionsProvider = this.createAsyncOptionsProvider(options);
|
|
58
|
-
return {
|
|
59
|
-
module: CachingModule_1,
|
|
60
|
-
imports: [
|
|
61
|
-
...(options.imports || []),
|
|
62
|
-
asyncOptionsProvider,
|
|
63
|
-
cache_manager_1.CacheModule.registerAsync({
|
|
64
|
-
imports: [asyncOptionsProvider],
|
|
65
|
-
useFactory: async (cachingOptions) => ({
|
|
66
|
-
stores: [
|
|
67
|
-
new redis_1.Keyv({
|
|
68
|
-
store: new redis_1.default({
|
|
69
|
-
url: `redis://${cachingOptions.host}:${cachingOptions.port}`,
|
|
70
|
-
socket: {
|
|
71
|
-
host: cachingOptions.host,
|
|
72
|
-
port: cachingOptions.port,
|
|
73
|
-
keepAlive: cachingOptions.keepAlive,
|
|
74
|
-
tls: cachingOptions.tls || false,
|
|
75
|
-
},
|
|
76
|
-
database: cachingOptions.database,
|
|
77
|
-
username: cachingOptions.username || 'default',
|
|
78
|
-
password: cachingOptions.password,
|
|
79
|
-
}),
|
|
80
|
-
}, {
|
|
81
|
-
namespace: cachingOptions.namespace,
|
|
82
|
-
ttl: cachingOptions.ttl,
|
|
83
|
-
}),
|
|
84
|
-
],
|
|
85
|
-
}),
|
|
86
|
-
inject: [caching_interface_1.CACHING_MODULE_OPTIONS],
|
|
87
|
-
}),
|
|
88
|
-
],
|
|
89
|
-
providers: [
|
|
90
|
-
{
|
|
91
|
-
provide: caching_service_1.CachingService,
|
|
92
|
-
useFactory: (cacheManager) => new caching_service_1.CachingService(cacheManager),
|
|
93
|
-
inject: [cache_manager_1.CACHE_MANAGER],
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
exports: [caching_service_1.CachingService, cache_manager_1.CacheModule],
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
static createAsyncOptionsProvider(options) {
|
|
100
|
-
const providers = this.createAsyncProviders(options);
|
|
101
|
-
return {
|
|
102
|
-
module: CachingModule_1,
|
|
103
|
-
providers,
|
|
104
|
-
exports: [caching_interface_1.CACHING_MODULE_OPTIONS],
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
static createAsyncProviders(options) {
|
|
108
|
-
if (options.useFactory) {
|
|
109
|
-
return [
|
|
110
|
-
{
|
|
111
|
-
provide: caching_interface_1.CACHING_MODULE_OPTIONS,
|
|
112
|
-
useFactory: options.useFactory,
|
|
113
|
-
inject: options.inject || [],
|
|
114
|
-
},
|
|
115
|
-
];
|
|
116
|
-
}
|
|
117
|
-
const useClass = options.useClass || options.useExisting;
|
|
118
|
-
if (useClass) {
|
|
119
|
-
return [
|
|
120
|
-
{
|
|
121
|
-
provide: caching_interface_1.CACHING_MODULE_OPTIONS,
|
|
122
|
-
useFactory: async (optionsFactory) => await optionsFactory.createModuleOptions(),
|
|
123
|
-
inject: [options.useExisting || options.useClass],
|
|
124
|
-
},
|
|
125
|
-
...(options.useClass
|
|
126
|
-
? [
|
|
127
|
-
{
|
|
128
|
-
provide: options.useClass,
|
|
129
|
-
useClass: options.useClass,
|
|
130
|
-
},
|
|
131
|
-
]
|
|
132
|
-
: []),
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
throw new Error('Invalid CachingModuleAsyncOptions');
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
exports.CachingModule = CachingModule;
|
|
139
|
-
exports.CachingModule = CachingModule = CachingModule_1 = __decorate([
|
|
140
|
-
(0, common_1.Global)(),
|
|
141
|
-
(0, common_1.Module)({})
|
|
142
|
-
], CachingModule);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Cache } from 'cache-manager';
|
|
2
|
-
import { Keyv } from '@keyv/redis';
|
|
3
|
-
export declare class CachingService {
|
|
4
|
-
private cacheManager;
|
|
5
|
-
private readonly logger;
|
|
6
|
-
constructor(cacheManager: Cache);
|
|
7
|
-
getStore(): Keyv<any>;
|
|
8
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
9
|
-
getMany<T>(keys?: string[]): Promise<T[] | undefined>;
|
|
10
|
-
set<T>(key: string, value: T, ttlSeconds?: number): Promise<string>;
|
|
11
|
-
setMany<T>(list: {
|
|
12
|
-
key: string;
|
|
13
|
-
value: T;
|
|
14
|
-
ttlSeconds?: number;
|
|
15
|
-
}[]): Promise<{
|
|
16
|
-
key: string;
|
|
17
|
-
value: string;
|
|
18
|
-
ttl?: number;
|
|
19
|
-
}[]>;
|
|
20
|
-
del(key: string): Promise<boolean>;
|
|
21
|
-
delMany(keys: string[]): Promise<boolean>;
|
|
22
|
-
clear(): Promise<boolean>;
|
|
23
|
-
has(key: string): Promise<boolean>;
|
|
24
|
-
ttl(key: string): Promise<number | undefined>;
|
|
25
|
-
}
|
|
@@ -1,85 +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
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var CachingService_1;
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.CachingService = void 0;
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
19
|
-
const redis_1 = require("@keyv/redis");
|
|
20
|
-
let CachingService = CachingService_1 = class CachingService {
|
|
21
|
-
constructor(cacheManager) {
|
|
22
|
-
this.cacheManager = cacheManager;
|
|
23
|
-
this.logger = new common_1.Logger(CachingService_1.name, {
|
|
24
|
-
timestamp: true,
|
|
25
|
-
});
|
|
26
|
-
if (this.cacheManager.stores?.length === 0) {
|
|
27
|
-
throw new Error('Cache manager is not initialized');
|
|
28
|
-
}
|
|
29
|
-
if (!(this.cacheManager.stores?.[0] instanceof redis_1.Keyv)) {
|
|
30
|
-
throw new Error('Cache manager is not a Keyv instance');
|
|
31
|
-
}
|
|
32
|
-
this.cacheManager.stores[0].opts.store.on('error', (error) => {
|
|
33
|
-
this.logger.error('Redis error:', error);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
getStore() {
|
|
37
|
-
return this.cacheManager.stores?.[0];
|
|
38
|
-
}
|
|
39
|
-
async get(key) {
|
|
40
|
-
const result = await this.cacheManager.get(key);
|
|
41
|
-
if (result) {
|
|
42
|
-
return JSON.parse(result);
|
|
43
|
-
}
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
async getMany(keys) {
|
|
47
|
-
const results = await this.cacheManager.mget(keys);
|
|
48
|
-
if (results?.length) {
|
|
49
|
-
return results.map((result) => JSON.parse(result));
|
|
50
|
-
}
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
async set(key, value, ttlSeconds) {
|
|
54
|
-
return await this.cacheManager.set(key, JSON.stringify(value), ttlSeconds ? ttlSeconds * 1000 : undefined);
|
|
55
|
-
}
|
|
56
|
-
async setMany(list) {
|
|
57
|
-
const valuesToSet = list.map((item) => ({
|
|
58
|
-
key: item.key,
|
|
59
|
-
value: JSON.stringify(item.value),
|
|
60
|
-
ttl: item?.ttlSeconds ? item.ttlSeconds * 1000 : undefined,
|
|
61
|
-
}));
|
|
62
|
-
return await this.cacheManager.mset(valuesToSet);
|
|
63
|
-
}
|
|
64
|
-
async del(key) {
|
|
65
|
-
return await this.cacheManager.del(key);
|
|
66
|
-
}
|
|
67
|
-
async delMany(keys) {
|
|
68
|
-
return await this.cacheManager.mdel(keys);
|
|
69
|
-
}
|
|
70
|
-
async clear() {
|
|
71
|
-
return await this.cacheManager.clear();
|
|
72
|
-
}
|
|
73
|
-
async has(key) {
|
|
74
|
-
return (await this.cacheManager.get(key)) !== undefined;
|
|
75
|
-
}
|
|
76
|
-
async ttl(key) {
|
|
77
|
-
return this.cacheManager.ttl(key);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
exports.CachingService = CachingService;
|
|
81
|
-
exports.CachingService = CachingService = CachingService_1 = __decorate([
|
|
82
|
-
(0, common_1.Injectable)(),
|
|
83
|
-
__param(0, (0, common_1.Inject)(cache_manager_1.CACHE_MANAGER)),
|
|
84
|
-
__metadata("design:paramtypes", [Object])
|
|
85
|
-
], CachingService);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PaginateConfig } from 'nestjs-paginate/lib/paginate';
|
|
2
|
-
import { BaseModelEntity } from '../../../entities';
|
|
3
|
-
import { BaseResponse, IdDto, SuccessResponse } from '../../../dto';
|
|
4
|
-
import { CoreBaseServiceOption, CoreCrudService, CoreFindAllWithPaginationServiceOption, CoreFindOneByIdServiceOption, CoreUpdateServiceOption } from '../index';
|
|
5
|
-
import { PaginationQueryCustom } from '../../../interfaces';
|
|
6
|
-
export declare class CoreCrudController<T extends BaseModelEntity, CreateDto, UpdateDto, ResponseDto extends BaseResponse> {
|
|
7
|
-
protected readonly coreService: CoreCrudService<T, CreateDto, UpdateDto>;
|
|
8
|
-
protected readonly responseDto: {
|
|
9
|
-
new (init?: Partial<BaseResponse>): ResponseDto;
|
|
10
|
-
};
|
|
11
|
-
static responseDto: {
|
|
12
|
-
new (init?: Partial<BaseResponse>): any;
|
|
13
|
-
};
|
|
14
|
-
protected constructor(coreService: CoreCrudService<T, CreateDto, UpdateDto>, responseDto: {
|
|
15
|
-
new (init?: Partial<BaseResponse>): ResponseDto;
|
|
16
|
-
});
|
|
17
|
-
findAllWithPagination(query: PaginationQueryCustom, paginateConfig: PaginateConfig<T>, options?: CoreFindAllWithPaginationServiceOption<T>, ...args: any[]): Promise<SuccessResponse<ResponseDto[]>>;
|
|
18
|
-
findOneById(id: number, options?: CoreFindOneByIdServiceOption<T>, ...args: any[]): Promise<SuccessResponse<ResponseDto>>;
|
|
19
|
-
create(createDto: CreateDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<SuccessResponse<ResponseDto>>;
|
|
20
|
-
update({ id }: IdDto, updateDto: UpdateDto, options?: CoreUpdateServiceOption<T>, ...args: any[]): Promise<SuccessResponse<ResponseDto>>;
|
|
21
|
-
deleteById({ id }: IdDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<SuccessResponse<void>>;
|
|
22
|
-
softDeleteById({ id }: IdDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<SuccessResponse<void>>;
|
|
23
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoreCrudController = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const dto_1 = require("../../../dto");
|
|
6
|
-
const enums_1 = require("../../../enums");
|
|
7
|
-
class CoreCrudController {
|
|
8
|
-
constructor(coreService, responseDto) {
|
|
9
|
-
this.coreService = coreService;
|
|
10
|
-
this.responseDto = responseDto;
|
|
11
|
-
CoreCrudController.responseDto = responseDto;
|
|
12
|
-
}
|
|
13
|
-
async findAllWithPagination(query, paginateConfig, options, ...args) {
|
|
14
|
-
const response = await this.coreService.findAllWithPagination(query, paginateConfig, options, ...args);
|
|
15
|
-
if (!response)
|
|
16
|
-
throw new common_1.NotFoundException(enums_1.SharedMessages.FETCH_FAILED);
|
|
17
|
-
const serializedData = response.data.map((item) => new this.responseDto(item));
|
|
18
|
-
return new dto_1.SuccessResponse(serializedData, enums_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK, {
|
|
19
|
-
...response.meta,
|
|
20
|
-
links: response.links,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
async findOneById(id, options, ...args) {
|
|
24
|
-
const response = await this.coreService.findOneById(id, options, ...args);
|
|
25
|
-
if (!response)
|
|
26
|
-
throw new common_1.NotFoundException(enums_1.SharedMessages.RESOURCE_NOT_FOUND);
|
|
27
|
-
return new dto_1.SuccessResponse(new this.responseDto(response), enums_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
|
|
28
|
-
}
|
|
29
|
-
async create(createDto, options, ...args) {
|
|
30
|
-
const response = await this.coreService.create(createDto, options, ...args);
|
|
31
|
-
if (!response)
|
|
32
|
-
throw new common_1.BadRequestException(enums_1.SharedMessages.CREATE_FAILED);
|
|
33
|
-
return new dto_1.SuccessResponse(new this.responseDto(response), enums_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.CREATED);
|
|
34
|
-
}
|
|
35
|
-
async update({ id }, updateDto, options, ...args) {
|
|
36
|
-
const response = await this.coreService.update(id, updateDto, options, ...args);
|
|
37
|
-
if (!response)
|
|
38
|
-
throw new common_1.BadRequestException(enums_1.SharedMessages.UPDATE_FAILED);
|
|
39
|
-
const foundItem = await this.coreService.findOneById(id, options);
|
|
40
|
-
return new dto_1.SuccessResponse(new this.responseDto(foundItem), enums_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
|
|
41
|
-
}
|
|
42
|
-
async deleteById({ id }, options, ...args) {
|
|
43
|
-
const result = await this.coreService.deleteById(id, options, ...args);
|
|
44
|
-
if (!result)
|
|
45
|
-
throw new common_1.BadRequestException(enums_1.SharedMessages.DELETE_FAILED);
|
|
46
|
-
return new dto_1.SuccessResponse(undefined, enums_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
|
|
47
|
-
}
|
|
48
|
-
async softDeleteById({ id }, options, ...args) {
|
|
49
|
-
const result = await this.coreService.softDeleteById(id, options, ...args);
|
|
50
|
-
if (!result)
|
|
51
|
-
throw new common_1.BadRequestException(enums_1.SharedMessages.DELETE_FAILED);
|
|
52
|
-
return new dto_1.SuccessResponse(undefined, enums_1.SharedMessages.SUCCESSFUL, common_1.HttpStatus.OK);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.CoreCrudController = CoreCrudController;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EntityManager, SelectQueryBuilder } from 'typeorm';
|
|
2
|
-
import { FindOptionsRelations } from 'typeorm/find-options/FindOptionsRelations';
|
|
3
|
-
export interface CoreFindOneServiceOption extends CoreBaseServiceOption {
|
|
4
|
-
enableFirstLevelRelation?: boolean;
|
|
5
|
-
existsCheck?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface CoreFindOneByIdServiceOption<T> extends CoreBaseServiceOption {
|
|
8
|
-
enableFirstLevelRelation?: boolean;
|
|
9
|
-
relations?: FindOptionsRelations<T> | string[];
|
|
10
|
-
existsCheck?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface CoreFindAllServiceOption extends CoreBaseServiceOption {
|
|
13
|
-
enableFirstLevelRelation?: boolean;
|
|
14
|
-
existsCheck?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface CoreFindAllWithPaginationServiceOption<T> {
|
|
17
|
-
selectQueryBuilder?: SelectQueryBuilder<T>;
|
|
18
|
-
relations?: FindOptionsRelations<T> | string[];
|
|
19
|
-
enableFirstLevelRelation?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface CoreUpdateServiceOption<T> extends CoreBaseServiceOption {
|
|
22
|
-
relations?: FindOptionsRelations<T> | string[];
|
|
23
|
-
enableFirstLevelRelation?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface CoreBaseServiceOption {
|
|
26
|
-
entityManager?: EntityManager;
|
|
27
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { DeepPartial, DeleteResult, FindManyOptions, FindOptionsWhere, Repository, UpdateResult } from 'typeorm';
|
|
2
|
-
import { BaseModelEntity } from '../../../entities';
|
|
3
|
-
import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
|
|
4
|
-
import { Paginated } from 'nestjs-paginate';
|
|
5
|
-
import { PaginateConfig } from 'nestjs-paginate/lib/paginate';
|
|
6
|
-
import { InsertResult } from 'typeorm/query-builder/result/InsertResult';
|
|
7
|
-
import { UpsertOptions } from 'typeorm/repository/UpsertOptions';
|
|
8
|
-
import { CoreBaseServiceOption, CoreFindAllServiceOption, CoreFindAllWithPaginationServiceOption, CoreFindOneByIdServiceOption, CoreFindOneServiceOption, CoreUpdateServiceOption } from '../interfaces/crud-service-option.interface';
|
|
9
|
-
import { PaginationQueryCustom } from '../../../interfaces';
|
|
10
|
-
export declare abstract class CoreCrudService<T extends BaseModelEntity, CreateDto, UpdateDto> {
|
|
11
|
-
protected readonly repository: Repository<T>;
|
|
12
|
-
private readonly relationsPath;
|
|
13
|
-
protected constructor(repository: Repository<T>);
|
|
14
|
-
create(createDto: CreateDto, options?: CoreBaseServiceOption, ...args: any[]): Promise<T>;
|
|
15
|
-
update(id: number, updateDto: Partial<UpdateDto> | DeepPartial<T> | QueryDeepPartialEntity<T>, options?: CoreUpdateServiceOption<T>, ...args: any[]): Promise<UpdateResult>;
|
|
16
|
-
updateMany(query: FindManyOptions<T>, updateDto: Partial<UpdateDto> | DeepPartial<T> | QueryDeepPartialEntity<T>, options?: CoreUpdateServiceOption<T>, ...args: any[]): Promise<void>;
|
|
17
|
-
upsert(upsertDto: QueryDeepPartialEntity<T>, upsertOptions: UpsertOptions<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<InsertResult>;
|
|
18
|
-
findAllWithPagination(query: PaginationQueryCustom, paginateConfig: PaginateConfig<T>, options?: CoreFindAllWithPaginationServiceOption<T>, ...args: any[]): Promise<Paginated<T>>;
|
|
19
|
-
findAll(query: FindManyOptions<T>, options?: CoreFindAllServiceOption, ...args: any[]): Promise<T[]>;
|
|
20
|
-
findOneById(id: number, options?: CoreFindOneByIdServiceOption<T>, ...args: any[]): Promise<T>;
|
|
21
|
-
findOne(query: FindManyOptions<T>, options?: CoreFindOneServiceOption, ...args: any[]): Promise<T>;
|
|
22
|
-
isExists(query: FindManyOptions<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<boolean>;
|
|
23
|
-
count(query: FindManyOptions<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<number>;
|
|
24
|
-
softDelete(query: FindOptionsWhere<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
|
|
25
|
-
softDeleteById(id: string | string[] | number | number[], options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
|
|
26
|
-
restore(query: FindOptionsWhere<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
|
|
27
|
-
restoreById(id: string | string[] | number | number[], options?: CoreBaseServiceOption, ...args: any[]): Promise<UpdateResult>;
|
|
28
|
-
delete(query: FindOptionsWhere<T>, options?: CoreBaseServiceOption, ...args: any[]): Promise<DeleteResult>;
|
|
29
|
-
deleteById(id: string | string[] | number | number[], options?: CoreBaseServiceOption, ...args: any[]): Promise<DeleteResult>;
|
|
30
|
-
private relatedPropertyTransformer;
|
|
31
|
-
private whereQueryTransformer;
|
|
32
|
-
private isObject;
|
|
33
|
-
private isArray;
|
|
34
|
-
private isArrayOfObjectId;
|
|
35
|
-
private isArrayOfNumbers;
|
|
36
|
-
}
|