@lenne.tech/nest-server 10.2.7 → 10.2.9
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/config.env.js +75 -75
- package/dist/config.env.js.map +1 -1
- package/dist/core/common/args/filter.args.js +1 -1
- package/dist/core/common/args/filter.args.js.map +1 -1
- package/dist/core/common/args/pagination.args.js.map +1 -1
- package/dist/core/common/decorators/current-user.decorator.js.map +1 -1
- package/dist/core/common/decorators/graphql-populate.decorator.js.map +1 -1
- package/dist/core/common/decorators/graphql-service-options.decorator.js.map +1 -1
- package/dist/core/common/decorators/restricted.decorator.d.ts +4 -4
- package/dist/core/common/decorators/restricted.decorator.js +2 -2
- package/dist/core/common/decorators/restricted.decorator.js.map +1 -1
- package/dist/core/common/enums/comparison-operator.enum.js +1 -1
- package/dist/core/common/enums/comparison-operator.enum.js.map +1 -1
- package/dist/core/common/enums/logical-operator.enum.js +1 -1
- package/dist/core/common/enums/logical-operator.enum.js.map +1 -1
- package/dist/core/common/enums/role.enum.d.ts +3 -3
- package/dist/core/common/enums/role.enum.js +2 -2
- package/dist/core/common/enums/role.enum.js.map +1 -1
- package/dist/core/common/enums/sort-order.emum.js +1 -1
- package/dist/core/common/enums/sort-order.emum.js.map +1 -1
- package/dist/core/common/filters/http-exception-log.filter.js.map +1 -1
- package/dist/core/common/helpers/config.helper.js.map +1 -1
- package/dist/core/common/helpers/context.helper.js +1 -1
- package/dist/core/common/helpers/context.helper.js.map +1 -1
- package/dist/core/common/helpers/db.helper.d.ts +28 -4
- package/dist/core/common/helpers/db.helper.js +4 -4
- package/dist/core/common/helpers/db.helper.js.map +1 -1
- package/dist/core/common/helpers/decorator.helper.d.ts +24 -0
- package/dist/core/common/helpers/decorator.helper.js.map +1 -1
- package/dist/core/common/helpers/file.helper.js +1 -1
- package/dist/core/common/helpers/file.helper.js.map +1 -1
- package/dist/core/common/helpers/filter.helper.d.ts +26 -2
- package/dist/core/common/helpers/filter.helper.js +3 -3
- package/dist/core/common/helpers/filter.helper.js.map +1 -1
- package/dist/core/common/helpers/graphql.helper.d.ts +2 -2
- package/dist/core/common/helpers/graphql.helper.js +1 -1
- package/dist/core/common/helpers/graphql.helper.js.map +1 -1
- package/dist/core/common/helpers/input.helper.d.ts +3 -3
- package/dist/core/common/helpers/input.helper.js +5 -5
- package/dist/core/common/helpers/input.helper.js.map +1 -1
- package/dist/core/common/helpers/model.helper.d.ts +2 -2
- package/dist/core/common/helpers/model.helper.js +3 -3
- package/dist/core/common/helpers/model.helper.js.map +1 -1
- package/dist/core/common/helpers/service.helper.d.ts +6 -6
- package/dist/core/common/helpers/service.helper.js +5 -5
- package/dist/core/common/helpers/service.helper.js.map +1 -1
- package/dist/core/common/helpers/table.helper.d.ts +3 -3
- package/dist/core/common/helpers/table.helper.js +7 -7
- package/dist/core/common/helpers/table.helper.js.map +1 -1
- package/dist/core/common/inputs/combined-filter.input.js.map +1 -1
- package/dist/core/common/inputs/filter.input.js.map +1 -1
- package/dist/core/common/inputs/single-filter.input.js.map +1 -1
- package/dist/core/common/inputs/sort.input.js.map +1 -1
- package/dist/core/common/interceptors/check-response.interceptor.js.map +1 -1
- package/dist/core/common/interceptors/check-security.interceptor.js.map +1 -1
- package/dist/core/common/interfaces/core-persistence-model.interface.d.ts +3 -3
- package/dist/core/common/interfaces/mailjet-options.interface.d.ts +1 -1
- package/dist/core/common/interfaces/prepare-input-options.interface.d.ts +1 -1
- package/dist/core/common/interfaces/server-options.interface.d.ts +12 -8
- package/dist/core/common/interfaces/service-options.interface.d.ts +31 -5
- package/dist/core/common/models/core-model.model.js.map +1 -1
- package/dist/core/common/models/core-persistence.model.d.ts +24 -0
- package/dist/core/common/models/core-persistence.model.js.map +1 -1
- package/dist/core/common/pipes/check-input.pipe.js.map +1 -1
- package/dist/core/common/pipes/map-and-validate.pipe.js.map +1 -1
- package/dist/core/common/plugins/complexity.plugin.js +4 -4
- package/dist/core/common/plugins/complexity.plugin.js.map +1 -1
- package/dist/core/common/plugins/mongoose-id.plugin.js.map +1 -1
- package/dist/core/common/scalars/any.scalar.js.map +1 -1
- package/dist/core/common/scalars/date-timestamp.scalar.js.map +1 -1
- package/dist/core/common/scalars/date.scalar.js.map +1 -1
- package/dist/core/common/scalars/json.scalar.js.map +1 -1
- package/dist/core/common/services/brevo.service.d.ts +4 -0
- package/dist/core/common/services/brevo.service.js +28 -5
- package/dist/core/common/services/brevo.service.js.map +1 -1
- package/dist/core/common/services/config.service.js +1 -1
- package/dist/core/common/services/config.service.js.map +1 -1
- package/dist/core/common/services/core-cron-jobs.service.d.ts +2 -2
- package/dist/core/common/services/core-cron-jobs.service.js.map +1 -1
- package/dist/core/common/services/crud.service.d.ts +58 -32
- package/dist/core/common/services/crud.service.js +40 -23
- package/dist/core/common/services/crud.service.js.map +1 -1
- package/dist/core/common/services/email.service.js +5 -5
- package/dist/core/common/services/email.service.js.map +1 -1
- package/dist/core/common/services/mailjet.service.d.ts +4 -4
- package/dist/core/common/services/mailjet.service.js +8 -8
- package/dist/core/common/services/mailjet.service.js.map +1 -1
- package/dist/core/common/services/model-doc.service.d.ts +24 -0
- package/dist/core/common/services/model-doc.service.js +1 -1
- package/dist/core/common/services/model-doc.service.js.map +1 -1
- package/dist/core/common/services/module.service.d.ts +28 -4
- package/dist/core/common/services/module.service.js +8 -4
- package/dist/core/common/services/module.service.js.map +1 -1
- package/dist/core/common/services/template.service.js +3 -3
- package/dist/core/common/services/template.service.js.map +1 -1
- package/dist/core/common/types/core-model-constructor.type.d.ts +1 -1
- package/dist/core/common/types/falsy.type.d.ts +1 -1
- package/dist/core/common/types/field-selection.type.d.ts +25 -1
- package/dist/core/common/types/ids.type.d.ts +31 -7
- package/dist/core/common/types/maybe-promise.type.d.ts +1 -1
- package/dist/core/common/types/plain-input.type.d.ts +1 -1
- package/dist/core/common/types/populate-config.type.d.ts +25 -1
- package/dist/core/common/types/string-or-object-id.type.d.ts +25 -1
- package/dist/core/modules/auth/core-auth.controller.js +1 -1
- package/dist/core/modules/auth/core-auth.controller.js.map +1 -1
- package/dist/core/modules/auth/core-auth.model.js.map +1 -1
- package/dist/core/modules/auth/core-auth.module.d.ts +5 -5
- package/dist/core/modules/auth/core-auth.module.js +5 -5
- package/dist/core/modules/auth/core-auth.module.js.map +1 -1
- package/dist/core/modules/auth/core-auth.resolver.js +1 -1
- package/dist/core/modules/auth/core-auth.resolver.js.map +1 -1
- package/dist/core/modules/auth/guards/auth.guard.d.ts +1 -1
- package/dist/core/modules/auth/guards/auth.guard.js +1 -1
- package/dist/core/modules/auth/guards/auth.guard.js.map +1 -1
- package/dist/core/modules/auth/guards/refresh-token.guard.js.map +1 -1
- package/dist/core/modules/auth/guards/roles.guard.js.map +1 -1
- package/dist/core/modules/auth/inputs/core-auth-sign-in.input.js.map +1 -1
- package/dist/core/modules/auth/inputs/core-auth-sign-up.input.js.map +1 -1
- package/dist/core/modules/auth/interfaces/core-auth-user.interface.d.ts +1 -1
- package/dist/core/modules/auth/interfaces/core-token-data.interface.d.ts +1 -1
- package/dist/core/modules/auth/interfaces/jwt-payload.interface.d.ts +1 -1
- package/dist/core/modules/auth/services/core-auth.service.d.ts +1 -1
- package/dist/core/modules/auth/services/core-auth.service.js +10 -10
- package/dist/core/modules/auth/services/core-auth.service.js.map +1 -1
- package/dist/core/modules/auth/strategies/jwt-refresh.strategy.js +1 -1
- package/dist/core/modules/auth/strategies/jwt-refresh.strategy.js.map +1 -1
- package/dist/core/modules/auth/strategies/jwt.strategy.js.map +1 -1
- package/dist/core/modules/auth/tokens.decorator.js +1 -1
- package/dist/core/modules/auth/tokens.decorator.js.map +1 -1
- package/dist/core/modules/file/core-file-info.model.d.ts +24 -0
- package/dist/core/modules/file/core-file-info.model.js +5 -5
- package/dist/core/modules/file/core-file-info.model.js.map +1 -1
- package/dist/core/modules/file/core-file.controller.js.map +1 -1
- package/dist/core/modules/file/core-file.resolver.js +1 -1
- package/dist/core/modules/file/core-file.resolver.js.map +1 -1
- package/dist/core/modules/file/core-file.service.d.ts +30 -6
- package/dist/core/modules/file/core-file.service.js +3 -3
- package/dist/core/modules/file/core-file.service.js.map +1 -1
- package/dist/core/modules/file/interfaces/file-service-options.interface.d.ts +1 -1
- package/dist/core/modules/file/interfaces/file-upload.interface.d.ts +2 -2
- package/dist/core/modules/health-check/core-health-check-result.model.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check.controller.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check.module.js +1 -1
- package/dist/core/modules/health-check/core-health-check.module.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check.resolver.js +2 -2
- package/dist/core/modules/health-check/core-health-check.resolver.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check.service.js +1 -1
- package/dist/core/modules/health-check/core-health-check.service.js.map +1 -1
- package/dist/core/modules/user/core-user.model.d.ts +24 -0
- package/dist/core/modules/user/core-user.model.js +1 -1
- package/dist/core/modules/user/core-user.model.js.map +1 -1
- package/dist/core/modules/user/core-user.service.d.ts +25 -1
- package/dist/core/modules/user/core-user.service.js +3 -3
- package/dist/core/modules/user/core-user.service.js.map +1 -1
- package/dist/core/modules/user/inputs/core-user-create.input.js +1 -1
- package/dist/core/modules/user/inputs/core-user-create.input.js.map +1 -1
- package/dist/core/modules/user/inputs/core-user.input.js +1 -1
- package/dist/core/modules/user/inputs/core-user.input.js.map +1 -1
- package/dist/core.module.js +20 -20
- package/dist/core.module.js.map +1 -1
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/server/common/models/persistence.model.d.ts +24 -0
- package/dist/server/common/models/persistence.model.js +4 -4
- package/dist/server/common/models/persistence.model.js.map +1 -1
- package/dist/server/common/services/cron-jobs.service.js.map +1 -1
- package/dist/server/modules/auth/auth.controller.js.map +1 -1
- package/dist/server/modules/auth/auth.model.js.map +1 -1
- package/dist/server/modules/auth/auth.module.js +2 -2
- package/dist/server/modules/auth/auth.module.js.map +1 -1
- package/dist/server/modules/auth/auth.resolver.js.map +1 -1
- package/dist/server/modules/auth/auth.service.js +1 -1
- package/dist/server/modules/auth/auth.service.js.map +1 -1
- package/dist/server/modules/auth/inputs/auth-sign-in.input.js.map +1 -1
- package/dist/server/modules/auth/inputs/auth-sign-up.input.js.map +1 -1
- package/dist/server/modules/file/file-info.model.js.map +1 -1
- package/dist/server/modules/file/file.controller.js.map +1 -1
- package/dist/server/modules/file/file.module.js +2 -2
- package/dist/server/modules/file/file.module.js.map +1 -1
- package/dist/server/modules/file/file.resolver.js +5 -5
- package/dist/server/modules/file/file.resolver.js.map +1 -1
- package/dist/server/modules/file/file.service.d.ts +24 -0
- package/dist/server/modules/file/file.service.js.map +1 -1
- package/dist/server/modules/file/multer-config.service.js +2 -2
- package/dist/server/modules/file/multer-config.service.js.map +1 -1
- package/dist/server/modules/user/avatar.controller.js.map +1 -1
- package/dist/server/modules/user/inputs/user-create.input.js.map +1 -1
- package/dist/server/modules/user/inputs/user.input.js.map +1 -1
- package/dist/server/modules/user/outputs/find-and-count-users-result.output.js.map +1 -1
- package/dist/server/modules/user/user.model.js +2 -2
- package/dist/server/modules/user/user.model.js.map +1 -1
- package/dist/server/modules/user/user.module.js +2 -2
- package/dist/server/modules/user/user.module.js.map +1 -1
- package/dist/server/modules/user/user.resolver.d.ts +1 -1
- package/dist/server/modules/user/user.resolver.js +1 -1
- package/dist/server/modules/user/user.resolver.js.map +1 -1
- package/dist/server/modules/user/user.service.d.ts +25 -1
- package/dist/server/modules/user/user.service.js +2 -2
- package/dist/server/modules/user/user.service.js.map +1 -1
- package/dist/server/server.controller.js.map +1 -1
- package/dist/server/server.module.js +2 -2
- package/dist/server/server.module.js.map +1 -1
- package/dist/test/test.helper.d.ts +13 -13
- package/dist/test/test.helper.js +15 -15
- package/dist/test/test.helper.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +35 -35
- package/src/config.env.ts +79 -78
- package/src/core/common/args/filter.args.ts +2 -1
- package/src/core/common/args/pagination.args.ts +1 -0
- package/src/core/common/decorators/current-user.decorator.ts +1 -0
- package/src/core/common/decorators/graphql-populate.decorator.ts +1 -0
- package/src/core/common/decorators/graphql-service-options.decorator.ts +1 -0
- package/src/core/common/decorators/restricted.decorator.ts +7 -5
- package/src/core/common/enums/comparison-operator.enum.ts +1 -1
- package/src/core/common/enums/logical-operator.enum.ts +1 -1
- package/src/core/common/enums/role.enum.ts +6 -6
- package/src/core/common/enums/sort-order.emum.ts +1 -1
- package/src/core/common/helpers/context.helper.ts +1 -1
- package/src/core/common/helpers/db.helper.ts +14 -12
- package/src/core/common/helpers/decorator.helper.ts +1 -0
- package/src/core/common/helpers/file.helper.ts +1 -1
- package/src/core/common/helpers/filter.helper.ts +6 -5
- package/src/core/common/helpers/graphql.helper.ts +7 -6
- package/src/core/common/helpers/input.helper.ts +10 -8
- package/src/core/common/helpers/model.helper.ts +6 -5
- package/src/core/common/helpers/service.helper.ts +13 -11
- package/src/core/common/helpers/table.helper.ts +12 -10
- package/src/core/common/inputs/combined-filter.input.ts +1 -0
- package/src/core/common/inputs/filter.input.ts +1 -0
- package/src/core/common/inputs/single-filter.input.ts +1 -0
- package/src/core/common/inputs/sort.input.ts +1 -0
- package/src/core/common/interceptors/check-response.interceptor.ts +1 -0
- package/src/core/common/interceptors/check-security.interceptor.ts +1 -0
- package/src/core/common/interfaces/core-persistence-model.interface.ts +3 -3
- package/src/core/common/interfaces/cron-job-config-with-time-zone.interface.ts +1 -0
- package/src/core/common/interfaces/cron-job-config-with-utc-offset.interface.ts +1 -0
- package/src/core/common/interfaces/mailjet-options.interface.ts +1 -1
- package/src/core/common/interfaces/prepare-input-options.interface.ts +1 -1
- package/src/core/common/interfaces/server-options.interface.ts +33 -24
- package/src/core/common/interfaces/service-options.interface.ts +31 -16
- package/src/core/common/models/core-persistence.model.ts +1 -0
- package/src/core/common/pipes/check-input.pipe.ts +1 -0
- package/src/core/common/pipes/map-and-validate.pipe.ts +1 -0
- package/src/core/common/plugins/complexity.plugin.ts +5 -4
- package/src/core/common/scalars/date-timestamp.scalar.ts +1 -0
- package/src/core/common/scalars/date.scalar.ts +1 -0
- package/src/core/common/services/brevo.service.ts +51 -6
- package/src/core/common/services/config.service.ts +3 -1
- package/src/core/common/services/core-cron-jobs.service.ts +3 -2
- package/src/core/common/services/crud.service.ts +70 -43
- package/src/core/common/services/email.service.ts +7 -5
- package/src/core/common/services/mailjet.service.ts +14 -13
- package/src/core/common/services/model-doc.service.ts +2 -1
- package/src/core/common/services/module.service.ts +18 -10
- package/src/core/common/services/template.service.ts +5 -3
- package/src/core/common/types/core-model-constructor.type.ts +1 -1
- package/src/core/common/types/falsy.type.ts +1 -1
- package/src/core/common/types/field-selection.type.ts +4 -3
- package/src/core/common/types/ids.type.ts +3 -3
- package/src/core/common/types/maybe-promise.type.ts +1 -1
- package/src/core/common/types/plain-input.type.ts +1 -1
- package/src/core/common/types/populate-config.type.ts +1 -1
- package/src/core/common/types/string-or-object-id.type.ts +1 -1
- package/src/core/modules/auth/core-auth.controller.ts +2 -1
- package/src/core/modules/auth/core-auth.model.ts +1 -0
- package/src/core/modules/auth/core-auth.module.ts +8 -7
- package/src/core/modules/auth/core-auth.resolver.ts +2 -1
- package/src/core/modules/auth/guards/auth.guard.ts +4 -2
- package/src/core/modules/auth/guards/refresh-token.guard.ts +1 -0
- package/src/core/modules/auth/guards/roles.guard.ts +1 -0
- package/src/core/modules/auth/inputs/core-auth-sign-in.input.ts +1 -0
- package/src/core/modules/auth/inputs/core-auth-sign-up.input.ts +1 -0
- package/src/core/modules/auth/interfaces/core-auth-user.interface.ts +4 -4
- package/src/core/modules/auth/interfaces/core-token-data.interface.ts +4 -4
- package/src/core/modules/auth/interfaces/jwt-payload.interface.ts +1 -1
- package/src/core/modules/auth/services/core-auth.service.ts +13 -11
- package/src/core/modules/auth/strategies/jwt-refresh.strategy.ts +3 -2
- package/src/core/modules/auth/strategies/jwt.strategy.ts +3 -2
- package/src/core/modules/auth/tokens.decorator.ts +4 -3
- package/src/core/modules/file/core-file-info.model.ts +6 -5
- package/src/core/modules/file/core-file.controller.ts +1 -0
- package/src/core/modules/file/core-file.resolver.ts +2 -1
- package/src/core/modules/file/core-file.service.ts +9 -8
- package/src/core/modules/file/interfaces/file-service-options.interface.ts +1 -1
- package/src/core/modules/file/interfaces/file-upload.interface.ts +2 -2
- package/src/core/modules/health-check/core-health-check-result.model.ts +1 -0
- package/src/core/modules/health-check/core-health-check.controller.ts +1 -0
- package/src/core/modules/health-check/core-health-check.module.ts +2 -1
- package/src/core/modules/health-check/core-health-check.resolver.ts +3 -2
- package/src/core/modules/health-check/core-health-check.service.ts +2 -1
- package/src/core/modules/user/core-user.model.ts +2 -1
- package/src/core/modules/user/core-user.service.ts +6 -4
- package/src/core/modules/user/inputs/core-user-create.input.ts +2 -1
- package/src/core/modules/user/inputs/core-user.input.ts +2 -1
- package/src/core.module.ts +24 -22
- package/src/main.ts +5 -3
- package/src/server/common/models/persistence.model.ts +7 -5
- package/src/server/common/services/cron-jobs.service.ts +1 -0
- package/src/server/modules/auth/auth.controller.ts +1 -0
- package/src/server/modules/auth/auth.model.ts +1 -0
- package/src/server/modules/auth/auth.module.ts +3 -2
- package/src/server/modules/auth/auth.resolver.ts +1 -0
- package/src/server/modules/auth/auth.service.ts +2 -1
- package/src/server/modules/auth/inputs/auth-sign-in.input.ts +1 -0
- package/src/server/modules/auth/inputs/auth-sign-up.input.ts +1 -0
- package/src/server/modules/file/file-info.model.ts +1 -0
- package/src/server/modules/file/file.controller.ts +1 -0
- package/src/server/modules/file/file.module.ts +3 -2
- package/src/server/modules/file/file.resolver.ts +7 -5
- package/src/server/modules/file/file.service.ts +1 -0
- package/src/server/modules/file/multer-config.service.ts +3 -2
- package/src/server/modules/user/avatar.controller.ts +1 -0
- package/src/server/modules/user/inputs/user-create.input.ts +1 -0
- package/src/server/modules/user/inputs/user.input.ts +1 -0
- package/src/server/modules/user/outputs/find-and-count-users-result.output.ts +1 -0
- package/src/server/modules/user/user.model.ts +3 -2
- package/src/server/modules/user/user.module.ts +3 -2
- package/src/server/modules/user/user.resolver.ts +2 -1
- package/src/server/modules/user/user.service.ts +5 -3
- package/src/server/server.controller.ts +1 -0
- package/src/server/server.module.ts +7 -6
- package/src/test/test.helper.ts +28 -26
|
@@ -10,16 +10,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CoreAuthService = void 0;
|
|
13
|
-
const crypto_1 = require("crypto");
|
|
14
13
|
const common_1 = require("@nestjs/common");
|
|
15
14
|
const jwt_1 = require("@nestjs/jwt");
|
|
16
|
-
const
|
|
15
|
+
const crypto_1 = require("crypto");
|
|
17
16
|
const js_sha256_1 = require("js-sha256");
|
|
18
17
|
const db_helper_1 = require("../../../common/helpers/db.helper");
|
|
19
18
|
const service_helper_1 = require("../../../common/helpers/service.helper");
|
|
20
19
|
const config_service_1 = require("../../../common/services/config.service");
|
|
21
20
|
const core_auth_model_1 = require("../core-auth.model");
|
|
22
21
|
const core_auth_user_service_1 = require("./core-auth-user.service");
|
|
22
|
+
const bcrypt = require("bcrypt");
|
|
23
23
|
let CoreAuthService = class CoreAuthService {
|
|
24
24
|
constructor(userService, jwtService, configService) {
|
|
25
25
|
this.userService = userService;
|
|
@@ -48,8 +48,8 @@ let CoreAuthService = class CoreAuthService {
|
|
|
48
48
|
return true;
|
|
49
49
|
}
|
|
50
50
|
async refreshTokens(user, currentRefreshToken) {
|
|
51
|
-
const {
|
|
52
|
-
const tokens = await this.createTokens(user.id, {
|
|
51
|
+
const { deviceDescription, deviceId } = this.decodeJwt(currentRefreshToken);
|
|
52
|
+
const tokens = await this.createTokens(user.id, { deviceDescription, deviceId });
|
|
53
53
|
tokens.refreshToken = await this.updateRefreshToken(user, currentRefreshToken, tokens.refreshToken);
|
|
54
54
|
return core_auth_model_1.CoreAuthModel.map({
|
|
55
55
|
...tokens,
|
|
@@ -61,7 +61,7 @@ let CoreAuthService = class CoreAuthService {
|
|
|
61
61
|
prepareOutput: null,
|
|
62
62
|
subFieldSelection: 'user',
|
|
63
63
|
});
|
|
64
|
-
const {
|
|
64
|
+
const { deviceDescription, deviceId, email, password } = input;
|
|
65
65
|
const user = await this.userService.getViaEmail(email, serviceOptionsForUserService);
|
|
66
66
|
if (!user) {
|
|
67
67
|
throw new common_1.UnauthorizedException('Unknown email');
|
|
@@ -69,7 +69,7 @@ let CoreAuthService = class CoreAuthService {
|
|
|
69
69
|
if (!((await bcrypt.compare(password, user.password)) || (await bcrypt.compare((0, js_sha256_1.sha256)(password), user.password)))) {
|
|
70
70
|
throw new common_1.UnauthorizedException('Wrong password');
|
|
71
71
|
}
|
|
72
|
-
return this.getResult(user, {
|
|
72
|
+
return this.getResult(user, { deviceDescription, deviceId });
|
|
73
73
|
}
|
|
74
74
|
async signUp(input, serviceOptions) {
|
|
75
75
|
const serviceOptionsForUserService = (0, service_helper_1.prepareServiceOptions)(serviceOptions, {
|
|
@@ -80,8 +80,8 @@ let CoreAuthService = class CoreAuthService {
|
|
|
80
80
|
if (!user) {
|
|
81
81
|
throw new common_1.BadRequestException('Email address already in use');
|
|
82
82
|
}
|
|
83
|
-
const {
|
|
84
|
-
return this.getResult(user, {
|
|
83
|
+
const { deviceDescription, deviceId } = input;
|
|
84
|
+
return this.getResult(user, { deviceDescription, deviceId });
|
|
85
85
|
}
|
|
86
86
|
catch (err) {
|
|
87
87
|
if (err?.message === 'Unprocessable Entity') {
|
|
@@ -129,8 +129,8 @@ let CoreAuthService = class CoreAuthService {
|
|
|
129
129
|
}
|
|
130
130
|
const payload = {
|
|
131
131
|
...data,
|
|
132
|
-
id: userId,
|
|
133
132
|
deviceId,
|
|
133
|
+
id: userId,
|
|
134
134
|
tokenId,
|
|
135
135
|
};
|
|
136
136
|
const [token, refreshToken] = await Promise.all([
|
|
@@ -144,8 +144,8 @@ let CoreAuthService = class CoreAuthService {
|
|
|
144
144
|
}),
|
|
145
145
|
]);
|
|
146
146
|
return {
|
|
147
|
-
token,
|
|
148
147
|
refreshToken,
|
|
148
|
+
token,
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
async updateRefreshToken(user, currentRefreshToken, newRefreshToken, data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-auth.service.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/services/core-auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"core-auth.service.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/services/core-auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwF;AACxF,qCAAyC;AACzC,mCAAoC;AACpC,yCAAmC;AAEnC,iEAAiE;AACjE,2EAA+E;AAE/E,4EAAwE;AACxE,wDAAmD;AAKnD,qEAA+D;AAE/D,iCAAkC;AAM3B,IAAM,eAAe,GAArB,MAAM,eAAe;IAI1B,YACqB,WAAgC,EAChC,UAAsB,EACtB,aAA4B;QAF5B,gBAAW,GAAX,WAAW,CAAqB;QAChC,eAAU,GAAV,UAAU,CAAY;QACtB,kBAAa,GAAb,aAAa,CAAe;IAC9C,CAAC;IAKJ,SAAS,CAAC,KAAa;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAe,CAAC;IACrD,CAAC;IAKD,KAAK,CAAC,MAAM,CACV,mBAA2B,EAC3B,cAAyD;QAGzD,MAAM,IAAI,GAAG,cAAc,CAAC,WAAW,CAAC;QACxC,IAAI,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAqB,CAAC,eAAe,CAAC,CAAC;QACnD,CAAC;QAGD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,QAAQ,CAAC;QAC/D,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,8BAAqB,CAAC,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ken(),
|
|
26
26
|
]),
|
|
27
|
+
passReqToCallback: true,
|
|
27
28
|
privateKey: configService.get('jwt.refresh.privateKey'),
|
|
28
29
|
publicKey: configService.get('jwt.refresh.publicKey'),
|
|
29
30
|
secret: configService.get('jwt.refresh.secret') || configService.get('jwt.refresh.secretOrPrivateKey'),
|
|
30
31
|
secretOrKey: configService.get('jwt.refresh.secretOrPrivateKey') || configService.get('jwt.refresh.secret'),
|
|
31
32
|
secretOrKeyProvider: configService.get('jwt.refresh.secretOrKeyProvider'),
|
|
32
|
-
passReqToCallback: true,
|
|
33
33
|
});
|
|
34
34
|
this.authService = authService;
|
|
35
35
|
this.configService = configService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt-refresh.strategy.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/strategies/jwt-refresh.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAmE;AACnE,+CAAoD;AAEpD,+CAAoD;
|
|
1
|
+
{"version":3,"file":"jwt-refresh.strategy.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/strategies/jwt-refresh.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAmE;AACnE,+CAAoD;AAEpD,+CAAoD;AAEpD,4EAAwE;AACxE,0EAAgE;AAChE,qEAAgE;AAGzD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAmB,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,EAAE,4CAAiB,CAAC,WAAW,CAAC;IAC/F,YAA+B,WAA4B,EAAqB,aAA4B;QAC1G,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,cAAc,CAAC;gBACxC,oBAAkB,CAAC,oBAAoB;gBACvC,yBAAU,CAAC,2BAA2B,EAAE;aACzC,CAAC;YACF,iBAAiB,EAAE,IAAI;YACvB,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,wBAAwB,CAAC;YACvD,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,uBAAuB,CAAC;YACrD,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,gCAAgC,CAAC;YACtG,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,gCAAgC,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,oBAAoB,CAAC;YAC3G,mBAAmB,EAAE,aAAa,CAAC,GAAG,CAAC,iCAAiC,CAAC;SAC1E,CAAC,CAAC;QAZ0B,gBAAW,GAAX,WAAW,CAAiB;QAAqB,kBAAa,GAAb,aAAa,CAAe;IAa5G,CAAC;IAKO,MAAM,CAAC,oBAAoB,CAAC,GAAgB;QAClD,OAAO,GAAG,EAAE,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC;IAC5C,CAAC;IAKD,KAAK,CAAC,QAAQ,CAAC,GAAY,EAAE,OAAY;QAEvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,8BAAqB,CAAC,cAAc,CAAC,CAAC;QAClD,CAAC;QAGD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AApCY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAEiC,mCAAe,EAAoC,8BAAa;GADjG,kBAAkB,CAoC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/strategies/jwt.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAmE;AACnE,+CAAoD;
|
|
1
|
+
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/strategies/jwt.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAmE;AACnE,+CAAoD;AAEpD,+CAAoD;AAEpD,4EAAwE;AACx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Aa;GAJjG,WAAW,CAmCvB"}
|
|
@@ -11,7 +11,7 @@ exports.Tokens = (0, common_1.createParamDecorator)((tokenId, ctx) => {
|
|
|
11
11
|
?.replace(/bearer/i, '')
|
|
12
12
|
.trim();
|
|
13
13
|
const refreshToken = context?.request?.cookies?.['refreshToken'] || token;
|
|
14
|
-
const tokens = {
|
|
14
|
+
const tokens = { refreshToken, token };
|
|
15
15
|
if (tokenId?.length) {
|
|
16
16
|
return tokens[tokenId];
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.decorator.js","sourceRoot":"","sources":["../../../../src/core/modules/auth/tokens.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;
|
|
1
|
+
{"version":3,"file":"tokens.decorator.js","sourceRoot":"","sources":["../../../../src/core/modules/auth/tokens.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAExE,wEAAqE;AAKxD,QAAA,MAAM,GAAG,IAAA,6BAAoB,EACxC,CACE,OAA6C,EAC7C,GAAqB,EAC6B,EAAE;IAEpD,MAAM,OAAO,GAAG,IAAA,+BAAc,EAAC,GAAG,CAAC,CAAC;IAGpC,MAAM,KAAK,GACP,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC;WACnC,OAAO,EAAE,OAAO;YACjB,EAAE,GAAG,CAAC,eAAe,CAAC;YACtB,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;aACvB,IAAI,EAAE,CAAC;IAGZ,MAAM,YAAY,GAAG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;IAG1E,MAAM,MAAM,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IAGvC,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CACF,CAAC"}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Types } from 'mongoose';
|
|
2
26
|
import { CoreModel } from '../../common/models/core-model.model';
|
|
3
27
|
export declare class CoreFileInfo extends CoreModel {
|
|
@@ -39,27 +39,27 @@ __decorate([
|
|
|
39
39
|
+ 'except for the last, which is only as large as needed. The default size is 255 kilobytes (kB)',
|
|
40
40
|
nullable: true,
|
|
41
41
|
}),
|
|
42
|
-
(0, mongoose_1.Prop)({
|
|
42
|
+
(0, mongoose_1.Prop)({ required: false, type: Number }),
|
|
43
43
|
__metadata("design:type", Number)
|
|
44
44
|
], CoreFileInfo.prototype, "chunkSize", void 0);
|
|
45
45
|
__decorate([
|
|
46
46
|
(0, graphql_1.Field)(() => String, { description: 'Content type', nullable: true }),
|
|
47
|
-
(0, mongoose_1.Prop)({
|
|
47
|
+
(0, mongoose_1.Prop)({ required: false, type: String }),
|
|
48
48
|
__metadata("design:type", String)
|
|
49
49
|
], CoreFileInfo.prototype, "contentType", void 0);
|
|
50
50
|
__decorate([
|
|
51
51
|
(0, graphql_1.Field)(() => String, { description: 'Name of the file', nullable: true }),
|
|
52
|
-
(0, mongoose_1.Prop)({
|
|
52
|
+
(0, mongoose_1.Prop)({ required: false, type: String }),
|
|
53
53
|
__metadata("design:type", String)
|
|
54
54
|
], CoreFileInfo.prototype, "filename", void 0);
|
|
55
55
|
__decorate([
|
|
56
56
|
(0, graphql_1.Field)(() => Number, { description: 'The size of the document in bytes', nullable: true }),
|
|
57
|
-
(0, mongoose_1.Prop)({
|
|
57
|
+
(0, mongoose_1.Prop)({ required: false, type: Number }),
|
|
58
58
|
__metadata("design:type", Number)
|
|
59
59
|
], CoreFileInfo.prototype, "length", void 0);
|
|
60
60
|
__decorate([
|
|
61
61
|
(0, graphql_1.Field)(() => Date, { description: 'The date the file was first stored', nullable: true }),
|
|
62
|
-
(0, mongoose_1.Prop)({
|
|
62
|
+
(0, mongoose_1.Prop)({ required: false, type: Date }),
|
|
63
63
|
__metadata("design:type", Date)
|
|
64
64
|
], CoreFileInfo.prototype, "uploadDate", void 0);
|
|
65
65
|
exports.CoreFileInfo = CoreFileInfo = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-file-info.model.js","sourceRoot":"","sources":["../../../../src/core/modules/file/core-file-info.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAoD;AACpD,+CAAwC;AACxC,uCAAiC;
|
|
1
|
+
{"version":3,"file":"core-file-info.model.js","sourceRoot":"","sources":["../../../../src/core/modules/file/core-file-info.model.ts"],"names":[],"mappings":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ACV;AAI9B;IAFC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzF,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACb;AAI3B;IAFC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,oCAAoC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxF,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BAC1B,IAAI;gDAAa;uBAvClB,YAAY;IADxB,IAAA,oBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,YAAY,CAwCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-file.controller.js","sourceRoot":"","sources":["../../../../src/core/modules/file/core-file.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAqG;
|
|
1
|
+
{"version":3,"file":"core-file.controller.js","sourceRoot":"","sources":["../../../../src/core/modules/file/core-file.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAqG;AAErG,2DAAsD;AAM/C,IAAe,kBAAkB,GAAjC,MAAe,kBAAkB;IAItC,YAAgC,WAA4B;QAA5B,gBAAW,GAAX,WAAW,CAAiB;IAAG,CAAC;IAM1D,AAAN,KAAK,CAAC,OAAO,CAAoB,QAAgB,EAAS,GAAG;QAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,4BAAmB,CAAC,+BAA+B,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,0BAAiB,CAAC,gBAAgB,CAAC,CAAC;QAChD,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjE,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7C,GAAG,CAAC,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;CACF,CAAA;AAxBqB,gDAAkB;AAUhC;IADL,IAAA,YAAG,EAAC,WAAW,CAAC;IACF,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IAAoB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;iDAaxD;6BAvBmB,kBAAkB;IADvC,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAK2B,mCAAe;GAJxC,kBAAkB,CAwBvC"}
|
|
@@ -15,8 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.CoreFileResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const GraphQLUpload = require("graphql-upload/GraphQLUpload.js");
|
|
18
|
-
const core_file_info_model_1 = require("./core-file-info.model");
|
|
19
18
|
const core_file_service_1 = require("./core-file.service");
|
|
19
|
+
const core_file_info_model_1 = require("./core-file-info.model");
|
|
20
20
|
let CoreFileResolver = class CoreFileResolver {
|
|
21
21
|
constructor(fileService) {
|
|
22
22
|
this.fileService = fileService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-file.resolver.js","sourceRoot":"","sources":["../../../../src/core/modules/file/core-file.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,iEAAiE;
|
|
1
|
+
{"version":3,"file":"core-file.resolver.js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BAAQ,EAAC,GAAG,EAAE,CAAC,mCAAY,CAAC;IACX,WAAA,IAAA,cAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CAAA;;;;kDAElE;AAMK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,CAAC,mCAAY,CAAC,CAAC;IACZ,WAAA,IAAA,cAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;;;;mDAEtE;2BA5CU,gBAAgB;IAD5B,IAAA,kBAAQ,GAAE;qCAKmC,mCAAe;GAJhD,gBAAgB,CA6C5B"}
|
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
3
|
+
/// <reference types="mongoose/types/callback" />
|
|
4
|
+
/// <reference types="mongoose/types/collection" />
|
|
5
|
+
/// <reference types="mongoose/types/connection" />
|
|
6
|
+
/// <reference types="mongoose/types/cursor" />
|
|
7
|
+
/// <reference types="mongoose/types/document" />
|
|
8
|
+
/// <reference types="mongoose/types/error" />
|
|
9
|
+
/// <reference types="mongoose/types/expressions" />
|
|
10
|
+
/// <reference types="mongoose/types/helpers" />
|
|
11
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
12
|
+
/// <reference types="mongoose/types/indexes" />
|
|
13
|
+
/// <reference types="mongoose/types/models" />
|
|
14
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
15
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
16
|
+
/// <reference types="mongoose/types/populate" />
|
|
17
|
+
/// <reference types="mongoose/types/query" />
|
|
18
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
19
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
20
|
+
/// <reference types="mongoose/types/session" />
|
|
21
|
+
/// <reference types="mongoose/types/types" />
|
|
22
|
+
/// <reference types="mongoose/types/utility" />
|
|
23
|
+
/// <reference types="mongoose/types/validation" />
|
|
24
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { MongooseGridFS } from '@lenne.tech/mongoose-gridfs';
|
|
2
27
|
import { GridFSBucket, GridFSBucketReadStream, GridFSBucketReadStreamOptions } from 'mongodb';
|
|
3
28
|
import { Connection, Types } from 'mongoose';
|
|
4
|
-
import { MongooseGridFS } from '@lenne.tech/mongoose-gridfs';
|
|
5
29
|
import { FilterArgs } from '../../common/args/filter.args';
|
|
6
30
|
import { MaybePromise } from '../../common/types/maybe-promise.type';
|
|
7
31
|
import { CoreFileInfo } from './core-file-info.model';
|
|
8
32
|
import { FileServiceOptions } from './interfaces/file-service-options.interface';
|
|
9
33
|
import { FileUpload } from './interfaces/file-upload.interface';
|
|
10
|
-
export type FileInputCheckType = 'file' | '
|
|
34
|
+
export type FileInputCheckType = 'file' | 'filename' | 'files' | 'filterArgs' | 'id';
|
|
11
35
|
export declare abstract class CoreFileService {
|
|
12
36
|
protected readonly connection: Connection;
|
|
13
37
|
files: GridFSBucket & MongooseGridFS;
|
|
@@ -15,13 +39,13 @@ export declare abstract class CoreFileService {
|
|
|
15
39
|
createFile(file: MaybePromise<FileUpload>, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo>;
|
|
16
40
|
createFiles(files: MaybePromise<FileUpload>[], serviceOptions?: FileServiceOptions): Promise<CoreFileInfo[]>;
|
|
17
41
|
findFileInfo(filterArgs?: FilterArgs, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo[]>;
|
|
18
|
-
getFileInfo(id:
|
|
42
|
+
getFileInfo(id: Types.ObjectId | string, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo>;
|
|
19
43
|
getFileInfoByName(filename: string, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo>;
|
|
20
|
-
getFileStream(id:
|
|
44
|
+
getFileStream(id: Types.ObjectId | string, serviceOptions?: FileServiceOptions): Promise<GridFSBucketReadStream>;
|
|
21
45
|
getFileStreamByName(filename: string, serviceOptions?: FileServiceOptions): Promise<GridFSBucketReadStreamOptions>;
|
|
22
|
-
getBuffer(id:
|
|
46
|
+
getBuffer(id: Types.ObjectId | string, serviceOptions?: FileServiceOptions): Promise<Buffer>;
|
|
23
47
|
getBufferByName(filename: string, serviceOptions?: FileServiceOptions): Promise<Buffer>;
|
|
24
|
-
deleteFile(id:
|
|
48
|
+
deleteFile(id: Types.ObjectId | string, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo>;
|
|
25
49
|
deleteFileByName(filename: string, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo>;
|
|
26
50
|
protected checkRights(input: any, options?: FileServiceOptions & {
|
|
27
51
|
checkInputType: FileInputCheckType;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoreFileService = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
4
|
const mongoose_gridfs_1 = require("@lenne.tech/mongoose-gridfs");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
6
|
const db_helper_1 = require("../../common/helpers/db.helper");
|
|
7
7
|
const filter_helper_1 = require("../../common/helpers/filter.helper");
|
|
8
8
|
const input_helper_1 = require("../../common/helpers/input.helper");
|
|
@@ -18,9 +18,9 @@ class CoreFileService {
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
return await new Promise(async (resolve, reject) => {
|
|
21
|
-
const {
|
|
21
|
+
const { createReadStream, encoding, filename, mimetype } = await file;
|
|
22
22
|
const readStream = createReadStream();
|
|
23
|
-
const options = {
|
|
23
|
+
const options = { contentType: mimetype, filename };
|
|
24
24
|
this.files.writeFile(options, readStream, (error, fileInfo) => {
|
|
25
25
|
error ? reject(error) : resolve(this.prepareOutput(fileInfo, serviceOptions));
|
|
26
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-file.service.js","sourceRoot":"","sources":["../../../../src/core/modules/file/core-file.service.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"core-file.service.js","sourceRoot":"","sources":["../../../../src/core/modules/file/core-file.service.ts"],"names":[],"mappings":";;;AAAA,iEAA+F;AAC/F,2CAAmD;AAKnD,8DAA4E;AAC5E,sEAA8E;AAC9E,oEAA0D;AAC1D,wEAAoE;AAEpE,iEAAsD;AAYtD,MAAsB,eAAe;IAMnC,YAAyC,UAAsB,EAAE,UAAU,GAAG,IAAI;QAAzC,eAAU,GAAV,UAAU,CAAY;QAC7D,IAAI,CAAC,KAAK,GAAG,IAAA,8BAAY,EAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;IACxD,CAAC;IAKD,KAAK,CAAC,UAAU,CAAC,IAA8B,EAAE,cAAmC;QAClF,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,GAAG,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;YACnF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YAEjD,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC;YACtE,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;YACtC,MAAM,OAAO,GAAuB,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;YACxE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;gBAC5D,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC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AKS,KAAK,CAAC,QAAuC;QACrD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBACxB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;oBAC7B,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAY,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACxC,QAAQ,CAAC,EAAE,GAAG,IAAA,wBAAY,EAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAlND,0CAkNC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Readable } from 'stream';
|
|
3
2
|
import { WriteStream } from 'fs-capacitor';
|
|
3
|
+
import { Readable } from 'stream';
|
|
4
4
|
export interface FileUpload {
|
|
5
5
|
capacitor: WriteStream;
|
|
6
6
|
createReadStream: (options?: {
|
|
7
|
-
encoding?: '
|
|
7
|
+
encoding?: 'ascii' | 'base64' | 'base64url' | 'hex' | 'latin1' | 'ucs2' | 'utf8' | 'utf8' | 'utf16le';
|
|
8
8
|
highWaterMark?: number;
|
|
9
9
|
}) => Readable;
|
|
10
10
|
encoding: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-health-check-result.model.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check-result.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAoD;
|
|
1
|
+
{"version":3,"file":"core-health-check-result.model.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check-result.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAoD;AAEpD,2EAAiE;AACjE,kEAAwD;AAMjD,IAAe,qBAAqB,GAApC,MAAe,qBAAsB,SAAQ,4BAAS;IAAtD;;QASL,WAAM,GAAqC,SAAS,CAAC;QASrD,SAAI,GAAS,SAAS,CAAC;QASvB,UAAK,GAAS,SAAS,CAAC;QASxB,YAAO,GAAS,SAAS,CAAC;IAC5B,CAAC;CAAA,CAAA;AArCqB,sDAAqB;AASzC;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDAC7B;AASrD;IAJC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAI,EAAE;QACnB,WAAW,EAAE,uFAAuF;QACpG,QAAQ,EAAE,IAAI;KACf,CAAC;8BACI,kBAAI;mDAAa;AASvB;IAJC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAI,EAAE;QACnB,WAAW,EAAE,0FAA0F;QACvG,QAAQ,EAAE,IAAI;KACf,CAAC;8BACK,kBAAI;oDAAa;AASxB;IAJC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAI,EAAE;QACnB,WAAW,EAAE,mEAAmE;QAChF,QAAQ,EAAE,KAAK;KAChB,CAAC;8BACO,kBAAI;sDAAa;gCApCN,qBAAqB;IAD1C,IAAA,oBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GAC7B,qBAAqB,CAqC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-health-check.controller.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;
|
|
1
|
+
{"version":3,"file":"core-health-check.controller.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AAEjD,2EAAqE;AAO9D,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAA+B,kBAA0C;QAA1C,uBAAkB,GAAlB,kBAAkB,CAAwB;IAAG,CAAC;IAWvE,AAAN,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,CAAC;IAC/C,CAAC;CACF,CAAA;AAfY,8DAAyB;AAY9B;IADL,IAAA,YAAG,EAAC,cAAc,CAAC;;;;4DAGnB;oCAdU,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEwC,kDAAsB;GAD9D,yBAAyB,CAerC"}
|
|
@@ -17,8 +17,8 @@ let CoreHealthCheckModule = class CoreHealthCheckModule {
|
|
|
17
17
|
exports.CoreHealthCheckModule = CoreHealthCheckModule;
|
|
18
18
|
exports.CoreHealthCheckModule = CoreHealthCheckModule = __decorate([
|
|
19
19
|
(0, common_1.Module)({
|
|
20
|
-
imports: [terminus_1.TerminusModule],
|
|
21
20
|
controllers: [core_health_check_controller_1.CoreHealthCheckController],
|
|
21
|
+
imports: [terminus_1.TerminusModule],
|
|
22
22
|
providers: [core_health_check_service_1.CoreHealthCheckService, core_health_check_resolver_1.CoreHealthCheckResolver],
|
|
23
23
|
})
|
|
24
24
|
], CoreHealthCheckModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-health-check.module.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;
|
|
1
|
+
{"version":3,"file":"core-health-check.module.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAElD,iFAA2E;AAC3E,6EAAuE;AACvE,2EAAqE;AAW9D,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CACjC,CAAA;AADY,sDAAqB;gCAArB,qBAAqB;IALjC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,wDAAyB,CAAC;QACxC,OAAO,EAAE,CAAC,yBAAc,CAAC;QACzB,SAAS,EAAE,CAAC,kDAAsB,EAAE,oDAAuB,CAAC;KAC7D,CAAC;GACW,qBAAqB,CACjC"}
|
|
@@ -11,10 +11,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CoreHealthCheckResolver = void 0;
|
|
13
13
|
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
-
const role_enum_1 = require("../../common/enums/role.enum");
|
|
15
14
|
const roles_decorator_1 = require("../../common/decorators/roles.decorator");
|
|
16
|
-
const
|
|
15
|
+
const role_enum_1 = require("../../common/enums/role.enum");
|
|
17
16
|
const core_health_check_service_1 = require("./core-health-check.service");
|
|
17
|
+
const core_health_check_result_model_1 = require("./core-health-check-result.model");
|
|
18
18
|
let CoreHealthCheckResolver = class CoreHealthCheckResolver {
|
|
19
19
|
constructor(healthCheckService) {
|
|
20
20
|
this.healthCheckService = healthCheckService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-health-check.resolver.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkD;
|
|
1
|
+
{"version":3,"file":"core-health-check.resolver.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkD;AAElD,6EAAgE;AAChE,4DAAwD;AACxD,2EAAqE;AACrE,qFAAyE;AAQlE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAIlC,YAA+B,kBAA0C;QAA1C,uBAAkB,GAAlB,kBAAkB,CAAwB;IACzE,CAAC;IAWK,AAAN,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,CAAC;IAC/C,CAAC;CACF,CAAA;AAnBY,0DAAuB;AAgB5B;IAFL,IAAA,uBAAK,EAAC,oBAAQ,CAAC,UAAU,CAAC;IAC1B,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,sDAAqB,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;;;0DAG9E;kCAlBU,uBAAuB;IAFnC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,sDAAqB,CAAC;IACrC,IAAA,uBAAK,EAAC,oBAAQ,CAAC,KAAK,CAAC;qCAK+B,kDAAsB;GAJ9D,uBAAuB,CAmBnC"}
|
|
@@ -34,8 +34,8 @@ let CoreHealthCheckService = class CoreHealthCheckService {
|
|
|
34
34
|
}
|
|
35
35
|
if (this.config.get('healthCheck.configs.storage.enabled')) {
|
|
36
36
|
healthIndicatorFunctions.push(() => this.disk.checkStorage(this.config.get('healthCheck.configs.storage.key') ?? 'storage', this.config.get('healthCheck.configs.storage.options') ?? {
|
|
37
|
-
thresholdPercent: 0.8,
|
|
38
37
|
path: '/',
|
|
38
|
+
thresholdPercent: 0.8,
|
|
39
39
|
}));
|
|
40
40
|
}
|
|
41
41
|
return this.health.check(healthIndicatorFunctions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-health-check.service.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAK0B;
|
|
1
|
+
{"version":3,"file":"core-health-check.service.js","sourceRoot":"","sources":["../../../../src/core/modules/health-check/core-health-check.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAK0B;AAI1B,yEAAqE;AAO9D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAEjC,YACY,MAAqB,EACrB,EAA2B,EAC3B,IAAyB,EACzB,MAA0B,EAC1B,MAA6B;QAJ7B,WAAM,GAAN,MAAM,CAAe;QACrB,OAAE,GAAF,EAAE,CAAyB;QAC3B,SAAI,GAAJ,IAAI,CAAqB;QACzB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AqC,CAAC,EAAE,CAAC;YACpE,wBAAwB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CACxD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,iCAAiC,CAAC,IAAI,SAAS,EACvE,IAAI,CAAC,MAAM,CAAC,GAAG,CAA6B,qCAAqC,CAAC,IAAI;gBACpF,IAAI,EAAE,GAAG;gBACT,gBAAgB,EAAE,GAAG;aACtB,CACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACrD,CAAC;CACF,CAAA;AA7CY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAIS,8BAAa;QACjB,kCAAuB;QACrB,8BAAmB;QACjB,6BAAkB;QAClB,gCAAqB;GAP9B,sBAAsB,CA6ClC"}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Document } from 'mongoose';
|
|
2
26
|
import { CorePersistenceModel } from '../../common/models/core-persistence.model';
|
|
3
27
|
import { CoreTokenData } from '../auth/interfaces/core-token-data.interface';
|
|
@@ -62,7 +62,7 @@ exports.CoreUserModel = CoreUserModel;
|
|
|
62
62
|
__decorate([
|
|
63
63
|
(0, graphql_1.Field)({ description: 'Email of the user', nullable: true }),
|
|
64
64
|
(0, class_validator_1.IsEmail)(),
|
|
65
|
-
(0, mongoose_1.Prop)({
|
|
65
|
+
(0, mongoose_1.Prop)({ lowercase: true, trim: true, unique: true }),
|
|
66
66
|
__metadata("design:type", String)
|
|
67
67
|
], CoreUserModel.prototype, "email", void 0);
|
|
68
68
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-user.model.js","sourceRoot":"","sources":["../../../../src/core/modules/user/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAoD;AACpD,+CAAuE;AACvE,qDAAsD;
|
|
1
|
+
{"version":3,"file":"core-user.model.js","sourceRoot":"","sources":["../../../../src/core/modules/user/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAoD;AACpD,+CAAuE;AACvE,qDAAsD;AAGtD,uFAAkF;AAU3E,IAAe,aAAa,GAA5B,MAAe,aAAc,SAAQ,6CAAoB;IAAzD;;QAWL,UAAK,GAAW,SAAS,CAAC;QAQ1B,cAAS,GAAW,SAAS,CAAC;QAQ9B,aAAQ,GAAW,SAAS,CAAC;QAM7B,aAAQ,GAAW,SAAS,CAAC;QAQ7B,UAAK,GAAa,SAAS,CAAC;Q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A,eAAI,GAAE;;+CACsB;AAO7B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,eAAI,GAAE;;yDACgC;AASvC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,eAAI,EAAC,IAAA,cAAG,EAAC,EAAE,CAAC,CAAC;;oDAC2C;AAQzD;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,eAAI,EAAC,IAAA,cAAG,EAAC,EAAE,CAAC,CAAC;;iDACmF;AAOjG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,eAAI,GAAE;;wDAC+B;AAOtC;IAFC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzF,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;+CACM;AAO9B;IAFC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,IAAA,eAAI,GAAE;8BACK,IAAI;iDAAa;wBA9FT,aAAa;IAFlC,IAAA,oBAAU,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IACrD,IAAA,iBAAc,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GACf,aAAa,CAgJlC"}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import { Document, Model } from 'mongoose';
|
|
2
26
|
import { ServiceOptions } from '../../common/interfaces/service-options.interface';
|
|
3
27
|
import { ConfigService } from '../../common/services/config.service';
|
|
@@ -5,8 +29,8 @@ import { CrudService } from '../../common/services/crud.service';
|
|
|
5
29
|
import { EmailService } from '../../common/services/email.service';
|
|
6
30
|
import { CoreModelConstructor } from '../../common/types/core-model-constructor.type';
|
|
7
31
|
import { CoreUserModel } from './core-user.model';
|
|
8
|
-
import { CoreUserCreateInput } from './inputs/core-user-create.input';
|
|
9
32
|
import { CoreUserInput } from './inputs/core-user.input';
|
|
33
|
+
import { CoreUserCreateInput } from './inputs/core-user-create.input';
|
|
10
34
|
export declare abstract class CoreUserService<TUser extends CoreUserModel, TUserInput extends CoreUserInput, TUserCreateInput extends CoreUserCreateInput> extends CrudService<TUser, TUserCreateInput, TUserInput> {
|
|
11
35
|
protected readonly configService: ConfigService;
|
|
12
36
|
protected readonly emailService: EmailService;
|