@nest-omni/core 1.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/boilerplate.polyfill.d.ts +39 -0
- package/dist/boilerplate.polyfill.js +66 -0
- package/dist/boilerplate.polyfill.js.map +1 -0
- package/dist/common/abstract-client.service.d.ts +16 -0
- package/dist/common/abstract-client.service.js +26 -0
- package/dist/common/abstract-client.service.js.map +1 -0
- package/dist/common/abstract.entity.d.ts +17 -0
- package/dist/common/abstract.entity.js +71 -0
- package/dist/common/abstract.entity.js.map +1 -0
- package/dist/common/dto/abstract.dto.d.ts +13 -0
- package/dist/common/dto/abstract.dto.js +63 -0
- package/dist/common/dto/abstract.dto.js.map +1 -0
- package/dist/common/dto/bulk-id.dto.d.ts +3 -0
- package/dist/common/dto/bulk-id.dto.js +29 -0
- package/dist/common/dto/bulk-id.dto.js.map +1 -0
- package/dist/common/dto/create-translation.dto.d.ts +5 -0
- package/dist/common/dto/create-translation.dto.js +28 -0
- package/dist/common/dto/create-translation.dto.js.map +1 -0
- package/dist/common/dto/page-meta.dto.d.ts +15 -0
- package/dist/common/dto/page-meta.dto.js +55 -0
- package/dist/common/dto/page-meta.dto.js.map +1 -0
- package/dist/common/dto/page-options.dto.d.ts +8 -0
- package/dist/common/dto/page-options.dto.js +52 -0
- package/dist/common/dto/page-options.dto.js.map +1 -0
- package/dist/common/dto/page.dto.d.ts +11 -0
- package/dist/common/dto/page.dto.js +61 -0
- package/dist/common/dto/page.dto.js.map +1 -0
- package/dist/common/utils.d.ts +3 -0
- package/dist/common/utils.js +26 -0
- package/dist/common/utils.js.map +1 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +21 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/language-code.d.ts +5 -0
- package/dist/constants/language-code.js +10 -0
- package/dist/constants/language-code.js.map +1 -0
- package/dist/constants/order.d.ts +4 -0
- package/dist/constants/order.js +9 -0
- package/dist/constants/order.js.map +1 -0
- package/dist/constants/role-type.d.ts +4 -0
- package/dist/constants/role-type.js +9 -0
- package/dist/constants/role-type.js.map +1 -0
- package/dist/constants/token-type.d.ts +4 -0
- package/dist/constants/token-type.js +9 -0
- package/dist/constants/token-type.js.map +1 -0
- package/dist/decorators/api-page-ok-response.decorator.d.ts +5 -0
- package/dist/decorators/api-page-ok-response.decorator.js +26 -0
- package/dist/decorators/api-page-ok-response.decorator.js.map +1 -0
- package/dist/decorators/auth-user.decorator.d.ts +1 -0
- package/dist/decorators/auth-user.decorator.js +16 -0
- package/dist/decorators/auth-user.decorator.js.map +1 -0
- package/dist/decorators/controller.decorator.d.ts +1 -0
- package/dist/decorators/controller.decorator.js +12 -0
- package/dist/decorators/controller.decorator.js.map +1 -0
- package/dist/decorators/field.decorators.d.ts +71 -0
- package/dist/decorators/field.decorators.js +457 -0
- package/dist/decorators/field.decorators.js.map +1 -0
- package/dist/decorators/http.decorators.d.ts +3 -0
- package/dist/decorators/http.decorators.js +9 -0
- package/dist/decorators/http.decorators.js.map +1 -0
- package/dist/decorators/index.d.ts +12 -0
- package/dist/decorators/index.js +29 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/omni-auth.decorator.d.ts +8 -0
- package/dist/decorators/omni-auth.decorator.js +36 -0
- package/dist/decorators/omni-auth.decorator.js.map +1 -0
- package/dist/decorators/operation.decorator.d.ts +1 -0
- package/dist/decorators/operation.decorator.js +7 -0
- package/dist/decorators/operation.decorator.js.map +1 -0
- package/dist/decorators/property.decorators.d.ts +15 -0
- package/dist/decorators/property.decorators.js +43 -0
- package/dist/decorators/property.decorators.js.map +1 -0
- package/dist/decorators/public-route.decorator.d.ts +3 -0
- package/dist/decorators/public-route.decorator.js +8 -0
- package/dist/decorators/public-route.decorator.js.map +1 -0
- package/dist/decorators/swagger.schema.d.ts +5 -0
- package/dist/decorators/swagger.schema.js +80 -0
- package/dist/decorators/swagger.schema.js.map +1 -0
- package/dist/decorators/timestamp-column.decorator.d.ts +1 -0
- package/dist/decorators/timestamp-column.decorator.js +29 -0
- package/dist/decorators/timestamp-column.decorator.js.map +1 -0
- package/dist/decorators/transform.decorators.d.ts +8 -0
- package/dist/decorators/transform.decorators.js +96 -0
- package/dist/decorators/transform.decorators.js.map +1 -0
- package/dist/decorators/translate.decorator.d.ts +5 -0
- package/dist/decorators/translate.decorator.js +18 -0
- package/dist/decorators/translate.decorator.js.map +1 -0
- package/dist/decorators/use-dto.decorator.d.ts +4 -0
- package/dist/decorators/use-dto.decorator.js +10 -0
- package/dist/decorators/use-dto.decorator.js.map +1 -0
- package/dist/decorators/user-check.decorator.d.ts +6 -0
- package/dist/decorators/user-check.decorator.js +22 -0
- package/dist/decorators/user-check.decorator.js.map +1 -0
- package/dist/decorators/user.decorator.d.ts +8 -0
- package/dist/decorators/user.decorator.js +39 -0
- package/dist/decorators/user.decorator.js.map +1 -0
- package/dist/decorators/user_auth.decorator.d.ts +1 -0
- package/dist/decorators/user_auth.decorator.js +17 -0
- package/dist/decorators/user_auth.decorator.js.map +1 -0
- package/dist/decorators/validator.decorators.d.ts +10 -0
- package/dist/decorators/validator.decorators.js +63 -0
- package/dist/decorators/validator.decorators.js.map +1 -0
- package/dist/exceptions/file-not-image.exception.d.ts +4 -0
- package/dist/exceptions/file-not-image.exception.js +11 -0
- package/dist/exceptions/file-not-image.exception.js.map +1 -0
- package/dist/exceptions/index.d.ts +2 -0
- package/dist/exceptions/index.js +19 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/exceptions/page-type.exception.d.ts +4 -0
- package/dist/exceptions/page-type.exception.js +11 -0
- package/dist/exceptions/page-type.exception.js.map +1 -0
- package/dist/exceptions/user-not-found.exception.d.ts +4 -0
- package/dist/exceptions/user-not-found.exception.js +11 -0
- package/dist/exceptions/user-not-found.exception.js.map +1 -0
- package/dist/filters/bad-request.filter.d.ts +5 -0
- package/dist/filters/bad-request.filter.js +65 -0
- package/dist/filters/bad-request.filter.js.map +1 -0
- package/dist/filters/constraint-errors.d.ts +1 -0
- package/dist/filters/constraint-errors.js +7 -0
- package/dist/filters/constraint-errors.js.map +1 -0
- package/dist/filters/index.d.ts +3 -0
- package/dist/filters/index.js +20 -0
- package/dist/filters/index.js.map +1 -0
- package/dist/filters/query-failed.filter.d.ts +10 -0
- package/dist/filters/query-failed.filter.js +43 -0
- package/dist/filters/query-failed.filter.js.map +1 -0
- package/dist/guards/auth.guard.d.ts +4 -0
- package/dist/guards/auth.guard.js +13 -0
- package/dist/guards/auth.guard.js.map +1 -0
- package/dist/guards/roles.guard.d.ts +7 -0
- package/dist/guards/roles.guard.js +36 -0
- package/dist/guards/roles.guard.js.map +1 -0
- package/dist/health-checker/health-checker.controller.d.ts +15 -0
- package/dist/health-checker/health-checker.controller.js +68 -0
- package/dist/health-checker/health-checker.controller.js.map +1 -0
- package/dist/health-checker/health-checker.module.d.ts +2 -0
- package/dist/health-checker/health-checker.module.js +26 -0
- package/dist/health-checker/health-checker.module.js.map +1 -0
- package/dist/health-checker/health-indicators/service.indicator.d.ts +8 -0
- package/dist/health-checker/health-indicators/service.indicator.js +57 -0
- package/dist/health-checker/health-indicators/service.indicator.js.map +1 -0
- package/dist/helpers/common.helper.d.ts +3 -0
- package/dist/helpers/common.helper.js +37 -0
- package/dist/helpers/common.helper.js.map +1 -0
- package/dist/helpers/date.helper.d.ts +10 -0
- package/dist/helpers/date.helper.js +59 -0
- package/dist/helpers/date.helper.js.map +1 -0
- package/dist/helpers/excel.helper.d.ts +12 -0
- package/dist/helpers/excel.helper.js +250 -0
- package/dist/helpers/excel.helper.js.map +1 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.js +20 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptors/auth-user.interceptor.d.ts +4 -0
- package/dist/interceptors/auth-user.interceptor.js +25 -0
- package/dist/interceptors/auth-user.interceptor.js.map +1 -0
- package/dist/interceptors/index.d.ts +2 -0
- package/dist/interceptors/index.js +19 -0
- package/dist/interceptors/index.js.map +1 -0
- package/dist/interceptors/language-interceptor.service.d.ts +6 -0
- package/dist/interceptors/language-interceptor.service.js +31 -0
- package/dist/interceptors/language-interceptor.service.js.map +1 -0
- package/dist/interceptors/translation-interceptor.service.d.ts +5 -0
- package/dist/interceptors/translation-interceptor.service.js +35 -0
- package/dist/interceptors/translation-interceptor.service.js.map +1 -0
- package/dist/interfaces/IApiFile.d.ts +4 -0
- package/dist/interfaces/IApiFile.js +3 -0
- package/dist/interfaces/IApiFile.js.map +1 -0
- package/dist/interfaces/IFile.d.ts +9 -0
- package/dist/interfaces/IFile.js +3 -0
- package/dist/interfaces/IFile.js.map +1 -0
- package/dist/interfaces/ITranslationDecoratorInterface.d.ts +3 -0
- package/dist/interfaces/ITranslationDecoratorInterface.js +3 -0
- package/dist/interfaces/ITranslationDecoratorInterface.js.map +1 -0
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/index.js +20 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/response.d.ts +25 -0
- package/dist/interfaces/response.js +3 -0
- package/dist/interfaces/response.js.map +1 -0
- package/dist/middlewares/index.d.ts +3 -0
- package/dist/middlewares/index.js +20 -0
- package/dist/middlewares/index.js.map +1 -0
- package/dist/middlewares/omni-auth.middleware.d.ts +1 -0
- package/dist/middlewares/omni-auth.middleware.js +14 -0
- package/dist/middlewares/omni-auth.middleware.js.map +1 -0
- package/dist/middlewares/powerby.middleware.d.ts +1 -0
- package/dist/middlewares/powerby.middleware.js +11 -0
- package/dist/middlewares/powerby.middleware.js.map +1 -0
- package/dist/middlewares/request-id.middleware.d.ts +7 -0
- package/dist/middlewares/request-id.middleware.js +23 -0
- package/dist/middlewares/request-id.middleware.js.map +1 -0
- package/dist/providers/context.provider.d.ts +32 -0
- package/dist/providers/context.provider.js +71 -0
- package/dist/providers/context.provider.js.map +1 -0
- package/dist/providers/generator.provider.d.ts +9 -0
- package/dist/providers/generator.provider.js +51 -0
- package/dist/providers/generator.provider.js.map +1 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +19 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/setup/bootstrap.setup.d.ts +5 -0
- package/dist/setup/bootstrap.setup.js +102 -0
- package/dist/setup/bootstrap.setup.js.map +1 -0
- package/dist/setup/index.d.ts +1 -0
- package/dist/setup/index.js +18 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/setup-swagger.d.ts +2 -0
- package/dist/setup-swagger.js +63 -0
- package/dist/setup-swagger.js.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +19 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/serviceRegistryModule.d.ts +2 -0
- package/dist/shared/serviceRegistryModule.js +102 -0
- package/dist/shared/serviceRegistryModule.js.map +1 -0
- package/dist/shared/services/api-config.service.d.ts +70 -0
- package/dist/shared/services/api-config.service.js +286 -0
- package/dist/shared/services/api-config.service.js.map +1 -0
- package/dist/shared/services/aws-s3.service.d.ts +10 -0
- package/dist/shared/services/aws-s3.service.js +49 -0
- package/dist/shared/services/aws-s3.service.js.map +1 -0
- package/dist/shared/services/generator.service.d.ts +4 -0
- package/dist/shared/services/generator.service.js +24 -0
- package/dist/shared/services/generator.service.js.map +1 -0
- package/dist/shared/services/index.d.ts +5 -0
- package/dist/shared/services/index.js +22 -0
- package/dist/shared/services/index.js.map +1 -0
- package/dist/shared/services/translation.service.d.ts +9 -0
- package/dist/shared/services/translation.service.js +61 -0
- package/dist/shared/services/translation.service.js.map +1 -0
- package/dist/shared/services/validator.service.d.ts +3 -0
- package/dist/shared/services/validator.service.js +21 -0
- package/dist/shared/services/validator.service.js.map +1 -0
- package/dist/snake-naming.strategy.d.ts +11 -0
- package/dist/snake-naming.strategy.js +38 -0
- package/dist/snake-naming.strategy.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/validators/file-mimetype.validator.d.ts +13 -0
- package/dist/validators/file-mimetype.validator.js +24 -0
- package/dist/validators/file-mimetype.validator.js.map +1 -0
- package/dist/validators/index.d.ts +3 -0
- package/dist/validators/index.js +20 -0
- package/dist/validators/index.js.map +1 -0
- package/dist/validators/is-exists.validator.d.ts +18 -0
- package/dist/validators/is-exists.validator.js +52 -0
- package/dist/validators/is-exists.validator.js.map +1 -0
- package/dist/validators/is-unique.validator.d.ts +17 -0
- package/dist/validators/is-unique.validator.js +83 -0
- package/dist/validators/is-unique.validator.js.map +1 -0
- package/dist/validators/phone-country-code.validator.d.ts +2 -0
- package/dist/validators/phone-country-code.validator.js +31 -0
- package/dist/validators/phone-country-code.validator.js.map +1 -0
- package/dist/validators/same-as.validator.d.ts +2 -0
- package/dist/validators/same-as.validator.js +26 -0
- package/dist/validators/same-as.validator.js.map +1 -0
- package/dist/validators/skip-empty.validator.d.ts +1 -0
- package/dist/validators/skip-empty.validator.js +19 -0
- package/dist/validators/skip-empty.validator.js.map +1 -0
- package/package.json +66 -0
- package/src/boilerplate.polyfill.d.ts +39 -0
- package/src/boilerplate.polyfill.js +78 -0
- package/src/boilerplate.polyfill.ts +202 -0
- package/src/common/abstract-client.service.d.ts +20 -0
- package/src/common/abstract-client.service.js +39 -0
- package/src/common/abstract-client.service.ts +56 -0
- package/src/common/abstract.entity.d.ts +24 -0
- package/src/common/abstract.entity.js +152 -0
- package/src/common/abstract.entity.ts +73 -0
- package/src/common/dto/abstract.dto.d.ts +13 -0
- package/src/common/dto/abstract.dto.js +96 -0
- package/src/common/dto/abstract.dto.ts +64 -0
- package/src/common/dto/bulk-id.dto.d.ts +3 -0
- package/src/common/dto/bulk-id.dto.js +63 -0
- package/src/common/dto/bulk-id.dto.ts +13 -0
- package/src/common/dto/create-translation.dto.d.ts +5 -0
- package/src/common/dto/create-translation.dto.js +63 -0
- package/src/common/dto/create-translation.dto.ts +10 -0
- package/src/common/dto/page-meta.dto.d.ts +15 -0
- package/src/common/dto/page-meta.dto.js +88 -0
- package/src/common/dto/page-meta.dto.ts +37 -0
- package/src/common/dto/page-options.dto.d.ts +8 -0
- package/src/common/dto/page-options.dto.js +87 -0
- package/src/common/dto/page-options.dto.ts +35 -0
- package/src/common/dto/page.dto.d.ts +11 -0
- package/src/common/dto/page.dto.js +94 -0
- package/src/common/dto/page.dto.ts +36 -0
- package/src/common/utils.d.ts +14 -0
- package/src/common/utils.js +39 -0
- package/src/common/utils.ts +45 -0
- package/src/constants/index.d.ts +4 -0
- package/src/constants/index.js +20 -0
- package/src/constants/index.ts +4 -0
- package/src/constants/language-code.d.ts +5 -0
- package/src/constants/language-code.js +10 -0
- package/src/constants/language-code.ts +7 -0
- package/src/constants/order.d.ts +4 -0
- package/src/constants/order.js +8 -0
- package/src/constants/order.ts +4 -0
- package/src/constants/role-type.d.ts +4 -0
- package/src/constants/role-type.js +8 -0
- package/src/constants/role-type.ts +4 -0
- package/src/constants/token-type.d.ts +4 -0
- package/src/constants/token-type.js +8 -0
- package/src/constants/token-type.ts +4 -0
- package/src/decorators/api-page-ok-response.decorator.d.ts +5 -0
- package/src/decorators/api-page-ok-response.decorator.js +25 -0
- package/src/decorators/api-page-ok-response.decorator.ts +31 -0
- package/src/decorators/auth-user.decorator.d.ts +1 -0
- package/src/decorators/auth-user.decorator.js +15 -0
- package/src/decorators/auth-user.decorator.ts +16 -0
- package/src/decorators/controller.decorator.d.ts +1 -0
- package/src/decorators/controller.decorator.js +34 -0
- package/src/decorators/controller.decorator.ts +8 -0
- package/src/decorators/field.decorators.d.ts +71 -0
- package/src/decorators/field.decorators.js +455 -0
- package/src/decorators/field.decorators.ts +773 -0
- package/src/decorators/http.decorators.d.ts +3 -0
- package/src/decorators/http.decorators.js +8 -0
- package/src/decorators/http.decorators.ts +10 -0
- package/src/decorators/index.d.ts +12 -0
- package/src/decorators/index.js +28 -0
- package/src/decorators/index.ts +12 -0
- package/src/decorators/omni-auth.decorator.d.ts +8 -0
- package/src/decorators/omni-auth.decorator.js +60 -0
- package/src/decorators/omni-auth.decorator.ts +46 -0
- package/src/decorators/operation.decorator.d.ts +1 -0
- package/src/decorators/operation.decorator.js +6 -0
- package/src/decorators/operation.decorator.ts +4 -0
- package/src/decorators/property.decorators.d.ts +15 -0
- package/src/decorators/property.decorators.js +36 -0
- package/src/decorators/property.decorators.ts +62 -0
- package/src/decorators/public-route.decorator.d.ts +3 -0
- package/src/decorators/public-route.decorator.js +8 -0
- package/src/decorators/public-route.decorator.ts +8 -0
- package/src/decorators/swagger.schema.d.ts +5 -0
- package/src/decorators/swagger.schema.js +82 -0
- package/src/decorators/swagger.schema.ts +117 -0
- package/src/decorators/timestamp-column.decorator.d.ts +1 -0
- package/src/decorators/timestamp-column.decorator.js +28 -0
- package/src/decorators/timestamp-column.decorator.ts +29 -0
- package/src/decorators/transform.decorators.d.ts +35 -0
- package/src/decorators/transform.decorators.js +122 -0
- package/src/decorators/transform.decorators.ts +147 -0
- package/src/decorators/translate.decorator.d.ts +5 -0
- package/src/decorators/translate.decorator.js +18 -0
- package/src/decorators/translate.decorator.ts +19 -0
- package/src/decorators/use-dto.decorator.d.ts +4 -0
- package/src/decorators/use-dto.decorator.js +9 -0
- package/src/decorators/use-dto.decorator.ts +11 -0
- package/src/decorators/user-check.decorator.d.ts +6 -0
- package/src/decorators/user-check.decorator.js +44 -0
- package/src/decorators/user-check.decorator.ts +30 -0
- package/src/decorators/user.decorator.d.ts +8 -0
- package/src/decorators/user.decorator.js +62 -0
- package/src/decorators/user.decorator.ts +48 -0
- package/src/decorators/user_auth.decorator.d.ts +1 -0
- package/src/decorators/user_auth.decorator.js +16 -0
- package/src/decorators/user_auth.decorator.ts +15 -0
- package/src/decorators/validator.decorators.d.ts +10 -0
- package/src/decorators/validator.decorators.js +59 -0
- package/src/decorators/validator.decorators.ts +78 -0
- package/src/exceptions/file-not-image.exception.d.ts +4 -0
- package/src/exceptions/file-not-image.exception.js +10 -0
- package/src/exceptions/file-not-image.exception.ts +7 -0
- package/src/exceptions/index.d.ts +2 -0
- package/src/exceptions/index.js +18 -0
- package/src/exceptions/index.ts +2 -0
- package/src/exceptions/page-type.exception.d.ts +4 -0
- package/src/exceptions/page-type.exception.js +10 -0
- package/src/exceptions/page-type.exception.ts +7 -0
- package/src/exceptions/user-not-found.exception.d.ts +4 -0
- package/src/exceptions/user-not-found.exception.js +10 -0
- package/src/exceptions/user-not-found.exception.ts +7 -0
- package/src/filters/bad-request.filter.d.ts +5 -0
- package/src/filters/bad-request.filter.js +104 -0
- package/src/filters/bad-request.filter.ts +67 -0
- package/src/filters/constraint-errors.d.ts +1 -0
- package/src/filters/constraint-errors.js +7 -0
- package/src/filters/constraint-errors.ts +5 -0
- package/src/filters/index.d.ts +3 -0
- package/src/filters/index.js +19 -0
- package/src/filters/index.ts +3 -0
- package/src/filters/query-failed.filter.d.ts +10 -0
- package/src/filters/query-failed.filter.js +81 -0
- package/src/filters/query-failed.filter.ts +32 -0
- package/src/health-checker/health-checker.controller.d.ts +15 -0
- package/src/health-checker/health-checker.controller.js +104 -0
- package/src/health-checker/health-checker.controller.ts +51 -0
- package/src/health-checker/health-checker.module.d.ts +2 -0
- package/src/health-checker/health-checker.module.js +69 -0
- package/src/health-checker/health-checker.module.ts +13 -0
- package/src/health-checker/health-indicators/service.indicator.d.ts +8 -0
- package/src/health-checker/health-indicators/service.indicator.js +102 -0
- package/src/health-checker/health-indicators/service.indicator.ts +44 -0
- package/src/helpers/common.helper.d.ts +16 -0
- package/src/helpers/common.helper.js +49 -0
- package/src/helpers/common.helper.ts +49 -0
- package/src/helpers/date.helper.d.ts +10 -0
- package/src/helpers/date.helper.js +81 -0
- package/src/helpers/date.helper.ts +64 -0
- package/src/helpers/excel.helper.d.ts +27 -0
- package/src/helpers/excel.helper.js +338 -0
- package/src/helpers/index.d.ts +3 -0
- package/src/helpers/index.js +19 -0
- package/src/helpers/index.ts +3 -0
- package/src/i18n/en_US/validation.json +38 -0
- package/src/i18n/zh_CN/validation.json +38 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +28 -0
- package/src/index.ts +12 -0
- package/src/interceptors/auth-user.interceptor.d.ts +4 -0
- package/src/interceptors/auth-user.interceptor.js +68 -0
- package/src/interceptors/auth-user.interceptor.ts +20 -0
- package/src/interceptors/index.d.ts +2 -0
- package/src/interceptors/index.js +18 -0
- package/src/interceptors/index.ts +2 -0
- package/src/interceptors/language-interceptor.service.d.ts +6 -0
- package/src/interceptors/language-interceptor.service.js +74 -0
- package/src/interceptors/language-interceptor.service.ts +31 -0
- package/src/interceptors/translation-interceptor.service.d.ts +5 -0
- package/src/interceptors/translation-interceptor.service.js +83 -0
- package/src/interceptors/translation-interceptor.service.ts +43 -0
- package/src/interfaces/IApiFile.d.ts +4 -0
- package/src/interfaces/IApiFile.js +2 -0
- package/src/interfaces/IApiFile.ts +4 -0
- package/src/interfaces/IFile.d.ts +9 -0
- package/src/interfaces/IFile.js +2 -0
- package/src/interfaces/IFile.ts +8 -0
- package/src/interfaces/ITranslationDecoratorInterface.d.ts +3 -0
- package/src/interfaces/ITranslationDecoratorInterface.js +2 -0
- package/src/interfaces/ITranslationDecoratorInterface.ts +3 -0
- package/src/interfaces/index.d.ts +3 -0
- package/src/interfaces/index.js +19 -0
- package/src/interfaces/index.ts +3 -0
- package/src/interfaces/response.d.ts +25 -0
- package/src/interfaces/response.js +2 -0
- package/src/interfaces/response.ts +37 -0
- package/src/middlewares/index.d.ts +3 -0
- package/src/middlewares/index.js +19 -0
- package/src/middlewares/index.ts +3 -0
- package/src/middlewares/omni-auth.middleware.d.ts +1 -0
- package/src/middlewares/omni-auth.middleware.js +13 -0
- package/src/middlewares/omni-auth.middleware.ts +10 -0
- package/src/middlewares/powerby.middleware.d.ts +1 -0
- package/src/middlewares/powerby.middleware.js +10 -0
- package/src/middlewares/powerby.middleware.ts +6 -0
- package/src/middlewares/request-id.middleware.d.ts +7 -0
- package/src/middlewares/request-id.middleware.js +22 -0
- package/src/middlewares/request-id.middleware.ts +28 -0
- package/src/providers/context.provider.d.ts +32 -0
- package/src/providers/context.provider.js +73 -0
- package/src/providers/context.provider.ts +98 -0
- package/src/providers/generator.provider.d.ts +13 -0
- package/src/providers/generator.provider.js +54 -0
- package/src/providers/generator.provider.ts +66 -0
- package/src/providers/index.d.ts +2 -0
- package/src/providers/index.js +18 -0
- package/src/providers/index.ts +2 -0
- package/src/setup/bootstrap.setup.d.ts +5 -0
- package/src/setup/bootstrap.setup.js +138 -0
- package/src/setup/bootstrap.setup.ts +139 -0
- package/src/setup/index.d.ts +1 -0
- package/src/setup/index.js +17 -0
- package/src/setup/index.ts +1 -0
- package/src/setup/microservices.setup.js +55 -0
- package/src/setup-swagger.d.ts +2 -0
- package/src/setup-swagger.js +62 -0
- package/src/setup-swagger.ts +67 -0
- package/src/shared/index.d.ts +2 -0
- package/src/shared/index.js +18 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/serviceRegistryModule.d.ts +2 -0
- package/src/shared/serviceRegistryModule.js +176 -0
- package/src/shared/serviceRegistryModule.ts +110 -0
- package/src/shared/services/api-config.service.d.ts +73 -0
- package/src/shared/services/api-config.service.js +335 -0
- package/src/shared/services/api-config.service.ts +319 -0
- package/src/shared/services/aws-s3.service.d.ts +10 -0
- package/src/shared/services/aws-s3.service.js +96 -0
- package/src/shared/services/aws-s3.service.ts +39 -0
- package/src/shared/services/generator.service.d.ts +4 -0
- package/src/shared/services/generator.service.js +67 -0
- package/src/shared/services/generator.service.ts +13 -0
- package/src/shared/services/index.d.ts +5 -0
- package/src/shared/services/index.js +21 -0
- package/src/shared/services/index.ts +5 -0
- package/src/shared/services/translation.service.d.ts +9 -0
- package/src/shared/services/translation.service.js +109 -0
- package/src/shared/services/translation.service.ts +59 -0
- package/src/shared/services/validator.service.d.ts +3 -0
- package/src/shared/services/validator.service.js +64 -0
- package/src/shared/services/validator.service.ts +10 -0
- package/src/snake-naming.strategy.d.ts +11 -0
- package/src/snake-naming.strategy.js +37 -0
- package/src/snake-naming.strategy.ts +64 -0
- package/src/types.d.ts +9 -0
- package/src/types.js +2 -0
- package/src/types.ts +44 -0
- package/src/validators/file-mimetype.validator.d.ts +13 -0
- package/src/validators/file-mimetype.validator.js +21 -0
- package/src/validators/file-mimetype.validator.ts +34 -0
- package/src/validators/index.d.ts +3 -0
- package/src/validators/index.js +19 -0
- package/src/validators/index.ts +3 -0
- package/src/validators/is-exists.validator.d.ts +18 -0
- package/src/validators/is-exists.validator.js +99 -0
- package/src/validators/is-exists.validator.ts +60 -0
- package/src/validators/is-unique.validator.d.ts +17 -0
- package/src/validators/is-unique.validator.js +131 -0
- package/src/validators/is-unique.validator.ts +93 -0
- package/src/validators/phone-country-code.validator.d.ts +2 -0
- package/src/validators/phone-country-code.validator.js +30 -0
- package/src/validators/phone-country-code.validator.ts +36 -0
- package/src/validators/same-as.validator.d.ts +2 -0
- package/src/validators/same-as.validator.js +25 -0
- package/src/validators/same-as.validator.ts +27 -0
- package/src/validators/skip-empty.validator.d.ts +6 -0
- package/src/validators/skip-empty.validator.js +23 -0
- package/src/validators/skip-empty.validator.ts +25 -0
- package/tsconfig.json +21 -0
- package/tsconfig.lib.json +16 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
|
|
3
|
+
import { DYNAMIC_TRANSLATION_DECORATOR_KEY } from '../../decorators';
|
|
4
|
+
import { ContextProvider } from '../../providers';
|
|
5
|
+
import {
|
|
6
|
+
AbstractEntity,
|
|
7
|
+
AbstractStringPrimaryEntity,
|
|
8
|
+
} from '../abstract.entity';
|
|
9
|
+
|
|
10
|
+
export class AbstractDto {
|
|
11
|
+
@ApiProperty()
|
|
12
|
+
id: number | string;
|
|
13
|
+
|
|
14
|
+
@ApiProperty()
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
|
|
17
|
+
@ApiProperty()
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
|
|
20
|
+
translations?: AbstractTranslationDto[];
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
entity: AbstractEntity | AbstractStringPrimaryEntity,
|
|
24
|
+
options?: { excludeFields?: boolean },
|
|
25
|
+
) {
|
|
26
|
+
if (!options?.excludeFields) {
|
|
27
|
+
this.id = entity.id;
|
|
28
|
+
this.createdAt = entity.createdAt;
|
|
29
|
+
this.updatedAt = entity.updatedAt;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const languageCode = ContextProvider.getLanguage();
|
|
33
|
+
|
|
34
|
+
if (languageCode && entity.translations) {
|
|
35
|
+
const translationEntity = entity.translations.find(
|
|
36
|
+
(titleTranslation) => titleTranslation.languageCode === languageCode,
|
|
37
|
+
)!;
|
|
38
|
+
|
|
39
|
+
const fields: Record<string, string> = {};
|
|
40
|
+
|
|
41
|
+
for (const key of Object.keys(translationEntity)) {
|
|
42
|
+
const metadata = Reflect.getMetadata(
|
|
43
|
+
DYNAMIC_TRANSLATION_DECORATOR_KEY,
|
|
44
|
+
this,
|
|
45
|
+
key,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
if (metadata) {
|
|
49
|
+
fields[key] = translationEntity[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Object.assign(this, fields);
|
|
54
|
+
} else {
|
|
55
|
+
this.translations = entity.translations?.toDtos();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class AbstractTranslationDto extends AbstractDto {
|
|
61
|
+
constructor(entity: AbstractEntity | AbstractStringPrimaryEntity) {
|
|
62
|
+
super(entity, { excludeFields: true });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.BulkIdDto = void 0;
|
|
38
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
39
|
+
const class_validator_1 = require("class-validator");
|
|
40
|
+
let BulkIdDto = (() => {
|
|
41
|
+
var _a;
|
|
42
|
+
let _instanceExtraInitializers = [];
|
|
43
|
+
let _id_decorators;
|
|
44
|
+
let _id_initializers = [];
|
|
45
|
+
return _a = class BulkIdDto {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.id = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _id_initializers, void 0));
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
(() => {
|
|
51
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
52
|
+
_id_decorators = [(0, swagger_1.ApiProperty)({
|
|
53
|
+
type: 'integer',
|
|
54
|
+
description: 'ID',
|
|
55
|
+
isArray: true,
|
|
56
|
+
required: false,
|
|
57
|
+
}), (0, class_validator_1.IsArray)()];
|
|
58
|
+
__esDecorate(null, null, _id_decorators, { kind: "field", name: "id", static: false, private: false, access: { has: obj => "id" in obj, get: obj => obj.id, set: (obj, value) => { obj.id = value; } }, metadata: _metadata }, _id_initializers, _instanceExtraInitializers);
|
|
59
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
60
|
+
})(),
|
|
61
|
+
_a;
|
|
62
|
+
})();
|
|
63
|
+
exports.BulkIdDto = BulkIdDto;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsArray } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
export class BulkIdDto {
|
|
5
|
+
@ApiProperty({
|
|
6
|
+
type: 'integer',
|
|
7
|
+
description: 'ID',
|
|
8
|
+
isArray: true,
|
|
9
|
+
required: false,
|
|
10
|
+
})
|
|
11
|
+
@IsArray()
|
|
12
|
+
id: number[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.CreateTranslationDto = void 0;
|
|
38
|
+
const constants_1 = require("../../constants");
|
|
39
|
+
const decorators_1 = require("../../decorators");
|
|
40
|
+
let CreateTranslationDto = (() => {
|
|
41
|
+
var _a;
|
|
42
|
+
let _instanceExtraInitializers = [];
|
|
43
|
+
let _languageCode_decorators;
|
|
44
|
+
let _languageCode_initializers = [];
|
|
45
|
+
let _text_decorators;
|
|
46
|
+
let _text_initializers = [];
|
|
47
|
+
return _a = class CreateTranslationDto {
|
|
48
|
+
constructor() {
|
|
49
|
+
this.languageCode = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _languageCode_initializers, void 0));
|
|
50
|
+
this.text = __runInitializers(this, _text_initializers, void 0);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
(() => {
|
|
54
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
55
|
+
_languageCode_decorators = [(0, decorators_1.EnumField)(() => constants_1.LanguageCode)];
|
|
56
|
+
_text_decorators = [(0, decorators_1.StringField)()];
|
|
57
|
+
__esDecorate(null, null, _languageCode_decorators, { kind: "field", name: "languageCode", static: false, private: false, access: { has: obj => "languageCode" in obj, get: obj => obj.languageCode, set: (obj, value) => { obj.languageCode = value; } }, metadata: _metadata }, _languageCode_initializers, _instanceExtraInitializers);
|
|
58
|
+
__esDecorate(null, null, _text_decorators, { kind: "field", name: "text", static: false, private: false, access: { has: obj => "text" in obj, get: obj => obj.text, set: (obj, value) => { obj.text = value; } }, metadata: _metadata }, _text_initializers, _instanceExtraInitializers);
|
|
59
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
60
|
+
})(),
|
|
61
|
+
_a;
|
|
62
|
+
})();
|
|
63
|
+
exports.CreateTranslationDto = CreateTranslationDto;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PageOptionsDto } from './page-options.dto';
|
|
2
|
+
interface IPageMetaDtoParameters {
|
|
3
|
+
pageOptionsDto: PageOptionsDto;
|
|
4
|
+
itemCount: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class PageMetaDto {
|
|
7
|
+
readonly page: number;
|
|
8
|
+
readonly pageSize: number;
|
|
9
|
+
readonly itemCount: number;
|
|
10
|
+
readonly pageCount: number;
|
|
11
|
+
readonly hasPreviousPage: boolean;
|
|
12
|
+
readonly hasNextPage: boolean;
|
|
13
|
+
constructor({ pageOptionsDto, itemCount }: IPageMetaDtoParameters);
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.PageMetaDto = void 0;
|
|
38
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
39
|
+
let PageMetaDto = (() => {
|
|
40
|
+
var _a;
|
|
41
|
+
let _instanceExtraInitializers = [];
|
|
42
|
+
let _page_decorators;
|
|
43
|
+
let _page_initializers = [];
|
|
44
|
+
let _pageSize_decorators;
|
|
45
|
+
let _pageSize_initializers = [];
|
|
46
|
+
let _itemCount_decorators;
|
|
47
|
+
let _itemCount_initializers = [];
|
|
48
|
+
let _pageCount_decorators;
|
|
49
|
+
let _pageCount_initializers = [];
|
|
50
|
+
let _hasPreviousPage_decorators;
|
|
51
|
+
let _hasPreviousPage_initializers = [];
|
|
52
|
+
let _hasNextPage_decorators;
|
|
53
|
+
let _hasNextPage_initializers = [];
|
|
54
|
+
return _a = class PageMetaDto {
|
|
55
|
+
constructor({ pageOptionsDto, itemCount }) {
|
|
56
|
+
this.page = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _page_initializers, void 0));
|
|
57
|
+
this.pageSize = __runInitializers(this, _pageSize_initializers, void 0);
|
|
58
|
+
this.itemCount = __runInitializers(this, _itemCount_initializers, void 0);
|
|
59
|
+
this.pageCount = __runInitializers(this, _pageCount_initializers, void 0);
|
|
60
|
+
this.hasPreviousPage = __runInitializers(this, _hasPreviousPage_initializers, void 0);
|
|
61
|
+
this.hasNextPage = __runInitializers(this, _hasNextPage_initializers, void 0);
|
|
62
|
+
this.page = pageOptionsDto.page;
|
|
63
|
+
this.pageSize = pageOptionsDto.pageSize;
|
|
64
|
+
this.itemCount = itemCount;
|
|
65
|
+
this.pageCount = Math.ceil(this.itemCount / this.pageSize);
|
|
66
|
+
this.hasPreviousPage = this.page > 1;
|
|
67
|
+
this.hasNextPage = this.page < this.pageCount;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
(() => {
|
|
71
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
72
|
+
_page_decorators = [(0, swagger_1.ApiProperty)()];
|
|
73
|
+
_pageSize_decorators = [(0, swagger_1.ApiProperty)()];
|
|
74
|
+
_itemCount_decorators = [(0, swagger_1.ApiProperty)()];
|
|
75
|
+
_pageCount_decorators = [(0, swagger_1.ApiProperty)()];
|
|
76
|
+
_hasPreviousPage_decorators = [(0, swagger_1.ApiProperty)()];
|
|
77
|
+
_hasNextPage_decorators = [(0, swagger_1.ApiProperty)()];
|
|
78
|
+
__esDecorate(null, null, _page_decorators, { kind: "field", name: "page", static: false, private: false, access: { has: obj => "page" in obj, get: obj => obj.page, set: (obj, value) => { obj.page = value; } }, metadata: _metadata }, _page_initializers, _instanceExtraInitializers);
|
|
79
|
+
__esDecorate(null, null, _pageSize_decorators, { kind: "field", name: "pageSize", static: false, private: false, access: { has: obj => "pageSize" in obj, get: obj => obj.pageSize, set: (obj, value) => { obj.pageSize = value; } }, metadata: _metadata }, _pageSize_initializers, _instanceExtraInitializers);
|
|
80
|
+
__esDecorate(null, null, _itemCount_decorators, { kind: "field", name: "itemCount", static: false, private: false, access: { has: obj => "itemCount" in obj, get: obj => obj.itemCount, set: (obj, value) => { obj.itemCount = value; } }, metadata: _metadata }, _itemCount_initializers, _instanceExtraInitializers);
|
|
81
|
+
__esDecorate(null, null, _pageCount_decorators, { kind: "field", name: "pageCount", static: false, private: false, access: { has: obj => "pageCount" in obj, get: obj => obj.pageCount, set: (obj, value) => { obj.pageCount = value; } }, metadata: _metadata }, _pageCount_initializers, _instanceExtraInitializers);
|
|
82
|
+
__esDecorate(null, null, _hasPreviousPage_decorators, { kind: "field", name: "hasPreviousPage", static: false, private: false, access: { has: obj => "hasPreviousPage" in obj, get: obj => obj.hasPreviousPage, set: (obj, value) => { obj.hasPreviousPage = value; } }, metadata: _metadata }, _hasPreviousPage_initializers, _instanceExtraInitializers);
|
|
83
|
+
__esDecorate(null, null, _hasNextPage_decorators, { kind: "field", name: "hasNextPage", static: false, private: false, access: { has: obj => "hasNextPage" in obj, get: obj => obj.hasNextPage, set: (obj, value) => { obj.hasNextPage = value; } }, metadata: _metadata }, _hasNextPage_initializers, _instanceExtraInitializers);
|
|
84
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
85
|
+
})(),
|
|
86
|
+
_a;
|
|
87
|
+
})();
|
|
88
|
+
exports.PageMetaDto = PageMetaDto;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
|
|
3
|
+
import type { PageOptionsDto } from './page-options.dto';
|
|
4
|
+
|
|
5
|
+
interface IPageMetaDtoParameters {
|
|
6
|
+
pageOptionsDto: PageOptionsDto;
|
|
7
|
+
itemCount: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class PageMetaDto {
|
|
11
|
+
@ApiProperty()
|
|
12
|
+
readonly page: number;
|
|
13
|
+
|
|
14
|
+
@ApiProperty()
|
|
15
|
+
readonly pageSize: number;
|
|
16
|
+
|
|
17
|
+
@ApiProperty()
|
|
18
|
+
readonly itemCount: number;
|
|
19
|
+
|
|
20
|
+
@ApiProperty()
|
|
21
|
+
readonly pageCount: number;
|
|
22
|
+
|
|
23
|
+
@ApiProperty()
|
|
24
|
+
readonly hasPreviousPage: boolean;
|
|
25
|
+
|
|
26
|
+
@ApiProperty()
|
|
27
|
+
readonly hasNextPage: boolean;
|
|
28
|
+
|
|
29
|
+
constructor({ pageOptionsDto, itemCount }: IPageMetaDtoParameters) {
|
|
30
|
+
this.page = pageOptionsDto.page;
|
|
31
|
+
this.pageSize = pageOptionsDto.pageSize;
|
|
32
|
+
this.itemCount = itemCount;
|
|
33
|
+
this.pageCount = Math.ceil(this.itemCount / this.pageSize);
|
|
34
|
+
this.hasPreviousPage = this.page > 1;
|
|
35
|
+
this.hasNextPage = this.page < this.pageCount;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.PageOptionsDto = void 0;
|
|
38
|
+
const constants_1 = require("../../constants");
|
|
39
|
+
const decorators_1 = require("../../decorators");
|
|
40
|
+
let PageOptionsDto = (() => {
|
|
41
|
+
var _a;
|
|
42
|
+
let _instanceExtraInitializers = [];
|
|
43
|
+
let _order_decorators;
|
|
44
|
+
let _order_initializers = [];
|
|
45
|
+
let _page_decorators;
|
|
46
|
+
let _page_initializers = [];
|
|
47
|
+
let _pageSize_decorators;
|
|
48
|
+
let _pageSize_initializers = [];
|
|
49
|
+
let _q_decorators;
|
|
50
|
+
let _q_initializers = [];
|
|
51
|
+
return _a = class PageOptionsDto {
|
|
52
|
+
constructor() {
|
|
53
|
+
this.order = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _order_initializers, constants_1.Order.ASC));
|
|
54
|
+
this.page = __runInitializers(this, _page_initializers, 1);
|
|
55
|
+
this.pageSize = __runInitializers(this, _pageSize_initializers, 10);
|
|
56
|
+
this.q = __runInitializers(this, _q_initializers, void 0);
|
|
57
|
+
}
|
|
58
|
+
get skip() {
|
|
59
|
+
return (this.page - 1) * this.pageSize;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
(() => {
|
|
63
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
64
|
+
_order_decorators = [(0, decorators_1.EnumFieldOptional)(() => constants_1.Order, {
|
|
65
|
+
default: constants_1.Order.ASC,
|
|
66
|
+
})];
|
|
67
|
+
_page_decorators = [(0, decorators_1.NumberFieldOptional)({
|
|
68
|
+
minimum: 1,
|
|
69
|
+
default: 1,
|
|
70
|
+
int: true,
|
|
71
|
+
})];
|
|
72
|
+
_pageSize_decorators = [(0, decorators_1.NumberFieldOptional)({
|
|
73
|
+
minimum: 1,
|
|
74
|
+
maximum: 50,
|
|
75
|
+
default: 10,
|
|
76
|
+
int: true,
|
|
77
|
+
})];
|
|
78
|
+
_q_decorators = [(0, decorators_1.StringFieldOptional)()];
|
|
79
|
+
__esDecorate(null, null, _order_decorators, { kind: "field", name: "order", static: false, private: false, access: { has: obj => "order" in obj, get: obj => obj.order, set: (obj, value) => { obj.order = value; } }, metadata: _metadata }, _order_initializers, _instanceExtraInitializers);
|
|
80
|
+
__esDecorate(null, null, _page_decorators, { kind: "field", name: "page", static: false, private: false, access: { has: obj => "page" in obj, get: obj => obj.page, set: (obj, value) => { obj.page = value; } }, metadata: _metadata }, _page_initializers, _instanceExtraInitializers);
|
|
81
|
+
__esDecorate(null, null, _pageSize_decorators, { kind: "field", name: "pageSize", static: false, private: false, access: { has: obj => "pageSize" in obj, get: obj => obj.pageSize, set: (obj, value) => { obj.pageSize = value; } }, metadata: _metadata }, _pageSize_initializers, _instanceExtraInitializers);
|
|
82
|
+
__esDecorate(null, null, _q_decorators, { kind: "field", name: "q", static: false, private: false, access: { has: obj => "q" in obj, get: obj => obj.q, set: (obj, value) => { obj.q = value; } }, metadata: _metadata }, _q_initializers, _instanceExtraInitializers);
|
|
83
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
84
|
+
})(),
|
|
85
|
+
_a;
|
|
86
|
+
})();
|
|
87
|
+
exports.PageOptionsDto = PageOptionsDto;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Order } from '../../constants';
|
|
2
|
+
import {
|
|
3
|
+
EnumFieldOptional,
|
|
4
|
+
NumberFieldOptional,
|
|
5
|
+
StringFieldOptional,
|
|
6
|
+
} from '../../decorators';
|
|
7
|
+
|
|
8
|
+
export class PageOptionsDto {
|
|
9
|
+
@EnumFieldOptional(() => Order, {
|
|
10
|
+
default: Order.ASC,
|
|
11
|
+
})
|
|
12
|
+
readonly order: Order = Order.ASC;
|
|
13
|
+
|
|
14
|
+
@NumberFieldOptional({
|
|
15
|
+
minimum: 1,
|
|
16
|
+
default: 1,
|
|
17
|
+
int: true,
|
|
18
|
+
})
|
|
19
|
+
readonly page: number = 1;
|
|
20
|
+
|
|
21
|
+
@NumberFieldOptional({
|
|
22
|
+
minimum: 1,
|
|
23
|
+
maximum: 50,
|
|
24
|
+
default: 10,
|
|
25
|
+
int: true,
|
|
26
|
+
})
|
|
27
|
+
readonly pageSize: number = 10;
|
|
28
|
+
|
|
29
|
+
get skip(): number {
|
|
30
|
+
return (this.page - 1) * this.pageSize;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@StringFieldOptional()
|
|
34
|
+
readonly q?: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageMetaDto } from './page-meta.dto';
|
|
2
|
+
export declare class PageDto<T> {
|
|
3
|
+
readonly data: T[];
|
|
4
|
+
count: number;
|
|
5
|
+
total: number;
|
|
6
|
+
page: number;
|
|
7
|
+
pageCount: number;
|
|
8
|
+
hasPreviousPage: boolean;
|
|
9
|
+
hasNextPage: boolean;
|
|
10
|
+
constructor(data: T[], meta: PageMetaDto);
|
|
11
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.PageDto = void 0;
|
|
38
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
39
|
+
let PageDto = (() => {
|
|
40
|
+
var _a;
|
|
41
|
+
let _instanceExtraInitializers = [];
|
|
42
|
+
let _data_decorators;
|
|
43
|
+
let _data_initializers = [];
|
|
44
|
+
let _count_decorators;
|
|
45
|
+
let _count_initializers = [];
|
|
46
|
+
let _total_decorators;
|
|
47
|
+
let _total_initializers = [];
|
|
48
|
+
let _page_decorators;
|
|
49
|
+
let _page_initializers = [];
|
|
50
|
+
let _pageCount_decorators;
|
|
51
|
+
let _pageCount_initializers = [];
|
|
52
|
+
let _hasPreviousPage_decorators;
|
|
53
|
+
let _hasPreviousPage_initializers = [];
|
|
54
|
+
let _hasNextPage_decorators;
|
|
55
|
+
let _hasNextPage_initializers = [];
|
|
56
|
+
return _a = class PageDto {
|
|
57
|
+
constructor(data, meta) {
|
|
58
|
+
this.data = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _data_initializers, void 0));
|
|
59
|
+
this.count = __runInitializers(this, _count_initializers, void 0);
|
|
60
|
+
this.total = __runInitializers(this, _total_initializers, void 0);
|
|
61
|
+
this.page = __runInitializers(this, _page_initializers, void 0);
|
|
62
|
+
this.pageCount = __runInitializers(this, _pageCount_initializers, void 0);
|
|
63
|
+
this.hasPreviousPage = __runInitializers(this, _hasPreviousPage_initializers, void 0);
|
|
64
|
+
this.hasNextPage = __runInitializers(this, _hasNextPage_initializers, void 0);
|
|
65
|
+
this.data = data;
|
|
66
|
+
this.count = meta.pageSize;
|
|
67
|
+
this.pageCount = meta.pageCount;
|
|
68
|
+
this.page = meta.page;
|
|
69
|
+
this.total = meta.itemCount;
|
|
70
|
+
this.hasPreviousPage = meta.hasPreviousPage;
|
|
71
|
+
this.hasNextPage = meta.hasNextPage;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
(() => {
|
|
75
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
76
|
+
_data_decorators = [(0, swagger_1.ApiProperty)({ isArray: true })];
|
|
77
|
+
_count_decorators = [(0, swagger_1.ApiProperty)()];
|
|
78
|
+
_total_decorators = [(0, swagger_1.ApiProperty)()];
|
|
79
|
+
_page_decorators = [(0, swagger_1.ApiProperty)()];
|
|
80
|
+
_pageCount_decorators = [(0, swagger_1.ApiProperty)()];
|
|
81
|
+
_hasPreviousPage_decorators = [(0, swagger_1.ApiProperty)()];
|
|
82
|
+
_hasNextPage_decorators = [(0, swagger_1.ApiProperty)()];
|
|
83
|
+
__esDecorate(null, null, _data_decorators, { kind: "field", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _instanceExtraInitializers);
|
|
84
|
+
__esDecorate(null, null, _count_decorators, { kind: "field", name: "count", static: false, private: false, access: { has: obj => "count" in obj, get: obj => obj.count, set: (obj, value) => { obj.count = value; } }, metadata: _metadata }, _count_initializers, _instanceExtraInitializers);
|
|
85
|
+
__esDecorate(null, null, _total_decorators, { kind: "field", name: "total", static: false, private: false, access: { has: obj => "total" in obj, get: obj => obj.total, set: (obj, value) => { obj.total = value; } }, metadata: _metadata }, _total_initializers, _instanceExtraInitializers);
|
|
86
|
+
__esDecorate(null, null, _page_decorators, { kind: "field", name: "page", static: false, private: false, access: { has: obj => "page" in obj, get: obj => obj.page, set: (obj, value) => { obj.page = value; } }, metadata: _metadata }, _page_initializers, _instanceExtraInitializers);
|
|
87
|
+
__esDecorate(null, null, _pageCount_decorators, { kind: "field", name: "pageCount", static: false, private: false, access: { has: obj => "pageCount" in obj, get: obj => obj.pageCount, set: (obj, value) => { obj.pageCount = value; } }, metadata: _metadata }, _pageCount_initializers, _instanceExtraInitializers);
|
|
88
|
+
__esDecorate(null, null, _hasPreviousPage_decorators, { kind: "field", name: "hasPreviousPage", static: false, private: false, access: { has: obj => "hasPreviousPage" in obj, get: obj => obj.hasPreviousPage, set: (obj, value) => { obj.hasPreviousPage = value; } }, metadata: _metadata }, _hasPreviousPage_initializers, _instanceExtraInitializers);
|
|
89
|
+
__esDecorate(null, null, _hasNextPage_decorators, { kind: "field", name: "hasNextPage", static: false, private: false, access: { has: obj => "hasNextPage" in obj, get: obj => obj.hasNextPage, set: (obj, value) => { obj.hasNextPage = value; } }, metadata: _metadata }, _hasNextPage_initializers, _instanceExtraInitializers);
|
|
90
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
91
|
+
})(),
|
|
92
|
+
_a;
|
|
93
|
+
})();
|
|
94
|
+
exports.PageDto = PageDto;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
|
|
3
|
+
import { PageMetaDto } from './page-meta.dto';
|
|
4
|
+
|
|
5
|
+
export class PageDto<T> {
|
|
6
|
+
@ApiProperty({ isArray: true })
|
|
7
|
+
readonly data: T[];
|
|
8
|
+
|
|
9
|
+
@ApiProperty()
|
|
10
|
+
count: number;
|
|
11
|
+
|
|
12
|
+
@ApiProperty()
|
|
13
|
+
total: number;
|
|
14
|
+
|
|
15
|
+
@ApiProperty()
|
|
16
|
+
page: number;
|
|
17
|
+
|
|
18
|
+
@ApiProperty()
|
|
19
|
+
pageCount: number;
|
|
20
|
+
|
|
21
|
+
@ApiProperty()
|
|
22
|
+
hasPreviousPage: boolean;
|
|
23
|
+
|
|
24
|
+
@ApiProperty()
|
|
25
|
+
hasNextPage: boolean;
|
|
26
|
+
|
|
27
|
+
constructor(data: T[], meta: PageMetaDto) {
|
|
28
|
+
this.data = data;
|
|
29
|
+
this.count = meta.pageSize;
|
|
30
|
+
this.pageCount = meta.pageCount;
|
|
31
|
+
this.page = meta.page;
|
|
32
|
+
this.total = meta.itemCount;
|
|
33
|
+
this.hasPreviousPage = meta.hasPreviousPage;
|
|
34
|
+
this.hasNextPage = meta.hasNextPage;
|
|
35
|
+
}
|
|
36
|
+
}
|