@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
|
@@ -36,8 +36,16 @@ let ContentCypherService = class ContentCypherService {
|
|
|
36
36
|
// Base MATCH clauses for core relationships
|
|
37
37
|
let query = `
|
|
38
38
|
MATCH (${content_meta_1.contentMeta.nodeName})-[:BELONGS_TO]->(${content_meta_1.contentMeta.nodeName}_${company_meta_1.companyMeta.nodeName}:${company_meta_1.companyMeta.labelName})
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
${this.ownerMatch({ target: `${content_meta_1.contentMeta.nodeName}_${user_meta_1.ownerMeta.nodeName}:${user_meta_1.ownerMeta.labelName}` })}`;
|
|
40
|
+
// The author match is OPTIONAL: it traverses the SAME `PUBLISHED` edge as
|
|
41
|
+
// the owner match above, so on package data every row surviving the owner
|
|
42
|
+
// match already resolves it — the row set is unchanged by default. Making
|
|
43
|
+
// it optional stops it from silently dropping every row for apps whose
|
|
44
|
+
// owner edge is not `PUBLISHED` (see `ownerMatchPattern`).
|
|
45
|
+
if (this.serialiseAuthor) {
|
|
46
|
+
query += `
|
|
47
|
+
OPTIONAL MATCH (${content_meta_1.contentMeta.nodeName})<-[:PUBLISHED]-(${content_meta_1.contentMeta.nodeName}_${user_meta_1.authorMeta.nodeName}:${user_meta_1.authorMeta.labelName})`;
|
|
48
|
+
}
|
|
41
49
|
// Add OPTIONAL MATCH for extension relationships
|
|
42
50
|
if (this.extension?.additionalRelationships) {
|
|
43
51
|
for (const rel of this.extension.additionalRelationships) {
|
|
@@ -51,12 +59,22 @@ let ContentCypherService = class ContentCypherService {
|
|
|
51
59
|
OPTIONAL MATCH ${relPattern}`;
|
|
52
60
|
}
|
|
53
61
|
}
|
|
62
|
+
// Add the config-driven meta-field clauses (appended verbatim)
|
|
63
|
+
if (this.extension?.metaFields) {
|
|
64
|
+
for (const metaField of this.extension.metaFields) {
|
|
65
|
+
query += `
|
|
66
|
+
${metaField.optionalMatch}`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
54
69
|
// Base RETURN clause
|
|
55
70
|
query += `
|
|
56
71
|
RETURN ${content_meta_1.contentMeta.nodeName},
|
|
57
72
|
${content_meta_1.contentMeta.nodeName}_${company_meta_1.companyMeta.nodeName},
|
|
58
|
-
${content_meta_1.contentMeta.nodeName}_${user_meta_1.ownerMeta.nodeName}
|
|
73
|
+
${content_meta_1.contentMeta.nodeName}_${user_meta_1.ownerMeta.nodeName}`;
|
|
74
|
+
if (this.serialiseAuthor) {
|
|
75
|
+
query += `,
|
|
59
76
|
${content_meta_1.contentMeta.nodeName}_${user_meta_1.authorMeta.nodeName}`;
|
|
77
|
+
}
|
|
60
78
|
// Add extension relationship nodes to RETURN
|
|
61
79
|
if (this.extension?.additionalRelationships) {
|
|
62
80
|
for (const rel of this.extension.additionalRelationships) {
|
|
@@ -64,6 +82,13 @@ let ContentCypherService = class ContentCypherService {
|
|
|
64
82
|
${content_meta_1.contentMeta.nodeName}_${rel.model.nodeName}`;
|
|
65
83
|
}
|
|
66
84
|
}
|
|
85
|
+
// Add the config-driven meta-field projections
|
|
86
|
+
if (this.extension?.metaFields) {
|
|
87
|
+
for (const metaField of this.extension.metaFields) {
|
|
88
|
+
query += `,
|
|
89
|
+
${metaField.returnAlias} AS ${metaField.key}`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
67
92
|
// Add optional totalScore
|
|
68
93
|
if (params?.useTotalScore) {
|
|
69
94
|
query += `,
|
|
@@ -76,16 +101,52 @@ let ContentCypherService = class ContentCypherService {
|
|
|
76
101
|
const types = this.configService.get("contentTypes")?.types ?? [];
|
|
77
102
|
return types.length > 0 ? types : [content_meta_1.contentMeta.labelName];
|
|
78
103
|
}
|
|
104
|
+
/** Whether the `author` relationship is matched and returned (default: yes). */
|
|
105
|
+
get serialiseAuthor() {
|
|
106
|
+
return this.extension?.serialiseAuthor !== false;
|
|
107
|
+
}
|
|
79
108
|
default(params) {
|
|
80
109
|
return `
|
|
81
110
|
MATCH (${content_meta_1.contentMeta.nodeName}:${this.getContentTypes().join("|")} ${params ? ` {${params.searchField}: $searchValue}` : ``})
|
|
82
|
-
WHERE $
|
|
111
|
+
WHERE ${this.extension?.requireTldr
|
|
112
|
+
? `${content_meta_1.contentMeta.nodeName}.tldr IS NOT NULL
|
|
113
|
+
AND ${content_meta_1.contentMeta.nodeName}.tldr <> ""
|
|
114
|
+
AND `
|
|
115
|
+
: ``}$companyId IS NULL
|
|
83
116
|
OR EXISTS {
|
|
84
117
|
MATCH (${content_meta_1.contentMeta.nodeName})-[:BELONGS_TO]-(company)
|
|
85
118
|
}
|
|
86
119
|
WITH ${content_meta_1.contentMeta.nodeName}${params?.blockCompanyAndUser ? `` : `, company, currentUser`}
|
|
87
120
|
`;
|
|
88
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* The `requireTldr` filter as trailing `AND` predicates, for callers that
|
|
124
|
+
* already opened a WHERE clause of their own (e.g. `ContentRepository.findByIds`).
|
|
125
|
+
* Returns an empty string when the filter is disabled (the default).
|
|
126
|
+
*/
|
|
127
|
+
tldrFilter() {
|
|
128
|
+
if (!this.extension?.requireTldr)
|
|
129
|
+
return ``;
|
|
130
|
+
return `
|
|
131
|
+
AND ${content_meta_1.contentMeta.nodeName}.tldr IS NOT NULL
|
|
132
|
+
AND ${content_meta_1.contentMeta.nodeName}.tldr <> ""`;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The Content → owner MATCH clause, driven by `ownerMatchPattern`.
|
|
136
|
+
*
|
|
137
|
+
* Default: `MATCH (content)<-[:PUBLISHED]-(<target>)`.
|
|
138
|
+
*
|
|
139
|
+
* @param params.target - The pattern's node body, e.g. `"content_owner:User"`
|
|
140
|
+
* (bind an alias) or `":User {id: $ownerId}"` (filter without binding).
|
|
141
|
+
*/
|
|
142
|
+
ownerMatch(params) {
|
|
143
|
+
const pattern = this.extension?.ownerMatchPattern;
|
|
144
|
+
const relationships = pattern?.relationships?.length ? pattern.relationships : ["PUBLISHED"];
|
|
145
|
+
const relationshipTypes = relationships.join("|");
|
|
146
|
+
return pattern?.undirected
|
|
147
|
+
? `MATCH (${content_meta_1.contentMeta.nodeName})-[:${relationshipTypes}]-(${params.target})`
|
|
148
|
+
: `MATCH (${content_meta_1.contentMeta.nodeName})<-[:${relationshipTypes}]-(${params.target})`;
|
|
149
|
+
}
|
|
89
150
|
};
|
|
90
151
|
exports.ContentCypherService = ContentCypherService;
|
|
91
152
|
exports.ContentCypherService = ContentCypherService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.cypher.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.cypher.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,2CAA+C;AAC/C,2CAAwC;AAExC,sEAAkE;AAClE,sEAAkE;AAClE,6DAAsE;AACtE,2FAA6G;AAGtG,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACmB,UAAsB,EACtB,aAAiD,EAGlE,SAAmD;QAJlC,eAAU,GAAV,UAAU,CAAY;QACtB,kBAAa,GAAb,aAAa,CAAoC;QAGjD,cAAS,GAAT,SAAS,CAAyB;
|
|
1
|
+
{"version":3,"file":"content.cypher.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.cypher.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,2CAA+C;AAC/C,2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AAA;IACV,WAAA,IAAA,eAAM,EAAC,sDAAwB,CAAC,CAAA;qCAHJ,uBAAU;QACP,sBAAa;GAHpC,oBAAoB,CAuJhC"}
|
|
@@ -13,7 +13,7 @@ exports.ContentService = void 0;
|
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const jsonapi_paginator_1 = require("../../../core/jsonapi/serialisers/jsonapi.paginator");
|
|
15
15
|
const jsonapi_service_1 = require("../../../core/jsonapi/services/jsonapi.service");
|
|
16
|
-
const
|
|
16
|
+
const content_1 = require("../../content/entities/content");
|
|
17
17
|
const content_repository_1 = require("../../content/repositories/content.repository");
|
|
18
18
|
let ContentService = class ContentService {
|
|
19
19
|
constructor(builder, contentRepository) {
|
|
@@ -22,7 +22,7 @@ let ContentService = class ContentService {
|
|
|
22
22
|
}
|
|
23
23
|
async find(params) {
|
|
24
24
|
const paginator = new jsonapi_paginator_1.JsonApiPaginator(params.query);
|
|
25
|
-
return this.builder.buildList(
|
|
25
|
+
return this.builder.buildList((0, content_1.getContentModel)(), await this.contentRepository.find({
|
|
26
26
|
fetchAll: params.fetchAll,
|
|
27
27
|
term: params.term,
|
|
28
28
|
orderBy: params.orderBy,
|
|
@@ -30,13 +30,13 @@ let ContentService = class ContentService {
|
|
|
30
30
|
}), paginator);
|
|
31
31
|
}
|
|
32
32
|
async findByIds(params) {
|
|
33
|
-
return this.builder.buildList(
|
|
33
|
+
return this.builder.buildList((0, content_1.getContentModel)(), await this.contentRepository.findByIds({
|
|
34
34
|
contentIds: params.contentIds,
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
37
37
|
async findByOwner(params) {
|
|
38
38
|
const paginator = new jsonapi_paginator_1.JsonApiPaginator(params.query);
|
|
39
|
-
return this.builder.buildList(
|
|
39
|
+
return this.builder.buildList((0, content_1.getContentModel)(), await this.contentRepository.findByOwner({
|
|
40
40
|
ownerId: params.ownerId,
|
|
41
41
|
fetchAll: params.fetchAll,
|
|
42
42
|
term: params.term,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,2FAAuF;AACvF,oFAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"content.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,2FAAuF;AACvF,oFAAgF;AAChF,4DAAiE;AACjE,sFAAkF;AAG3E,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YACmB,OAAuB,EACvB,iBAAoC;QADpC,YAAO,GAAP,OAAO,CAAgB;QACvB,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,MAKV;QACC,MAAM,SAAS,GAAqB,IAAI,oCAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAC3B,IAAA,yBAAe,GAAE,EACjB,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAChC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,SAAS,CAAC,cAAc,EAAE;SACnC,CAAC,EACF,SAAS,CACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAgC;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAC3B,IAAA,yBAAe,GAAE,EACjB,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC;YACrC,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAA4F;QAC5G,MAAM,SAAS,GAAqB,IAAI,oCAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAC3B,IAAA,yBAAe,GAAE,EACjB,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC;YACvC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,SAAS,CAAC,cAAc,EAAE;SACnC,CAAC,EACF,SAAS,CACV,CAAC;IACJ,CAAC;CACF,CAAA;AAlDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAGiB,gCAAc;QACJ,sCAAiB;GAH5C,cAAc,CAkD1B"}
|
|
@@ -27,11 +27,11 @@ let DiscordUserService = class DiscordUserService {
|
|
|
27
27
|
async create(params) {
|
|
28
28
|
this.clsService.set("companyId", params.companyId);
|
|
29
29
|
this.clsService.set("userId", params.userId);
|
|
30
|
-
await this.companyRepository.
|
|
30
|
+
await this.companyRepository.createCompanyNode({
|
|
31
31
|
companyId: params.companyId,
|
|
32
32
|
name: `${params.userDetails.username}`,
|
|
33
33
|
});
|
|
34
|
-
await this.userRepository.
|
|
34
|
+
await this.userRepository.createUser({
|
|
35
35
|
userId: params.userId,
|
|
36
36
|
email: params.userDetails.email ?? params.userDetails.id,
|
|
37
37
|
name: params.userDetails.username,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discord-user.service.js","sourceRoot":"","sources":["../../../../src/foundations/discord-user/services/discord-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mCAAoC;AACpC,2CAAwC;AACxC,4CAAyC;AACzC,2CAAkD;AAClD,qCAA4C;AAC5C,qFAAgF;AAIzE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,qBAA4C,EAC5C,cAA8B,EAC9B,iBAAoC,EACpC,UAAsB;QAHtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,MAOZ;QACC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,MAAM,IAAI,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"discord-user.service.js","sourceRoot":"","sources":["../../../../src/foundations/discord-user/services/discord-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mCAAoC;AACpC,2CAAwC;AACxC,4CAAyC;AACzC,2CAAkD;AAClD,qCAA4C;AAC5C,qFAAgF;AAIzE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,qBAA4C,EAC5C,cAA8B,EAC9B,iBAAoC,EACpC,UAAsB;QAHtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,MAOZ;QACC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,MAAM,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;YAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,IAAI,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE;SACvC,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;YACnC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE;YACxD,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ;YACjC,QAAQ,EAAE,IAAA,mBAAU,GAAE;YACtB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM;YACjC,OAAO,EAAE,CAAC,eAAM,CAAC,oBAAoB,CAAC;YACtC,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,IAAI,SAAS;SAC3D,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC;YACtC,EAAE,EAAE,MAAM,CAAC,MAAM;YACjB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE;YAChC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ;YACjC,IAAI,EAAE,MAAM,CAAC,MAAM;SACpB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA7CY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAG+B,+CAAqB;QAC5B,qBAAc;QACX,2BAAiB;QACxB,uBAAU;GAL9B,kBAAkB,CA6C9B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Entity } from "../../../common/abstracts/entity";
|
|
2
|
+
import { Module } from "../../module/entities/module.entity";
|
|
3
|
+
/**
|
|
4
|
+
* Feature Entity Type
|
|
5
|
+
*/
|
|
6
|
+
export type Feature = Entity & {
|
|
7
|
+
name: string;
|
|
8
|
+
isCore: boolean;
|
|
9
|
+
module: Module[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Feature Entity Descriptor
|
|
13
|
+
*
|
|
14
|
+
* Single source of truth for the Feature entity configuration.
|
|
15
|
+
* Generates mapper, childrenTokens, and DataModelInterface automatically.
|
|
16
|
+
*/
|
|
17
|
+
export declare const FeatureDescriptor: import("../../..").EntityDescriptor<Feature, {
|
|
18
|
+
module: {
|
|
19
|
+
model: import("../../..").DataMeta;
|
|
20
|
+
direction: "in";
|
|
21
|
+
relationship: string;
|
|
22
|
+
cardinality: "many";
|
|
23
|
+
dtoKey: string;
|
|
24
|
+
description: string;
|
|
25
|
+
reverse: {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
export type FeatureDescriptorType = typeof FeatureDescriptor;
|
|
32
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAEhB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;EAyD5B,CAAC;AAGH,MAAM,MAAM,qBAAqB,GAAG,OAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeatureDescriptor = void 0;
|
|
4
|
+
const define_entity_1 = require("../../../common/helpers/define-entity");
|
|
5
|
+
const module_meta_1 = require("../../module/entities/module.meta");
|
|
6
|
+
const feature_meta_1 = require("./feature.meta");
|
|
7
|
+
/**
|
|
8
|
+
* Feature Entity Descriptor
|
|
9
|
+
*
|
|
10
|
+
* Single source of truth for the Feature entity configuration.
|
|
11
|
+
* Generates mapper, childrenTokens, and DataModelInterface automatically.
|
|
12
|
+
*/
|
|
13
|
+
exports.FeatureDescriptor = (0, define_entity_1.defineEntity)()({
|
|
14
|
+
...feature_meta_1.featureMeta,
|
|
15
|
+
// Features are global RBAC building blocks seeded once for the whole platform —
|
|
16
|
+
// there is no (Feature)-[:BELONGS_TO]->(Company) edge in the graph. Companies opt
|
|
17
|
+
// into features via a separate (Company)-[:HAS_FEATURE]->(Feature) edge (see
|
|
18
|
+
// FeatureRepository.findByCompany). Leaving this unset (defaults to true) would
|
|
19
|
+
// make the inherited buildDefaultMatch()/create()/put() require a BELONGS_TO edge
|
|
20
|
+
// that never exists, silently returning zero rows / failing writes.
|
|
21
|
+
isCompanyScoped: false,
|
|
22
|
+
// Catalog metadata: consumed by GraphDescriptorRegistry/GraphCatalogService when a
|
|
23
|
+
// host app graph-registers this descriptor. Inert for apps that never register it,
|
|
24
|
+
// and invisible to JSON:API — but the catalog contract REQUIRES a top-level
|
|
25
|
+
// description plus at least one described field, so these are not optional copy.
|
|
26
|
+
description: "A platform feature flag: a named capability of the product that can be enabled per company " +
|
|
27
|
+
"and that groups the RBAC modules (screens/entities) a company's users may access when the feature is on.",
|
|
28
|
+
chat: {
|
|
29
|
+
summary: (d) => d.name ?? d.id,
|
|
30
|
+
textSearchFields: ["name"],
|
|
31
|
+
},
|
|
32
|
+
// Field definitions
|
|
33
|
+
fields: {
|
|
34
|
+
name: {
|
|
35
|
+
type: "string",
|
|
36
|
+
required: true,
|
|
37
|
+
description: "The feature's display name.",
|
|
38
|
+
},
|
|
39
|
+
isCore: {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
required: true,
|
|
42
|
+
default: false,
|
|
43
|
+
description: "Whether this feature is a core platform capability that every company has, as opposed to an opt-in add-on.",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
// Relationship definitions
|
|
47
|
+
relationships: {
|
|
48
|
+
module: {
|
|
49
|
+
model: module_meta_1.moduleMeta,
|
|
50
|
+
direction: "in",
|
|
51
|
+
relationship: "IN_FEATURE",
|
|
52
|
+
cardinality: "many",
|
|
53
|
+
dtoKey: "modules",
|
|
54
|
+
description: "The RBAC modules (screens/entities) grouped under this feature.",
|
|
55
|
+
// `reverse.description` is a REQUIRED key on RelationshipDef["reverse"] —
|
|
56
|
+
// ported verbatim from the app descriptor (it was already English).
|
|
57
|
+
reverse: {
|
|
58
|
+
name: "feature",
|
|
59
|
+
description: "The feature this RBAC module belongs to.",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.ts"],"names":[],"mappings":";;;AACA,yEAAqE;AAErE,mEAA+D;AAC/D,iDAA6C;AAY7C;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAA,4BAAY,GAAW,CAAC;IACvD,GAAG,0BAAW;IAEd,gFAAgF;IAChF,kFAAkF;IAClF,6EAA6E;IAC7E,gFAAgF;IAChF,kFAAkF;IAClF,oEAAoE;IACpE,eAAe,EAAE,KAAK;IAEtB,mFAAmF;IACnF,mFAAmF;IACnF,4EAA4E;IAC5E,iFAAiF;IACjF,WAAW,EACT,6FAA6F;QAC7F,0GAA0G;IAE5G,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE;QAC9B,gBAAgB,EAAE,CAAC,MAAM,CAAC;KAC3B;IAED,oBAAoB;IACpB,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,6BAA6B;SAC3C;QACD,MAAM,EAAE;YACN,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YACd,WAAW,EACT,4GAA4G;SAC/G;KACF;IAED,2BAA2B;IAC3B,aAAa,EAAE;QACb,MAAM,EAAE;YACN,KAAK,EAAE,wBAAU;YACjB,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,MAAM;YACnB,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,iEAAiE;YAC9E,0EAA0E;YAC1E,oEAAoE;YACpE,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,0CAA0C;aACxD;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { Feature } from "../../feature/entities/feature.entity";
|
|
3
|
-
export declare const FeatureModel: DataModelInterface<Feature>;
|
|
1
|
+
export declare const FeatureModel: import("../../..").DataModelInterface<import("./feature").Feature>;
|
|
4
2
|
//# sourceMappingURL=feature.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.model.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature.model.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,oEAA0B,CAAC"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FeatureModel = void 0;
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const module_meta_1 = require("../../module/entities/module.meta");
|
|
8
|
-
exports.FeatureModel = {
|
|
9
|
-
...feature_meta_1.featureMeta,
|
|
10
|
-
entity: undefined,
|
|
11
|
-
mapper: feature_map_1.mapFeature,
|
|
12
|
-
serialiser: feature_serialiser_1.FeatureSerialiser,
|
|
13
|
-
childrenTokens: [module_meta_1.moduleMeta.nodeName],
|
|
14
|
-
};
|
|
4
|
+
// Backward-compatibility aliases for pre-descriptor consumers (e.g. stripe-price serialiser).
|
|
5
|
+
const feature_1 = require("./feature");
|
|
6
|
+
exports.FeatureModel = feature_1.FeatureDescriptor.model;
|
|
15
7
|
//# sourceMappingURL=feature.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.model.js","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"feature.model.js","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":";;;AAAA,8FAA8F;AAC9F,uCAA8C;AAEjC,QAAA,YAAY,GAAG,2BAAiB,CAAC,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"feature.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQtD,qBAKa,aAAc,YAAW,YAAY;IAChD,YAAY;CAGb"}
|
|
@@ -10,21 +10,20 @@ exports.FeatureModule = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const registry_1 = require("../../common/registries/registry");
|
|
12
12
|
const feature_controller_1 = require("./controllers/feature.controller");
|
|
13
|
-
const
|
|
14
|
-
const feature_serialiser_1 = require("./serialisers/feature.serialiser");
|
|
13
|
+
const feature_1 = require("./entities/feature");
|
|
15
14
|
const feature_repository_1 = require("./repositories/feature.repository");
|
|
16
15
|
const feature_service_1 = require("./services/feature.service");
|
|
17
16
|
let FeatureModule = class FeatureModule {
|
|
18
17
|
onModuleInit() {
|
|
19
|
-
registry_1.modelRegistry.register(
|
|
18
|
+
registry_1.modelRegistry.register(feature_1.FeatureDescriptor.model);
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
exports.FeatureModule = FeatureModule;
|
|
23
22
|
exports.FeatureModule = FeatureModule = __decorate([
|
|
24
23
|
(0, common_1.Module)({
|
|
25
24
|
controllers: [feature_controller_1.FeatureController],
|
|
26
|
-
providers: [feature_repository_1.FeatureRepository, feature_service_1.FeatureService,
|
|
27
|
-
exports: [feature_service_1.FeatureService, feature_repository_1.FeatureRepository,
|
|
25
|
+
providers: [feature_repository_1.FeatureRepository, feature_service_1.FeatureService, feature_1.FeatureDescriptor.model.serialiser],
|
|
26
|
+
exports: [feature_service_1.FeatureService, feature_repository_1.FeatureRepository, feature_1.FeatureDescriptor.model.serialiser],
|
|
28
27
|
})
|
|
29
28
|
], FeatureModule);
|
|
30
29
|
//# sourceMappingURL=feature.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.module.js","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AAEtD,+DAAiE;AACjE,yEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"feature.module.js","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AAEtD,+DAAiE;AACjE,yEAAqE;AACrE,gDAAuD;AACvD,0EAAsE;AACtE,gEAA4D;AAOrD,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,2BAAiB,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;CACF,CAAA;AAJY,sCAAa;wBAAb,aAAa;IALzB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,sCAAiB,EAAE,gCAAc,EAAE,2BAAiB,CAAC,KAAK,CAAC,UAAU,CAAC;QAClF,OAAO,EAAE,CAAC,gCAAc,EAAE,sCAAiB,EAAE,2BAAiB,CAAC,KAAK,CAAC,UAAU,CAAC;KACjF,CAAC;GACW,aAAa,CAIzB"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
export { FeatureModule } from "./feature.module";
|
|
2
|
+
export { Feature, FeatureDescriptor, FeatureDescriptorType } from "./entities/feature";
|
|
3
|
+
export { featureMeta } from "./entities/feature.meta";
|
|
4
|
+
export { FeatureModel } from "./entities/feature.model";
|
|
5
|
+
export { FeatureRepository } from "./repositories/feature.repository";
|
|
6
|
+
export { FeatureService } from "./services/feature.service";
|
|
7
|
+
export { FeatureDTO, FeatureDataDTO, FeatureDataListDTO } from "./dtos/feature.dto";
|
|
8
|
+
/**
|
|
9
|
+
* Compat alias: the hand-written FeatureSerialiser class was replaced by the
|
|
10
|
+
* descriptor's auto-generated serialiser. The exported name is kept so existing
|
|
11
|
+
* consumers (DI providers, serialiser factories) keep resolving.
|
|
12
|
+
*/
|
|
13
|
+
export declare const FeatureSerialiser: new (...args: any[]) => import("../..").SerialiserType;
|
|
2
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEpF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wDAAsC,CAAC"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FeatureModule = void 0;
|
|
3
|
+
exports.FeatureSerialiser = exports.FeatureDataListDTO = exports.FeatureDataDTO = exports.FeatureDTO = exports.FeatureService = exports.FeatureRepository = exports.FeatureModel = exports.featureMeta = exports.FeatureDescriptor = exports.FeatureModule = void 0;
|
|
4
|
+
const feature_1 = require("./entities/feature");
|
|
4
5
|
var feature_module_1 = require("./feature.module");
|
|
5
6
|
Object.defineProperty(exports, "FeatureModule", { enumerable: true, get: function () { return feature_module_1.FeatureModule; } });
|
|
7
|
+
var feature_2 = require("./entities/feature");
|
|
8
|
+
Object.defineProperty(exports, "FeatureDescriptor", { enumerable: true, get: function () { return feature_2.FeatureDescriptor; } });
|
|
9
|
+
var feature_meta_1 = require("./entities/feature.meta");
|
|
10
|
+
Object.defineProperty(exports, "featureMeta", { enumerable: true, get: function () { return feature_meta_1.featureMeta; } });
|
|
11
|
+
var feature_model_1 = require("./entities/feature.model");
|
|
12
|
+
Object.defineProperty(exports, "FeatureModel", { enumerable: true, get: function () { return feature_model_1.FeatureModel; } });
|
|
13
|
+
var feature_repository_1 = require("./repositories/feature.repository");
|
|
14
|
+
Object.defineProperty(exports, "FeatureRepository", { enumerable: true, get: function () { return feature_repository_1.FeatureRepository; } });
|
|
15
|
+
var feature_service_1 = require("./services/feature.service");
|
|
16
|
+
Object.defineProperty(exports, "FeatureService", { enumerable: true, get: function () { return feature_service_1.FeatureService; } });
|
|
17
|
+
var feature_dto_1 = require("./dtos/feature.dto");
|
|
18
|
+
Object.defineProperty(exports, "FeatureDTO", { enumerable: true, get: function () { return feature_dto_1.FeatureDTO; } });
|
|
19
|
+
Object.defineProperty(exports, "FeatureDataDTO", { enumerable: true, get: function () { return feature_dto_1.FeatureDataDTO; } });
|
|
20
|
+
Object.defineProperty(exports, "FeatureDataListDTO", { enumerable: true, get: function () { return feature_dto_1.FeatureDataListDTO; } });
|
|
21
|
+
/**
|
|
22
|
+
* Compat alias: the hand-written FeatureSerialiser class was replaced by the
|
|
23
|
+
* descriptor's auto-generated serialiser. The exported name is kept so existing
|
|
24
|
+
* consumers (DI providers, serialiser factories) keep resolving.
|
|
25
|
+
*/
|
|
26
|
+
exports.FeatureSerialiser = feature_1.FeatureDescriptor.model.serialiser;
|
|
6
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":";;;AAAA,gDAA6E;AAE7E,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,8CAAuF;AAArE,4GAAA,iBAAiB,OAAA;AACnC,wDAAsD;AAA7C,2GAAA,WAAW,OAAA;AACpB,0DAAwD;AAA/C,6GAAA,YAAY,OAAA;AACrB,wEAAsE;AAA7D,uHAAA,iBAAiB,OAAA;AAC1B,8DAA4D;AAAnD,iHAAA,cAAc,OAAA;AACvB,kDAAoF;AAA3E,yGAAA,UAAU,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAEvD;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,2BAAkB,CAAC,KAAK,CAAC,UAAU,CAAC"}
|
|
@@ -1,19 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { AppLoggingService } from "../../../core/logging/services/logging.service";
|
|
1
|
+
import { ClsService } from "nestjs-cls";
|
|
2
|
+
import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
|
|
4
3
|
import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { SecurityService } from "../../../core/security/services/security.service";
|
|
5
|
+
import { Feature, FeatureDescriptor } from "../entities/feature";
|
|
6
|
+
export declare class FeatureRepository extends AbstractRepository<Feature, typeof FeatureDescriptor.relationships> {
|
|
7
|
+
protected readonly descriptor: import("../../..").EntityDescriptor<Feature, {
|
|
8
|
+
module: {
|
|
9
|
+
model: import("../../..").DataMeta;
|
|
10
|
+
direction: "in";
|
|
11
|
+
relationship: string;
|
|
12
|
+
cardinality: "many";
|
|
13
|
+
dtoKey: string;
|
|
14
|
+
description: string;
|
|
15
|
+
reverse: {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
|
|
22
|
+
/**
|
|
23
|
+
* Companies opt into features via a (Company)-[:HAS_FEATURE]->(Feature) edge that
|
|
24
|
+
* is NOT modelled as a descriptor relationship (Feature.isCompanyScoped is false —
|
|
25
|
+
* it is a global entity many companies point to, not something a Feature "belongs"
|
|
26
|
+
* to). The explicit Company MATCH is the intended cross-tenant opt-in for a global
|
|
27
|
+
* entity, not a bypass of buildDefaultMatch(). Keep the name and signature stable —
|
|
28
|
+
* external consumers depend on them.
|
|
29
|
+
*/
|
|
11
30
|
findByCompany(params: {
|
|
12
31
|
companyId: string;
|
|
13
32
|
}): Promise<Feature[]>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Case-insensitive exact-name lookup — not the fulltext CONTAINS search the
|
|
35
|
+
* inherited find({ term }) performs. Feature is a global entity, so the bare
|
|
36
|
+
* label MATCH is correct here. Keep the name and signature stable — external
|
|
37
|
+
* consumers depend on them.
|
|
38
|
+
*/
|
|
39
|
+
findByName(params: {
|
|
40
|
+
name: string;
|
|
41
|
+
}): Promise<Feature>;
|
|
18
42
|
}
|
|
19
43
|
//# sourceMappingURL=feature.repository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/repositories/feature.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/repositories/feature.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGjE,qBACa,iBAAkB,SAAQ,kBAAkB,CAAC,OAAO,EAAE,OAAO,iBAAiB,CAAC,aAAa,CAAC;IACxG,SAAS,CAAC,QAAQ,CAAC,UAAU;;;;;;;;;;;;;OAAqB;gBAEtC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU;IAWzF;;;;;;;OAOG;IACG,aAAa,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAatE;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAa7D"}
|
|
@@ -11,54 +11,60 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FeatureRepository = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
|
-
const
|
|
14
|
+
const nestjs_cls_1 = require("nestjs-cls");
|
|
15
|
+
const abstract_repository_1 = require("../../../core/neo4j/abstracts/abstract.repository");
|
|
15
16
|
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
await this.neo4j.writeOne({
|
|
24
|
-
query: `CREATE CONSTRAINT feature_id IF NOT EXISTS FOR (feature:Feature) REQUIRE feature.id IS UNIQUE`,
|
|
25
|
-
});
|
|
17
|
+
const security_service_1 = require("../../../core/security/services/security.service");
|
|
18
|
+
const feature_1 = require("../entities/feature");
|
|
19
|
+
const feature_meta_1 = require("../entities/feature.meta");
|
|
20
|
+
let FeatureRepository = class FeatureRepository extends abstract_repository_1.AbstractRepository {
|
|
21
|
+
constructor(neo4j, securityService, clsService) {
|
|
22
|
+
super(neo4j, securityService, clsService);
|
|
23
|
+
this.descriptor = feature_1.FeatureDescriptor;
|
|
26
24
|
}
|
|
25
|
+
// onModuleInit() (id constraint + fulltext index) and find({ term, cursor, orderBy })
|
|
26
|
+
// (search + module relationship) are inherited — the descriptor declares `module` as a
|
|
27
|
+
// cardinality-many relationship, so buildReturnStatement() already emits the
|
|
28
|
+
// `OPTIONAL MATCH (feature)<-[:IN_FEATURE]-(feature_module:Module)` the old bespoke
|
|
29
|
+
// find() had, and the `name` string field auto-generates the fulltext index the
|
|
30
|
+
// inherited find() searches against for `term`.
|
|
31
|
+
/**
|
|
32
|
+
* Companies opt into features via a (Company)-[:HAS_FEATURE]->(Feature) edge that
|
|
33
|
+
* is NOT modelled as a descriptor relationship (Feature.isCompanyScoped is false —
|
|
34
|
+
* it is a global entity many companies point to, not something a Feature "belongs"
|
|
35
|
+
* to). The explicit Company MATCH is the intended cross-tenant opt-in for a global
|
|
36
|
+
* entity, not a bypass of buildDefaultMatch(). Keep the name and signature stable —
|
|
37
|
+
* external consumers depend on them.
|
|
38
|
+
*/
|
|
27
39
|
async findByCompany(params) {
|
|
28
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
29
|
-
query.queryParams = {
|
|
30
|
-
companyId: params.companyId,
|
|
31
|
-
};
|
|
40
|
+
const query = this.neo4j.initQuery({ serialiser: feature_1.FeatureDescriptor.model });
|
|
41
|
+
query.queryParams = { ...query.queryParams, companyId: params.companyId };
|
|
32
42
|
query.query = `
|
|
33
|
-
MATCH (company:Company {id: $companyId})-[:HAS_FEATURE]->(
|
|
34
|
-
RETURN
|
|
43
|
+
MATCH (company:Company {id: $companyId})-[:HAS_FEATURE]->(${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
|
|
44
|
+
RETURN ${feature_meta_1.featureMeta.nodeName}
|
|
35
45
|
`;
|
|
36
46
|
return this.neo4j.readMany(query);
|
|
37
47
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Case-insensitive exact-name lookup — not the fulltext CONTAINS search the
|
|
50
|
+
* inherited find({ term }) performs. Feature is a global entity, so the bare
|
|
51
|
+
* label MATCH is correct here. Keep the name and signature stable — external
|
|
52
|
+
* consumers depend on them.
|
|
53
|
+
*/
|
|
54
|
+
async findByName(params) {
|
|
55
|
+
const query = this.neo4j.initQuery({ serialiser: feature_1.FeatureDescriptor.model });
|
|
56
|
+
query.queryParams = { ...query.queryParams, name: params.name };
|
|
43
57
|
query.query = `
|
|
44
|
-
MATCH (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
WITH feature
|
|
48
|
-
ORDER BY feature.name ASC
|
|
49
|
-
{CURSOR}
|
|
50
|
-
|
|
51
|
-
OPTIONAL MATCH (feature)<-[:IN_FEATURE]-(feature_module:Module)
|
|
52
|
-
|
|
53
|
-
RETURN feature, feature_module
|
|
58
|
+
MATCH (${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
|
|
59
|
+
WHERE toLower(${feature_meta_1.featureMeta.nodeName}.name) = toLower($name)
|
|
60
|
+
${this.buildReturnStatement()}
|
|
54
61
|
`;
|
|
55
|
-
return this.neo4j.
|
|
62
|
+
return this.neo4j.readOne(query);
|
|
56
63
|
}
|
|
57
64
|
};
|
|
58
65
|
exports.FeatureRepository = FeatureRepository;
|
|
59
66
|
exports.FeatureRepository = FeatureRepository = __decorate([
|
|
60
67
|
(0, common_1.Injectable)(),
|
|
61
|
-
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService,
|
|
62
|
-
logging_service_1.AppLoggingService])
|
|
68
|
+
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService, security_service_1.SecurityService, nestjs_cls_1.ClsService])
|
|
63
69
|
], FeatureRepository);
|
|
64
70
|
//# sourceMappingURL=feature.repository.js.map
|