@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
@@ -1,75 +1,19 @@
1
- import {
2
- getTokenHandler
3
- } from "./chunk-SM63SZCP.mjs";
4
1
  import {
5
2
  JsonApiDelete,
6
3
  JsonApiGet,
7
4
  JsonApiPost
8
- } from "./chunk-IKBA4AHN.mjs";
5
+ } from "./chunk-F4Y3GZG4.mjs";
9
6
  import {
10
- AbstractApiData,
11
7
  AbstractService,
12
8
  EndpointCreator,
13
9
  Modules,
14
- createJsonApiInclusion,
10
+ getTokenHandler,
15
11
  rehydrate
16
- } from "./chunk-FMBQZAIP.mjs";
12
+ } from "./chunk-KFL5ZFM4.mjs";
17
13
  import {
18
14
  __name
19
15
  } from "./chunk-PAWJFY3S.mjs";
20
16
 
21
- // src/features/auth/auth.module.ts
22
- var AuthModule = /* @__PURE__ */ __name((factory) => factory({
23
- pageUrl: "/auth",
24
- name: "auth",
25
- model: Auth
26
- }), "AuthModule");
27
-
28
- // src/features/auth/data/auth.ts
29
- var Auth = class extends AbstractApiData {
30
- static {
31
- __name(this, "Auth");
32
- }
33
- _token;
34
- _refreshToken;
35
- _user;
36
- get token() {
37
- if (!this._token) throw new Error("Token is not defined");
38
- return this._token;
39
- }
40
- get refreshToken() {
41
- if (!this._refreshToken) throw new Error("Refresh token is not defined");
42
- return this._refreshToken;
43
- }
44
- get user() {
45
- if (!this._user) throw new Error("User is not defined");
46
- return this._user;
47
- }
48
- rehydrate(data) {
49
- super.rehydrate(data);
50
- this._token = data.jsonApi.attributes.token ?? void 0;
51
- this._refreshToken = data.jsonApi.attributes.refreshToken ?? void 0;
52
- this._user = this._readIncluded(data, "user", Modules.User);
53
- return this;
54
- }
55
- createJsonApi(data) {
56
- const response = {
57
- data: {
58
- type: Modules.Auth.name,
59
- attributes: {}
60
- }
61
- };
62
- if (data.id) response.data.id = data.id;
63
- if (data.email !== void 0) response.data.attributes.email = data.email;
64
- if (data.name !== void 0) response.data.attributes.name = data.name;
65
- if (data.companyName !== void 0) response.data.attributes.companyName = data.companyName;
66
- if (data.password !== void 0) response.data.attributes.password = data.password;
67
- if (data.partitaIva !== void 0) response.data.attributes.partitaIva = data.partitaIva;
68
- if (data.codiceFiscale !== void 0) response.data.attributes.codiceFiscale = data.codiceFiscale;
69
- return response;
70
- }
71
- };
72
-
73
17
  // src/features/auth/data/auth.service.ts
