@mondart/nestjs-common-module 2.9.0 → 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 -159
- 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/helpers/xor.d.ts +0 -1
- package/dist/lib/google-recaptcha/helpers/xor.js +0 -6
- 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,32 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.RecaptchaRequestResolver = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const load_module_1 = require("../helpers/load-module");
|
|
12
|
-
let RecaptchaRequestResolver = class RecaptchaRequestResolver {
|
|
13
|
-
resolve(context) {
|
|
14
|
-
const contextType = context.getType();
|
|
15
|
-
switch (contextType) {
|
|
16
|
-
case 'http':
|
|
17
|
-
return context.switchToHttp().getRequest();
|
|
18
|
-
case 'graphql':
|
|
19
|
-
return (0, load_module_1.loadModule)('@nestjs/graphql', true)
|
|
20
|
-
.GqlExecutionContext.create(context)
|
|
21
|
-
.getContext().req?.socket?._httpMessage?.req;
|
|
22
|
-
case 'ws':
|
|
23
|
-
return context.switchToWs().getClient().handshake;
|
|
24
|
-
default:
|
|
25
|
-
throw new Error(`Unsupported request type '${contextType}'.`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
exports.RecaptchaRequestResolver = RecaptchaRequestResolver;
|
|
30
|
-
exports.RecaptchaRequestResolver = RecaptchaRequestResolver = __decorate([
|
|
31
|
-
(0, common_1.Injectable)()
|
|
32
|
-
], RecaptchaRequestResolver);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AbstractGoogleRecaptchaValidator } from './validators/abstract-google-recaptcha-validator';
|
|
2
|
-
import { GoogleRecaptchaValidator } from './validators/google-recaptcha.validator';
|
|
3
|
-
import { GoogleRecaptchaEnterpriseValidator } from './validators/google-recaptcha-enterprise.validator';
|
|
4
|
-
import { RecaptchaConfigRef } from '../models/recaptcha-config-ref';
|
|
5
|
-
export declare class RecaptchaValidatorResolver {
|
|
6
|
-
private readonly configRef;
|
|
7
|
-
protected readonly googleRecaptchaValidator: GoogleRecaptchaValidator;
|
|
8
|
-
protected readonly googleRecaptchaEnterpriseValidator: GoogleRecaptchaEnterpriseValidator;
|
|
9
|
-
constructor(configRef: RecaptchaConfigRef, googleRecaptchaValidator: GoogleRecaptchaValidator, googleRecaptchaEnterpriseValidator: GoogleRecaptchaEnterpriseValidator);
|
|
10
|
-
resolve(): AbstractGoogleRecaptchaValidator<unknown>;
|
|
11
|
-
}
|
|
@@ -1,40 +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.RecaptchaValidatorResolver = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const google_recaptcha_validator_1 = require("./validators/google-recaptcha.validator");
|
|
15
|
-
const google_recaptcha_enterprise_validator_1 = require("./validators/google-recaptcha-enterprise.validator");
|
|
16
|
-
const recaptcha_config_ref_1 = require("../models/recaptcha-config-ref");
|
|
17
|
-
let RecaptchaValidatorResolver = class RecaptchaValidatorResolver {
|
|
18
|
-
constructor(configRef, googleRecaptchaValidator, googleRecaptchaEnterpriseValidator) {
|
|
19
|
-
this.configRef = configRef;
|
|
20
|
-
this.googleRecaptchaValidator = googleRecaptchaValidator;
|
|
21
|
-
this.googleRecaptchaEnterpriseValidator = googleRecaptchaEnterpriseValidator;
|
|
22
|
-
}
|
|
23
|
-
resolve() {
|
|
24
|
-
const configValue = this.configRef.valueOf;
|
|
25
|
-
if (configValue.secretKey) {
|
|
26
|
-
return this.googleRecaptchaValidator;
|
|
27
|
-
}
|
|
28
|
-
if (Object.keys(configValue.enterprise || {}).length) {
|
|
29
|
-
return this.googleRecaptchaEnterpriseValidator;
|
|
30
|
-
}
|
|
31
|
-
throw new Error('Cannot resolve google recaptcha validator');
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.RecaptchaValidatorResolver = RecaptchaValidatorResolver;
|
|
35
|
-
exports.RecaptchaValidatorResolver = RecaptchaValidatorResolver = __decorate([
|
|
36
|
-
(0, common_1.Injectable)(),
|
|
37
|
-
__metadata("design:paramtypes", [recaptcha_config_ref_1.RecaptchaConfigRef,
|
|
38
|
-
google_recaptcha_validator_1.GoogleRecaptchaValidator,
|
|
39
|
-
google_recaptcha_enterprise_validator_1.GoogleRecaptchaEnterpriseValidator])
|
|
40
|
-
], RecaptchaValidatorResolver);
|
package/dist/lib/google-recaptcha/services/validators/abstract-google-recaptcha-validator.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { VerifyResponseOptions } from '../../interfaces/verify-response-decorator-options';
|
|
2
|
-
import { ScoreValidator } from '../../types';
|
|
3
|
-
import { RecaptchaVerificationResult } from '../../models/recaptcha-verification-result';
|
|
4
|
-
import { RecaptchaConfigRef } from '../../models/recaptcha-config-ref';
|
|
5
|
-
export declare abstract class AbstractGoogleRecaptchaValidator<Res> {
|
|
6
|
-
protected readonly options: RecaptchaConfigRef;
|
|
7
|
-
protected constructor(options: RecaptchaConfigRef);
|
|
8
|
-
abstract validate(options: VerifyResponseOptions): Promise<RecaptchaVerificationResult<Res>>;
|
|
9
|
-
protected isValidAction(action: string, options?: VerifyResponseOptions): boolean;
|
|
10
|
-
protected isValidScore(score: number, validator?: ScoreValidator): boolean;
|
|
11
|
-
}
|
package/dist/lib/google-recaptcha/services/validators/abstract-google-recaptcha-validator.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbstractGoogleRecaptchaValidator = void 0;
|
|
4
|
-
class AbstractGoogleRecaptchaValidator {
|
|
5
|
-
constructor(options) {
|
|
6
|
-
this.options = options;
|
|
7
|
-
}
|
|
8
|
-
isValidAction(action, options) {
|
|
9
|
-
if (options.action) {
|
|
10
|
-
return options.action === action;
|
|
11
|
-
}
|
|
12
|
-
return this.options.valueOf.actions
|
|
13
|
-
? this.options.valueOf.actions.includes(action)
|
|
14
|
-
: true;
|
|
15
|
-
}
|
|
16
|
-
isValidScore(score, validator) {
|
|
17
|
-
const finalValidator = validator || this.options.valueOf.score;
|
|
18
|
-
if (finalValidator) {
|
|
19
|
-
if (typeof finalValidator === 'function') {
|
|
20
|
-
return finalValidator(score);
|
|
21
|
-
}
|
|
22
|
-
return score >= finalValidator;
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.AbstractGoogleRecaptchaValidator = AbstractGoogleRecaptchaValidator;
|
package/dist/lib/google-recaptcha/services/validators/google-recaptcha-enterprise.validator.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@nestjs/common';
|
|
2
|
-
import { VerifyResponseOptions } from '../../interfaces/verify-response-decorator-options';
|
|
3
|
-
import { AbstractGoogleRecaptchaValidator } from './abstract-google-recaptcha-validator';
|
|
4
|
-
import { RecaptchaVerificationResult } from '../../models/recaptcha-verification-result';
|
|
5
|
-
import { VerifyResponseEnterprise } from '../../interfaces/verify-response-enterprise';
|
|
6
|
-
import { EnterpriseReasonTransformer } from '../enterprise-reason.transformer';
|
|
7
|
-
import { AxiosInstance } from 'axios';
|
|
8
|
-
import { RecaptchaConfigRef } from '../../models/recaptcha-config-ref';
|
|
9
|
-
export declare class GoogleRecaptchaEnterpriseValidator extends AbstractGoogleRecaptchaValidator<VerifyResponseEnterprise> {
|
|
10
|
-
private readonly axios;
|
|
11
|
-
private readonly logger;
|
|
12
|
-
private readonly enterpriseReasonTransformer;
|
|
13
|
-
private readonly headers;
|
|
14
|
-
constructor(axios: AxiosInstance, logger: Logger, configRef: RecaptchaConfigRef, enterpriseReasonTransformer: EnterpriseReasonTransformer);
|
|
15
|
-
validate(options: VerifyResponseOptions): Promise<RecaptchaVerificationResult<VerifyResponseEnterprise>>;
|
|
16
|
-
private verifyResponse;
|
|
17
|
-
}
|
package/dist/lib/google-recaptcha/services/validators/google-recaptcha-enterprise.validator.js
DELETED
|
@@ -1,126 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.GoogleRecaptchaEnterpriseValidator = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const provider_declarations_1 = require("../../provider.declarations");
|
|
18
|
-
const abstract_google_recaptcha_validator_1 = require("./abstract-google-recaptcha-validator");
|
|
19
|
-
const recaptcha_verification_result_1 = require("../../models/recaptcha-verification-result");
|
|
20
|
-
const error_code_1 = require("../../enums/error-code");
|
|
21
|
-
const google_recaptcha_network_exception_1 = require("../../exceptions/google-recaptcha-network.exception");
|
|
22
|
-
const google_recaptcha_context_1 = require("../../enums/google-recaptcha-context");
|
|
23
|
-
const enterprise_reason_transformer_1 = require("../enterprise-reason.transformer");
|
|
24
|
-
const get_error_info_1 = require("../../helpers/get-error-info");
|
|
25
|
-
const recaptcha_config_ref_1 = require("../../models/recaptcha-config-ref");
|
|
26
|
-
let GoogleRecaptchaEnterpriseValidator = class GoogleRecaptchaEnterpriseValidator extends abstract_google_recaptcha_validator_1.AbstractGoogleRecaptchaValidator {
|
|
27
|
-
constructor(axios, logger, configRef, enterpriseReasonTransformer) {
|
|
28
|
-
super(configRef);
|
|
29
|
-
this.axios = axios;
|
|
30
|
-
this.logger = logger;
|
|
31
|
-
this.enterpriseReasonTransformer = enterpriseReasonTransformer;
|
|
32
|
-
this.headers = { 'Content-Type': 'application/json' };
|
|
33
|
-
}
|
|
34
|
-
async validate(options) {
|
|
35
|
-
const [result, errorDetails] = await this.verifyResponse(options.response, options.action, options.remoteIp);
|
|
36
|
-
const errors = [];
|
|
37
|
-
let success = result?.tokenProperties?.valid || false;
|
|
38
|
-
if (!errorDetails) {
|
|
39
|
-
if (result.tokenProperties) {
|
|
40
|
-
if (result.tokenProperties.invalidReason) {
|
|
41
|
-
const invalidReasonCode = this.enterpriseReasonTransformer.transform(result.tokenProperties.invalidReason);
|
|
42
|
-
if (invalidReasonCode) {
|
|
43
|
-
errors.push(invalidReasonCode);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (success &&
|
|
47
|
-
!this.isValidAction(result.tokenProperties.action, options)) {
|
|
48
|
-
success = false;
|
|
49
|
-
errors.push(error_code_1.ErrorCode.ForbiddenAction);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (result.riskAnalysis &&
|
|
53
|
-
!this.isValidScore(result.riskAnalysis.score, options.score)) {
|
|
54
|
-
success = false;
|
|
55
|
-
errors.push(error_code_1.ErrorCode.LowScore);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (!success && !errors.length) {
|
|
59
|
-
errorDetails
|
|
60
|
-
? errors.push(error_code_1.ErrorCode.UnknownError)
|
|
61
|
-
: errors.push(error_code_1.ErrorCode.InvalidInputResponse);
|
|
62
|
-
}
|
|
63
|
-
return new recaptcha_verification_result_1.RecaptchaVerificationResult({
|
|
64
|
-
success,
|
|
65
|
-
errors,
|
|
66
|
-
nativeResponse: result,
|
|
67
|
-
remoteIp: options.remoteIp,
|
|
68
|
-
score: result?.riskAnalysis?.score,
|
|
69
|
-
action: result?.tokenProperties?.action,
|
|
70
|
-
hostname: result?.tokenProperties?.hostname || '',
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
verifyResponse(response, expectedAction, remoteIp) {
|
|
74
|
-
const projectId = this.options.valueOf.enterprise.projectId;
|
|
75
|
-
const body = {
|
|
76
|
-
event: {
|
|
77
|
-
expectedAction,
|
|
78
|
-
siteKey: this.options.valueOf.enterprise.siteKey,
|
|
79
|
-
token: response,
|
|
80
|
-
userIpAddress: remoteIp,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
const url = `https://recaptchaenterprise.googleapis.com/v1/projects/${projectId}/assessments`;
|
|
84
|
-
const config = {
|
|
85
|
-
headers: this.headers,
|
|
86
|
-
params: {
|
|
87
|
-
key: this.options.valueOf.enterprise.apiKey,
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
if (this.options.valueOf.debug) {
|
|
91
|
-
this.logger.debug({ body }, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptchaEnterprise}.request`);
|
|
92
|
-
}
|
|
93
|
-
return this.axios
|
|
94
|
-
.post(url, body, config)
|
|
95
|
-
.then((res) => res.data)
|
|
96
|
-
.then((data) => {
|
|
97
|
-
if (this.options.valueOf.debug) {
|
|
98
|
-
this.logger.debug(data, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptchaEnterprise}.response`);
|
|
99
|
-
}
|
|
100
|
-
return [data, null];
|
|
101
|
-
})
|
|
102
|
-
.catch((err) => {
|
|
103
|
-
if (this.options.valueOf.debug) {
|
|
104
|
-
this.logger.debug((0, get_error_info_1.getErrorInfo)(err), `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptchaEnterprise}.error`);
|
|
105
|
-
}
|
|
106
|
-
const networkErrorCode = err.isAxiosError && !err.response && err.code;
|
|
107
|
-
if (networkErrorCode) {
|
|
108
|
-
throw new google_recaptcha_network_exception_1.GoogleRecaptchaNetworkException(networkErrorCode);
|
|
109
|
-
}
|
|
110
|
-
const errData = {
|
|
111
|
-
status: err.response.status,
|
|
112
|
-
data: err.response.data,
|
|
113
|
-
};
|
|
114
|
-
return [null, errData];
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
exports.GoogleRecaptchaEnterpriseValidator = GoogleRecaptchaEnterpriseValidator;
|
|
119
|
-
exports.GoogleRecaptchaEnterpriseValidator = GoogleRecaptchaEnterpriseValidator = __decorate([
|
|
120
|
-
(0, common_1.Injectable)(),
|
|
121
|
-
__param(0, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_AXIOS_INSTANCE)),
|
|
122
|
-
__param(1, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_LOGGER)),
|
|
123
|
-
__metadata("design:paramtypes", [Function, common_1.Logger,
|
|
124
|
-
recaptcha_config_ref_1.RecaptchaConfigRef,
|
|
125
|
-
enterprise_reason_transformer_1.EnterpriseReasonTransformer])
|
|
126
|
-
], GoogleRecaptchaEnterpriseValidator);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@nestjs/common';
|
|
2
|
-
import { VerifyResponseOptions } from '../../interfaces/verify-response-decorator-options';
|
|
3
|
-
import { VerifyResponseV3 } from '../../interfaces/verify-response';
|
|
4
|
-
import { AbstractGoogleRecaptchaValidator } from './abstract-google-recaptcha-validator';
|
|
5
|
-
import { RecaptchaVerificationResult } from '../../models/recaptcha-verification-result';
|
|
6
|
-
import { AxiosInstance } from 'axios';
|
|
7
|
-
import { RecaptchaConfigRef } from '../../models/recaptcha-config-ref';
|
|
8
|
-
export declare class GoogleRecaptchaValidator extends AbstractGoogleRecaptchaValidator<VerifyResponseV3> {
|
|
9
|
-
private readonly axios;
|
|
10
|
-
private readonly logger;
|
|
11
|
-
private readonly defaultNetwork;
|
|
12
|
-
private readonly headers;
|
|
13
|
-
constructor(axios: AxiosInstance, logger: Logger, configRef: RecaptchaConfigRef);
|
|
14
|
-
validate(options: VerifyResponseOptions): Promise<RecaptchaVerificationResult<VerifyResponseV3>>;
|
|
15
|
-
private verifyResponse;
|
|
16
|
-
private isUseV3;
|
|
17
|
-
}
|
|
@@ -1,128 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.GoogleRecaptchaValidator = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const provider_declarations_1 = require("../../provider.declarations");
|
|
18
|
-
const qs = require("querystring");
|
|
19
|
-
const google_recaptcha_network_1 = require("../../enums/google-recaptcha-network");
|
|
20
|
-
const error_code_1 = require("../../enums/error-code");
|
|
21
|
-
const google_recaptcha_network_exception_1 = require("../../exceptions/google-recaptcha-network.exception");
|
|
22
|
-
const abstract_google_recaptcha_validator_1 = require("./abstract-google-recaptcha-validator");
|
|
23
|
-
const recaptcha_verification_result_1 = require("../../models/recaptcha-verification-result");
|
|
24
|
-
const google_recaptcha_context_1 = require("../../enums/google-recaptcha-context");
|
|
25
|
-
const get_error_info_1 = require("../../helpers/get-error-info");
|
|
26
|
-
const recaptcha_config_ref_1 = require("../../models/recaptcha-config-ref");
|
|
27
|
-
let GoogleRecaptchaValidator = class GoogleRecaptchaValidator extends abstract_google_recaptcha_validator_1.AbstractGoogleRecaptchaValidator {
|
|
28
|
-
constructor(axios, logger, configRef) {
|
|
29
|
-
super(configRef);
|
|
30
|
-
this.axios = axios;
|
|
31
|
-
this.logger = logger;
|
|
32
|
-
this.defaultNetwork = google_recaptcha_network_1.GoogleRecaptchaNetwork.Google;
|
|
33
|
-
this.headers = {
|
|
34
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
async validate(options) {
|
|
38
|
-
const result = await this.verifyResponse(options.response, options.remoteIp);
|
|
39
|
-
if (!this.isUseV3(result)) {
|
|
40
|
-
const resV2 = result;
|
|
41
|
-
return new recaptcha_verification_result_1.RecaptchaVerificationResult({
|
|
42
|
-
nativeResponse: resV2,
|
|
43
|
-
remoteIp: options.remoteIp,
|
|
44
|
-
score: undefined,
|
|
45
|
-
action: undefined,
|
|
46
|
-
errors: resV2.errors,
|
|
47
|
-
success: resV2.success,
|
|
48
|
-
hostname: resV2.hostname,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
if (!this.isValidAction(result.action, options)) {
|
|
52
|
-
result.success = false;
|
|
53
|
-
result.errors.push(error_code_1.ErrorCode.ForbiddenAction);
|
|
54
|
-
}
|
|
55
|
-
if (!this.isValidScore(result.score, options.score)) {
|
|
56
|
-
result.success = false;
|
|
57
|
-
result.errors.push(error_code_1.ErrorCode.LowScore);
|
|
58
|
-
}
|
|
59
|
-
const nativeResponse = { ...result };
|
|
60
|
-
return new recaptcha_verification_result_1.RecaptchaVerificationResult({
|
|
61
|
-
nativeResponse: nativeResponse,
|
|
62
|
-
remoteIp: options.remoteIp,
|
|
63
|
-
score: result.score,
|
|
64
|
-
errors: result.errors,
|
|
65
|
-
success: result.success,
|
|
66
|
-
action: result.action,
|
|
67
|
-
hostname: result.hostname,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
verifyResponse(response, remoteIp) {
|
|
71
|
-
const body = qs.stringify({
|
|
72
|
-
secret: this.options.valueOf.secretKey,
|
|
73
|
-
response,
|
|
74
|
-
remoteip: remoteIp,
|
|
75
|
-
});
|
|
76
|
-
const url = this.options.valueOf.network || this.defaultNetwork;
|
|
77
|
-
const config = {
|
|
78
|
-
headers: this.headers,
|
|
79
|
-
};
|
|
80
|
-
if (this.options.valueOf.debug) {
|
|
81
|
-
this.logger.debug({ body }, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptcha}.request`);
|
|
82
|
-
}
|
|
83
|
-
return this.axios
|
|
84
|
-
.post(url, body, config)
|
|
85
|
-
.then((res) => res.data)
|
|
86
|
-
.then((data) => {
|
|
87
|
-
if (this.options.valueOf.debug) {
|
|
88
|
-
this.logger.debug(data, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptcha}.response`);
|
|
89
|
-
}
|
|
90
|
-
return data;
|
|
91
|
-
})
|
|
92
|
-
.then((result) => ({
|
|
93
|
-
...result,
|
|
94
|
-
errors: result['error-codes'] || [],
|
|
95
|
-
}))
|
|
96
|
-
.then((result) => {
|
|
97
|
-
delete result['error-codes'];
|
|
98
|
-
return result;
|
|
99
|
-
})
|
|
100
|
-
.catch((err) => {
|
|
101
|
-
if (this.options.valueOf.debug) {
|
|
102
|
-
this.logger.debug((0, get_error_info_1.getErrorInfo)(err), `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptcha}.error`);
|
|
103
|
-
}
|
|
104
|
-
const networkErrorCode = err.isAxiosError && !err.response && err.code;
|
|
105
|
-
if (networkErrorCode) {
|
|
106
|
-
throw new google_recaptcha_network_exception_1.GoogleRecaptchaNetworkException(networkErrorCode);
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
success: false,
|
|
110
|
-
errors: [error_code_1.ErrorCode.UnknownError],
|
|
111
|
-
};
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
isUseV3(v) {
|
|
115
|
-
return ('score' in v &&
|
|
116
|
-
typeof v['score'] === 'number' &&
|
|
117
|
-
'action' in v &&
|
|
118
|
-
typeof v['action'] === 'string');
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
exports.GoogleRecaptchaValidator = GoogleRecaptchaValidator;
|
|
122
|
-
exports.GoogleRecaptchaValidator = GoogleRecaptchaValidator = __decorate([
|
|
123
|
-
(0, common_1.Injectable)(),
|
|
124
|
-
__param(0, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_AXIOS_INSTANCE)),
|
|
125
|
-
__param(1, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_LOGGER)),
|
|
126
|
-
__metadata("design:paramtypes", [Function, common_1.Logger,
|
|
127
|
-
recaptcha_config_ref_1.RecaptchaConfigRef])
|
|
128
|
-
], GoogleRecaptchaValidator);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ContextType } from '@nestjs/common';
|
|
2
|
-
export type RecaptchaResponseProvider = (req: any) => string | Promise<string>;
|
|
3
|
-
export type RecaptchaRemoteIpProvider = (req: any) => string | Promise<string>;
|
|
4
|
-
export type ScoreValidator = number | ((score: number) => boolean);
|
|
5
|
-
export type SkipIfValue = boolean | (<Req = unknown>(request: Req) => boolean | Promise<boolean>);
|
|
6
|
-
export type RecaptchaContextType = ContextType | 'graphql';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
-
import { SASLOptions } from 'kafkajs';
|
|
3
|
-
import tls from 'tls';
|
|
4
|
-
export declare const HEALTH_CHECK_MODULE_OPTIONS = "HEALTH_CHECK_MODULE_OPTIONS";
|
|
5
|
-
export interface HealthCheckModuleOptions {
|
|
6
|
-
http?: {
|
|
7
|
-
docsUrl: string;
|
|
8
|
-
};
|
|
9
|
-
redis?: {
|
|
10
|
-
host: string;
|
|
11
|
-
port: number;
|
|
12
|
-
username?: string;
|
|
13
|
-
password?: string;
|
|
14
|
-
database?: number;
|
|
15
|
-
tls?: boolean;
|
|
16
|
-
};
|
|
17
|
-
bull?: {
|
|
18
|
-
host: string;
|
|
19
|
-
port: number;
|
|
20
|
-
username?: string;
|
|
21
|
-
password?: string;
|
|
22
|
-
database?: number;
|
|
23
|
-
tls?: boolean;
|
|
24
|
-
};
|
|
25
|
-
kafka?: {
|
|
26
|
-
clientId: string;
|
|
27
|
-
brokers: string[];
|
|
28
|
-
sasl?: SASLOptions;
|
|
29
|
-
ssl?: tls.ConnectionOptions;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export interface HealthCheckModuleFactory {
|
|
33
|
-
createModuleOptions: () => Promise<HealthCheckModuleOptions> | HealthCheckModuleOptions;
|
|
34
|
-
}
|
|
35
|
-
export interface HealthCheckModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
36
|
-
inject?: any[];
|
|
37
|
-
useClass?: Type<HealthCheckModuleFactory>;
|
|
38
|
-
useExisting?: Type<HealthCheckModuleFactory>;
|
|
39
|
-
useFactory?: (...args: any[]) => Promise<HealthCheckModuleOptions> | HealthCheckModuleOptions;
|
|
40
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HealthCheckService, HttpHealthIndicator, MicroserviceHealthIndicator, TypeOrmHealthIndicator } from '@nestjs/terminus';
|
|
2
|
-
import { HealthCheckModuleOptions } from './health-check-options.interface';
|
|
3
|
-
export declare class HealthCheckController {
|
|
4
|
-
private health;
|
|
5
|
-
private http;
|
|
6
|
-
private db;
|
|
7
|
-
private microservice;
|
|
8
|
-
private options;
|
|
9
|
-
constructor(health: HealthCheckService, http: HttpHealthIndicator, db: TypeOrmHealthIndicator, microservice: MicroserviceHealthIndicator, options: HealthCheckModuleOptions);
|
|
10
|
-
checkHttp(): Promise<import("@nestjs/terminus").HealthCheckResult<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"app-docs">, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"app-docs">>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"app-docs">>>>;
|
|
11
|
-
checkTypeOrm(): Promise<import("@nestjs/terminus").HealthCheckResult<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"typeorm">, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"typeorm">>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"typeorm">>>>;
|
|
12
|
-
checkRedis(): Promise<import("@nestjs/terminus").HealthCheckResult<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>>>>;
|
|
13
|
-
checkBull(): Promise<import("@nestjs/terminus").HealthCheckResult<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>>>>;
|
|
14
|
-
checkKafka(): Promise<import("@nestjs/terminus").HealthCheckResult<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>>, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<string>>>>;
|
|
15
|
-
}
|
|
@@ -1,136 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.HealthCheckController = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const microservices_1 = require("@nestjs/microservices");
|
|
18
|
-
const terminus_1 = require("@nestjs/terminus");
|
|
19
|
-
const health_check_options_interface_1 = require("./health-check-options.interface");
|
|
20
|
-
let HealthCheckController = class HealthCheckController {
|
|
21
|
-
constructor(health, http, db, microservice, options) {
|
|
22
|
-
this.health = health;
|
|
23
|
-
this.http = http;
|
|
24
|
-
this.db = db;
|
|
25
|
-
this.microservice = microservice;
|
|
26
|
-
this.options = options;
|
|
27
|
-
}
|
|
28
|
-
checkHttp() {
|
|
29
|
-
return this.health.check([
|
|
30
|
-
() => this.http.pingCheck('app-docs', this.options?.http?.docsUrl),
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
checkTypeOrm() {
|
|
34
|
-
return this.health.check([async () => this.db.pingCheck('typeorm')]);
|
|
35
|
-
}
|
|
36
|
-
checkRedis() {
|
|
37
|
-
return this.health.check([
|
|
38
|
-
async () => this.microservice.pingCheck('redis', {
|
|
39
|
-
transport: microservices_1.Transport.REDIS,
|
|
40
|
-
options: {
|
|
41
|
-
host: this.options?.redis?.host,
|
|
42
|
-
port: this.options?.redis?.port,
|
|
43
|
-
username: this.options?.redis?.username,
|
|
44
|
-
password: this.options?.redis?.password,
|
|
45
|
-
db: this.options?.redis?.database,
|
|
46
|
-
tls: this.options?.redis?.tls
|
|
47
|
-
? {
|
|
48
|
-
host: this.options?.redis?.host,
|
|
49
|
-
port: this.options?.redis?.port,
|
|
50
|
-
}
|
|
51
|
-
: undefined,
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
]);
|
|
55
|
-
}
|
|
56
|
-
checkBull() {
|
|
57
|
-
return this.health.check([
|
|
58
|
-
async () => this.microservice.pingCheck('redis', {
|
|
59
|
-
transport: microservices_1.Transport.REDIS,
|
|
60
|
-
options: {
|
|
61
|
-
host: this.options?.bull?.host,
|
|
62
|
-
port: this.options?.bull?.port,
|
|
63
|
-
username: this.options?.bull?.username,
|
|
64
|
-
password: this.options?.bull?.password,
|
|
65
|
-
db: this.options?.bull?.database,
|
|
66
|
-
tls: this.options?.bull?.tls
|
|
67
|
-
? {
|
|
68
|
-
host: this.options?.bull?.host,
|
|
69
|
-
port: this.options?.bull?.port,
|
|
70
|
-
}
|
|
71
|
-
: undefined,
|
|
72
|
-
},
|
|
73
|
-
}),
|
|
74
|
-
]);
|
|
75
|
-
}
|
|
76
|
-
checkKafka() {
|
|
77
|
-
return this.health.check([
|
|
78
|
-
async () => this.microservice.pingCheck('kafka', {
|
|
79
|
-
transport: microservices_1.Transport.KAFKA,
|
|
80
|
-
timeout: 2000,
|
|
81
|
-
options: {
|
|
82
|
-
client: {
|
|
83
|
-
clientId: this.options?.kafka?.clientId,
|
|
84
|
-
brokers: this.options?.kafka?.brokers,
|
|
85
|
-
sasl: this.options?.kafka?.sasl,
|
|
86
|
-
ssl: this.options?.kafka?.ssl,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
}),
|
|
90
|
-
]);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
exports.HealthCheckController = HealthCheckController;
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, common_1.Get)('http'),
|
|
96
|
-
(0, terminus_1.HealthCheck)(),
|
|
97
|
-
__metadata("design:type", Function),
|
|
98
|
-
__metadata("design:paramtypes", []),
|
|
99
|
-
__metadata("design:returntype", void 0)
|
|
100
|
-
], HealthCheckController.prototype, "checkHttp", null);
|
|
101
|
-
__decorate([
|
|
102
|
-
(0, common_1.Get)('database'),
|
|
103
|
-
(0, terminus_1.HealthCheck)(),
|
|
104
|
-
__metadata("design:type", Function),
|
|
105
|
-
__metadata("design:paramtypes", []),
|
|
106
|
-
__metadata("design:returntype", void 0)
|
|
107
|
-
], HealthCheckController.prototype, "checkTypeOrm", null);
|
|
108
|
-
__decorate([
|
|
109
|
-
(0, common_1.Get)('redis'),
|
|
110
|
-
(0, terminus_1.HealthCheck)(),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", []),
|
|
113
|
-
__metadata("design:returntype", void 0)
|
|
114
|
-
], HealthCheckController.prototype, "checkRedis", null);
|
|
115
|
-
__decorate([
|
|
116
|
-
(0, common_1.Get)('bull'),
|
|
117
|
-
(0, terminus_1.HealthCheck)(),
|
|
118
|
-
__metadata("design:type", Function),
|
|
119
|
-
__metadata("design:paramtypes", []),
|
|
120
|
-
__metadata("design:returntype", void 0)
|
|
121
|
-
], HealthCheckController.prototype, "checkBull", null);
|
|
122
|
-
__decorate([
|
|
123
|
-
(0, common_1.Get)('kafka'),
|
|
124
|
-
(0, terminus_1.HealthCheck)(),
|
|
125
|
-
__metadata("design:type", Function),
|
|
126
|
-
__metadata("design:paramtypes", []),
|
|
127
|
-
__metadata("design:returntype", void 0)
|
|
128
|
-
], HealthCheckController.prototype, "checkKafka", null);
|
|
129
|
-
exports.HealthCheckController = HealthCheckController = __decorate([
|
|
130
|
-
(0, common_1.Controller)('health-check'),
|
|
131
|
-
__param(4, (0, common_1.Inject)(health_check_options_interface_1.HEALTH_CHECK_MODULE_OPTIONS)),
|
|
132
|
-
__metadata("design:paramtypes", [terminus_1.HealthCheckService,
|
|
133
|
-
terminus_1.HttpHealthIndicator,
|
|
134
|
-
terminus_1.TypeOrmHealthIndicator,
|
|
135
|
-
terminus_1.MicroserviceHealthIndicator, Object])
|
|
136
|
-
], HealthCheckController);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { HealthCheckModuleAsyncOptions, HealthCheckModuleOptions } from './health-check-options.interface';
|
|
3
|
-
export declare class HealthCheckModule {
|
|
4
|
-
static register(options: HealthCheckModuleOptions): DynamicModule;
|
|
5
|
-
static registerAsync(options: HealthCheckModuleAsyncOptions): DynamicModule;
|
|
6
|
-
private static createAsyncOptionsProvider;
|
|
7
|
-
private static createAsyncProviders;
|
|
8
|
-
}
|