@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.
Files changed (395) 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.guard.d.ts +3 -2
  7. package/dist/common/guards/jwt.auth.guard.d.ts.map +1 -1
  8. package/dist/common/guards/jwt.auth.guard.js +7 -2
  9. package/dist/common/guards/jwt.auth.guard.js.map +1 -1
  10. package/dist/common/interfaces/entity.schema.interface.d.ts +2 -0
  11. package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
  12. package/dist/common/tokens.d.ts +64 -0
  13. package/dist/common/tokens.d.ts.map +1 -1
  14. package/dist/common/tokens.js +37 -2
  15. package/dist/common/tokens.js.map +1 -1
  16. package/dist/config/base.config.d.ts.map +1 -1
  17. package/dist/config/base.config.js +1 -0
  18. package/dist/config/base.config.js.map +1 -1
  19. package/dist/config/enums/queue.id.d.ts +2 -1
  20. package/dist/config/enums/queue.id.d.ts.map +1 -1
  21. package/dist/config/enums/queue.id.js +1 -0
  22. package/dist/config/enums/queue.id.js.map +1 -1
  23. package/dist/config/interfaces/config.auth.interface.d.ts +7 -0
  24. package/dist/config/interfaces/config.auth.interface.d.ts.map +1 -1
  25. package/dist/config/interfaces/config.email.interface.d.ts +6 -0
  26. package/dist/config/interfaces/config.email.interface.d.ts.map +1 -1
  27. package/dist/core/email/services/email.service.d.ts +1 -0
  28. package/dist/core/email/services/email.service.d.ts.map +1 -1
  29. package/dist/core/email/services/email.service.js +22 -18
  30. package/dist/core/email/services/email.service.js.map +1 -1
  31. package/dist/core/llm/services/llm.service.d.ts +9 -1
  32. package/dist/core/llm/services/llm.service.d.ts.map +1 -1
  33. package/dist/core/llm/services/llm.service.js +13 -3
  34. package/dist/core/llm/services/llm.service.js.map +1 -1
  35. package/dist/core/neo4j/abstracts/abstract.repository.d.ts.map +1 -1
  36. package/dist/core/neo4j/abstracts/abstract.repository.js +33 -2
  37. package/dist/core/neo4j/abstracts/abstract.repository.js.map +1 -1
  38. package/dist/foundations/auth/auth.module.d.ts.map +1 -1
  39. package/dist/foundations/auth/auth.module.js +9 -10
  40. package/dist/foundations/auth/auth.module.js.map +1 -1
  41. package/dist/foundations/auth/controllers/auth.controller.d.ts.map +1 -1
  42. package/dist/foundations/auth/controllers/auth.controller.js +5 -0
  43. package/dist/foundations/auth/controllers/auth.controller.js.map +1 -1
  44. package/dist/foundations/auth/controllers/auth.discord.controller.d.ts.map +1 -1
  45. package/dist/foundations/auth/controllers/auth.discord.controller.js +6 -3
  46. package/dist/foundations/auth/controllers/auth.discord.controller.js.map +1 -1
  47. package/dist/foundations/auth/controllers/auth.google.controller.d.ts.map +1 -1
  48. package/dist/foundations/auth/controllers/auth.google.controller.js +7 -3
  49. package/dist/foundations/auth/controllers/auth.google.controller.js.map +1 -1
  50. package/dist/foundations/auth/entities/auth.code.d.ts +34 -0
  51. package/dist/foundations/auth/entities/auth.code.d.ts.map +1 -0
  52. package/dist/foundations/auth/entities/auth.code.js +53 -0
  53. package/dist/foundations/auth/entities/auth.code.js.map +1 -0
  54. package/dist/foundations/auth/entities/auth.d.ts +41 -0
  55. package/dist/foundations/auth/entities/auth.d.ts.map +1 -0
  56. package/dist/foundations/auth/entities/auth.js +68 -0
  57. package/dist/foundations/auth/entities/auth.js.map +1 -0
  58. package/dist/foundations/auth/entities/pending-auth.d.ts +39 -0
  59. package/dist/foundations/auth/entities/pending-auth.d.ts.map +1 -0
  60. package/dist/foundations/auth/entities/pending-auth.js +41 -0
  61. package/dist/foundations/auth/entities/pending-auth.js.map +1 -0
  62. package/dist/foundations/auth/index.d.ts +13 -0
  63. package/dist/foundations/auth/index.d.ts.map +1 -1
  64. package/dist/foundations/auth/index.js +31 -1
  65. package/dist/foundations/auth/index.js.map +1 -1
  66. package/dist/foundations/auth/repositories/auth.repository.d.ts +49 -9
  67. package/dist/foundations/auth/repositories/auth.repository.d.ts.map +1 -1
  68. package/dist/foundations/auth/repositories/auth.repository.js +115 -63
  69. package/dist/foundations/auth/repositories/auth.repository.js.map +1 -1
  70. package/dist/foundations/auth/services/auth.discord.service.d.ts +1 -1
  71. package/dist/foundations/auth/services/auth.discord.service.d.ts.map +1 -1
  72. package/dist/foundations/auth/services/auth.discord.service.js +5 -2
  73. package/dist/foundations/auth/services/auth.discord.service.js.map +1 -1
  74. package/dist/foundations/auth/services/auth.google.service.d.ts +1 -1
  75. package/dist/foundations/auth/services/auth.google.service.d.ts.map +1 -1
  76. package/dist/foundations/auth/services/auth.google.service.js +6 -2
  77. package/dist/foundations/auth/services/auth.google.service.js.map +1 -1
  78. package/dist/foundations/auth/services/auth.service.d.ts +42 -7
  79. package/dist/foundations/auth/services/auth.service.d.ts.map +1 -1
  80. package/dist/foundations/auth/services/auth.service.js +140 -77
  81. package/dist/foundations/auth/services/auth.service.js.map +1 -1
  82. package/dist/foundations/company/entities/company.d.ts +1 -1
  83. package/dist/foundations/company/entities/company.d.ts.map +1 -1
  84. package/dist/foundations/company/entities/company.js +15 -1
  85. package/dist/foundations/company/entities/company.js.map +1 -1
  86. package/dist/foundations/company/index.d.ts +5 -0
  87. package/dist/foundations/company/index.d.ts.map +1 -1
  88. package/dist/foundations/company/index.js +16 -1
  89. package/dist/foundations/company/index.js.map +1 -1
  90. package/dist/foundations/company/processors/company.processor.js +1 -1
  91. package/dist/foundations/company/processors/company.processor.js.map +1 -1
  92. package/dist/foundations/company/repositories/company.repository.d.ts +65 -9
  93. package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
  94. package/dist/foundations/company/repositories/company.repository.js +59 -18
  95. package/dist/foundations/company/repositories/company.repository.js.map +1 -1
  96. package/dist/foundations/company/services/company.service.d.ts +44 -4
  97. package/dist/foundations/company/services/company.service.d.ts.map +1 -1
  98. package/dist/foundations/company/services/company.service.js +33 -7
  99. package/dist/foundations/company/services/company.service.js.map +1 -1
  100. package/dist/foundations/content/content.module.d.ts +20 -8
  101. package/dist/foundations/content/content.module.d.ts.map +1 -1
  102. package/dist/foundations/content/content.module.js +40 -24
  103. package/dist/foundations/content/content.module.js.map +1 -1
  104. package/dist/foundations/content/controllers/content.controller.d.ts +1 -1
  105. package/dist/foundations/content/controllers/content.controller.d.ts.map +1 -1
  106. package/dist/foundations/content/controllers/content.controller.js +2 -2
  107. package/dist/foundations/content/controllers/content.controller.js.map +1 -1
  108. package/dist/foundations/content/entities/content.d.ts +74 -0
  109. package/dist/foundations/content/entities/content.d.ts.map +1 -0
  110. package/dist/foundations/content/entities/content.js +141 -0
  111. package/dist/foundations/content/entities/content.js.map +1 -0
  112. package/dist/foundations/content/index.d.ts +2 -4
  113. package/dist/foundations/content/index.d.ts.map +1 -1
  114. package/dist/foundations/content/index.js +6 -5
  115. package/dist/foundations/content/index.js.map +1 -1
  116. package/dist/foundations/content/interfaces/content.extension.interface.d.ts +126 -0
  117. package/dist/foundations/content/interfaces/content.extension.interface.d.ts.map +1 -1
  118. package/dist/foundations/content/interfaces/content.extension.interface.js +7 -1
  119. package/dist/foundations/content/interfaces/content.extension.interface.js.map +1 -1
  120. package/dist/foundations/content/repositories/content.repository.d.ts +14 -7
  121. package/dist/foundations/content/repositories/content.repository.d.ts.map +1 -1
  122. package/dist/foundations/content/repositories/content.repository.js +18 -16
  123. package/dist/foundations/content/repositories/content.repository.js.map +1 -1
  124. package/dist/foundations/content/services/content.cypher.service.d.ts +19 -0
  125. package/dist/foundations/content/services/content.cypher.service.d.ts.map +1 -1
  126. package/dist/foundations/content/services/content.cypher.service.js +65 -4
  127. package/dist/foundations/content/services/content.cypher.service.js.map +1 -1
  128. package/dist/foundations/content/services/content.service.js +4 -4
  129. package/dist/foundations/content/services/content.service.js.map +1 -1
  130. package/dist/foundations/discord-user/services/discord-user.service.js +2 -2
  131. package/dist/foundations/discord-user/services/discord-user.service.js.map +1 -1
  132. package/dist/foundations/feature/entities/feature.d.ts +32 -0
  133. package/dist/foundations/feature/entities/feature.d.ts.map +1 -0
  134. package/dist/foundations/feature/entities/feature.js +64 -0
  135. package/dist/foundations/feature/entities/feature.js.map +1 -0
  136. package/dist/foundations/feature/entities/feature.model.d.ts +1 -3
  137. package/dist/foundations/feature/entities/feature.model.d.ts.map +1 -1
  138. package/dist/foundations/feature/entities/feature.model.js +3 -11
  139. package/dist/foundations/feature/entities/feature.model.js.map +1 -1
  140. package/dist/foundations/feature/feature.module.d.ts.map +1 -1
  141. package/dist/foundations/feature/feature.module.js +4 -5
  142. package/dist/foundations/feature/feature.module.js.map +1 -1
  143. package/dist/foundations/feature/index.d.ts +12 -0
  144. package/dist/foundations/feature/index.d.ts.map +1 -1
  145. package/dist/foundations/feature/index.js +22 -1
  146. package/dist/foundations/feature/index.js.map +1 -1
  147. package/dist/foundations/feature/repositories/feature.repository.d.ts +37 -13
  148. package/dist/foundations/feature/repositories/feature.repository.d.ts.map +1 -1
  149. package/dist/foundations/feature/repositories/feature.repository.js +41 -35
  150. package/dist/foundations/feature/repositories/feature.repository.js.map +1 -1
  151. package/dist/foundations/feature/services/feature.service.d.ts +31 -4
  152. package/dist/foundations/feature/services/feature.service.d.ts.map +1 -1
  153. package/dist/foundations/feature/services/feature.service.js +20 -12
  154. package/dist/foundations/feature/services/feature.service.js.map +1 -1
  155. package/dist/foundations/foundations.modules.d.ts +6 -0
  156. package/dist/foundations/foundations.modules.d.ts.map +1 -1
  157. package/dist/foundations/foundations.modules.js +14 -3
  158. package/dist/foundations/foundations.modules.js.map +1 -1
  159. package/dist/foundations/google-user/services/google-user.service.js +2 -2
  160. package/dist/foundations/google-user/services/google-user.service.js.map +1 -1
  161. package/dist/foundations/index.d.ts +3 -0
  162. package/dist/foundations/index.d.ts.map +1 -1
  163. package/dist/foundations/index.js +3 -0
  164. package/dist/foundations/index.js.map +1 -1
  165. package/dist/foundations/membership/entities/membership.d.ts.map +1 -1
  166. package/dist/foundations/membership/entities/membership.js +4 -0
  167. package/dist/foundations/membership/entities/membership.js.map +1 -1
  168. package/dist/foundations/notification/controllers/notification.controller.js +2 -2
  169. package/dist/foundations/notification/controllers/notification.controller.js.map +1 -1
  170. package/dist/foundations/notification/entities/notification.d.ts +75 -0
  171. package/dist/foundations/notification/entities/notification.d.ts.map +1 -0
  172. package/dist/foundations/notification/entities/notification.js +73 -0
  173. package/dist/foundations/notification/entities/notification.js.map +1 -0
  174. package/dist/foundations/notification/index.d.ts +6 -2
  175. package/dist/foundations/notification/index.d.ts.map +1 -1
  176. package/dist/foundations/notification/index.js +17 -3
  177. package/dist/foundations/notification/index.js.map +1 -1
  178. package/dist/foundations/notification/notification.module.d.ts.map +1 -1
  179. package/dist/foundations/notification/notification.module.js +3 -4
  180. package/dist/foundations/notification/notification.module.js.map +1 -1
  181. package/dist/foundations/notification/repositories/notification.repository.d.ts +125 -8
  182. package/dist/foundations/notification/repositories/notification.repository.d.ts.map +1 -1
  183. package/dist/foundations/notification/repositories/notification.repository.js +219 -20
  184. package/dist/foundations/notification/repositories/notification.repository.js.map +1 -1
  185. package/dist/foundations/notification/services/notification.service.d.ts +31 -5
  186. package/dist/foundations/notification/services/notification.service.d.ts.map +1 -1
  187. package/dist/foundations/notification/services/notification.service.js +26 -9
  188. package/dist/foundations/notification/services/notification.service.js.map +1 -1
  189. package/dist/foundations/rbac/dump.d.ts +48 -4
  190. package/dist/foundations/rbac/dump.d.ts.map +1 -1
  191. package/dist/foundations/rbac/dump.js +28 -4
  192. package/dist/foundations/rbac/dump.js.map +1 -1
  193. package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts +14 -0
  194. package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts.map +1 -1
  195. package/dist/foundations/rbac/serializer/matrix-to-ts.js +13 -3
  196. package/dist/foundations/rbac/serializer/matrix-to-ts.js.map +1 -1
  197. package/dist/foundations/relevancy/repositories/relevancy.repository.d.ts.map +1 -1
  198. package/dist/foundations/relevancy/repositories/relevancy.repository.js +13 -1
  199. package/dist/foundations/relevancy/repositories/relevancy.repository.js.map +1 -1
  200. package/dist/foundations/role/entities/role.d.ts +1 -1
  201. package/dist/foundations/role/entities/role.d.ts.map +1 -1
  202. package/dist/foundations/stripe/index.d.ts +3 -0
  203. package/dist/foundations/stripe/index.d.ts.map +1 -1
  204. package/dist/foundations/stripe/index.js +6 -0
  205. package/dist/foundations/stripe/index.js.map +1 -1
  206. package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts +1 -1
  207. package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts.map +1 -1
  208. package/dist/foundations/tokenusage/entities/tokenusage.d.ts +49 -0
  209. package/dist/foundations/tokenusage/entities/tokenusage.d.ts.map +1 -0
  210. package/dist/foundations/tokenusage/entities/tokenusage.js +64 -0
  211. package/dist/foundations/tokenusage/entities/tokenusage.js.map +1 -0
  212. package/dist/foundations/tokenusage/index.d.ts +2 -2
  213. package/dist/foundations/tokenusage/index.d.ts.map +1 -1
  214. package/dist/foundations/tokenusage/index.js +5 -3
  215. package/dist/foundations/tokenusage/index.js.map +1 -1
  216. package/dist/foundations/tokenusage/repositories/tokenusage.repository.d.ts +33 -5
  217. package/dist/foundations/tokenusage/repositories/tokenusage.repository.d.ts.map +1 -1
  218. package/dist/foundations/tokenusage/repositories/tokenusage.repository.js +40 -14
  219. package/dist/foundations/tokenusage/repositories/tokenusage.repository.js.map +1 -1
  220. package/dist/foundations/tokenusage/services/tokenusage.service.d.ts +36 -9
  221. package/dist/foundations/tokenusage/services/tokenusage.service.d.ts.map +1 -1
  222. package/dist/foundations/tokenusage/services/tokenusage.service.js +32 -3
  223. package/dist/foundations/tokenusage/services/tokenusage.service.js.map +1 -1
  224. package/dist/foundations/tokenusage/tokenusage.module.js +3 -3
  225. package/dist/foundations/tokenusage/tokenusage.module.js.map +1 -1
  226. package/dist/foundations/user/controllers/user.controller.js +4 -4
  227. package/dist/foundations/user/controllers/user.controller.js.map +1 -1
  228. package/dist/foundations/user/dtos/user.put.dto.d.ts +1 -1
  229. package/dist/foundations/user/dtos/user.put.dto.d.ts.map +1 -1
  230. package/dist/foundations/user/dtos/user.put.dto.js +1 -1
  231. package/dist/foundations/user/dtos/user.put.dto.js.map +1 -1
  232. package/dist/foundations/user/entities/user.d.ts +4 -0
  233. package/dist/foundations/user/entities/user.d.ts.map +1 -1
  234. package/dist/foundations/user/entities/user.js +18 -4
  235. package/dist/foundations/user/entities/user.js.map +1 -1
  236. package/dist/foundations/user/index.d.ts +6 -1
  237. package/dist/foundations/user/index.d.ts.map +1 -1
  238. package/dist/foundations/user/index.js +13 -1
  239. package/dist/foundations/user/index.js.map +1 -1
  240. package/dist/foundations/user/repositories/user.repository.d.ts +56 -11
  241. package/dist/foundations/user/repositories/user.repository.d.ts.map +1 -1
  242. package/dist/foundations/user/repositories/user.repository.js +55 -35
  243. package/dist/foundations/user/repositories/user.repository.js.map +1 -1
  244. package/dist/foundations/user/services/user.service.d.ts +48 -9
  245. package/dist/foundations/user/services/user.service.d.ts.map +1 -1
  246. package/dist/foundations/user/services/user.service.js +50 -32
  247. package/dist/foundations/user/services/user.service.js.map +1 -1
  248. package/dist/foundations/user-activity/entities/user-activity.d.ts +36 -0
  249. package/dist/foundations/user-activity/entities/user-activity.d.ts.map +1 -0
  250. package/dist/foundations/user-activity/entities/user-activity.js +86 -0
  251. package/dist/foundations/user-activity/entities/user-activity.js.map +1 -0
  252. package/dist/foundations/user-activity/entities/user-activity.meta.d.ts +3 -0
  253. package/dist/foundations/user-activity/entities/user-activity.meta.d.ts.map +1 -0
  254. package/dist/foundations/user-activity/entities/user-activity.meta.js +10 -0
  255. package/dist/foundations/user-activity/entities/user-activity.meta.js.map +1 -0
  256. package/dist/foundations/user-activity/index.d.ts +10 -0
  257. package/dist/foundations/user-activity/index.d.ts.map +1 -0
  258. package/dist/foundations/user-activity/index.js +22 -0
  259. package/dist/foundations/user-activity/index.js.map +1 -0
  260. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.d.ts +29 -0
  261. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.d.ts.map +1 -0
  262. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.js +98 -0
  263. package/dist/foundations/user-activity/interceptors/user-activity.interceptor.js.map +1 -0
  264. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.d.ts +67 -0
  265. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.d.ts.map +1 -0
  266. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.js +26 -0
  267. package/dist/foundations/user-activity/interfaces/user-activity.config.interface.js.map +1 -0
  268. package/dist/foundations/user-activity/interfaces/user-activity.record.input.d.ts +18 -0
  269. package/dist/foundations/user-activity/interfaces/user-activity.record.input.d.ts.map +1 -0
  270. package/dist/foundations/{auth/entities/auth.entity.js → user-activity/interfaces/user-activity.record.input.js} +1 -1
  271. package/dist/foundations/user-activity/interfaces/user-activity.record.input.js.map +1 -0
  272. package/dist/foundations/user-activity/processors/user-activity.processor.d.ts +25 -0
  273. package/dist/foundations/user-activity/processors/user-activity.processor.d.ts.map +1 -0
  274. package/dist/foundations/user-activity/processors/user-activity.processor.js +74 -0
  275. package/dist/foundations/user-activity/processors/user-activity.processor.js.map +1 -0
  276. package/dist/foundations/user-activity/repositories/user-activity.repository.d.ts +47 -0
  277. package/dist/foundations/user-activity/repositories/user-activity.repository.d.ts.map +1 -0
  278. package/dist/foundations/user-activity/repositories/user-activity.repository.js +124 -0
  279. package/dist/foundations/user-activity/repositories/user-activity.repository.js.map +1 -0
  280. package/dist/foundations/user-activity/services/user-activity.service.d.ts +29 -0
  281. package/dist/foundations/user-activity/services/user-activity.service.d.ts.map +1 -0
  282. package/dist/foundations/user-activity/services/user-activity.service.js +61 -0
  283. package/dist/foundations/user-activity/services/user-activity.service.js.map +1 -0
  284. package/dist/foundations/user-activity/user-activity.module.d.ts +40 -0
  285. package/dist/foundations/user-activity/user-activity.module.d.ts.map +1 -0
  286. package/dist/foundations/user-activity/user-activity.module.js +99 -0
  287. package/dist/foundations/user-activity/user-activity.module.js.map +1 -0
  288. package/package.json +1 -1
  289. package/dist/foundations/auth/entities/auth.code.entity.d.ts +0 -7
  290. package/dist/foundations/auth/entities/auth.code.entity.d.ts.map +0 -1
  291. package/dist/foundations/auth/entities/auth.code.entity.js +0 -3
  292. package/dist/foundations/auth/entities/auth.code.entity.js.map +0 -1
  293. package/dist/foundations/auth/entities/auth.code.map.d.ts +0 -8
  294. package/dist/foundations/auth/entities/auth.code.map.d.ts.map +0 -1
  295. package/dist/foundations/auth/entities/auth.code.map.js +0 -13
  296. package/dist/foundations/auth/entities/auth.code.map.js.map +0 -1
  297. package/dist/foundations/auth/entities/auth.code.model.d.ts +0 -4
  298. package/dist/foundations/auth/entities/auth.code.model.d.ts.map +0 -1
  299. package/dist/foundations/auth/entities/auth.code.model.js +0 -13
  300. package/dist/foundations/auth/entities/auth.code.model.js.map +0 -1
  301. package/dist/foundations/auth/entities/auth.entity.d.ts +0 -18
  302. package/dist/foundations/auth/entities/auth.entity.d.ts.map +0 -1
  303. package/dist/foundations/auth/entities/auth.entity.js.map +0 -1
  304. package/dist/foundations/auth/entities/auth.map.d.ts +0 -8
  305. package/dist/foundations/auth/entities/auth.map.d.ts.map +0 -1
  306. package/dist/foundations/auth/entities/auth.map.js +0 -14
  307. package/dist/foundations/auth/entities/auth.map.js.map +0 -1
  308. package/dist/foundations/auth/entities/auth.model.d.ts +0 -4
  309. package/dist/foundations/auth/entities/auth.model.d.ts.map +0 -1
  310. package/dist/foundations/auth/entities/auth.model.js +0 -15
  311. package/dist/foundations/auth/entities/auth.model.js.map +0 -1
  312. package/dist/foundations/auth/entities/pending-auth.entity.d.ts +0 -16
  313. package/dist/foundations/auth/entities/pending-auth.entity.d.ts.map +0 -1
  314. package/dist/foundations/auth/entities/pending-auth.entity.js +0 -3
  315. package/dist/foundations/auth/entities/pending-auth.entity.js.map +0 -1
  316. package/dist/foundations/auth/entities/pending-auth.map.d.ts +0 -6
  317. package/dist/foundations/auth/entities/pending-auth.map.d.ts.map +0 -1
  318. package/dist/foundations/auth/entities/pending-auth.map.js +0 -20
  319. package/dist/foundations/auth/entities/pending-auth.map.js.map +0 -1
  320. package/dist/foundations/auth/entities/pending-auth.model.d.ts +0 -9
  321. package/dist/foundations/auth/entities/pending-auth.model.d.ts.map +0 -1
  322. package/dist/foundations/auth/entities/pending-auth.model.js +0 -19
  323. package/dist/foundations/auth/entities/pending-auth.model.js.map +0 -1
  324. package/dist/foundations/auth/serialisers/auth.serialiser.d.ts +0 -13
  325. package/dist/foundations/auth/serialisers/auth.serialiser.d.ts.map +0 -1
  326. package/dist/foundations/auth/serialisers/auth.serialiser.js +0 -52
  327. package/dist/foundations/auth/serialisers/auth.serialiser.js.map +0 -1
  328. package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts +0 -18
  329. package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts.map +0 -1
  330. package/dist/foundations/auth/serialisers/pending-auth.serialiser.js +0 -49
  331. package/dist/foundations/auth/serialisers/pending-auth.serialiser.js.map +0 -1
  332. package/dist/foundations/content/entities/content.entity.d.ts +0 -31
  333. package/dist/foundations/content/entities/content.entity.d.ts.map +0 -1
  334. package/dist/foundations/content/entities/content.entity.js +0 -3
  335. package/dist/foundations/content/entities/content.entity.js.map +0 -1
  336. package/dist/foundations/content/entities/content.map.d.ts +0 -8
  337. package/dist/foundations/content/entities/content.map.d.ts.map +0 -1
  338. package/dist/foundations/content/entities/content.map.js +0 -19
  339. package/dist/foundations/content/entities/content.map.js.map +0 -1
  340. package/dist/foundations/content/entities/content.model.d.ts +0 -4
  341. package/dist/foundations/content/entities/content.model.d.ts.map +0 -1
  342. package/dist/foundations/content/entities/content.model.js +0 -16
  343. package/dist/foundations/content/entities/content.model.js.map +0 -1
  344. package/dist/foundations/content/factories/content.model.factory.d.ts +0 -17
  345. package/dist/foundations/content/factories/content.model.factory.d.ts.map +0 -1
  346. package/dist/foundations/content/factories/content.model.factory.js +0 -65
  347. package/dist/foundations/content/factories/content.model.factory.js.map +0 -1
  348. package/dist/foundations/content/serialisers/content.serialiser.d.ts +0 -14
  349. package/dist/foundations/content/serialisers/content.serialiser.d.ts.map +0 -1
  350. package/dist/foundations/content/serialisers/content.serialiser.js +0 -78
  351. package/dist/foundations/content/serialisers/content.serialiser.js.map +0 -1
  352. package/dist/foundations/feature/entities/feature.entity.d.ts +0 -8
  353. package/dist/foundations/feature/entities/feature.entity.d.ts.map +0 -1
  354. package/dist/foundations/feature/entities/feature.entity.js +0 -3
  355. package/dist/foundations/feature/entities/feature.entity.js.map +0 -1
  356. package/dist/foundations/feature/entities/feature.map.d.ts +0 -8
  357. package/dist/foundations/feature/entities/feature.map.d.ts.map +0 -1
  358. package/dist/foundations/feature/entities/feature.map.js +0 -14
  359. package/dist/foundations/feature/entities/feature.map.js.map +0 -1
  360. package/dist/foundations/feature/serialisers/feature.serialiser.d.ts +0 -12
  361. package/dist/foundations/feature/serialisers/feature.serialiser.d.ts.map +0 -1
  362. package/dist/foundations/feature/serialisers/feature.serialiser.js +0 -45
  363. package/dist/foundations/feature/serialisers/feature.serialiser.js.map +0 -1
  364. package/dist/foundations/notification/entities/notification.entity.d.ts +0 -10
  365. package/dist/foundations/notification/entities/notification.entity.d.ts.map +0 -1
  366. package/dist/foundations/notification/entities/notification.entity.js +0 -3
  367. package/dist/foundations/notification/entities/notification.entity.js.map +0 -1
  368. package/dist/foundations/notification/entities/notification.map.d.ts +0 -8
  369. package/dist/foundations/notification/entities/notification.map.d.ts.map +0 -1
  370. package/dist/foundations/notification/entities/notification.map.js +0 -16
  371. package/dist/foundations/notification/entities/notification.map.js.map +0 -1
  372. package/dist/foundations/notification/entities/notification.model.d.ts +0 -4
  373. package/dist/foundations/notification/entities/notification.model.d.ts.map +0 -1
  374. package/dist/foundations/notification/entities/notification.model.js +0 -15
  375. package/dist/foundations/notification/entities/notification.model.js.map +0 -1
  376. package/dist/foundations/notification/interfaces/notification.service.interface.d.ts +0 -4
  377. package/dist/foundations/notification/interfaces/notification.service.interface.d.ts.map +0 -1
  378. package/dist/foundations/notification/interfaces/notification.service.interface.js +0 -3
  379. package/dist/foundations/notification/interfaces/notification.service.interface.js.map +0 -1
  380. package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts +0 -12
  381. package/dist/foundations/notification/serialisers/notifications.serialiser.d.ts.map +0 -1
  382. package/dist/foundations/notification/serialisers/notifications.serialiser.js +0 -47
  383. package/dist/foundations/notification/serialisers/notifications.serialiser.js.map +0 -1
  384. package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts +0 -11
  385. package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts.map +0 -1
  386. package/dist/foundations/tokenusage/entities/tokenusage.entity.js +0 -3
  387. package/dist/foundations/tokenusage/entities/tokenusage.entity.js.map +0 -1
  388. package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts +0 -8
  389. package/dist/foundations/tokenusage/entities/tokenusage.map.d.ts.map +0 -1
  390. package/dist/foundations/tokenusage/entities/tokenusage.map.js +0 -17
  391. package/dist/foundations/tokenusage/entities/tokenusage.map.js.map +0 -1
  392. package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts +0 -4
  393. package/dist/foundations/tokenusage/entities/tokenusage.model.d.ts.map +0 -1
  394. package/dist/foundations/tokenusage/entities/tokenusage.model.js +0 -15
  395. package/dist/foundations/tokenusage/entities/tokenusage.model.js.map +0 -1
