@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.
Files changed (437) hide show
  1. package/dist/bootstrap/app.module.factory.d.ts.map +1 -1
  2. package/dist/bootstrap/app.module.factory.js +1 -0
  3. package/dist/bootstrap/app.module.factory.js.map +1 -1
  4. package/dist/bootstrap/bootstrap.options.d.ts +17 -0
  5. package/dist/bootstrap/bootstrap.options.d.ts.map +1 -1
  6. package/dist/common/guards/jwt.auth.admin.guard.d.ts +3 -2
  7. package/dist/common/guards/jwt.auth.admin.guard.d.ts.map +1 -1
  8. package/dist/common/guards/jwt.auth.admin.guard.js +19 -4
  9. package/dist/common/guards/jwt.auth.admin.guard.js.map +1 -1
  10. package/dist/common/guards/jwt.auth.guard.d.ts +3 -2
  11. package/dist/common/guards/jwt.auth.guard.d.ts.map +1 -1
  12. package/dist/common/guards/jwt.auth.guard.js +7 -2
  13. package/dist/common/guards/jwt.auth.guard.js.map +1 -1
  14. package/dist/common/interfaces/entity.schema.interface.d.ts +2 -0
  15. package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
  16. package/dist/common/tokens.d.ts +68 -0
  17. package/dist/common/tokens.d.ts.map +1 -1
  18. package/dist/common/tokens.js +37 -2
  19. package/dist/common/tokens.js.map +1 -1
  20. package/dist/config/base.config.d.ts.map +1 -1
  21. package/dist/config/base.config.js +9 -0
  22. package/dist/config/base.config.js.map +1 -1
  23. package/dist/config/enums/queue.id.d.ts +2 -1
  24. package/dist/config/enums/queue.id.d.ts.map +1 -1
  25. package/dist/config/enums/queue.id.js +1 -0
  26. package/dist/config/enums/queue.id.js.map +1 -1
  27. package/dist/config/interfaces/base.config.interface.d.ts +2 -0
  28. package/dist/config/interfaces/base.config.interface.d.ts.map +1 -1
  29. package/dist/config/interfaces/config.ai.interface.d.ts +8 -0
  30. package/dist/config/interfaces/config.ai.interface.d.ts.map +1 -1
  31. package/dist/config/interfaces/config.auth.interface.d.ts +7 -0
  32. package/dist/config/interfaces/config.auth.interface.d.ts.map +1 -1
  33. package/dist/config/interfaces/config.credits.interface.d.ts +24 -0
  34. package/dist/config/interfaces/config.credits.interface.d.ts.map +1 -0
  35. package/dist/{foundations/auth/entities/auth.entity.js → config/interfaces/config.credits.interface.js} +1 -1
  36. package/dist/config/interfaces/config.credits.interface.js.map +1 -0
  37. package/dist/config/interfaces/config.email.interface.d.ts +6 -0
  38. package/dist/config/interfaces/config.email.interface.d.ts.map +1 -1
  39. package/dist/config/interfaces/index.d.ts +1 -0
  40. package/dist/config/interfaces/index.d.ts.map +1 -1
  41. package/dist/config/interfaces/index.js +1 -0
  42. package/dist/config/interfaces/index.js.map +1 -1
  43. package/dist/core/email/services/email.service.d.ts +1 -0
  44. package/dist/core/email/services/email.service.d.ts.map +1 -1
  45. package/dist/core/email/services/email.service.js +10 -7
  46. package/dist/core/email/services/email.service.js.map +1 -1
  47. package/dist/core/llm/services/embedder.service.d.ts +36 -2
  48. package/dist/core/llm/services/embedder.service.d.ts.map +1 -1
  49. package/dist/core/llm/services/embedder.service.js +87 -7
  50. package/dist/core/llm/services/embedder.service.js.map +1 -1
  51. package/dist/core/llm/services/llm.service.d.ts +9 -1
  52. package/dist/core/llm/services/llm.service.d.ts.map +1 -1
  53. package/dist/core/llm/services/llm.service.js +13 -3
  54. package/dist/core/llm/services/llm.service.js.map +1 -1
  55. package/dist/core/neo4j/abstracts/abstract.repository.d.ts.map +1 -1
  56. package/dist/core/neo4j/abstracts/abstract.repository.js +33 -2
  57. package/dist/core/neo4j/abstracts/abstract.repository.js.map +1 -1
  58. package/dist/foundations/auth/auth.module.d.ts.map +1 -1
  59. package/dist/foundations/auth/auth.module.js +9 -10
  60. package/dist/foundations/auth/auth.module.js.map +1 -1
  61. package/dist/foundations/auth/controllers/auth.controller.d.ts.map +1 -1
  62. package/dist/foundations/auth/controllers/auth.controller.js +5 -0
  63. package/dist/foundations/auth/controllers/auth.controller.js.map +1 -1
  64. package/dist/foundations/auth/controllers/auth.discord.controller.d.ts.map +1 -1
  65. package/dist/foundations/auth/controllers/auth.discord.controller.js +6 -3
  66. package/dist/foundations/auth/controllers/auth.discord.controller.js.map +1 -1
  67. package/dist/foundations/auth/controllers/auth.google.controller.d.ts.map +1 -1
  68. package/dist/foundations/auth/controllers/auth.google.controller.js +7 -3
  69. package/dist/foundations/auth/controllers/auth.google.controller.js.map +1 -1
  70. package/dist/foundations/auth/entities/auth.code.d.ts +34 -0
  71. package/dist/foundations/auth/entities/auth.code.d.ts.map +1 -0
  72. package/dist/foundations/auth/entities/auth.code.js +53 -0
  73. package/dist/foundations/auth/entities/auth.code.js.map +1 -0
  74. package/dist/foundations/auth/entities/auth.d.ts +41 -0
  75. package/dist/foundations/auth/entities/auth.d.ts.map +1 -0
  76. package/dist/foundations/auth/entities/auth.js +68 -0
  77. package/dist/foundations/auth/entities/auth.js.map +1 -0
  78. package/dist/foundations/auth/entities/pending-auth.d.ts +39 -0
  79. package/dist/foundations/auth/entities/pending-auth.d.ts.map +1 -0
  80. package/dist/foundations/auth/entities/pending-auth.js +41 -0
  81. package/dist/foundations/auth/entities/pending-auth.js.map +1 -0
  82. package/dist/foundations/auth/index.d.ts +13 -0
  83. package/dist/foundations/auth/index.d.ts.map +1 -1
  84. package/dist/foundations/auth/index.js +31 -1
  85. package/dist/foundations/auth/index.js.map +1 -1
  86. package/dist/foundations/auth/repositories/auth.repository.d.ts +49 -9
  87. package/dist/foundations/auth/repositories/auth.repository.d.ts.map +1 -1
  88. package/dist/foundations/auth/repositories/auth.repository.js +115 -63
  89. package/dist/foundations/auth/repositories/auth.repository.js.map +1 -1
  90. package/dist/foundations/auth/services/auth.discord.service.d.ts +1 -1
  91. package/dist/foundations/auth/services/auth.discord.service.d.ts.map +1 -1
  92. package/dist/foundations/auth/services/auth.discord.service.js +5 -2
  93. package/dist/foundations/auth/services/auth.discord.service.js.map +1 -1
  94. package/dist/foundations/auth/services/auth.google.service.d.ts +1 -1
  95. package/dist/foundations/auth/services/auth.google.service.d.ts.map +1 -1
  96. package/dist/foundations/auth/services/auth.google.service.js +6 -2
  97. package/dist/foundations/auth/services/auth.google.service.js.map +1 -1
  98. package/dist/foundations/auth/services/auth.service.d.ts +42 -7
  99. package/dist/foundations/auth/services/auth.service.d.ts.map +1 -1
  100. package/dist/foundations/auth/services/auth.service.js +140 -77
  101. package/dist/foundations/auth/services/auth.service.js.map +1 -1
  102. package/dist/foundations/company/dtos/company.post.dto.d.ts +3 -3
  103. package/dist/foundations/company/dtos/company.post.dto.d.ts.map +1 -1
  104. package/dist/foundations/company/dtos/company.post.dto.js +3 -3
  105. package/dist/foundations/company/dtos/company.post.dto.js.map +1 -1
  106. package/dist/foundations/company/dtos/company.put.dto.d.ts +3 -3
  107. package/dist/foundations/company/dtos/company.put.dto.d.ts.map +1 -1
  108. package/dist/foundations/company/dtos/company.put.dto.js +3 -3
  109. package/dist/foundations/company/dtos/company.put.dto.js.map +1 -1
  110. package/dist/foundations/company/entities/company.d.ts +4 -4
  111. package/dist/foundations/company/entities/company.d.ts.map +1 -1
  112. package/dist/foundations/company/entities/company.js +18 -4
  113. package/dist/foundations/company/entities/company.js.map +1 -1
  114. package/dist/foundations/company/index.d.ts +5 -0
  115. package/dist/foundations/company/index.d.ts.map +1 -1
  116. package/dist/foundations/company/index.js +16 -1
  117. package/dist/foundations/company/index.js.map +1 -1
  118. package/dist/foundations/company/processors/company.processor.js +1 -1
  119. package/dist/foundations/company/processors/company.processor.js.map +1 -1
  120. package/dist/foundations/company/repositories/company.repository.d.ts +96 -33
  121. package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
  122. package/dist/foundations/company/repositories/company.repository.js +125 -95
  123. package/dist/foundations/company/repositories/company.repository.js.map +1 -1
  124. package/dist/foundations/company/services/company.service.d.ts +52 -13
  125. package/dist/foundations/company/services/company.service.d.ts.map +1 -1
  126. package/dist/foundations/company/services/company.service.js +62 -39
  127. package/dist/foundations/company/services/company.service.js.map +1 -1
  128. package/dist/foundations/content/content.module.d.ts +20 -8
  129. package/dist/foundations/content/content.module.d.ts.map +1 -1
  130. package/dist/foundations/content/content.module.js +40 -24
  131. package/dist/foundations/content/content.module.js.map +1 -1
  132. package/dist/foundations/content/controllers/content.controller.d.ts +1 -1
  133. package/dist/foundations/content/controllers/content.controller.d.ts.map +1 -1
  134. package/dist/foundations/content/controllers/content.controller.js +2 -2
  135. package/dist/foundations/content/controllers/content.controller.js.map +1 -1
  136. package/dist/foundations/content/entities/content.d.ts +74 -0
  137. package/dist/foundations/content/entities/content.d.ts.map +1 -0
  138. package/dist/foundations/content/entities/content.js +141 -0
  139. package/dist/foundations/content/entities/content.js.map +1 -0
  140. package/dist/foundations/content/index.d.ts +2 -4
  141. package/dist/foundations/content/index.d.ts.map +1 -1
  142. package/dist/foundations/content/index.js +6 -5
  143. package/dist/foundations/content/index.js.map +1 -1
  144. package/dist/foundations/content/interfaces/content.extension.interface.d.ts +126 -0
  145. package/dist/foundations/content/interfaces/content.extension.interface.d.ts.map +1 -1
  146. package/dist/foundations/content/interfaces/content.extension.interface.js +7 -1
  147. package/dist/foundations/content/interfaces/content.extension.interface.js.map +1 -1
  148. package/dist/foundations/content/repositories/content.repository.d.ts +14 -7
  149. package/dist/foundations/content/repositories/content.repository.d.ts.map +1 -1
  150. package/dist/foundations/content/repositories/content.repository.js +18 -16
  151. package/dist/foundations/content/repositories/content.repository.js.map +1 -1
  152. package/dist/foundations/content/services/content.cypher.service.d.ts +19 -0
  153. package/dist/foundations/content/services/content.cypher.service.d.ts.map +1 -1
  154. package/dist/foundations/content/services/content.cypher.service.js +65 -4
  155. package/dist/foundations/content/services/content.cypher.service.js.map +1 -1
  156. package/dist/foundations/content/services/content.service.js +4 -4
  157. package/dist/foundations/content/services/content.service.js.map +1 -1
  158. package/dist/foundations/discord-user/services/discord-user.service.js +2 -2
  159. package/dist/foundations/discord-user/services/discord-user.service.js.map +1 -1
  160. package/dist/foundations/feature/entities/feature.d.ts +32 -0
  161. package/dist/foundations/feature/entities/feature.d.ts.map +1 -0
  162. package/dist/foundations/feature/entities/feature.js +64 -0
  163. package/dist/foundations/feature/entities/feature.js.map +1 -0
  164. package/dist/foundations/feature/entities/feature.model.d.ts +1 -3
  165. package/dist/foundations/feature/entities/feature.model.d.ts.map +1 -1
  166. package/dist/foundations/feature/entities/feature.model.js +3 -11
  167. package/dist/foundations/feature/entities/feature.model.js.map +1 -1
  168. package/dist/foundations/feature/feature.module.d.ts.map +1 -1
  169. package/dist/foundations/feature/feature.module.js +4 -5
  170. package/dist/foundations/feature/feature.module.js.map +1 -1
  171. package/dist/foundations/feature/index.d.ts +12 -0
  172. package/dist/foundations/feature/index.d.ts.map +1 -1
  173. package/dist/foundations/feature/index.js +22 -1
  174. package/dist/foundations/feature/index.js.map +1 -1
  175. package/dist/foundations/feature/repositories/feature.repository.d.ts +37 -13
  176. package/dist/foundations/feature/repositories/feature.repository.d.ts.map +1 -1
  177. package/dist/foundations/feature/repositories/feature.repository.js +41 -35
  178. package/dist/foundations/feature/repositories/feature.repository.js.map +1 -1
  179. package/dist/foundations/feature/services/feature.service.d.ts +31 -4
  180. package/dist/foundations/feature/services/feature.service.d.ts.map +1 -1
  181. package/dist/foundations/feature/services/feature.service.js +20 -12
  182. package/dist/foundations/feature/services/feature.service.js.map +1 -1
  183. package/dist/foundations/foundations.modules.d.ts +6 -0
  184. package/dist/foundations/foundations.modules.d.ts.map +1 -1
  185. package/dist/foundations/foundations.modules.js +14 -3
  186. package/dist/foundations/foundations.modules.js.map +1 -1
  187. package/dist/foundations/google-user/services/google-user.service.js +2 -2
  188. package/dist/foundations/google-user/services/google-user.service.js.map +1 -1
  189. package/dist/foundations/index.d.ts +3 -0
  190. package/dist/foundations/index.d.ts.map +1 -1
  191. package/dist/foundations/index.js +3 -0
  192. package/dist/foundations/index.js.map +1 -1
  193. package/dist/foundations/membership/entities/membership.d.ts.map +1 -1
  194. package/dist/foundations/membership/entities/membership.js +4 -0
  195. package/dist/foundations/membership/entities/membership.js.map +1 -1
  196. package/dist/foundations/notification/controllers/notification.controller.js +2 -2
  197. package/dist/foundations/notification/controllers/notification.controller.js.map +1 -1
  198. package/dist/foundations/notification/entities/notification.d.ts +75 -0
  199. package/dist/foundations/notification/entities/notification.d.ts.map +1 -0
  200. package/dist/foundations/notification/entities/notification.js +73 -0
  201. package/dist/foundations/notification/entities/notification.js.map +1 -0
  202. package/dist/foundations/notification/index.d.ts +6 -2
  203. package/dist/foundations/notification/index.d.ts.map +1 -1
  204. package/dist/foundations/notification/index.js +17 -3
  205. package/dist/foundations/notification/index.js.map +1 -1
  206. package/dist/foundations/notification/notification.module.d.ts.map +1 -1
  207. package/dist/foundations/notification/notification.module.js +3 -4
  208. package/dist/foundations/notification/notification.module.js.map +1 -1
  209. package/dist/foundations/notification/repositories/notification.repository.d.ts +125 -8
  210. package/dist/foundations/notification/repositories/notification.repository.d.ts.map +1 -1
  211. package/dist/foundations/notification/repositories/notification.repository.js +219 -20
  212. package/dist/foundations/notification/repositories/notification.repository.js.map +1 -1
  213. package/dist/foundations/notification/services/notification.service.d.ts +31 -5
  214. package/dist/foundations/notification/services/notification.service.d.ts.map +1 -1
  215. package/dist/foundations/notification/services/notification.service.js +26 -9
  216. package/dist/foundations/notification/services/notification.service.js.map +1 -1
  217. package/dist/foundations/rbac/dump.d.ts +48 -4
  218. package/dist/foundations/rbac/dump.d.ts.map +1 -1
  219. package/dist/foundations/rbac/dump.js +28 -4
  220. package/dist/foundations/rbac/dump.js.map +1 -1
  221. package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts +14 -0
  222. package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts.map +1 -1
  223. package/dist/foundations/rbac/serializer/matrix-to-ts.js +13 -3
  224. package/dist/foundations/rbac/serializer/matrix-to-ts.js.map +1 -1
  225. package/dist/foundations/referral/services/referral.service.js +4 -4
  226. package/dist/foundations/referral/services/referral.service.js.map +1 -1
  227. package/dist/foundations/relevancy/repositories/relevancy.repository.d.ts.map +1 -1
  228. package/dist/foundations/relevancy/repositories/relevancy.repository.js +13 -1
  229. package/dist/foundations/relevancy/repositories/relevancy.repository.js.map +1 -1
  230. package/dist/foundations/role/entities/role.d.ts +1 -1
  231. package/dist/foundations/role/entities/role.d.ts.map +1 -1
  232. package/dist/foundations/stripe/index.d.ts +3 -0
  233. package/dist/foundations/stripe/index.d.ts.map +1 -1
  234. package/dist/foundations/stripe/index.js +6 -0
  235. package/dist/foundations/stripe/index.js.map +1 -1
  236. package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts +1 -1
  237. package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts.map +1 -1
  238. package/dist/foundations/stripe-subscription/services/token-allocation.service.d.ts +1 -1
  239. package/dist/foundations/stripe-subscription/services/token-allocation.service.js +10 -10
  240. package/dist/foundations/stripe-subscription/services/token-allocation.service.js.map +1 -1
  241. package/dist/foundations/stripe-trial/services/trial.service.js +2 -2
  242. package/dist/foundations/stripe-trial/services/trial.service.js.map +1 -1
  243. package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js +2 -2
  244. package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js.map +1 -1
  245. package/dist/foundations/tokenusage/entities/tokenusage.d.ts +50 -0
  246. package/dist/foundations/tokenusage/entities/tokenusage.d.ts.map +1 -0
  247. package/dist/foundations/tokenusage/entities/tokenusage.js +68 -0
  248. package/dist/foundations/tokenusage/entities/tokenusage.js.map +1 -0
  249. package/dist/foundations/tokenusage/enums/tokenusage.type.d.ts +2 -1
  250. package/dist/foundations/tokenusage/enums/tokenusage.type.d.ts.map +1 -1
  251. package/dist/foundations/tokenusage/enums/tokenusage.type.js +1 -0
  252. package/dist/foundations/tokenusage/enums/tokenusage.type.js.map +1 -1
  253. package/dist/foundations/tokenusage/events/tokenusage.events.d.ts +2 -0
  254. package/dist/foundations/tokenusage/events/tokenusage.events.d.ts.map +1 -1
  255. package/dist/foundations/tokenusage/index.d.ts +3 -3
  256. package/dist/foundations/tokenusage/index.d.ts.map +1 -1
  257. package/dist/foundations/tokenusage/index.js +5 -3
  258. package/dist/foundations/tokenusage/index.js.map +1 -1
  259. package/dist/foundations/tokenusage/repositories/tokenusage.repository.d.ts +90 -5
  260. package/dist/foundations/tokenusage/repositories/tokenusage.repository.d.ts.map +1 -1
  261. package/dist/foundations/tokenusage/repositories/tokenusage.repository.js +165 -14
  262. package/dist/foundations/tokenusage/repositories/tokenusage.repository.js.map +1 -1
  263. package/dist/foundations/tokenusage/services/tokenusage.service.d.ts +73 -10
  264. package/dist/foundations/tokenusage/services/tokenusage.service.d.ts.map +1 -1
  265. package/dist/foundations/tokenusage/services/tokenusage.service.js +88 -8
  266. package/dist/foundations/tokenusage/services/tokenusage.service.js.map +1 -1
  267. package/dist/foundations/tokenusage/tokenusage.module.js +3 -3
  268. package/dist/foundations/tokenusage/tokenusage.module.js.map +1 -1
  269. package/dist/foundations/user/controllers/user.controller.js +4 -4
  270. package/dist/foundations/user/controllers/user.controller.js.map +1 -1
  271. package/dist/foundations/user/dtos/user.put.dto.d.ts +1 -1
  272. package/dist/foundations/user/dtos/user.put.dto.d.ts.map +1 -1
  273. package/dist/foundations/user/dtos/user.put.dto.js +1 -1
  274. package/dist/foundations/user/dtos/user.put.dto.js.map +1 -1
  275. package/dist/foundations/user/entities/user.d.ts +4 -0
  276. package/dist/foundations/user/entities/user.d.ts.map +1 -1
  277. package/dist/foundations/user/entities/user.js +18 -4
  278. package/dist/foundations/user/entities/user.js.map +1 -1
  279. package/dist/foundations/user/index.d.ts +6 -1
  280. package/dist/foundations/user/index.d.ts.map +1 -1
  281. package/dist/foundations/user/index.js +13 -1
  282. package/dist/foundations/user/index.js.map +1 -1
  283. package/dist/foundations/user/repositories/user.repository.d.ts +56 -11
  284. package/dist/foundations/user/repositories/user.repository.d.ts.map +1 -1
  285. package/dist/foundations/user/repositories/user.repository.js +55 -35
  286. package/dist/foundations/user/repositories/user.repository.js.map +1 -1
  287. package/dist/foundations/user/services/user.service.d.ts +48 -9
  288. package/dist/foundations/user/services/user.service.d.ts.map +1 -1
  289. package/dist/foundations/user/services/user.service.js +50 -32
  290. package/dist/foundations/user/services/user.service.js.map +1 -1
  291. package/dist/foundations/user-activity/entities/user-activity.d.ts +36 -0
  292. package/dist/foundations/user-activity/entities/user-activity.d.ts.map +1 -0
  293. package/dist/foundations/user-activity/entities/user-activity.js +86 -0
  294. package/dist/foundations/user-activity/entities/user-activity.js.map +1 -0
  295. package/dist/foundations/user-activity/entities/user-activity.meta.d.ts +3 -0
  296. package/dist/foundations/user-activity/entities/user-activity.meta.d.ts.map +1 -0
  297. package/dist/foundations/user-activity/entities/user-activity.meta.js +10 -0
  298. package/dist/foundations/user-activity/entities/user-activity.meta.js.map +1 -0
  299. package/dist/foundations/user-activity/index.d.ts +10 -0
  300. package/dist/foundations/user-activity/index.d.ts.map +1 -0
  301. package/dist/foundations/user-activity/index.js +22 -0
  302. package/dist/foundations/user-activity/index.js.map +1 -0
  303. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.d.ts +29 -0
  304. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.d.ts.map +1 -0
  305. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.js +98 -0
  306. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.js.map +1 -0
  307. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.d.ts +67 -0
  308. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.d.ts.map +1 -0
  309. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.js +26 -0
  310. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.js.map +1 -0
  311. package/dist/foundations/user-activity/interfaces/user-activity.record.input.d.ts +18 -0
  312. package/dist/foundations/user-activity/interfaces/user-activity.record.input.d.ts.map +1 -0
  313. package/dist/foundations/{auth/entities/pending-auth.entity.js → user-activity/interfaces/user-activity.record.input.js} +1 -1
  314. package/dist/foundations/user-activity/interfaces/user-activity.record.input.js.map +1 -0
  315. package/dist/foundations/user-activity/processors/user-activity.processor.d.ts +25 -0
  316. package/dist/foundations/user-activity/processors/user-activity.processor.d.ts.map +1 -0
  317. package/dist/foundations/user-activity/processors/user-activity.processor.js +74 -0
  318. package/dist/foundations/user-activity/processors/user-activity.processor.js.map +1 -0
  319. package/dist/foundations/user-activity/repositories/user-activity.repository.d.ts +47 -0
  320. package/dist/foundations/user-activity/repositories/user-activity.repository.d.ts.map +1 -0
  321. package/dist/foundations/user-activity/repositories/user-activity.repository.js +124 -0
  322. package/dist/foundations/user-activity/repositories/user-activity.repository.js.map +1 -0
  323. package/dist/foundations/user-activity/services/user-activity.service.d.ts +29 -0
  324. package/dist/foundations/user-activity/services/user-activity.service.d.ts.map +1 -0
  325. package/dist/foundations/user-activity/services/user-activity.service.js +61 -0
  326. package/dist/foundations/user-activity/services/user-activity.service.js.map +1 -0
  327. package/dist/foundations/user-activity/user-activity.module.d.ts +40 -0
  328. package/dist/foundations/user-activity/user-activity.module.d.ts.map +1 -0
  329. package/dist/foundations/user-activity/user-activity.module.js +99 -0
  330. package/dist/foundations/user-activity/user-activity.module.js.map +1 -0
  331. package/package.json +2 -1
  332. package/dist/foundations/auth/entities/auth.code.entity.d.ts +0 -7
  333. package/dist/foundations/auth/entities/auth.code.entity.d.ts.map +0 -1
  334. package/dist/foundations/auth/entities/auth.code.entity.js +0 -3
  335. package/dist/foundations/auth/entities/auth.code.entity.js.map +0 -1
  336. package/dist/foundations/auth/entities/auth.code.map.d.ts +0 -8
  337. package/dist/foundations/auth/entities/auth.code.map.d.ts.map +0 -1
  338. package/dist/foundations/auth/entities/auth.code.map.js +0 -13
  339. package/dist/foundations/auth/entities/auth.code.map.js.map +0 -1
  340. package/dist/foundations/auth/entities/auth.code.model.d.ts +0 -4
  341. package/dist/foundations/auth/entities/auth.code.model.d.ts.map +0 -1
  342. package/dist/foundations/auth/entities/auth.code.model.js +0 -13
  343. package/dist/foundations/auth/entities/auth.code.model.js.map +0 -1
  344. package/dist/foundations/auth/entities/auth.entity.d.ts +0 -18
  345. package/dist/foundations/auth/entities/auth.entity.d.ts.map +0 -1
  346. package/dist/foundations/auth/entities/auth.entity.js.map +0 -1
  347. package/dist/foundations/auth/entities/auth.map.d.ts +0 -8
  348. package/dist/foundations/auth/entities/auth.map.d.ts.map +0 -1
  349. package/dist/foundations/auth/entities/auth.map.js +0 -14
  350. package/dist/foundations/auth/entities/auth.map.js.map +0 -1
  351. package/dist/foundations/auth/entities/auth.model.d.ts +0 -4
  352. package/dist/foundations/auth/entities/auth.model.d.ts.map +0 -1
  353. package/dist/foundations/auth/entities/auth.model.js +0 -15
  354. package/dist/foundations/auth/entities/auth.model.js.map +0 -1
  355. package/dist/foundations/auth/entities/pending-auth.entity.d.ts +0 -16
  356. package/dist/foundations/auth/entities/pending-auth.entity.d.ts.map +0 -1
  357. package/dist/foundations/auth/entities/pending-auth.entity.js.map +0 -1
  358. package/dist/foundations/auth/entities/pending-auth.map.d.ts +0 -6
  359. package/dist/foundations/auth/entities/pending-auth.map.d.ts.map +0 -1
  360. package/dist/foundations/auth/entities/pending-auth.map.js +0 -20
  361. package/dist/foundations/auth/entities/pending-auth.map.js.map +0 -1
  362. package/dist/foundations/auth/entities/pending-auth.model.d.ts +0 -9
  363. package/dist/foundations/auth/entities/pending-auth.model.d.ts.map +0 -1
  364. package/dist/foundations/auth/entities/pending-auth.model.js +0 -19
  365. package/dist/foundations/auth/entities/pending-auth.model.js.map +0 -1
  366. package/dist/foundations/auth/serialisers/auth.serialiser.d.ts +0 -13
  367. package/dist/foundations/auth/serialisers/auth.serialiser.d.ts.map +0 -1
  368. package/dist/foundations/auth/serialisers/auth.serialiser.js +0 -52
  369. package/dist/foundations/auth/serialisers/auth.serialiser.js.map +0 -1
  370. package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts +0 -18
  371. package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts.map +0 -1
  372. package/dist/foundations/auth/serialisers/pending-auth.serialiser.js +0 -49
  373. package/dist/foundations/auth/serialisers/pending-auth.serialiser.js.map +0 -1
  374. package/dist/foundations/content/entities/content.entity.d.ts +0 -31
  375. package/dist/foundations/content/entities/content.entity.d.ts.map +0 -1
  376. package/dist/foundations/content/entities/content.entity.js +0 -3
  377. package/dist/foundations/content/entities/content.entity.js.map +0 -1
  378. package/dist/foundations/content/entities/content.map.d.ts +0 -8
  379. package/dist/foundations/content/entities/content.map.d.ts.map +0 -1
  380. package/dist/foundations/content/entities/content.map.js +0 -19
  381. package/dist/foundations/content/entities/content.map.js.map +0 -1
  382. package/dist/foundations/content/entities/content.model.d.ts +0 -4
  383. package/dist/foundations/content/entities/content.model.d.ts.map +0 -1
  384. package/dist/foundations/content/entities/content.model.js +0 -16
  385. package/dist/foundations/content/entities/content.model.js.map +0 -1
  386. package/dist/foundations/content/factories/content.model.factory.d.ts +0 -17
  387. package/dist/foundations/content/factories/content.model.factory.d.ts.map +0 -1
  388. package/dist/foundations/content/factories/content.model.factory.js +0 -65
  389. package/dist/foundations/content/factories/content.model.factory.js.map +0 -1
  390. package/dist/foundations/content/serialisers/content.serialiser.d.ts +0 -14
  391. package/dist/foundations/content/serialisers/content.serialiser.d.ts.map +0 -1
  392. package/dist/foundations/content/serialisers/content.serialiser.js +0 -78
  393. package/dist/foundations/content/serialisers/content.serialiser.js.map +0 -1
  394. package/dist/foundations/feature/entities/feature.entity.d.ts +0 -8
  395. package/dist/foundations/feature/entities/feature.entity.d.ts.map +0 -1
  396. package/dist/foundations/feature/entities/feature.entity.js +0 -3
  397. package/dist/foundations/feature/entities/feature.entity.js.map +0 -1
  398. package/dist/foundations/feature/entities/feature.map.d.ts +0 -8
  399. package/dist/foundations/feature/entities/feature.map.d.ts.map +0 -1
  400. package/dist/foundations/feature/entities/feature.map.js +0 -14
  401. package/dist/foundations/feature/entities/feature.map.js.map +0 -1
  402. package/dist/foundations/feature/serialisers/feature.serialiser.d.ts +0 -12
  403. package/dist/foundations/feature/serialisers/feature.serialiser.d.ts.map +0 -1
  404. package/dist/foundations/feature/serialisers/feature.serialiser.js +0 -45
  405. package/dist/foundations/feature/serialisers/feature.serialiser.js.map +0 -1
  406. package/dist/foundations/notification/entities/notification.entity.d.ts +0 -10
  407. package/dist/foundations/notification/entities/notification.entity.d.ts.map +0 -1
  408. package/dist/foundations/notification/entities/notification.entity.js +0 -3
  409. package/dist/foundations/notification/entities/notification.entity.js.map +0 -1
  410. package/dist/foundations/notification/entities/notification.map.d.ts +0 -8
  411. package/dist/foundations/notification/entities/notification.map.d.ts.map +0 -1
  412. package/dist/foundations/notification/entities/notification.map.js +0 -16
  413. package/dist/foundations/notification/entities/notification.map.js.map +0 -1
  414. package/dist/foundations/notification/entities/notification.model.d.ts +0 -4
  415. package/dist/foundations/notification/entities/notification.model.d.ts.map +0 -1
  416. package/dist/foundations/notification/entities/notification.model.js +0 -15
  417. package/dist/foundations/notification/entities/notification.model.js.map +0 -1
  418. package/dist/foundations/notification/interfaces/notification.service.interface.d.ts +0 -4
  419. package/dist/foundations/notification/interfaces/notification.service.interface.d.ts.map +0 -1
  420. package/dist/foundations/notification/interfaces/notification.service.interface.js +0 -3
  421. package/dist/foundations/notification/interfaces/notification.service.interface.js.map +0 -1
  422. package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts +0 -12
  423. package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts.map +0 -1
  424. package/dist/foundations/notification/serialisers/notifications.serialiser.js +0 -47
  425. package/dist/foundations/notification/serialisers/notifications.serialiser.js.map +0 -1
  426. package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts +0 -11
  427. package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts.map +0 -1
  428. package/dist/foundations/tokenusage/entities/tokenusage.entity.js +0 -3
  429. package/dist/foundations/tokenusage/entities/tokenusage.entity.js.map +0 -1
  430. package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts +0 -8
  431. package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts.map +0 -1
  432. package/dist/foundations/tokenusage/entities/tokenusage.map.js +0 -17
  433. package/dist/foundations/tokenusage/entities/tokenusage.map.js.map +0 -1
  434. package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts +0 -4
  435. package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts.map +0 -1
  436. package/dist/foundations/tokenusage/entities/tokenusage.model.js +0 -15
  437. package/dist/foundations/tokenusage/entities/tokenusage.model.js.map +0 -1
