@carlonicora/nestjs-neo4jsonapi 1.115.0 → 1.116.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.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 +64 -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 +1 -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/config.auth.interface.d.ts +7 -0
- package/dist/config/interfaces/config.auth.interface.d.ts.map +1 -1
- 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/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 +22 -18
- package/dist/core/email/services/email.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/entities/company.d.ts +1 -1
- package/dist/foundations/company/entities/company.d.ts.map +1 -1
- package/dist/foundations/company/entities/company.js +15 -1
- 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 +65 -9
- package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
- package/dist/foundations/company/repositories/company.repository.js +59 -18
- package/dist/foundations/company/repositories/company.repository.js.map +1 -1
- package/dist/foundations/company/services/company.service.d.ts +44 -4
- package/dist/foundations/company/services/company.service.d.ts.map +1 -1
- package/dist/foundations/company/services/company.service.js +33 -7
- 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/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/tokenusage/entities/tokenusage.d.ts +49 -0
- package/dist/foundations/tokenusage/entities/tokenusage.d.ts.map +1 -0
- package/dist/foundations/tokenusage/entities/tokenusage.js +64 -0
- package/dist/foundations/tokenusage/entities/tokenusage.js.map +1 -0
- package/dist/foundations/tokenusage/index.d.ts +2 -2
- 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 +33 -5
- package/dist/foundations/tokenusage/repositories/tokenusage.repository.d.ts.map +1 -1
- package/dist/foundations/tokenusage/repositories/tokenusage.repository.js +40 -14
- package/dist/foundations/tokenusage/repositories/tokenusage.repository.js.map +1 -1
- package/dist/foundations/tokenusage/services/tokenusage.service.d.ts +36 -9
- package/dist/foundations/tokenusage/services/tokenusage.service.d.ts.map +1 -1
- package/dist/foundations/tokenusage/services/tokenusage.service.js +32 -3
- 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/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 +1 -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 +0 -3
- package/dist/foundations/auth/entities/pending-auth.entity.js.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.map.d.ts +0 -6
- package/dist/foundations/auth/entities/pending-auth.map.d.ts.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.map.js +0 -20
- package/dist/foundations/auth/entities/pending-auth.map.js.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.model.d.ts +0 -9
- package/dist/foundations/auth/entities/pending-auth.model.d.ts.map +0 -1
- package/dist/foundations/auth/entities/pending-auth.model.js +0 -19
- package/dist/foundations/auth/entities/pending-auth.model.js.map +0 -1
- package/dist/foundations/auth/serialisers/auth.serialiser.d.ts +0 -13
- package/dist/foundations/auth/serialisers/auth.serialiser.d.ts.map +0 -1
- package/dist/foundations/auth/serialisers/auth.serialiser.js +0 -52
- package/dist/foundations/auth/serialisers/auth.serialiser.js.map +0 -1
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts +0 -18
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts.map +0 -1
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.js +0 -49
- package/dist/foundations/auth/serialisers/pending-auth.serialiser.js.map +0 -1
- package/dist/foundations/content/entities/content.entity.d.ts +0 -31
- package/dist/foundations/content/entities/content.entity.d.ts.map +0 -1
- package/dist/foundations/content/entities/content.entity.js +0 -3
- package/dist/foundations/content/entities/content.entity.js.map +0 -1
- package/dist/foundations/content/entities/content.map.d.ts +0 -8
- package/dist/foundations/content/entities/content.map.d.ts.map +0 -1
- package/dist/foundations/content/entities/content.map.js +0 -19
- package/dist/foundations/content/entities/content.map.js.map +0 -1
- package/dist/foundations/content/entities/content.model.d.ts +0 -4
- package/dist/foundations/content/entities/content.model.d.ts.map +0 -1
- package/dist/foundations/content/entities/content.model.js +0 -16
- package/dist/foundations/content/entities/content.model.js.map +0 -1
- package/dist/foundations/content/factories/content.model.factory.d.ts +0 -17
- package/dist/foundations/content/factories/content.model.factory.d.ts.map +0 -1
- package/dist/foundations/content/factories/content.model.factory.js +0 -65
- package/dist/foundations/content/factories/content.model.factory.js.map +0 -1
- package/dist/foundations/content/serialisers/content.serialiser.d.ts +0 -14
- package/dist/foundations/content/serialisers/content.serialiser.d.ts.map +0 -1
- package/dist/foundations/content/serialisers/content.serialiser.js +0 -78
- package/dist/foundations/content/serialisers/content.serialiser.js.map +0 -1
- package/dist/foundations/feature/entities/feature.entity.d.ts +0 -8
- package/dist/foundations/feature/entities/feature.entity.d.ts.map +0 -1
- package/dist/foundations/feature/entities/feature.entity.js +0 -3
- package/dist/foundations/feature/entities/feature.entity.js.map +0 -1
- package/dist/foundations/feature/entities/feature.map.d.ts +0 -8
- package/dist/foundations/feature/entities/feature.map.d.ts.map +0 -1
- package/dist/foundations/feature/entities/feature.map.js +0 -14
- package/dist/foundations/feature/entities/feature.map.js.map +0 -1
- package/dist/foundations/feature/serialisers/feature.serialiser.d.ts +0 -12
- package/dist/foundations/feature/serialisers/feature.serialiser.d.ts.map +0 -1
- package/dist/foundations/feature/serialisers/feature.serialiser.js +0 -45
- package/dist/foundations/feature/serialisers/feature.serialiser.js.map +0 -1
- package/dist/foundations/notification/entities/notification.entity.d.ts +0 -10
- package/dist/foundations/notification/entities/notification.entity.d.ts.map +0 -1
- package/dist/foundations/notification/entities/notification.entity.js +0 -3
- package/dist/foundations/notification/entities/notification.entity.js.map +0 -1
- package/dist/foundations/notification/entities/notification.map.d.ts +0 -8
- package/dist/foundations/notification/entities/notification.map.d.ts.map +0 -1
- package/dist/foundations/notification/entities/notification.map.js +0 -16
- package/dist/foundations/notification/entities/notification.map.js.map +0 -1
- package/dist/foundations/notification/entities/notification.model.d.ts +0 -4
- package/dist/foundations/notification/entities/notification.model.d.ts.map +0 -1
- package/dist/foundations/notification/entities/notification.model.js +0 -15
- package/dist/foundations/notification/entities/notification.model.js.map +0 -1
- package/dist/foundations/notification/interfaces/notification.service.interface.d.ts +0 -4
- package/dist/foundations/notification/interfaces/notification.service.interface.d.ts.map +0 -1
- package/dist/foundations/notification/interfaces/notification.service.interface.js +0 -3
- package/dist/foundations/notification/interfaces/notification.service.interface.js.map +0 -1
- package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts +0 -12
- package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts.map +0 -1
- package/dist/foundations/notification/serialisers/notifications.serialiser.js +0 -47
- package/dist/foundations/notification/serialisers/notifications.serialiser.js.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts +0 -11
- package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.entity.js +0 -3
- package/dist/foundations/tokenusage/entities/tokenusage.entity.js.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts +0 -8
- package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.map.js +0 -17
- package/dist/foundations/tokenusage/entities/tokenusage.map.js.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts +0 -4
- package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts.map +0 -1
- package/dist/foundations/tokenusage/entities/tokenusage.model.js +0 -15
- package/dist/foundations/tokenusage/entities/tokenusage.model.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dump.js","sourceRoot":"","sources":["../../../src/foundations/rbac/dump.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dump.js","sourceRoot":"","sources":["../../../src/foundations/rbac/dump.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2KA,wCAmDC;AA9ND,uCAAyB;AACzB,2CAA6B;AAG7B,4DAAgE;AA0FhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACI,KAAK,UAAU,cAAc,CAAC,IAA2B;IAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7F,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;QAC5G,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CACnC,sHAAsH,CACvH,CAAC;QAEF,MAAM,MAAM,GAAe,EAAE,CAAC;QAE9B,KAAK,MAAM,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;YACxC,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/B,MAAM,WAAW,GAAkB,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC1D,IAAI,CAAC,QAAQ;gBAAE,SAAS;YACxB,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EA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C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACtG,CAAC"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import type { RbacMatrix } from "../dsl/types";
|
|
2
|
+
/**
|
|
3
|
+
* Import lines emitted at the head of the generated file when the caller does
|
|
4
|
+
* not supply `importLines`. These are the neural-erp conventions and are kept
|
|
5
|
+
* verbatim so the default output stays byte-identical for existing consumers.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_IMPORT_LINES: readonly string[];
|
|
2
8
|
interface Options {
|
|
3
9
|
roleNames: Record<string, string>;
|
|
4
10
|
moduleNames: Record<string, string>;
|
|
11
|
+
/**
|
|
12
|
+
* Import lines emitted verbatim at the head of the generated file, in order.
|
|
13
|
+
* Supply this when the consuming app's `RoleId` / `ModuleId` / module-paths
|
|
14
|
+
* map do not live where {@link DEFAULT_IMPORT_LINES} expects them — the
|
|
15
|
+
* generated file must be re-generatable without hand-editing its header.
|
|
16
|
+
* Omit to keep the default (byte-identical) output.
|
|
17
|
+
*/
|
|
18
|
+
importLines?: string[];
|
|
5
19
|
}
|
|
6
20
|
/**
|
|
7
21
|
* Serialise an RbacMatrix to formatted TypeScript source.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix-to-ts.d.ts","sourceRoot":"","sources":["../../../../src/foundations/rbac/serializer/matrix-to-ts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,cAAc,CAAC;AAE1D,UAAU,OAAO;IACf,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"matrix-to-ts.d.ts","sourceRoot":"","sources":["../../../../src/foundations/rbac/serializer/matrix-to-ts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,cAAc,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAIjD,CAAC;AAEF,UAAU,OAAO;IACf,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAkC5F"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_IMPORT_LINES = void 0;
|
|
3
4
|
exports.serializeMatrixToTs = serializeMatrixToTs;
|
|
5
|
+
/**
|
|
6
|
+
* Import lines emitted at the head of the generated file when the caller does
|
|
7
|
+
* not supply `importLines`. These are the neural-erp conventions and are kept
|
|
8
|
+
* verbatim so the default output stays byte-identical for existing consumers.
|
|
9
|
+
*/
|
|
10
|
+
exports.DEFAULT_IMPORT_LINES = [
|
|
11
|
+
`import { RoleId, ModuleId } from "@neural-erp/shared";`,
|
|
12
|
+
`import { perm, defineRbac } from "@carlonicora/nestjs-neo4jsonapi";`,
|
|
13
|
+
`import { MODULE_USER_PATHS } from "../features/rbac/module-relationships.map";`,
|
|
14
|
+
];
|
|
4
15
|
/**
|
|
5
16
|
* Serialise an RbacMatrix to formatted TypeScript source.
|
|
6
17
|
* Deterministic: module and role keys are sorted by UUID; tokens are
|
|
@@ -12,9 +23,8 @@ async function serializeMatrixToTs(matrix, opts) {
|
|
|
12
23
|
const lines = [];
|
|
13
24
|
lines.push(`// Auto-maintained by the RBAC UI. Edit via \`pnpm dev\` + UI, or by hand.`);
|
|
14
25
|
lines.push(``);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
lines.push(`import { MODULE_USER_PATHS } from "../features/rbac/module-relationships.map";`);
|
|
26
|
+
for (const line of opts?.importLines ?? exports.DEFAULT_IMPORT_LINES)
|
|
27
|
+
lines.push(line);
|
|
18
28
|
lines.push(``);
|
|
19
29
|
lines.push(`export const rbac = defineRbac<typeof MODULE_USER_PATHS>({`);
|
|
20
30
|
for (const moduleId of moduleIds) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix-to-ts.js","sourceRoot":"","sources":["../../../../src/foundations/rbac/serializer/matrix-to-ts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"matrix-to-ts.js","sourceRoot":"","sources":["../../../../src/foundations/rbac/serializer/matrix-to-ts.ts"],"names":[],"mappings":";;;AAoCA,kDAkCC;AAhED;;;;GAIG;AACU,QAAA,oBAAoB,GAAsB;IACrD,wDAAwD;IACxD,qEAAqE;IACrE,gFAAgF;CACjF,CAAC;AAgBF;;;;GAIG;AACI,KAAK,UAAU,mBAAmB,CAAC,MAAkB,EAAE,IAAa;IACzE,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IACpD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;IACzF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,WAAW,IAAI,4BAAoB;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IA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AC;SACD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;IAC1C,CAAC,CAAC,CAAC;IACL,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relevancy.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/relevancy/repositories/relevancy.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,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,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AAEzG,OAAO,EAAkB,IAAI,EAAE,MAAM,YAAY,CAAC;AAElD,qBACa,mBAAmB,CAAC,CAAC,CAAE,YAAW,4BAA4B,CAAC,CAAC,CAAC;IAE1E,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,KAAK,EAAE,YAAY,EACnB,eAAe,EAAE,eAAe;YAGrC,aAAa;
|
|
1
|
+
{"version":3,"file":"relevancy.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/relevancy/repositories/relevancy.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,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,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AAEzG,OAAO,EAAkB,IAAI,EAAE,MAAM,YAAY,CAAC;AAElD,qBACa,mBAAmB,CAAC,CAAC,CAAE,YAAW,4BAA4B,CAAC,CAAC,CAAC;IAE1E,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,KAAK,EAAE,YAAY,EACnB,eAAe,EAAE,eAAe;YAGrC,aAAa;YAoCb,qBAAqB;IAoC7B,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE;QAC1B,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAC7B,aAAa,EAAE,GAAG,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,sBAAsB,CAAC;KAChC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAUV,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE;QACxB,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAC7B,aAAa,EAAE,GAAG,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,sBAAsB,CAAC;KAChC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IASV,aAAa,CAAC,MAAM,EAAE;QAAE,aAAa,EAAE,GAAG,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,sBAAsB,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAgBjH"}
|
|
@@ -29,8 +29,14 @@ let RelevancyRepository = class RelevancyRepository {
|
|
|
29
29
|
const validator = () => params.cypherService.userHasAccess({ useTotalScore: true });
|
|
30
30
|
query.query += `${(0, relevance_1.contentQuery)({})}
|
|
31
31
|
WITH content as ${params.model.nodeName}, totalScore
|
|
32
|
-
WHERE ${params.model.nodeName}.id <>
|
|
32
|
+
WHERE ${params.model.nodeName}.id <> $id
|
|
33
33
|
AND totalScore > 20
|
|
34
|
+
${query.queryParams.companyId ? `MATCH (company:Company {id: $companyId})` : ``}
|
|
35
|
+
${query.queryParams.currentUserId
|
|
36
|
+
? query.queryParams.companyId
|
|
37
|
+
? `MATCH (currentUser:User {id: $currentUserId})-[:BELONGS_TO]->(company)`
|
|
38
|
+
: `MATCH (currentUser:User {id: $currentUserId})`
|
|
39
|
+
: ``}
|
|
34
40
|
|
|
35
41
|
${this.securityService.userHasAccess({ validator: validator })}
|
|
36
42
|
${params.cypherService.returnStatement({ useTotalScore: true })}
|
|
@@ -48,6 +54,12 @@ let RelevancyRepository = class RelevancyRepository {
|
|
|
48
54
|
WITH content as ${params.model.nodeName}, totalScore
|
|
49
55
|
OPTIONAL MATCH (${params.model.nodeName})-[:AUTHORED_BY]->(${params.model.nodeName}_author:User)
|
|
50
56
|
WHERE ${params.model.nodeName}_author.id <> $id
|
|
57
|
+
${query.queryParams.companyId ? `MATCH (company:Company {id: $companyId})` : ``}
|
|
58
|
+
${query.queryParams.currentUserId
|
|
59
|
+
? query.queryParams.companyId
|
|
60
|
+
? `MATCH (currentUser:User {id: $currentUserId})-[:BELONGS_TO]->(company)`
|
|
61
|
+
: `MATCH (currentUser:User {id: $currentUserId})`
|
|
62
|
+
: ``}
|
|
51
63
|
|
|
52
64
|
${this.securityService.userHasAccess({ validator: validator })}
|
|
53
65
|
${params.cypherService.returnStatement({ useTotalScore: true })}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relevancy.repository.js","sourceRoot":"","sources":["../../../../src/foundations/relevancy/repositories/relevancy.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,8EAA0E;AAC1E,uFAAmF;AAEnF,iEAAoG;AACpG,qCAAkD;AAG3C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,KAAmB,EACnB,eAAgC;QADhC,UAAK,GAAL,KAAK,CAAc;QACnB,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAEI,KAAK,CAAC,aAAa,CAAI,MAM9B;QACC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAExF,KAAK,CAAC,WAAW,GAAG;YAClB,GAAG,KAAK,CAAC,WAAW;YACpB,EAAE,EAAE,MAAM,CAAC,EAAE;SACd,CAAC;QAEF,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAE5F,KAAK,CAAC,KAAK,IAAI,GAAG,IAAA,wBAAY,EAAC,EAAE,CAAC;wBACd,MAAM,CAAC,KAAK,CAAC,QAAQ;cAC/B,MAAM,CAAC,KAAK,CAAC,QAAQ,WAAW,
|
|
1
|
+
{"version":3,"file":"relevancy.repository.js","sourceRoot":"","sources":["../../../../src/foundations/relevancy/repositories/relevancy.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,8EAA0E;AAC1E,uFAAmF;AAEnF,iEAAoG;AACpG,qCAAkD;AAG3C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,KAAmB,EACnB,eAAgC;QADhC,UAAK,GAAL,KAAK,CAAc;QACnB,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAEI,KAAK,CAAC,aAAa,CAAI,MAM9B;QACC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAExF,KAAK,CAAC,WAAW,GAAG;YAClB,GAAG,KAAK,CAAC,WAAW;YACpB,EAAE,EAAE,MAAM,CAAC,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aAAa,CAAC,MAA0E;QAC5F,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,qBAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAEhG,KAAK,CAAC,WAAW,GAAG;YAClB,GAAG,KAAK,CAAC,WAAW;YACpB,EAAE,EAAE,MAAM,CAAC,EAAE;SACd,CAAC;QAEF,KAAK,CAAC,KAAK,IAAI;QACX,IAAA,gCAAoB,EAAC,EAAE,CAAC;;;KAG3B,CAAC;QAEF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AA3HY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAGe,4BAAY;QACF,kCAAe;GAHxC,mBAAmB,CA2H/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../../src/foundations/role/entities/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../../src/foundations/role/entities/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAI9D;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;EAqBzB,CAAC;AAGH,MAAM,MAAM,kBAAkB,GAAG,OAAO,cAAc,CAAC"}
|
|
@@ -18,4 +18,7 @@ export * from "../stripe-subscription";
|
|
|
18
18
|
export * from "../stripe-invoice";
|
|
19
19
|
export * from "../stripe-usage";
|
|
20
20
|
export * from "../stripe-webhook";
|
|
21
|
+
export * from "../stripe-product";
|
|
22
|
+
export * from "../stripe-promotion-code";
|
|
23
|
+
export * from "../stripe-trial";
|
|
21
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/stripe/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kCAAkC,CAAC;AAGjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AAGjD,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,wBAAwB,CAAC;AAGvC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/stripe/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kCAAkC,CAAC;AAGjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AAGjD,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,wBAAwB,CAAC;AAGvC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,iBAAiB,CAAC"}
|
|
@@ -46,4 +46,10 @@ __exportStar(require("../stripe-invoice"), exports);
|
|
|
46
46
|
__exportStar(require("../stripe-usage"), exports);
|
|
47
47
|
// Re-export stripe-webhook module for backward compatibility
|
|
48
48
|
__exportStar(require("../stripe-webhook"), exports);
|
|
49
|
+
// Re-export stripe-product module for backward compatibility
|
|
50
|
+
__exportStar(require("../stripe-product"), exports);
|
|
51
|
+
// Re-export stripe-promotion-code module for backward compatibility
|
|
52
|
+
__exportStar(require("../stripe-promotion-code"), exports);
|
|
53
|
+
// Re-export stripe-trial module for backward compatibility
|
|
54
|
+
__exportStar(require("../stripe-trial"), exports);
|
|
49
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/stripe/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,SAAS;AACT,kDAAgC;AAEhC,cAAc;AACd,mEAAiD;AAEjD,iCAAiC;AACjC,4DAA0C;AAC1C,oEAAkD;AAClD,mEAAiD;AAEjD,4BAA4B;AAC5B,6DAA2C;AAE3C,OAAO;AACP,iEAA+C;AAE/C,iBAAiB;AACjB,yDAAuC;AAEvC,8DAA8D;AAC9D,qDAAmC;AAEnC,2DAA2D;AAC3D,kDAAgC;AAEhC,kEAAkE;AAClE,yDAAuC;AAEvC,6DAA6D;AAC7D,oDAAkC;AAElC,2DAA2D;AAC3D,kDAAgC;AAEhC,6DAA6D;AAC7D,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/stripe/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,SAAS;AACT,kDAAgC;AAEhC,cAAc;AACd,mEAAiD;AAEjD,iCAAiC;AACjC,4DAA0C;AAC1C,oEAAkD;AAClD,mEAAiD;AAEjD,4BAA4B;AAC5B,6DAA2C;AAE3C,OAAO;AACP,iEAA+C;AAE/C,iBAAiB;AACjB,yDAAuC;AAEvC,8DAA8D;AAC9D,qDAAmC;AAEnC,2DAA2D;AAC3D,kDAAgC;AAEhC,kEAAkE;AAClE,yDAAuC;AAEvC,6DAA6D;AAC7D,oDAAkC;AAElC,2DAA2D;AAC3D,kDAAgC;AAEhC,6DAA6D;AAC7D,oDAAkC;AAElC,6DAA6D;AAC7D,oDAAkC;AAElC,oEAAoE;AACpE,2DAAyC;AAEzC,2DAA2D;AAC3D,kDAAgC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity } from "../../../common/abstracts/entity";
|
|
2
2
|
import { StripeProduct } from "../../stripe-product/entities/stripe-product.entity";
|
|
3
|
-
import { Feature } from "../../feature/entities/feature
|
|
3
|
+
import type { Feature } from "../../feature/entities/feature";
|
|
4
4
|
export type StripePriceType = "one_time" | "recurring";
|
|
5
5
|
export type StripePriceRecurringInterval = "day" | "week" | "month" | "year";
|
|
6
6
|
export type StripePriceRecurringUsageType = "licensed" | "metered";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-price.entity.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stripe-price.entity.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,CAAC;AACvD,MAAM,MAAM,4BAA4B,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,6BAA6B,GAAG,UAAU,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;IACjD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,6BAA6B,CAAC;IAEnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Entity } from "../../../common/abstracts/entity";
|
|
2
|
+
import { Company } from "../../company/entities/company";
|
|
3
|
+
/**
|
|
4
|
+
* TokenUsage Entity Type
|
|
5
|
+
*
|
|
6
|
+
* An accounting record of a single LLM (large-language-model) call made by the
|
|
7
|
+
* platform: how many tokens it consumed and what it cost. Written automatically
|
|
8
|
+
* by the LLM call paths (see `TokenUsageService.recordTokenUsage`) — never
|
|
9
|
+
* created or edited directly by end users.
|
|
10
|
+
*/
|
|
11
|
+
export type TokenUsage = Entity & {
|
|
12
|
+
inputTokens: number;
|
|
13
|
+
outputTokens: number;
|
|
14
|
+
cachedInputTokens?: number;
|
|
15
|
+
cost?: number;
|
|
16
|
+
tokenUsageType: string;
|
|
17
|
+
company: Company;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* TokenUsage Entity Descriptor
|
|
21
|
+
*
|
|
22
|
+
* Replaces the hand-written `TokenUsageModel` (`entities/tokenusage.model.ts`,
|
|
23
|
+
* deleted), whose `serialiser` was `undefined` — the entity had no JSON:API
|
|
24
|
+
* wire at all. This descriptor is therefore the FIRST tokenusage serialiser:
|
|
25
|
+
* every attribute below is new on the wire for consuming apps, with no prior
|
|
26
|
+
* consumer to constrain it.
|
|
27
|
+
*
|
|
28
|
+
* Relationship-parity note: the old model declared `childrenTokens: []` and
|
|
29
|
+
* `singleChildrenTokens: [companyMeta.nodeName]`, so no relationships are
|
|
30
|
+
* declared here either (`isCompanyScoped: true` reinstates the company token).
|
|
31
|
+
* Real graph edges exist — BELONGS_TO (company), TRIGGERED_BY (user), USED_FOR
|
|
32
|
+
* (the polymorphic target entity, see `TokenUsageRepository.create()`) — but
|
|
33
|
+
* were never part of the JSON:API surface. USED_FOR in particular is
|
|
34
|
+
* polymorphic (any entity label), which the descriptor's fixed-target
|
|
35
|
+
* `relationships` shape cannot express as a single relationship.
|
|
36
|
+
*
|
|
37
|
+
* `tokenUsageType` stays `type: "string"`: the set of operations that record
|
|
38
|
+
* usage is application-specific, so consuming apps narrow it with their own
|
|
39
|
+
* enum rather than the package pinning one.
|
|
40
|
+
*
|
|
41
|
+
* No top-level `description`/`chat` block: the chatbot copy is
|
|
42
|
+
* application-specific (it describes each app's own operation names and
|
|
43
|
+
* billing model) and is supplied by the consuming app's extended descriptor.
|
|
44
|
+
* Per-field `description`s live here so an extended descriptor can spread
|
|
45
|
+
* `TokenUsageDescriptor.fields` and inherit them.
|
|
46
|
+
*/
|
|
47
|
+
export declare const TokenUsageDescriptor: import("../../..").EntityDescriptor<TokenUsage, {}>;
|
|
48
|
+
export type TokenUsageDescriptorType = typeof TokenUsageDescriptor;
|
|
49
|
+
//# sourceMappingURL=tokenusage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenusage.d.ts","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/entities/tokenusage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAGzD;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IAEvB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,oBAAoB,qDAmC/B,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,OAAO,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenUsageDescriptor = void 0;
|
|
4
|
+
const define_entity_1 = require("../../../common/helpers/define-entity");
|
|
5
|
+
const tokenusage_meta_1 = require("./tokenusage.meta");
|
|
6
|
+
/**
|
|
7
|
+
* TokenUsage Entity Descriptor
|
|
8
|
+
*
|
|
9
|
+
* Replaces the hand-written `TokenUsageModel` (`entities/tokenusage.model.ts`,
|
|
10
|
+
* deleted), whose `serialiser` was `undefined` — the entity had no JSON:API
|
|
11
|
+
* wire at all. This descriptor is therefore the FIRST tokenusage serialiser:
|
|
12
|
+
* every attribute below is new on the wire for consuming apps, with no prior
|
|
13
|
+
* consumer to constrain it.
|
|
14
|
+
*
|
|
15
|
+
* Relationship-parity note: the old model declared `childrenTokens: []` and
|
|
16
|
+
* `singleChildrenTokens: [companyMeta.nodeName]`, so no relationships are
|
|
17
|
+
* declared here either (`isCompanyScoped: true` reinstates the company token).
|
|
18
|
+
* Real graph edges exist — BELONGS_TO (company), TRIGGERED_BY (user), USED_FOR
|
|
19
|
+
* (the polymorphic target entity, see `TokenUsageRepository.create()`) — but
|
|
20
|
+
* were never part of the JSON:API surface. USED_FOR in particular is
|
|
21
|
+
* polymorphic (any entity label), which the descriptor's fixed-target
|
|
22
|
+
* `relationships` shape cannot express as a single relationship.
|
|
23
|
+
*
|
|
24
|
+
* `tokenUsageType` stays `type: "string"`: the set of operations that record
|
|
25
|
+
* usage is application-specific, so consuming apps narrow it with their own
|
|
26
|
+
* enum rather than the package pinning one.
|
|
27
|
+
*
|
|
28
|
+
* No top-level `description`/`chat` block: the chatbot copy is
|
|
29
|
+
* application-specific (it describes each app's own operation names and
|
|
30
|
+
* billing model) and is supplied by the consuming app's extended descriptor.
|
|
31
|
+
* Per-field `description`s live here so an extended descriptor can spread
|
|
32
|
+
* `TokenUsageDescriptor.fields` and inherit them.
|
|
33
|
+
*/
|
|
34
|
+
exports.TokenUsageDescriptor = (0, define_entity_1.defineEntity)()({
|
|
35
|
+
...tokenusage_meta_1.tokenUsageMeta,
|
|
36
|
+
isCompanyScoped: true,
|
|
37
|
+
fields: {
|
|
38
|
+
inputTokens: {
|
|
39
|
+
type: "number",
|
|
40
|
+
required: true,
|
|
41
|
+
description: "The number of input (prompt) tokens consumed by this LLM call.",
|
|
42
|
+
},
|
|
43
|
+
outputTokens: {
|
|
44
|
+
type: "number",
|
|
45
|
+
required: true,
|
|
46
|
+
description: "The number of output (completion) tokens produced by this LLM call.",
|
|
47
|
+
},
|
|
48
|
+
cachedInputTokens: {
|
|
49
|
+
type: "number",
|
|
50
|
+
description: "The subset of the input tokens that was served from the provider's prompt cache. Billed at the configured cached-input rate (falling back to the full input rate when no cached rate is configured) and always clamped to at most `inputTokens`.",
|
|
51
|
+
},
|
|
52
|
+
cost: {
|
|
53
|
+
type: "number",
|
|
54
|
+
description: "The computed monetary cost of this LLM call, derived from the configured per-million-token input/cached-input/output rates of the tier the call used. Absent or 0 when cost tracking is disabled (rates set to 0).",
|
|
55
|
+
},
|
|
56
|
+
tokenUsageType: {
|
|
57
|
+
type: "string",
|
|
58
|
+
required: true,
|
|
59
|
+
description: 'Which internal AI operation triggered this usage (e.g. "summariser", "graph_creator", "ethicist"). See the application\'s TokenUsageType enum for the full list of values.',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
relationships: {},
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=tokenusage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenusage.js","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/entities/tokenusage.ts"],"names":[],"mappings":";;;AACA,yEAAqE;AAErE,uDAAmD;AAoBnD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,oBAAoB,GAAG,IAAA,4BAAY,GAAc,CAAC;IAC7D,GAAG,gCAAc;IAEjB,eAAe,EAAE,IAAI;IAErB,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gEAAgE;SAC9E;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,qEAAqE;SACnF;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kPAAkP;SACrP;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,oNAAoN;SACvN;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,4KAA4K;SAC/K;KACF;IAED,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { TokenUsage } from "./entities/tokenusage
|
|
1
|
+
export { TokenUsage, TokenUsageDescriptor } from "./entities/tokenusage";
|
|
2
2
|
export { tokenUsageMeta } from "./entities/tokenusage.meta";
|
|
3
|
-
export { TokenUsageModel } from "./entities/tokenusage.model";
|
|
4
3
|
export { TokenUsageType } from "./enums/tokenusage.type";
|
|
4
|
+
export { TOKEN_USAGE_RECORDED_EVENT, TokenUsageRecordedPayload } from "./events/tokenusage.events";
|
|
5
5
|
export { TokenUsageRepository } from "./repositories/tokenusage.repository";
|
|
6
6
|
export { TokenUsageService } from "./services/tokenusage.service";
|
|
7
7
|
export { TokenUsageModule } from "./tokenusage.module";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/tokenusage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/tokenusage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TokenUsageModule = exports.TokenUsageService = exports.TokenUsageRepository = exports.
|
|
3
|
+
exports.TokenUsageModule = exports.TokenUsageService = exports.TokenUsageRepository = exports.TOKEN_USAGE_RECORDED_EVENT = exports.TokenUsageType = exports.tokenUsageMeta = exports.TokenUsageDescriptor = void 0;
|
|
4
|
+
var tokenusage_1 = require("./entities/tokenusage");
|
|
5
|
+
Object.defineProperty(exports, "TokenUsageDescriptor", { enumerable: true, get: function () { return tokenusage_1.TokenUsageDescriptor; } });
|
|
4
6
|
var tokenusage_meta_1 = require("./entities/tokenusage.meta");
|
|
5
7
|
Object.defineProperty(exports, "tokenUsageMeta", { enumerable: true, get: function () { return tokenusage_meta_1.tokenUsageMeta; } });
|
|
6
|
-
var tokenusage_model_1 = require("./entities/tokenusage.model");
|
|
7
|
-
Object.defineProperty(exports, "TokenUsageModel", { enumerable: true, get: function () { return tokenusage_model_1.TokenUsageModel; } });
|
|
8
8
|
var tokenusage_type_1 = require("./enums/tokenusage.type");
|
|
9
9
|
Object.defineProperty(exports, "TokenUsageType", { enumerable: true, get: function () { return tokenusage_type_1.TokenUsageType; } });
|
|
10
|
+
var tokenusage_events_1 = require("./events/tokenusage.events");
|
|
11
|
+
Object.defineProperty(exports, "TOKEN_USAGE_RECORDED_EVENT", { enumerable: true, get: function () { return tokenusage_events_1.TOKEN_USAGE_RECORDED_EVENT; } });
|
|
10
12
|
var tokenusage_repository_1 = require("./repositories/tokenusage.repository");
|
|
11
13
|
Object.defineProperty(exports, "TokenUsageRepository", { enumerable: true, get: function () { return tokenusage_repository_1.TokenUsageRepository; } });
|
|
12
14
|
var tokenusage_service_1 = require("./services/tokenusage.service");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/tokenusage/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/tokenusage/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyE;AAApD,kHAAA,oBAAoB,OAAA;AACzC,8DAA4D;AAAnD,iHAAA,cAAc,OAAA;AACvB,2DAAyD;AAAhD,iHAAA,cAAc,OAAA;AACvB,gEAAmG;AAA1F,+HAAA,0BAA0B,OAAA;AACnC,8EAA4E;AAAnE,6HAAA,oBAAoB,OAAA;AAC7B,oEAAkE;AAAzD,uHAAA,iBAAiB,OAAA;AAC1B,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClsService } from "nestjs-cls";
|
|
2
|
+
import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
|
|
2
3
|
import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { SecurityService } from "../../../core/security/services/security.service";
|
|
5
|
+
import { TokenUsage, TokenUsageDescriptor } from "../../tokenusage/entities/tokenusage";
|
|
6
|
+
/**
|
|
7
|
+
* TokenUsage repository.
|
|
8
|
+
*
|
|
9
|
+
* Extends `AbstractRepository` so a consuming application can subclass it (see
|
|
10
|
+
* `ExtendedTokenUsageRepository` in a consuming app) and have BOTH the inherited
|
|
11
|
+
* generic methods AND every method declared here resolve the *extended*
|
|
12
|
+
* descriptor. Model resolution is by subclass polymorphism — `this.descriptor` —
|
|
13
|
+
* never by a registry lookup: Nest constructs providers long before
|
|
14
|
+
* `onModuleInit`, where models are registered.
|
|
15
|
+
*
|
|
16
|
+
* `onModuleInit` is INHERITED rather than declared: `AbstractRepository.onModuleInit`
|
|
17
|
+
* emits `CREATE CONSTRAINT tokenusage_id IF NOT EXISTS FOR (tokenusage:TokenUsage)
|
|
18
|
+
* REQUIRE tokenusage.id IS UNIQUE` from `descriptor.constraints` — byte-identical to
|
|
19
|
+
* the constraint this repository used to declare by hand — plus the FULLTEXT index
|
|
20
|
+
* derived from the descriptor's string fields.
|
|
21
|
+
*/
|
|
22
|
+
export declare class TokenUsageRepository extends AbstractRepository<TokenUsage, typeof TokenUsageDescriptor.relationships> {
|
|
23
|
+
protected readonly descriptor: import("../../..").EntityDescriptor<TokenUsage, {}>;
|
|
24
|
+
constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
|
|
25
|
+
/**
|
|
26
|
+
* Custom create (KEPT — "non-standard relationships" rule): USED_FOR's target is
|
|
27
|
+
* polymorphic (any entity label — Content, Chunk, Conversation, ...), which the
|
|
28
|
+
* descriptor's fixed-target `relationships` cannot express as a single
|
|
29
|
+
* relationship. BELONGS_TO (company) and TRIGGERED_BY (currentUser) rely on the
|
|
30
|
+
* CLS-injected preamble from `Neo4jService.initQuery()` — unchanged from the
|
|
31
|
+
* pre-migration repository. Cannot be replaced by the inherited
|
|
32
|
+
* descriptor-driven `create()`, which only knows fixed relationships declared
|
|
33
|
+
* on the descriptor.
|
|
34
|
+
*/
|
|
7
35
|
create(params: {
|
|
8
36
|
id: string;
|
|
9
37
|
tokenUsageType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenusage.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/repositories/tokenusage.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tokenusage.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/repositories/tokenusage.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,UAAU,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAGxF;;;;;;;;;;;;;;;GAeG;AACH,qBACa,oBAAqB,SAAQ,kBAAkB,CAAC,UAAU,EAAE,OAAO,oBAAoB,CAAC,aAAa,CAAC;IACjH,SAAS,CAAC,QAAQ,CAAC,UAAU,sDAAwB;gBAEzC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU;IAIzF;;;;;;;;;OASG;IACG,MAAM,CAAC,MAAM,EAAE;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,cAAc,EAAE,MAAM,CAAC;QACvB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,GAAG,OAAO,CAAC,IAAI,CAAC;CAkClB"}
|
|
@@ -11,17 +11,43 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TokenUsageRepository = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
|
+
const nestjs_cls_1 = require("nestjs-cls");
|
|
15
|
+
const abstract_repository_1 = require("../../../core/neo4j/abstracts/abstract.repository");
|
|
14
16
|
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
17
|
+
const security_service_1 = require("../../../core/security/services/security.service");
|
|
18
|
+
const tokenusage_1 = require("../../tokenusage/entities/tokenusage");
|
|
15
19
|
const tokenusage_meta_1 = require("../../tokenusage/entities/tokenusage.meta");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* TokenUsage repository.
|
|
22
|
+
*
|
|
23
|
+
* Extends `AbstractRepository` so a consuming application can subclass it (see
|
|
24
|
+
* `ExtendedTokenUsageRepository` in a consuming app) and have BOTH the inherited
|
|
25
|
+
* generic methods AND every method declared here resolve the *extended*
|
|
26
|
+
* descriptor. Model resolution is by subclass polymorphism — `this.descriptor` —
|
|
27
|
+
* never by a registry lookup: Nest constructs providers long before
|
|
28
|
+
* `onModuleInit`, where models are registered.
|
|
29
|
+
*
|
|
30
|
+
* `onModuleInit` is INHERITED rather than declared: `AbstractRepository.onModuleInit`
|
|
31
|
+
* emits `CREATE CONSTRAINT tokenusage_id IF NOT EXISTS FOR (tokenusage:TokenUsage)
|
|
32
|
+
* REQUIRE tokenusage.id IS UNIQUE` from `descriptor.constraints` — byte-identical to
|
|
33
|
+
* the constraint this repository used to declare by hand — plus the FULLTEXT index
|
|
34
|
+
* derived from the descriptor's string fields.
|
|
35
|
+
*/
|
|
36
|
+
let TokenUsageRepository = class TokenUsageRepository extends abstract_repository_1.AbstractRepository {
|
|
37
|
+
constructor(neo4j, securityService, clsService) {
|
|
38
|
+
super(neo4j, securityService, clsService);
|
|
39
|
+
this.descriptor = tokenusage_1.TokenUsageDescriptor;
|
|
24
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Custom create (KEPT — "non-standard relationships" rule): USED_FOR's target is
|
|
43
|
+
* polymorphic (any entity label — Content, Chunk, Conversation, ...), which the
|
|
44
|
+
* descriptor's fixed-target `relationships` cannot express as a single
|
|
45
|
+
* relationship. BELONGS_TO (company) and TRIGGERED_BY (currentUser) rely on the
|
|
46
|
+
* CLS-injected preamble from `Neo4jService.initQuery()` — unchanged from the
|
|
47
|
+
* pre-migration repository. Cannot be replaced by the inherited
|
|
48
|
+
* descriptor-driven `create()`, which only knows fixed relationships declared
|
|
49
|
+
* on the descriptor.
|
|
50
|
+
*/
|
|
25
51
|
async create(params) {
|
|
26
52
|
const query = this.neo4j.initQuery();
|
|
27
53
|
query.queryParams = {
|
|
@@ -35,7 +61,7 @@ let TokenUsageRepository = class TokenUsageRepository {
|
|
|
35
61
|
cost: params.cost ?? 0,
|
|
36
62
|
};
|
|
37
63
|
query.query += `
|
|
38
|
-
CREATE (
|
|
64
|
+
CREATE (${tokenusage_meta_1.tokenUsageMeta.nodeName}:${tokenusage_meta_1.tokenUsageMeta.labelName} {
|
|
39
65
|
id: $id,
|
|
40
66
|
tokenUsageType: $tokenUsageType,
|
|
41
67
|
inputTokens: $inputTokens,
|
|
@@ -45,11 +71,11 @@ let TokenUsageRepository = class TokenUsageRepository {
|
|
|
45
71
|
createdAt: datetime(),
|
|
46
72
|
updatedAt: datetime()
|
|
47
73
|
})
|
|
48
|
-
CREATE (
|
|
49
|
-
CREATE (
|
|
50
|
-
WITH
|
|
74
|
+
CREATE (${tokenusage_meta_1.tokenUsageMeta.nodeName})-[:BELONGS_TO]->(company)
|
|
75
|
+
CREATE (${tokenusage_meta_1.tokenUsageMeta.nodeName})-[:TRIGGERED_BY]->(currentUser)
|
|
76
|
+
WITH ${tokenusage_meta_1.tokenUsageMeta.nodeName}
|
|
51
77
|
MATCH (relEntity:${params.relationshipType} {id: $relationshipId})
|
|
52
|
-
CREATE (
|
|
78
|
+
CREATE (${tokenusage_meta_1.tokenUsageMeta.nodeName})-[:USED_FOR]->(relEntity)
|
|
53
79
|
`;
|
|
54
80
|
await this.neo4j.writeOne(query);
|
|
55
81
|
}
|
|
@@ -57,6 +83,6 @@ let TokenUsageRepository = class TokenUsageRepository {
|
|
|
57
83
|
exports.TokenUsageRepository = TokenUsageRepository;
|
|
58
84
|
exports.TokenUsageRepository = TokenUsageRepository = __decorate([
|
|
59
85
|
(0, common_1.Injectable)(),
|
|
60
|
-
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService])
|
|
86
|
+
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService, security_service_1.SecurityService, nestjs_cls_1.ClsService])
|
|
61
87
|
], TokenUsageRepository);
|
|
62
88
|
//# sourceMappingURL=tokenusage.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenusage.repository.js","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/repositories/tokenusage.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"tokenusage.repository.js","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/repositories/tokenusage.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAAwC;AACxC,2FAAuF;AACvF,8EAA0E;AAC1E,uFAAmF;AACnF,qEAAwF;AACxF,+EAA2E;AAE3E;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,wCAAyE;IAGjH,YAAY,KAAmB,EAAE,eAAgC,EAAE,UAAsB;QACvF,KAAK,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;QAHzB,eAAU,GAAG,iCAAoB,CAAC;IAIrD,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,MAAM,CAAC,MASZ;QACC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAErC,KAAK,CAAC,WAAW,GAAG;YAClB,GAAG,KAAK,CAAC,WAAW;YACpB,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,IAAI,CAAC;YAChD,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC;SACvB,CAAC;QAEF,KAAK,CAAC,KAAK,IAAI;gBACH,gCAAc,CAAC,QAAQ,IAAI,gCAAc,CAAC,SAAS;;;;;;;;;;gBAUnD,gCAAc,CAAC,QAAQ;gBACvB,gCAAc,CAAC,QAAQ;aAC1B,gCAAc,CAAC,QAAQ;yBACX,MAAM,CAAC,gBAAgB;gBAChC,gCAAc,CAAC,QAAQ;KAClC,CAAC;QAEF,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AA5DY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAIQ,4BAAY,EAAmB,kCAAe,EAAc,uBAAU;GAH9E,oBAAoB,CA4DhC"}
|
|
@@ -1,17 +1,44 @@
|
|
|
1
|
+
import { Logger } from "@nestjs/common";
|
|
1
2
|
import { ConfigService } from "@nestjs/config";
|
|
2
3
|
import { EventEmitter2 } from "@nestjs/event-emitter";
|
|
3
|
-
import {
|
|
4
|
+
import { ClsService } from "nestjs-cls";
|
|
5
|
+
import { BaseConfigInterface, ConfigAiInterface } from "../../../config/interfaces";
|
|
4
6
|
import { TokenUsageInterface } from "../../../common/interfaces/token.usage.interface";
|
|
7
|
+
import { JsonApiService } from "../../../core/jsonapi/services/jsonapi.service";
|
|
8
|
+
import { AbstractService } from "../../../core/neo4j/abstracts/abstract.service";
|
|
9
|
+
import { TokenUsage, TokenUsageDescriptor } from "../../tokenusage/entities/tokenusage";
|
|
5
10
|
import { TokenUsageRepository } from "../../tokenusage/repositories/tokenusage.repository";
|
|
6
11
|
import { ModelWeight } from "../../../core/llm/enums/model.weight";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* TokenUsage service.
|
|
14
|
+
*
|
|
15
|
+
* Extends `AbstractService` so a consuming application can subclass it (see
|
|
16
|
+
* `ExtendedTokenUsageService` in a consuming app) and have BOTH the inherited
|
|
17
|
+
* generic methods AND every method declared here serialise with the *extended*
|
|
18
|
+
* model. Model resolution is by subclass polymorphism — a subclass re-declares
|
|
19
|
+
* `descriptor` and `model` as initialised class fields — never by a registry
|
|
20
|
+
* lookup (Nest constructs providers before `onModuleInit`, where models are
|
|
21
|
+
* registered).
|
|
22
|
+
*
|
|
23
|
+
* Every member is `protected` rather than `private` precisely so a subclass can
|
|
24
|
+
* reuse it: TypeScript forbids a subclass from redeclaring a name a base class
|
|
25
|
+
* holds privately (TS2415), which would otherwise force the extension to invent
|
|
26
|
+
* aliases for its own constructor parameters.
|
|
27
|
+
*
|
|
28
|
+
* Inherited generic CRUD (find / findById / create / put / patch / delete) is
|
|
29
|
+
* unused by any HTTP route in the package — there is no tokenusage controller,
|
|
30
|
+
* records are only ever written through `recordTokenUsage()` — but is available
|
|
31
|
+
* to consuming apps that mount their own controller.
|
|
32
|
+
*/
|
|
33
|
+
export declare class TokenUsageService extends AbstractService<TokenUsage, typeof TokenUsageDescriptor.relationships> {
|
|
34
|
+
protected readonly tokenUsageRepository: TokenUsageRepository;
|
|
35
|
+
protected readonly configService: ConfigService<BaseConfigInterface>;
|
|
36
|
+
protected readonly eventEmitter: EventEmitter2;
|
|
37
|
+
protected readonly descriptor: import("../../..").EntityDescriptor<TokenUsage, {}>;
|
|
38
|
+
protected readonly logger: Logger;
|
|
39
|
+
constructor(jsonApiService: JsonApiService, tokenUsageRepository: TokenUsageRepository, clsService: ClsService, configService: ConfigService<BaseConfigInterface>, eventEmitter: EventEmitter2);
|
|
40
|
+
protected get aiConfig(): ConfigAiInterface;
|
|
41
|
+
protected configForWeight(weight?: ModelWeight): import("../../../config/interfaces").AiTierConfig;
|
|
15
42
|
/**
|
|
16
43
|
* Computes the monetary cost of a call from the per-tier rates in config
|
|
17
44
|
* (`inputCostPer1MTokens` / `outputCostPer1MTokens`). Single source of truth —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenusage.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/services/tokenusage.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tokenusage.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/tokenusage/services/tokenusage.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACp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