@@ -15,6 +15,7 @@ export * from "./content";
15
15
  export * from "./discord";
16
16
  export * from "./discord-user";
17
17
  export * from "./feature";
18
+ export * from "./google-user";
18
19
  export * from "./how-to";
19
20
  export * from "./keyconcept";
20
21
  export * from "./membership";
@@ -30,5 +31,7 @@ export * from "./stripe";
30
31
  export * from "./tokenusage";
31
32
  export * from "./two-factor";
32
33
  export * from "./user";
34
+ export * from "./user-activity";
35
+ export * from "./waitlist";
33
36
  export * from "./rbac";
34
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/foundations/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,uBAAuB,CAAC;AAGtC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/foundations/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,uBAAuB,CAAC;AAGtC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
@@ -33,6 +33,7 @@ __exportStar(require("./content"), exports);
33
33
  __exportStar(require("./discord"), exports);
34
34
  __exportStar(require("./discord-user"), exports);
35
35
  __exportStar(require("./feature"), exports);
36
+ __exportStar(require("./google-user"), exports);
36
37
  __exportStar(require("./how-to"), exports);
37
38
  __exportStar(require("./keyconcept"), exports);
38
39
  __exportStar(require("./membership"), exports);
@@ -48,5 +49,7 @@ __exportStar(require("./stripe"), exports);
48
49
  __exportStar(require("./tokenusage"), exports);