@@ -36,8 +36,16 @@ let ContentCypherService = class ContentCypherService {
36
36
  // Base MATCH clauses for core relationships
37
37
  let query = `
38
38
  MATCH (${content_meta_1.contentMeta.nodeName})-[:BELONGS_TO]->(${content_meta_1.contentMeta.nodeName}_${company_meta_1.companyMeta.nodeName}:${company_meta_1.companyMeta.labelName})
39
- MATCH (${content_meta_1.contentMeta.nodeName})<-[:PUBLISHED]-(${content_meta_1.contentMeta.nodeName}_${user_meta_1.ownerMeta.nodeName}:${user_meta_1.ownerMeta.labelName})
40
- MATCH (${content_meta_1.contentMeta.nodeName})<-[:PUBLISHED]-(${content_meta_1.contentMeta.nodeName}_${user_meta_1.authorMeta.nodeName}:${user_meta_1.authorMeta.labelName})`;
39
+ ${this.ownerMatch({ target: `${content_meta_1.contentMeta.nodeName}_${user_meta_1.ownerMeta.nodeName}:${user_meta_1.ownerMeta.labelName}` })}`;
40
+ // The author match is OPTIONAL: it traverses the SAME `PUBLISHED` edge as
41
+ // the owner match above, so on package data every row surviving the owner
42
+ // match already resolves it — the row set is unchanged by default. Making
43
+ // it optional stops it from silently dropping every row for apps whose
44
+ // owner edge is not `PUBLISHED` (see `ownerMatchPattern`).
45
+ if (this.serialiseAuthor) {
46
+ query += `
47
+ OPTIONAL MATCH (${content_meta_1.contentMeta.nodeName})<-[:PUBLISHED]-(${content_meta_1.contentMeta.nodeName}_${user_meta_1.authorMeta.nodeName}:${user_meta_1.authorMeta.labelName})`;
48
+ }
41
49
  // Add OPTIONAL MATCH for extension relationships
42
50
  if (this.extension?.additionalRelationships) {
43
51
  for (const rel of this.extension.additionalRelationships) {
@@ -51,12 +59,22 @@ let ContentCypherService = class ContentCypherService {
51
59
  OPTIONAL MATCH ${relPattern}`;
52
60
  }
