@carlonicora/nextjs-jsonapi 1.4.0 → 1.6.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 (317) hide show
  1. package/README.md +208 -127
  2. package/dist/{ApiResponseInterface-DDI7QQPR.d.ts → ApiResponseInterface-CfcC7pPC.d.mts} +11 -2
  3. package/dist/{ApiResponseInterface-BHN5D9r5.d.mts → ApiResponseInterface-DTBJaV5R.d.ts} +11 -2
  4. package/dist/{BlockNoteEditor-QV6ESIQA.js → BlockNoteEditor-7FM7B737.js} +19 -24
  5. package/dist/BlockNoteEditor-7FM7B737.js.map +1 -0
  6. package/dist/{BlockNoteEditor-U2IHUVUF.mjs → BlockNoteEditor-RVL76ZAS.mjs} +11 -16
  7. package/dist/BlockNoteEditor-RVL76ZAS.mjs.map +1 -0
  8. package/dist/JsonApiRequest-KOKGVPBI.js +25 -0
  9. package/dist/{JsonApiRequest-UJ7FGIVI.js.map → JsonApiRequest-KOKGVPBI.js.map} +1 -1
  10. package/dist/{JsonApiRequest-6UR7DIAR.mjs → JsonApiRequest-VCCRO732.mjs} +2 -2
  11. package/dist/chunk-2Z56AS2S.js +2723 -0
  12. package/dist/chunk-2Z56AS2S.js.map +1 -0
  13. package/dist/{chunk-HTLEKZND.mjs → chunk-37NJZ2VD.mjs} +281 -1019
  14. package/dist/chunk-37NJZ2VD.mjs.map +1 -0
  15. package/dist/{chunk-2K3Q24UF.js → chunk-3ZPK4QOB.js} +24 -14
  16. package/dist/chunk-3ZPK4QOB.js.map +1 -0
  17. package/dist/chunk-AGWQ75PQ.js +142 -0
  18. package/dist/chunk-AGWQ75PQ.js.map +1 -0
  19. package/dist/{chunk-32HM6MDD.js → chunk-CSM6AIAP.js} +1 -1
  20. package/dist/{chunk-32HM6MDD.js.map → chunk-CSM6AIAP.js.map} +1 -1
  21. package/dist/{chunk-IKBA4AHN.mjs → chunk-F4Y3GZG4.mjs} +3 -3
  22. package/dist/{chunk-YF5XQZDR.mjs → chunk-F5UNXZ3J.mjs} +1 -1
  23. package/dist/chunk-F5UNXZ3J.mjs.map +1 -0
  24. package/dist/chunk-IGOWVLJH.mjs +142 -0
  25. package/dist/chunk-IGOWVLJH.mjs.map +1 -0
  26. package/dist/{chunk-HAG77QBV.mjs → chunk-K4W5QXL5.mjs} +1 -1
  27. package/dist/chunk-KFL5ZFM4.mjs +2723 -0
  28. package/dist/chunk-KFL5ZFM4.mjs.map +1 -0
  29. package/dist/{chunk-HR4H2FP7.mjs → chunk-KJ4ETLJB.mjs} +24 -14
  30. package/dist/chunk-KJ4ETLJB.mjs.map +1 -0
  31. package/dist/chunk-LOSPCUCF.js +637 -0
  32. package/dist/chunk-LOSPCUCF.js.map +1 -0
  33. package/dist/{chunk-E2HRC2OG.js → chunk-SVX7E6RR.js} +10360 -6256
  34. package/dist/chunk-SVX7E6RR.js.map +1 -0
  35. package/dist/{chunk-EFJEWLRL.js → chunk-YUO55Q5A.js} +1 -1
  36. package/dist/chunk-YUO55Q5A.js.map +1 -0
  37. package/dist/chunk-ZQTFZKLJ.mjs +12089 -0
  38. package/dist/chunk-ZQTFZKLJ.mjs.map +1 -0
  39. package/dist/{chunk-PMXG5WBC.js → chunk-ZUEEIQHW.js} +3 -3
  40. package/dist/{chunk-PMXG5WBC.js.map → chunk-ZUEEIQHW.js.map} +1 -1
  41. package/dist/client/index.d.mts +161 -11
  42. package/dist/client/index.d.ts +161 -11
  43. package/dist/client/index.js +74 -12
  44. package/dist/client/index.js.map +1 -1
  45. package/dist/client/index.mjs +73 -11
  46. package/dist/components/index.d.mts +762 -73
  47. package/dist/components/index.d.ts +762 -73
  48. package/dist/components/index.js +465 -12
  49. package/dist/components/index.js.map +1 -1
  50. package/dist/components/index.mjs +466 -13
  51. package/dist/config-B43zxEvn.d.mts +69 -0
  52. package/dist/config-D2OUrI_G.d.ts +69 -0
  53. package/dist/content.fields-Ck5lkQ5d.d.mts +47 -0
  54. package/dist/content.fields-Ck5lkQ5d.d.ts +47 -0
  55. package/dist/{content.interface-C_PGZMuy.d.ts → content.interface-Bs8a7uW6.d.mts} +2 -3
  56. package/dist/{content.interface-D_WS6CrB.d.mts → content.interface-UtsJ-mzs.d.ts} +2 -3
  57. package/dist/contexts/index.d.mts +13 -6
  58. package/dist/contexts/index.d.ts +13 -6
  59. package/dist/contexts/index.js +10 -12
  60. package/dist/contexts/index.js.map +1 -1
  61. package/dist/contexts/index.mjs +9 -11
  62. package/dist/core/index.d.mts +539 -8
  63. package/dist/core/index.d.ts +539 -8
  64. package/dist/core/index.js +104 -2
  65. package/dist/core/index.js.map +1 -1
  66. package/dist/core/index.mjs +105 -3
  67. package/dist/index.d.mts +131 -70
  68. package/dist/index.d.ts +131 -70
  69. package/dist/index.js +97 -7
  70. package/dist/index.js.map +1 -1
  71. package/dist/index.mjs +118 -28
  72. package/dist/notification.interface-BdcwkuQE.d.mts +228 -0
  73. package/dist/notification.interface-BdcwkuQE.d.ts +228 -0
  74. package/dist/request-GBLBPYFM.js +8 -0
  75. package/dist/request-GBLBPYFM.js.map +1 -0
  76. package/dist/request-XABCMU25.mjs +8 -0
  77. package/dist/{AbstractService-wLid8dB0.d.ts → s3.interface-D7ttGatc.d.ts} +36 -26
  78. package/dist/{AbstractService-BsY6W3Ej.d.mts → s3.interface-DlaMDRTn.d.mts} +36 -26
  79. package/dist/scripts/generate-web-module/generator.d.ts.map +1 -1
  80. package/dist/scripts/generate-web-module/generator.js +8 -5
  81. package/dist/scripts/generate-web-module/generator.js.map +1 -1
  82. package/dist/scripts/generate-web-module/index.js +1 -1
  83. package/dist/scripts/generate-web-module/index.js.map +1 -1
  84. package/dist/scripts/generate-web-module/templates/components/editor.template.js +8 -1
  85. package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
  86. package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts +4 -3
  87. package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts.map +1 -1
  88. package/dist/scripts/generate-web-module/transformers/parent-detector.js +9 -3
  89. package/dist/scripts/generate-web-module/transformers/parent-detector.js.map +1 -1
  90. package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts +11 -0
  91. package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts.map +1 -1
  92. package/dist/scripts/generate-web-module/transformers/relationship-resolver.js +36 -9
  93. package/dist/scripts/generate-web-module/transformers/relationship-resolver.js.map +1 -1
  94. package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts +2 -0
  95. package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts.map +1 -1
  96. package/dist/scripts/generate-web-module/types/template-data.interface.d.ts +1 -0
  97. package/dist/scripts/generate-web-module/types/template-data.interface.d.ts.map +1 -1
  98. package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts +4 -3
  99. package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts.map +1 -1
  100. package/dist/scripts/generate-web-module/utils/i18n-updater.js +9 -9
  101. package/dist/scripts/generate-web-module/utils/i18n-updater.js.map +1 -1
  102. package/dist/scripts/generate-web-module/validators/json-schema-validator.js +3 -3
  103. package/dist/scripts/generate-web-module/validators/json-schema-validator.js.map +1 -1
  104. package/dist/server/index.d.mts +299 -4
  105. package/dist/server/index.d.ts +299 -4
  106. package/dist/server/index.js +215 -5
  107. package/dist/server/index.js.map +1 -1
  108. package/dist/server/index.mjs +214 -4
  109. package/dist/server/index.mjs.map +1 -1
  110. package/dist/token-2UWQJY5T.js +8 -0
  111. package/dist/token-2UWQJY5T.js.map +1 -0
  112. package/dist/token-EOK3N45S.mjs +8 -0
  113. package/dist/{useSocket-DzMKRKCA.d.ts → useSocket-8vwK_R_c.d.ts} +1 -1
  114. package/dist/{useSocket-Cn7fB_B1.d.mts → useSocket-BWJUXuOl.d.mts} +1 -1
  115. package/package.json +12 -52
  116. package/scripts/generate-web-module/generator.ts +8 -5
  117. package/scripts/generate-web-module/index.ts +1 -1
  118. package/scripts/generate-web-module/templates/components/editor.template.ts +7 -2
  119. package/scripts/generate-web-module/transformers/parent-detector.ts +10 -3
  120. package/scripts/generate-web-module/transformers/relationship-resolver.ts +36 -9
  121. package/scripts/generate-web-module/types/json-schema.interface.ts +2 -0
  122. package/scripts/generate-web-module/types/template-data.interface.ts +1 -0
  123. package/scripts/generate-web-module/utils/i18n-updater.ts +9 -9
  124. package/scripts/generate-web-module/validators/json-schema-validator.ts +3 -3
  125. package/src/client/JsonApiClient.ts +248 -0
  126. package/src/client/config.ts +78 -0
  127. package/src/client/index.ts +6 -1
  128. package/src/components/containers/TabsContainer.tsx +1 -1
  129. package/src/components/editors/BlockNoteEditor.tsx +3 -1
  130. package/src/components/index.ts +4 -0
  131. package/src/components/navigations/Breadcrumb.tsx +1 -1
  132. package/src/components/navigations/Header.tsx +2 -2
  133. package/src/contexts/CommonContext.tsx +1 -1
  134. package/src/contexts/SocketContext.tsx +1 -1
  135. package/src/contexts/index.ts +3 -0
  136. package/src/core/abstracts/ClientAbstractService.ts +255 -0
  137. package/src/core/abstracts/ServerAbstractService.ts +180 -0
  138. package/src/core/abstracts/index.ts +2 -0
  139. package/src/core/index.ts +32 -3
  140. package/src/discord/config.ts +15 -0
  141. package/src/discord/index.ts +1 -0
  142. package/src/features/auth/components/details/LandingComponent.tsx +2 -2
  143. package/src/features/auth/components/forms/AcceptInvitation.tsx +1 -1
  144. package/src/features/auth/components/forms/ActivateAccount.tsx +1 -1
  145. package/src/features/auth/components/forms/Cookies.tsx +2 -1
  146. package/src/features/auth/components/forms/ForgotPassword.tsx +1 -1
  147. package/src/features/auth/components/forms/Login.tsx +1 -1
  148. package/src/features/auth/components/forms/Logout.tsx +1 -1
  149. package/src/features/auth/components/forms/RefreshUser.tsx +2 -1
  150. package/src/features/auth/components/forms/Register.tsx +1 -1
  151. package/src/features/auth/components/forms/ResetPassword.tsx +1 -1
  152. package/src/features/auth/data/auth.service.ts +1 -1
  153. package/src/features/auth/data/index.ts +0 -1
  154. package/src/features/auth/utils/AuthCookies.ts +1 -1
  155. package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +4 -2
  156. package/src/features/company/components/forms/CompanyDeleter.tsx +2 -1
  157. package/src/features/company/components/forms/CompanyEditor.tsx +6 -3
  158. package/src/features/company/components/forms/CompanyLicense.tsx +4 -2
  159. package/src/features/company/components/lists/CompaniesList.tsx +2 -1
  160. package/src/features/company/data/index.ts +0 -1
  161. package/src/features/content/components/lists/ContentsListById.tsx +2 -1
  162. package/src/features/content/components/lists/RelevantContentsList.tsx +2 -1
  163. package/src/features/content/data/index.ts +0 -1
  164. package/src/features/feature/data/index.ts +0 -1
  165. package/src/features/notification/components/lists/NotificationsList.tsx +2 -1
  166. package/src/features/notification/contexts/NotificationContext.tsx +2 -1
  167. package/src/features/notification/data/index.ts +0 -1
  168. package/src/features/push/data/index.ts +0 -1
  169. package/src/features/role/components/forms/RemoveUserFromRole.tsx +4 -2
  170. package/src/features/role/components/forms/UserRoleAdd.tsx +2 -1
  171. package/src/features/role/components/lists/RolesList.tsx +2 -1
  172. package/src/features/role/components/lists/UserRolesList.tsx +2 -1
  173. package/src/features/role/data/index.ts +0 -1
  174. package/src/features/s3/data/index.ts +0 -1
  175. package/src/features/user/components/forms/RoleUserAdd.tsx +4 -2
  176. package/src/features/user/components/forms/UserDeleter.tsx +2 -1
  177. package/src/features/user/components/forms/UserEditor.tsx +6 -3
  178. package/src/features/user/components/forms/UserMultiSelect.tsx +2 -1
  179. package/src/features/user/components/forms/UserReactivator.tsx +2 -1
  180. package/src/features/user/components/forms/UserResentInvitationEmail.tsx +2 -1
  181. package/src/features/user/components/forms/UserSelector.tsx +2 -1
  182. package/src/features/user/components/lists/AdminUsersList.tsx +2 -1
  183. package/src/features/user/components/lists/CompanyUsersList.tsx +2 -1
  184. package/src/features/user/components/lists/RelevantUsersList.tsx +2 -1
  185. package/src/features/user/components/lists/RoleUsersList.tsx +2 -1
  186. package/src/features/user/components/lists/UsersListByContentIds.tsx +2 -1
  187. package/src/features/user/data/index.ts +0 -1
  188. package/src/features/user/hooks/useUserSearch.ts +2 -1
  189. package/src/features/user/index.ts +1 -0
  190. package/src/hooks/useDataListRetriever.ts +4 -4
  191. package/src/hooks/usePageTracker.ts +1 -1
  192. package/src/hooks/usePushNotifications.ts +3 -2
  193. package/src/hooks/useSocket.ts +1 -1
  194. package/src/index.ts +7 -2
  195. package/src/roles/config.ts +0 -15
  196. package/src/roles/index.ts +1 -9
  197. package/src/server/JsonApiServer.ts +249 -0
  198. package/src/server/cache.ts +1 -1
  199. package/src/server/index.ts +13 -0
  200. package/src/server/request.ts +32 -18
  201. package/src/server/token.ts +1 -1
  202. package/dist/ApiData-DPKNfY-9.d.mts +0 -10
  203. package/dist/ApiData-DPKNfY-9.d.ts +0 -10
  204. package/dist/ApiDataInterface-DPP8s46n.d.mts +0 -21
  205. package/dist/ApiDataInterface-DPP8s46n.d.ts +0 -21
  206. package/dist/BlockNoteEditor-QV6ESIQA.js.map +0 -1
  207. package/dist/BlockNoteEditor-U2IHUVUF.mjs.map +0 -1
  208. package/dist/JsonApiRequest-UJ7FGIVI.js +0 -25
  209. package/dist/atoms/index.d.mts +0 -12
  210. package/dist/atoms/index.d.ts +0 -12
  211. package/dist/atoms/index.js +0 -9
  212. package/dist/atoms/index.js.map +0 -1
  213. package/dist/atoms/index.mjs +0 -9
  214. package/dist/chunk-2K3Q24UF.js.map +0 -1
  215. package/dist/chunk-3FBCC4G3.js +0 -8
  216. package/dist/chunk-3FBCC4G3.js.map +0 -1
  217. package/dist/chunk-3UELCPIN.js +0 -46
  218. package/dist/chunk-3UELCPIN.js.map +0 -1
  219. package/dist/chunk-5IET37O4.js +0 -4210
  220. package/dist/chunk-5IET37O4.js.map +0 -1
  221. package/dist/chunk-AYHKQWHH.js +0 -68
  222. package/dist/chunk-AYHKQWHH.js.map +0 -1
  223. package/dist/chunk-DEYKTLA3.js +0 -1131
  224. package/dist/chunk-DEYKTLA3.js.map +0 -1
  225. package/dist/chunk-E2HRC2OG.js.map +0 -1
  226. package/dist/chunk-EFJEWLRL.js.map +0 -1
  227. package/dist/chunk-FMBQZAIP.mjs +0 -490
  228. package/dist/chunk-FMBQZAIP.mjs.map +0 -1
  229. package/dist/chunk-HR4H2FP7.mjs.map +0 -1
  230. package/dist/chunk-HTLEKZND.mjs.map +0 -1
  231. package/dist/chunk-JGFWIT2E.mjs +0 -1131
  232. package/dist/chunk-JGFWIT2E.mjs.map +0 -1
  233. package/dist/chunk-P2F54I7Q.mjs +0 -4210
  234. package/dist/chunk-P2F54I7Q.mjs.map +0 -1
  235. package/dist/chunk-PO5Q3H5I.js +0 -1375
  236. package/dist/chunk-PO5Q3H5I.js.map +0 -1
  237. package/dist/chunk-Q2N6SQYW.mjs +0 -8
  238. package/dist/chunk-Q2N6SQYW.mjs.map +0 -1
  239. package/dist/chunk-Q4FXESVT.js +0 -490
  240. package/dist/chunk-Q4FXESVT.js.map +0 -1
  241. package/dist/chunk-R2ONK22M.mjs +0 -7985
  242. package/dist/chunk-R2ONK22M.mjs.map +0 -1
  243. package/dist/chunk-SM63SZCP.mjs +0 -68
  244. package/dist/chunk-SM63SZCP.mjs.map +0 -1
  245. package/dist/chunk-SZZYEG3P.mjs +0 -46
  246. package/dist/chunk-SZZYEG3P.mjs.map +0 -1
  247. package/dist/chunk-YF5XQZDR.mjs.map +0 -1
  248. package/dist/config-BmnK65TD.d.mts +0 -35
  249. package/dist/config-BmnK65TD.d.ts +0 -35
  250. package/dist/config-DQeAo9Kf.d.mts +0 -49
  251. package/dist/config-DQeAo9Kf.d.ts +0 -49
  252. package/dist/content.fields-cHPdM8GJ.d.mts +0 -27
  253. package/dist/content.fields-cHPdM8GJ.d.ts +0 -27
  254. package/dist/d3.link.interface-ClC4Irqp.d.mts +0 -21
  255. package/dist/d3.link.interface-ClC4Irqp.d.ts +0 -21
  256. package/dist/features/index.d.mts +0 -476
  257. package/dist/features/index.d.ts +0 -476
  258. package/dist/features/index.js +0 -87
  259. package/dist/features/index.js.map +0 -1
  260. package/dist/features/index.mjs +0 -87
  261. package/dist/hooks/index.d.mts +0 -69
  262. package/dist/hooks/index.d.ts +0 -69
  263. package/dist/hooks/index.js +0 -56
  264. package/dist/hooks/index.js.map +0 -1
  265. package/dist/hooks/index.mjs +0 -56
  266. package/dist/hooks/index.mjs.map +0 -1
  267. package/dist/interfaces/index.d.mts +0 -4
  268. package/dist/interfaces/index.d.ts +0 -4
  269. package/dist/interfaces/index.js +0 -2
  270. package/dist/interfaces/index.js.map +0 -1
  271. package/dist/interfaces/index.mjs +0 -2
  272. package/dist/interfaces/index.mjs.map +0 -1
  273. package/dist/notification.interface-BBgMUdLR.d.mts +0 -14
  274. package/dist/notification.interface-gyvT-Z2F.d.ts +0 -14
  275. package/dist/permissions/index.d.mts +0 -41
  276. package/dist/permissions/index.d.ts +0 -41
  277. package/dist/permissions/index.js +0 -14
  278. package/dist/permissions/index.js.map +0 -1
  279. package/dist/permissions/index.mjs +0 -14
  280. package/dist/permissions/index.mjs.map +0 -1
  281. package/dist/request-7FE3LJLV.mjs +0 -9
  282. package/dist/request-7FE3LJLV.mjs.map +0 -1
  283. package/dist/request-QFS7NEIE.js +0 -9
  284. package/dist/request-QFS7NEIE.js.map +0 -1
  285. package/dist/roles/index.d.mts +0 -39
  286. package/dist/roles/index.d.ts +0 -39
  287. package/dist/roles/index.js +0 -18
  288. package/dist/roles/index.js.map +0 -1
  289. package/dist/roles/index.mjs +0 -18
  290. package/dist/roles/index.mjs.map +0 -1
  291. package/dist/shadcnui/index.d.mts +0 -698
  292. package/dist/shadcnui/index.d.ts +0 -698
  293. package/dist/shadcnui/index.js +0 -468
  294. package/dist/shadcnui/index.js.map +0 -1
  295. package/dist/shadcnui/index.mjs +0 -467
  296. package/dist/shadcnui/index.mjs.map +0 -1
  297. package/dist/token-IJSPOMW6.mjs +0 -9
  298. package/dist/token-IJSPOMW6.mjs.map +0 -1
  299. package/dist/token-UYE7CV6X.js +0 -9
  300. package/dist/token-UYE7CV6X.js.map +0 -1
  301. package/dist/types-B2QRyqyK.d.ts +0 -39
  302. package/dist/types-CgvNmxTd.d.mts +0 -39
  303. package/dist/types-t2PyXhDu.d.mts +0 -116
  304. package/dist/types-t2PyXhDu.d.ts +0 -116
  305. package/dist/user.interface-CAsTIbuQ.d.mts +0 -85
  306. package/dist/user.interface-CbWqMaaU.d.ts +0 -85
  307. package/dist/utils/index.d.mts +0 -224
  308. package/dist/utils/index.d.ts +0 -224
  309. package/dist/utils/index.js +0 -46
  310. package/dist/utils/index.js.map +0 -1
  311. package/dist/utils/index.mjs +0 -46
  312. package/dist/utils/index.mjs.map +0 -1
  313. /package/dist/{JsonApiRequest-6UR7DIAR.mjs.map → JsonApiRequest-VCCRO732.mjs.map} +0 -0
  314. /package/dist/{chunk-IKBA4AHN.mjs.map → chunk-F4Y3GZG4.mjs.map} +0 -0
  315. /package/dist/{chunk-HAG77QBV.mjs.map → chunk-K4W5QXL5.mjs.map} +0 -0
  316. /package/dist/{atoms/index.mjs.map → request-XABCMU25.mjs.map} +0 -0
  317. /package/dist/{features/index.mjs.map → token-EOK3N45S.mjs.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-2Z56AS2S.js","../src/core/factories/RehydrationFactory.ts","../src/core/abstracts/AbstractApiData.ts","../src/core/abstracts/AbstractService.ts","../src/client/JsonApiClient.ts","../src/core/abstracts/ClientAbstractService.ts","../src/core/registry/ModuleRegistrar.ts","../src/core/registry/ModuleRegistry.ts","../src/core/endpoint/EndpointCreator.ts","../src/core/fields/FieldSelector.ts","../src/core/utils/rehydrate.ts","../src/utils/cn.ts","../src/utils/compose-refs.ts","../src/utils/use-mobile.tsx","../src/utils/date-formatter.ts","../src/utils/exists.ts","../src/utils/table-options.ts","../src/utils/schemas/user.object.schema.ts","../src/utils/schemas/entity.object.schema.ts","../src/utils/blocknote-diff.util.ts","../src/utils/blocknote-word-diff-renderer.util.ts","../src/utils/icons.tsx","../src/features/auth/data/auth.ts","../src/features/auth/enums/AuthComponent.ts","../src/features/auth/config.ts","../src/features/auth/auth.module.ts","../src/features/company/data/company.ts","../src/features/company/data/company.fields.ts","../src/features/company/company.module.ts","../src/features/content/data/content.ts","../src/features/content/data/content.fields.ts","../src/features/content/content.module.ts","../src/features/feature/data/feature.ts","../src/features/feature/feature.module.ts","../src/features/module/data/module.ts","../src/features/module/module.module.ts","../src/features/notification/data/notification.ts","../src/features/notification/data/notification.fields.ts","../src/features/notification/notification.module.ts","../src/features/push/data/push.ts","../src/features/push/push.module.ts","../src/features/role/data/role.ts","../src/features/role/data/role.fields.ts","../src/features/role/role.module.ts","../src/features/s3/data/s3.ts","../src/features/s3/s3.module.ts","../src/features/user/data/user.ts","../src/features/user/data/user.fields.ts","../src/features/user/user.module.ts","../src/features/user/author.module.ts"],"names":["includedData","HttpMethod","ClientHttpMethod","globalErrorHandler","AuthComponent","CompanyFields","ContentFields","NotificationFields","RoleFields","UserFields"],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACVO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EALhC,OAKgC;AAAA,IAAA,qCAAA,IAAA,EAAA,oBAAA,CAAA;AAAA,EAAA;AAAA,EAC9B,OAAc,SAAA,CACZ,QAAA,EACA,IAAA,EACG;AACH,IAAA,MAAM,aAAA,EAAe,kCAAA,CAAkB,GAAA,CAAI,QAAQ,CAAA;AAEnD,IAAA,MAAM,SAAA,EAAW,IAAI,YAAA,CAAa,CAAA;AAClC,IAAA,OAAO,QAAA,CAAS,SAAA,CAAU,IAAI,CAAA;AAAA,EAChC;AAAA,EAEA,OAAc,aAAA,CACZ,QAAA,EACA,IAAA,EACK;AACL,IAAA,MAAM,aAAA,EAAe,kCAAA,CAAkB,GAAA,CAAI,QAAQ,CAAA;AAEnD,IAAA,MAAM,SAAA,EAAW,IAAA,CAAK,GAAA,CAAI,CAAC,IAAA,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A;AACF,EAAA;AAfsB;AhDykFO;AACA;AiD3kFL;AAEf,EAAA;AACH,EAAA;AACC,EAAA;AACG,EAAA;AALc;AjDklFK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-2Z56AS2S.js","sourcesContent":[null,"import { ApiDataInterface } from \"../interfaces/ApiDataInterface\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { JsonApiHydratedDataInterface } from \"../interfaces/JsonApiHydratedDataInterface\";\nimport { DataClassRegistry } from \"../registry/DataClassRegistry\";\n\nexport class RehydrationFactory {\n public static rehydrate<T extends ApiDataInterface>(\n classKey: ApiRequestDataTypeInterface,\n data: JsonApiHydratedDataInterface,\n ): T {\n const factoryClass = DataClassRegistry.get(classKey);\n\n const instance = new factoryClass();\n return instance.rehydrate(data) as T;\n }\n\n public static rehydrateList<T extends ApiDataInterface>(\n classKey: ApiRequestDataTypeInterface,\n data: JsonApiHydratedDataInterface[],\n ): T[] {\n const factoryClass = DataClassRegistry.get(classKey);\n\n const response = data.map((item: JsonApiHydratedDataInterface) => {\n const instance = new factoryClass();\n return instance.rehydrate(item) as T;\n });\n\n return response;\n }\n}\n","import { ApiDataInterface } from \"../interfaces/ApiDataInterface\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { JsonApiHydratedDataInterface } from \"../interfaces/JsonApiHydratedDataInterface\";\nimport { RehydrationFactory } from \"../factories/RehydrationFactory\";\n\nexport abstract class AbstractApiData implements ApiDataInterface {\n protected _jsonApi?: any;\n protected _included?: any[];\n\n protected _id?: string;\n protected _type?: string;\n protected _createdAt?: Date;\n protected _updatedAt?: Date;\n\n protected _self?: string;\n\n get type(): string {\n if (!this._type) throw new Error(\"Type is not set.\");\n return this._type;\n }\n\n get id(): string {\n if (!this._id) throw new Error(\"Id is not set.\");\n return this._id;\n }\n\n get self(): string | undefined {\n return this._self;\n }\n\n get createdAt(): Date {\n return this._createdAt ?? new Date();\n }\n\n get updatedAt(): Date {\n return this._updatedAt ?? new Date();\n }\n\n get included(): any[] {\n return this._included ?? [];\n }\n\n get jsonApi(): any {\n return this._jsonApi;\n }\n\n ingestJsonApi(_data: JsonApiHydratedDataInterface): void {}\n\n generateApiUrl(_params?: any): string {\n throw new Error(\"Method not implemented.\");\n }\n\n createJsonApi(_data?: any): any {\n throw new Error(\"Method not implemented.\");\n }\n\n protected _readIncluded<T extends ApiDataInterface>(\n data: JsonApiHydratedDataInterface,\n type: string,\n dataType: ApiRequestDataTypeInterface,\n ): T | T[] | undefined {\n if (\n data.included === undefined ||\n data.included.length === 0 ||\n data.jsonApi.relationships === undefined ||\n data.jsonApi.relationships[type] === undefined ||\n data.jsonApi.relationships[type].data === undefined\n ) {\n return undefined;\n }\n\n if (Array.isArray(data.jsonApi.relationships[type].data)) {\n const response: T[] = data.jsonApi.relationships[type].data.map((jsonApiData: any) => {\n const includedData = data.included.find(\n (includedData: any) => includedData.id === jsonApiData.id && includedData.type === jsonApiData.type,\n );\n\n if (includedData === undefined) return undefined;\n\n return RehydrationFactory.rehydrate(dataType, {\n jsonApi: includedData,\n included: data.included,\n }) as T;\n });\n\n return response.filter((item: T | undefined) => item !== undefined) as T[];\n }\n\n const includedData = data.included.find(\n (includedData: any) =>\n includedData.id === data.jsonApi.relationships[type].data.id &&\n includedData.type === data.jsonApi.relationships[type].data.type,\n );\n\n if (includedData === undefined && data.allData !== undefined) {\n // Try to find in allData as a fallback\n const fallbackData = data.allData.find(\n (includedData: any) =>\n includedData.id === data.jsonApi.relationships[type].data.id &&\n includedData.type === data.jsonApi.relationships[type].data.type,\n );\n if (fallbackData !== undefined) {\n return RehydrationFactory.rehydrate(dataType, {\n jsonApi: fallbackData,\n included: data.included,\n }) as T;\n }\n }\n\n if (includedData === undefined) return undefined;\n\n return RehydrationFactory.rehydrate(dataType, {\n jsonApi: includedData,\n included: data.included,\n }) as T;\n }\n\n dehydrate(): JsonApiHydratedDataInterface {\n return {\n jsonApi: this._jsonApi,\n included: this._included ?? [],\n };\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n this._jsonApi = data.jsonApi;\n this._included = data.included;\n\n this._type = this._jsonApi.type;\n this._id = this._jsonApi.id;\n this._createdAt = this._jsonApi.meta?.createdAt !== undefined ? new Date(this._jsonApi.meta.createdAt) : undefined;\n this._updatedAt = this._jsonApi.meta?.updatedAt !== undefined ? new Date(this._jsonApi.meta.updatedAt) : undefined;\n\n this._self = this._jsonApi.links?.self ?? undefined;\n\n return this;\n }\n}\n","import { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { ApiResponseInterface } from \"../interfaces/ApiResponseInterface\";\n\nexport enum HttpMethod {\n GET = \"GET\",\n POST = \"POST\",\n PUT = \"PUT\",\n PATCH = \"PATCH\",\n DELETE = \"DELETE\",\n}\n\nexport interface NextRef {\n next?: string;\n}\n\nexport interface PreviousRef {\n previous?: string;\n}\n\nexport interface SelfRef {\n self?: string;\n}\n\nlet globalErrorHandler: ((status: number, message: string) => void) | null = null;\n\n/**\n * Set a global error handler for API errors (client-side only).\n * This handler will be called instead of throwing errors.\n */\nexport function setGlobalErrorHandler(handler: (status: number, message: string) => void) {\n globalErrorHandler = handler;\n}\n\n/**\n * Get the current global error handler.\n */\nexport function getGlobalErrorHandler(): ((status: number, message: string) => void) | null {\n return globalErrorHandler;\n}\n\n/**\n * Abstract base class for services that interact with the JSON:API.\n * Extend this class to create feature-specific services.\n */\nexport abstract class AbstractService {\n /**\n * Extract locale from client-side URL pathname\n * URL structure: /{locale}/route-path (e.g., /it/accounts)\n * Fallback chain: URL locale → navigator.language → \"en\"\n */\n private static getClientLocale(): string {\n if (typeof window === \"undefined\") {\n return \"en\"; // Server-side fallback\n }\n\n // Extract locale from URL pathname (first segment after leading slash)\n const pathSegments = window.location.pathname.split(\"/\").filter(Boolean);\n const urlLocale = pathSegments[0];\n\n // Validate against supported locales (currently only \"en\")\n const supportedLocales = [\"en\"];\n if (urlLocale && supportedLocales.includes(urlLocale)) {\n return urlLocale;\n }\n\n // Fallback to navigator language\n const navigatorLocale = navigator.language.split(\"-\")[0];\n if (navigatorLocale && supportedLocales.includes(navigatorLocale)) {\n return navigatorLocale;\n }\n\n // Final fallback\n return \"en\";\n }\n\n static async next<T>(params: {\n type: ApiRequestDataTypeInterface;\n endpoint: string;\n next?: NextRef;\n previous?: PreviousRef;\n self?: SelfRef;\n }): Promise<T> {\n return await this.callApi<T>({\n method: HttpMethod.GET,\n type: params.type,\n endpoint: params.endpoint,\n next: params.next,\n previous: params.previous,\n self: params.self,\n });\n }\n\n /**\n * Fetch the previous page of results.\n */\n static async previous<T>(params: {\n type: ApiRequestDataTypeInterface;\n endpoint: string;\n next?: NextRef;\n previous?: PreviousRef;\n self?: SelfRef;\n }): Promise<T> {\n return await this.callApi<T>({\n method: HttpMethod.GET,\n type: params.type,\n endpoint: params.endpoint,\n next: params.next,\n previous: params.previous,\n self: params.self,\n });\n }\n\n /**\n * Make an API call with automatic environment detection and error handling.\n */\n protected static async callApi<T>(params: {\n type: ApiRequestDataTypeInterface;\n method: HttpMethod;\n endpoint: string;\n companyId?: string;\n input?: any;\n overridesJsonApiCreation?: boolean;\n next?: NextRef;\n previous?: PreviousRef;\n self?: SelfRef;\n responseType?: ApiRequestDataTypeInterface;\n files?: { [key: string]: File | Blob } | File | Blob;\n }): Promise<T> {\n // Dynamic import to avoid bundling issues\n const { JsonApiGet, JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } =\n await import(\"../../unified/JsonApiRequest\");\n\n let apiResponse: ApiResponseInterface;\n\n // Get language based on environment\n let language = \"en\";\n if (typeof window === \"undefined\") {\n const { getLocale } = await import(\"next-intl/server\");\n language = (await getLocale()) ?? \"en\";\n } else {\n // Client-side: extract locale from URL pathname\n language = this.getClientLocale();\n }\n\n switch (params.method) {\n case HttpMethod.GET:\n apiResponse = await JsonApiGet({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n language: language,\n });\n break;\n case HttpMethod.POST:\n apiResponse = await JsonApiPost({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n body: params.input,\n overridesJsonApiCreation: params.overridesJsonApiCreation,\n language: language,\n responseType: params.responseType,\n files: params.files,\n });\n break;\n case HttpMethod.PUT:\n apiResponse = await JsonApiPut({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n body: params.input,\n language: language,\n responseType: params.responseType,\n files: params.files,\n });\n break;\n case HttpMethod.PATCH:\n apiResponse = await JsonApiPatch({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n body: params.input,\n overridesJsonApiCreation: params.overridesJsonApiCreation,\n language: language,\n responseType: params.responseType,\n files: params.files,\n });\n break;\n case HttpMethod.DELETE:\n apiResponse = await JsonApiDelete({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n language: language,\n responseType: params.responseType,\n });\n break;\n default:\n throw new Error(\"Method not found\");\n }\n\n if (!apiResponse.ok) {\n if (globalErrorHandler && typeof window !== \"undefined\") {\n globalErrorHandler(apiResponse.response, apiResponse.error);\n return undefined as any;\n } else {\n const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n error.status = apiResponse.response;\n error.digest = `HTTP_${apiResponse.response}`;\n throw error;\n }\n }\n\n if (apiResponse.next && params.next) params.next.next = apiResponse.next;\n if (apiResponse.prev && params.previous) params.previous.previous = apiResponse.prev;\n if (apiResponse.self && params.self) params.self.self = apiResponse.self;\n\n return apiResponse.data as T;\n }\n\n /**\n * Get raw JSON:API response data without deserialization.\n */\n protected static async getRawData(params: {\n type: ApiRequestDataTypeInterface;\n method: HttpMethod;\n endpoint: string;\n companyId?: string;\n }): Promise<any> {\n const { JsonApiGet } = await import(\"../../unified/JsonApiRequest\");\n\n let language = \"en\";\n\n if (typeof window === \"undefined\") {\n const { getLocale } = await import(\"next-intl/server\");\n language = (await getLocale()) ?? \"en\";\n } else {\n // Client-side: extract locale from URL pathname\n language = this.getClientLocale();\n }\n\n const apiResponse: ApiResponseInterface = await JsonApiGet({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n language: language,\n });\n\n if (!apiResponse.ok) {\n if (globalErrorHandler && typeof window !== \"undefined\") {\n globalErrorHandler(apiResponse.response, apiResponse.error);\n return undefined as any;\n } else {\n const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n error.status = apiResponse.response;\n error.digest = `HTTP_${apiResponse.response}`;\n throw error;\n }\n }\n\n return apiResponse.raw;\n }\n}\n","\"use client\";\n\nimport { JsonApiDataFactory } from \"../core/factories/JsonApiDataFactory\";\nimport { ApiRequestDataTypeInterface } from \"../core/interfaces/ApiRequestDataTypeInterface\";\nimport { ApiResponseInterface } from \"../core/interfaces/ApiResponseInterface\";\nimport { translateResponse } from \"../core/utils/translateResponse\";\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { directFetch } from \"./request\";\nimport { getClientToken } from \"./token\";\n\n// Config storage for client contexts\nlet _clientConfig: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n} | null = null;\n\n/**\n * Configure the JSON:API client for browser contexts.\n * Call this in your client-side initialization or use JsonApiProvider.\n */\nexport function configureClientJsonApi(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n}): void {\n _clientConfig = config;\n if (config.bootstrapper) {\n config.bootstrapper();\n }\n}\n\nexport function getClientApiUrl(): string {\n if (_clientConfig?.apiUrl) {\n return _clientConfig.apiUrl;\n }\n const envUrl = process.env.NEXT_PUBLIC_API_URL;\n if (!envUrl) {\n throw new Error(\"API URL not configured. Use configureClientJsonApi() or set NEXT_PUBLIC_API_URL environment variable.\");\n }\n return envUrl;\n}\n\nexport function getClientAppUrl(): string {\n if (_clientConfig?.appUrl) {\n return _clientConfig.appUrl;\n }\n const envUrl = process.env.NEXT_PUBLIC_ADDRESS;\n if (!envUrl) {\n throw new Error(\"App URL not configured. Use configureClientJsonApi({ appUrl }) or set NEXT_PUBLIC_ADDRESS environment variable.\");\n }\n return envUrl.trim().replace(/\\/+$/, \"\");\n}\n\nexport function getClientTrackablePages(): ModuleWithPermissions[] {\n return _clientConfig?.trackablePages ?? [];\n}\n\nfunction runClientBootstrapper(): void {\n if (_clientConfig?.bootstrapper) {\n _clientConfig.bootstrapper();\n }\n}\n\nfunction buildClientUrl(endpoint: string): string {\n const apiUrl = getClientApiUrl();\n return endpoint.startsWith(\"http\") ? endpoint : `${apiUrl}${endpoint}`;\n}\n\nexport async function ClientJsonApiGet(params: {\n classKey: ApiRequestDataTypeInterface;\n endpoint: string;\n companyId?: string;\n language: string;\n}): Promise<ApiResponseInterface> {\n runClientBootstrapper();\n const token = await getClientToken();\n\n const apiResponse = await directFetch({\n method: \"GET\",\n url: buildClientUrl(params.endpoint),\n token,\n companyId: params.companyId,\n language: params.language,\n additionalHeaders: _clientConfig?.additionalHeaders,\n });\n\n return translateResponse({\n classKey: params.classKey,\n apiResponse,\n companyId: params.companyId,\n language: params.language,\n paginationHandler: async (endpoint: string) =>\n ClientJsonApiGet({\n classKey: params.classKey,\n endpoint,\n companyId: params.companyId,\n language: params.language,\n }),\n });\n}\n\nexport async function ClientJsonApiPost(params: {\n classKey: ApiRequestDataTypeInterface;\n endpoint: string;\n companyId?: string;\n body?: any;\n overridesJsonApiCreation?: boolean;\n files?: { [key: string]: File | Blob } | File | Blob;\n language: string;\n responseType?: ApiRequestDataTypeInterface;\n}): Promise<ApiResponseInterface> {\n runClientBootstrapper();\n const token = await getClientToken();\n\n let body = params.body;\n if (!body) {\n body = {};\n } else if (params.overridesJsonApiCreation !== true) {\n body = JsonApiDataFactory.create(params.classKey, body);\n }\n\n const apiResponse = await directFetch({\n method: \"POST\",\n url: buildClientUrl(params.endpoint),\n token,\n body,\n files: params.files,\n companyId: params.companyId,\n language: params.language,\n additionalHeaders: _clientConfig?.additionalHeaders,\n });\n\n return translateResponse({\n classKey: params.responseType ?? params.classKey,\n apiResponse,\n companyId: params.companyId,\n language: params.language,\n });\n}\n\nexport async function ClientJsonApiPut(params: {\n classKey: ApiRequestDataTypeInterface;\n endpoint: string;\n companyId?: string;\n body?: any;\n files?: { [key: string]: File | Blob } | File | Blob;\n language: string;\n responseType?: ApiRequestDataTypeInterface;\n}): Promise<ApiResponseInterface> {\n runClientBootstrapper();\n const token = await getClientToken();\n\n let body = params.body;\n if (!body) {\n body = {};\n } else {\n body = JsonApiDataFactory.create(params.classKey, body);\n }\n\n const apiResponse = await directFetch({\n method: \"PUT\",\n url: buildClientUrl(params.endpoint),\n token,\n body,\n files: params.files,\n companyId: params.companyId,\n language: params.language,\n additionalHeaders: _clientConfig?.additionalHeaders,\n });\n\n return translateResponse({\n classKey: params.responseType ?? params.classKey,\n apiResponse,\n companyId: params.companyId,\n language: params.language,\n });\n}\n\nexport async function ClientJsonApiPatch(params: {\n classKey: ApiRequestDataTypeInterface;\n endpoint: string;\n companyId?: string;\n body?: any;\n files?: { [key: string]: File | Blob } | File | Blob;\n overridesJsonApiCreation?: boolean;\n responseType?: ApiRequestDataTypeInterface;\n language: string;\n}): Promise<ApiResponseInterface> {\n runClientBootstrapper();\n const token = await getClientToken();\n\n let body = params.body;\n if (!body) {\n body = {};\n } else if (params.overridesJsonApiCreation !== true) {\n body = JsonApiDataFactory.create(params.classKey, body);\n }\n\n const apiResponse = await directFetch({\n method: \"PATCH\",\n url: buildClientUrl(params.endpoint),\n token,\n body,\n files: params.files,\n companyId: params.companyId,\n language: params.language,\n additionalHeaders: _clientConfig?.additionalHeaders,\n });\n\n return translateResponse({\n classKey: params.responseType ?? params.classKey,\n apiResponse,\n companyId: params.companyId,\n language: params.language,\n });\n}\n\nexport async function ClientJsonApiDelete(params: {\n classKey: ApiRequestDataTypeInterface;\n endpoint: string;\n companyId?: string;\n language: string;\n responseType?: ApiRequestDataTypeInterface;\n}): Promise<ApiResponseInterface> {\n runClientBootstrapper();\n const token = await getClientToken();\n\n const apiResponse = await directFetch({\n method: \"DELETE\",\n url: buildClientUrl(params.endpoint),\n token,\n companyId: params.companyId,\n language: params.language,\n additionalHeaders: _clientConfig?.additionalHeaders,\n });\n\n return translateResponse({\n classKey: params.responseType ?? params.classKey,\n apiResponse,\n companyId: params.companyId,\n language: params.language,\n });\n}\n","\"use client\";\n\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { ApiResponseInterface } from \"../interfaces/ApiResponseInterface\";\nimport {\n ClientJsonApiGet,\n ClientJsonApiPost,\n ClientJsonApiPut,\n ClientJsonApiPatch,\n ClientJsonApiDelete,\n} from \"../../client/JsonApiClient\";\n// Duplicated to avoid importing from AbstractService which pulls in server code\n// These are exported so client services can import them from here instead of core\nexport enum ClientHttpMethod {\n GET = \"GET\",\n POST = \"POST\",\n PUT = \"PUT\",\n PATCH = \"PATCH\",\n DELETE = \"DELETE\",\n}\n\nexport interface ClientNextRef {\n next?: string;\n}\n\nexport interface ClientPreviousRef {\n previous?: string;\n}\n\nexport interface ClientSelfRef {\n self?: string;\n}\n\nlet globalErrorHandler: ((status: number, message: string) => void) | null = null;\n\n/**\n * Set a global error handler for API errors (client-side only).\n * This handler will be called instead of throwing errors.\n */\nexport function setClientGlobalErrorHandler(handler: (status: number, message: string) => void) {\n globalErrorHandler = handler;\n}\n\n/**\n * Get the current global error handler.\n */\nexport function getClientGlobalErrorHandler(): ((status: number, message: string) => void) | null {\n return globalErrorHandler;\n}\n\n/**\n * Client-side abstract base class for services that interact with the JSON:API.\n * Use this for client components.\n */\nexport abstract class ClientAbstractService {\n /**\n * Extract locale from client-side URL pathname\n * URL structure: /{locale}/route-path (e.g., /it/accounts)\n * Fallback chain: URL locale → navigator.language → \"en\"\n */\n private static getClientLocale(): string {\n if (typeof window === \"undefined\") {\n return \"en\"; // Should not happen in client service\n }\n\n // Extract locale from URL pathname (first segment after leading slash)\n const pathSegments = window.location.pathname.split(\"/\").filter(Boolean);\n const urlLocale = pathSegments[0];\n\n // Validate against supported locales (currently only \"en\")\n const supportedLocales = [\"en\"];\n if (urlLocale && supportedLocales.includes(urlLocale)) {\n return urlLocale;\n }\n\n // Fallback to navigator language\n const navigatorLocale = navigator.language.split(\"-\")[0];\n if (navigatorLocale && supportedLocales.includes(navigatorLocale)) {\n return navigatorLocale;\n }\n\n // Final fallback\n return \"en\";\n }\n\n /**\n * Fetch the next page of results.\n */\n static async next<T>(params: {\n type: ApiRequestDataTypeInterface;\n endpoint: string;\n next?: ClientNextRef;\n previous?: ClientPreviousRef;\n self?: ClientSelfRef;\n }): Promise<T> {\n return await this.callApi<T>({\n method: ClientHttpMethod.GET,\n type: params.type,\n endpoint: params.endpoint,\n next: params.next,\n previous: params.previous,\n self: params.self,\n });\n }\n\n /**\n * Fetch the previous page of results.\n */\n static async previous<T>(params: {\n type: ApiRequestDataTypeInterface;\n endpoint: string;\n next?: ClientNextRef;\n previous?: ClientPreviousRef;\n self?: ClientSelfRef;\n }): Promise<T> {\n return await this.callApi<T>({\n method: ClientHttpMethod.GET,\n type: params.type,\n endpoint: params.endpoint,\n next: params.next,\n previous: params.previous,\n self: params.self,\n });\n }\n\n /**\n * Make a client-side API call.\n */\n protected static async callApi<T>(params: {\n type: ApiRequestDataTypeInterface;\n method: ClientHttpMethod;\n endpoint: string;\n companyId?: string;\n input?: any;\n overridesJsonApiCreation?: boolean;\n next?: ClientNextRef;\n previous?: ClientPreviousRef;\n self?: ClientSelfRef;\n responseType?: ApiRequestDataTypeInterface;\n files?: { [key: string]: File | Blob } | File | Blob;\n }): Promise<T> {\n let apiResponse: ApiResponseInterface;\n\n // Client-side: extract locale from URL pathname\n const language = this.getClientLocale();\n\n switch (params.method) {\n case ClientHttpMethod.GET:\n apiResponse = await ClientJsonApiGet({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n language: language,\n });\n break;\n case ClientHttpMethod.POST:\n apiResponse = await ClientJsonApiPost({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n body: params.input,\n overridesJsonApiCreation: params.overridesJsonApiCreation,\n language: language,\n responseType: params.responseType,\n files: params.files,\n });\n break;\n case ClientHttpMethod.PUT:\n apiResponse = await ClientJsonApiPut({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n body: params.input,\n language: language,\n responseType: params.responseType,\n files: params.files,\n });\n break;\n case ClientHttpMethod.PATCH:\n apiResponse = await ClientJsonApiPatch({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n body: params.input,\n overridesJsonApiCreation: params.overridesJsonApiCreation,\n language: language,\n responseType: params.responseType,\n files: params.files,\n });\n break;\n case ClientHttpMethod.DELETE:\n apiResponse = await ClientJsonApiDelete({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n language: language,\n responseType: params.responseType,\n });\n break;\n default:\n throw new Error(\"Method not found\");\n }\n\n if (!apiResponse.ok) {\n if (globalErrorHandler) {\n globalErrorHandler(apiResponse.response, apiResponse.error);\n return undefined as any;\n } else {\n const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n error.status = apiResponse.response;\n error.digest = `HTTP_${apiResponse.response}`;\n throw error;\n }\n }\n\n if (apiResponse.next && params.next) params.next.next = apiResponse.next;\n if (apiResponse.prev && params.previous) params.previous.previous = apiResponse.prev;\n if (apiResponse.self && params.self) params.self.self = apiResponse.self;\n\n return apiResponse.data as T;\n }\n\n /**\n * Get raw JSON:API response data without deserialization.\n */\n protected static async getRawData(params: {\n type: ApiRequestDataTypeInterface;\n method: ClientHttpMethod;\n endpoint: string;\n companyId?: string;\n }): Promise<any> {\n const language = this.getClientLocale();\n\n const apiResponse: ApiResponseInterface = await ClientJsonApiGet({\n classKey: params.type,\n endpoint: params.endpoint,\n companyId: params.companyId,\n language: language,\n });\n\n if (!apiResponse.ok) {\n if (globalErrorHandler) {\n globalErrorHandler(apiResponse.response, apiResponse.error);\n return undefined as any;\n } else {\n const error = new Error(`${apiResponse.response}:${apiResponse.error}`) as any;\n error.status = apiResponse.response;\n error.digest = `HTTP_${apiResponse.response}`;\n throw error;\n }\n }\n\n return apiResponse.raw;\n }\n}\n","import { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { DataClassRegistry } from \"./DataClassRegistry\";\n\n/**\n * Helper class to bootstrap the registry from a Modules-style class.\n * This supports the pattern where modules are defined as static getters.\n */\nexport class ModuleRegistrar {\n private static _isBootstrapped = false;\n\n /**\n * Bootstrap the registry from a Modules class.\n * Automatically detects static getters and registers their models.\n *\n * @param modulesClass - The Modules class with static getters\n */\n static bootstrap<T extends object>(modulesClass: T): void {\n if (this._isBootstrapped) return;\n\n const data = Object.getOwnPropertyNames(modulesClass)\n .filter((key) => {\n const descriptor = Object.getOwnPropertyDescriptor(modulesClass, key);\n return descriptor && typeof descriptor.get === \"function\";\n })\n .map((key) => (modulesClass as any)[key] as ApiRequestDataTypeInterface);\n\n data.forEach((item) => {\n if (item && item.model) {\n DataClassRegistry.registerObjectClass(item, item.model);\n }\n });\n\n this._isBootstrapped = true;\n }\n\n /**\n * Reset the bootstrapped state. Useful for testing.\n */\n static reset(): void {\n this._isBootstrapped = false;\n DataClassRegistry.clear();\n }\n}\n","import { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { ModuleWithPermissions } from \"../../permissions/types\";\n\n// Foundation module types - defined by LIBRARY\nexport interface FoundationModuleDefinitions {\n S3: ModuleWithPermissions;\n Auth: ModuleWithPermissions;\n User: ModuleWithPermissions;\n Author: ModuleWithPermissions;\n Company: ModuleWithPermissions;\n Role: ModuleWithPermissions;\n Notification: ModuleWithPermissions;\n Push: ModuleWithPermissions;\n Feature: ModuleWithPermissions;\n Module: ModuleWithPermissions;\n Content: ModuleWithPermissions;\n UserTopic: ModuleWithPermissions;\n UserExpertise: ModuleWithPermissions;\n}\n\n// App-specific modules - apps will augment this interface ONLY\n\nexport interface AppModuleDefinitions {}\n\n// Combined type for full autocompletion\nexport type ModuleDefinitions = FoundationModuleDefinitions & AppModuleDefinitions;\n\nclass ModuleRegistryClass {\n private _modules: Map<string, ApiRequestDataTypeInterface> = new Map();\n\n register<K extends string>(name: K, module: ApiRequestDataTypeInterface): void {\n this._modules.set(name, module);\n }\n\n get<K extends keyof ModuleDefinitions>(name: K): ModuleDefinitions[K] {\n const module = this._modules.get(name as string);\n if (!module) {\n throw new Error(`Module \"${String(name)}\" not registered. Call bootstrap() first.`);\n }\n return module as ModuleDefinitions[K];\n }\n\n findByName(moduleName: string): ModuleWithPermissions {\n // Search by module's name property (e.g., \"topics\", \"articles\")\n for (const module of this._modules.values()) {\n if ((module as ModuleWithPermissions).name === moduleName) {\n return module as ModuleWithPermissions;\n }\n }\n throw new Error(`Module not found: ${moduleName}`);\n }\n\n findByModelName(modelName: string): ModuleWithPermissions {\n // Direct lookup by registry key (e.g., \"Article\", \"Document\")\n const module = this._modules.get(modelName);\n if (!module) {\n throw new Error(`Module not found for model: ${modelName}`);\n }\n return module as ModuleWithPermissions;\n }\n}\n\nexport const ModuleRegistry = new ModuleRegistryClass();\n\n// Proxy object for Modules.X syntax with autocompletion\nexport const Modules = new Proxy({} as ModuleDefinitions, {\n get(_, prop: string) {\n if (prop === \"findByName\") {\n return (name: string) => ModuleRegistry.findByName(name);\n }\n if (prop === \"findByModelName\") {\n return (name: string) => ModuleRegistry.findByModelName(name);\n }\n return ModuleRegistry.get(prop as keyof ModuleDefinitions);\n },\n}) as ModuleDefinitions & {\n findByName: (name: string) => ModuleWithPermissions;\n findByModelName: (name: string) => ModuleWithPermissions;\n};\n","import { FieldSelector } from \"../fields/FieldSelector\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\n\nexport type EndpointQuery = {\n endpoint: ApiRequestDataTypeInterface;\n id?: string;\n childEndpoint?: ApiRequestDataTypeInterface | string;\n childId?: string;\n additionalParams?: { key: string; value: string | string[] }[];\n};\n\nexport class EndpointCreator {\n private _endpoint: EndpointQuery;\n\n constructor(params: {\n endpoint: ApiRequestDataTypeInterface;\n id?: string;\n childEndpoint?: ApiRequestDataTypeInterface | string;\n childId?: string;\n additionalParams?: { key: string; value: string }[];\n }) {\n this._endpoint = {\n endpoint: params.endpoint,\n id: params.id,\n childEndpoint: params.childEndpoint,\n childId: params.childId,\n additionalParams: params.additionalParams ?? [],\n };\n }\n\n endpoint(value: ApiRequestDataTypeInterface): EndpointCreator {\n this._endpoint.endpoint = value;\n return this;\n }\n\n id(value: string): EndpointCreator {\n this._endpoint.id = value;\n return this;\n }\n\n childEndpoint(value: ApiRequestDataTypeInterface | string): EndpointCreator {\n this._endpoint.childEndpoint = value;\n return this;\n }\n\n childId(value: string): EndpointCreator {\n this._endpoint.childId = value;\n return this;\n }\n\n set additionalParams(value: { key: string; value: string }[]) {\n this._endpoint.additionalParams = value;\n }\n\n addAdditionalParam(key: string, value: string | string[]): EndpointCreator {\n if (!this._endpoint.additionalParams) this._endpoint.additionalParams = [];\n this._endpoint.additionalParams.push({ key, value });\n return this;\n }\n\n limitToType(selectors: string[]): this {\n this.addAdditionalParam(`include`, selectors.join(\",\"));\n return this;\n }\n\n limitToFields(selectors: FieldSelector<any>[]): this {\n if (selectors.length === 0) return this;\n\n selectors.forEach((selector) => {\n const fieldString = selector.fields.join(\",\");\n this.addAdditionalParam(`fields[${selector.type}]`, fieldString);\n });\n\n return this;\n }\n\n generate(): string {\n let additionalParams = \"\";\n if (this._endpoint.additionalParams) {\n additionalParams = this._endpoint.additionalParams.map((param) => `${param.key}=${param.value}`).join(\"&\");\n }\n\n let response = `${this._endpoint.endpoint.name}`;\n if (this._endpoint.id) response += `/${this._endpoint.id}`;\n if (this._endpoint.childEndpoint) {\n response += `/${\n typeof this._endpoint.childEndpoint === \"string\"\n ? this._endpoint.childEndpoint\n : this._endpoint.childEndpoint.name\n }`;\n }\n if (this._endpoint.childId) response += `/${this._endpoint.childId}`;\n if (additionalParams) response += `?${additionalParams}`;\n\n return response;\n }\n}\n","export type GetterKeys<T> = {\n [K in keyof T]: T[K] extends () => any ? never : K;\n}[keyof T];\n\nexport type FieldSelector<T> = {\n type: string;\n fields: ReadonlyArray<GetterKeys<T>>;\n};\n\nexport function createJsonApiInclusion<T>(dataType: string, fields: ReadonlyArray<GetterKeys<T>>): FieldSelector<T> {\n return {\n type: dataType,\n fields,\n };\n}\n","import { ApiDataInterface } from \"../interfaces/ApiDataInterface\";\nimport { ApiRequestDataTypeInterface } from \"../interfaces/ApiRequestDataTypeInterface\";\nimport { JsonApiHydratedDataInterface } from \"../interfaces/JsonApiHydratedDataInterface\";\nimport { RehydrationFactory } from \"../factories/RehydrationFactory\";\n\n/**\n * Rehydrate a single dehydrated object back into its typed class instance.\n */\nexport function rehydrate<T extends ApiDataInterface>(\n classKey: ApiRequestDataTypeInterface,\n data: JsonApiHydratedDataInterface,\n): T {\n return RehydrationFactory.rehydrate(classKey, data) as T;\n}\n\n/**\n * Rehydrate a list of dehydrated objects back into typed class instances.\n */\nexport function rehydrateList<T extends ApiDataInterface>(\n classKey: ApiRequestDataTypeInterface,\n data: JsonApiHydratedDataInterface[],\n): T[] {\n return RehydrationFactory.rehydrateList(classKey, data) as T[];\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === \"function\") {\n return ref(value);\n }\n\n if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup === \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n","\"use client\";\n\nimport * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","type FormatOption = \"date\" | \"time\" | \"dateTime\" | \"timeSince\" | \"default\";\n\nexport const formatDate = (eventDate: Date, formatOption: FormatOption): string => {\n const browserLocale = navigator.language || \"en-US\";\n\n const formatPart = (date: Date, options: Intl.DateTimeFormatOptions): string =>\n new Intl.DateTimeFormat(browserLocale, options).format(date);\n\n const now = new Date();\n const diff = now.getTime() - eventDate.getTime();\n\n if (formatOption === \"default\") {\n if (diff < 24 * 60 * 60 * 1000) formatOption = \"timeSince\";\n else formatOption = \"dateTime\";\n }\n\n if (formatOption === \"timeSince\") {\n const seconds = Math.floor(diff / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n\n if (days > 0) return `${days} days ago`;\n if (hours > 0) return `${hours} hours ago`;\n if (minutes > 0) return `${minutes} minutes ago`;\n return `${seconds} seconds ago`;\n }\n\n // Define formatting options\n const dateOptions: Intl.DateTimeFormatOptions = {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n };\n const timeOptions: Intl.DateTimeFormatOptions = {\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n // Format based on the option\n switch (formatOption) {\n case \"date\":\n return formatPart(eventDate, dateOptions);\n case \"time\":\n return formatPart(eventDate, timeOptions);\n case \"dateTime\":\n return `${formatPart(eventDate, dateOptions)} ${formatPart(eventDate, timeOptions)}`;\n default:\n throw new Error(\"Invalid format option\");\n }\n};\n\nexport type { FormatOption };\n","export const exists = <T>(itemOrArray: T | T[] | null | undefined): boolean => {\n if (!itemOrArray) return false;\n if (Array.isArray(itemOrArray)) {\n return itemOrArray.length > 0;\n }\n return true;\n};\n","import { Action, ModuleWithPermissions } from \"../permissions\";\nimport { cloneElement, createElement, Fragment, ReactElement } from \"react\";\n\nexport class TableOptions {\n private _components: ReactElement<any>[];\n private _hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n module: M;\n action: Action;\n data?: any;\n }) => boolean;\n\n constructor(\n hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n module: M;\n action: Action;\n data?: any;\n }) => boolean,\n ) {\n this._hasPermissionToModule = hasPermissionToModule;\n this._components = [];\n }\n\n addOption<M extends ModuleWithPermissions>(component: ReactElement<any> | null, module?: M, action?: Action): void {\n if (!component || (module && action && !this._hasPermissionToModule({ module, action }))) return;\n this._components.push(component);\n }\n\n getComponents(): ReactElement<any>[] {\n return this._components;\n }\n\n getOptions(): ReactElement<any> | null {\n if (this._components.length === 0) return null;\n\n const response: ReactElement<any>[] = this._components.map((option, index) =>\n cloneElement(option, { key: option.key ?? index }),\n );\n\n return createElement(Fragment, {}, response);\n }\n}\n\nexport function getTableOptions(params: {\n hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n module: M;\n action: Action;\n data?: any;\n }) => boolean;\n options: { component: ReactElement<any> | null; module?: ModuleWithPermissions; action?: Action }[];\n}): ReactElement<any> | null {\n const tableOptions = new TableOptions(params.hasPermissionToModule);\n params.options.forEach((option) => tableOptions.addOption(option.component, option.module, option.action));\n return tableOptions.getOptions();\n}\n\nexport function getTableComponents(params: {\n hasPermissionToModule: <M extends ModuleWithPermissions>(params: {\n module: M;\n action: Action;\n data?: any;\n }) => boolean;\n options: { component: ReactElement<any> | null; module?: ModuleWithPermissions; action?: Action }[];\n}): ReactElement<any>[] {\n const tableOptions = new TableOptions(params.hasPermissionToModule);\n params.options.forEach((option) => tableOptions.addOption(option.component, option.module, option.action));\n return tableOptions.getComponents();\n}\n","import { z } from \"zod\";\n\nexport const userObjectSchema = z.object({\n id: z.string(),\n name: z.string(),\n avatar: z.string().optional(),\n});\n\nexport type UserObject = z.infer<typeof userObjectSchema>;\n","import { z } from \"zod\";\n\nexport const entityObjectSchema = z.object({\n id: z.uuidv4(),\n name: z.string(),\n});\n\nexport type EntityObject = z.infer<typeof entityObjectSchema>;\n","import { PartialBlock } from \"@blocknote/core\";\n\nexport interface WordDiff {\n type: \"added\" | \"removed\" | \"unchanged\";\n text: string;\n diffId: string;\n accepted?: boolean;\n rejected?: boolean;\n}\n\nexport interface DiffBlock {\n id?: string;\n type?: string;\n props?: any;\n content?: any;\n children?: DiffBlock[];\n diffType?: \"added\" | \"removed\" | \"modified\" | \"unchanged\";\n originalContent?: any;\n diffId?: string;\n wordDiffs?: WordDiff[];\n accepted?: boolean;\n rejected?: boolean;\n}\n\nexport interface DiffResult {\n blocks: DiffBlock[];\n hasChanges: boolean;\n}\n\nexport interface BlockDiffOptions {\n ignoreIds?: boolean;\n compareContent?: boolean;\n similarityThreshold?: number;\n}\n\n/**\n * BlockNote Diff Utility\n * Implements a sophisticated diff algorithm for BlockNote document structures\n */\nexport class BlockNoteDiffUtil {\n private static readonly DEFAULT_OPTIONS: BlockDiffOptions = {\n ignoreIds: false,\n compareContent: true,\n similarityThreshold: 0.8,\n };\n\n /**\n * Compare two BlockNote documents and return diff result\n */\n static diff(\n originalBlocks: PartialBlock[] = [],\n newBlocks: PartialBlock[] = [],\n options: BlockDiffOptions = {},\n ): DiffResult {\n const opts = { ...this.DEFAULT_OPTIONS, ...options };\n\n // Create a map for efficient lookups\n const originalMap = new Map<string, PartialBlock>();\n const newMap = new Map<string, PartialBlock>();\n\n // Build maps based on block IDs\n originalBlocks.forEach((block) => {\n if (block.id) {\n originalMap.set(block.id, block);\n }\n });\n\n newBlocks.forEach((block) => {\n if (block.id) {\n newMap.set(block.id, block);\n }\n });\n\n const diffBlocks: DiffBlock[] = [];\n const processedNewIds = new Set<string>();\n\n // Process original blocks to find removed and modified blocks\n for (const originalBlock of originalBlocks) {\n const blockId = originalBlock.id;\n\n // Generate ID if missing\n const processId = blockId || crypto.randomUUID();\n const newBlock = blockId ? newMap.get(blockId) : null;\n\n if (!newBlock) {\n // Block was removed\n const removedBlock: DiffBlock = {\n ...originalBlock,\n id: processId,\n diffType: \"removed\",\n diffId: `removed-${processId}`,\n };\n diffBlocks.push(removedBlock);\n } else {\n // Block exists in both, check for modifications\n if (blockId) {\n processedNewIds.add(blockId);\n }\n\n if (this.areBlocksEqual(originalBlock, newBlock, opts)) {\n // Block is unchanged\n const unchangedBlock: DiffBlock = {\n ...newBlock,\n diffType: \"unchanged\",\n };\n diffBlocks.push(unchangedBlock);\n } else {\n // Block was modified - perform word-level diff\n const wordDiffs = this.generateWordDiffs(originalBlock.content, newBlock.content, processId);\n const modifiedBlock: DiffBlock = {\n ...newBlock,\n diffType: \"modified\",\n originalContent: originalBlock.content as any,\n diffId: `modified-${processId}`,\n wordDiffs: wordDiffs,\n };\n diffBlocks.push(modifiedBlock);\n }\n }\n }\n\n // Process new blocks to find added blocks\n for (const newBlock of newBlocks) {\n const blockId = newBlock.id;\n\n // Skip if block was already processed (has ID and was found in original)\n if (blockId && processedNewIds.has(blockId)) continue;\n\n // This is a new block (either no ID or ID not found in original)\n const generatedId = blockId || crypto.randomUUID();\n const addedBlock: DiffBlock = {\n ...newBlock,\n id: generatedId,\n diffType: \"added\",\n diffId: `added-${generatedId}`,\n };\n diffBlocks.push(addedBlock);\n }\n\n // Sort blocks to maintain original order as much as possible\n const sortedDiffBlocks = this.sortDiffBlocks(diffBlocks, originalBlocks, newBlocks);\n\n return {\n blocks: sortedDiffBlocks,\n hasChanges: sortedDiffBlocks.some((block) => block.diffType !== \"unchanged\"),\n };\n }\n\n /**\n * Compare two blocks for equality\n */\n private static areBlocksEqual(block1: PartialBlock, block2: PartialBlock, options: BlockDiffOptions): boolean {\n // Compare block type\n if (block1.type !== block2.type) {\n return false;\n }\n\n // Compare props (excluding diffType specific props)\n if (!this.deepEqual(block1.props, block2.props)) {\n return false;\n }\n\n // Compare content if enabled\n if (options.compareContent) {\n if (!this.deepEqual(block1.content, block2.content)) {\n return false;\n }\n }\n\n // Compare children recursively\n const children1 = block1.children || [];\n const children2 = block2.children || [];\n\n if (children1.length !== children2.length) {\n return false;\n }\n\n for (let i = 0; i < children1.length; i++) {\n if (!this.areBlocksEqual(children1[i], children2[i], options)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Deep equality comparison for objects\n */\n private static deepEqual(obj1: any, obj2: any): boolean {\n if (obj1 === obj2) return true;\n\n if (obj1 == null || obj2 == null) return obj1 === obj2;\n\n if (typeof obj1 !== typeof obj2) return false;\n\n if (typeof obj1 !== \"object\") return obj1 === obj2;\n\n if (Array.isArray(obj1) !== Array.isArray(obj2)) return false;\n\n if (Array.isArray(obj1)) {\n if (obj1.length !== obj2.length) return false;\n for (let i = 0; i < obj1.length; i++) {\n if (!this.deepEqual(obj1[i], obj2[i])) return false;\n }\n return true;\n }\n\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n\n if (keys1.length !== keys2.length) return false;\n\n for (const key of keys1) {\n if (!keys2.includes(key)) return false;\n if (!this.deepEqual(obj1[key], obj2[key])) return false;\n }\n\n return true;\n }\n\n /**\n * Sort diff blocks to maintain logical order\n */\n private static sortDiffBlocks(\n diffBlocks: DiffBlock[],\n originalBlocks: PartialBlock[],\n newBlocks: PartialBlock[],\n ): DiffBlock[] {\n // Create position maps\n const originalPositions = new Map<string, number>();\n const newPositions = new Map<string, number>();\n\n originalBlocks.forEach((block, index) => {\n if (block.id) {\n originalPositions.set(block.id, index);\n }\n });\n\n newBlocks.forEach((block, index) => {\n if (block.id) {\n newPositions.set(block.id, index);\n }\n });\n\n return diffBlocks.sort((a, b) => {\n const aId = a.id;\n const bId = b.id;\n\n if (!aId || !bId) return 0;\n\n // Prioritize by new positions, fallback to original positions\n const aPos = newPositions.get(aId) ?? originalPositions.get(aId) ?? Infinity;\n const bPos = newPositions.get(bId) ?? originalPositions.get(bId) ?? Infinity;\n\n return aPos - bPos;\n });\n }\n\n /**\n * Calculate similarity between two text contents\n */\n private static calculateSimilarity(content1: any[], content2: any[]): number {\n if (!content1 || !content2) return 0;\n\n const text1 = this.extractTextFromContent(content1);\n const text2 = this.extractTextFromContent(content2);\n\n if (text1 === text2) return 1;\n if (!text1 || !text2) return 0;\n\n // Simple Levenshtein distance-based similarity\n const maxLength = Math.max(text1.length, text2.length);\n const distance = this.levenshteinDistance(text1, text2);\n\n return 1 - distance / maxLength;\n }\n\n /**\n * Extract plain text from BlockNote content array\n */\n private static extractTextFromContent(content: any[]): string {\n if (!Array.isArray(content)) return \"\";\n\n return content\n .map((item) => {\n if (item.type === \"text\") {\n return item.text || \"\";\n }\n return \"\";\n })\n .join(\"\");\n }\n\n /**\n * Calculate Levenshtein distance between two strings\n */\n private static levenshteinDistance(str1: string, str2: string): number {\n const matrix = Array(str2.length + 1)\n .fill(null)\n .map(() => Array(str1.length + 1).fill(null));\n\n for (let i = 0; i <= str1.length; i++) {\n matrix[0][i] = i;\n }\n\n for (let j = 0; j <= str2.length; j++) {\n matrix[j][0] = j;\n }\n\n for (let j = 1; j <= str2.length; j++) {\n for (let i = 1; i <= str1.length; i++) {\n const substitutionCost = str1[i - 1] === str2[j - 1] ? 0 : 1;\n matrix[j][i] = Math.min(\n matrix[j][i - 1] + 1, // deletion\n matrix[j - 1][i] + 1, // insertion\n matrix[j - 1][i - 1] + substitutionCost, // substitution\n );\n }\n }\n\n return matrix[str2.length][str1.length];\n }\n\n /**\n * Generate word-level diffs between two content arrays\n */\n static generateWordDiffs(originalContent: any, newContent: any, blockId: string): WordDiff[] {\n const originalText = this.extractTextFromContent(originalContent || []);\n const newText = this.extractTextFromContent(newContent || []);\n\n if (!originalText && !newText) return [];\n if (!originalText) {\n return newText\n .split(/\\s+/)\n .filter((word) => word.trim())\n .map((word, index) => ({\n type: \"added\" as const,\n text: word,\n diffId: `${blockId}-add-${index}`,\n accepted: false,\n rejected: false,\n }));\n }\n if (!newText) {\n return originalText\n .split(/\\s+/)\n .filter((word) => word.trim())\n .map((word, index) => ({\n type: \"removed\" as const,\n text: word,\n diffId: `${blockId}-remove-${index}`,\n accepted: false,\n rejected: false,\n }));\n }\n\n return this.diffWords(originalText, newText, blockId);\n }\n\n /**\n * Perform word-level diff using word-only approach (no space tokenization)\n */\n private static diffWords(text1: string, text2: string, blockId: string): WordDiff[] {\n const words1 = text1.split(/\\s+/).filter((word) => word.length > 0);\n const words2 = text2.split(/\\s+/).filter((word) => word.length > 0);\n\n const diffs = this.myersDiff(words1, words2);\n\n // Consolidate adjacent changes to reduce fragmentation\n const consolidatedDiffs = this.consolidateAdjacentChanges(diffs);\n\n const result: WordDiff[] = [];\n let diffIndex = 0;\n\n for (let i = 0; i < consolidatedDiffs.length; i++) {\n const diff = consolidatedDiffs[i];\n const isLastDiff = i === consolidatedDiffs.length - 1;\n\n switch (diff.type) {\n case \"equal\":\n result.push({\n type: \"unchanged\",\n text: diff.value,\n diffId: `${blockId}-unchanged-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n\n // Add space after word if not the last diff\n if (!isLastDiff) {\n result.push({\n type: \"unchanged\",\n text: \" \",\n diffId: `${blockId}-space-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n }\n break;\n\n case \"delete\":\n // Check if this is a consolidated change or regular change\n if ((diff as any).consolidated) {\n // This is a consolidated deletion - check if next is consolidated insertion\n const nextDiff = i + 1 < consolidatedDiffs.length ? consolidatedDiffs[i + 1] : null;\n const isConsolidatedReplacement = nextDiff && nextDiff.type === \"insert\" && (nextDiff as any).consolidated;\n\n if (isConsolidatedReplacement) {\n // Use single shared diff ID for the entire consolidated change\n const replacementId = `${blockId}-replace-${diffIndex++}`;\n\n // Add the removed text\n result.push({\n type: \"removed\",\n text: diff.value,\n diffId: replacementId,\n accepted: false,\n rejected: false,\n });\n\n // Add the new text with same diff ID\n result.push({\n type: \"added\",\n text: nextDiff.value,\n diffId: replacementId,\n accepted: false,\n rejected: false,\n });\n\n // Skip the next insert since we handled it\n i++;\n\n // Add space after replacement if not the last\n if (i < consolidatedDiffs.length - 1) {\n result.push({\n type: \"unchanged\",\n text: \" \",\n diffId: `${blockId}-space-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n }\n } else {\n // Consolidated deletion without replacement\n result.push({\n type: \"removed\",\n text: diff.value,\n diffId: `${blockId}-remove-${diffIndex++}`,\n accepted: false,\n rejected: false,\n });\n\n // Add space after deletion if not the last\n if (!isLastDiff) {\n result.push({\n type: \"unchanged\",\n text: \" \",\n diffId: `${blockId}-space-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n }\n }\n } else {\n // Regular single-word processing\n const nextDiff = i + 1 < consolidatedDiffs.length ? consolidatedDiffs[i + 1] : null;\n const isReplacement =\n nextDiff && nextDiff.type === \"insert\" && this.areWordsSimilar(diff.value, nextDiff.value);\n\n if (isReplacement) {\n // Use single shared diff ID for both operations\n const replacementId = `${blockId}-replace-${diffIndex++}`;\n\n // Add the removed word\n result.push({\n type: \"removed\",\n text: diff.value,\n diffId: replacementId,\n accepted: false,\n rejected: false,\n });\n\n // Add the new word with same diff ID (no space between them)\n result.push({\n type: \"added\",\n text: nextDiff.value,\n diffId: replacementId,\n accepted: false,\n rejected: false,\n });\n\n // Skip the next insert since we handled it\n i++;\n\n // Add space after replacement if not the last\n if (i < consolidatedDiffs.length - 1) {\n result.push({\n type: \"unchanged\",\n text: \" \",\n diffId: `${blockId}-space-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n }\n } else {\n // Regular deletion\n result.push({\n type: \"removed\",\n text: diff.value,\n diffId: `${blockId}-remove-${diffIndex++}`,\n accepted: false,\n rejected: false,\n });\n\n // Add space after deletion if not the last\n if (!isLastDiff) {\n result.push({\n type: \"unchanged\",\n text: \" \",\n diffId: `${blockId}-space-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n }\n }\n }\n break;\n\n case \"insert\":\n // Only handle if not already processed as part of replacement or consolidation\n if ((diff as any).consolidated) {\n // This should have been handled in the delete case above\n const prevDiff = i > 0 ? consolidatedDiffs[i - 1] : null;\n const wasProcessedAsConsolidatedReplacement =\n prevDiff && prevDiff.type === \"delete\" && (prevDiff as any).consolidated;\n\n if (!wasProcessedAsConsolidatedReplacement) {\n // Standalone consolidated insertion\n result.push({\n type: \"added\",\n text: diff.value,\n diffId: `${blockId}-add-${diffIndex++}`,\n accepted: false,\n rejected: false,\n });\n\n // Add space after insertion if not the last\n if (!isLastDiff) {\n result.push({\n type: \"unchanged\",\n text: \" \",\n diffId: `${blockId}-space-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n }\n }\n } else {\n // Regular single-word processing\n const prevDiff = i > 0 ? consolidatedDiffs[i - 1] : null;\n const wasProcessedAsReplacement =\n prevDiff && prevDiff.type === \"delete\" && this.areWordsSimilar(prevDiff.value, diff.value);\n\n if (!wasProcessedAsReplacement) {\n result.push({\n type: \"added\",\n text: diff.value,\n diffId: `${blockId}-add-${diffIndex++}`,\n accepted: false,\n rejected: false,\n });\n\n // Add space after insertion if not the last\n if (!isLastDiff) {\n result.push({\n type: \"unchanged\",\n text: \" \",\n diffId: `${blockId}-space-${diffIndex++}`,\n accepted: true,\n rejected: false,\n });\n }\n }\n }\n break;\n }\n }\n\n return result;\n } /**\n * Improved diff algorithm that better handles word insertions\n * Uses a combination of LCS and heuristics to minimize false changes\n */\n private static myersDiff(a: string[], b: string[]): Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string }> {\n if (a.length === 0) {\n return b.map((value) => ({ type: \"insert\" as const, value }));\n }\n if (b.length === 0) {\n return a.map((value) => ({ type: \"delete\" as const, value }));\n }\n\n // Use dynamic programming for optimal diff\n const dp = this.computeEditScript(a, b);\n return this.reconstructDiff(a, b, dp);\n }\n\n /**\n * Compute edit script using dynamic programming\n */\n private static computeEditScript(a: string[], b: string[]): number[][] {\n const m = a.length;\n const n = b.length;\n const dp: number[][] = Array(m + 1)\n .fill(null)\n .map(() => Array(n + 1).fill(0));\n\n // Initialize base cases\n for (let i = 0; i <= m; i++) dp[i][0] = i;\n for (let j = 0; j <= n; j++) dp[0][j] = j;\n\n // Fill the DP table\n for (let i = 1; i <= m; i++) {\n for (let j = 1; j <= n; j++) {\n if (a[i - 1] === b[j - 1]) {\n dp[i][j] = dp[i - 1][j - 1]; // No operation needed\n } else {\n dp[i][j] =\n 1 +\n Math.min(\n dp[i - 1][j], // Delete from a\n dp[i][j - 1], // Insert into a\n dp[i - 1][j - 1], // Replace\n );\n }\n }\n }\n\n return dp;\n }\n\n /**\n * Reconstruct the actual diff from the DP table\n */\n private static reconstructDiff(\n a: string[],\n b: string[],\n dp: number[][],\n ): Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string; sharedDiffId?: boolean }> {\n const result: Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string; sharedDiffId?: boolean }> = [];\n let i = a.length;\n let j = b.length;\n\n while (i > 0 || j > 0) {\n if (i > 0 && j > 0 && a[i - 1] === b[j - 1]) {\n // Equal\n result.unshift({ type: \"equal\", value: a[i - 1] });\n i--;\n j--;\n } else {\n // Determine the best operation with preference for insert/delete over replace\n const deleteCost = i > 0 ? dp[i - 1][j] : Infinity;\n const insertCost = j > 0 ? dp[i][j - 1] : Infinity;\n const replaceCost = i > 0 && j > 0 ? dp[i - 1][j - 1] : Infinity;\n\n const minCost = Math.min(deleteCost, insertCost, replaceCost);\n\n // Prefer insertions and deletions over replacements when costs are equal\n if (minCost === insertCost && j > 0) {\n // Insert\n result.unshift({ type: \"insert\", value: b[j - 1] });\n j--;\n } else if (minCost === deleteCost && i > 0) {\n // Delete\n result.unshift({ type: \"delete\", value: a[i - 1] });\n i--;\n } else if (minCost === replaceCost && i > 0 && j > 0) {\n // Only use replace for similar words, otherwise prefer separate operations\n if (this.areWordsSimilar(a[i - 1], b[j - 1])) {\n // Similar words - treat as replacement with shared diffId\n result.unshift({ type: \"insert\", value: b[j - 1], sharedDiffId: true });\n result.unshift({ type: \"delete\", value: a[i - 1], sharedDiffId: true });\n i--;\n j--;\n } else {\n // Different words - prefer insert over delete when costs are equal\n result.unshift({ type: \"insert\", value: b[j - 1] });\n j--;\n }\n }\n }\n }\n\n return result;\n }\n\n /**\n * Consolidate adjacent changes to reduce fragmentation\n * e.g., if we have: delete \"Key\", insert \"Key!\", delete \"Challenges\"\n * We can consolidate this into: replace [\"Key\", \"Challenges\"] with [\"Key!\"]\n */\n private static consolidateAdjacentChanges(\n diffs: Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string }>,\n ): Array<{ type: \"equal\" | \"delete\" | \"insert\"; value: string; consolidated?: boolean }> {\n const result = [];\n let i = 0;\n\n while (i < diffs.length) {\n const current = diffs[i];\n\n if (current.type === \"equal\") {\n result.push(current);\n i++;\n continue;\n }\n\n // Look for patterns of adjacent changes that can be consolidated\n const changeSequence = [];\n let j = i;\n\n // Collect adjacent non-equal changes\n while (j < diffs.length && diffs[j].type !== \"equal\") {\n changeSequence.push(diffs[j]);\n j++;\n }\n\n if (changeSequence.length <= 1) {\n // Single change, no consolidation needed\n result.push(current);\n i++;\n continue;\n }\n\n // Check if we should consolidate this sequence\n const shouldConsolidate = this.shouldConsolidateChanges(\n changeSequence as Array<{ type: \"delete\" | \"insert\"; value: string }>,\n );\n\n if (shouldConsolidate) {\n // Create consolidated changes\n const deletedWords = changeSequence.filter((c) => c.type === \"delete\").map((c) => c.value);\n const insertedWords = changeSequence.filter((c) => c.type === \"insert\").map((c) => c.value);\n\n if (deletedWords.length > 0) {\n result.push({\n type: \"delete\" as const,\n value: deletedWords.join(\" \"),\n consolidated: true,\n });\n }\n\n if (insertedWords.length > 0) {\n result.push({\n type: \"insert\" as const,\n value: insertedWords.join(\" \"),\n consolidated: true,\n });\n }\n } else {\n // Don't consolidate, add individual changes\n changeSequence.forEach((change) => result.push(change));\n }\n\n i = j;\n }\n\n return result;\n }\n\n /**\n * Determine if a sequence of changes should be consolidated\n */\n private static shouldConsolidateChanges(changes: Array<{ type: \"delete\" | \"insert\"; value: string }>): boolean {\n // Consolidate if we have both deletions and insertions in the same sequence\n const hasDeletes = changes.some((c) => c.type === \"delete\");\n const hasInserts = changes.some((c) => c.type === \"insert\");\n\n // Only consolidate if we have both types of changes (replacements/modifications)\n // Pure additions or pure deletions are fine as separate changes\n return hasDeletes && hasInserts;\n }\n\n /**\n * Check if two words are similar enough to be considered a replacement\n */\n private static areWordsSimilar(word1: string, word2: string): boolean {\n // If words are exactly the same, they're similar\n if (word1 === word2) return true;\n\n // Consider words similar if they share more than 70% of their characters\n const maxLen = Math.max(word1.length, word2.length);\n const minLen = Math.min(word1.length, word2.length);\n\n // If one word is much longer than the other, they're not similar\n if (maxLen > minLen * 2) {\n return false;\n }\n\n // Special case: if one word is just the other plus punctuation, treat as separate changes\n // e.g., \"Key\" and \"Key!\" should not be considered similar for replacement\n const word1Clean = word1.replace(/[^\\w]/g, \"\");\n const word2Clean = word2.replace(/[^\\w]/g, \"\");\n\n if (word1Clean === word2Clean && word1 !== word2) {\n // One word is just the other with added punctuation - don't treat as replacement\n return false;\n }\n\n // Calculate character overlap using Levenshtein distance\n const distance = this.levenshteinDistance(word1, word2);\n const similarity = 1 - distance / maxLen;\n\n return similarity > 0.7; // Increased threshold to be more conservative\n }\n}\n","import { PartialBlock } from \"@blocknote/core\";\nimport { DiffBlock, WordDiff } from \"./blocknote-diff.util\";\n\nexport class BlockNoteWordDiffRendererUtil {\n static renderWordDiffs(\n diffBlocks: DiffBlock[],\n onAcceptChange?: (diffId: string) => void,\n onRejectChange?: (diffId: string) => void,\n acceptedChanges?: Set<string>,\n rejectedChanges?: Set<string>,\n ): PartialBlock[] {\n if (acceptedChanges || rejectedChanges) {\n diffBlocks = this.updateWordDiffStates(diffBlocks, acceptedChanges, rejectedChanges);\n }\n return diffBlocks.map((block) => this.renderDiffBlock(block, onAcceptChange, onRejectChange));\n }\n\n private static updateWordDiffStates(\n diffBlocks: DiffBlock[],\n acceptedChanges?: Set<string>,\n rejectedChanges?: Set<string>,\n ): DiffBlock[] {\n return diffBlocks.map((block) => {\n const updatedBlock = { ...block };\n\n if (updatedBlock.diffId) {\n updatedBlock.accepted = acceptedChanges?.has(updatedBlock.diffId) || false;\n updatedBlock.rejected = rejectedChanges?.has(updatedBlock.diffId) || false;\n }\n\n if (updatedBlock.wordDiffs) {\n updatedBlock.wordDiffs = updatedBlock.wordDiffs.map((wordDiff) => ({\n ...wordDiff,\n accepted: acceptedChanges?.has(wordDiff.diffId) || false,\n rejected: rejectedChanges?.has(wordDiff.diffId) || false,\n }));\n }\n\n if (updatedBlock.children) {\n updatedBlock.children = this.updateWordDiffStates(\n updatedBlock.children as DiffBlock[],\n acceptedChanges,\n rejectedChanges,\n );\n }\n\n return updatedBlock;\n });\n }\n\n private static renderDiffBlock(\n block: DiffBlock,\n onAcceptChange?: (diffId: string) => void,\n onRejectChange?: (diffId: string) => void,\n ): PartialBlock {\n if (block.diffType === \"modified\" && block.wordDiffs) {\n return this.renderWordLevelDiff(block, onAcceptChange, onRejectChange);\n }\n\n if (block.diffType === \"added\" || block.diffType === \"removed\") {\n return this.renderBlockLevelDiff(block, onAcceptChange, onRejectChange);\n }\n\n const baseBlock: PartialBlock = {\n id: block.id || crypto.randomUUID(),\n type: (block.type as any) || \"paragraph\",\n props: this.getBlockProps(block),\n content: Array.isArray(block.content) ? block.content : [],\n children: block.children?.map((child) =>\n this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange),\n ),\n };\n\n return baseBlock;\n }\n\n private static renderBlockLevelDiff(\n block: DiffBlock,\n onAcceptChange?: (diffId: string) => void,\n onRejectChange?: (diffId: string) => void,\n ): PartialBlock {\n if (!block.diffId) {\n return {\n id: block.id || crypto.randomUUID(),\n type: (block.type as any) || \"paragraph\",\n props: block.props || {},\n content: Array.isArray(block.content) ? block.content : [],\n children: block.children?.map((child) =>\n this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange),\n ),\n };\n }\n\n const blockAccepted = block.accepted || false;\n const blockRejected = block.rejected || false;\n\n let content = Array.isArray(block.content) ? [...block.content] : [];\n\n if (block.diffType === \"added\") {\n if (blockRejected) {\n return {\n id: block.id || crypto.randomUUID(),\n type: \"paragraph\",\n props: {},\n content: [],\n children: [],\n };\n } else if (!blockAccepted) {\n content = content.map((item: any) => ({\n ...item,\n styles: { ...item.styles, bold: true },\n }));\n\n content.push({\n type: \"diffActions\",\n props: { diffIds: block.diffId },\n });\n }\n } else if (block.diffType === \"removed\") {\n if (blockAccepted) {\n return {\n id: block.id || crypto.randomUUID(),\n type: \"paragraph\",\n props: {},\n content: [],\n children: [],\n };\n } else if (!blockRejected) {\n content = content.map((item: any) => ({\n ...item,\n styles: { ...item.styles, strike: true },\n }));\n\n content.push({\n type: \"diffActions\",\n props: { diffIds: block.diffId },\n });\n }\n }\n\n const baseBlock: PartialBlock = {\n id: block.id || crypto.randomUUID(),\n type: (block.type as any) || \"paragraph\",\n props: this.getBlockProps(block),\n content: content,\n children: block.children?.map((child) =>\n this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange),\n ),\n };\n\n return baseBlock;\n }\n\n private static renderWordLevelDiff(\n block: DiffBlock,\n onAcceptChange?: (diffId: string) => void,\n onRejectChange?: (diffId: string) => void,\n ): PartialBlock {\n if (!block.wordDiffs) {\n return {\n id: block.id || crypto.randomUUID(),\n type: (block.type as any) || \"paragraph\",\n props: block.props || {},\n content: Array.isArray(block.content) ? block.content : [],\n children: [],\n };\n }\n\n const content = this.groupAndRenderWordDiffs(block.wordDiffs);\n\n return {\n id: block.id || crypto.randomUUID(),\n type: (block.type as any) || \"paragraph\",\n props: block.props || {},\n content: Array.isArray(content) ? content : [],\n children:\n block.children?.map((child) => this.renderDiffBlock(child as DiffBlock, onAcceptChange, onRejectChange)) || [],\n };\n }\n\n private static groupAndRenderWordDiffs(wordDiffs: WordDiff[]): any[] {\n const content: any[] = [];\n\n for (let i = 0; i < wordDiffs.length; i++) {\n const wordDiff = wordDiffs[i];\n\n const isLastOfGroup = this.isLastDiffInGroup(wordDiffs, i);\n\n const textContent = this.createTextContent(wordDiff, isLastOfGroup);\n if (textContent) {\n if (Array.isArray(textContent)) {\n content.push(...textContent);\n } else {\n content.push(textContent);\n }\n }\n }\n\n const cleanedContent = this.cleanupSpaces(content);\n\n return cleanedContent;\n }\n\n private static cleanupSpaces(content: any[]): any[] {\n const filtered = content.filter((item) => item !== null && item !== undefined);\n\n const cleaned: any[] = [];\n\n for (let i = 0; i < filtered.length; i++) {\n const current = filtered[i];\n\n if (current.type === \"text\" && current.text === \" \") {\n const lastItem = cleaned[cleaned.length - 1];\n\n if (\n i === 0 ||\n i === filtered.length - 1 ||\n (lastItem && lastItem.type === \"text\" && lastItem.text === \" \") ||\n (lastItem && lastItem.type === \"diffActions\")\n ) {\n continue;\n }\n }\n\n if (current.type === \"diffActions\") {\n const nextItem = i + 1 < filtered.length ? filtered[i + 1] : null;\n\n cleaned.push(current);\n\n if (nextItem && nextItem.type === \"text\" && nextItem.text !== \" \" && nextItem.type !== \"diffActions\") {\n cleaned.push({\n type: \"text\",\n text: \" \",\n styles: {},\n });\n }\n\n continue;\n }\n\n cleaned.push(current);\n }\n\n return cleaned;\n }\n\n private static isLastDiffInGroup(wordDiffs: WordDiff[], currentIndex: number): boolean {\n const currentDiff = wordDiffs[currentIndex];\n\n if (currentDiff.type === \"unchanged\") {\n return false;\n }\n\n for (let i = currentIndex + 1; i < wordDiffs.length; i++) {\n const nextDiff = wordDiffs[i];\n\n if (nextDiff.diffId === currentDiff.diffId && (nextDiff.type === \"added\" || nextDiff.type === \"removed\")) {\n return false;\n }\n\n if (nextDiff.type !== \"unchanged\" && nextDiff.diffId !== currentDiff.diffId) {\n break;\n }\n }\n\n return true;\n }\n\n private static createTextContent(wordDiff: WordDiff, isLastOfGroup?: boolean): any[] | any {\n switch (wordDiff.type) {\n case \"added\":\n if (wordDiff.accepted) {\n return {\n type: \"text\",\n text: wordDiff.text,\n styles: {},\n };\n } else if (wordDiff.rejected) {\n return null;\n } else {\n if (wordDiff.text.trim() === \"\") {\n return {\n type: \"text\",\n text: wordDiff.text,\n styles: { backgroundColor: \"#dcfce7\" },\n };\n } else {\n const baseContent = {\n type: \"text\",\n text: wordDiff.text,\n styles: { bold: true },\n };\n\n if (isLastOfGroup) {\n return [\n baseContent,\n {\n type: \"diffActions\",\n props: { diffIds: wordDiff.diffId },\n },\n ];\n } else {\n return baseContent;\n }\n }\n }\n\n case \"removed\":\n if (wordDiff.accepted) {\n return null;\n } else if (wordDiff.rejected) {\n return {\n type: \"text\",\n text: wordDiff.text,\n styles: {},\n };\n } else {\n if (wordDiff.text.trim() === \"\") {\n return {\n type: \"text\",\n text: wordDiff.text,\n styles: { strike: true },\n };\n } else {\n const baseContent = {\n type: \"text\",\n text: wordDiff.text,\n styles: { strike: true },\n };\n\n if (isLastOfGroup) {\n return [\n baseContent,\n {\n type: \"diffActions\",\n props: { diffIds: wordDiff.diffId },\n },\n ];\n } else {\n return baseContent;\n }\n }\n }\n\n case \"unchanged\":\n default:\n return {\n type: \"text\",\n text: wordDiff.text,\n styles: {},\n };\n }\n }\n\n private static getBlockProps(block: DiffBlock): any {\n const baseProps = block.props || {};\n\n return baseProps;\n }\n\n static generateChangeSummary(diffBlocks: DiffBlock[]): {\n totalWords: number;\n addedWords: number;\n removedWords: number;\n acceptedChanges: number;\n rejectedChanges: number;\n pendingChanges: number;\n } {\n let totalWords = 0;\n let addedWords = 0;\n let removedWords = 0;\n let acceptedChanges = 0;\n let rejectedChanges = 0;\n let pendingChanges = 0;\n\n const processBlock = (block: DiffBlock) => {\n if (block.wordDiffs) {\n block.wordDiffs.forEach((wordDiff) => {\n totalWords++;\n\n if (wordDiff.type === \"added\") {\n addedWords++;\n } else if (wordDiff.type === \"removed\") {\n removedWords++;\n }\n\n if (wordDiff.accepted) {\n acceptedChanges++;\n } else if (wordDiff.rejected) {\n rejectedChanges++;\n } else if (wordDiff.type !== \"unchanged\") {\n pendingChanges++;\n }\n });\n }\n\n if (block.children) {\n block.children.forEach((child) => processBlock(child as DiffBlock));\n }\n };\n\n diffBlocks.forEach(processBlock);\n\n return {\n totalWords,\n addedWords,\n removedWords,\n acceptedChanges,\n rejectedChanges,\n pendingChanges,\n };\n }\n}\n","import { LucideIcon } from \"lucide-react\";\nimport { ReactNode } from \"react\";\nimport { ApiDataInterface, Modules } from \"../core\";\nimport { ContentInterface } from \"../features/content/data/content.interface\";\nimport { ModuleWithPermissions } from \"../permissions\";\nimport { cn } from \"./cn\";\n\nexport const getIconByModule = (params: { module: ModuleWithPermissions; className?: string }): ReactNode => {\n const IconComponent = getLucideIconByModule({ module: params.module });\n if (!IconComponent) return null;\n return <IconComponent className={cn(``, params.className)} />;\n};\n\nexport const getIcon = (params: { element: ApiDataInterface; className?: string }): ReactNode => {\n const IconComponent = getLucideIcon({ element: params.element });\n if (!IconComponent) return null;\n return <IconComponent className={cn(``, params.className)} />;\n};\n\nexport const getIconByModuleName = (params: { name: string; className?: string }): ReactNode => {\n return getIconByModule({ module: Modules.findByModelName(params.name), className: params.className });\n};\n\nexport const getLucideIcon = (params: { element: ApiDataInterface }): LucideIcon | null => {\n if (params.element.type === \"contents\") {\n const contentType = (params.element as ContentInterface).contentType;\n if (!contentType) return null;\n return getLucideIconByModule({ module: Modules.findByModelName(contentType) });\n }\n\n return getLucideIconByModule({ module: Modules.findByName(params.element.type) });\n};\n\nexport const getLucideIconByModule = (params: { module: ModuleWithPermissions }): LucideIcon | null => {\n return params.module.icon ?? null;\n};\n\nexport const getLucideIconByModuleName = (params: { name: string }): LucideIcon | null => {\n return getLucideIconByModule({ module: Modules.findByModelName(params.name) });\n};\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { UserInterface } from \"../../user/data/user.interface\";\nimport { AuthInput, AuthInterface } from \"./auth.interface\";\n\nexport class Auth extends AbstractApiData implements AuthInterface {\n private _token?: string;\n private _refreshToken?: string;\n private _user?: UserInterface;\n\n get token(): string {\n if (!this._token) throw new Error(\"Token is not defined\");\n return this._token;\n }\n\n get refreshToken(): string {\n if (!this._refreshToken) throw new Error(\"Refresh token is not defined\");\n return this._refreshToken;\n }\n\n get user(): UserInterface {\n if (!this._user) throw new Error(\"User is not defined\");\n return this._user;\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._token = data.jsonApi.attributes.token ?? undefined;\n this._refreshToken = data.jsonApi.attributes.refreshToken ?? undefined;\n\n this._user = this._readIncluded(data, \"user\", Modules.User) as UserInterface;\n\n return this;\n }\n\n createJsonApi(data: AuthInput) {\n const response: any = {\n data: {\n type: Modules.Auth.name,\n attributes: {},\n },\n };\n\n if (data.id) response.data.id = data.id;\n if (data.email !== undefined) response.data.attributes.email = data.email;\n if (data.name !== undefined) response.data.attributes.name = data.name;\n if (data.companyName !== undefined) response.data.attributes.companyName = data.companyName;\n if (data.password !== undefined) response.data.attributes.password = data.password;\n if (data.partitaIva !== undefined) response.data.attributes.partitaIva = data.partitaIva;\n if (data.codiceFiscale !== undefined) response.data.attributes.codiceFiscale = data.codiceFiscale;\n\n return response;\n }\n}\n","export enum AuthComponent {\n Login,\n ForgotPassword,\n ResetPassword,\n ActivateAccount,\n AcceptInvitation,\n Register,\n Landing,\n}\n","/**\n * Token parameters for authentication cookie management\n */\nexport interface TokenParams {\n token?: string;\n refreshToken?: string;\n userId?: string;\n companyId?: string;\n licenseExpirationDate?: Date;\n roles?: string[];\n features?: string[];\n modules?: {\n id: string;\n permissions: {\n create: boolean | string;\n read: boolean | string;\n update: boolean | string;\n delete: boolean | string;\n };\n }[];\n}\n\n/**\n * Token handler interface for dependency injection\n * Apps must provide implementations of these functions via configureAuth()\n */\nexport interface TokenHandler {\n updateToken: (params: TokenParams) => Promise<void>;\n removeToken: () => Promise<void>;\n}\n\n// Private storage for the injected token handler\nlet _tokenHandler: TokenHandler | null = null;\n\n/**\n * Configure authentication token handling\n * Call this at app startup to provide Server Actions for cookie management\n *\n * @example\n * ```typescript\n * import { configureAuth } from \"@carlonicora/nextjs-jsonapi/features\";\n * import { updateToken, removeToken } from \"@/features/auth/utils/AuthCookies\";\n *\n * configureAuth({ updateToken, removeToken });\n * ```\n */\nexport function configureAuth(handler: TokenHandler): void {\n _tokenHandler = handler;\n}\n\n/**\n * Internal getter for AuthService to access the token handler\n * @internal\n */\nexport function getTokenHandler(): TokenHandler | null {\n return _tokenHandler;\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Auth } from \".\";\n\nexport const AuthModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/auth\",\n name: \"auth\",\n model: Auth,\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { FeatureInterface } from \"../../feature\";\nimport { ModuleInterface } from \"../../module\";\nimport { CompanyInput, CompanyInterface } from \"./company.interface\";\n\nexport class Company extends AbstractApiData implements CompanyInterface {\n private _name?: string;\n private _logo?: string;\n private _logoUrl?: string;\n private _configurations?: any;\n\n private _licenseExpirationDate?: Date;\n\n private _features?: FeatureInterface[];\n private _modules?: ModuleInterface[];\n\n get name(): string {\n if (this._name === undefined) throw new Error(\"Name is not defined\");\n return this._name;\n }\n\n get logo(): string | undefined {\n return this._logo;\n }\n\n get logoUrl(): string | undefined {\n return this._logoUrl;\n }\n\n get licenseExpirationDate(): Date | undefined {\n return this._licenseExpirationDate;\n }\n\n get features(): FeatureInterface[] {\n return this._features ?? [];\n }\n\n get modules(): ModuleInterface[] {\n return this._modules ?? [];\n }\n\n get configurations(): any | undefined {\n return this._configurations;\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._name = data.jsonApi.attributes.name;\n this._configurations = data.jsonApi.attributes.configurations\n ? JSON.parse(data.jsonApi.attributes.configurations)\n : undefined;\n this._logo = data.jsonApi.attributes.logo;\n this._logoUrl = data.jsonApi.attributes.logoUrl;\n\n this._licenseExpirationDate = data.jsonApi.attributes.licenseExpirationDate\n ? new Date(data.jsonApi.attributes.licenseExpirationDate)\n : undefined;\n\n this._features = this._readIncluded<FeatureInterface>(data, \"features\", Modules.Feature) as FeatureInterface[];\n this._modules = this._readIncluded<ModuleInterface>(data, \"modules\", Modules.Module) as ModuleInterface[];\n\n return this;\n }\n\n createJsonApi(data: CompanyInput) {\n const response: any = {\n data: {\n type: Modules.Company.name,\n id: data.id,\n attributes: {},\n meta: {},\n relationships: {},\n },\n included: [],\n };\n\n if (data.name) response.data.attributes.name = data.name;\n if (data.configurations) response.data.attributes.configurations = JSON.stringify(data.configurations);\n if (data.logo) response.data.attributes.logo = data.logo;\n if (data.license) response.data.attributes.license = data.license;\n if (data.privateKey) response.data.attributes.privateKey = data.privateKey;\n\n if (data.featureIds && data.featureIds.length > 0) {\n response.data.relationships.features = {\n data: data.featureIds.map((featureId) => ({\n type: Modules.Feature.name,\n id: featureId,\n })),\n };\n }\n\n if (data.moduleIds && data.moduleIds.length > 0) {\n response.data.relationships.modules = {\n data: data.moduleIds.map((moduleId) => ({\n type: Modules.Module.name,\n id: moduleId,\n })),\n };\n }\n\n return response;\n }\n}\n","export enum CompanyFields {\n companyId = \"companyId\",\n name = \"name\",\n createdAt = \"createdAt\",\n updatedAt = \"updatedAt\",\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Company } from \".\";\n\nexport const CompanyModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/companies\",\n name: \"companies\",\n model: Company,\n moduleId: \"f9e77c8f-bfd1-4fd4-80b0-e1d891ab7113\",\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { SearchResultInterface } from \"../../search/interfaces/search.result.interface\";\nimport { UserInterface } from \"../../user\";\nimport { ContentInput, ContentInterface } from \"./content.interface\";\n\nexport class Content extends AbstractApiData implements ContentInterface, SearchResultInterface {\n private _contentType?: string;\n\n private _name?: string;\n private _abstract?: string;\n private _tldr?: string;\n private _aiStatus?: string;\n private _relevance?: number;\n\n private _author?: UserInterface;\n private _editors?: UserInterface[];\n\n get searchResult(): string {\n return this._name ?? \"\";\n }\n\n get contentType(): string | undefined {\n return this._contentType;\n }\n\n get name(): string {\n if (this._name === undefined) throw new Error(\"JsonApi error: content name is missing\");\n return this._name;\n }\n\n get abstract(): string | undefined {\n return this._abstract;\n }\n\n get tldr(): string | undefined {\n return this._tldr;\n }\n\n get aiStatus(): string {\n return this._aiStatus ?? \"\";\n }\n\n get relevance(): number | undefined {\n return this._relevance;\n }\n\n get author(): UserInterface {\n if (this._author === undefined) throw new Error(\"JsonApi error: document author is missing\");\n return this._author;\n }\n\n get editors(): UserInterface[] {\n return this._editors ?? [];\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._contentType = data.jsonApi.meta.contentType;\n\n this._name = data.jsonApi.attributes.name;\n this._abstract = data.jsonApi.attributes.abstract;\n this._tldr = data.jsonApi.attributes.tldr;\n this._aiStatus = data.jsonApi.meta.aiStatus;\n this._relevance = data.jsonApi.meta.relevance;\n\n this._author = this._readIncluded(data, \"author\", Modules.User) as UserInterface;\n this._editors = this._readIncluded(data, \"editors\", Modules.User) as UserInterface[];\n\n return this;\n }\n\n protected addContentInput(response: any, data: ContentInput) {\n if (data.name) response.data.attributes.name = data.name;\n\n if (data.authorId) {\n response.data.relationships.author = {\n data: {\n type: Modules.User.name,\n id: data.authorId,\n },\n };\n }\n }\n}\n","export enum ContentFields {\n contentId = \"contentId\",\n\n name = \"name\",\n relevance = \"relevance\",\n\n authors = \"authors\",\n\n createdAt = \"createdAt\",\n updatedAt = \"updatedAt\",\n}\n","import { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\nimport { Content } from \".\";\n\nexport const ContentModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/contents\",\n name: \"contents\",\n model: Content,\n inclusions: {\n lists: {\n fields: [\n createJsonApiInclusion(\"content\", [`name`, `tldr`, `abstract`, `aiStatus`, `relevance`]),\n createJsonApiInclusion(\"users\", [`name`, `avatar`]),\n createJsonApiInclusion(\"topics\", [`name`]),\n createJsonApiInclusion(\"expertises\", [`name`]),\n ],\n },\n },\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { ModuleInterface } from \"../../module\";\nimport { FeatureInterface } from \"./feature.interface\";\n\nexport class Feature extends AbstractApiData implements FeatureInterface {\n private _name?: string;\n private _isProduction?: boolean;\n\n private _modules: ModuleInterface[] = [];\n\n get name(): string {\n return this._name ?? \"\";\n }\n\n get isProduction(): boolean {\n return this._isProduction == true ? true : false;\n }\n\n get modules(): ModuleInterface[] {\n return this._modules;\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._name = data.jsonApi.attributes.name;\n this._isProduction = data.jsonApi.attributes.isProduction ?? false;\n\n this._modules = this._readIncluded(data, `modules`, Modules.Module) as ModuleInterface[];\n\n return this;\n }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Feature } from \"./data/feature\";\n\nexport const FeatureModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/features\",\n name: \"features\",\n model: Feature,\n moduleId: \"025fdd23-2803-4360-9fd9-eaa3612c2e23\",\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface } from \"../../../core\";\nimport { ModuleInterface } from \"./module.interface\";\n\nexport class Module extends AbstractApiData implements ModuleInterface {\n private _name?: string;\n private _isCore?: boolean;\n private _permissions?: {\n create: boolean | string;\n read: boolean | string;\n update: boolean | string;\n delete: boolean | string;\n };\n\n get name(): string {\n if (!this._name) throw new Error(\"Name is not defined\");\n return this._name ?? \"\";\n }\n\n get isCore(): boolean {\n return this._isCore ?? false;\n }\n\n get permissions(): {\n create: boolean | string;\n read: boolean | string;\n update: boolean | string;\n delete: boolean | string;\n } {\n if (!this._permissions) throw new Error(\"Permissions is not defined\");\n return this._permissions;\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._name = data.jsonApi.attributes.name;\n this._isCore = data.jsonApi.attributes.isCore;\n this._permissions = data.jsonApi.meta.permissions;\n\n return this;\n }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Module } from \"./data\";\n\nexport const ModuleModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/modules\",\n name: \"modules\",\n model: Module,\n moduleId: \"25ffd868-8341-4ca7-963b-6e1c56b03b1d\",\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { UserInterface } from \"../../user\";\nimport { NotificationInput, NotificationInterface } from \"./notification.interface\";\n\nexport class Notification extends AbstractApiData implements NotificationInterface {\n private _notificationType?: string;\n private _isRead?: boolean;\n\n private _actor?: UserInterface;\n\n get notificationType(): string {\n if (this._notificationType === undefined) throw new Error(\"notificationType is not set\");\n return this._notificationType;\n }\n\n get isRead(): boolean {\n return this._isRead === undefined ? false : this._isRead;\n }\n\n get actor(): UserInterface | undefined {\n return this._actor;\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._notificationType = data.jsonApi.attributes.notificationType;\n this._isRead = data.jsonApi.attributes.isRead;\n\n this._actor = this._readIncluded(data, \"actor\", Modules.User) as UserInterface;\n\n return this;\n }\n\n createJsonApi(data: NotificationInput) {\n const response: any = {\n data: {\n type: Modules.Notification.name,\n id: data.id,\n attributes: {\n isRead: data.isRead,\n },\n meta: {},\n relationships: {},\n },\n included: [],\n };\n\n return response;\n }\n}\n","export enum NotificationFields {\n notificationId = \"notificationId\",\n\n name = \"name\",\n\n createdAt = \"createdAt\",\n updatedAt = \"updatedAt\",\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Notification } from \"./data/notification\";\n\nexport const NotificationModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/notifications\",\n name: \"notifications\",\n model: Notification,\n moduleId: \"9259d704-c670-4e77-a3a1-a728ffc5be3d\",\n });\n","import { AbstractApiData, Modules } from \"../../../core\";\nimport { PushInput, PushInterface } from \"./push.interface\";\n\nexport class Push extends AbstractApiData implements PushInterface {\n createJsonApi(data: PushInput) {\n const response: any = {\n data: {\n type: Modules.Push.name,\n attributes: {\n key: data.key,\n },\n },\n included: [],\n };\n\n return response;\n }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Push } from \"./data/push\";\n\nexport const PushModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/push\",\n name: \"push\",\n model: Push,\n moduleId: \"\",\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { FeatureInterface } from \"../../feature\";\nimport { RoleInput, RoleInterface } from \"./role.interface\";\n\nexport class Role extends AbstractApiData implements RoleInterface {\n private _name?: string;\n private _description?: string;\n private _isSelectable?: boolean;\n\n private _requiredFeature?: FeatureInterface;\n\n get name(): string {\n if (!this._name) throw new Error(\"Name is not defined\");\n return this._name;\n }\n\n get description(): string {\n return this._description ?? \"\";\n }\n\n get isSelectable(): boolean {\n return this._isSelectable ?? false;\n }\n\n get requiredFeature(): FeatureInterface | undefined {\n return this._requiredFeature;\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._name = data.jsonApi.attributes.name ?? undefined;\n this._description = data.jsonApi.attributes.description ?? undefined;\n this._isSelectable = data.jsonApi.attributes.isSelectable ?? undefined;\n\n this._requiredFeature = this._readIncluded<FeatureInterface>(\n data,\n \"requiredFeature\",\n Modules.Feature,\n ) as FeatureInterface;\n\n return this;\n }\n\n createJsonApi(data: RoleInput) {\n const response: any = {\n data: {\n type: Modules.Role.name,\n id: data.id,\n attributes: {\n name: data.name,\n },\n meta: {},\n },\n included: [],\n };\n\n if (data.description !== undefined) response.data.attributes.description = data.description;\n\n return response;\n }\n}\n","export enum RoleFields {\n roleId = \"roleId\",\n name = \"name\",\n description = \"description\",\n\n createdAt = \"createdAt\",\n updatedAt = \"updatedAt\",\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { Role } from \"./data/role\";\n\nexport const RoleModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/roles\",\n name: \"roles\",\n model: Role,\n moduleId: \"9f6416e6-7b9b-4e1a-a99f-833191eca8a9\",\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { S3Input, S3Interface } from \"./s3.interface\";\n\nexport class S3 extends AbstractApiData implements S3Interface {\n private _url?: string;\n private _storageType?: string;\n private _contentType?: string;\n private _blobType?: string;\n private _acl?: string;\n\n get url(): string {\n if (!this._url) throw new Error(\"Image URL is not set.\");\n return this._url;\n }\n\n get headers(): Record<string, string> {\n const headers: Record<string, string> = {};\n\n if (this._contentType) {\n headers[\"Content-Type\"] = this._contentType;\n }\n\n if (this._blobType) {\n headers[\"x-ms-blob-type\"] = this._blobType;\n }\n\n if (this._acl) {\n headers[\"x-amz-acl\"] = this._acl;\n }\n\n return headers;\n }\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._url = data.jsonApi.attributes.url ?? undefined;\n this._storageType = data.jsonApi.attributes.storageType ?? undefined;\n this._contentType = data.jsonApi.attributes.contentType ?? undefined;\n this._blobType = data.jsonApi.attributes.blobType ?? undefined;\n this._acl = data.jsonApi.attributes.acl ?? undefined;\n\n return this;\n }\n\n createJsonApi(data: S3Input) {\n const response: any = {\n data: {\n type: Modules.S3.name,\n attributes: {\n key: data.key,\n },\n },\n included: [],\n };\n\n if (data.contentType) response.data.attributes.contentType = data.contentType;\n\n return response;\n }\n}\n","import { ModuleFactory } from \"../../permissions\";\nimport { S3 } from \"./data/s3\";\n\nexport const S3Module = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/s3\",\n name: \"s3\",\n model: S3,\n moduleId: \"db41ba46-e171-4324-8845-99353eba8568\",\n });\n","import { AbstractApiData, JsonApiHydratedDataInterface, Modules } from \"../../../core\";\nimport { CompanyInterface } from \"../../company\";\nimport { ModuleInterface } from \"../../module\";\nimport { RoleInterface } from \"../../role\";\nimport { SearchResultInterface } from \"../../search\";\nimport { UserInput, UserInterface } from \"./user.interface\";\n\nexport class User extends AbstractApiData implements UserInterface, SearchResultInterface {\n private _name?: string;\n private _email?: string;\n private _title?: string;\n private _bio?: string;\n private _avatar?: string;\n private _avatarUrl?: string;\n private _phone?: string;\n private _rate?: number;\n\n private _isActivated?: boolean;\n private _isDeleted?: boolean;\n private _lastLogin?: Date;\n\n private _relevance?: number;\n\n private _roles: RoleInterface[] = [];\n private _company?: CompanyInterface;\n private _modules: ModuleInterface[] = [];\n\n get searchResult(): string {\n return this._name ?? \"\";\n }\n\n get name(): string {\n return this._name ?? \"\";\n }\n\n get email(): string {\n return this._email ?? \"\";\n }\n\n get title(): string {\n return this._title ?? \"\";\n }\n\n get bio(): string {\n return this._bio ?? \"\";\n }\n\n get avatar(): string | undefined {\n return this._avatar;\n }\n\n get avatarUrl(): string | undefined {\n return this._avatarUrl;\n }\n\n get phone(): string | undefined {\n return this._phone;\n }\n\n get rate(): number | undefined {\n return this._rate;\n }\n\n get relevance(): number | undefined {\n return this._relevance;\n }\n\n get isActivated(): boolean {\n return this._isActivated ?? false;\n }\n\n get isDeleted(): boolean {\n return this._isDeleted ?? false;\n }\n\n get lastLogin(): Date | undefined {\n return this._lastLogin;\n }\n\n get roles(): RoleInterface[] {\n return this._roles;\n }\n\n get company(): CompanyInterface | undefined {\n return this._company;\n }\n\n get modules(): ModuleInterface[] {\n return this._modules;\n }\n\n rehydrate(data: JsonApiHydratedDataInterface): this {\n super.rehydrate(data);\n\n this._name = data.jsonApi.attributes.name;\n this._email = data.jsonApi.attributes.email;\n this._title = data.jsonApi.attributes.title;\n this._bio = data.jsonApi.attributes.bio;\n this._phone = data.jsonApi.attributes.phone;\n this._rate = data.jsonApi.attributes.rate;\n\n this._avatar = data.jsonApi.attributes.avatar;\n this._avatarUrl = data.jsonApi.attributes.avatarUrl;\n\n this._isActivated = data.jsonApi.meta.isActive;\n this._isDeleted = data.jsonApi.meta.isDeleted;\n this._lastLogin = data.jsonApi.meta.lastLogin ? new Date(data.jsonApi.meta.lastLogin) : undefined;\n\n this._relevance = data.jsonApi.meta.relevance;\n\n this._roles = this._readIncluded(data, \"roles\", Modules.Role) as RoleInterface[];\n this._company = this._readIncluded(data, \"company\", Modules.Company) as CompanyInterface;\n this._modules = this._readIncluded(data, \"modules\", Modules.Module) as ModuleInterface[];\n\n return this;\n }\n\n createJsonApi(data: UserInput) {\n const response: any = {\n data: {\n type: Modules.User.name,\n id: data.id,\n attributes: {\n name: data.name,\n },\n meta: {},\n relationships: {},\n },\n included: [],\n };\n\n if (data.email !== undefined) response.data.attributes.email = data.email;\n if (data.title !== undefined) response.data.attributes.title = data.title;\n if (data.bio !== undefined) response.data.attributes.bio = data.bio;\n if (data.phone !== undefined) response.data.attributes.phone = data.phone;\n if (data.password !== undefined) response.data.attributes.password = data.password;\n if (data.sendInvitationEmail) response.data.attributes.sendInvitationEmail = true;\n if (data.adminCreated) response.data.attributes.adminCreated = true;\n if (data.avatar) response.data.attributes.avatar = data.avatar;\n if (data.rate !== undefined) response.data.attributes.rate = data.rate;\n\n if (data.roleIds) {\n response.data.relationships.roles = {\n data: data.roleIds.map((roleId) => ({\n type: Modules.Role.name,\n id: roleId,\n })),\n };\n }\n\n if (data.companyId) {\n response.data.relationships.company = {\n data: {\n type: Modules.Company.name,\n id: data.companyId,\n },\n };\n }\n\n return response;\n }\n}\n","export enum UserFields {\n userId = \"userId\",\n name = \"name\",\n email = \"email\",\n relevance = \"relevance\",\n createdAt = \"createdAt\",\n updatedAt = \"updatedAt\",\n}\n","import { User } from \"./data/user\";\nimport { createJsonApiInclusion } from \"../../core\";\nimport { ModuleFactory } from \"../../permissions\";\n\nexport const UserModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/users\",\n name: \"users\",\n model: User,\n moduleId: \"04cfc677-0fd2-4f5e-adf4-2483a00c0277\",\n inclusions: {\n lists: {\n fields: [\n createJsonApiInclusion(\"users\", [`name`, `email`, `avatar`, `title`]),\n createJsonApiInclusion(\"usertopics\", [`level`]),\n createJsonApiInclusion(\"userexpertises\", [`level`]),\n createJsonApiInclusion(\"topics\", [`name`]),\n ],\n },\n },\n });\n","import { ModuleFactory } from \"../../permissions\";\nimport { User } from \"./data\";\n\nexport const AuthorModule = (factory: ModuleFactory) =>\n factory({\n pageUrl: \"/authors\",\n name: \"authors\",\n model: User,\n moduleId: \"04cfc677-0fd2-4f5e-adf4-2483a00c0277\",\n });\n"]}