49
50
  __exportStar(require("./two-factor"), exports);
50
51
  __exportStar(require("./user"), exports);
52
+ __exportStar(require("./user-activity"), exports);
53
+ __exportStar(require("./waitlist"), exports);
51
54
  __exportStar(require("./rbac"), exports);
52
55
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/foundations/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,sFAAsF;AACtF,wDAAsC;AAEtC,iFAAiF;AACjF,8CAA4B;AAC5B,qDAAmC;AACnC,sDAAoC;AACpC,+CAA6B;AAC7B,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,iDAA+B;AAC/B,4CAA0B;AAC1B,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B;AAC7B,2CAAyB;AACzB,iDAA+B;AAC/B,0CAAwB;AACxB,yCAAuB;AACvB,6CAA2B;AAC3B,8CAA4B;AAC5B,yCAAuB;AACvB,uCAAqB;AACrB,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B;AAC7B,yCAAuB;AACvB,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/foundations/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,sFAAsF;AACtF,wDAAsC;AAEtC,iFAAiF;AACjF,8CAA4B;AAC5B,qDAAmC;AACnC,sDAAoC;AACpC,+CAA6B;AAC7B,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,iDAA+B;AAC/B,4CAA0B;AAC1B,gDAA8B;AAC9B,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B;AAC7B,2CAAyB;AACzB,iDAA+B;AAC/B,0CAAwB;AACxB,yCAAuB;AACvB,6CAA2B;AAC3B,8CAA4B;AAC5B,yCAAuB;AACvB,uCAAqB;AACrB,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B;AAC7B,yCAAuB;AACvB,kDAAgC;AAChC,6CAA2B;AAC3B,yCAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../../../../src/foundations/membership/entities/membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AAMvD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;EAgB/B,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,OAAO,oBAAoB,CAAC"}
1
+ {"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../../../../src/foundations/membership/entities/membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AAMvD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;EAqB/B,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,OAAO,oBAAoB,CAAC"}
@@ -8,6 +8,10 @@ const user_meta_1 = require("../../user/entities/user.meta");
8
8
  const membership_meta_1 = require("./membership.meta");
