@carlonicora/nestjs-neo4jsonapi 1.115.1 → 1.117.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/bootstrap/app.module.factory.d.ts.map +1 -1
- package/dist/bootstrap/app.module.factory.js +1 -0
- package/dist/bootstrap/app.module.factory.js.map +1 -1
- package/dist/bootstrap/bootstrap.options.d.ts +17 -0
- package/dist/bootstrap/bootstrap.options.d.ts.map +1 -1
- package/dist/common/guards/jwt.auth.admin.guard.d.ts +3 -2
- package/dist/common/guards/jwt.auth.admin.guard.d.ts.map +1 -1
- package/dist/common/guards/jwt.auth.admin.guard.js +19 -4
- package/dist/common/guards/jwt.auth.admin.guard.js.map +1 -1
- package/dist/common/guards/jwt.auth.guard.d.ts +3 -2
- package/dist/common/guards/jwt.auth.guard.d.ts.map +1 -1
- package/dist/common/guards/jwt.auth.guard.js +7 -2
- package/dist/common/guards/jwt.auth.guard.js.map +1 -1
- package/dist/common/interfaces/entity.schema.interface.d.ts +2 -0
- package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
- package/dist/common/tokens.d.ts +68 -0
- package/dist/common/tokens.d.ts.map +1 -1
- package/dist/common/tokens.js +37 -2
- package/dist/common/tokens.js.map +1 -1
- package/dist/config/base.config.d.ts.map +1 -1
- package/dist/config/base.config.js +9 -0
- package/dist/config/base.config.js.map +1 -1
- package/dist/config/enums/queue.id.d.ts +2 -1
- package/dist/config/enums/queue.id.d.ts.map +1 -1
- package/dist/config/enums/queue.id.js +1 -0
- package/dist/config/enums/queue.id.js.map +1 -1
- package/dist/config/interfaces/base.config.interface.d.ts +2 -0
- package/dist/config/interfaces/base.config.interface.d.ts.map +1 -1
- package/dist/config/interfaces/config.ai.interface.d.ts +8 -0
- package/dist/config/interfaces/config.ai.interface.d.ts.map +1 -1
- package/dist/config/interfaces/config.auth.interface.d.ts +7 -0
- package/dist/config/interfaces/config.auth.interface.d.ts.map +1 -1
- package/dist/config/interfaces/config.credits.interface.d.ts +24 -0
- package/dist/config/interfaces/config.credits.interface.d.ts.map +1 -0
- package/dist/{foundations/auth/entities/auth.entity.js → config/interfaces/config.credits.interface.js} +1 -1
- package/dist/config/interfaces/config.credits.interface.js.map +1 -0
- package/dist/config/interfaces/config.email.interface.d.ts +6 -0
- package/dist/config/interfaces/config.email.interface.d.ts.map +1 -1
- package/dist/config/interfaces/index.d.ts +1 -0
- package/dist/config/interfaces/index.d.ts.map +1 -1
- package/dist/config/interfaces/index.js +1 -0
- package/dist/config/interfaces/index.js.map +1 -1
- package/dist/core/email/services/email.service.d.ts +1 -0
- package/dist/core/email/services/email.service.d.ts.map +1 -1
- package/dist/core/email/services/email.service.js +10 -7
- package/dist/core/email/services/email.service.js.map +1 -1
- package/dist/core/llm/services/embedder.service.d.ts +36 -2
- package/dist/core/llm/services/embedder.service.d.ts.map +1 -1
- package/dist/core/llm/services/embedder.service.js +87 -7
- package/dist/core/llm/services/embedder.service.js.map +1 -1
- package/dist/core/llm/services/llm.service.d.ts +9 -1
- package/dist/core/llm/services/llm.service.d.ts.map +1 -1
- package/dist/core/llm/services/llm.service.js +13 -3
- package/dist/core/llm/services/llm.service.js.map +1 -1
- package/dist/core/neo4j/abstracts/abstract.repository.d.ts.map +1 -1
- package/dist/core/neo4j/abstracts/abstract.repository.js +33 -2
- package/dist/core/neo4j/abstracts/abstract.repository.js.map +1 -1
- package/dist/foundations/auth/auth.module.d.ts.map +1 -1
- package/dist/foundations/auth/auth.module.js +9 -10
- package/dist/foundations/auth/auth.module.js.map +1 -1
- package/dist/foundations/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/foundations/auth/controllers/auth.controller.js +5 -0
- package/dist/foundations/auth/controllers/auth.controller.js.map +1 -1
- package/dist/foundations/auth/controllers/auth.discord.controller.d.ts.map +1 -1
- package/dist/foundations/auth/controllers/auth.discord.controller.js +6 -3
- package/dist/foundations/auth/controllers/auth.discord.controller.js.map +1 -1
- package/dist/foundations/auth/controllers/auth.google.controller.d.ts.map +1 -1
- package/dist/foundations/auth/controllers/auth.google.controller.js +7 -3
- package/dist/foundations/auth/controllers/auth.google.controller.js.map +1 -1
- package/dist/foundations/auth/entities/auth.code.d.ts +34 -0
- package/dist/foundations/auth/entities/auth.code.d.ts.map +1 -0
- package/dist/foundations/auth/entities/auth.code.js +53 -0
- package/dist/foundations/auth/entities/auth.code.js.map +1 -0
- package/dist/foundations/auth/entities/auth.d.ts +41 -0
- package/dist/foundations/auth/entities/auth.d.ts.map +1 -0
- package/dist/foundations/auth/entities/auth.js +68 -0
- package/dist/foundations/auth/entities/auth.js.map +1 -0
- package/dist/foundations/auth/entities/pending-auth.d.ts +39 -0
- package/dist/foundations/auth/entities/pending-auth.d.ts.map +1 -0
- package/dist/foundations/auth/entities/pending-auth.js +41 -0
- package/dist/foundations/auth/entities/pending-auth.js.map +1 -0
- package/dist/foundations/auth/index.d.ts +13 -0
- package/dist/foundations/auth/index.d.ts.map +1 -1
- package/dist/foundations/auth/index.js +31 -1
- package/dist/foundations/auth/index.js.map +1 -1
- package/dist/foundations/auth/repositories/auth.repository.d.ts +49 -9
- package/dist/foundations/auth/repositories/auth.repository.d.ts.map +1 -1
- package/dist/foundations/auth/repositories/auth.repository.js +115 -63
- package/dist/foundations/auth/repositories/auth.repository.js.map +1 -1
- package/dist/foundations/auth/services/auth.discord.service.d.ts +1 -1
- package/dist/foundations/auth/services/auth.discord.service.d.ts.map +1 -1
- package/dist/foundations/auth/services/auth.discord.service.js +5 -2
- package/dist/foundations/auth/services/auth.discord.service.js.map +1 -1
- package/dist/foundations/auth/services/auth.google.service.d.ts +1 -1
- package/dist/foundations/auth/services/auth.google.service.d.ts.map +1 -1
- package/dist/foundations/auth/services/auth.google.service.js +6 -2
- package/dist/foundations/auth/services/auth.google.service.js.map +1 -1
- package/dist/foundations/auth/services/auth.service.d.ts +42 -7
- package/dist/foundations/auth/services/auth.service.d.ts.map +1 -1
- package/dist/foundations/auth/services/auth.service.js +140 -77
- package/dist/foundations/auth/services/auth.service.js.map +1 -1
- package/dist/foundations/company/dtos/company.post.dto.d.ts +3 -3
- package/dist/foundations/company/dtos/company.post.dto.d.ts.map +1 -1
- package/dist/foundations/company/dtos/company.post.dto.js +3 -3
- package/dist/foundations/company/dtos/company.post.dto.js.map +1 -1
- package/dist/foundations/company/dtos/company.put.dto.d.ts +3 -3
- package/dist/foundations/company/dtos/company.put.dto.d.ts.map +1 -1
- package/dist/foundations/company/dtos/company.put.dto.js +3 -3
- package/dist/foundations/company/dtos/company.put.dto.js.map +1 -1
- package/dist/foundations/company/entities/company.d.ts +4 -4
- package/dist/foundations/company/entities/company.d.ts.map +1 -1
- package/dist/foundations/company/entities/company.js +18 -4
- package/dist/foundations/company/entities/company.js.map +1 -1
- package/dist/foundations/company/index.d.ts +5 -0
- package/dist/foundations/company/index.d.ts.map +1 -1
- package/dist/foundations/company/index.js +16 -1
- package/dist/foundations/company/index.js.map +1 -1
- package/dist/foundations/company/processors/company.processor.js +1 -1
- package/dist/foundations/company/processors/company.processor.js.map +1 -1
- package/dist/foundations/company/repositories/company.repository.d.ts +96 -33
- package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
- package/dist/foundations/company/repositories/company.repository.js +125 -95
- package/dist/foundations/company/repositories/company.repository.js.map +1 -1
- package/dist/foundations/company/services/company.service.d.ts +52 -13
- package/dist/foundations/company/services/company.service.d.ts.map +1 -1
- package/dist/foundations/company/services/company.service.js +62 -39
- package/dist/foundations/company/services/company.service.js.map +1 -1
- package/dist/foundations/content/content.module.d.ts +20 -8
- package/dist/foundations/content/content.module.d.ts.map +1 -1
- package/dist/foundations/content/content.module.js +40 -24
- package/dist/foundations/content/content.module.js.map +1 -1
- package/dist/foundations/content/controllers/content.controller.d.ts +1 -1
- package/dist/foundations/content/controllers/content.controller.d.ts.map +1 -1
- package/dist/foundations/content/controllers/content.controller.js +2 -2
- package/dist/foundations/content/controllers/content.controller.js.map +1 -1
- package/dist/foundations/content/entities/content.d.ts +74 -0
- package/dist/foundations/content/entities/content.d.ts.map +1 -0
- package/dist/foundations/content/entities/content.js +141 -0
- package/dist/foundations/content/entities/content.js.map +1 -0
- package/dist/foundations/content/index.d.ts +2 -4
- package/dist/foundations/content/index.d.ts.map +1 -1
- package/dist/foundations/content/index.js +6 -5
- package/dist/foundations/content/index.js.map +1 -1
- package/dist/foundations/content/interfaces/content.extension.interface.d.ts +126 -0
- package/dist/foundations/content/interfaces/content.extension.interface.d.ts.map +1 -1
- package/dist/foundations/content/interfaces/content.extension.interface.js +7 -1
- package/dist/foundations/content/interfaces/content.extension.interface.js.map +1 -1
- package/dist/foundations/content/repositories/content.repository.d.ts +14 -7
- package/dist/foundations/content/repositories/content.repository.d.ts.map +1 -1
- package/dist/foundations/content/repositories/content.repository.js +18 -16
- package/dist/foundations/content/repositories/content.repository.js.map +1 -1
- package/dist/foundations/content/services/content.cypher.service.d.ts +19 -0
- package/dist/foundations/content/services/content.cypher.service.d.ts.map +1 -1
- package/dist/foundations/content/services/content.cypher.service.js +65 -4
- package/dist/foundations/content/services/content.cypher.service.js.map +1 -1
- package/dist/foundations/content/services/content.service.js +4 -4
- package/dist/foundations/content/services/content.service.js.map +1 -1
- package/dist/foundations/discord-user/services/discord-user.service.js +2 -2
- package/dist/foundations/discord-user/services/discord-user.service.js.map +1 -1
- package/dist/foundations/feature/entities/feature.d.ts +32 -0
- package/dist/foundations/feature/entities/feature.d.ts.map +1 -0
- package/dist/foundations/feature/entities/feature.js +64 -0
- package/dist/foundations/feature/entities/feature.js.map +1 -0
- package/dist/foundations/feature/entities/feature.model.d.ts +1 -3
- package/dist/foundations/feature/entities/feature.model.d.ts.map +1 -1
- package/dist/foundations/feature/entities/feature.model.js +3 -11
- package/dist/foundations/feature/entities/feature.model.js.map +1 -1
- package/dist/foundations/feature/feature.module.d.ts.map +1 -1
- package/dist/foundations/feature/feature.module.js +4 -5
- package/dist/foundations/feature/feature.module.js.map +1 -1
- package/dist/foundations/feature/index.d.ts +12 -0
- package/dist/foundations/feature/index.d.ts.map +1 -1
- package/dist/foundations/feature/index.js +22 -1
- package/dist/foundations/feature/index.js.map +1 -1
- package/dist/foundations/feature/repositories/feature.repository.d.ts +37 -13
- package/dist/foundations/feature/repositories/feature.repository.d.ts.map +1 -1
- package/dist/foundations/feature/repositories/feature.repository.js +41 -35
- package/dist/foundations/feature/repositories/feature.repository.js.map +1 -1
- package/dist/foundations/feature/services/feature.service.d.ts +31 -4
- package/dist/foundations/feature/services/feature.service.d.ts.map +1 -1
- package/dist/foundations/feature/services/feature.service.js +20 -12
- package/dist/foundations/feature/services/feature.service.js.map +1 -1
- package/dist/foundations/foundations.modules.d.ts +6 -0
- package/dist/foundations/foundations.modules.d.ts.map +1 -1
- package/dist/foundations/foundations.modules.js +14 -3
- package/dist/foundations/foundations.modules.js.map +1 -1
- package/dist/foundations/google-user/services/google-user.service.js +2 -2
- package/dist/foundations/google-user/services/google-user.service.js.map +1 -1
- package/dist/foundations/index.d.ts +3 -0
- package/dist/foundations/index.d.ts.map +1 -1
- package/dist/foundations/index.js +3 -0
- package/dist/foundations/index.js.map +1 -1
- package/dist/foundations/membership/entities/membership.d.ts.map +1 -1
- package/dist/foundations/membership/entities/membership.js +4 -0
- package/dist/foundations/membership/entities/membership.js.map +1 -1
- package/dist/foundations/notification/controllers/notification.controller.js +2 -2
- package/dist/foundations/notification/controllers/notification.controller.js.map +1 -1
- package/dist/foundations/notification/entities/notification.d.ts +75 -0
- package/dist/foundations/notification/entities/notification.d.ts.map +1 -0
- package/dist/foundations/notification/entities/notification.js +73 -0
- package/dist/foundations/notification/entities/notification.js.map +1 -0
- package/dist/foundations/notification/index.d.ts +6 -2
- package/dist/foundations/notification/index.d.ts.map +1 -1
- package/dist/foundations/notification/index.js +17 -3
- package/dist/foundations/notification/index.js.map +1 -1
- package/dist/foundations/notification/notification.module.d.ts.map +1 -1
- package/dist/foundations/notification/notification.module.js +3 -4
- package/dist/foundations/notification/notification.module.js.map +1 -1
- package/dist/foundations/notification/repositories/notification.repository.d.ts +125 -8
- package/dist/foundations/notification/repositories/notification.repository.d.ts.map +1 -1
- package/dist/foundations/notification/repositories/notification.repository.js +219 -20
- package/dist/foundations/notification/repositories/notification.repository.js.map +1 -1
- package/dist/foundations/notification/services/notification.service.d.ts +31 -5
- package/dist/foundations/notification/services/notification.service.d.ts.map +1 -1
- package/dist/foundations/notification/services/notification.service.js +26 -9
- package/dist/foundations/notification/services/notification.service.js.map +1 -1
- package/dist/foundations/rbac/dump.d.ts +48 -4
- package/dist/foundations/rbac/dump.d.ts.map +1 -1
- package/dist/foundations/rbac/dump.js +28 -4
- package/dist/foundations/rbac/dump.js.map +1 -1
- package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts +14 -0
- package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts.map +1 -1
- package/dist/foundations/rbac/serializer/matrix-to-ts.js +13 -3
- package/dist/foundations/rbac/serializer/matrix-to-ts.js.map +1 -1
- package/dist/foundations/referral/services/referral.service.js +4 -4
- package/dist/foundations/referral/services/referral.service.js.map +1 -1
- package/dist/foundations/relevancy/repositories/relevancy.repository.d.ts.map +1 -1
- package/dist/foundations/relevancy/repositories/relevancy.repository.js +13 -1
- package/dist/foundations/relevancy/repositories/relevancy.repository.js.map +1 -1
- package/dist/foundations/role/entities/role.d.ts +1 -1
- package/dist/foundations/role/entities/role.d.ts.map +1 -1
- package/dist/foundations/stripe/index.d.ts +3 -0
- package/dist/foundations/stripe/index.d.ts.map +1 -1
- package/dist/foundations/stripe/index.js +6 -0
- package/dist/foundations/stripe/index.js.map +1 -1
- package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts +1 -1
- package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/services/token-allocation.service.d.ts +1 -1
- package/dist/foundations/stripe-subscription/services/token-allocation.service.js +10 -10
- package/dist/foundations/stripe-subscription/services/token-allocation.service.js.map +1 -1
- package/dist/foundations/stripe-trial/services/trial.service.js +2 -2
- package/dist/foundations/stripe-trial/services/trial.service.js.map +1 -1
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js +2 -2
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js.map +1 -1
- package/dist/foundations/tokenusage/entities/tokenusage.d.ts +50 -0
- package/dist/foundations/tokenusage/entities/tokenusage.d.ts.map +1 -0
- package/dist/foundations/tokenusage/entities/tokenusage.js +68 -0
- package/dist/foundations/tokenusage/entities/tokenusage.js.map +1 -0
- package/dist/foundations/tokenusage/enums/tokenusage.type.d.ts +2 -1
- package/dist/foundations/tokenusage/enums/tokenusage.type.d.ts.map +1 -1
- package/dist/foundations/tokenusage/enums/tokenusage.type.js +1 -0
- package/dist/foundations/tokenusage/enums/tokenusage.type.js.map +1 -1
- package/dist/foundations/tokenusage/events/tokenusage.events.d.ts +2 -0
- package/dist/foundations/tokenusage/events/tokenusage.events.d.ts.map +1 -1
- package/dist/foundations/tokenusage/index.d.ts +3 -3
- package/dist/foundations/tokenusage/index.d.ts.map +1 -1
- package/dist/foundations/tokenusage/index.js +5 -3
- package/dist/foundations/tokenusage/index.js.map +1 -1
- package/dist/foundations/tokenusage/repositories/tokenusage.repository.d.ts +90 -5
- package/dist/foundations/tokenusage/repositories/tokenusage.repository.d.ts.map +1 -1
- package/dist/foundations/tokenusage/repositories/tokenusage.repository.js +165 -14
- package/dist/foundations/tokenusage/repositories/tokenusage.repository.js.map +1 -1
- package/dist/foundations/tokenusage/services/tokenusage.service.d.ts +73 -10
- package/dist/foundations/tokenusage/services/tokenusage.service.d.ts.map +1 -1
- package/dist/foundations/tokenusage/services/tokenusage.service.js +88 -8
- package/dist/foundations/tokenusage/services/tokenusage.service.js.map +1 -1
- package/dist/foundations/tokenusage/tokenusage.module.js +3 -3
- package/dist/foundations/tokenusage/tokenusage.module.js.map +1 -1
- package/dist/foundations/user/controllers/user.controller.js +4 -4
- package/dist/foundations/user/controllers/user.controller.js.map +1 -1
- package/dist/foundations/user/dtos/user.put.dto.d.ts +1 -1
- package/dist/foundations/user/dtos/user.put.dto.d.ts.map +1 -1
- package/dist/foundations/user/dtos/user.put.dto.js +1 -1
- package/dist/foundations/user/dtos/user.put.dto.js.map +1 -1
- package/dist/foundations/user/entities/user.d.ts +4 -0
- package/dist/foundations/user/entities/user.d.ts.map +1 -1
- package/dist/foundations/user/entities/user.js +18 -4
- package/dist/foundations/user/entities/user.js.map +1 -1
- package/dist/foundations/user/index.d.ts +6 -1
- package/dist/foundations/user/index.d.ts.map +1 -1
- package/dist/foundations/user/index.js +13 -1
- package/dist/foundations/user/index.js.map +1 -1
- package/dist/foundations/user/repositories/user.repository.d.ts +56 -11
- package/dist/foundations/user/repositories/user.repository.d.ts.map +1 -1
- package/dist/foundations/user/repositories/user.repository.js +55 -35
- package/dist/foundations/user/repositories/user.repository.js.map +1 -1
- package/dist/foundations/user/services/user.service.d.ts +48 -9
- package/dist/foundations/user/services/user.service.d.ts.map +1 -1
- package/dist/foundations/user/services/user.service.js +50 -32
- package/dist/foundations/user/services/user.service.js.map +1 -1
- package/dist/foundations/user-activity/entities/user-activity.d.ts +36 -0
- package/dist/foundations/user-activity/entities/user-activity.d.ts.map +1 -0
- package/dist/foundations/user-activity/entities/user-activity.js +86 -0
- package/dist/foundations/user-activity/entities/user-activity.js.map +1 -0
- package/dist/foundations/user-activity/entities/user-activity.meta.d.ts +3 -0
- package/dist/foundations/user-activity/entities/user-activity.meta.d.ts.map +1 -0
- package/dist/foundations/user-activity/entities/user-activity.meta.js +10 -0
- package/dist/foundations/user-activity/entities/user-activity.meta.js.map +1 -0
- package/dist/foundations/user-activity/index.d.ts +10 -0
- package/dist/foundations/user-activity/index.d.ts.map +1 -0
- package/dist/foundations/user-activity/index.js +22 -0
- package/dist/foundations/user-activity/index.js.map +1 -0
- package/dist/foundations/user-activity/interceptors/user-activity.interceptor.d.ts +29 -0
- package/dist/foundations/user-activity/interceptors/user-activity.interceptor.d.ts.map +1 -0
- package/dist/foundations/user-activity/interceptors/user-activity.interceptor.js +98 -0
- package/dist/foundations/user-activity/interceptors/user-activity.interceptor.js.map +1 -0
- package/dist/foundations/user-activity/interfaces/user-activity.config.interface.d.ts +67 -0
- package/dist/foundations/user-activity/interfaces/user-activity.config.interface.d.ts.map +1 -0
- package/dist/foundations/user-activity/interfaces/user-activity.config.interface.js +26 -0
- package/dist/foundations/user-activity/interfaces/user-activity.config.interface.js.map +1 -0
- package/dist/foundations/user-activity/interfaces/user-activity.record.input.d.ts +18 -0
- package/dist/foundations/user-activity/interfaces/user-activity.record.input.d.ts.map +1 -0
- package/dist/foundations/{auth/entities/pending-auth.entity.js → user-activity/interfaces/user-activity.record.input.js} +1 -1
- package/dist/foundations/user-activity/interfaces/user-activity.record.input.js.map +1 -0
- package/dist/foundations/user-activity/processors/user-activity.processor.d.ts +25 -0
- package/dist/foundations/user-activity/processors/user-activity.processor.d.ts.map +1 -0
- package/dist/foundations/user-activity/processors/user-activity.processor.js +74 -0
- package/dist/foundations/user-activity/processors/user-activity.processor.js.map +1 -0
- package/dist/foundations/user-activity/repositories/user-activity.repository.d.ts +47 -0
- package/dist/foundations/user-activity/repositories/user-activity.repository.d.ts.map +1 -0
- package/dist/foundations/user-activity/repositories/user-activity.repository.js +124 -0
- package/dist/foundations/user-activity/repositories/user-activity.repository.js.map +1 -0
- package/dist/foundations/user-activity/services/user-activity.service.d.ts +29 -0
- package/dist/foundations/user-activity/services/user-activity.service.d.ts.map +1 -0
- package/dist/foundations/user-activity/services/user-activity.service.js +61 -0
- package/dist/foundations/user-activity/services/user-activity.service.js.map +1 -0
- package/dist/foundations/user-activity/user-activity.module.d.ts +40 -0
- package/dist/foundations/user-activity/user-activity.module.d.ts.map +1 -0
- package/dist/foundations/user-activity/user-activity.module.js +99 -0
- package/dist/foundations/user-activity/user-activity.module.js.map +1 -0
- package/package.json +2 -1
- package/dist/foundations/auth/entities/auth.code.entity.d.ts +0 -7
- package/dist/foundations/auth/entities/auth.code.entity.d.ts.map +0 -1
- package/dist/foundations/auth/entities/auth.code.entity.js +0 -3
- package/dist/foundations/auth/entities/auth.code.entity.js.map +0 -1
- package/dist/foundations/auth/entities/auth.code.map.d.ts +0 -8
- package/dist/foundations/auth/entities/auth.code.map.d.ts.map +0 -1
- package/dist/foundations/auth/entities/auth.code.map.js +0 -13
- package/dist/foundations/auth/entities/auth.code.map.js.map +0 -1
- package/dist/foundations/auth/entities/auth.code.model.d.ts +0 -4
- package/dist/foundations/auth/entities/auth.code.model.d.ts.map +0 -1
- package/dist/foundations/auth/entities/auth.code.model.js +0 -13
- package/dist/foundations/auth/entities/auth.code.model.js.map +0 -1
- package/dist/foundations/auth/entities/auth.entity.d.ts +0 -18
- package/dist/foundations/auth/entities/auth.entity.d.ts.map +0 -1
- package/dist/foundations/auth/entities/auth.entity.js.map +0 -1
- package/dist/foundations/auth/entities/auth.map.d.ts +0 -8
- package/dist/foundations/auth/entities/auth.map.d.ts.map +0 -1
- package/dist/foundations/auth/entities/auth.map.js +0 -14
- package/dist/foundations/auth/entities/auth.map.js.map +0 -1
- package/dist/foundations/auth/entities/auth.model.d.ts +0 -4
- package/dist/foundations/auth/entities/auth.model.d.ts.map +0 -1
- package/dist/foundations/auth/entities/auth.model.js +0 -15
- package/dist/foundations/auth/entities/auth.model.js.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.entity.d.ts +0 -16
- package/dist/foundations/auth/entities/pending-auth.entity.d.ts.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.entity.js.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.map.d.ts +0 -6
- package/dist/foundations/auth/entities/pending-auth.map.d.ts.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.map.js +0 -20
- package/dist/foundations/auth/entities/pending-auth.map.js.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.model.d.ts +0 -9
- package/dist/foundations/auth/entities/pending-auth.model.d.ts.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.model.js +0 -19
- package/dist/foundations/auth/entities/pending-auth.model.js.map +0 -1
- package/dist/foundations/auth/serialisers/auth.serialiser.d.ts +0 -13
- package/dist/foundations/auth/serialisers/auth.serialiser.d.ts.map +0 -1
- package/dist/foundations/auth/serialisers/auth.serialiser.js +0 -52
- package/dist/foundations/auth/serialisers/auth.serialiser.js.map +0 -1
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts +0 -18
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts.map +0 -1
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.js +0 -49
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.js.map +0 -1
- package/dist/foundations/content/entities/content.entity.d.ts +0 -31
- package/dist/foundations/content/entities/content.entity.d.ts.map +0 -1
- package/dist/foundations/content/entities/content.entity.js +0 -3
- package/dist/foundations/content/entities/content.entity.js.map +0 -1
- package/dist/foundations/content/entities/content.map.d.ts +0 -8
- package/dist/foundations/content/entities/content.map.d.ts.map +0 -1
- package/dist/foundations/content/entities/content.map.js +0 -19
- package/dist/foundations/content/entities/content.map.js.map +0 -1
- package/dist/foundations/content/entities/content.model.d.ts +0 -4
- package/dist/foundations/content/entities/content.model.d.ts.map +0 -1
- package/dist/foundations/content/entities/content.model.js +0 -16
- package/dist/foundations/content/entities/content.model.js.map +0 -1
- package/dist/foundations/content/factories/content.model.factory.d.ts +0 -17
- package/dist/foundations/content/factories/content.model.factory.d.ts.map +0 -1
- package/dist/foundations/content/factories/content.model.factory.js +0 -65
- package/dist/foundations/content/factories/content.model.factory.js.map +0 -1
- package/dist/foundations/content/serialisers/content.serialiser.d.ts +0 -14
- package/dist/foundations/content/serialisers/content.serialiser.d.ts.map +0 -1
- package/dist/foundations/content/serialisers/content.serialiser.js +0 -78
- package/dist/foundations/content/serialisers/content.serialiser.js.map +0 -1
- package/dist/foundations/feature/entities/feature.entity.d.ts +0 -8
- package/dist/foundations/feature/entities/feature.entity.d.ts.map +0 -1
- package/dist/foundations/feature/entities/feature.entity.js +0 -3
- package/dist/foundations/feature/entities/feature.entity.js.map +0 -1
- package/dist/foundations/feature/entities/feature.map.d.ts +0 -8
- package/dist/foundations/feature/entities/feature.map.d.ts.map +0 -1
- package/dist/foundations/feature/entities/feature.map.js +0 -14
- package/dist/foundations/feature/entities/feature.map.js.map +0 -1
- package/dist/foundations/feature/serialisers/feature.serialiser.d.ts +0 -12
- package/dist/foundations/feature/serialisers/feature.serialiser.d.ts.map +0 -1
- package/dist/foundations/feature/serialisers/feature.serialiser.js +0 -45
- package/dist/foundations/feature/serialisers/feature.serialiser.js.map +0 -1
- package/dist/foundations/notification/entities/notification.entity.d.ts +0 -10
- package/dist/foundations/notification/entities/notification.entity.d.ts.map +0 -1
- package/dist/foundations/notification/entities/notification.entity.js +0 -3
- package/dist/foundations/notification/entities/notification.entity.js.map +0 -1
- package/dist/foundations/notification/entities/notification.map.d.ts +0 -8
- package/dist/foundations/notification/entities/notification.map.d.ts.map +0 -1
- package/dist/foundations/notification/entities/notification.map.js +0 -16
- package/dist/foundations/notification/entities/notification.map.js.map +0 -1
- package/dist/foundations/notification/entities/notification.model.d.ts +0 -4
- package/dist/foundations/notification/entities/notification.model.d.ts.map +0 -1
- package/dist/foundations/notification/entities/notification.model.js +0 -15
- package/dist/foundations/notification/entities/notification.model.js.map +0 -1
- package/dist/foundations/notification/interfaces/notification.service.interface.d.ts +0 -4
- package/dist/foundations/notification/interfaces/notification.service.interface.d.ts.map +0 -1
- package/dist/foundations/notification/interfaces/notification.service.interface.js +0 -3
- package/dist/foundations/notification/interfaces/notification.service.interface.js.map +0 -1
- package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts +0 -12
- package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts.map +0 -1
- package/dist/foundations/notification/serialisers/notifications.serialiser.js +0 -47
- package/dist/foundations/notification/serialisers/notifications.serialiser.js.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts +0 -11
- package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.entity.js +0 -3
- package/dist/foundations/tokenusage/entities/tokenusage.entity.js.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts +0 -8
- package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.map.js +0 -17
- package/dist/foundations/tokenusage/entities/tokenusage.map.js.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts +0 -4
- package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.model.js +0 -15
- package/dist/foundations/tokenusage/entities/tokenusage.model.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.put.dto.d.ts","sourceRoot":"","sources":["../../../../src/foundations/user/dtos/user.put.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,qBAAa,oBAAoB;IAG/B,KAAK,EAAE,MAAM,CAAC;IAId,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"user.put.dto.d.ts","sourceRoot":"","sources":["../../../../src/foundations/user/dtos/user.put.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,qBAAa,oBAAoB;IAG/B,KAAK,EAAE,MAAM,CAAC;IAId,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAIlB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,uBAAuB;IAIlC,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,qBAAa,cAAc;IAEzB,IAAI,EAAE,MAAM,CAAC;IAGb,EAAE,EAAE,MAAM,CAAC;IAKX,UAAU,EAAE,oBAAoB,CAAC;IAKjC,aAAa,EAAE,uBAAuB,CAAC;CACxC;AAED,qBAAa,UAAU;IAIrB,IAAI,EAAE,cAAc,CAAC;IAGrB,QAAQ,EAAE,GAAG,EAAE,CAAC;CACjB"}
|
|
@@ -23,7 +23,7 @@ __decorate([
|
|
|
23
23
|
__metadata("design:type", String)
|
|
24
24
|
], UserPutAttributesDTO.prototype, "email", void 0);
|
|
25
25
|
__decorate([
|
|
26
|
-
(0, class_validator_1.
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
27
|
(0, class_validator_1.IsString)(),
|
|
28
28
|
__metadata("design:type", String)
|
|
29
29
|
], UserPutAttributesDTO.prototype, "name", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.put.dto.js","sourceRoot":"","sources":["../../../../src/foundations/user/dtos/user.put.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAA8G;AAC9G,uDAA2D;AAC3D,6DAAyD;AAEzD,MAAa,oBAAoB;CA4BhC;AA5BD,oDA4BC;AAzBC;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;mDACG;AAId;IAFC,IAAA,
|
|
1
|
+
{"version":3,"file":"user.put.dto.js","sourceRoot":"","sources":["../../../../src/foundations/user/dtos/user.put.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAA8G;AAC9G,uDAA2D;AAC3D,6DAAyD;AAEzD,MAAa,oBAAoB;CA4BhC;AA5BD,oDA4BC;AAzBC;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;mDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACI;AAIf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAA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"many";
|
|
41
41
|
dtoKey: string;
|
|
42
|
+
readOnly: true;
|
|
42
43
|
};
|
|
43
44
|
company: {
|
|
44
45
|
model: import("../../../common").DataModelInterface<Company>;
|
|
@@ -62,6 +63,7 @@ export declare const OwnerDescriptor: import("../../../common").EntityDescriptor
|
|
|
62
63
|
relationship: string;
|
|
63
64
|
cardinality: "many";
|
|
64
65
|
dtoKey: string;
|
|
66
|
+
readOnly: true;
|
|
65
67
|
};
|
|
66
68
|
company: {
|
|
67
69
|
model: import("../../../common").DataModelInterface<Company>;
|
|
@@ -84,6 +86,7 @@ export declare const AssigneeDescriptor: import("../../../common").EntityDescrip
|
|
|
84
86
|
relationship: string;
|
|
85
87
|
cardinality: "many";
|
|
86
88
|
dtoKey: string;
|
|
89
|
+
readOnly: true;
|
|
87
90
|
};
|
|
88
91
|
company: {
|
|
89
92
|
model: import("../../../common").DataModelInterface<Company>;
|
|
@@ -106,6 +109,7 @@ export declare const AuthorDescriptor: import("../../../common").EntityDescripto
|
|
|
106
109
|
relationship: string;
|
|
107
110
|
cardinality: "many";
|
|
108
111
|
dtoKey: string;
|
|
112
|
+
readOnly: true;
|
|
109
113
|
};
|
|
110
114
|
company: {
|
|
111
115
|
model: import("../../../common").DataModelInterface<Company>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/foundations/user/entities/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAmC,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKhD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,K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B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAE1B,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;EAiFzB,CAAC;AAGH,MAAM,MAAM,kBAAkB,GAAG,OAAO,cAAc,CAAC;AAGvD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;EAA+C,CAAC;AAC5E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;EAAkD,CAAC;AAClF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;EAAgD,CAAC"}
|
|
@@ -22,7 +22,7 @@ exports.UserDescriptor = (0, common_1.defineEntity)()({
|
|
|
22
22
|
name: { type: "string" },
|
|
23
23
|
title: { type: "string" },
|
|
24
24
|
bio: { type: "string" },
|
|
25
|
-
password: { type: "string", excludeFromJsonApi: true },
|
|
25
|
+
password: { type: "string", excludeFromJsonApi: true, excludeFromSearch: true },
|
|
26
26
|
avatar: {
|
|
27
27
|
type: "string",
|
|
28
28
|
transform: async (data, services) => {
|
|
@@ -38,7 +38,8 @@ exports.UserDescriptor = (0, common_1.defineEntity)()({
|
|
|
38
38
|
isActive: { type: "boolean", meta: true },
|
|
39
39
|
lastLogin: { type: "datetime", meta: true },
|
|
40
40
|
isDeleted: { type: "boolean", meta: true },
|
|
41
|
-
code
|
|
41
|
+
// one-time invitation/reset code — never serialised, never indexed
|
|
42
|
+
code: { type: "string", excludeFromJsonApi: true, excludeFromSearch: true },
|
|
42
43
|
codeExpiration: { type: "datetime", excludeFromJsonApi: true },
|
|
43
44
|
termsAcceptedAt: { type: "datetime", excludeFromJsonApi: true },
|
|
44
45
|
marketingConsent: { type: "boolean", excludeFromJsonApi: true },
|
|
@@ -55,14 +56,27 @@ exports.UserDescriptor = (0, common_1.defineEntity)()({
|
|
|
55
56
|
// Serialisation-only: roles are hydrated through the Membership path
|
|
56
57
|
// (see foundations/membership/queries/membership.query.ts) — no single-hop
|
|
57
58
|
// (user)-[:HAS_MEMBERSHIP]->(role) edge exists. The serialiser maps by key +
|
|
58
|
-
// model,
|
|
59
|
-
//
|
|
59
|
+
// model, which is what every UserRepository/UserService read path relies on.
|
|
60
|
+
//
|
|
61
|
+
// WARNING: UserRepository/UserService now extend AbstractRepository/
|
|
62
|
+
// AbstractService, so the INHERITED generic methods (find, findById, create,
|
|
63
|
+
// put, patch, addToRelationship…) would traverse/write this relationship as a
|
|
64
|
+
// single hop and therefore silently return no roles (read) or create a bogus
|
|
65
|
+
// (user)-[:HAS_MEMBERSHIP]->(:Role) edge (write). Use the explicit domain
|
|
66
|
+
// methods — findMany / findByUserId / createUser / putUser / addUserToRole —
|
|
67
|
+
// for anything involving roles.
|
|
68
|
+
//
|
|
69
|
+
// `readOnly: true` closes that hole generically (spec §3.4): the generic
|
|
70
|
+
// create/put/patch paths skip this relationship and findByRelated /
|
|
71
|
+
// addToRelationship / removeFromRelationship reject it with 400 instead of
|
|
72
|
+
// silently writing a bogus edge or returning an empty list.
|
|
60
73
|
role: {
|
|
61
74
|
model: role_meta_1.roleMeta,
|
|
62
75
|
direction: "out",
|
|
63
76
|
relationship: "HAS_MEMBERSHIP",
|
|
64
77
|
cardinality: "many",
|
|
65
78
|
dtoKey: "roles",
|
|
79
|
+
readOnly: true,
|
|
66
80
|
},
|
|
67
81
|
company: {
|
|
68
82
|
model: company_1.CompanyDescriptor.model,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../src/foundations/user/entities/user.ts"],"names":[],"mappings":";;;AAAA,4CAA0E;AAE1E,4DAAmE;AAEnE,mEAA+D;AAE/D,6DAAyD;AACzD,iCAAqC;AACrC,2CAA4E;AA4B5E;;;;;GAKG;AACU,QAAA,cAAc,GAAG,IAAA,qBAAY,GAAQ,CAAC;IACjD,GAAG,oBAAQ;IAEX,cAAc,EAAE,CAAC,cAAS,CAAC;IAE3B,oBAAoB;IACpB,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../src/foundations/user/entities/user.ts"],"names":[],"mappings":";;;AAAA,4CAA0E;AAE1E,4DAAmE;AAEnE,mEAA+D;AAE/D,6DAAyD;AACzD,iCAAqC;AACrC,2CAA4E;AA4B5E;;;;;GAKG;AACU,QAAA,cAAc,GAAG,IAAA,qBAAY,GAAQ,CAAC;IACjD,GAAG,oBAAQ;IAEX,cAAc,EAAE,CAAC,cAAS,CAAC;IAE3B,oBAAoB;IACpB,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACz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,EAAE,sBAAU,CAAC,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
export { UserController } from "./controllers/user.controller";
|
|
1
2
|
export { UserDataDTO, UserDataListDTO } from "./dtos/user.dto";
|
|
3
|
+
export { UserPatchAvatarDTO } from "./dtos/user.patch.avatar.dto";
|
|
4
|
+
export { UserPatchRateDTO } from "./dtos/user.patch.rate.dto";
|
|
5
|
+
export { UserPostDataDTO, UserPostDTO } from "./dtos/user.post.dto";
|
|
6
|
+
export { UserPutDTO } from "./dtos/user.put.dto";
|
|
2
7
|
export { User, UserDescriptor, OwnerDescriptor, AssigneeDescriptor, AuthorDescriptor } from "./entities/user";
|
|
3
|
-
export { authorMeta, ownerMeta, userMeta } from "./entities/user.meta";
|
|
8
|
+
export { assigneeMeta, authorMeta, ownerMeta, userMeta } from "./entities/user.meta";
|
|
4
9
|
export { UserRepository } from "./repositories/user.repository";
|
|
5
10
|
export { UserCypherService } from "./services/user.cypher.service";
|
|
6
11
|
export { UserService } from "./services/user.service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserModule = exports.UserService = exports.UserCypherService = exports.UserRepository = exports.userMeta = exports.ownerMeta = exports.authorMeta = exports.AuthorDescriptor = exports.AssigneeDescriptor = exports.OwnerDescriptor = exports.UserDescriptor = exports.UserDataListDTO = exports.UserDataDTO = void 0;
|
|
3
|
+
exports.UserModule = exports.UserService = exports.UserCypherService = exports.UserRepository = exports.userMeta = exports.ownerMeta = exports.authorMeta = exports.assigneeMeta = exports.AuthorDescriptor = exports.AssigneeDescriptor = exports.OwnerDescriptor = exports.UserDescriptor = exports.UserPutDTO = exports.UserPostDTO = exports.UserPostDataDTO = exports.UserPatchRateDTO = exports.UserPatchAvatarDTO = exports.UserDataListDTO = exports.UserDataDTO = exports.UserController = void 0;
|
|
4
|
+
var user_controller_1 = require("./controllers/user.controller");
|
|
5
|
+
Object.defineProperty(exports, "UserController", { enumerable: true, get: function () { return user_controller_1.UserController; } });
|
|
4
6
|
var user_dto_1 = require("./dtos/user.dto");
|
|
5
7
|
Object.defineProperty(exports, "UserDataDTO", { enumerable: true, get: function () { return user_dto_1.UserDataDTO; } });
|
|
6
8
|
Object.defineProperty(exports, "UserDataListDTO", { enumerable: true, get: function () { return user_dto_1.UserDataListDTO; } });
|
|
9
|
+
var user_patch_avatar_dto_1 = require("./dtos/user.patch.avatar.dto");
|
|
10
|
+
Object.defineProperty(exports, "UserPatchAvatarDTO", { enumerable: true, get: function () { return user_patch_avatar_dto_1.UserPatchAvatarDTO; } });
|
|
11
|
+
var user_patch_rate_dto_1 = require("./dtos/user.patch.rate.dto");
|
|
12
|
+
Object.defineProperty(exports, "UserPatchRateDTO", { enumerable: true, get: function () { return user_patch_rate_dto_1.UserPatchRateDTO; } });
|
|
13
|
+
var user_post_dto_1 = require("./dtos/user.post.dto");
|
|
14
|
+
Object.defineProperty(exports, "UserPostDataDTO", { enumerable: true, get: function () { return user_post_dto_1.UserPostDataDTO; } });
|
|
15
|
+
Object.defineProperty(exports, "UserPostDTO", { enumerable: true, get: function () { return user_post_dto_1.UserPostDTO; } });
|
|
16
|
+
var user_put_dto_1 = require("./dtos/user.put.dto");
|
|
17
|
+
Object.defineProperty(exports, "UserPutDTO", { enumerable: true, get: function () { return user_put_dto_1.UserPutDTO; } });
|
|
7
18
|
var user_1 = require("./entities/user");
|
|
8
19
|
Object.defineProperty(exports, "UserDescriptor", { enumerable: true, get: function () { return user_1.UserDescriptor; } });
|
|
9
20
|
Object.defineProperty(exports, "OwnerDescriptor", { enumerable: true, get: function () { return user_1.OwnerDescriptor; } });
|
|
10
21
|
Object.defineProperty(exports, "AssigneeDescriptor", { enumerable: true, get: function () { return user_1.AssigneeDescriptor; } });
|
|
11
22
|
Object.defineProperty(exports, "AuthorDescriptor", { enumerable: true, get: function () { return user_1.AuthorDescriptor; } });
|
|
12
23
|
var user_meta_1 = require("./entities/user.meta");
|
|
24
|
+
Object.defineProperty(exports, "assigneeMeta", { enumerable: true, get: function () { return user_meta_1.assigneeMeta; } });
|
|
13
25
|
Object.defineProperty(exports, "authorMeta", { enumerable: true, get: function () { return user_meta_1.authorMeta; } });
|
|
14
26
|
Object.defineProperty(exports, "ownerMeta", { enumerable: true, get: function () { return user_meta_1.ownerMeta; } });
|
|
15
27
|
Object.defineProperty(exports, "userMeta", { enumerable: true, get: function () { return user_meta_1.userMeta; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/user/index.ts"],"names":[],"mappings":";;;AAAA,4CAA+D;AAAtD,uGAAA,WAAW,OAAA;AAAE,2GAAA,eAAe,OAAA;AACrC,wCAA8G;AAA/F,sGAAA,cAAc,OAAA;AAAE,uGAAA,eAAe,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAAE,wGAAA,gBAAgB,OAAA;AACpF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/user/index.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAAtD,iHAAA,cAAc,OAAA;AACvB,4CAA+D;AAAtD,uGAAA,WAAW,OAAA;AAAE,2GAAA,eAAe,OAAA;AACrC,sEAAkE;AAAzD,2HAAA,kBAAkB,OAAA;AAC3B,kEAA8D;AAArD,uHAAA,gBAAgB,OAAA;AACzB,sDAAoE;AAA3D,gHAAA,eAAe,OAAA;AAAE,4GAAA,WAAW,OAAA;AACrC,oDAAiD;AAAxC,0GAAA,UAAU,OAAA;AACnB,wCAA8G;AAA/F,sGAAA,cAAc,OAAA;AAAE,uGAAA,eAAe,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAAE,wGAAA,gBAAgB,OAAA;AACpF,kDAAqF;AAA5E,yGAAA,YAAY,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,qGAAA,QAAQ,OAAA;AACtD,kEAAgE;AAAvD,iHAAA,cAAc,OAAA;AACvB,sEAAmE;AAA1D,wHAAA,iBAAiB,OAAA;AAC1B,wDAAsD;AAA7C,2GAAA,WAAW,OAAA;AACpB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA"}
|
|
@@ -1,14 +1,59 @@
|
|
|
1
|
-
import { OnModuleInit } from "@nestjs/common";
|
|
2
1
|
import { ClsService } from "nestjs-cls";
|
|
3
2
|
import { JsonApiCursorInterface } from "../../../core/jsonapi/interfaces/jsonapi.cursor.interface";
|
|
3
|
+
import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
|
|
4
4
|
import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
|
|
5
|
-
import {
|
|
5
|
+
import { SecurityService } from "../../../core/security/services/security.service";
|
|
6
|
+
import { User, UserDescriptor } from "../../user/entities/user";
|
|
6
7
|
import { UserCypherService } from "../../user/services/user.cypher.service";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/**
|
|
9
|
+
* User repository.
|
|
10
|
+
*
|
|
11
|
+
* Extends `AbstractRepository` so an application can subclass it (see
|
|
12
|
+
* `ExtendedUserRepository` in a consuming app) and have BOTH the inherited
|
|
13
|
+
* generic methods AND every method declared here resolve the *extended*
|
|
14
|
+
* descriptor. Model resolution is by subclass polymorphism — `this.descriptor`
|
|
15
|
+
* — never by a registry lookup: Nest constructs providers long before
|
|
16
|
+
* `onModuleInit`, where models are registered, so a registry lookup at
|
|
17
|
+
* construction time would yield `undefined`.
|
|
18
|
+
*
|
|
19
|
+
* The three domain methods whose names collide with the abstract's generic
|
|
20
|
+
* CRUD (`create` / `put` / `delete`) are named `createUser` / `putUser` /
|
|
21
|
+
* `deleteUser` so the inherited descriptor-driven CRUD stays reachable.
|
|
22
|
+
*/
|
|
23
|
+
export declare class UserRepository extends AbstractRepository<User, typeof UserDescriptor.relationships> {
|
|
24
|
+
protected readonly userCypherService: UserCypherService;
|
|
25
|
+
protected readonly descriptor: import("../../..").EntityDescriptor<User, {
|
|
26
|
+
role: {
|
|
27
|
+
model: import("../../..").DataMeta;
|
|
28
|
+
direction: "out";
|
|
29
|
+
relationship: string;
|
|
30
|
+
cardinality: "many";
|
|
31
|
+
dtoKey: string;
|
|
32
|
+
readOnly: true;
|
|
33
|
+
};
|
|
34
|
+
company: {
|
|
35
|
+
model: import("../../..").DataModelInterface<import("../..").Company>;
|
|
36
|
+
direction: "out";
|
|
37
|
+
relationship: string;
|
|
38
|
+
cardinality: "one";
|
|
39
|
+
};
|
|
40
|
+
module: {
|
|
41
|
+
model: import("../../..").DataMeta;
|
|
42
|
+
direction: "out";
|
|
43
|
+
relationship: string;
|
|
44
|
+
cardinality: "many";
|
|
45
|
+
dtoKey: string;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService, userCypherService: UserCypherService);
|
|
49
|
+
/**
|
|
50
|
+
* `AbstractRepository.onModuleInit` creates the constraints and indexes
|
|
51
|
+
* declared by the descriptor. `defineEntity` only ever emits the `id` UNIQUE
|
|
52
|
+
* constraint, so the User-specific `email` UNIQUE constraint is added here.
|
|
53
|
+
* The fulltext index is created by the parent from `descriptor.indexes`
|
|
54
|
+
* (`stringFields`), which excludes `password` and `code` — both carry
|
|
55
|
+
* `excludeFromSearch: true`.
|
|
56
|
+
*/
|
|
12
57
|
onModuleInit(): Promise<void>;
|
|
13
58
|
makeCompanyAdmin(params: {
|
|
14
59
|
userId: string;
|
|
@@ -66,7 +111,7 @@ export declare class UserRepository implements OnModuleInit {
|
|
|
66
111
|
term?: string;
|
|
67
112
|
cursor: JsonApiCursorInterface;
|
|
68
113
|
}): Promise<User[]>;
|
|
69
|
-
|
|
114
|
+
createUser(params: {
|
|
70
115
|
userId: string;
|
|
71
116
|
email: string;
|
|
72
117
|
name: string;
|
|
@@ -85,11 +130,11 @@ export declare class UserRepository implements OnModuleInit {
|
|
|
85
130
|
resetCode(params: {
|
|
86
131
|
userId: string;
|
|
87
132
|
}): Promise<User>;
|
|
88
|
-
|
|
133
|
+
putUser(params: {
|
|
89
134
|
isAdmin: boolean;
|
|
90
135
|
userId: string;
|
|
91
136
|
email: string;
|
|
92
|
-
name
|
|
137
|
+
name?: string;
|
|
93
138
|
title?: string;
|
|
94
139
|
bio?: string;
|
|
95
140
|
password?: string;
|
|
@@ -114,7 +159,7 @@ export declare class UserRepository implements OnModuleInit {
|
|
|
114
159
|
userId: string;
|
|
115
160
|
avatar: string;
|
|
116
161
|
}): Promise<void>;
|
|
117
|
-
|
|
162
|
+
deleteUser(params: {
|
|
118
163
|
userId: string;
|
|
119
164
|
}): Promise<void>;
|
|
120
165
|
addUserToRole(params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/user/repositories/user.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/user/repositories/user.repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAYnF,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E;;;;;;;;;;;;;;GAcG;AACH,qBACa,cAAe,SAAQ,kBAAkB,CAAC,IAAI,EAAE,OAAO,cAAc,CAAC,aAAa,CAAC;IAO7F,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB;IANzD,SAAS,CAAC,QAAQ,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;OAAkB;gBAG7C,KAAK,EAAE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,IAAI,CAAC;IA4BxE,kBAAkB,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBnF;;;OAGG;IACG,0BAA0B,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAiBnD;;;OAGG;IACG,mCAAmC,CAAC,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IA0BhG;;;OAGG;IACG,qBAAqB,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAmB5E"}
|
|
@@ -14,7 +14,9 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const crypto_1 = require("crypto");
|
|
15
15
|
const nestjs_cls_1 = require("nestjs-cls");
|
|
16
16
|
const system_roles_1 = require("../../../common/constants/system.roles");
|
|
17
|
+
const abstract_repository_1 = require("../../../core/neo4j/abstracts/abstract.repository");
|
|
17
18
|
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
19
|
+
const security_service_1 = require("../../../core/security/services/security.service");
|
|
18
20
|
const company_meta_1 = require("../../company/entities/company.meta");
|
|
19
21
|
const feature_meta_1 = require("../../feature/entities/feature.meta");
|
|
20
22
|
const membership_query_1 = require("../../membership/queries/membership.query");
|
|
@@ -24,26 +26,40 @@ const role_meta_1 = require("../../role/entities/role.meta");
|
|
|
24
26
|
const user_1 = require("../../user/entities/user");
|
|
25
27
|
const user_meta_1 = require("../../user/entities/user.meta");
|
|
26
28
|
const user_cypher_service_1 = require("../../user/services/user.cypher.service");
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* User repository.
|
|
31
|
+
*
|
|
32
|
+
* Extends `AbstractRepository` so an application can subclass it (see
|
|
33
|
+
* `ExtendedUserRepository` in a consuming app) and have BOTH the inherited
|
|
34
|
+
* generic methods AND every method declared here resolve the *extended*
|
|
35
|
+
* descriptor. Model resolution is by subclass polymorphism — `this.descriptor`
|
|
36
|
+
* — never by a registry lookup: Nest constructs providers long before
|
|
37
|
+
* `onModuleInit`, where models are registered, so a registry lookup at
|
|
38
|
+
* construction time would yield `undefined`.
|
|
39
|
+
*
|
|
40
|
+
* The three domain methods whose names collide with the abstract's generic
|
|
41
|
+
* CRUD (`create` / `put` / `delete`) are named `createUser` / `putUser` /
|
|
42
|
+
* `deleteUser` so the inherited descriptor-driven CRUD stays reachable.
|
|
43
|
+
*/
|
|
44
|
+
let UserRepository = class UserRepository extends abstract_repository_1.AbstractRepository {
|
|
45
|
+
constructor(neo4j, securityService, clsService, userCypherService) {
|
|
46
|
+
super(neo4j, securityService, clsService);
|
|
31
47
|
this.userCypherService = userCypherService;
|
|
48
|
+
this.descriptor = user_1.UserDescriptor;
|
|
32
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* `AbstractRepository.onModuleInit` creates the constraints and indexes
|
|
52
|
+
* declared by the descriptor. `defineEntity` only ever emits the `id` UNIQUE
|
|
53
|
+
* constraint, so the User-specific `email` UNIQUE constraint is added here.
|
|
54
|
+
* The fulltext index is created by the parent from `descriptor.indexes`
|
|
55
|
+
* (`stringFields`), which excludes `password` and `code` — both carry
|
|
56
|
+
* `excludeFromSearch: true`.
|
|
57
|
+
*/
|
|
33
58
|
async onModuleInit() {
|
|
34
|
-
await
|
|
35
|
-
query: `CREATE CONSTRAINT user_id IF NOT EXISTS FOR (user:User) REQUIRE user.id IS UNIQUE`,
|
|
36
|
-
});
|
|
59
|
+
await super.onModuleInit();
|
|
37
60
|
await this.neo4j.writeOne({
|
|
38
61
|
query: `CREATE CONSTRAINT user_email IF NOT EXISTS FOR (user:User) REQUIRE user.email IS UNIQUE`,
|
|
39
62
|
});
|
|
40
|
-
// Create fulltext search index for user string fields
|
|
41
|
-
if (user_1.UserDescriptor.fulltextIndexName && user_1.UserDescriptor.stringFields.length > 0) {
|
|
42
|
-
await this.neo4j.writeOne({
|
|
43
|
-
query: `CREATE FULLTEXT INDEX \`${user_1.UserDescriptor.fulltextIndexName}\` IF NOT EXISTS FOR (n:\`${user_meta_1.userMeta.labelName}\`) ON EACH [${user_1.UserDescriptor.stringFields.map((p) => `n.\`${p}\``).join(", ")}]`,
|
|
44
|
-
queryParams: {},
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
63
|
}
|
|
48
64
|
async makeCompanyAdmin(params) {
|
|
49
65
|
const query = this.neo4j.initQuery();
|
|
@@ -61,7 +77,7 @@ let UserRepository = class UserRepository {
|
|
|
61
77
|
await this.neo4j.writeOne(query);
|
|
62
78
|
}
|
|
63
79
|
async findOneForAdmin(params) {
|
|
64
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
80
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
65
81
|
query.queryParams = {
|
|
66
82
|
userId: params.userId,
|
|
67
83
|
};
|
|
@@ -85,7 +101,7 @@ let UserRepository = class UserRepository {
|
|
|
85
101
|
* Returns user with roles, company, and features needed for token creation.
|
|
86
102
|
*/
|
|
87
103
|
async findForTwoFactorLogin(params) {
|
|
88
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
104
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
89
105
|
query.queryParams = {
|
|
90
106
|
userId: params.userId,
|
|
91
107
|
};
|
|
@@ -112,7 +128,7 @@ let UserRepository = class UserRepository {
|
|
|
112
128
|
return this.neo4j.readOne(query);
|
|
113
129
|
}
|
|
114
130
|
async findFullUser(params) {
|
|
115
|
-
let query = this.neo4j.initQuery({ serialiser:
|
|
131
|
+
let query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
116
132
|
query.queryParams = {
|
|
117
133
|
...query.queryParams,
|
|
118
134
|
searchValue: params.userId,
|
|
@@ -158,7 +174,7 @@ let UserRepository = class UserRepository {
|
|
|
158
174
|
return user;
|
|
159
175
|
}
|
|
160
176
|
async findByUserId(params) {
|
|
161
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
177
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
162
178
|
query.queryParams = {
|
|
163
179
|
...query.queryParams,
|
|
164
180
|
userId: params.userId,
|
|
@@ -180,7 +196,7 @@ let UserRepository = class UserRepository {
|
|
|
180
196
|
return this.neo4j.readOne(query);
|
|
181
197
|
}
|
|
182
198
|
async findByEmail(params) {
|
|
183
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
199
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
184
200
|
query.queryParams = {
|
|
185
201
|
email: params.email.toLowerCase(),
|
|
186
202
|
};
|
|
@@ -208,7 +224,7 @@ let UserRepository = class UserRepository {
|
|
|
208
224
|
return this.neo4j.readOne(query);
|
|
209
225
|
}
|
|
210
226
|
async findByCode(params) {
|
|
211
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
227
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
212
228
|
query.queryParams = {
|
|
213
229
|
code: params.code,
|
|
214
230
|
};
|
|
@@ -227,13 +243,13 @@ let UserRepository = class UserRepository {
|
|
|
227
243
|
return this.neo4j.readOne(query);
|
|
228
244
|
}
|
|
229
245
|
async findMany(params) {
|
|
230
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
246
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, cursor: params.cursor });
|
|
231
247
|
query.queryParams = {
|
|
232
248
|
...query.queryParams,
|
|
233
249
|
term: params.term ? `*${params.term.toLowerCase()}*` : undefined,
|
|
234
250
|
};
|
|
235
|
-
if (params.term &&
|
|
236
|
-
query.query += `CALL db.index.fulltext.queryNodes("${
|
|
251
|
+
if (params.term && this.descriptor.fulltextIndexName) {
|
|
252
|
+
query.query += `CALL db.index.fulltext.queryNodes("${this.descriptor.fulltextIndexName}", $term)
|
|
237
253
|
YIELD node, score
|
|
238
254
|
WHERE (node)-[:BELONGS_TO]->(company)
|
|
239
255
|
|
|
@@ -257,7 +273,7 @@ let UserRepository = class UserRepository {
|
|
|
257
273
|
return this.neo4j.readMany(query);
|
|
258
274
|
}
|
|
259
275
|
async findManyByContentIds(params) {
|
|
260
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
276
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, fetchAll: true });
|
|
261
277
|
query.queryParams = {
|
|
262
278
|
...query.queryParams,
|
|
263
279
|
term: params.term,
|
|
@@ -276,7 +292,7 @@ let UserRepository = class UserRepository {
|
|
|
276
292
|
return this.neo4j.readMany(query);
|
|
277
293
|
}
|
|
278
294
|
async findManyByCompany(params) {
|
|
279
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
295
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, cursor: params.cursor });
|
|
280
296
|
query.queryParams = {
|
|
281
297
|
companyId: params.companyId,
|
|
282
298
|
term: params.term,
|
|
@@ -292,7 +308,7 @@ let UserRepository = class UserRepository {
|
|
|
292
308
|
return this.neo4j.readMany(query);
|
|
293
309
|
}
|
|
294
310
|
async findInRole(params) {
|
|
295
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
311
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, cursor: params.cursor });
|
|
296
312
|
query.queryParams = {
|
|
297
313
|
...query.queryParams,
|
|
298
314
|
roleId: params.roleId,
|
|
@@ -314,7 +330,7 @@ let UserRepository = class UserRepository {
|
|
|
314
330
|
return this.neo4j.readMany(query);
|
|
315
331
|
}
|
|
316
332
|
async findNotInRole(params) {
|
|
317
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
333
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, cursor: params.cursor });
|
|
318
334
|
query.queryParams = {
|
|
319
335
|
...query.queryParams,
|
|
320
336
|
roleId: params.roleId,
|
|
@@ -340,10 +356,10 @@ let UserRepository = class UserRepository {
|
|
|
340
356
|
`;
|
|
341
357
|
return this.neo4j.readMany(query);
|
|
342
358
|
}
|
|
343
|
-
async
|
|
359
|
+
async createUser(params) {
|
|
344
360
|
const query = this.neo4j.initQuery();
|
|
345
361
|
query.queryParams = {
|
|
346
|
-
currentUserId: this.
|
|
362
|
+
currentUserId: this.clsService.has("userId") ? this.clsService.get("userId") : null,
|
|
347
363
|
userId: params.userId,
|
|
348
364
|
email: params.email.toLowerCase(),
|
|
349
365
|
name: params.name,
|
|
@@ -407,9 +423,12 @@ let UserRepository = class UserRepository {
|
|
|
407
423
|
await this.neo4j.writeOne(query);
|
|
408
424
|
return this.findByUserId({ userId: params.userId });
|
|
409
425
|
}
|
|
410
|
-
async
|
|
426
|
+
async putUser(params) {
|
|
411
427
|
const setClauses = [];
|
|
412
|
-
|
|
428
|
+
// `name` is optional on the PUT DTO: an omitted name must leave the stored
|
|
429
|
+
// name untouched, never overwrite it with null.
|
|
430
|
+
if (params.name !== undefined)
|
|
431
|
+
setClauses.push("user.name = $name");
|
|
413
432
|
setClauses.push("user.email = $email");
|
|
414
433
|
setClauses.push("user.title = $title");
|
|
415
434
|
setClauses.push("user.bio = $bio");
|
|
@@ -513,7 +532,7 @@ let UserRepository = class UserRepository {
|
|
|
513
532
|
`;
|
|
514
533
|
await this.neo4j.writeOne(query);
|
|
515
534
|
}
|
|
516
|
-
async
|
|
535
|
+
async deleteUser(params) {
|
|
517
536
|
const query = this.neo4j.initQuery();
|
|
518
537
|
query.queryParams = {
|
|
519
538
|
...query.queryParams,
|
|
@@ -573,7 +592,7 @@ let UserRepository = class UserRepository {
|
|
|
573
592
|
* These users have the Administrator role and receive internal payment notifications.
|
|
574
593
|
*/
|
|
575
594
|
async findPlatformAdministrators() {
|
|
576
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
595
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, fetchAll: true });
|
|
577
596
|
query.queryParams = {
|
|
578
597
|
administratorRoleId: system_roles_1.RoleId.Administrator,
|
|
579
598
|
};
|
|
@@ -590,7 +609,7 @@ let UserRepository = class UserRepository {
|
|
|
590
609
|
* Query path: StripeCustomer -> Company <- User with CompanyAdministrator role
|
|
591
610
|
*/
|
|
592
611
|
async findCompanyAdminsByStripeCustomerId(params) {
|
|
593
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
612
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, fetchAll: true });
|
|
594
613
|
query.queryParams = {
|
|
595
614
|
stripeCustomerId: params.stripeCustomerId,
|
|
596
615
|
companyAdminRoleId: system_roles_1.RoleId.CompanyAdministrator,
|
|
@@ -616,7 +635,7 @@ let UserRepository = class UserRepository {
|
|
|
616
635
|
* Used for deletion warning notifications
|
|
617
636
|
*/
|
|
618
637
|
async findAdminsByCompanyId(params) {
|
|
619
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
638
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model, fetchAll: true });
|
|
620
639
|
query.queryParams = {
|
|
621
640
|
companyId: params.companyId,
|
|
622
641
|
companyAdminRoleId: system_roles_1.RoleId.CompanyAdministrator,
|
|
@@ -636,6 +655,7 @@ exports.UserRepository = UserRepository;
|
|
|
636
655
|
exports.UserRepository = UserRepository = __decorate([
|
|
637
656
|
(0, common_1.Injectable)(),
|
|
638
657
|
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService,
|
|
658
|
+
security_service_1.SecurityService,
|
|
639
659
|
nestjs_cls_1.ClsService,
|
|
640
660
|
user_cypher_service_1.UserCypherService])
|
|
641
661
|
], UserRepository);
|