53
61
  }
62
+ // Add the config-driven meta-field clauses (appended verbatim)
63
+ if (this.extension?.metaFields) {
64
+ for (const metaField of this.extension.metaFields) {
65
+ query += `
66
+ ${metaField.optionalMatch}`;
67
+ }
68
+ }
54
69
  // Base RETURN clause
55
70
  query += `
56
71
  RETURN ${content_meta_1.contentMeta.nodeName},
57
72
  ${content_meta_1.contentMeta.nodeName}_${company_meta_1.companyMeta.nodeName},
58
- ${content_meta_1.contentMeta.nodeName}_${user_meta_1.ownerMeta.nodeName},
73
+ ${content_meta_1.contentMeta.nodeName}_${user_meta_1.ownerMeta.nodeName}`;
74
+ if (this.serialiseAuthor) {
75
+ query += `,
59
76
  ${content_meta_1.contentMeta.nodeName}_${user_meta_1.authorMeta.nodeName}`;
77
+ }
60
78
  // Add extension relationship nodes to RETURN
61
79
  if (this.extension?.additionalRelationships) {
62
80
  for (const rel of this.extension.additionalRelationships) {
@@ -64,6 +82,13 @@ let ContentCypherService = class ContentCypherService {
64
82
  ${content_meta_1.contentMeta.nodeName}_${rel.model.nodeName}`;
65
83
  }
66
84
  }
85
+ // Add the config-driven meta-field projections
86
+ if (this.extension?.metaFields) {
87
+ for (const metaField of this.extension.metaFields) {
88
+ query += `,
89
+ ${metaField.returnAlias} AS ${metaField.key}`;
90
+ }
91
+ }
67
92
  // Add optional totalScore
68
93
  if (params?.useTotalScore) {
69
94
  query += `,
@@ -76,16 +101,52 @@ let ContentCypherService = class ContentCypherService {
76
101
  const types = this.configService.get("contentTypes")?.types ?? [];
77
102
  return types.length > 0 ? types : [content_meta_1.contentMeta.labelName];
78
103
  }
104
+ /** Whether the `author` relationship is matched and returned (default: yes). */
105
+ get serialiseAuthor() {
106
+ return this.extension?.serialiseAuthor !== false;
107
+ }
79
108
  default(params) {
80
109
  return `
81
110
  MATCH (${content_meta_1.contentMeta.nodeName}:${this.getContentTypes().join("|")} ${params ? ` {${params.searchField}: $searchValue}` : ``})
82
- WHERE $companyId IS NULL
111
+ WHERE ${this.extension?.requireTldr
112
+ ? `${content_meta_1.contentMeta.nodeName}.tldr IS NOT NULL
113
+ AND ${content_meta_1.contentMeta.nodeName}.tldr <> ""
114
+ AND `
115
+ : ``}$companyId IS NULL
83
116
  OR EXISTS {
84
117
  MATCH (${content_meta_1.contentMeta.nodeName})-[:BELONGS_TO]-(company)
85
118
  }
86
119
  WITH ${content_meta_1.contentMeta.nodeName}${params?.blockCompanyAndUser ? `` : `, company, currentUser`}
87
120
  `;
88
121
  }
122
+ /**
123
+ * The `requireTldr` filter as trailing `AND` predicates, for callers that
124
+ * already opened a WHERE clause of their own (e.g. `ContentRepository.findByIds`).
125
+ * Returns an empty string when the filter is disabled (the default).
126
+ */
127
+ tldrFilter() {
128
+ if (!this.extension?.requireTldr)
129
+ return ``;
130
+ return `
131
+ AND ${content_meta_1.contentMeta.nodeName}.tldr IS NOT NULL
132
+ AND ${content_meta_1.contentMeta.nodeName}.tldr <> ""`;
133
+ }
134
+ /**
135
+ * The Content → owner MATCH clause, driven by `ownerMatchPattern`.
136
+ *
137
+ * Default: `MATCH (content)<-[:PUBLISHED]-(<target>)`.
138
+ *
139
+ * @param params.target - The pattern's node body, e.g. `"content_owner:User"`
140
+ * (bind an alias) or `":User {id: $ownerId}"` (filter without binding).
141
+ */
142
+ ownerMatch(params) {
143
+ const pattern = this.extension?.ownerMatchPattern;
144
+ const relationships = pattern?.relationships?.length ? pattern.relationships : ["PUBLISHED"];
145
+ const relationshipTypes = relationships.join("|");
146
+ return pattern?.undirected
147
+ ? `MATCH (${content_meta_1.contentMeta.nodeName})-[:${relationshipTypes}]-(${params.target})`
148
+ : `MATCH (${content_meta_1.contentMeta.nodeName})<-[:${relationshipTypes}]-(${params.target})`;
149
+ }
89
150
  };
90
151
  exports.ContentCypherService = ContentCypherService;
91
152
  exports.ContentCypherService = ContentCypherService = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"content.cypher.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.cypher.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,2CAA+C;AAC/C,2CAAwC;AAExC,sEAAkE;AAClE,sEAAkE;AAClE,6DAAsE;AACtE,2FAA6G;AAGtG,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACmB,UAAsB,EACtB,aAAiD,EAGlE,SAAmD;QAJlC,eAAU,GAAV,UAAU,CAAY;QACtB,kBAAa,GAAb,aAAa,CAAoC;QAGjD,cAAS,GAAT,SAAS,CAAyB;QAmBrD,kBAAa,GAAG,CAAC,MAAoC,EAAU,EAAE;YAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACnD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAE7C,OAAO;aACE,0BAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,0BAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;KACzJ,CAAC;QACJ,CAAC,CAAC;QAEF,oBAAe,GAAG,CAAC,MAAoC,EAAE,EAAE;YACzD,4CAA4C;YAC5C,IAAI,KAAK,GAAG;eACD,0BAAW,CAAC,QAAQ,qBAAqB,0BAAW,CAAC,QAAQ,IAAI,0BAAW,CAAC,QAAQ,IAAI,0BAAW,CAAC,SAAS;eAC9G,0BAAW,CAAC,QAAQ,oBAAoB,0BAAW,CAAC,QAAQ,IAAI,qBAAS,CAAC,QAAQ,IAAI,qBAAS,CAAC,SAAS;eACzG,0BAAW,CAAC,QAAQ,oBAAoB,0BAAW,C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BACjD,CAAC;YACH,CAAC;YAED,0BAA0B;YAC1B,IAAI,MAAM,EAAE,aAAa,EAAE,CAAC;gBAC1B,KAAK,IAAI;mBACI,CAAC;YAChB,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;IAxEC,CAAC;IAEI,eAAe;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAA8B,cAAc,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;QAC/F,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,0BAAW,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,CAAC,MAA+D;QACrE,OAAO;eACI,0BAAW,CAAC,QAAQ,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,WAAW,iBAAiB,CAAC,CAAC,CAAC,EAAE;;;iBAGhH,0BAAW,CAAC,QAAQ;;aAExB,0BAAW,CAAC,QAAQ,GAAG,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAwB;KAC1F,CAAC;IACJ,CAAC;CAyDF,CAAA;AAhFY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,sDAAwB,CAAC,CAAA;qCAHJ,uBAAU;QACP,sBAAa;GAHpC,oBAAoB,CAgFhC"}
1
+ {"version":3,"file":"content.cypher.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.cypher.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,2CAA+C;AAC/C,2CAAwC;AAExC,sEAAkE;AAClE,sEAAkE;AAClE,6DAAsE;AACtE,2FAA6G;AAGtG,IAAM,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Aa;GAHpC,oBAAoB,CAuJhC"}
@@ -13,7 +13,7 @@ exports.ContentService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const jsonapi_paginator_1 = require("../../../core/jsonapi/serialisers/jsonapi.paginator");
15
15
  const jsonapi_service_1 = require("../../../core/jsonapi/services/jsonapi.service");
16
- const content_model_1 = require("../../content/entities/content.model");
16
+ const content_1 = require("../../content/entities/content");
17
17
  const content_repository_1 = require("../../content/repositories/content.repository");
18
18
  let ContentService = class ContentService {
19
19
  constructor(builder, contentRepository) {
@@ -22,7 +22,7 @@ let ContentService = class ContentService {
22
22
  }
23
23
  async find(params) {
24
24
  const paginator = new jsonapi_paginator_1.JsonApiPaginator(params.query);
25
- return this.builder.buildList(content_model_1.ContentModel, await this.contentRepository.find({
25
+ return this.builder.buildList((0, content_1.getContentModel)(), await this.contentRepository.find({
26
26
  fetchAll: params.fetchAll,
27
27
  term: params.term,
28
28
  orderBy: params.orderBy,
@@ -30,13 +30,13 @@ let ContentService = class ContentService {
30
30
  }), paginator);
31
31
  }
32
32
  async findByIds(params) {
33
- return this.builder.buildList(content_model_1.ContentModel, await this.contentRepository.findByIds({
33
+ return this.builder.buildList((0, content_1.getContentModel)(), await this.contentRepository.findByIds({
34
34
  contentIds: params.contentIds,
35
35
  }));
36
36
  }
37
37
  async findByOwner(params) {
38
38
  const paginator = new jsonapi_paginator_1.JsonApiPaginator(params.query);
39
- return this.builder.buildList(content_model_1.ContentModel, await this.contentRepository.findByOwner({
39
+ return this.builder.buildList((0, content_1.getContentModel)(), await this.contentRepository.findByOwner({
40
40
  ownerId: params.ownerId,
41
41
  fetchAll: params.fetchAll,
42
42
  term: params.term,
@@ -1 +1 @@
1
- {"version":3,"file":"content.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,2FAAuF;AACvF,oFAAgF;AAChF,wEAAoE;AACpE,sFAAkF;AAG3E,IAAM,cAA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AAA;AAlDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAGiB,gCAAc;QACJ,sCAAiB;GAH5C,cAAc,CAkD1B"}
1
+ {"version":3,"file":"content.service.js","sourceRoot":"","sources":["../../../../src/foundations/content/services/content.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,2FAAuF;AACvF,oFAAgF;AAChF,4DAAiE;AACjE,sFAAkF;AAG3E,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YACmB,OAAuB,EACvB,iBAAoC;QADpC,YAAO,GAAP,OAAO,CAAgB;QACvB,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,MAKV;QACC,MAAM,SAAS,GAAqB,IAAI,oCAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAC3B,IAAA,yBAAe,GAAE,EACjB,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAChC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,SAAS,CAAC,cAAc,EAAE;SACnC,CAAC,EACF,SAAS,CACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAgC;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAC3B,IAAA,yBAAe,GAAE,EACjB,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC;YACrC,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAA4F;QAC5G,MAAM,SAAS,GAAqB,IAAI,oCAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAC3B,IAAA,yBAAe,GAAE,EACjB,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC;YACvC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,SAAS,CAAC,cAAc,EAAE;SACnC,CAAC,EACF,SAAS,CACV,CAAC;IACJ,CAAC;CACF,CAAA;AAlDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAGiB,gCAAc;QACJ,sCAAiB;GAH5C,cAAc,CAkD1B"}
@@ -27,11 +27,11 @@ let DiscordUserService = class DiscordUserService {
27
27
  async create(params) {
28
28
  this.clsService.set("companyId", params.companyId);
29
29
  this.clsService.set("userId", params.userId);
30
- await this.companyRepository.create({
30
+ await this.companyRepository.createCompanyNode({
31
31
  companyId: params.companyId,
32
32
  name: `${params.userDetails.username}`,
33
33
  });
34
- await this.userRepository.create({
34
+ await this.userRepository.createUser({
35
35
  userId: params.userId,
36
36
  email: params.userDetails.email ?? params.userDetails.id,
37
37
  name: params.userDetails.username,
@@ -1 +1 @@
1
- {"version":3,"file":"discord-user.service.js","sourceRoot":"","sources":["../../../../src/foundations/discord-user/services/discord-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mCAAoC;AACpC,2CAAwC;AACxC,4CAAyC;AACzC,2CAAkD;AAClD,qCAA4C;AAC5C,qFAAgF;AAIzE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,qBAA4C,EAC5C,cAA8B,EAC9B,iBAAoC,EACpC,UAAsB;QAHtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAAY;I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AlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAG+B,+CAAqB;QAC5B,qBAAc;QACX,2BAAiB;QACxB,uBAAU;GAL9B,kBAAkB,CA6C9B"}
1
+ {"version":3,"file":"discord-user.service.js","sourceRoot":"","sources":["../../../../src/foundations/discord-user/services/discord-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mCAAoC;AACpC,2CAAwC;AACxC,4CAAyC;AACzC,2CAAkD;AAClD,qCAA4C;AAC5C,qFAAgF;AAIzE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,qBAA4C,EAC5C,cAA8B,EAC9B,iBAAoC,EACpC,UAAsB;QAHtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,MAOZ;QACC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,MAAM,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;YAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,IAAI,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE;SACvC,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;YACnC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE;YACxD,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ;YACjC,QAAQ,EAAE,IAAA,mBAAU,GAAE;YACtB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM;YACjC,OAAO,EAAE,CAAC,eAAM,CAAC,oBAAoB,CAAC;YACtC,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,IAAI,SAAS;SAC3D,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC;YACtC,EAAE,EAAE,MAAM,CAAC,MAAM;YACjB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE;YAChC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ;YACjC,IAAI,EAAE,MAAM,CAAC,MAAM;SACpB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA7CY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAG+B,+CAAqB;QAC5B,qBAAc;QACX,2BAAiB;QACxB,uBAAU;GAL9B,kBAAkB,CA6C9B"}
@@ -0,0 +1,32 @@
1
+ import { Entity } from "../../../common/abstracts/entity";
2
+ import { Module } from "../../module/entities/module.entity";
3
+ /**
4
+ * Feature Entity Type
5
+ */
6
+ export type Feature = Entity & {
7
+ name: string;
8
+ isCore: boolean;
9
+ module: Module[];
10
+ };
11
+ /**
12
+ * Feature Entity Descriptor
13
+ *
14
+ * Single source of truth for the Feature entity configuration.
15
+ * Generates mapper, childrenTokens, and DataModelInterface automatically.
16
+ */
17
+ export declare const FeatureDescriptor: import("../../..").EntityDescriptor<Feature, {
18
+ module: {
19
+ model: import("../../..").DataMeta;
20
+ direction: "in";
21
+ relationship: string;
22
+ cardinality: "many";
23
+ dtoKey: string;
24
+ description: string;
25
+ reverse: {
26
+ name: string;
27
+ description: string;
28
+ };
29
+ };
30
+ }>;
31
+ export type FeatureDescriptorType = typeof FeatureDescriptor;
32
+ //# sourceMappingURL=feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAEhB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;EAyD5B,CAAC;AAGH,MAAM,MAAM,qBAAqB,GAAG,OAAO,iBAAiB,CAAC"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeatureDescriptor = void 0;
4
+ const define_entity_1 = require("../../../common/helpers/define-entity");
5
+ const module_meta_1 = require("../../module/entities/module.meta");
6
+ const feature_meta_1 = require("./feature.meta");
7
+ /**
8
+ * Feature Entity Descriptor
9
+ *
10
+ * Single source of truth for the Feature entity configuration.
11
+ * Generates mapper, childrenTokens, and DataModelInterface automatically.
12
+ */
13
+ exports.FeatureDescriptor = (0, define_entity_1.defineEntity)()({
14
+ ...feature_meta_1.featureMeta,
15
+ // Features are global RBAC building blocks seeded once for the whole platform —
16
+ // there is no (Feature)-[:BELONGS_TO]->(Company) edge in the graph. Companies opt
17
+ // into features via a separate (Company)-[:HAS_FEATURE]->(Feature) edge (see
18
+ // FeatureRepository.findByCompany). Leaving this unset (defaults to true) would
19
+ // make the inherited buildDefaultMatch()/create()/put() require a BELONGS_TO edge
20
+ // that never exists, silently returning zero rows / failing writes.
21
+ isCompanyScoped: false,
22
+ // Catalog metadata: consumed by GraphDescriptorRegistry/GraphCatalogService when a
23
+ // host app graph-registers this descriptor. Inert for apps that never register it,
24
+ // and invisible to JSON:API — but the catalog contract REQUIRES a top-level
25
+ // description plus at least one described field, so these are not optional copy.
26
+ description: "A platform feature flag: a named capability of the product that can be enabled per company " +
27
+ "and that groups the RBAC modules (screens/entities) a company's users may access when the feature is on.",
28
+ chat: {
29
+ summary: (d) => d.name ?? d.id,
30
+ textSearchFields: ["name"],
31
+ },
32
+ // Field definitions
33
+ fields: {
34
+ name: {
35
+ type: "string",
36
+ required: true,
37
+ description: "The feature's display name.",
38
+ },
39
+ isCore: {
40
+ type: "boolean",
41
+ required: true,
42
+ default: false,
43
+ description: "Whether this feature is a core platform capability that every company has, as opposed to an opt-in add-on.",
44
+ },
45
+ },
46
+ // Relationship definitions
47
+ relationships: {
48
+ module: {
49
+ model: module_meta_1.moduleMeta,
50
+ direction: "in",
51
+ relationship: "IN_FEATURE",
52
+ cardinality: "many",
53
+ dtoKey: "modules",
54
+ description: "The RBAC modules (screens/entities) grouped under this feature.",
55
+ // `reverse.description` is a REQUIRED key on RelationshipDef["reverse"] —
56
+ // ported verbatim from the app descriptor (it was already English).
57
+ reverse: {
58
+ name: "feature",
59
+ description: "The feature this RBAC module belongs to.",
60
+ },
61
+ },
62
+ },
63
+ });
64
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.ts"],"names":[],"mappings":";;;AACA,yEAAqE;AAErE,mEAA+D;AAC/D,iDAA6C;AAY7C;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAA,4BAAY,GAAW,CAAC;IACvD,GAAG,0BAAW;IAEd,gFAAgF;IAChF,kFAAkF;IAClF,6EAA6E;IAC7E,gFAAgF;IAChF,kFAAkF;IAClF,oEAAoE;IACpE,eAAe,EAAE,KAAK;IAEtB,mFAAmF;IACnF,mFAAmF;IACnF,4EAA4E;IAC5E,iFAAiF;IACjF,WAAW,EACT,6FAA6F;QAC7F,0GAA0G;IAE5G,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE;QAC9B,gBAAgB,EAAE,CAAC,MAAM,CAAC;KAC3B;IAED,oBAAoB;IACpB,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,6BAA6B;SAC3C;QACD,MAAM,EAAE;YACN,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YACd,WAAW,EACT,4GAA4G;SAC/G;KACF;IAED,2BAA2B;IAC3B,aAAa,EAAE;QACb,MAAM,EAAE;YACN,KAAK,EAAE,wBAAU;YACjB,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,MAAM;YACnB,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,iEAAiE;YAC9E,0EAA0E;YAC1E,oEAAoE;YACpE,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,0CAA0C;aACxD;SACF;KACF;CACF,CAAC,CAAC"}
@@ -1,4 +1,2 @@
1
- import { DataModelInterface } from "../../../common/interfaces/datamodel.interface";
2
- import { Feature } from "../../feature/entities/feature.entity";
3
- export declare const FeatureModel: DataModelInterface<Feature>;
1
+ export declare const FeatureModel: import("../../..").DataModelInterface<import("./feature").Feature>;
4
2
  //# sourceMappingURL=feature.model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.model.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAMhE,eAAO,MAAM,YAAY,EAAE,kBAAkB,CAAC,OAAO,CAMpD,CAAC"}
1
+ {"version":3,"file":"feature.model.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,oEAA0B,CAAC"}
@@ -1,15 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FeatureModel = void 0;
4
- const feature_map_1 = require("../../feature/entities/feature.map");
5
- const feature_meta_1 = require("../../feature/entities/feature.meta");
6
- const feature_serialiser_1 = require("../../feature/serialisers/feature.serialiser");
7
- const module_meta_1 = require("../../module/entities/module.meta");
8
- exports.FeatureModel = {
9
- ...feature_meta_1.featureMeta,
10
- entity: undefined,
11
- mapper: feature_map_1.mapFeature,
12
- serialiser: feature_serialiser_1.FeatureSerialiser,
13
- childrenTokens: [module_meta_1.moduleMeta.nodeName],
14
- };
4
+ // Backward-compatibility aliases for pre-descriptor consumers (e.g. stripe-price serialiser).
5
+ const feature_1 = require("./feature");
6
+ exports.FeatureModel = feature_1.FeatureDescriptor.model;
15
7
  //# sourceMappingURL=feature.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.model.js","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":";;;AAEA,oEAAgE;AAChE,sEAAkE;AAClE,qFAAiF;AACjF,mEAA+D;AAElD,QAAA,YAAY,GAAgC;IACvD,GAAG,0BAAW;IACd,MAAM,EAAE,SAA+B;IACvC,MAAM,EAAE,wBAAU;IAClB,UAAU,EAAE,sCAAiB;IAC7B,cAAc,EAAE,CAAC,wBAAU,CAAC,QAAQ,CAAC;CACtC,CAAC"}
1
+ {"version":3,"file":"feature.model.js","sourceRoot":"","sources":["../../../../src/foundations/feature/entities/feature.model.ts"],"names":[],"mappings":";;;AAAA,8FAA8F;AAC9F,uCAA8C;AAEjC,QAAA,YAAY,GAAG,2BAAiB,CAAC,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAStD,qBAKa,aAAc,YAAW,YAAY;IAChD,YAAY;CAGb"}
1
+ {"version":3,"file":"feature.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQtD,qBAKa,aAAc,YAAW,YAAY;IAChD,YAAY;CAGb"}
@@ -10,21 +10,20 @@ exports.FeatureModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const registry_1 = require("../../common/registries/registry");
12
12
  const feature_controller_1 = require("./controllers/feature.controller");
13
- const feature_model_1 = require("./entities/feature.model");
14
- const feature_serialiser_1 = require("./serialisers/feature.serialiser");
13
+ const feature_1 = require("./entities/feature");
15
14
  const feature_repository_1 = require("./repositories/feature.repository");
16
15
  const feature_service_1 = require("./services/feature.service");
17
16
  let FeatureModule = class FeatureModule {
18
17
  onModuleInit() {
19
- registry_1.modelRegistry.register(feature_model_1.FeatureModel);
18
+ registry_1.modelRegistry.register(feature_1.FeatureDescriptor.model);
20
19
  }
21
20
  };
22
21
  exports.FeatureModule = FeatureModule;
23
22
  exports.FeatureModule = FeatureModule = __decorate([
24
23
  (0, common_1.Module)({
25
24
  controllers: [feature_controller_1.FeatureController],
26
- providers: [feature_repository_1.FeatureRepository, feature_service_1.FeatureService, feature_serialiser_1.FeatureSerialiser],
27
- exports: [feature_service_1.FeatureService, feature_repository_1.FeatureRepository, feature_serialiser_1.FeatureSerialiser],
25
+ providers: [feature_repository_1.FeatureRepository, feature_service_1.FeatureService, feature_1.FeatureDescriptor.model.serialiser],
26
+ exports: [feature_service_1.FeatureService, feature_repository_1.FeatureRepository, feature_1.FeatureDescriptor.model.serialiser],
28
27
  })
29
28
  ], FeatureModule);
30
29
  //# sourceMappingURL=feature.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.module.js","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AAEtD,+DAAiE;AACjE,yEAAqE;AACrE,4DAAwD;AACxD,yEAAqE;AACrE,0EAAsE;AACtE,gEAA4D;AAOrD,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,4BAAY,CAAC,CAAC;IACvC,CAAC;CACF,CAAA;AAJY,sCAAa;wBAAb,aAAa;IALzB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,sCAAiB,EAAE,gCAAc,EAAE,sCAAiB,CAAC;QACjE,OAAO,EAAE,CAAC,gCAAc,EAAE,sCAAiB,EAAE,sCAAiB,CAAC;KAChE,CAAC;GACW,aAAa,CAIzB"}
1
+ {"version":3,"file":"feature.module.js","sourceRoot":"","sources":["../../../src/foundations/feature/feature.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AAEtD,+DAAiE;AACjE,yEAAqE;AACrE,gDAAuD;AACvD,0EAAsE;AACtE,gEAA4D;AAOrD,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,2BAAiB,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;CACF,CAAA;AAJY,sCAAa;wBAAb,aAAa;IALzB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,sCAAiB,EAAE,gCAAc,EAAE,2BAAiB,CAAC,KAAK,CAAC,UAAU,CAAC;QAClF,OAAO,EAAE,CAAC,gCAAc,EAAE,sCAAiB,EAAE,2BAAiB,CAAC,KAAK,CAAC,UAAU,CAAC;KACjF,CAAC;GACW,aAAa,CAIzB"}
@@ -1,2 +1,14 @@
1
1
  export { FeatureModule } from "./feature.module";
2
+ export { Feature, FeatureDescriptor, FeatureDescriptorType } from "./entities/feature";
3
+ export { featureMeta } from "./entities/feature.meta";
4
+ export { FeatureModel } from "./entities/feature.model";
5
+ export { FeatureRepository } from "./repositories/feature.repository";
6
+ export { FeatureService } from "./services/feature.service";
7
+ export { FeatureDTO, FeatureDataDTO, FeatureDataListDTO } from "./dtos/feature.dto";
8
+ /**
9
+ * Compat alias: the hand-written FeatureSerialiser class was replaced by the
10
+ * descriptor's auto-generated serialiser. The exported name is kept so existing
11
+ * consumers (DI providers, serialiser factories) keep resolving.
12
+ */
13
+ export declare const FeatureSerialiser: new (...args: any[]) => import("../..").SerialiserType;
2
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEpF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wDAAsC,CAAC"}
@@ -1,6 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FeatureModule = void 0;
3
+ exports.FeatureSerialiser = exports.FeatureDataListDTO = exports.FeatureDataDTO = exports.FeatureDTO = exports.FeatureService = exports.FeatureRepository = exports.FeatureModel = exports.featureMeta = exports.FeatureDescriptor = exports.FeatureModule = void 0;
4
+ const feature_1 = require("./entities/feature");
4
5
  var feature_module_1 = require("./feature.module");
5
6
  Object.defineProperty(exports, "FeatureModule", { enumerable: true, get: function () { return feature_module_1.FeatureModule; } });
7
+ var feature_2 = require("./entities/feature");
8
+ Object.defineProperty(exports, "FeatureDescriptor", { enumerable: true, get: function () { return feature_2.FeatureDescriptor; } });
9
+ var feature_meta_1 = require("./entities/feature.meta");
10
+ Object.defineProperty(exports, "featureMeta", { enumerable: true, get: function () { return feature_meta_1.featureMeta; } });
11
+ var feature_model_1 = require("./entities/feature.model");
12
+ Object.defineProperty(exports, "FeatureModel", { enumerable: true, get: function () { return feature_model_1.FeatureModel; } });
13
+ var feature_repository_1 = require("./repositories/feature.repository");
14
+ Object.defineProperty(exports, "FeatureRepository", { enumerable: true, get: function () { return feature_repository_1.FeatureRepository; } });
15
+ var feature_service_1 = require("./services/feature.service");
16
+ Object.defineProperty(exports, "FeatureService", { enumerable: true, get: function () { return feature_service_1.FeatureService; } });
17
+ var feature_dto_1 = require("./dtos/feature.dto");
18
+ Object.defineProperty(exports, "FeatureDTO", { enumerable: true, get: function () { return feature_dto_1.FeatureDTO; } });
19
+ Object.defineProperty(exports, "FeatureDataDTO", { enumerable: true, get: function () { return feature_dto_1.FeatureDataDTO; } });
20
+ Object.defineProperty(exports, "FeatureDataListDTO", { enumerable: true, get: function () { return feature_dto_1.FeatureDataListDTO; } });
21
+ /**
22
+ * Compat alias: the hand-written FeatureSerialiser class was replaced by the
23
+ * descriptor's auto-generated serialiser. The exported name is kept so existing
24
+ * consumers (DI providers, serialiser factories) keep resolving.
25
+ */
26
+ exports.FeatureSerialiser = feature_1.FeatureDescriptor.model.serialiser;
6
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/feature/index.ts"],"names":[],"mappings":";;;AAAA,gDAA6E;AAE7E,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,8CAAuF;AAArE,4GAAA,iBAAiB,OAAA;AACnC,wDAAsD;AAA7C,2GAAA,WAAW,OAAA;AACpB,0DAAwD;AAA/C,6GAAA,YAAY,OAAA;AACrB,wEAAsE;AAA7D,uHAAA,iBAAiB,OAAA;AAC1B,8DAA4D;AAAnD,iHAAA,cAAc,OAAA;AACvB,kDAAoF;AAA3E,yGAAA,UAAU,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAEvD;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,2BAAkB,CAAC,KAAK,CAAC,UAAU,CAAC"}
@@ -1,19 +1,43 @@
1
- import { OnModuleInit } from "@nestjs/common";
2
- import { JsonApiCursorInterface } from "../../../core/jsonapi/interfaces/jsonapi.cursor.interface";
3
- import { AppLoggingService } from "../../../core/logging/services/logging.service";
1
+ import { ClsService } from "nestjs-cls";
2
+ import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
4
3
  import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
5
- import { Feature } from "../../feature/entities/feature.entity";
6
- export declare class FeatureRepository implements OnModuleInit {
7
- private readonly neo4j;
8
- private readonly logger;
9
- constructor(neo4j: Neo4jService, logger: AppLoggingService);
10
- onModuleInit(): Promise<void>;
4
+ import { SecurityService } from "../../../core/security/services/security.service";
5
+ import { Feature, FeatureDescriptor } from "../entities/feature";
6
+ export declare class FeatureRepository extends AbstractRepository<Feature, typeof FeatureDescriptor.relationships> {
7
+ protected readonly descriptor: import("../../..").EntityDescriptor<Feature, {
8
+ module: {
9
+ model: import("../../..").DataMeta;
10
+ direction: "in";
11
+ relationship: string;
12
+ cardinality: "many";
13
+ dtoKey: string;
14
+ description: string;
15
+ reverse: {
16
+ name: string;
17
+ description: string;
18
+ };
19
+ };
20
+ }>;
21
+ constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
22
+ /**
23
+ * Companies opt into features via a (Company)-[:HAS_FEATURE]->(Feature) edge that
24
+ * is NOT modelled as a descriptor relationship (Feature.isCompanyScoped is false —
25
+ * it is a global entity many companies point to, not something a Feature "belongs"
26
+ * to). The explicit Company MATCH is the intended cross-tenant opt-in for a global
27
+ * entity, not a bypass of buildDefaultMatch(). Keep the name and signature stable —
28
+ * external consumers depend on them.
29
+ */
11
30
  findByCompany(params: {
12
31
  companyId: string;
13
32
  }): Promise<Feature[]>;
14
- find(params: {
15
- term?: string;
16
- cursor: JsonApiCursorInterface;
17
- }): Promise<Feature[]>;
33
+ /**
34
+ * Case-insensitive exact-name lookup — not the fulltext CONTAINS search the
35
+ * inherited find({ term }) performs. Feature is a global entity, so the bare
36
+ * label MATCH is correct here. Keep the name and signature stable — external
37
+ * consumers depend on them.
38
+ */
39
+ findByName(params: {
40
+ name: string;
41
+ }): Promise<Feature>;
18
42
  }
19
43
  //# sourceMappingURL=feature.repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/repositories/feature.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAGhE,qBACa,iBAAkB,YAAW,YAAY;IAElD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,iBAAiB;IAGtC,YAAY;IAMZ,aAAa,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAehE,IAAI,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,sBAAsB,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsB1F"}
1
+ {"version":3,"file":"feature.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/feature/repositories/feature.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGjE,qBACa,iBAAkB,SAAQ,kBAAkB,CAAC,OAAO,EAAE,OAAO,iBAAiB,CAAC,aAAa,CAAC;IACxG,SAAS,CAAC,QAAQ,CAAC,UAAU;;;;;;;;;;;;;OAAqB;gBAEtC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU;IAWzF;;;;;;;OAOG;IACG,aAAa,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAatE;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAa7D"}
@@ -11,54 +11,60 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.FeatureRepository = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
- const logging_service_1 = require("../../../core/logging/services/logging.service");
14
+ const nestjs_cls_1 = require("nestjs-cls");
15
+ const abstract_repository_1 = require("../../../core/neo4j/abstracts/abstract.repository");
15
16
  const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
16
- const feature_model_1 = require("../../feature/entities/feature.model");
17
- let FeatureRepository = class FeatureRepository {
18
- constructor(neo4j, logger) {
19
- this.neo4j = neo4j;
20
- this.logger = logger;
21
- }
22
- async onModuleInit() {
23
- await this.neo4j.writeOne({
24
- query: `CREATE CONSTRAINT feature_id IF NOT EXISTS FOR (feature:Feature) REQUIRE feature.id IS UNIQUE`,
25
- });
17
+ const security_service_1 = require("../../../core/security/services/security.service");
18
+ const feature_1 = require("../entities/feature");
19
+ const feature_meta_1 = require("../entities/feature.meta");
20
+ let FeatureRepository = class FeatureRepository extends abstract_repository_1.AbstractRepository {
21
+ constructor(neo4j, securityService, clsService) {
22
+ super(neo4j, securityService, clsService);
23
+ this.descriptor = feature_1.FeatureDescriptor;
26
24
  }
25
+ // onModuleInit() (id constraint + fulltext index) and find({ term, cursor, orderBy })
26
+ // (search + module relationship) are inherited — the descriptor declares `module` as a
27
+ // cardinality-many relationship, so buildReturnStatement() already emits the
28
+ // `OPTIONAL MATCH (feature)<-[:IN_FEATURE]-(feature_module:Module)` the old bespoke
29
+ // find() had, and the `name` string field auto-generates the fulltext index the
30
+ // inherited find() searches against for `term`.
31
+ /**
32
+ * Companies opt into features via a (Company)-[:HAS_FEATURE]->(Feature) edge that
33
+ * is NOT modelled as a descriptor relationship (Feature.isCompanyScoped is false —
34
+ * it is a global entity many companies point to, not something a Feature "belongs"
35
+ * to). The explicit Company MATCH is the intended cross-tenant opt-in for a global
36
+ * entity, not a bypass of buildDefaultMatch(). Keep the name and signature stable —
37
+ * external consumers depend on them.
38
+ */
27
39
  async findByCompany(params) {
28
- const query = this.neo4j.initQuery({ serialiser: feature_model_1.FeatureModel });
29
- query.queryParams = {
30
- companyId: params.companyId,
31
- };
40
+ const query = this.neo4j.initQuery({ serialiser: feature_1.FeatureDescriptor.model });
41
+ query.queryParams = { ...query.queryParams, companyId: params.companyId };
32
42
  query.query = `
33
- MATCH (company:Company {id: $companyId})-[:HAS_FEATURE]->(feature:Feature)
34
- RETURN feature
43
+ MATCH (company:Company {id: $companyId})-[:HAS_FEATURE]->(${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
44
+ RETURN ${feature_meta_1.featureMeta.nodeName}
35
45
  `;
36
46
  return this.neo4j.readMany(query);
37
47
  }
38
- async find(params) {
39
- const query = this.neo4j.initQuery({ serialiser: feature_model_1.FeatureModel, cursor: params.cursor });
40
- query.queryParams = {
41
- term: params.term,
42
- };
48
+ /**
49
+ * Case-insensitive exact-name lookup — not the fulltext CONTAINS search the
50
+ * inherited find({ term }) performs. Feature is a global entity, so the bare
51
+ * label MATCH is correct here. Keep the name and signature stable — external
52
+ * consumers depend on them.
53
+ */
54
+ async findByName(params) {
55
+ const query = this.neo4j.initQuery({ serialiser: feature_1.FeatureDescriptor.model });
56
+ query.queryParams = { ...query.queryParams, name: params.name };
43
57
  query.query = `
44
- MATCH (feature:Feature)
45
- ${params.term ? "WHERE toLower(feature.name) CONTAINS toLower($term)" : ""}
46
-
47
- WITH feature
48
- ORDER BY feature.name ASC
49
- {CURSOR}
50
-
51
- OPTIONAL MATCH (feature)<-[:IN_FEATURE]-(feature_module:Module)
52
-
53
- RETURN feature, feature_module
58
+ MATCH (${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
59
+ WHERE toLower(${feature_meta_1.featureMeta.nodeName}.name) = toLower($name)
60
+ ${this.buildReturnStatement()}
54
61
  `;
55
- return this.neo4j.readMany(query);
62
+ return this.neo4j.readOne(query);
56
63
  }
57
64
  };
58
65
  exports.FeatureRepository = FeatureRepository;
59
66
  exports.FeatureRepository = FeatureRepository = __decorate([
60
67
  (0, common_1.Injectable)(),
61
- __metadata("design:paramtypes", [neo4j_service_1.Neo4jService,
62
- logging_service_1.AppLoggingService])
68
+ __metadata("design:paramtypes", [neo4j_service_1.Neo4jService, security_service_1.SecurityService, nestjs_cls_1.ClsService])
63
69
  ], FeatureRepository);
64
70
  //# sourceMappingURL=feature.repository.js.map