74
18
  var AuthService = class extends AbstractService {
75
19
  static {
@@ -191,116 +135,185 @@ var AuthService = class extends AbstractService {
191
135
  }
192
136
  };
193
137
 
194
- // src/features/auth/enums/AuthComponent.ts
195
- var AuthComponent = /* @__PURE__ */ ((AuthComponent2) => {
196
- AuthComponent2[AuthComponent2["Login"] = 0] = "Login";
197
- AuthComponent2[AuthComponent2["ForgotPassword"] = 1] = "ForgotPassword";
198
- AuthComponent2[AuthComponent2["ResetPassword"] = 2] = "ResetPassword";
199
- AuthComponent2[AuthComponent2["ActivateAccount"] = 3] = "ActivateAccount";
200
- AuthComponent2[AuthComponent2["AcceptInvitation"] = 4] = "AcceptInvitation";
201
- AuthComponent2[AuthComponent2["Register"] = 5] = "Register";
202
- AuthComponent2[AuthComponent2["Landing"] = 6] = "Landing";
203
- return AuthComponent2;
204
- })(AuthComponent || {});
205
-
206
- // src/features/company/company.module.ts
207
- var CompanyModule = /* @__PURE__ */ __name((factory) => factory({
208
- pageUrl: "/companies",
209
- name: "companies",
210
- model: Company,
211
- moduleId: "f9e77c8f-bfd1-4fd4-80b0-e1d891ab7113"
212
- }), "CompanyModule");
213
-
214
- // src/features/company/data/company.ts
215
- var Company = class extends AbstractApiData {
138
+ // src/features/user/data/user.service.ts
139
+ var UserService = class extends AbstractService {
216
140
  static {
217
- __name(this, "Company");
141
+ __name(this, "UserService");
218
142
  }
219
- _name;
220
- _logo;
221
- _logoUrl;
222
- _configurations;
223
- _licenseExpirationDate;
224
- _features;
225
- _modules;
226
- get name() {
227
- if (this._name === void 0) throw new Error("Name is not defined");
228
- return this._name;
143
+ static async findFullUser() {
144
+ const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "me", childEndpoint: "full" });
145
+ return this.callApi({
146
+ type: Modules.User,
147
+ method: "GET" /* GET */,
148
+ endpoint: endpoint.generate()
149
+ });
150
+ }
151
+ static async findById(params) {
152
+ return this.callApi({
153
+ type: Modules.User,
154
+ method: "GET" /* GET */,
155
+ endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
156
+ });
229
157
  }
230
- get logo() {
231
- return this._logo;
158
+ static async findByEmail(params) {
159
+ const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "email", childEndpoint: params.email });
160
+ return this.callApi({ type: Modules.User, method: "GET" /* GET */, endpoint: endpoint.generate() });
232
161
  }
233
- get logoUrl() {
234
- return this._logoUrl;
162
+ static async findMany(params) {
163
+ const endpoint = new EndpointCreator({ endpoint: Modules.User });
164
+ if (params.roleId) endpoint.addAdditionalParam("roleId", params.roleId);
165
+ if (params.includeDeleted) endpoint.addAdditionalParam("includeDeleted", "true");
166
+ if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
167
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
168
+ return this.callApi({
169
+ type: Modules.User,
170
+ method: "GET" /* GET */,
171
+ endpoint: endpoint.generate(),
172
+ next: params.next
173
+ });
235
174
  }
236
- get licenseExpirationDate() {
237
- return this._licenseExpirationDate;
175
+ static async findManyByContentIds(params) {
176
+ const endpoint = new EndpointCreator({ endpoint: Modules.User });
177
+ endpoint.addAdditionalParam("contentIds", params.contentIds.map((id) => id).join(","));
178
+ endpoint.addAdditionalParam("includeDeleted", "true");
179
+ endpoint.addAdditionalParam("fetchAll", "true");
180
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
181
+ return this.callApi({
182
+ type: Modules.User,
183
+ method: "GET" /* GET */,
184
+ endpoint: endpoint.generate(),
185
+ next: params.next
186
+ });
238
187
  }
239
- get features() {
240
- return this._features ?? [];
188
+ static async findRelevant(params) {
189
+ const endpoint = new EndpointCreator({
190
+ endpoint: Modules.Content,
191
+ id: params.id,
192
+ childEndpoint: "user-relevance"
193
+ });
194
+ if (Modules.User.inclusions?.lists?.fields) endpoint.limitToFields(Modules.User.inclusions.lists.fields);
195
+ if (Modules.User.inclusions?.lists?.types) endpoint.limitToType(Modules.User.inclusions.lists.types);
196
+ return this.callApi({
197
+ type: Modules.User,
198
+ method: "GET" /* GET */,
199
+ endpoint: endpoint.generate(),
200
+ next: params.next
201
+ });
241
202
  }
242
- get modules() {
243
- return this._modules ?? [];
203
+ static async findManyForAmin(params) {
204
+ if (!params.companyId) return [];
205
+ const endpoint = new EndpointCreator({
206
+ endpoint: Modules.Company,
207
+ id: params.companyId,
208
+ childEndpoint: Modules.User
209
+ });
210
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
211
+ return this.callApi({
212
+ type: Modules.User,
213
+ method: "GET" /* GET */,
214
+ endpoint: endpoint.generate(),
215
+ next: params.next,
216
+ previous: params.prev
217
+ });
244
218
  }
245
- get configurations() {
246
- return this._configurations;
219
+ static async findAllUsers(params) {
220
+ const endpoint = new EndpointCreator({
221
+ endpoint: Modules.Company,
222
+ id: params.companyId,
223
+ childEndpoint: Modules.User
224
+ });
225
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
226
+ if (params.isDeleted) endpoint.addAdditionalParam("isDeleted", "true");
227
+ if (params.limitToRoles && params.limitToRoles.length > 0)
228
+ endpoint.addAdditionalParam("limitToRoles", params.limitToRoles.join(","));
229
+ return this.callApi({
230
+ type: Modules.User,
231
+ method: "GET" /* GET */,
232
+ endpoint: endpoint.generate(),
233
+ next: params.next
234
+ });
247
235
  }
248
- rehydrate(data) {
249
- super.rehydrate(data);
250
- this._name = data.jsonApi.attributes.name;
251
- this._configurations = data.jsonApi.attributes.configurations ? JSON.parse(data.jsonApi.attributes.configurations) : void 0;
252
- this._logo = data.jsonApi.attributes.logo;
253
- this._logoUrl = data.jsonApi.attributes.logoUrl;
254
- this._licenseExpirationDate = data.jsonApi.attributes.licenseExpirationDate ? new Date(data.jsonApi.attributes.licenseExpirationDate) : void 0;
255
- this._features = this._readIncluded(data, "features", Modules.Feature);
256
- this._modules = this._readIncluded(data, "modules", Modules.Module);
257
- return this;
236
+ static async findAllUsersByRole(params) {
237
+ const endpoint = new EndpointCreator({ endpoint: Modules.Role, id: params.roleId, childEndpoint: Modules.User });
238
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
239
+ return this.callApi({
240
+ type: Modules.User,
241
+ method: "GET" /* GET */,
242
+ endpoint: endpoint.generate(),
243
+ next: params.next
244
+ });
258
245
  }
259
- createJsonApi(data) {
260
- const response = {
261
- data: {
262
- type: Modules.Company.name,
263
- id: data.id,
264
- attributes: {},
265
- meta: {},
266
- relationships: {}
267
- },
268
- included: []
269
- };
270
- if (data.name) response.data.attributes.name = data.name;
271
- if (data.configurations) response.data.attributes.configurations = JSON.stringify(data.configurations);
272
- if (data.logo) response.data.attributes.logo = data.logo;
273
- if (data.license) response.data.attributes.license = data.license;
274
- if (data.privateKey) response.data.attributes.privateKey = data.privateKey;
275
- if (data.featureIds && data.featureIds.length > 0) {
276
- response.data.relationships.features = {
277
- data: data.featureIds.map((featureId) => ({
278
- type: Modules.Feature.name,
279
- id: featureId
280
- }))
281
- };
282
- }
283
- if (data.moduleIds && data.moduleIds.length > 0) {
284
- response.data.relationships.modules = {
285
- data: data.moduleIds.map((moduleId) => ({
286
- type: Modules.Module.name,
287
- id: moduleId
288
- }))
289
- };
290
- }
291
- return response;
246
+ static async findAllUsersNotInRole(params) {
247
+ const endpoint = new EndpointCreator({
248
+ endpoint: Modules.Role,
249
+ id: params.roleId,
250
+ childEndpoint: Modules.User
251
+ }).addAdditionalParam("notInRole", "true");
252
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
253
+ return this.callApi({
254
+ type: Modules.User,
255
+ method: "GET" /* GET */,
256
+ endpoint: endpoint.generate(),
257
+ next: params.next
258
+ });
259
+ }
260
+ static async create(params) {
261
+ return this.callApi({
262
+ type: Modules.User,
263
+ method: "POST" /* POST */,
264
+ endpoint: new EndpointCreator({ endpoint: Modules.User }).generate(),
265
+ companyId: params.companyId,
266
+ input: params
267
+ });
268
+ }
269
+ static async reactivate(params) {
270
+ return this.callApi({
271
+ type: Modules.User,
272
+ method: "PATCH" /* PATCH */,
273
+ endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
274
+ });
275
+ }
276
+ static async sendInvitation(params) {
277
+ const endpoint = new EndpointCreator({
278
+ endpoint: Modules.User,
279
+ id: params.userId,
280
+ childEndpoint: "send-invitation-email"
281
+ });
282
+ if (params.companyId) endpoint.addAdditionalParam("companyId", params.companyId);
283
+ this.callApi({
284
+ type: Modules.User,
285
+ method: "POST" /* POST */,
286
+ endpoint: endpoint.generate()
287
+ });
288
+ }
289
+ static async update(params) {
290
+ return this.callApi({
291
+ type: Modules.User,
292
+ method: "PUT" /* PUT */,
293
+ endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id }).generate(),
294
+ companyId: params.companyId,
295
+ input: params
296
+ });
297
+ }
298
+ static async patchRate(params) {
299
+ return this.callApi({
300
+ type: Modules.User,
301
+ method: "PATCH" /* PATCH */,
302
+ endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id, childEndpoint: "rates" }).generate(),
303
+ companyId: params.companyId,
304
+ input: params
305
+ });
306
+ }
307
+ static async delete(params) {
308
+ await this.callApi({
309
+ type: Modules.User,
310
+ method: "DELETE" /* DELETE */,
311
+ endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate(),
312
+ companyId: params.companyId
313
+ });
292
314
  }
293
315
  };
294
316
 
295
- // src/features/company/data/company.fields.ts
296
- var CompanyFields = /* @__PURE__ */ ((CompanyFields2) => {
297
- CompanyFields2["companyId"] = "companyId";
298
- CompanyFields2["name"] = "name";
299
- CompanyFields2["createdAt"] = "createdAt";
300
- CompanyFields2["updatedAt"] = "updatedAt";
301
- return CompanyFields2;
302
- })(CompanyFields || {});
303
-
304
317
  // src/features/company/data/company.service.ts
305
318
  var CompanyService = class extends AbstractService {
306
319
  static {
@@ -368,468 +381,33 @@ var CompanyService = class extends AbstractService {
368
381
  }
369
382
  };
370
383
 
371
- // src/features/content/content.module.ts
372
- var ContentModule = /* @__PURE__ */ __name((factory) => factory({
373
- pageUrl: "/contents",
374
- name: "contents",
375
- model: Content,
376
- inclusions: {
377
- lists: {
378
- fields: [
379
- createJsonApiInclusion("content", [`name`, `tldr`, `abstract`, `aiStatus`, `relevance`]),
380
- createJsonApiInclusion("users", [`name`, `avatar`]),
381
- createJsonApiInclusion("topics", [`name`]),
382
- createJsonApiInclusion("expertises", [`name`])
383
- ]
384
- }
385
- }
386
- }), "ContentModule");
387
-
388
- // src/features/content/data/content.ts
389
- var Content = class extends AbstractApiData {
390
- static {
391
- __name(this, "Content");
392
- }
393
- _contentType;
394
- _name;
395
- _abstract;
396
- _tldr;
397
- _aiStatus;
398
- _relevance;
399
- _author;
400
- _editors;
401
- get searchResult() {
402
- return this._name ?? "";
403
- }
404
- get contentType() {
405
- return this._contentType;
406
- }
407
- get name() {
408
- if (this._name === void 0) throw new Error("JsonApi error: content name is missing");
409
- return this._name;
410
- }
411
- get abstract() {
412
- return this._abstract;
413
- }
414
- get tldr() {
415
- return this._tldr;
416
- }
417
- get aiStatus() {
418
- return this._aiStatus ?? "";
419
- }
420
- get relevance() {
421
- return this._relevance;
422
- }
423
- get author() {
424
- if (this._author === void 0) throw new Error("JsonApi error: document author is missing");
425
- return this._author;
426
- }
427
- get editors() {
428
- return this._editors ?? [];
429
- }
430
- rehydrate(data) {
431
- super.rehydrate(data);
432
- this._contentType = data.jsonApi.meta.contentType;
433
- this._name = data.jsonApi.attributes.name;
434
- this._abstract = data.jsonApi.attributes.abstract;
435
- this._tldr = data.jsonApi.attributes.tldr;
436
- this._aiStatus = data.jsonApi.meta.aiStatus;
437
- this._relevance = data.jsonApi.meta.relevance;
438
- this._author = this._readIncluded(data, "author", Modules.User);
439
- this._editors = this._readIncluded(data, "editors", Modules.User);
440
- return this;
441
- }
442
- addContentInput(response, data) {
443
- if (data.name) response.data.attributes.name = data.name;
444
- if (data.authorId) {
445
- response.data.relationships.author = {
446
- data: {
447
- type: Modules.User.name,
448
- id: data.authorId
449
- }
450
- };
451
- }
452
- }
453
- };
454
-
455
- // src/features/content/data/content.fields.ts
456
- var ContentFields = /* @__PURE__ */ ((ContentFields2) => {
457
- ContentFields2["contentId"] = "contentId";
458
- ContentFields2["name"] = "name";
459
- ContentFields2["relevance"] = "relevance";
460
- ContentFields2["authors"] = "authors";
461
- ContentFields2["createdAt"] = "createdAt";
462
- ContentFields2["updatedAt"] = "updatedAt";
463
- return ContentFields2;
464
- })(ContentFields || {});
465
-
466
- // src/features/content/data/content.service.ts
467
- var ContentService = class extends AbstractService {
384
+ // src/features/role/data/role.service.ts
385
+ var RoleService = class extends AbstractService {
468
386
  static {
469
- __name(this, "ContentService");
387
+ __name(this, "RoleService");
470
388
  }
471
- static async findMany(params) {
472
- const endpoint = new EndpointCreator({ endpoint: Modules.Content });
473
- if (params.contentIds) {
474
- endpoint.addAdditionalParam("contentIds", params.contentIds.join(","));
475
- endpoint.addAdditionalParam("fetchAll", "true");
476
- } else {
477
- if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
478
- if (params.search) endpoint.addAdditionalParam("search", params.search);
479
- }
480
- if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
481
- if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
389
+ static async findById(params) {
482
390
  return this.callApi({
483
- type: Modules.Content,
391
+ type: Modules.Role,
484
392
  method: "GET" /* GET */,
485
- endpoint: endpoint.generate(),
486
- next: params.next
393
+ endpoint: new EndpointCreator({ endpoint: Modules.Role, id: params.roleId }).generate()
487
394
  });
488
395
  }
489
- static async findRelevant(params) {
490
- const endpoint = new EndpointCreator({
491
- endpoint: Modules.Content,
492
- id: params.id,
493
- childEndpoint: "relevance"
494
- });
495
- if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
496
- if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
396
+ static async findAllRoles(params) {
397
+ const endpoint = new EndpointCreator({ endpoint: Modules.Role });
398
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
497
399
  return this.callApi({
498
- type: Modules.Content,
400
+ type: Modules.Role,
499
401
  method: "GET" /* GET */,
500
402
  endpoint: endpoint.generate(),
501
403
  next: params.next
502
404
  });
503
405
  }
504
- static async findManyByAuthor(params) {
505
- const endpoint = new EndpointCreator({
506
- endpoint: Modules.Author,
507
- id: params.userId,
508
- childEndpoint: Modules.Content
509
- });
510
- if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
406
+ static async findAllRolesByUser(params) {
407
+ const endpoint = new EndpointCreator({ endpoint: Modules.User, id: params.userId, childEndpoint: Modules.Role });
511
408
  if (params.search) endpoint.addAdditionalParam("search", params.search);
512
- if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
513
- if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
514
409
  return this.callApi({
515
- type: Modules.Content,
516
- method: "GET" /* GET */,
517
- endpoint: endpoint.generate(),
518
- next: params.next
519
- });
520
- }
521
- };
522
-
523
- // src/features/feature/data/feature.ts
524
- var Feature = class extends AbstractApiData {
525
- static {
526
- __name(this, "Feature");
527
- }
528
- _name;
529
- _isProduction;
530
- _modules = [];
531
- get name() {
532
- return this._name ?? "";
533
- }
534
- get isProduction() {
535
- return this._isProduction == true ? true : false;
536
- }
537
- get modules() {
538
- return this._modules;
539
- }
540
- rehydrate(data) {
541
- super.rehydrate(data);
542
- this._name = data.jsonApi.attributes.name;
543
- this._isProduction = data.jsonApi.attributes.isProduction ?? false;
544
- this._modules = this._readIncluded(data, `modules`, Modules.Module);
545
- return this;
546
- }
547
- };
548
-
549
- // src/features/feature/feature.module.ts
550
- var FeatureModule = /* @__PURE__ */ __name((factory) => factory({
551
- pageUrl: "/features",
552
- name: "features",
553
- model: Feature,
554
- moduleId: "025fdd23-2803-4360-9fd9-eaa3612c2e23"
555
- }), "FeatureModule");
556
-
557
- // src/features/feature/data/feature.service.ts
558
- var FeatureService = class extends AbstractService {
559
- static {
560
- __name(this, "FeatureService");
561
- }
562
- static async findMany(params) {
563
- const endpoint = new EndpointCreator({ endpoint: Modules.Feature });
564
- if (params.companyId) endpoint.endpoint(Modules.Company).id(params.companyId).childEndpoint(Modules.Feature);
565
- if (params.search) endpoint.addAdditionalParam("search", params.search);
566
- return this.callApi({
567
- type: Modules.Feature,
568
- method: "GET" /* GET */,
569
- endpoint: endpoint.generate(),
570
- next: params.next
571
- });
572
- }
573
- };
574
-
575
- // src/features/module/data/module.ts
576
- var Module = class extends AbstractApiData {
577
- static {
578
- __name(this, "Module");
579
- }
580
- _name;
581
- _isCore;
582
- _permissions;
583
- get name() {
584
- if (!this._name) throw new Error("Name is not defined");
585
- return this._name ?? "";
586
- }
587
- get isCore() {
588
- return this._isCore ?? false;
589
- }
590
- get permissions() {
591
- if (!this._permissions) throw new Error("Permissions is not defined");
592
- return this._permissions;
593
- }
594
- rehydrate(data) {
595
- super.rehydrate(data);
596
- this._name = data.jsonApi.attributes.name;
597
- this._isCore = data.jsonApi.attributes.isCore;
598
- this._permissions = data.jsonApi.meta.permissions;
599
- return this;
600
- }
601
- };
602
-
603
- // src/features/module/module.module.ts
604
- var ModuleModule = /* @__PURE__ */ __name((factory) => factory({
605
- pageUrl: "/modules",
606
- name: "modules",
607
- model: Module,
608
- moduleId: "25ffd868-8341-4ca7-963b-6e1c56b03b1d"
609
- }), "ModuleModule");
610
-
611
- // src/features/notification/data/notification.ts
612
- var Notification = class extends AbstractApiData {
613
- static {
614
- __name(this, "Notification");
615
- }
616
- _notificationType;
617
- _isRead;
618
- _actor;
619
- get notificationType() {
620
- if (this._notificationType === void 0) throw new Error("notificationType is not set");
621
- return this._notificationType;
622
- }
623
- get isRead() {
624
- return this._isRead === void 0 ? false : this._isRead;
625
- }
626
- get actor() {
627
- return this._actor;
628
- }
629
- rehydrate(data) {
630
- super.rehydrate(data);
631
- this._notificationType = data.jsonApi.attributes.notificationType;
632
- this._isRead = data.jsonApi.attributes.isRead;
633
- this._actor = this._readIncluded(data, "actor", Modules.User);
634
- return this;
635
- }
636
- createJsonApi(data) {
637
- const response = {
638
- data: {
639
- type: Modules.Notification.name,
640
- id: data.id,
641
- attributes: {
642
- isRead: data.isRead
643
- },
644
- meta: {},
645
- relationships: {}
646
- },
647
- included: []
648
- };
649
- return response;
650
- }
651
- };
652
-
653
- // src/features/notification/notification.module.ts
654
- var NotificationModule = /* @__PURE__ */ __name((factory) => factory({
655
- pageUrl: "/notifications",
656
- name: "notifications",
657
- model: Notification,
658
- moduleId: "9259d704-c670-4e77-a3a1-a728ffc5be3d"
659
- }), "NotificationModule");
660
-
661
- // src/features/notification/data/notification.fields.ts
662
- var NotificationFields = /* @__PURE__ */ ((NotificationFields2) => {
663
- NotificationFields2["notificationId"] = "notificationId";
664
- NotificationFields2["name"] = "name";
665
- NotificationFields2["createdAt"] = "createdAt";
666
- NotificationFields2["updatedAt"] = "updatedAt";
667
- return NotificationFields2;
668
- })(NotificationFields || {});
669
-
670
- // src/features/notification/data/notification.service.ts
671
- var NotificationService = class extends AbstractService {
672
- static {
673
- __name(this, "NotificationService");
674
- }
675
- static async findMany(params) {
676
- const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
677
- if (params.isArchived) endpoint.addAdditionalParam("isArchived", "true");
678
- return this.callApi({
679
- type: Modules.Notification,
680
- method: "GET" /* GET */,
681
- endpoint: endpoint.generate(),
682
- next: params.next
683
- });
684
- }
685
- static async markAsRead(params) {
686
- const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
687
- await this.callApi({
688
- type: Modules.Notification,
689
- method: "PATCH" /* PATCH */,
690
- endpoint: endpoint.generate(),
691
- input: params.data,
692
- overridesJsonApiCreation: true
693
- });
694
- }
695
- static async archive(params) {
696
- const endpoint = new EndpointCreator({ endpoint: Modules.Notification, id: params.id, childEndpoint: "archive" });
697
- await this.callApi({ type: Modules.Notification, method: "POST" /* POST */, endpoint: endpoint.generate() });
698
- }
699
- };
700
-
701
- // src/features/push/data/push.ts
702
- var Push = class extends AbstractApiData {
703
- static {
704
- __name(this, "Push");
705
- }
706
- createJsonApi(data) {
707
- const response = {
708
- data: {
709
- type: Modules.Push.name,
710
- attributes: {
711
- key: data.key
712
- }
713
- },
714
- included: []
715
- };
716
- return response;
717
- }
718
- };
719
-
720
- // src/features/push/push.module.ts
721
- var PushModule = /* @__PURE__ */ __name((factory) => factory({
722
- pageUrl: "/push",
723
- name: "push",
724
- model: Push,
725
- moduleId: ""
726
- }), "PushModule");
727
-
728
- // src/features/push/data/push.service.ts
729
- var PushService = class extends AbstractService {
730
- static {
731
- __name(this, "PushService");
732
- }
733
- static async register(params) {
734
- const endpoint = new EndpointCreator({ endpoint: Modules.Push });
735
- await this.callApi({
736
- type: Modules.Push,
737
- method: "POST" /* POST */,
738
- endpoint: endpoint.generate(),
739
- input: params.data,
740
- overridesJsonApiCreation: true
741
- });
742
- }
743
- };
744
-
745
- // src/features/role/data/role.ts
746
- var Role = class extends AbstractApiData {
747
- static {
748
- __name(this, "Role");
749
- }
750
- _name;
751
- _description;
752
- _isSelectable;
753
- _requiredFeature;
754
- get name() {
755
- if (!this._name) throw new Error("Name is not defined");
756
- return this._name;
757
- }
758
- get description() {
759
- return this._description ?? "";
760
- }
761
- get isSelectable() {
762
- return this._isSelectable ?? false;
763
- }
764
- get requiredFeature() {
765
- return this._requiredFeature;
766
- }
767
- rehydrate(data) {
768
- super.rehydrate(data);
769
- this._name = data.jsonApi.attributes.name ?? void 0;
770
- this._description = data.jsonApi.attributes.description ?? void 0;
771
- this._isSelectable = data.jsonApi.attributes.isSelectable ?? void 0;
772
- this._requiredFeature = this._readIncluded(
773
- data,
774
- "requiredFeature",
775
- Modules.Feature
776
- );
777
- return this;
778
- }
779
- createJsonApi(data) {
780
- const response = {
781
- data: {
782
- type: Modules.Role.name,
783
- id: data.id,
784
- attributes: {
785
- name: data.name
786
- },
787
- meta: {}
788
- },
789
- included: []
790
- };
791
- if (data.description !== void 0) response.data.attributes.description = data.description;
792
- return response;
793
- }
794
- };
795
-
796
- // src/features/role/data/role.fields.ts
797
- var RoleFields = /* @__PURE__ */ ((RoleFields2) => {
798
- RoleFields2["roleId"] = "roleId";
799
- RoleFields2["name"] = "name";
800
- RoleFields2["description"] = "description";
801
- RoleFields2["createdAt"] = "createdAt";
802
- RoleFields2["updatedAt"] = "updatedAt";
803
- return RoleFields2;
804
- })(RoleFields || {});
805
-
806
- // src/features/role/data/role.service.ts
807
- var RoleService = class extends AbstractService {
808
- static {
809
- __name(this, "RoleService");
810
- }
811
- static async findById(params) {
812
- return this.callApi({
813
- type: Modules.Role,
814
- method: "GET" /* GET */,
815
- endpoint: new EndpointCreator({ endpoint: Modules.Role, id: params.roleId }).generate()
816
- });
817
- }
818
- static async findAllRoles(params) {
819
- const endpoint = new EndpointCreator({ endpoint: Modules.Role });
820
- if (params.search) endpoint.addAdditionalParam("search", params.search);
821
- return this.callApi({
822
- type: Modules.Role,
823
- method: "GET" /* GET */,
824
- endpoint: endpoint.generate(),
825
- next: params.next
826
- });
827
- }
828
- static async findAllRolesByUser(params) {
829
- const endpoint = new EndpointCreator({ endpoint: Modules.User, id: params.userId, childEndpoint: Modules.Role });
830
- if (params.search) endpoint.addAdditionalParam("search", params.search);
831
- return this.callApi({
832
- type: Modules.Role,
410
+ type: Modules.Role,
833
411
  method: "GET" /* GET */,
834
412
  endpoint: endpoint.generate(),
835
413
  next: params.next
@@ -898,282 +476,24 @@ var RoleService = class extends AbstractService {
898
476
  }
899
477
  };
900
478
 
901
- // src/features/role/role.module.ts
902
- var RoleModule = /* @__PURE__ */ __name((factory) => factory({
903
- pageUrl: "/roles",
904
- name: "roles",
905
- model: Role,
906
- moduleId: "9f6416e6-7b9b-4e1a-a99f-833191eca8a9"
907
- }), "RoleModule");
908
-
909
- // src/features/s3/data/s3.ts
910
- var S3 = class extends AbstractApiData {
911
- static {
912
- __name(this, "S3");
913
- }
914
- _url;
915
- _storageType;
916
- _contentType;
917
- _blobType;
918
- _acl;
919
- get url() {
920
- if (!this._url) throw new Error("Image URL is not set.");
921
- return this._url;
922
- }
923
- get headers() {
924
- const headers = {};
925
- if (this._contentType) {
926
- headers["Content-Type"] = this._contentType;
927
- }
928
- if (this._blobType) {
929
- headers["x-ms-blob-type"] = this._blobType;
930
- }
931
- if (this._acl) {
932
- headers["x-amz-acl"] = this._acl;
933
- }
934
- return headers;
935
- }
936
- rehydrate(data) {
937
- super.rehydrate(data);
938
- this._url = data.jsonApi.attributes.url ?? void 0;
939
- this._storageType = data.jsonApi.attributes.storageType ?? void 0;
940
- this._contentType = data.jsonApi.attributes.contentType ?? void 0;
941
- this._blobType = data.jsonApi.attributes.blobType ?? void 0;
942
- this._acl = data.jsonApi.attributes.acl ?? void 0;
943
- return this;
944
- }
945
- createJsonApi(data) {
946
- const response = {
947
- data: {
948
- type: Modules.S3.name,
949
- attributes: {
950
- key: data.key
951
- }
952
- },
953
- included: []
954
- };
955
- if (data.contentType) response.data.attributes.contentType = data.contentType;
956
- return response;
957
- }
958
- };
959
-
960
- // src/features/s3/s3.module.ts
961
- var S3Module = /* @__PURE__ */ __name((factory) => factory({
962
- pageUrl: "/s3",
963
- name: "s3",
964
- model: S3,
965
- moduleId: "db41ba46-e171-4324-8845-99353eba8568"
966
- }), "S3Module");
967
-
968
- // src/features/s3/data/s3.service.ts
969
- var S3Service = class extends AbstractService {
970
- static {
971
- __name(this, "S3Service");
972
- }
973
- static async getPreSignedUrl(params) {
974
- const endpoint = new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).addAdditionalParam("contentType", params.contentType);
975
- if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
976
- return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
977
- }
978
- static async getSignedUrl(params) {
979
- const endpoint = new EndpointCreator({ endpoint: Modules.S3, id: "sign" }).addAdditionalParam("key", params.key);
980
- if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
981
- return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
982
- }
983
- static async deleteFile(params) {
984
- this.callApi({
985
- type: Modules.S3,
986
- method: "DELETE" /* DELETE */,
987
- endpoint: new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).generate()
988
- });
989
- }
990
- };
991
-
992
- // src/features/user/data/user.ts
993
- var User = class extends AbstractApiData {
994
- static {
995
- __name(this, "User");
996
- }
997
- _name;
998
- _email;
999
- _title;
1000
- _bio;
1001
- _avatar;
1002
- _avatarUrl;
1003
- _phone;
1004
- _rate;
1005
- _isActivated;
1006
- _isDeleted;
1007
- _lastLogin;
1008
- _relevance;
1009
- _roles = [];
1010
- _company;
1011
- _modules = [];
1012
- get searchResult() {
1013
- return this._name ?? "";
1014
- }
1015
- get name() {
1016
- return this._name ?? "";
1017
- }
1018
- get email() {
1019
- return this._email ?? "";
1020
- }
1021
- get title() {
1022
- return this._title ?? "";
1023
- }
1024
- get bio() {
1025
- return this._bio ?? "";
1026
- }
1027
- get avatar() {
1028
- return this._avatar;
1029
- }
1030
- get avatarUrl() {
1031
- return this._avatarUrl;
1032
- }
1033
- get phone() {
1034
- return this._phone;
1035
- }
1036
- get rate() {
1037
- return this._rate;
1038
- }
1039
- get relevance() {
1040
- return this._relevance;
1041
- }
1042
- get isActivated() {
1043
- return this._isActivated ?? false;
1044
- }
1045
- get isDeleted() {
1046
- return this._isDeleted ?? false;
1047
- }
1048
- get lastLogin() {
1049
- return this._lastLogin;
1050
- }
1051
- get roles() {
1052
- return this._roles;
1053
- }
1054
- get company() {
1055
- return this._company;
1056
- }
1057
- get modules() {
1058
- return this._modules;
1059
- }
1060
- rehydrate(data) {
1061
- super.rehydrate(data);
1062
- this._name = data.jsonApi.attributes.name;
1063
- this._email = data.jsonApi.attributes.email;
1064
- this._title = data.jsonApi.attributes.title;
1065
- this._bio = data.jsonApi.attributes.bio;
1066
- this._phone = data.jsonApi.attributes.phone;
1067
- this._rate = data.jsonApi.attributes.rate;
1068
- this._avatar = data.jsonApi.attributes.avatar;
1069
- this._avatarUrl = data.jsonApi.attributes.avatarUrl;
1070
- this._isActivated = data.jsonApi.meta.isActive;
1071
- this._isDeleted = data.jsonApi.meta.isDeleted;
1072
- this._lastLogin = data.jsonApi.meta.lastLogin ? new Date(data.jsonApi.meta.lastLogin) : void 0;
1073
- this._relevance = data.jsonApi.meta.relevance;
1074
- this._roles = this._readIncluded(data, "roles", Modules.Role);
1075
- this._company = this._readIncluded(data, "company", Modules.Company);
1076
- this._modules = this._readIncluded(data, "modules", Modules.Module);
1077
- return this;
1078
- }
1079
- createJsonApi(data) {
1080
- const response = {
1081
- data: {
1082
- type: Modules.User.name,
1083
- id: data.id,
1084
- attributes: {
1085
- name: data.name
1086
- },
1087
- meta: {},
1088
- relationships: {}
1089
- },
1090
- included: []
1091
- };
1092
- if (data.email !== void 0) response.data.attributes.email = data.email;
1093
- if (data.title !== void 0) response.data.attributes.title = data.title;
1094
- if (data.bio !== void 0) response.data.attributes.bio = data.bio;
1095
- if (data.phone !== void 0) response.data.attributes.phone = data.phone;
1096
- if (data.password !== void 0) response.data.attributes.password = data.password;
1097
- if (data.sendInvitationEmail) response.data.attributes.sendInvitationEmail = true;
1098
- if (data.adminCreated) response.data.attributes.adminCreated = true;
1099
- if (data.avatar) response.data.attributes.avatar = data.avatar;
1100
- if (data.rate !== void 0) response.data.attributes.rate = data.rate;
1101
- if (data.roleIds) {
1102
- response.data.relationships.roles = {
1103
- data: data.roleIds.map((roleId) => ({
1104
- type: Modules.Role.name,
1105
- id: roleId
1106
- }))
1107
- };
1108
- }
1109
- if (data.companyId) {
1110
- response.data.relationships.company = {
1111
- data: {
1112
- type: Modules.Company.name,
1113
- id: data.companyId
1114
- }
1115
- };
1116
- }
1117
- return response;
1118
- }
1119
- };
1120
-
1121
- // src/features/user/data/user.fields.ts
1122
- var UserFields = /* @__PURE__ */ ((UserFields2) => {
1123
- UserFields2["userId"] = "userId";
1124
- UserFields2["name"] = "name";
1125
- UserFields2["email"] = "email";
1126
- UserFields2["relevance"] = "relevance";
1127
- UserFields2["createdAt"] = "createdAt";
1128
- UserFields2["updatedAt"] = "updatedAt";
1129
- return UserFields2;
1130
- })(UserFields || {});
1131
-
1132
- // src/features/user/data/user.service.ts
1133
- var UserService = class extends AbstractService {
479
+ // src/features/content/data/content.service.ts
480
+ var ContentService = class extends AbstractService {
1134
481
  static {
1135
- __name(this, "UserService");
1136
- }
1137
- static async findFullUser() {
1138
- const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "me", childEndpoint: "full" });
1139
- return this.callApi({
1140
- type: Modules.User,
1141
- method: "GET" /* GET */,
1142
- endpoint: endpoint.generate()
1143
- });
1144
- }
1145
- static async findById(params) {
1146
- return this.callApi({
1147
- type: Modules.User,
1148
- method: "GET" /* GET */,
1149
- endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
1150
- });
1151
- }
1152
- static async findByEmail(params) {
1153
- const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "email", childEndpoint: params.email });
1154
- return this.callApi({ type: Modules.User, method: "GET" /* GET */, endpoint: endpoint.generate() });
482
+ __name(this, "ContentService");
1155
483
  }
1156
484
  static async findMany(params) {
1157
- const endpoint = new EndpointCreator({ endpoint: Modules.User });
1158
- if (params.roleId) endpoint.addAdditionalParam("roleId", params.roleId);
1159
- if (params.includeDeleted) endpoint.addAdditionalParam("includeDeleted", "true");
1160
- if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
1161
- if (params.search) endpoint.addAdditionalParam("search", params.search);
1162
- return this.callApi({
1163
- type: Modules.User,
1164
- method: "GET" /* GET */,
1165
- endpoint: endpoint.generate(),
1166
- next: params.next
1167
- });
1168
- }
1169
- static async findManyByContentIds(params) {
1170
- const endpoint = new EndpointCreator({ endpoint: Modules.User });
1171
- endpoint.addAdditionalParam("contentIds", params.contentIds.map((id) => id).join(","));
1172
- endpoint.addAdditionalParam("includeDeleted", "true");
1173
- endpoint.addAdditionalParam("fetchAll", "true");
1174
- if (params.search) endpoint.addAdditionalParam("search", params.search);
485
+ const endpoint = new EndpointCreator({ endpoint: Modules.Content });
486
+ if (params.contentIds) {
487
+ endpoint.addAdditionalParam("contentIds", params.contentIds.join(","));
488
+ endpoint.addAdditionalParam("fetchAll", "true");
489
+ } else {
490
+ if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
491
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
492
+ }
493
+ if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
494
+ if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
1175
495
  return this.callApi({
1176
- type: Modules.User,
496
+ type: Modules.Content,
1177
497
  method: "GET" /* GET */,
1178
498
  endpoint: endpoint.generate(),
1179
499
  next: params.next
@@ -1183,193 +503,135 @@ var UserService = class extends AbstractService {
1183
503
  const endpoint = new EndpointCreator({
1184
504
  endpoint: Modules.Content,
1185
505
  id: params.id,
1186
- childEndpoint: "user-relevance"
506
+ childEndpoint: "relevance"
1187
507
  });
1188
- if (Modules.User.inclusions?.lists?.fields) endpoint.limitToFields(Modules.User.inclusions.lists.fields);
1189
- if (Modules.User.inclusions?.lists?.types) endpoint.limitToType(Modules.User.inclusions.lists.types);
508
+ if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
509
+ if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
1190
510
  return this.callApi({
1191
- type: Modules.User,
511
+ type: Modules.Content,
1192
512
  method: "GET" /* GET */,
1193
513
  endpoint: endpoint.generate(),
1194
514
  next: params.next
1195
515
  });
1196
516
  }
1197
- static async findManyForAmin(params) {
1198
- if (!params.companyId) return [];
517
+ static async findManyByAuthor(params) {
1199
518
  const endpoint = new EndpointCreator({
1200
- endpoint: Modules.Company,
1201
- id: params.companyId,
1202
- childEndpoint: Modules.User
519
+ endpoint: Modules.Author,
520
+ id: params.userId,
521
+ childEndpoint: Modules.Content
1203
522
  });
523
+ if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
1204
524
  if (params.search) endpoint.addAdditionalParam("search", params.search);
525
+ if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
526
+ if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
1205
527
  return this.callApi({
1206
- type: Modules.User,
528
+ type: Modules.Content,
1207
529
  method: "GET" /* GET */,
1208
530
  endpoint: endpoint.generate(),
1209
- next: params.next,
1210
- previous: params.prev
531
+ next: params.next
1211
532
  });
1212
533
  }
1213
- static async findAllUsers(params) {
1214
- const endpoint = new EndpointCreator({
1215
- endpoint: Modules.Company,
1216
- id: params.companyId,
1217
- childEndpoint: Modules.User
1218
- });
1219
- if (params.search) endpoint.addAdditionalParam("search", params.search);
1220
- if (params.isDeleted) endpoint.addAdditionalParam("isDeleted", "true");
1221
- if (params.limitToRoles && params.limitToRoles.length > 0)
1222
- endpoint.addAdditionalParam("limitToRoles", params.limitToRoles.join(","));
534
+ };
535
+
536
+ // src/features/notification/data/notification.service.ts
537
+ var NotificationService = class extends AbstractService {
538
+ static {
539
+ __name(this, "NotificationService");
540
+ }
541
+ static async findMany(params) {
542
+ const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
543
+ if (params.isArchived) endpoint.addAdditionalParam("isArchived", "true");
1223
544
  return this.callApi({
1224
- type: Modules.User,
545
+ type: Modules.Notification,
1225
546
  method: "GET" /* GET */,
1226
547
  endpoint: endpoint.generate(),
1227
548
  next: params.next
1228
549
  });
1229
550
  }
1230
- static async findAllUsersByRole(params) {
1231
- const endpoint = new EndpointCreator({ endpoint: Modules.Role, id: params.roleId, childEndpoint: Modules.User });
1232
- if (params.search) endpoint.addAdditionalParam("search", params.search);
1233
- return this.callApi({
1234
- type: Modules.User,
1235
- method: "GET" /* GET */,
551
+ static async markAsRead(params) {
552
+ const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
553
+ await this.callApi({
554
+ type: Modules.Notification,
555
+ method: "PATCH" /* PATCH */,
1236
556
  endpoint: endpoint.generate(),
1237
- next: params.next
557
+ input: params.data,
558
+ overridesJsonApiCreation: true
1238
559
  });
1239
560
  }
1240
- static async findAllUsersNotInRole(params) {
1241
- const endpoint = new EndpointCreator({
1242
- endpoint: Modules.Role,
1243
- id: params.roleId,
1244
- childEndpoint: Modules.User
1245
- }).addAdditionalParam("notInRole", "true");
561
+ static async archive(params) {
562
+ const endpoint = new EndpointCreator({ endpoint: Modules.Notification, id: params.id, childEndpoint: "archive" });
563
+ await this.callApi({ type: Modules.Notification, method: "POST" /* POST */, endpoint: endpoint.generate() });
564
+ }
565
+ };
566
+
567
+ // src/features/feature/data/feature.service.ts
568
+ var FeatureService = class extends AbstractService {
569
+ static {
570
+ __name(this, "FeatureService");
571
+ }
572
+ static async findMany(params) {
573
+ const endpoint = new EndpointCreator({ endpoint: Modules.Feature });
574
+ if (params.companyId) endpoint.endpoint(Modules.Company).id(params.companyId).childEndpoint(Modules.Feature);
1246
575
  if (params.search) endpoint.addAdditionalParam("search", params.search);
1247
576
  return this.callApi({
1248
- type: Modules.User,
577
+ type: Modules.Feature,
1249
578
  method: "GET" /* GET */,
1250
579
  endpoint: endpoint.generate(),
1251
580
  next: params.next
1252
581
  });
1253
582
  }
1254
- static async create(params) {
1255
- return this.callApi({
1256
- type: Modules.User,
1257
- method: "POST" /* POST */,
1258
- endpoint: new EndpointCreator({ endpoint: Modules.User }).generate(),
1259
- companyId: params.companyId,
1260
- input: params
1261
- });
1262
- }
1263
- static async reactivate(params) {
1264
- return this.callApi({
1265
- type: Modules.User,
1266
- method: "PATCH" /* PATCH */,
1267
- endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
1268
- });
583
+ };
584
+
585
+ // src/features/push/data/push.service.ts
586
+ var PushService = class extends AbstractService {
587
+ static {
588
+ __name(this, "PushService");
1269
589
  }
1270
- static async sendInvitation(params) {
1271
- const endpoint = new EndpointCreator({
1272
- endpoint: Modules.User,
1273
- id: params.userId,
1274
- childEndpoint: "send-invitation-email"
1275
- });
1276
- if (params.companyId) endpoint.addAdditionalParam("companyId", params.companyId);
1277
- this.callApi({
1278
- type: Modules.User,
590
+ static async register(params) {
591
+ const endpoint = new EndpointCreator({ endpoint: Modules.Push });
592
+ await this.callApi({
593
+ type: Modules.Push,
1279
594
  method: "POST" /* POST */,
1280
- endpoint: endpoint.generate()
595
+ endpoint: endpoint.generate(),
596
+ input: params.data,
597
+ overridesJsonApiCreation: true
1281
598
  });
1282
599
  }
1283
- static async update(params) {
1284
- return this.callApi({
1285
- type: Modules.User,
1286
- method: "PUT" /* PUT */,
1287
- endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id }).generate(),
1288
- companyId: params.companyId,
1289
- input: params
1290
- });
600
+ };
601
+
602
+ // src/features/s3/data/s3.service.ts
603
+ var S3Service = class extends AbstractService {
604
+ static {
605
+ __name(this, "S3Service");
1291
606
  }
1292
- static async patchRate(params) {
1293
- return this.callApi({
1294
- type: Modules.User,
1295
- method: "PATCH" /* PATCH */,
1296
- endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id, childEndpoint: "rates" }).generate(),
1297
- companyId: params.companyId,
1298
- input: params
1299
- });
607
+ static async getPreSignedUrl(params) {
608
+ const endpoint = new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).addAdditionalParam("contentType", params.contentType);
609
+ if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
610
+ return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
1300
611
  }
1301
- static async delete(params) {
1302
- await this.callApi({
1303
- type: Modules.User,
612
+ static async getSignedUrl(params) {
613
+ const endpoint = new EndpointCreator({ endpoint: Modules.S3, id: "sign" }).addAdditionalParam("key", params.key);
614
+ if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
615
+ return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
616
+ }
617
+ static async deleteFile(params) {
618
+ this.callApi({
619
+ type: Modules.S3,
1304
620
  method: "DELETE" /* DELETE */,
1305
- endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate(),
1306
- companyId: params.companyId
621
+ endpoint: new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).generate()
1307
622
  });
1308
623
  }
1309
624
  };
1310
625
 
1311
- // src/features/user/author.module.ts
1312
- var AuthorModule = /* @__PURE__ */ __name((factory) => factory({
1313
- pageUrl: "/authors",
1314
- name: "authors",
1315
- model: User,
1316
- moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277"
1317
- }), "AuthorModule");
1318
-
1319
- // src/features/user/user.module.ts
1320
- var UserModule = /* @__PURE__ */ __name((factory) => factory({
1321
- pageUrl: "/users",
1322
- name: "users",
1323
- model: User,
1324
- moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277",
1325
- inclusions: {
1326
- lists: {
1327
- fields: [
1328
- createJsonApiInclusion("users", [`name`, `email`, `avatar`, `title`]),
1329
- createJsonApiInclusion("usertopics", [`level`]),
1330
- createJsonApiInclusion("userexpertises", [`level`]),
1331
- createJsonApiInclusion("topics", [`name`])
1332
- ]
1333
- }
1334
- }
1335
- }), "UserModule");
1336
-
1337
626
  export {
1338
- Role,
1339
- RoleFields,
1340
- RoleService,
1341
- RoleModule,
1342
- User,
1343
- UserFields,
627
+ AuthService,
1344
628
  UserService,
1345
- S3,
1346
- S3Module,
1347
- S3Service,
1348
- AuthorModule,
1349
- UserModule,
1350
- Company,
1351
- CompanyFields,
1352
629
  CompanyService,
1353
- Feature,
1354
- FeatureModule,
1355
- FeatureService,
1356
- Notification,
1357
- NotificationFields,
1358
- NotificationService,
1359
- AuthModule,
1360
- Auth,
1361
- AuthService,
1362
- AuthComponent,
1363
- CompanyModule,
1364
- ContentModule,
1365
- Content,
1366
- ContentFields,
630
+ RoleService,
1367
631
  ContentService,
1368
- Module,
1369
- ModuleModule,
1370
- NotificationModule,
1371
- Push,
1372
- PushModule,
1373
- PushService
632
+ NotificationService,
633
+ FeatureService,
634
+ PushService,
635
+ S3Service
1374
636
  };
1375
- //# sourceMappingURL=chunk-HTLEKZND.mjs.map
637
+ //# sourceMappingURL=chunk-37NJZ2VD.mjs.map