@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
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentDescriptor = void 0;
|
|
4
|
+
exports.buildContentDescriptor = buildContentDescriptor;
|
|
5
|
+
exports.getContentModel = getContentModel;
|
|
6
|
+
const ai_status_1 = require("../../../common/enums/ai.status");
|
|
7
|
+
const define_entity_1 = require("../../../common/helpers/define-entity");
|
|
8
|
+
const registry_1 = require("../../../common/registries/registry");
|
|
9
|
+
const user_meta_1 = require("../../user/entities/user.meta");
|
|
10
|
+
const content_meta_1 = require("./content.meta");
|
|
11
|
+
/**
|
|
12
|
+
* Builds the Content entity descriptor, optionally shaped by a
|
|
13
|
+
* {@link ContentExtensionConfig}.
|
|
14
|
+
*
|
|
15
|
+
* With NO config the descriptor is the exact wire contract of the legacy
|
|
16
|
+
* `ContentSerialiser`/`ContentModel` pair it replaces:
|
|
17
|
+
* - attributes: `name`, `abstract`, `tldr`
|
|
18
|
+
* - meta: `aiStatus`, `contentType`, `relevance`
|
|
19
|
+
* - relationships: `owner`, `author`
|
|
20
|
+
*
|
|
21
|
+
* Config effects:
|
|
22
|
+
* - `serialiseAuthor: false` removes the `author` relationship
|
|
23
|
+
* - `metaFields` adds one computed meta entry per entry, read from the Cypher
|
|
24
|
+
* RETURN alias produced by {@link ContentCypherService}
|
|
25
|
+
* - `additionalRelationships` adds one relationship per entry, keyed by the
|
|
26
|
+
* related model's `nodeName` (the key the Cypher RETURN alias
|
|
27
|
+
* `content_<nodeName>` maps onto)
|
|
28
|
+
*
|
|
29
|
+
* @param config - Optional Content extension configuration
|
|
30
|
+
*/
|
|
31
|
+
function buildContentDescriptor(config) {
|
|
32
|
+
const relationships = {
|
|
33
|
+
owner: {
|
|
34
|
+
model: user_meta_1.ownerMeta,
|
|
35
|
+
direction: "in",
|
|
36
|
+
relationship: "PUBLISHED",
|
|
37
|
+
cardinality: "one",
|
|
38
|
+
dtoKey: "owner",
|
|
39
|
+
description: "The user who published/owns the underlying record.",
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
// Default true — the package wire has always carried `author`. Apps whose
|
|
43
|
+
// content has no distinct author (a360ai) switch it off via config.
|
|
44
|
+
if (config?.serialiseAuthor !== false) {
|
|
45
|
+
relationships.author = {
|
|
46
|
+
model: user_meta_1.authorMeta,
|
|
47
|
+
direction: "in",
|
|
48
|
+
relationship: "PUBLISHED",
|
|
49
|
+
cardinality: "one",
|
|
50
|
+
dtoKey: "author",
|
|
51
|
+
description: "The user who authored the underlying record.",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
for (const relationship of config?.additionalRelationships ?? []) {
|
|
55
|
+
relationships[relationship.model.nodeName] = {
|
|
56
|
+
model: relationship.model,
|
|
57
|
+
direction: relationship.direction,
|
|
58
|
+
relationship: relationship.relationship,
|
|
59
|
+
cardinality: relationship.cardinality,
|
|
60
|
+
...(relationship.dtoKey ? { dtoKey: relationship.dtoKey } : {}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const computed = {
|
|
64
|
+
// Content carries no "contentType" property of its own — it is derived from
|
|
65
|
+
// the underlying node's Neo4j label at read time (old mapper: `params.data.labels[0]`).
|
|
66
|
+
contentType: {
|
|
67
|
+
compute: (params) => params.data?.labels?.[0],
|
|
68
|
+
meta: true,
|
|
69
|
+
description: 'The underlying Neo4j label of the record (e.g. "Article", "Document") — identifies which platform entity this content view represents.',
|
|
70
|
+
},
|
|
71
|
+
relevance: {
|
|
72
|
+
compute: (params) => (params.record.has("totalScore") ? Number(params.record.get("totalScore")) : 0),
|
|
73
|
+
meta: true,
|
|
74
|
+
description: "Relevance score computed against a reference entity by the relevancy engine. 0 outside a relevance query.",
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
for (const metaField of config?.metaFields ?? []) {
|
|
78
|
+
computed[metaField.key] = {
|
|
79
|
+
compute: (params) => params.record.has(metaField.key) ? (params.record.get(metaField.key) ?? undefined) : undefined,
|
|
80
|
+
meta: true,
|
|
81
|
+
description: metaField.description,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return (0, define_entity_1.defineEntity)()({
|
|
85
|
+
...content_meta_1.contentMeta,
|
|
86
|
+
isCompanyScoped: true,
|
|
87
|
+
description: "A generic, read-only view over any AI-summarised platform record. Used for cross-type search, listing by owner, and relevance ranking against another entity — Content is never created or updated directly.",
|
|
88
|
+
chat: {
|
|
89
|
+
summary: (d) => d.name ?? d.id,
|
|
90
|
+
textSearchFields: ["name", "abstract", "tldr"],
|
|
91
|
+
},
|
|
92
|
+
fields: {
|
|
93
|
+
name: {
|
|
94
|
+
type: "string",
|
|
95
|
+
required: true,
|
|
96
|
+
description: "The title of the underlying record (document name, article title, etc.).",
|
|
97
|
+
},
|
|
98
|
+
abstract: {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: "A short AI-generated abstract of the underlying record's content.",
|
|
101
|
+
},
|
|
102
|
+
tldr: {
|
|
103
|
+
type: "string",
|
|
104
|
+
description: "The AI-generated too-long-didn't-read summary of the underlying record.",
|
|
105
|
+
},
|
|
106
|
+
aiStatus: {
|
|
107
|
+
type: "string",
|
|
108
|
+
default: ai_status_1.AiStatus.Pending,
|
|
109
|
+
meta: true,
|
|
110
|
+
description: "The AI processing status of the underlying record (e.g. pending, in_progress, completed, failed).",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
computed,
|
|
114
|
+
relationships,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Content Entity Descriptor (no extension config).
|
|
119
|
+
*
|
|
120
|
+
* This is the descriptor to register in a graph catalog and to import from
|
|
121
|
+
* consuming apps. The descriptor actually used for serialisation at runtime is
|
|
122
|
+
* built by `ContentModule.forRoot()` from the module's configuration and
|
|
123
|
+
* published through `modelRegistry` — read it with {@link getContentModel}.
|
|
124
|
+
*/
|
|
125
|
+
exports.ContentDescriptor = buildContentDescriptor();
|
|
126
|
+
/**
|
|
127
|
+
* Get the Content model from the registry.
|
|
128
|
+
*
|
|
129
|
+
* `ContentModule.forRoot()` registers the CONFIGURED model (extension
|
|
130
|
+
* relationships, config-driven meta fields, optional author), so every read
|
|
131
|
+
* path must resolve the model through the registry rather than capturing
|
|
132
|
+
* {@link ContentDescriptor}.model at import time.
|
|
133
|
+
*/
|
|
134
|
+
function getContentModel() {
|
|
135
|
+
const model = registry_1.modelRegistry.get(content_meta_1.contentMeta.nodeName);
|
|
136
|
+
if (!model) {
|
|
137
|
+
throw new Error(`ContentModel not found in registry for nodeName: ${content_meta_1.contentMeta.nodeName}`);
|
|
138
|
+
}
|
|
139
|
+
return model;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../../src/foundations/content/entities/content.ts"],"names":[],"mappings":";;;AAmEA,wDAsGC;AAuBD,0CAMC;AArMD,+DAA2D;AAC3D,yEAAqE;AAOrE,kEAAoE;AAEpE,6DAAsE;AAEtE,iDAA6C;AAkC7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,sBAAsB,CACpC,MAA+B;IAE/B,MAAM,aAAa,GAAoC;QACrD,KAAK,EAAE;YACL,KAAK,EAAE,qBAAS;YAChB,SA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,EAAE,IAAI;gBACV,WAAW,EACT,mGAAmG;aACtG;SACF;QAED,QAAQ;QAER,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,sBAAsB,EAAE,CAAC;AAK1D;;;;;;;GAOG;AACH,SAAgB,eAAe;IAC7B,MAAM,KAAK,GAAG,wBAAa,CAAC,GAAG,CAAC,0BAAW,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oDAAoD,0BAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9F,CAAC;IACD,OAAO,KAAoC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export { ContentModule } from "./content.module";
|
|
2
|
-
export { Content } from "./entities/content
|
|
2
|
+
export { buildContentDescriptor, Content, ContentDescriptor, ContentDescriptorType, getContentModel, } from "./entities/content";
|
|
3
3
|
export { contentMeta } from "./entities/content.meta";
|
|
4
|
-
export {
|
|
5
|
-
export { createExtendedContentModel } from "./factories/content.model.factory";
|
|
6
|
-
export { ContentExtensionConfig, ContentRelationshipExtension, CONTENT_EXTENSION_CONFIG, } from "./interfaces/content.extension.interface";
|
|
4
|
+
export { ContentExtensionConfig, ContentMetaFieldExtension, ContentOwnerMatchPattern, ContentRelationshipExtension, CONTENT_DESCRIPTOR, CONTENT_EXTENSION_CONFIG, } from "./interfaces/content.extension.interface";
|
|
7
5
|
export { ContentRepository } from "./repositories/content.repository";
|
|
8
6
|
export { ContentCypherService } from "./services/content.cypher.service";
|
|
9
7
|
export { ContentService } from "./services/content.service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/content/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/content/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,OAAO,EACP,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContentService = exports.ContentCypherService = exports.ContentRepository = exports.CONTENT_EXTENSION_CONFIG = exports.
|
|
3
|
+
exports.ContentService = exports.ContentCypherService = exports.ContentRepository = exports.CONTENT_EXTENSION_CONFIG = exports.CONTENT_DESCRIPTOR = exports.contentMeta = exports.getContentModel = exports.ContentDescriptor = exports.buildContentDescriptor = exports.ContentModule = void 0;
|
|
4
4
|
var content_module_1 = require("./content.module");
|
|
5
5
|
Object.defineProperty(exports, "ContentModule", { enumerable: true, get: function () { return content_module_1.ContentModule; } });
|
|
6
|
+
var content_1 = require("./entities/content");
|
|
7
|
+
Object.defineProperty(exports, "buildContentDescriptor", { enumerable: true, get: function () { return content_1.buildContentDescriptor; } });
|
|
8
|
+
Object.defineProperty(exports, "ContentDescriptor", { enumerable: true, get: function () { return content_1.ContentDescriptor; } });
|
|
9
|
+
Object.defineProperty(exports, "getContentModel", { enumerable: true, get: function () { return content_1.getContentModel; } });
|
|
6
10
|
var content_meta_1 = require("./entities/content.meta");
|
|
7
11
|
Object.defineProperty(exports, "contentMeta", { enumerable: true, get: function () { return content_meta_1.contentMeta; } });
|
|
8
|
-
var content_model_1 = require("./entities/content.model");
|
|
9
|
-
Object.defineProperty(exports, "ContentModel", { enumerable: true, get: function () { return content_model_1.ContentModel; } });
|
|
10
|
-
var content_model_factory_1 = require("./factories/content.model.factory");
|
|
11
|
-
Object.defineProperty(exports, "createExtendedContentModel", { enumerable: true, get: function () { return content_model_factory_1.createExtendedContentModel; } });
|
|
12
12
|
var content_extension_interface_1 = require("./interfaces/content.extension.interface");
|
|
13
|
+
Object.defineProperty(exports, "CONTENT_DESCRIPTOR", { enumerable: true, get: function () { return content_extension_interface_1.CONTENT_DESCRIPTOR; } });
|
|
13
14
|
Object.defineProperty(exports, "CONTENT_EXTENSION_CONFIG", { enumerable: true, get: function () { return content_extension_interface_1.CONTENT_EXTENSION_CONFIG; } });
|
|
14
15
|
var content_repository_1 = require("./repositories/content.repository");
|
|
15
16
|
Object.defineProperty(exports, "ContentRepository", { enumerable: true, get: function () { return content_repository_1.ContentRepository; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/content/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/content/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,8CAM4B;AAL1B,iHAAA,sBAAsB,OAAA;AAEtB,4GAAA,iBAAiB,OAAA;AAEjB,0GAAA,eAAe,OAAA;AAEjB,wDAAsD;AAA7C,2GAAA,WAAW,OAAA;AACpB,wFAOkD;AAFhD,iIAAA,kBAAkB,OAAA;AAClB,uIAAA,wBAAwB,OAAA;AAE1B,wEAAsE;AAA7D,uHAAA,iBAAiB,OAAA;AAC1B,4EAAyE;AAAhE,8HAAA,oBAAoB,OAAA;AAC7B,8DAA4D;AAAnD,iHAAA,cAAc,OAAA"}
|
|
@@ -14,6 +14,65 @@ export interface ContentRelationshipExtension {
|
|
|
14
14
|
/** Optional JSON:API key override (e.g., "topics" instead of "topic") */
|
|
15
15
|
dtoKey?: string;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Describes how the Content → owner edge is matched in Cypher.
|
|
19
|
+
*
|
|
20
|
+
* Default (omitted): the historical directed single-type match
|
|
21
|
+
* `MATCH (content)<-[:PUBLISHED]-(content_owner:User)`.
|
|
22
|
+
*/
|
|
23
|
+
export interface ContentOwnerMatchPattern {
|
|
24
|
+
/**
|
|
25
|
+
* Neo4j relationship types accepted for the owner edge. Joined with `|`,
|
|
26
|
+
* so `["PUBLISHED", "FROM"]` becomes `[:PUBLISHED|FROM]`.
|
|
27
|
+
*/
|
|
28
|
+
relationships: string[];
|
|
29
|
+
/**
|
|
30
|
+
* When true the pattern is undirected (`(content)-[:…]-(owner)`) instead of
|
|
31
|
+
* the default incoming direction (`(content)<-[:…]-(owner)`).
|
|
32
|
+
*
|
|
33
|
+
* Needed when the owner edge points different ways for different underlying
|
|
34
|
+
* labels — e.g. a360ai's Email rows, where the edge is
|
|
35
|
+
* `(email)-[:FROM]->(user)` while every other content type is
|
|
36
|
+
* `(user)-[:PUBLISHED]->(content)`.
|
|
37
|
+
*/
|
|
38
|
+
undirected?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Adds one config-driven computed meta field to Content, fed by an extra
|
|
42
|
+
* OPTIONAL MATCH appended to the Content RETURN statement.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* // a360ai: expose the proceeding a memo belongs to as meta.proceedingId
|
|
47
|
+
* {
|
|
48
|
+
* key: "proceedingId",
|
|
49
|
+
* optionalMatch: "OPTIONAL MATCH (memoProceeding:Proceeding)-[:HAS_MEMO]->(content)",
|
|
50
|
+
* returnAlias: "memoProceeding.id",
|
|
51
|
+
* }
|
|
52
|
+
* // → OPTIONAL MATCH (memoProceeding:Proceeding)-[:HAS_MEMO]->(content)
|
|
53
|
+
* // → RETURN …, memoProceeding.id AS proceedingId
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export interface ContentMetaFieldExtension {
|
|
57
|
+
/**
|
|
58
|
+
* JSON:API meta key AND the Cypher RETURN alias the value is read from
|
|
59
|
+
* (the descriptor's computed field reads `record.get(key)`).
|
|
60
|
+
*/
|
|
61
|
+
key: string;
|
|
62
|
+
/**
|
|
63
|
+
* A complete Cypher clause appended verbatim before the RETURN — normally an
|
|
64
|
+
* `OPTIONAL MATCH …` binding the variable projected by `returnAlias`. It runs
|
|
65
|
+
* after the company/owner matches, so `content` is in scope.
|
|
66
|
+
*/
|
|
67
|
+
optionalMatch: string;
|
|
68
|
+
/**
|
|
69
|
+
* The Cypher expression to project, WITHOUT the alias: it is emitted as
|
|
70
|
+
* `${returnAlias} AS ${key}`. For the example above, `"memoProceeding.id"`.
|
|
71
|
+
*/
|
|
72
|
+
returnAlias: string;
|
|
73
|
+
/** Optional human-readable description for the graph catalog / chatbot. */
|
|
74
|
+
description?: string;
|
|
75
|
+
}
|
|
17
76
|
/**
|
|
18
77
|
* Configuration for extending Content module with additional relationships.
|
|
19
78
|
*
|
|
@@ -22,6 +81,10 @@ export interface ContentRelationshipExtension {
|
|
|
22
81
|
* - Included in JSON:API serialization
|
|
23
82
|
* - Mapped in entity results
|
|
24
83
|
*
|
|
84
|
+
* Every key beyond `additionalRelationships` is optional and defaults to the
|
|
85
|
+
* package's historical behaviour, so omitting the config (or passing only
|
|
86
|
+
* `additionalRelationships`) leaves the Content wire and Cypher unchanged.
|
|
87
|
+
*
|
|
25
88
|
* @example
|
|
26
89
|
* ```typescript
|
|
27
90
|
* const contentExtension: ContentExtensionConfig = {
|
|
@@ -36,13 +99,76 @@ export interface ContentRelationshipExtension {
|
|
|
36
99
|
* ],
|
|
37
100
|
* };
|
|
38
101
|
* ```
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* // a360ai's configuration — every non-default knob in one place
|
|
106
|
+
* const contentExtension: ContentExtensionConfig = {
|
|
107
|
+
* additionalRelationships: [],
|
|
108
|
+
* ownerMatchPattern: { relationships: ["PUBLISHED", "FROM"], undirected: true },
|
|
109
|
+
* requireTldr: true,
|
|
110
|
+
* metaFields: [
|
|
111
|
+
* {
|
|
112
|
+
* key: "proceedingId",
|
|
113
|
+
* optionalMatch: "OPTIONAL MATCH (memoProceeding:Proceeding)-[:HAS_MEMO]->(content)",
|
|
114
|
+
* returnAlias: "memoProceeding.id",
|
|
115
|
+
* },
|
|
116
|
+
* ],
|
|
117
|
+
* serialiseAuthor: false,
|
|
118
|
+
* };
|
|
119
|
+
* ```
|
|
39
120
|
*/
|
|
40
121
|
export interface ContentExtensionConfig {
|
|
41
122
|
additionalRelationships: ContentRelationshipExtension[];
|
|
123
|
+
/**
|
|
124
|
+
* Overrides the Content → owner Cypher match.
|
|
125
|
+
*
|
|
126
|
+
* Default (omitted): `MATCH (content)<-[:PUBLISHED]-(content_owner:User)` —
|
|
127
|
+
* byte-identical to the pre-config behaviour.
|
|
128
|
+
*
|
|
129
|
+
* a360ai: `{ relationships: ["PUBLISHED", "FROM"], undirected: true }`.
|
|
130
|
+
*/
|
|
131
|
+
ownerMatchPattern?: ContentOwnerMatchPattern;
|
|
132
|
+
/**
|
|
133
|
+
* When true, only records carrying a non-empty `tldr` are returned. The
|
|
134
|
+
* filter is applied BOTH to the default list match and to the `findByIds`
|
|
135
|
+
* lookup.
|
|
136
|
+
*
|
|
137
|
+
* Default (omitted / false): no tldr filter — every content record is
|
|
138
|
+
* returned, exactly as before.
|
|
139
|
+
*
|
|
140
|
+
* a360ai: `true` (Content is a view over AI-summarised records only).
|
|
141
|
+
*/
|
|
142
|
+
requireTldr?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Extra computed meta fields hydrated by additional OPTIONAL MATCH clauses.
|
|
145
|
+
*
|
|
146
|
+
* Default (omitted): no extra clauses and no extra meta keys.
|
|
147
|
+
*
|
|
148
|
+
* a360ai: the `proceedingId` entry documented on
|
|
149
|
+
* {@link ContentMetaFieldExtension}.
|
|
150
|
+
*/
|
|
151
|
+
metaFields?: ContentMetaFieldExtension[];
|
|
152
|
+
/**
|
|
153
|
+
* Whether the `author` relationship is matched and serialised.
|
|
154
|
+
*
|
|
155
|
+
* Default (omitted / true): the `author` relationship is part of the wire and
|
|
156
|
+
* of the Cypher RETURN, as it has always been.
|
|
157
|
+
*
|
|
158
|
+
* a360ai: `false` — a360ai content has no author distinct from the owner and
|
|
159
|
+
* its wire contract pins relationships to `["owner"]`.
|
|
160
|
+
*/
|
|
161
|
+
serialiseAuthor?: boolean;
|
|
42
162
|
}
|
|
43
163
|
/**
|
|
44
164
|
* Injection token for Content extension configuration.
|
|
45
165
|
* Use with @Optional() @Inject(CONTENT_EXTENSION_CONFIG) to make it optional.
|
|
46
166
|
*/
|
|
47
167
|
export declare const CONTENT_EXTENSION_CONFIG: unique symbol;
|
|
168
|
+
/**
|
|
169
|
+
* Injection token carrying the descriptor that `ContentModule.forRoot()` built
|
|
170
|
+
* from the module configuration. The module registers `descriptor.model` in
|
|
171
|
+
* `modelRegistry` on init; read paths resolve it with `getContentModel()`.
|
|
172
|
+
*/
|
|
173
|
+
export declare const CONTENT_DESCRIPTOR: unique symbol;
|
|
48
174
|
//# sourceMappingURL=content.extension.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.extension.interface.d.ts","sourceRoot":"","sources":["../../../../src/foundations/content/interfaces/content.extension.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,8EAA8E;IAC9E,KAAK,EAAE,QAAQ,CAAC;IAEhB,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;IAErB,6DAA6D;IAC7D,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;IAExB,+DAA+D;IAC/D,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC;IAE5B,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED
|
|
1
|
+
{"version":3,"file":"content.extension.interface.d.ts","sourceRoot":"","sources":["../../../../src/foundations/content/interfaces/content.extension.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,8EAA8E;IAC9E,KAAK,EAAE,QAAQ,CAAC;IAEhB,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;IAErB,6DAA6D;IAC7D,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;IAExB,+DAA+D;IAC/D,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC;IAE5B,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,WAAW,sBAAsB;IACrC,uBAAuB,EAAE,4BAA4B,EAAE,CAAC;IAExD;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IAE7C;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAEzC;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,eAA+B,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONTENT_EXTENSION_CONFIG = void 0;
|
|
3
|
+
exports.CONTENT_DESCRIPTOR = exports.CONTENT_EXTENSION_CONFIG = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Injection token for Content extension configuration.
|
|
6
6
|
* Use with @Optional() @Inject(CONTENT_EXTENSION_CONFIG) to make it optional.
|
|
7
7
|
*/
|
|
8
8
|
exports.CONTENT_EXTENSION_CONFIG = Symbol("CONTENT_EXTENSION_CONFIG");
|
|
9
|
+
/**
|
|
10
|
+
* Injection token carrying the descriptor that `ContentModule.forRoot()` built
|
|
11
|
+
* from the module configuration. The module registers `descriptor.model` in
|
|
12
|
+
* `modelRegistry` on init; read paths resolve it with `getContentModel()`.
|
|
13
|
+
*/
|
|
14
|
+
exports.CONTENT_DESCRIPTOR = Symbol("CONTENT_DESCRIPTOR");
|
|
9
15
|
//# sourceMappingURL=content.extension.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.extension.interface.js","sourceRoot":"","sources":["../../../../src/foundations/content/interfaces/content.extension.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"content.extension.interface.js","sourceRoot":"","sources":["../../../../src/foundations/content/interfaces/content.extension.interface.ts"],"names":[],"mappings":";;;AAmLA;;;GAGG;AACU,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAE3E;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import { Document } from "@langchain/core/documents";
|
|
2
1
|
import { ConfigService } from "@nestjs/config";
|
|
3
2
|
import { BaseConfigInterface } from "../../../config/interfaces";
|
|
4
3
|
import { JsonApiCursorInterface } from "../../../core/jsonapi/interfaces/jsonapi.cursor.interface";
|
|
5
4
|
import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
|
|
6
5
|
import { SecurityService } from "../../../core/security/services/security.service";
|
|
7
|
-
import { Content } from "../../content/entities/content
|
|
6
|
+
import { Content } from "../../content/entities/content";
|
|
8
7
|
import { ContentCypherService } from "../../content/services/content.cypher.service";
|
|
8
|
+
/**
|
|
9
|
+
* Content is a virtual, multi-label aggregate (the labels come from
|
|
10
|
+
* `baseConfig.contentTypes`) with no single Neo4j label of its own, so the
|
|
11
|
+
* inherited AbstractRepository query builders — which assume one
|
|
12
|
+
* `${labelName}` match — cannot express these reads. Every method below is
|
|
13
|
+
* genuinely custom and delegates its Cypher fragments to ContentCypherService.
|
|
14
|
+
*
|
|
15
|
+
* ContentCypherService is also handed, as an instance, to
|
|
16
|
+
* RelevancyService/RelevancyRepository by ContentController (duck-typed as
|
|
17
|
+
* `cypherService: any`, calling `.userHasAccess()` / `.returnStatement()`) for
|
|
18
|
+
* the `/contents/:id/relevance` endpoint. Do not delete it.
|
|
19
|
+
*/
|
|
9
20
|
export declare class ContentRepository {
|
|
10
21
|
private readonly neo4j;
|
|
11
22
|
private readonly contentCypherService;
|
|
@@ -13,10 +24,6 @@ export declare class ContentRepository {
|
|
|
13
24
|
private readonly configService;
|
|
14
25
|
constructor(neo4j: Neo4jService, contentCypherService: ContentCypherService, securityService: SecurityService, configService: ConfigService<BaseConfigInterface>);
|
|
15
26
|
private getContentTypes;
|
|
16
|
-
/**
|
|
17
|
-
* Get the ContentModel from registry (may be extended with additional childrenTokens)
|
|
18
|
-
*/
|
|
19
|
-
private getContentModel;
|
|
20
27
|
find(params: {
|
|
21
28
|
fetchAll?: boolean;
|
|
22
29
|
term?: string;
|
|
@@ -25,7 +32,7 @@ export declare class ContentRepository {
|
|
|
25
32
|
}): Promise<Content[]>;
|
|
26
33
|
findByIds(params: {
|
|
27
34
|
contentIds: string[];
|
|
28
|
-
}): Promise<
|
|
35
|
+
}): Promise<Content[]>;
|
|
29
36
|
findByOwner(params: {
|
|
30
37
|
ownerId: string;
|
|
31
38
|
term?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/content/repositories/content.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/content/repositories/content.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAA+B,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAmB,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAGrF;;;;;;;;;;;GAWG;AACH,qBACa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAHb,KAAK,EAAE,YAAY,EACnB,oBAAoB,EAAE,oBAAoB,EAC1C,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAAC;IAGpE,OAAO,CAAC,eAAe;IAKjB,IAAI,CAAC,MAAM,EAAE;QACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,sBAAsB,CAAC;KACjC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAyBhB,SAAS,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAkB/D,WAAW,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,sBAAsB,CAAC;KACjC;CA0BF"}
|
|
@@ -12,12 +12,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ContentRepository = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const config_1 = require("@nestjs/config");
|
|
15
|
-
const registry_1 = require("../../../common/registries/registry");
|
|
16
15
|
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
17
16
|
const security_service_1 = require("../../../core/security/services/security.service");
|
|
17
|
+
const content_1 = require("../../content/entities/content");
|
|
18
18
|
const content_meta_1 = require("../../content/entities/content.meta");
|
|
19
19
|
const content_cypher_service_1 = require("../../content/services/content.cypher.service");
|
|
20
20
|
const user_meta_1 = require("../../user/entities/user.meta");
|
|
21
|
+
/**
|
|
22
|
+
* Content is a virtual, multi-label aggregate (the labels come from
|
|
23
|
+
* `baseConfig.contentTypes`) with no single Neo4j label of its own, so the
|
|
24
|
+
* inherited AbstractRepository query builders — which assume one
|
|
25
|
+
* `${labelName}` match — cannot express these reads. Every method below is
|
|
26
|
+
* genuinely custom and delegates its Cypher fragments to ContentCypherService.
|
|
27
|
+
*
|
|
28
|
+
* ContentCypherService is also handed, as an instance, to
|
|
29
|
+
* RelevancyService/RelevancyRepository by ContentController (duck-typed as
|
|
30
|
+
* `cypherService: any`, calling `.userHasAccess()` / `.returnStatement()`) for
|
|
31
|
+
* the `/contents/:id/relevance` endpoint. Do not delete it.
|
|
32
|
+
*/
|
|
21
33
|
let ContentRepository = class ContentRepository {
|
|
22
34
|
constructor(neo4j, contentCypherService, securityService, configService) {
|
|
23
35
|
this.neo4j = neo4j;
|
|
@@ -29,20 +41,10 @@ let ContentRepository = class ContentRepository {
|
|
|
29
41
|
const types = this.configService.get("contentTypes")?.types ?? [];
|
|
30
42
|
return types.length > 0 ? types : [content_meta_1.contentMeta.labelName];
|
|
31
43
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Get the ContentModel from registry (may be extended with additional childrenTokens)
|
|
34
|
-
*/
|
|
35
|
-
getContentModel() {
|
|
36
|
-
const model = registry_1.modelRegistry.get(content_meta_1.contentMeta.nodeName);
|
|
37
|
-
if (!model) {
|
|
38
|
-
throw new Error(`ContentModel not found in registry for nodeName: ${content_meta_1.contentMeta.nodeName}`);
|
|
39
|
-
}
|
|
40
|
-
return model;
|
|
41
|
-
}
|
|
42
44
|
async find(params) {
|
|
43
45
|
const query = this.neo4j.initQuery({
|
|
44
46
|
cursor: params.cursor,
|
|
45
|
-
serialiser:
|
|
47
|
+
serialiser: (0, content_1.getContentModel)(),
|
|
46
48
|
fetchAll: params.fetchAll,
|
|
47
49
|
});
|
|
48
50
|
query.queryParams = {
|
|
@@ -61,14 +63,14 @@ let ContentRepository = class ContentRepository {
|
|
|
61
63
|
return this.neo4j.readMany(query);
|
|
62
64
|
}
|
|
63
65
|
async findByIds(params) {
|
|
64
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
66
|
+
const query = this.neo4j.initQuery({ serialiser: (0, content_1.getContentModel)() });
|
|
65
67
|
query.queryParams = {
|
|
66
68
|
...query.queryParams,
|
|
67
69
|
ids: params.contentIds,
|
|
68
70
|
};
|
|
69
71
|
query.query += `
|
|
70
72
|
MATCH (${content_meta_1.contentMeta.nodeName}:${this.getContentTypes().join("|")})-[:BELONGS_TO]->(company)
|
|
71
|
-
WHERE ${content_meta_1.contentMeta.nodeName}.id IN $ids
|
|
73
|
+
WHERE ${content_meta_1.contentMeta.nodeName}.id IN $ids${this.contentCypherService.tldrFilter()}
|
|
72
74
|
${this.securityService.userHasAccess({ validator: this.contentCypherService.userHasAccess })}
|
|
73
75
|
${this.contentCypherService.returnStatement()}
|
|
74
76
|
`;
|
|
@@ -76,7 +78,7 @@ let ContentRepository = class ContentRepository {
|
|
|
76
78
|
}
|
|
77
79
|
async findByOwner(params) {
|
|
78
80
|
const query = this.neo4j.initQuery({
|
|
79
|
-
serialiser:
|
|
81
|
+
serialiser: (0, content_1.getContentModel)(),
|
|
80
82
|
cursor: params.cursor,
|
|
81
83
|
fetchAll: params.fetchAll,
|
|
82
84
|
});
|
|
@@ -88,7 +90,7 @@ let ContentRepository = class ContentRepository {
|
|
|
88
90
|
query.query += `
|
|
89
91
|
${this.contentCypherService.default()}
|
|
90
92
|
${this.securityService.userHasAccess({ validator: this.contentCypherService.userHasAccess })}
|
|
91
|
-
|
|
93
|
+
${this.contentCypherService.ownerMatch({ target: `:${user_meta_1.ownerMeta.labelName} {id: $ownerId}` })}
|
|
92
94
|
|
|
93
95
|
ORDER BY ${content_meta_1.contentMeta.nodeName}.${params.orderBy ? `${params.orderBy}` : `updatedAt DESC`}
|
|
94
96
|
{CURSOR}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.repository.js","sourceRoot":"","sources":["../../../../src/foundations/content/repositories/content.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"content.repository.js","sourceRoot":"","sources":["../../../../src/foundations/content/repositories/content.repository.ts"],"names":[],"mappings":";;;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B,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC;QAEF,KAAK,CAAC,KAAK,IAAI;QACX,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE;QACnC,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;QAC1F,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,qBAAS,CAAC,SAAS,iBAAiB,EAAE,CAAC;;iBAEjF,0BAAW,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,gBAAgB;;;QAGxF,IAAI,CAAC,oBAAoB,CAAC,eAAe,EAAE;KAC9C,CAAC;QAEF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AA7FY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAGe,4BAAY;QACG,6CAAoB;QACzB,kCAAe;QACjB,sBAAa;GALpC,iBAAiB,CA6F7B"}
|
|
@@ -8,10 +8,29 @@ export declare class ContentCypherService {
|
|
|
8
8
|
private readonly extension?;
|
|
9
9
|
constructor(clsService: ClsService, configService: ConfigService<BaseConfigInterface>, extension?: ContentExtensionConfig);
|
|
10
10
|
private getContentTypes;
|
|
11
|
+
/** Whether the `author` relationship is matched and returned (default: yes). */
|
|
12
|
+
private get serialiseAuthor();
|
|
11
13
|
default(params?: {
|
|
12
14
|
searchField: string;
|
|
13
15
|
blockCompanyAndUser?: boolean;
|
|
14
16
|
}): string;
|
|
17
|
+
/**
|
|
18
|
+
* The `requireTldr` filter as trailing `AND` predicates, for callers that
|
|
19
|
+
* already opened a WHERE clause of their own (e.g. `ContentRepository.findByIds`).
|
|
20
|
+
* Returns an empty string when the filter is disabled (the default).
|
|
21
|
+
*/
|
|
22
|
+
tldrFilter(): string;
|
|
23
|
+
/**
|
|
24
|
+
* The Content → owner MATCH clause, driven by `ownerMatchPattern`.
|
|
25
|
+
*
|
|
26
|
+
* Default: `MATCH (content)<-[:PUBLISHED]-(<target>)`.
|
|
27
|
+
*
|
|
28
|
+
* @param params.target - The pattern's node body, e.g. `"content_owner:User"`
|
|
29
|
+
* (bind an alias) or `":User {id: $ownerId}"` (filter without binding).
|
|
30
|
+
*/
|
|
31
|
+
ownerMatch(params: {
|
|
32
|
+
target: string;
|
|
33
|
+
}): string;
|
|
15
34
|
userHasAccess: (params?: {
|
|
16
35
|
useTotalScore?: boolean;
|
|
17
36
|
}) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.cypher.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.cypher.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAA+B,MAAM,4BAA4B,CAAC;AAI9F,OAAO,EAAE,sBAAsB,EAA4B,MAAM,2CAA2C,CAAC;AAE7G,qBACa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAG9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAJV,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAGjD,SAAS,CAAC,EAAE,sBAAsB;IAGrD,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,MAAM,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"content.cypher.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.cypher.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAA+B,MAAM,4BAA4B,CAAC;AAI9F,OAAO,EAAE,sBAAsB,EAA4B,MAAM,2CAA2C,CAAC;AAE7G,qBACa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAG9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAJV,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAGjD,SAAS,CAAC,EAAE,sBAAsB;IAGrD,OAAO,CAAC,eAAe;IAKvB,gFAAgF;IAChF,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,CAAC,MAAM,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM;IAiBhF;;;;OAIG;IACH,UAAU,IAAI,MAAM;IAQpB;;;;;;;OAOG;IACH,UAAU,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAU9C,aAAa,GAAI,SAAS;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,KAAG,MAAM,CAO5D;IAEF,eAAe,GAAI,SAAS;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,YA0ErD;CACH"}
|