9
9
  exports.MembershipDescriptor = (0, common_1.defineEntity)()({
10
10
  ...membership_meta_1.membershipMeta,
11
+ // Platform-level memberships have NO IN_COMPANY edge (global Administrator).
12
+ // A company-scoped default would BELONGS_TO-filter any future generic read
13
+ // and silently hide platform memberships.
14
+ isCompanyScoped: false,
11
15
  fields: {},
12
16
  relationships: {
13
17
  user: { model: user_meta_1.userMeta, direction: "in", relationship: "HAS_MEMBERSHIP", cardinality: "one", dtoKey: "user" },
@@ -1 +1 @@
1
- {"version":3,"file":"membership.js","sourceRoot":"","sources":["../../../../src/foundations/membership/entities/membership.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AACvD,sEAAkE;AAClE,6DAAyD;AACzD,6DAAyD;AACzD,uDAAmD;AAWtC,QAAA,oBAAoB,GAAG,IAAA,qBAAY,GAAc,CAAC;IAC7D,GAAG,gCAAc;IAEjB,MAAM,EAAE,EAAE;IAEV,aAAa,EAAE;QACb,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QAC9G,OAAO,EAAE;YACP,KAAK,EAAE,0BAAW;YAClB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE,SAAS;SAClB;QACD,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;KAC5G;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"membership.js","sourceRoot":"","sources":["../../../../src/foundations/membership/entities/membership.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AACvD,sEAAkE;AAClE,6DAAyD;AACzD,6DAAyD;AACzD,uDAAmD;AAWtC,QAAA,oBAAoB,GAAG,IAAA,qBAAY,GAAc,CAAC;IAC7D,GAAG,gCAAc;IAEjB,6EAA6E;IAC7E,2EAA2E;IAC3E,0CAA0C;IAC1C,eAAe,EAAE,KAAK;IAEtB,MAAM,EAAE,EAAE;IAEV,aAAa,EAAE;QACb,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QAC9G,OAAO,EAAE;YACP,KAAK,EAAE,0BAAW;YAClB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE,SAAS;SAClB;QACD,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;KAC5G;CACF,CAAC,CAAC"}
@@ -26,10 +26,10 @@ let NotificationController = class NotificationController {
26
26
  this.cacheService = cacheService;
27
27
  }
28
28
  async findList(request, query, isArchived) {
29
- return await this.service.find({ query: query, userId: request.user.userId, isArchived: isArchived });
29
+ return await this.service.findForUser({ query: query, userId: request.user.userId, isArchived: isArchived });
30
30
  }
31
31
  async findById(request, notificationId) {
32
- return await this.service.findById({ notificationId: notificationId, userId: request.user.id });
32
+ return await this.service.findByIdForUser({ notificationId: notificationId, userId: request.user.id });
33
33
  }
34
34
  async markAsRead(request, query, body) {
35
35
  return await this.service.markAsRead({
@@ -1 +1 @@
1
- {"version":3,"file":"notification.controller.js","sourceRoot":"","sources":["../../../../src/foundations/notification/controllers/notification.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwH;AAExH,sGAAwF;AACxF,0EAAqE;AACrE,8EAA0E;AAC1E,2FAAoH;AACpH,qFAAiF;AACjF,2FAAwF;AAIjF,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YACmB,OAA6B,EAC7B,YAA0B;QAD1B,YAAO,GAAP,OAAO,CAAsB;QAC7B,iBAAY,GAAZ,YAAY,CAAc;IAC1C,CAAC;IAGE,AAAN,KAAK,CAAC,QAAQ,CAAQ,OAAY,EAAW,KAAU,EAAuB,UAAoB;QAChG,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;IACxG,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAQ,OAAY,EAA2B,cAAsB;QACjF,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAClG,CAAC;IAKK,AAAN,KAAK,CAAC,UAAU,CAAQ,OAAY,EAAW,KAAU,EAAU,IAA8B;QAC/F,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACnC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;YAC3B,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAsC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;SAC5F,CAAC,CAAC;IACL,CAAC;IAKK,AAAN,KAAK,CAAC,OAAO,CAAQ,OAAY,EAAW,KAAU,EAA2B,cAAsB;QACrG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACzB,cAAc,EAAE,cAAc;SAC/B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAlCY,wDAAsB;AAO3B;IADL,IAAA,YAAG,EAAC,oCAAgB,CAAC,QAAQ,CAAC;IACf,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,GAAE,CAAA;IAAc,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;;;;sDAE5E;AAGK;IADL,IAAA,YAAG,EAAC,GAAG,oCAAgB,CAAC,QAAQ,kBAAkB,CAAC;IACpC,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;;;;sDAE3D;AAKK;IAHL,IAAA,cAAK,EAAC,oCAAgB,CAAC,QAAQ,CAAC;IAChC,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAC/B,IAAA,4CAAe,EAAC,oCAAgB,EAAE,gBAAgB,CAAC;IAClC,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,GAAE,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;qDAAO,iDAAwB;;wDAKhG;AAKK;IAHL,IAAA,aAAI,EAAC,GAAG,oCAAgB,CAAC,QAAQ,0BAA0B,CAAC;IAC5D,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAC/B,IAAA,4CAAe,EAAC,oCAAgB,EAAE,gBAAgB,CAAC;IACrC,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,GAAE,CAAA;IAAc,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;;;;qDAI/E;iCAjCU,sBAAsB;IAFlC,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,mBAAU,GAAE;qCAGiB,2CAAoB;QACf,4BAAY;GAHlC,sBAAsB,CAkClC"}
1
+ {"version":3,"file":"notification.controller.js","sourceRoot":"","sources":["../../../../src/foundations/notification/controllers/notification.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwH;AAExH,sGAAwF;AACxF,0EAAqE;AACrE,8EAA0E;AAC1E,2FAAoH;AACpH,qFAAiF;AACjF,2FAAwF;AAIjF,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YACmB,OAA6B,EAC7B,YAA0B;QAD1B,YAAO,GAAP,OAAO,CAAsB;QAC7B,iBAAY,GAAZ,YAAY,CAAc;IAC1C,CAAC;IAGE,AAAN,KAAK,CAAC,QAAQ,CAAQ,OAAY,EAAW,KAAU,EAAuB,UAAoB;QAChG,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;IAC/G,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAQ,OAAY,EAA2B,cAAsB;QACjF,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACzG,CAAC;IAKK,AAAN,KAAK,CAAC,UAAU,CAAQ,OAAY,EAAW,KAAU,EAAU,IAA8B;QAC/F,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACnC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;YAC3B,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAsC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;SAC5F,CAAC,CAAC;IACL,CAAC;IAKK,AAAN,KAAK,CAAC,OAAO,CAAQ,OAAY,EAAW,KAAU,EAA2B,cAAsB;QACrG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACzB,cAAc,EAAE,cAAc;SAC/B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAlCY,wDAAsB;AAO3B;IADL,IAAA,YAAG,EAAC,oCAAgB,CAAC,QAAQ,CAAC;IACf,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,GAAE,CAAA;IAAc,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;;;;sDAE5E;AAGK;IADL,IAAA,YAAG,EAAC,GAAG,oCAAgB,CAAC,QAAQ,kBAAkB,CAAC;IACpC,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;;;;sDAE3D;AAKK;IAHL,IAAA,cAAK,EAAC,oCAAgB,CAAC,QAAQ,CAAC;IAChC,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAC/B,IAAA,4CAAe,EAAC,oCAAgB,EAAE,gBAAgB,CAAC;IAClC,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,GAAE,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;qDAAO,iDAAwB;;wDAKhG;AAKK;IAHL,IAAA,aAAI,EAAC,GAAG,oCAAgB,CAAC,QAAQ,0BAA0B,CAAC;IAC5D,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAC/B,IAAA,4CAAe,EAAC,oCAAgB,EAAE,gBAAgB,CAAC;IACrC,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,cAAK,GAAE,CAAA;IAAc,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;;;;qDAI/E;iCAjCU,sBAAsB;IAFlC,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,mBAAU,GAAE;qCAGiB,2CAAoB;QACf,4BAAY;GAHlC,sBAAsB,CAkClC"}
@@ -0,0 +1,75 @@
1
+ import { Entity } from "../../../common/abstracts/entity";
2
+ import { User } from "../../user/entities/user";
3
+ /**
4
+ * Notification Entity Type
5
+ *
6
+ * An in-app notification raised for a single recipient user. The graph shape is
7
+ * `(notification)-[:TRIGGERED_FOR]->(:User)` for the recipient,
8
+ * `(notification)-[:TRIGGERED_BY]->(:User)` for the actor, and
9
+ * `(notification)-[:REFERS_TO]->(subject)` for whatever the notification is
10
+ * about (the "subject"). The list query REQUIRES at least one REFERS_TO edge —
11
+ * see `NotificationRepository.findForUser` — so a notification created without
12
+ * a subject is invisible to the very list it was created for.
13
+ *
14
+ * Replaces the hand-written quartet (`notification.entity.ts`,
15
+ * `notification.map.ts`, `notification.model.ts`,
16
+ * `serialisers/notifications.serialiser.ts` — all deleted). The attribute and
17
+ * relationship surface below reproduces the old `NotificationSerialiser.create()`
18
+ * byte for byte: attributes `notificationType`, `isRead`, `message`,
19
+ * `actionUrl`; a single to-one `actor` relationship pointing at the User model
20
+ * (the old serialiser declared it under key `user` with `name: "actor"`, which
21
+ * put `actor` on the wire — the descriptor reaches the same wire key with key
22
+ * `actor` + `dtoKey: "actor"`).
23
+ */
24
+ export type Notification = Entity & {
25
+ notificationType: string;
26
+ isRead: boolean;
27
+ message?: string;
28
+ actionUrl?: string;
29
+ actor?: User;
30
+ };
31
+ /**
32
+ * Notification Entity Descriptor
33
+ *
34
+ * Single source of truth for the Notification entity configuration. Generates
35
+ * the mapper, the children tokens and the DataModelInterface automatically.
36
+ *
37
+ * `isCompanyScoped` is left at its default (`true`): every notification is
38
+ * written with a `(notification)-[:BELONGS_TO]->(company)` edge and every query
39
+ * in the repository joins `company`. The old hand-written model declared
40
+ * `singleChildrenTokens: [userMeta.nodeName]`; the descriptor derives
41
+ * `["company", "user"]` — the extra `company` token is inert on the wire (the
42
+ * serialiser only emits `relationships` declared below) and inert in entity
43
+ * mapping (no query RETURNs a `notification_company` column).
44
+ *
45
+ * No top-level `description`/`chat` block: the chatbot copy for a notification
46
+ * is application-specific (it describes each app's own notification types and
47
+ * subjects) and is supplied by the consuming app's extended descriptor. The
48
+ * per-field `description`s live here so an extended descriptor can spread
49
+ * `NotificationDescriptor.fields` and inherit them.
50
+ *
51
+ * Consuming apps that need more attributes, more subjects or a polymorphic
52
+ * actor register an EXTENDED descriptor (`modelRegistry`, last write wins) and
53
+ * subclass `NotificationRepository` — the narrowed-extend pattern used for
54
+ * user/auth/company/tokenusage. The package default stays User-only actor +
55
+ * `message`/`actionUrl`.
56
+ */
57
+ export declare const NotificationDescriptor: import("../../..").EntityDescriptor<Notification, {
58
+ actor: {
59
+ model: import("../../..").DataMeta;
60
+ direction: "out";
61
+ relationship: string;
62
+ cardinality: "one";
63
+ required: false;
64
+ dtoKey: string;
65
+ description: string;
66
+ };
67
+ }>;
68
+ export type NotificationDescriptorType = typeof NotificationDescriptor;
69
+ /**
70
+ * Back-compat alias for the pre-descriptor `NotificationModel` export (the
71
+ * `entities/notification.model.ts` file it used to live in is deleted). Mirrors
72
+ * `FeatureModel` in `foundations/feature/entities/feature.model.ts`.
73
+ */
74
+ export declare const NotificationModel: import("../../..").DataModelInterface<Notification>;
75
+ //# sourceMappingURL=notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../../src/foundations/notification/entities/notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,IAAI,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;EAoCjC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,OAAO,sBAAsB,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,qDAA+B,CAAC"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationModel = exports.NotificationDescriptor = void 0;
4
+ const define_entity_1 = require("../../../common/helpers/define-entity");
5
+ const user_meta_1 = require("../../user/entities/user.meta");
6
+ const notification_meta_1 = require("./notification.meta");
7
+ /**
8
+ * Notification Entity Descriptor
9
+ *
10
+ * Single source of truth for the Notification entity configuration. Generates
11
+ * the mapper, the children tokens and the DataModelInterface automatically.
12
+ *
13
+ * `isCompanyScoped` is left at its default (`true`): every notification is
14
+ * written with a `(notification)-[:BELONGS_TO]->(company)` edge and every query
15
+ * in the repository joins `company`. The old hand-written model declared
16
+ * `singleChildrenTokens: [userMeta.nodeName]`; the descriptor derives
17
+ * `["company", "user"]` — the extra `company` token is inert on the wire (the
18
+ * serialiser only emits `relationships` declared below) and inert in entity
19
+ * mapping (no query RETURNs a `notification_company` column).
20
+ *
21
+ * No top-level `description`/`chat` block: the chatbot copy for a notification
22
+ * is application-specific (it describes each app's own notification types and
23
+ * subjects) and is supplied by the consuming app's extended descriptor. The
24
+ * per-field `description`s live here so an extended descriptor can spread
25
+ * `NotificationDescriptor.fields` and inherit them.
26
+ *
27
+ * Consuming apps that need more attributes, more subjects or a polymorphic
28
+ * actor register an EXTENDED descriptor (`modelRegistry`, last write wins) and
29
+ * subclass `NotificationRepository` — the narrowed-extend pattern used for
30
+ * user/auth/company/tokenusage. The package default stays User-only actor +
31
+ * `message`/`actionUrl`.
32
+ */
33
+ exports.NotificationDescriptor = (0, define_entity_1.defineEntity)()({
34
+ ...notification_meta_1.notificationMeta,
35
+ fields: {
36
+ notificationType: {
37
+ type: "string",
38
+ required: true,
39
+ description: 'The event that triggered the notification (e.g. "MENTION", "TASK_ASSIGNED"). Drives the message text and icon shown to the recipient.',
40
+ },
41
+ isRead: {
42
+ type: "boolean",
43
+ required: true,
44
+ description: "Whether the recipient has opened/acknowledged this notification.",
45
+ },
46
+ message: {
47
+ type: "string",
48
+ description: "Pre-rendered message text shown to the recipient.",
49
+ },
50
+ actionUrl: {
51
+ type: "string",
52
+ description: "URL the recipient is sent to when acting on the notification.",
53
+ },
54
+ },
55
+ relationships: {
56
+ actor: {
57
+ model: user_meta_1.userMeta,
58
+ direction: "out",
59
+ relationship: "TRIGGERED_BY",
60
+ cardinality: "one",
61
+ required: false,
62
+ dtoKey: "actor",
63
+ description: "The user whose action triggered this notification.",
64
+ },
65
+ },
66
+ });
67
+ /**
68
+ * Back-compat alias for the pre-descriptor `NotificationModel` export (the
69
+ * `entities/notification.model.ts` file it used to live in is deleted). Mirrors
70
+ * `FeatureModel` in `foundations/feature/entities/feature.model.ts`.
71
+ */
72
+ exports.NotificationModel = exports.NotificationDescriptor.model;
73
+ //# sourceMappingURL=notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../../src/foundations/notification/entities/notification.ts"],"names":[],"mappings":";;;AACA,yEAAqE;AAErE,6DAAyD;AACzD,2DAAuD;AAgCvD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACU,QAAA,sBAAsB,GAAG,IAAA,4BAAY,GAAgB,CAAC;IACjE,GAAG,oCAAgB;IAEnB,MAAM,EAAE;QACN,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,uIAAuI;SAC1I;QACD,MAAM,EAAE;YACN,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kEAAkE;SAChF;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mDAAmD;SACjE;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+DAA+D;SAC7E;KACF;IAED,aAAa,EAAE;QACb,KAAK,EAAE;YACL,KAAK,EAAE,oBAAQ;YACf,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,cAAc;YAC5B,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,OAAO;YACf,WAAW,EAAE,oDAAoD;SAClE;KACF;CACF,CAAC,CAAC;AAIH;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,8BAAsB,CAAC,KAAK,CAAC"}
@@ -1,4 +1,8 @@
1
1
  export { NotificationModule } from "./notification.module";
2
- export { NotificationModel } from "./entities/notification.model";
3
- export { Notification } from "./entities/notification.entity";
2
+ export { Notification, NotificationDescriptor, NotificationDescriptorType, NotificationModel, } from "./entities/notification";
3
+ export { notificationMeta } from "./entities/notification.meta";
4
+ export { NotificationController } from "./controllers/notification.controller";
5
+ export { NotificationDataPatchDTO, NotificationPatchAttributesDTO, NotificationPatchDTO, NotificationPatchListDTO, } from "./dtos/notification.patch.dto";
6
+ export { NotificationRepository, NotificationTarget } from "./repositories/notification.repository";
7
+ export { NotificationServices } from "./services/notification.service";
4
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1,8 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationModel = exports.NotificationModule = void 0;
3
+ exports.NotificationServices = exports.NotificationRepository = exports.NotificationPatchListDTO = exports.NotificationPatchDTO = exports.NotificationPatchAttributesDTO = exports.NotificationDataPatchDTO = exports.NotificationController = exports.notificationMeta = exports.NotificationModel = exports.NotificationDescriptor = exports.NotificationModule = void 0;
4
4
  var notification_module_1 = require("./notification.module");
5
5
  Object.defineProperty(exports, "NotificationModule", { enumerable: true, get: function () { return notification_module_1.NotificationModule; } });
6
- var notification_model_1 = require("./entities/notification.model");
7
- Object.defineProperty(exports, "NotificationModel", { enumerable: true, get: function () { return notification_model_1.NotificationModel; } });
6
+ var notification_1 = require("./entities/notification");
7
+ Object.defineProperty(exports, "NotificationDescriptor", { enumerable: true, get: function () { return notification_1.NotificationDescriptor; } });
8
+ Object.defineProperty(exports, "NotificationModel", { enumerable: true, get: function () { return notification_1.NotificationModel; } });
9
+ var notification_meta_1 = require("./entities/notification.meta");
10
+ Object.defineProperty(exports, "notificationMeta", { enumerable: true, get: function () { return notification_meta_1.notificationMeta; } });
11
+ var notification_controller_1 = require("./controllers/notification.controller");
12
+ Object.defineProperty(exports, "NotificationController", { enumerable: true, get: function () { return notification_controller_1.NotificationController; } });
13
+ var notification_patch_dto_1 = require("./dtos/notification.patch.dto");
14
+ Object.defineProperty(exports, "NotificationDataPatchDTO", { enumerable: true, get: function () { return notification_patch_dto_1.NotificationDataPatchDTO; } });
15
+ Object.defineProperty(exports, "NotificationPatchAttributesDTO", { enumerable: true, get: function () { return notification_patch_dto_1.NotificationPatchAttributesDTO; } });
16
+ Object.defineProperty(exports, "NotificationPatchDTO", { enumerable: true, get: function () { return notification_patch_dto_1.NotificationPatchDTO; } });
17
+ Object.defineProperty(exports, "NotificationPatchListDTO", { enumerable: true, get: function () { return notification_patch_dto_1.NotificationPatchListDTO; } });
18
+ var notification_repository_1 = require("./repositories/notification.repository");
19
+ Object.defineProperty(exports, "NotificationRepository", { enumerable: true, get: function () { return notification_repository_1.NotificationRepository; } });
20
+ var notification_service_1 = require("./services/notification.service");
21
+ Object.defineProperty(exports, "NotificationServices", { enumerable: true, get: function () { return notification_service_1.NotificationServices; } });
8
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/notification/index.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAAlD,yHAAA,kBAAkB,OAAA;AAC3B,oEAAkE;AAAzD,uHAAA,iBAAiB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/notification/index.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAAlD,yHAAA,kBAAkB,OAAA;AAC3B,wDAKiC;AAH/B,sHAAA,sBAAsB,OAAA;AAEtB,iHAAA,iBAAiB,OAAA;AAEnB,kEAAgE;AAAvD,qHAAA,gBAAgB,OAAA;AACzB,iFAA+E;AAAtE,iIAAA,sBAAsB,OAAA;AAC/B,wEAKuC;AAJrC,kIAAA,wBAAwB,OAAA;AACxB,wIAAA,8BAA8B,OAAA;AAC9B,8HAAA,oBAAoB,OAAA;AACpB,kIAAA,wBAAwB,OAAA;AAE1B,kFAAoG;AAA3F,iIAAA,sBAAsB,OAAA;AAC/B,wEAAuE;AAA9D,4HAAA,oBAAoB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"notification.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/notification/notification.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQtD,qBAMa,kBAAmB,YAAW,YAAY;IACrD,YAAY;CAGb"}
1
+ {"version":3,"file":"notification.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/notification/notification.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOtD,qBAMa,kBAAmB,YAAW,YAAY;IACrD,YAAY;CAGb"}
@@ -10,20 +10,19 @@ exports.NotificationModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const registry_1 = require("../../common/registries/registry");
12
12
  const notification_controller_1 = require("./controllers/notification.controller");
13
- const notification_model_1 = require("./entities/notification.model");
13
+ const notification_1 = require("./entities/notification");
14
14
  const notification_repository_1 = require("./repositories/notification.repository");
15
- const notifications_serialiser_1 = require("./serialisers/notifications.serialiser");
16
15
  const notification_service_1 = require("./services/notification.service");
17
16
  let NotificationModule = class NotificationModule {
18
17
  onModuleInit() {
19
- registry_1.modelRegistry.register(notification_model_1.NotificationModel);
18
+ registry_1.modelRegistry.register(notification_1.NotificationDescriptor.model);
20
19
  }
21
20
  };
22
21
  exports.NotificationModule = NotificationModule;
23
22
  exports.NotificationModule = NotificationModule = __decorate([
24
23
  (0, common_1.Module)({
25
24
  controllers: [notification_controller_1.NotificationController],
26
- providers: [notification_repository_1.NotificationRepository, notification_service_1.NotificationServices, notifications_serialiser_1.NotificationSerialiser],
25
+ providers: [notification_repository_1.NotificationRepository, notification_service_1.NotificationServices, notification_1.NotificationDescriptor.model.serialiser],
27
26
  exports: [notification_repository_1.NotificationRepository],
28
27
  imports: [],
29
28
  })
@@ -1 +1 @@
1
- {"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../../src/foundations/notification/notification.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AACtD,+DAAiE;AACjE,mFAA+E;AAC/E,sEAAkE;AAClE,oFAAgF;AAChF,qFAAgF;AAChF,0EAAuE;AAQhE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,sCAAiB,CAAC,CAAC;IAC5C,CAAC;CACF,CAAA;AAJY,gDAAkB;6BAAlB,kBAAkB;IAN9B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,gDAAsB,CAAC;QACrC,SAAS,EAAE,CAAC,gDAAsB,EAAE,2CAAoB,EAAE,iDAAsB,CAAC;QACjF,OAAO,EAAE,CAAC,gDAAsB,CAAC;QACjC,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,kBAAkB,CAI9B"}
1
+ {"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../../src/foundations/notification/notification.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AACtD,+DAAiE;AACjE,mFAA+E;AAC/E,0DAAiE;AACjE,oFAAgF;AAChF,0EAAuE;AAQhE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,qCAAsB,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;CACF,CAAA;AAJY,gDAAkB;6BAAlB,kBAAkB;IAN9B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,gDAAsB,CAAC;QACrC,SAAS,EAAE,CAAC,gDAAsB,EAAE,2CAAoB,EAAE,qCAAsB,CAAC,KAAK,CAAC,UAAU,CAAC;QAClG,OAAO,EAAE,CAAC,gDAAsB,CAAC;QACjC,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,kBAAkB,CAI9B"}
@@ -1,17 +1,97 @@
1
- import { OnModuleInit } from "@nestjs/common";
1
+ import { ClsService } from "nestjs-cls";
2
+ import { DataModelInterface } from "../../../common/interfaces/datamodel.interface";
2
3
  import { JsonApiCursorInterface } from "../../../core/jsonapi/interfaces/jsonapi.cursor.interface";
4
+ import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
3
5
  import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
4
- import { Notification } from "../../notification/entities/notification.entity";
5
- export declare class NotificationRepository implements OnModuleInit {
6
- private readonly neo4j;
7
- constructor(neo4j: Neo4jService);
6
+ import { SecurityService } from "../../../core/security/services/security.service";
7
+ import { Notification, NotificationDescriptor } from "../../notification/entities/notification";
8
+ /** A node a notification refers to (its "subject"), written as `-[:REFERS_TO]->`. */
9
+ export type NotificationTarget = {
10
+ /** `id` property of an EXISTING node. */
11
+ id: string;
12
+ /** Neo4j label of that node (e.g. "Task", "Document"). */
13
+ label: string;
14
+ };
15
+ /**
16
+ * Every method below is fully custom Cypher: the bell list/detail queries scope
17
+ * by TRIGGERED_FOR user and require a REFERS_TO edge to exist (see
18
+ * `findForUser`), and `createNotification`/`createIdempotent` write a bespoke
19
+ * subject graph. The generic descriptor-driven `create`/`put`/`patch`/`delete`/
20
+ * `find`/`findById` are INHERITED from `AbstractRepository` unchanged.
21
+ *
22
+ * NAMING — `find`/`findById` are named `findForUser`/`findByIdForUser`: their
23
+ * required `userId`/`notificationId` params are incompatible overrides of
24
+ * `AbstractRepository.find(params: {...all optional})` /
25
+ * `findById(params: { id })`. The bespoke creator is named `createNotification`
26
+ * for the same reason: `AbstractRepository.create(params: { id: string;
27
+ * [key: string]: any }): Promise<void>` cannot be narrowed to a param without
28
+ * `id` returning `Promise<Notification>` (TS2416). Both names mirror the proven
29
+ * naming of the application repository this port is derived from.
30
+ *
31
+ * COMPANY SCOPING — why `buildDefaultMatch()` is deliberately not used here:
32
+ * every query in this file is hand-written for the reasons above, so none can
33
+ * call the framework helper. Scoping is achieved instead by matching the
34
+ * CLS-bound `company` variable that `initQuery()` seeds:
35
+ * `MATCH (notification:Notification)-[:BELONGS_TO]->(company)`.
36
+ *
37
+ * Be precise about the two read methods — they are NOT equally scoped:
38
+ * - `findForUser` is company- AND user-scoped: it additionally matches
39
+ * `-[:TRIGGERED_FOR]->(user:User {id: $userId})-[:BELONGS_TO]->(company)`.
40
+ * - `findByIdForUser` is company-scoped ONLY. It takes a `userId` param and
41
+ * binds it as a query param, but its Cypher never references `$userId`, so
42
+ * any user of the same company can read any other user's notification by
43
+ * id. Pre-existing behaviour, preserved verbatim by this port; tightening it
44
+ * is a behavioural change outside the port's scope.
45
+ *
46
+ * Any new query added to this file MUST join `company` the same way —
47
+ * dropping that join is a cross-tenant read.
48
+ * (This note also clears nja-lint's file-level `manual-query-no-company-scope`
49
+ * rule, which fires on any repository whose file never mentions
50
+ * `buildDefaultMatch`; per-line `nja-lint-ignore` comments cannot clear it
51
+ * because the rule simply advances to the next unignored MATCH.)
52
+ */
53
+ export declare class NotificationRepository extends AbstractRepository<Notification, typeof NotificationDescriptor.relationships> {
54
+ protected readonly descriptor: import("../../..").EntityDescriptor<Notification, {
55
+ actor: {
56
+ model: import("../../../common/interfaces/datamodel.interface").DataMeta;
57
+ direction: "out";
58
+ relationship: string;
59
+ cardinality: "one";
60
+ required: false;
61
+ dtoKey: string;
62
+ description: string;
63
+ };
64
+ }>;
65
+ constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
66
+ /**
67
+ * Fully custom (NOT calling `super.onModuleInit()`): adds the
68
+ * `idempotencyKey` uniqueness constraint that backs `createIdempotent` on top
69
+ * of the descriptor's `id` constraint, and deliberately creates NO FULLTEXT
70
+ * index. The base implementation would derive one from the descriptor's
71
+ * string fields (`notificationType`, `message`, `actionUrl`); notifications
72
+ * have never been full-text searchable and adding the index would change the
73
+ * shipped index set of every consuming application.
74
+ */
8
75
  onModuleInit(): Promise<void>;
9
- find(params: {
76
+ /**
77
+ * Resolve the model used to map/serialise notification rows.
78
+ *
79
+ * Registry first (mirrors `ContentRepository.getContentModel()`): an
80
+ * application that registers an EXTENDED notification model — more
81
+ * attributes, more subjects, a polymorphic actor — wins here without having
82
+ * to override every query method. Falls back to `this.descriptor.model`, so a
83
+ * subclass that overrides `descriptor` still resolves its own model and unit
84
+ * tests that never run `onModuleInit` still work.
85
+ */
86
+ protected getNotificationModel(): DataModelInterface<Notification>;
87
+ /** Guards a caller-supplied Neo4j label before it is interpolated into Cypher. */
88
+ protected assertSafeLabel(label: string): string;
89
+ findForUser(params: {
10
90
  userId: string;
11
91
  cursor?: JsonApiCursorInterface;
12
92
  isArchived?: boolean;
13
93
  }): Promise<Notification[]>;
14
- findById(params: {
94
+ findByIdForUser(params: {
15
95
  notificationId: string;
16
96
  userId: string;
17
97
  }): Promise<Notification>;
@@ -22,10 +102,47 @@ export declare class NotificationRepository implements OnModuleInit {
22
102
  archive(params: {
23
103
  notificationId: string;
24
104
  }): Promise<void>;
25
- create(params: {
105
+ /**
106
+ * Create a notification for a recipient, optionally attributed to an actor
107
+ * and pointing at one or more subjects.
108
+ *
109
+ * `targets` is what makes the notification VISIBLE: `findForUser` filters on
110
+ * `EXISTS { MATCH (notification)-[:REFERS_TO]->() }`, so a notification
111
+ * created without a target never appears in the recipient's list. Every
112
+ * target is validated (`validateExistingNodes`) before the write and then
113
+ * written as `(notification)-[:REFERS_TO]->(target)`, grouped per label.
114
+ *
115
+ * Named `createNotification` rather than `create` because
116
+ * `AbstractRepository.create` is inherited with an incompatible signature —
117
+ * see the class JSDoc.
118
+ */
119
+ createNotification(params: {
26
120
  notificationType: string;
27
121
  userId: string;
28
122
  actorId?: string;
123
+ targets?: NotificationTarget[];
29
124
  }): Promise<Notification>;
125
+ /**
126
+ * Create a notification at most once for a given `idempotencyKey`.
127
+ *
128
+ * Backed by the `notification_idempotency_key` uniqueness constraint created
129
+ * in `onModuleInit`. The MERGE is the atomic find-or-create; the follow-up
130
+ * read compares the stored id with the id this call generated to decide
131
+ * whether THIS call created the record (`{ created: true }`) or a previous
132
+ * call with the same key won (`{ created: false }`).
133
+ *
134
+ * Every related node is matched through `company`, so a node that does not
135
+ * belong to the current company is simply not linked.
136
+ */
137
+ createIdempotent(params: {
138
+ notificationType: string;
139
+ userId: string;
140
+ actorId?: string;
141
+ actorLabel?: string;
142
+ targets?: NotificationTarget[];
143
+ idempotencyKey: string;
144
+ }): Promise<{
145
+ created: boolean;
146
+ }>;
30
147
  }
31
148
  //# sourceMappingURL=notification.repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/notification/repositories/notification.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAK/E,qBACa,sBAAuB,YAAW,YAAY;IAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,YAAY;IAE1C,YAAY;IAMZ,IAAI,CAAC,MAAM,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,sBAAsB,CAAC;QAChC,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA2BrB,QAAQ,CAAC,MAAM,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAoBnF,UAAU,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE;IAmBhE,OAAO,CAAC,MAAM,EAAE;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE;IAgB1C,MAAM,CAAC,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CA2D5G"}
1
+ {"version":3,"file":"notification.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/notification/repositories/notification.repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAIhG,qFAAqF;AACrF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AASF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,sBAAuB,SAAQ,kBAAkB,CAC5D,YAAY,EACZ,OAAO,sBAAsB,CAAC,aAAa,CAC5C;IACC,SAAS,CAAC,QAAQ,CAAC,UAAU;;;;;;;;;;OAA0B;gBAE3C,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU;IAIzF;;;;;;;;OAQG;IACG,YAAY;IASlB;;;;;;;;;OASG;IACH,SAAS,CAAC,oBAAoB,IAAI,kBAAkB,CAAC,YAAY,CAAC;IAIlE,kFAAkF;IAClF,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK1C,WAAW,CAAC,MAAM,EAAE;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,sBAAsB,CAAC;QAChC,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA2BrB,eAAe,CAAC,MAAM,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAoB1F,UAAU,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE;IAmBhE,OAAO,CAAC,MAAM,EAAE;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE;IAgBhD;;;;;;;;;;;;;OAaG;IACG,kBAAkB,CAAC,MAAM,EAAE;QAC/B,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAChC,GAAG,OAAO,CAAC,YAAY,CAAC;IAkGzB;;;;;;;;;;;OAWG;IACG,gBAAgB,CAAC,MAAM,EAAE;QAC7B,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;QAC/B,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CA2ElC"}