@carlonicora/nextjs-jsonapi 1.5.0 → 1.7.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 (278) hide show
  1. package/dist/{ApiResponseInterface-DDI7QQPR.d.ts → ApiResponseInterface-DMwITHYP.d.mts} +11 -2
  2. package/dist/{ApiResponseInterface-BHN5D9r5.d.mts → ApiResponseInterface-DWgIAXI-.d.ts} +11 -2
  3. package/dist/AuthComponent-hxOPs9o8.d.mts +11 -0
  4. package/dist/AuthComponent-hxOPs9o8.d.ts +11 -0
  5. package/dist/{BlockNoteEditor-G6AK2NWA.js → BlockNoteEditor-IJASTIUZ.js} +16 -23
  6. package/dist/BlockNoteEditor-IJASTIUZ.js.map +1 -0
  7. package/dist/{BlockNoteEditor-AIEEQM6A.mjs → BlockNoteEditor-M6TUP3NT.mjs} +8 -15
  8. package/dist/BlockNoteEditor-M6TUP3NT.mjs.map +1 -0
  9. package/dist/JsonApiRequest-2OM5NDAW.js +24 -0
  10. package/dist/JsonApiRequest-2OM5NDAW.js.map +1 -0
  11. package/dist/{JsonApiRequest-6UR7DIAR.mjs → JsonApiRequest-SYZ6FGCA.mjs} +2 -3
  12. package/dist/{chunk-2K3Q24UF.js → chunk-3ZPK4QOB.js} +24 -14
  13. package/dist/chunk-3ZPK4QOB.js.map +1 -0
  14. package/dist/{chunk-VET55IZO.js → chunk-4L7OWJ2P.js} +10290 -7537
  15. package/dist/chunk-4L7OWJ2P.js.map +1 -0
  16. package/dist/chunk-4U5CJA44.mjs +3435 -0
  17. package/dist/chunk-4U5CJA44.mjs.map +1 -0
  18. package/dist/chunk-AGWQ75PQ.js +142 -0
  19. package/dist/chunk-AGWQ75PQ.js.map +1 -0
  20. package/dist/{chunk-PMXG5WBC.js → chunk-CKS6SVUK.js} +160 -24
  21. package/dist/chunk-CKS6SVUK.js.map +1 -0
  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-HR4H2FP7.mjs → chunk-KJ4ETLJB.mjs} +24 -14
  27. package/dist/chunk-KJ4ETLJB.mjs.map +1 -0
  28. package/dist/{chunk-IKBA4AHN.mjs → chunk-SAL7XW2G.mjs} +143 -7
  29. package/dist/chunk-SAL7XW2G.mjs.map +1 -0
  30. package/dist/chunk-TW4QRJ7D.mjs +12085 -0
  31. package/dist/chunk-TW4QRJ7D.mjs.map +1 -0
  32. package/dist/chunk-U4NADAHN.js +3435 -0
  33. package/dist/chunk-U4NADAHN.js.map +1 -0
  34. package/dist/{chunk-EFJEWLRL.js → chunk-YUO55Q5A.js} +1 -1
  35. package/dist/chunk-YUO55Q5A.js.map +1 -0
  36. package/dist/client/index.d.mts +161 -11
  37. package/dist/client/index.d.ts +161 -11
  38. package/dist/client/index.js +71 -11
  39. package/dist/client/index.js.map +1 -1
  40. package/dist/client/index.mjs +70 -10
  41. package/dist/components/index.d.mts +763 -11
  42. package/dist/components/index.d.ts +763 -11
  43. package/dist/components/index.js +462 -11
  44. package/dist/components/index.js.map +1 -1
  45. package/dist/components/index.mjs +463 -12
  46. package/dist/config-BdCV25CE.d.mts +69 -0
  47. package/dist/config-C9dt1QiR.d.ts +69 -0
  48. package/dist/content.fields-Ck5lkQ5d.d.mts +47 -0
  49. package/dist/content.fields-Ck5lkQ5d.d.ts +47 -0
  50. package/dist/{content.interface-CR2aBeAW.d.ts → content.interface-B6qP_ABq.d.mts} +2 -3
  51. package/dist/{content.interface-FpLfsaRm.d.mts → content.interface-DHAFLasV.d.ts} +2 -3
  52. package/dist/contexts/index.d.mts +13 -6
  53. package/dist/contexts/index.d.ts +13 -6
  54. package/dist/contexts/index.js +7 -11
  55. package/dist/contexts/index.js.map +1 -1
  56. package/dist/contexts/index.mjs +6 -10
  57. package/dist/core/index.d.mts +575 -8
  58. package/dist/core/index.d.ts +575 -8
  59. package/dist/core/index.js +131 -3
  60. package/dist/core/index.js.map +1 -1
  61. package/dist/core/index.mjs +132 -4
  62. package/dist/index.d.mts +95 -71
  63. package/dist/index.d.ts +95 -71
  64. package/dist/index.js +113 -7
  65. package/dist/index.js.map +1 -1
  66. package/dist/index.mjs +135 -29
  67. package/dist/notification.interface-agcMYCkg.d.mts +228 -0
  68. package/dist/notification.interface-agcMYCkg.d.ts +228 -0
  69. package/dist/request-GBLBPYFM.js +8 -0
  70. package/dist/request-GBLBPYFM.js.map +1 -0
  71. package/dist/request-XABCMU25.mjs +8 -0
  72. package/dist/s3.service-DYnmymEd.d.mts +350 -0
  73. package/dist/s3.service-DyXjKTqr.d.ts +350 -0
  74. package/dist/server/index.d.mts +69 -4
  75. package/dist/server/index.d.ts +69 -4
  76. package/dist/server/index.js +211 -5
  77. package/dist/server/index.js.map +1 -1
  78. package/dist/server/index.mjs +211 -5
  79. package/dist/server/index.mjs.map +1 -1
  80. package/dist/token-2UWQJY5T.js +8 -0
  81. package/dist/token-2UWQJY5T.js.map +1 -0
  82. package/dist/token-EOK3N45S.mjs +8 -0
  83. package/dist/{useSocket-L-An7_Mr.d.mts → useSocket-91s8M4Xd.d.mts} +1 -1
  84. package/dist/{useSocket-BV6yMdWS.d.ts → useSocket-DSR7vaXj.d.ts} +1 -1
  85. package/package.json +12 -52
  86. package/src/client/JsonApiClient.ts +248 -0
  87. package/src/client/config.ts +78 -0
  88. package/src/client/index.ts +6 -1
  89. package/src/components/containers/TabsContainer.tsx +1 -1
  90. package/src/components/editors/BlockNoteEditor.tsx +3 -1
  91. package/src/components/index.ts +4 -0
  92. package/src/components/navigations/Breadcrumb.tsx +1 -1
  93. package/src/components/navigations/Header.tsx +2 -2
  94. package/src/contexts/CommonContext.tsx +1 -1
  95. package/src/contexts/SocketContext.tsx +1 -1
  96. package/src/contexts/index.ts +3 -0
  97. package/src/core/abstracts/ClientAbstractService.ts +255 -0
  98. package/src/core/abstracts/ServerAbstractService.ts +180 -0
  99. package/src/core/abstracts/index.ts +2 -0
  100. package/src/core/index.ts +35 -3
  101. package/src/discord/config.ts +15 -0
  102. package/src/discord/index.ts +1 -0
  103. package/src/features/auth/components/details/LandingComponent.tsx +2 -2
  104. package/src/features/auth/components/forms/AcceptInvitation.tsx +1 -1
  105. package/src/features/auth/components/forms/ActivateAccount.tsx +1 -1
  106. package/src/features/auth/components/forms/Cookies.tsx +2 -1
  107. package/src/features/auth/components/forms/ForgotPassword.tsx +1 -1
  108. package/src/features/auth/components/forms/Login.tsx +1 -1
  109. package/src/features/auth/components/forms/Logout.tsx +1 -1
  110. package/src/features/auth/components/forms/RefreshUser.tsx +2 -1
  111. package/src/features/auth/components/forms/Register.tsx +1 -1
  112. package/src/features/auth/components/forms/ResetPassword.tsx +1 -1
  113. package/src/features/auth/data/auth.service.ts +1 -1
  114. package/src/features/auth/utils/AuthCookies.ts +1 -1
  115. package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +4 -2
  116. package/src/features/company/components/forms/CompanyDeleter.tsx +2 -1
  117. package/src/features/company/components/forms/CompanyEditor.tsx +6 -3
  118. package/src/features/company/components/forms/CompanyLicense.tsx +4 -2
  119. package/src/features/company/components/lists/CompaniesList.tsx +2 -1
  120. package/src/features/content/components/lists/ContentsListById.tsx +2 -1
  121. package/src/features/content/components/lists/RelevantContentsList.tsx +2 -1
  122. package/src/features/notification/components/lists/NotificationsList.tsx +2 -1
  123. package/src/features/notification/contexts/NotificationContext.tsx +2 -1
  124. package/src/features/role/components/forms/RemoveUserFromRole.tsx +4 -2
  125. package/src/features/role/components/forms/UserRoleAdd.tsx +2 -1
  126. package/src/features/role/components/lists/RolesList.tsx +2 -1
  127. package/src/features/role/components/lists/UserRolesList.tsx +2 -1
  128. package/src/features/user/components/forms/RoleUserAdd.tsx +4 -2
  129. package/src/features/user/components/forms/UserDeleter.tsx +2 -1
  130. package/src/features/user/components/forms/UserEditor.tsx +6 -3
  131. package/src/features/user/components/forms/UserMultiSelect.tsx +2 -1
  132. package/src/features/user/components/forms/UserReactivator.tsx +2 -1
  133. package/src/features/user/components/forms/UserResentInvitationEmail.tsx +2 -1
  134. package/src/features/user/components/forms/UserSelector.tsx +2 -1
  135. package/src/features/user/components/lists/AdminUsersList.tsx +2 -1
  136. package/src/features/user/components/lists/CompanyUsersList.tsx +2 -1
  137. package/src/features/user/components/lists/RelevantUsersList.tsx +2 -1
  138. package/src/features/user/components/lists/RoleUsersList.tsx +2 -1
  139. package/src/features/user/components/lists/UsersListByContentIds.tsx +2 -1
  140. package/src/features/user/hooks/useUserSearch.ts +2 -1
  141. package/src/hooks/useDataListRetriever.ts +4 -4
  142. package/src/hooks/usePageTracker.ts +1 -1
  143. package/src/hooks/usePushNotifications.ts +3 -2
  144. package/src/hooks/useSocket.ts +1 -1
  145. package/src/index.ts +7 -2
  146. package/src/roles/config.ts +0 -15
  147. package/src/roles/index.ts +1 -9
  148. package/src/server/JsonApiServer.ts +249 -0
  149. package/src/server/cache.ts +1 -1
  150. package/src/server/index.ts +13 -0
  151. package/src/server/request.ts +32 -18
  152. package/src/server/token.ts +1 -1
  153. package/dist/AbstractService-BsY6W3Ej.d.mts +0 -109
  154. package/dist/AbstractService-wLid8dB0.d.ts +0 -109
  155. package/dist/ApiData-DPKNfY-9.d.mts +0 -10
  156. package/dist/ApiData-DPKNfY-9.d.ts +0 -10
  157. package/dist/ApiDataInterface-DPP8s46n.d.mts +0 -21
  158. package/dist/ApiDataInterface-DPP8s46n.d.ts +0 -21
  159. package/dist/AuthComponent-B_Ps2Vb9.d.ts +0 -78
  160. package/dist/AuthComponent-CxnGgvoh.d.mts +0 -78
  161. package/dist/BlockNoteEditor-AIEEQM6A.mjs.map +0 -1
  162. package/dist/BlockNoteEditor-G6AK2NWA.js.map +0 -1
  163. package/dist/JsonApiRequest-UJ7FGIVI.js +0 -25
  164. package/dist/JsonApiRequest-UJ7FGIVI.js.map +0 -1
  165. package/dist/atoms/index.d.mts +0 -12
  166. package/dist/atoms/index.d.ts +0 -12
  167. package/dist/atoms/index.js +0 -9
  168. package/dist/atoms/index.js.map +0 -1
  169. package/dist/atoms/index.mjs +0 -9
  170. package/dist/chunk-2K3Q24UF.js.map +0 -1
  171. package/dist/chunk-32HM6MDD.js +0 -98
  172. package/dist/chunk-32HM6MDD.js.map +0 -1
  173. package/dist/chunk-3FBCC4G3.js +0 -8
  174. package/dist/chunk-3FBCC4G3.js.map +0 -1
  175. package/dist/chunk-3UELCPIN.js +0 -46
  176. package/dist/chunk-3UELCPIN.js.map +0 -1
  177. package/dist/chunk-5IET37O4.js +0 -4210
  178. package/dist/chunk-5IET37O4.js.map +0 -1
  179. package/dist/chunk-AGAJMJ4T.js +0 -147
  180. package/dist/chunk-AGAJMJ4T.js.map +0 -1
  181. package/dist/chunk-AYHKQWHH.js +0 -68
  182. package/dist/chunk-AYHKQWHH.js.map +0 -1
  183. package/dist/chunk-DEYKTLA3.js +0 -1131
  184. package/dist/chunk-DEYKTLA3.js.map +0 -1
  185. package/dist/chunk-EFJEWLRL.js.map +0 -1
  186. package/dist/chunk-FMBQZAIP.mjs +0 -490
  187. package/dist/chunk-FMBQZAIP.mjs.map +0 -1
  188. package/dist/chunk-HAG77QBV.mjs +0 -98
  189. package/dist/chunk-HAG77QBV.mjs.map +0 -1
  190. package/dist/chunk-HR4H2FP7.mjs.map +0 -1
  191. package/dist/chunk-IKBA4AHN.mjs.map +0 -1
  192. package/dist/chunk-J7YDGYSW.mjs +0 -9332
  193. package/dist/chunk-J7YDGYSW.mjs.map +0 -1
  194. package/dist/chunk-JGFWIT2E.mjs +0 -1131
  195. package/dist/chunk-JGFWIT2E.mjs.map +0 -1
  196. package/dist/chunk-P2F54I7Q.mjs +0 -4210
  197. package/dist/chunk-P2F54I7Q.mjs.map +0 -1
  198. package/dist/chunk-PMXG5WBC.js.map +0 -1
  199. package/dist/chunk-Q2N6SQYW.mjs +0 -8
  200. package/dist/chunk-Q2N6SQYW.mjs.map +0 -1
  201. package/dist/chunk-Q4FXESVT.js +0 -490
  202. package/dist/chunk-Q4FXESVT.js.map +0 -1
  203. package/dist/chunk-RBIVEH2K.mjs +0 -147
  204. package/dist/chunk-RBIVEH2K.mjs.map +0 -1
  205. package/dist/chunk-SM63SZCP.mjs +0 -68
  206. package/dist/chunk-SM63SZCP.mjs.map +0 -1
  207. package/dist/chunk-SZZYEG3P.mjs +0 -46
  208. package/dist/chunk-SZZYEG3P.mjs.map +0 -1
  209. package/dist/chunk-VET55IZO.js.map +0 -1
  210. package/dist/chunk-YF5XQZDR.mjs.map +0 -1
  211. package/dist/config-BmnK65TD.d.mts +0 -35
  212. package/dist/config-BmnK65TD.d.ts +0 -35
  213. package/dist/config-DQeAo9Kf.d.mts +0 -49
  214. package/dist/config-DQeAo9Kf.d.ts +0 -49
  215. package/dist/content.fields-cHPdM8GJ.d.mts +0 -27
  216. package/dist/content.fields-cHPdM8GJ.d.ts +0 -27
  217. package/dist/d3.link.interface-ClC4Irqp.d.mts +0 -21
  218. package/dist/d3.link.interface-ClC4Irqp.d.ts +0 -21
  219. package/dist/features/index.d.mts +0 -477
  220. package/dist/features/index.d.ts +0 -477
  221. package/dist/features/index.js +0 -108
  222. package/dist/features/index.js.map +0 -1
  223. package/dist/features/index.mjs +0 -108
  224. package/dist/hooks/index.d.mts +0 -69
  225. package/dist/hooks/index.d.ts +0 -69
  226. package/dist/hooks/index.js +0 -55
  227. package/dist/hooks/index.js.map +0 -1
  228. package/dist/hooks/index.mjs +0 -55
  229. package/dist/hooks/index.mjs.map +0 -1
  230. package/dist/interfaces/index.d.mts +0 -4
  231. package/dist/interfaces/index.d.ts +0 -4
  232. package/dist/interfaces/index.js +0 -2
  233. package/dist/interfaces/index.js.map +0 -1
  234. package/dist/interfaces/index.mjs +0 -2
  235. package/dist/interfaces/index.mjs.map +0 -1
  236. package/dist/notification.interface-B2BrLoDA.d.mts +0 -14
  237. package/dist/notification.interface-DlZLnAfg.d.ts +0 -14
  238. package/dist/permissions/index.d.mts +0 -41
  239. package/dist/permissions/index.d.ts +0 -41
  240. package/dist/permissions/index.js +0 -14
  241. package/dist/permissions/index.js.map +0 -1
  242. package/dist/permissions/index.mjs +0 -14
  243. package/dist/permissions/index.mjs.map +0 -1
  244. package/dist/request-7FE3LJLV.mjs +0 -9
  245. package/dist/request-7FE3LJLV.mjs.map +0 -1
  246. package/dist/request-QFS7NEIE.js +0 -9
  247. package/dist/request-QFS7NEIE.js.map +0 -1
  248. package/dist/roles/index.d.mts +0 -39
  249. package/dist/roles/index.d.ts +0 -39
  250. package/dist/roles/index.js +0 -18
  251. package/dist/roles/index.js.map +0 -1
  252. package/dist/roles/index.mjs +0 -18
  253. package/dist/roles/index.mjs.map +0 -1
  254. package/dist/shadcnui/index.d.mts +0 -698
  255. package/dist/shadcnui/index.d.ts +0 -698
  256. package/dist/shadcnui/index.js +0 -468
  257. package/dist/shadcnui/index.js.map +0 -1
  258. package/dist/shadcnui/index.mjs +0 -467
  259. package/dist/shadcnui/index.mjs.map +0 -1
  260. package/dist/token-IJSPOMW6.mjs +0 -9
  261. package/dist/token-IJSPOMW6.mjs.map +0 -1
  262. package/dist/token-UYE7CV6X.js +0 -9
  263. package/dist/token-UYE7CV6X.js.map +0 -1
  264. package/dist/types-B2QRyqyK.d.ts +0 -39
  265. package/dist/types-CgvNmxTd.d.mts +0 -39
  266. package/dist/types-t2PyXhDu.d.mts +0 -116
  267. package/dist/types-t2PyXhDu.d.ts +0 -116
  268. package/dist/user.interface-CooB1R79.d.mts +0 -85
  269. package/dist/user.interface-KnIT9pVY.d.ts +0 -85
  270. package/dist/utils/index.d.mts +0 -224
  271. package/dist/utils/index.d.ts +0 -224
  272. package/dist/utils/index.js +0 -46
  273. package/dist/utils/index.js.map +0 -1
  274. package/dist/utils/index.mjs +0 -46
  275. package/dist/utils/index.mjs.map +0 -1
  276. /package/dist/{JsonApiRequest-6UR7DIAR.mjs.map → JsonApiRequest-SYZ6FGCA.mjs.map} +0 -0
  277. /package/dist/{atoms/index.mjs.map → request-XABCMU25.mjs.map} +0 -0
  278. /package/dist/{features/index.mjs.map → token-EOK3N45S.mjs.map} +0 -0
@@ -1,10 +1,128 @@
1
- import { A as ApiData } from '../ApiData-DPKNfY-9.js';
2
- import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from '../ApiDataInterface-DPP8s46n.js';
3
- import { A as ApiRequestDataTypeInterface, M as ModuleWithPermissions, F as FieldSelector } from '../types-t2PyXhDu.js';
4
- export { G as GetterKeys, c as createJsonApiInclusion } from '../types-t2PyXhDu.js';
5
- import { A as ApiResponseInterface } from '../ApiResponseInterface-DDI7QQPR.js';
6
- export { A as AbstractApiData, a as AbstractService, H as HttpMethod, N as NextRef, P as PreviousRef, S as SelfRef, g as getGlobalErrorHandler, s as setGlobalErrorHandler } from '../AbstractService-wLid8dB0.js';
7
- import 'lucide-react';
1
+ import { A as ApiData, a as ApiResponseInterface } from '../ApiResponseInterface-DWgIAXI-.js';
2
+ import { A as ApiDataInterface, J as JsonApiHydratedDataInterface, a as ApiRequestDataTypeInterface, M as ModuleWithPermissions, F as FieldSelector, i as PermissionUser, b as Action, h as PermissionModule, j as ModuleFactory, m as ModuleInterface, l as FeatureInterface, o as RoleInterface, R as RoleInput, k as CompanyInterface, C as CompanyInput, U as UserInterface, p as UserInput, N as NotificationInterface, n as NotificationInput } from '../notification.interface-agcMYCkg.js';
3
+ export { G as GetterKeys, f as ModuleDefinition, e as ModulePermissionDefinition, d as PageUrl, P as PermissionCheck, g as PermissionConfig, c as createJsonApiInclusion } from '../notification.interface-agcMYCkg.js';
4
+ import { c as AuthInterface, a as AuthInput, j as S3Interface, i as S3Input } from '../s3.service-DyXjKTqr.js';
5
+ export { A as AbstractService, b as AuthQuery, d as AuthService, C as CompanyService, e as ContentService, F as FeatureService, H as HttpMethod, N as NextRef, f as NotificationService, P as PreviousRef, h as PushService, R as RoleService, k as S3Service, S as SelfRef, U as UserService, g as getGlobalErrorHandler, s as setGlobalErrorHandler } from '../s3.service-DyXjKTqr.js';
6
+ export { B as BreadcrumbItemData } from '../breadcrumb.item.data.interface-CgB4_1EE.js';
7
+ export { C as ContentFields, D as D3Link, a as D3Node, R as RoleFields, U as UserFields } from '../content.fields-Ck5lkQ5d.js';
8
+ import { ClassValue } from 'clsx';
9
+ export { ClassValue } from 'clsx';
10
+ import * as React from 'react';
11
+ import { ReactElement, ReactNode } from 'react';
12
+ import { z } from 'zod';
13
+ import { PartialBlock } from '@blocknote/core';
14
+ import { LucideIcon } from 'lucide-react';
15
+ export { A as AuthComponent } from '../AuthComponent-hxOPs9o8.js';
16
+ import { a as ContentInterface, C as ContentInput } from '../content.interface-DHAFLasV.js';
17
+ import 'd3';
18
+
19
+ declare abstract class AbstractApiData implements ApiDataInterface {
20
+ protected _jsonApi?: any;
21
+ protected _included?: any[];
22
+ protected _id?: string;
23
+ protected _type?: string;
24
+ protected _createdAt?: Date;
25
+ protected _updatedAt?: Date;
26
+ protected _self?: string;
27
+ get type(): string;
28
+ get id(): string;
29
+ get self(): string | undefined;
30
+ get createdAt(): Date;
31
+ get updatedAt(): Date;
32
+ get included(): any[];
33
+ get jsonApi(): any;
34
+ ingestJsonApi(_data: JsonApiHydratedDataInterface): void;
35
+ generateApiUrl(_params?: any): string;
36
+ createJsonApi(_data?: any): any;
37
+ protected _readIncluded<T extends ApiDataInterface>(data: JsonApiHydratedDataInterface, type: string, dataType: ApiRequestDataTypeInterface): T | T[] | undefined;
38
+ dehydrate(): JsonApiHydratedDataInterface;
39
+ rehydrate(data: JsonApiHydratedDataInterface): this;
40
+ }
41
+
42
+ declare enum ClientHttpMethod {
43
+ GET = "GET",
44
+ POST = "POST",
45
+ PUT = "PUT",
46
+ PATCH = "PATCH",
47
+ DELETE = "DELETE"
48
+ }
49
+ interface ClientNextRef {
50
+ next?: string;
51
+ }
52
+ interface ClientPreviousRef {
53
+ previous?: string;
54
+ }
55
+ interface ClientSelfRef {
56
+ self?: string;
57
+ }
58
+ /**
59
+ * Set a global error handler for API errors (client-side only).
60
+ * This handler will be called instead of throwing errors.
61
+ */
62
+ declare function setClientGlobalErrorHandler(handler: (status: number, message: string) => void): void;
63
+ /**
64
+ * Get the current global error handler.
65
+ */
66
+ declare function getClientGlobalErrorHandler(): ((status: number, message: string) => void) | null;
67
+ /**
68
+ * Client-side abstract base class for services that interact with the JSON:API.
69
+ * Use this for client components.
70
+ */
71
+ declare abstract class ClientAbstractService {
72
+ /**
73
+ * Extract locale from client-side URL pathname
74
+ * URL structure: /{locale}/route-path (e.g., /it/accounts)
75
+ * Fallback chain: URL locale → navigator.language → "en"
76
+ */
77
+ private static getClientLocale;
78
+ /**
79
+ * Fetch the next page of results.
80
+ */
81
+ static next<T>(params: {
82
+ type: ApiRequestDataTypeInterface;
83
+ endpoint: string;
84
+ next?: ClientNextRef;
85
+ previous?: ClientPreviousRef;
86
+ self?: ClientSelfRef;
87
+ }): Promise<T>;
88
+ /**
89
+ * Fetch the previous page of results.
90
+ */
91
+ static previous<T>(params: {
92
+ type: ApiRequestDataTypeInterface;
93
+ endpoint: string;
94
+ next?: ClientNextRef;
95
+ previous?: ClientPreviousRef;
96
+ self?: ClientSelfRef;
97
+ }): Promise<T>;
98
+ /**
99
+ * Make a client-side API call.
100
+ */
101
+ protected static callApi<T>(params: {
102
+ type: ApiRequestDataTypeInterface;
103
+ method: ClientHttpMethod;
104
+ endpoint: string;
105
+ companyId?: string;
106
+ input?: any;
107
+ overridesJsonApiCreation?: boolean;
108
+ next?: ClientNextRef;
109
+ previous?: ClientPreviousRef;
110
+ self?: ClientSelfRef;
111
+ responseType?: ApiRequestDataTypeInterface;
112
+ files?: {
113
+ [key: string]: File | Blob;
114
+ } | File | Blob;
115
+ }): Promise<T>;
116
+ /**
117
+ * Get raw JSON:API response data without deserialization.
118
+ */
119
+ protected static getRawData(params: {
120
+ type: ApiRequestDataTypeInterface;
121
+ method: ClientHttpMethod;
122
+ endpoint: string;
123
+ companyId?: string;
124
+ }): Promise<any>;
125
+ }
8
126
 
9
127
  declare class JsonApiDataFactory {
10
128
  static create(classKey: ApiRequestDataTypeInterface, data: any): any;
@@ -151,4 +269,453 @@ declare function rehydrate<T extends ApiDataInterface>(classKey: ApiRequestDataT
151
269
  */
152
270
  declare function rehydrateList<T extends ApiDataInterface>(classKey: ApiRequestDataTypeInterface, data: JsonApiHydratedDataInterface[]): T[];
153
271
 
154
- export { ApiData, ApiDataInterface, ApiRequestDataTypeInterface, ApiResponseInterface, type AppModuleDefinitions, DataClassRegistry as DataClass, DataClassRegistry, EndpointCreator, type EndpointQuery, FieldSelector, type FoundationModuleDefinitions, JsonApiDataFactory, JsonApiHydratedDataInterface, type ModuleDefinitions, ModuleRegistrar, ModuleRegistry, Modules, RehydrationFactory, rehydrate, rehydrateList, translateData, translateResponse };
272
+ declare function cn(...inputs: ClassValue[]): string;
273
+
274
+ type PossibleRef<T> = React.Ref<T> | undefined;
275
+ /**
276
+ * A utility to compose multiple refs together
277
+ * Accepts callback refs and RefObject(s)
278
+ */
279
+ declare function composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
280
+ /**
281
+ * A custom hook that composes multiple refs
282
+ * Accepts callback refs and RefObject(s)
283
+ */
284
+ declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
285
+
286
+ declare function useIsMobile(): boolean;
287
+
288
+ type FormatOption = "date" | "time" | "dateTime" | "timeSince" | "default";
289
+ declare const formatDate: (eventDate: Date, formatOption: FormatOption) => string;
290
+
291
+ declare const exists: <T>(itemOrArray: T | T[] | null | undefined) => boolean;
292
+
293
+ /**
294
+ * Check if a user has permission to perform an action on a module.
295
+ *
296
+ * @param module - The module to check permissions for
297
+ * @param action - The action to check (read, create, update, delete)
298
+ * @param user - The user with their modules and permissions
299
+ * @param data - Optional data object for path-based permission checks
300
+ */
301
+ declare function checkPermissions<T extends PermissionUser>(params: {
302
+ module: ModuleWithPermissions;
303
+ action: Action;
304
+ user: T;
305
+ data?: any;
306
+ }): boolean;
307
+ /**
308
+ * Check permissions from server context where user object is not fully available.
309
+ *
310
+ * @param module - The module to check permissions for
311
+ * @param action - The action to check
312
+ * @param userId - The user's ID
313
+ * @param selectedModule - The selected module with its permissions
314
+ * @param data - Optional data object for path-based permission checks
315
+ */
316
+ declare function checkPermissionsFromServer(params: {
317
+ module: ModuleWithPermissions;
318
+ action: Action;
319
+ userId: string;
320
+ selectedModule?: PermissionModule;
321
+ data?: any;
322
+ }): boolean;
323
+ /**
324
+ * Traverse an object path and check if the value matches the user ID.
325
+ * Handles nested objects, arrays, and various data structures.
326
+ */
327
+ declare function getValueFromPath(obj: any, path: string, userId: string): any;
328
+
329
+ declare class TableOptions {
330
+ private _components;
331
+ private _hasPermissionToModule;
332
+ constructor(hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
333
+ module: M;
334
+ action: Action;
335
+ data?: any;
336
+ }) => boolean);
337
+ addOption<M extends ModuleWithPermissions>(component: ReactElement<any> | null, module?: M, action?: Action): void;
338
+ getComponents(): ReactElement<any>[];
339
+ getOptions(): ReactElement<any> | null;
340
+ }
341
+ declare function getTableOptions(params: {
342
+ hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
343
+ module: M;
344
+ action: Action;
345
+ data?: any;
346
+ }) => boolean;
347
+ options: {
348
+ component: ReactElement<any> | null;
349
+ module?: ModuleWithPermissions;
350
+ action?: Action;
351
+ }[];
352
+ }): ReactElement<any> | null;
353
+ declare function getTableComponents(params: {
354
+ hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
355
+ module: M;
356
+ action: Action;
357
+ data?: any;
358
+ }) => boolean;
359
+ options: {
360
+ component: ReactElement<any> | null;
361
+ module?: ModuleWithPermissions;
362
+ action?: Action;
363
+ }[];
364
+ }): ReactElement<any>[];
365
+
366
+ declare const userObjectSchema: z.ZodObject<{
367
+ id: z.ZodString;
368
+ name: z.ZodString;
369
+ avatar: z.ZodOptional<z.ZodString>;
370
+ }, z.core.$strip>;
371
+ type UserObject = z.infer<typeof userObjectSchema>;
372
+
373
+ declare const entityObjectSchema: z.ZodObject<{
374
+ id: z.ZodUUID;
375
+ name: z.ZodString;
376
+ }, z.core.$strip>;
377
+ type EntityObject = z.infer<typeof entityObjectSchema>;
378
+
379
+ interface WordDiff {
380
+ type: "added" | "removed" | "unchanged";
381
+ text: string;
382
+ diffId: string;
383
+ accepted?: boolean;
384
+ rejected?: boolean;
385
+ }
386
+ interface DiffBlock {
387
+ id?: string;
388
+ type?: string;
389
+ props?: any;
390
+ content?: any;
391
+ children?: DiffBlock[];
392
+ diffType?: "added" | "removed" | "modified" | "unchanged";
393
+ originalContent?: any;
394
+ diffId?: string;
395
+ wordDiffs?: WordDiff[];
396
+ accepted?: boolean;
397
+ rejected?: boolean;
398
+ }
399
+ interface DiffResult {
400
+ blocks: DiffBlock[];
401
+ hasChanges: boolean;
402
+ }
403
+ interface BlockDiffOptions {
404
+ ignoreIds?: boolean;
405
+ compareContent?: boolean;
406
+ similarityThreshold?: number;
407
+ }
408
+ /**
409
+ * BlockNote Diff Utility
410
+ * Implements a sophisticated diff algorithm for BlockNote document structures
411
+ */
412
+ declare class BlockNoteDiffUtil {
413
+ private static readonly DEFAULT_OPTIONS;
414
+ /**
415
+ * Compare two BlockNote documents and return diff result
416
+ */
417
+ static diff(originalBlocks?: PartialBlock[], newBlocks?: PartialBlock[], options?: BlockDiffOptions): DiffResult;
418
+ /**
419
+ * Compare two blocks for equality
420
+ */
421
+ private static areBlocksEqual;
422
+ /**
423
+ * Deep equality comparison for objects
424
+ */
425
+ private static deepEqual;
426
+ /**
427
+ * Sort diff blocks to maintain logical order
428
+ */
429
+ private static sortDiffBlocks;
430
+ /**
431
+ * Calculate similarity between two text contents
432
+ */
433
+ private static calculateSimilarity;
434
+ /**
435
+ * Extract plain text from BlockNote content array
436
+ */
437
+ private static extractTextFromContent;
438
+ /**
439
+ * Calculate Levenshtein distance between two strings
440
+ */
441
+ private static levenshteinDistance;
442
+ /**
443
+ * Generate word-level diffs between two content arrays
444
+ */
445
+ static generateWordDiffs(originalContent: any, newContent: any, blockId: string): WordDiff[];
446
+ /**
447
+ * Perform word-level diff using word-only approach (no space tokenization)
448
+ */
449
+ private static diffWords; /**
450
+ * Improved diff algorithm that better handles word insertions
451
+ * Uses a combination of LCS and heuristics to minimize false changes
452
+ */
453
+ private static myersDiff;
454
+ /**
455
+ * Compute edit script using dynamic programming
456
+ */
457
+ private static computeEditScript;
458
+ /**
459
+ * Reconstruct the actual diff from the DP table
460
+ */
461
+ private static reconstructDiff;
462
+ /**
463
+ * Consolidate adjacent changes to reduce fragmentation
464
+ * e.g., if we have: delete "Key", insert "Key!", delete "Challenges"
465
+ * We can consolidate this into: replace ["Key", "Challenges"] with ["Key!"]
466
+ */
467
+ private static consolidateAdjacentChanges;
468
+ /**
469
+ * Determine if a sequence of changes should be consolidated
470
+ */
471
+ private static shouldConsolidateChanges;
472
+ /**
473
+ * Check if two words are similar enough to be considered a replacement
474
+ */
475
+ private static areWordsSimilar;
476
+ }
477
+
478
+ declare class BlockNoteWordDiffRendererUtil {
479
+ static renderWordDiffs(diffBlocks: DiffBlock[], onAcceptChange?: (diffId: string) => void, onRejectChange?: (diffId: string) => void, acceptedChanges?: Set<string>, rejectedChanges?: Set<string>): PartialBlock[];
480
+ private static updateWordDiffStates;
481
+ private static renderDiffBlock;
482
+ private static renderBlockLevelDiff;
483
+ private static renderWordLevelDiff;
484
+ private static groupAndRenderWordDiffs;
485
+ private static cleanupSpaces;
486
+ private static isLastDiffInGroup;
487
+ private static createTextContent;
488
+ private static getBlockProps;
489
+ static generateChangeSummary(diffBlocks: DiffBlock[]): {
490
+ totalWords: number;
491
+ addedWords: number;
492
+ removedWords: number;
493
+ acceptedChanges: number;
494
+ rejectedChanges: number;
495
+ pendingChanges: number;
496
+ };
497
+ }
498
+
499
+ declare const getIconByModule: (params: {
500
+ module: ModuleWithPermissions;
501
+ className?: string;
502
+ }) => ReactNode;
503
+ declare const getIcon: (params: {
504
+ element: ApiDataInterface;
505
+ className?: string;
506
+ }) => ReactNode;
507
+ declare const getIconByModuleName: (params: {
508
+ name: string;
509
+ className?: string;
510
+ }) => ReactNode;
511
+ declare const getLucideIcon: (params: {
512
+ element: ApiDataInterface;
513
+ }) => LucideIcon | null;
514
+ declare const getLucideIconByModule: (params: {
515
+ module: ModuleWithPermissions;
516
+ }) => LucideIcon | null;
517
+ declare const getLucideIconByModuleName: (params: {
518
+ name: string;
519
+ }) => LucideIcon | null;
520
+
521
+ declare const ModuleModule: (factory: ModuleFactory) => ModuleWithPermissions;
522
+
523
+ declare class Module extends AbstractApiData implements ModuleInterface {
524
+ private _name?;
525
+ private _isCore?;
526
+ private _permissions?;
527
+ get name(): string;
528
+ get isCore(): boolean;
529
+ get permissions(): {
530
+ create: boolean | string;
531
+ read: boolean | string;
532
+ update: boolean | string;
533
+ delete: boolean | string;
534
+ };
535
+ rehydrate(data: JsonApiHydratedDataInterface): this;
536
+ }
537
+
538
+ declare const FeatureModule: (factory: ModuleFactory) => ModuleWithPermissions;
539
+
540
+ declare class Feature extends AbstractApiData implements FeatureInterface {
541
+ private _name?;
542
+ private _isProduction?;
543
+ private _modules;
544
+ get name(): string;
545
+ get isProduction(): boolean;
546
+ get modules(): ModuleInterface[];
547
+ rehydrate(data: JsonApiHydratedDataInterface): this;
548
+ }
549
+
550
+ declare const AuthorModule: (factory: ModuleFactory) => ModuleWithPermissions;
551
+
552
+ declare class Role extends AbstractApiData implements RoleInterface {
553
+ private _name?;
554
+ private _description?;
555
+ private _isSelectable?;
556
+ private _requiredFeature?;
557
+ get name(): string;
558
+ get description(): string;
559
+ get isSelectable(): boolean;
560
+ get requiredFeature(): FeatureInterface | undefined;
561
+ rehydrate(data: JsonApiHydratedDataInterface): this;
562
+ createJsonApi(data: RoleInput): any;
563
+ }
564
+
565
+ declare const RoleModule: (factory: ModuleFactory) => ModuleWithPermissions;
566
+
567
+ declare const CompanyModule: (factory: ModuleFactory) => ModuleWithPermissions;
568
+
569
+ declare class Company extends AbstractApiData implements CompanyInterface {
570
+ private _name?;
571
+ private _logo?;
572
+ private _logoUrl?;
573
+ private _configurations?;
574
+ private _licenseExpirationDate?;
575
+ private _features?;
576
+ private _modules?;
577
+ get name(): string;
578
+ get logo(): string | undefined;
579
+ get logoUrl(): string | undefined;
580
+ get licenseExpirationDate(): Date | undefined;
581
+ get features(): FeatureInterface[];
582
+ get modules(): ModuleInterface[];
583
+ get configurations(): any | undefined;
584
+ rehydrate(data: JsonApiHydratedDataInterface): this;
585
+ createJsonApi(data: CompanyInput): any;
586
+ }
587
+
588
+ declare enum CompanyFields {
589
+ companyId = "companyId",
590
+ name = "name",
591
+ createdAt = "createdAt",
592
+ updatedAt = "updatedAt"
593
+ }
594
+
595
+ interface SearchResultInterface {
596
+ get searchResult(): string;
597
+ }
598
+
599
+ declare class User extends AbstractApiData implements UserInterface, SearchResultInterface {
600
+ private _name?;
601
+ private _email?;
602
+ private _title?;
603
+ private _bio?;
604
+ private _avatar?;
605
+ private _avatarUrl?;
606
+ private _phone?;
607
+ private _rate?;
608
+ private _isActivated?;
609
+ private _isDeleted?;
610
+ private _lastLogin?;
611
+ private _relevance?;
612
+ private _roles;
613
+ private _company?;
614
+ private _modules;
615
+ get searchResult(): string;
616
+ get name(): string;
617
+ get email(): string;
618
+ get title(): string;
619
+ get bio(): string;
620
+ get avatar(): string | undefined;
621
+ get avatarUrl(): string | undefined;
622
+ get phone(): string | undefined;
623
+ get rate(): number | undefined;
624
+ get relevance(): number | undefined;
625
+ get isActivated(): boolean;
626
+ get isDeleted(): boolean;
627
+ get lastLogin(): Date | undefined;
628
+ get roles(): RoleInterface[];
629
+ get company(): CompanyInterface | undefined;
630
+ get modules(): ModuleInterface[];
631
+ rehydrate(data: JsonApiHydratedDataInterface): this;
632
+ createJsonApi(data: UserInput): any;
633
+ }
634
+
635
+ declare const UserModule: (factory: ModuleFactory) => ModuleWithPermissions;
636
+
637
+ declare class Auth extends AbstractApiData implements AuthInterface {
638
+ private _token?;
639
+ private _refreshToken?;
640
+ private _user?;
641
+ get token(): string;
642
+ get refreshToken(): string;
643
+ get user(): UserInterface;
644
+ rehydrate(data: JsonApiHydratedDataInterface): this;
645
+ createJsonApi(data: AuthInput): any;
646
+ }
647
+
648
+ declare const AuthModule: (factory: ModuleFactory) => ModuleWithPermissions;
649
+
650
+ declare class Content extends AbstractApiData implements ContentInterface, SearchResultInterface {
651
+ private _contentType?;
652
+ private _name?;
653
+ private _abstract?;
654
+ private _tldr?;
655
+ private _aiStatus?;
656
+ private _relevance?;
657
+ private _author?;
658
+ private _editors?;
659
+ get searchResult(): string;
660
+ get contentType(): string | undefined;
661
+ get name(): string;
662
+ get abstract(): string | undefined;
663
+ get tldr(): string | undefined;
664
+ get aiStatus(): string;
665
+ get relevance(): number | undefined;
666
+ get author(): UserInterface;
667
+ get editors(): UserInterface[];
668
+ rehydrate(data: JsonApiHydratedDataInterface): this;
669
+ protected addContentInput(response: any, data: ContentInput): void;
670
+ }
671
+
672
+ declare const ContentModule: (factory: ModuleFactory) => ModuleWithPermissions;
673
+
674
+ declare class Notification extends AbstractApiData implements NotificationInterface {
675
+ private _notificationType?;
676
+ private _isRead?;
677
+ private _actor?;
678
+ get notificationType(): string;
679
+ get isRead(): boolean;
680
+ get actor(): UserInterface | undefined;
681
+ rehydrate(data: JsonApiHydratedDataInterface): this;
682
+ createJsonApi(data: NotificationInput): any;
683
+ }
684
+
685
+ declare enum NotificationFields {
686
+ notificationId = "notificationId",
687
+ name = "name",
688
+ createdAt = "createdAt",
689
+ updatedAt = "updatedAt"
690
+ }
691
+
692
+ declare const NotificationModule: (factory: ModuleFactory) => ModuleWithPermissions;
693
+
694
+ type PushInput = {
695
+ key: string;
696
+ contentType?: string;
697
+ };
698
+ interface PushInterface extends ApiDataInterface {
699
+ }
700
+
701
+ declare class Push extends AbstractApiData implements PushInterface {
702
+ createJsonApi(data: PushInput): any;
703
+ }
704
+
705
+ declare const PushModule: (factory: ModuleFactory) => ModuleWithPermissions;
706
+
707
+ declare const S3Module: (factory: ModuleFactory) => ModuleWithPermissions;
708
+
709
+ declare class S3 extends AbstractApiData implements S3Interface {
710
+ private _url?;
711
+ private _storageType?;
712
+ private _contentType?;
713
+ private _blobType?;
714
+ private _acl?;
715
+ get url(): string;
716
+ get headers(): Record<string, string>;
717
+ rehydrate(data: JsonApiHydratedDataInterface): this;
718
+ createJsonApi(data: S3Input): any;
719
+ }
720
+
721
+ export { AbstractApiData, Action, ApiData, ApiDataInterface, ApiRequestDataTypeInterface, ApiResponseInterface, type AppModuleDefinitions, Auth, AuthInput, AuthInterface, AuthModule, AuthorModule, type BlockDiffOptions, BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, ClientAbstractService, ClientHttpMethod, type ClientNextRef, type ClientPreviousRef, type ClientSelfRef, Company, CompanyFields, CompanyInput, CompanyInterface, CompanyModule, Content, ContentInput, ContentInterface, ContentModule, DataClassRegistry as DataClass, DataClassRegistry, type DiffBlock, type DiffResult, EndpointCreator, type EndpointQuery, type EntityObject, Feature, FeatureInterface, FeatureModule, FieldSelector, type FormatOption, type FoundationModuleDefinitions, JsonApiDataFactory, JsonApiHydratedDataInterface, Module, type ModuleDefinitions, ModuleFactory, ModuleInterface, ModuleModule, ModuleRegistrar, ModuleRegistry, ModuleWithPermissions, Modules, Notification, NotificationFields, NotificationInput, NotificationInterface, NotificationModule, PermissionModule, PermissionUser, Push, type PushInput, type PushInterface, PushModule, RehydrationFactory, Role, RoleInput, RoleInterface, RoleModule, S3, S3Input, S3Interface, S3Module, type SearchResultInterface, TableOptions, User, UserInput, UserInterface, UserModule, type UserObject, type WordDiff, checkPermissions, checkPermissionsFromServer, cn, composeRefs, entityObjectSchema, exists, formatDate, getClientGlobalErrorHandler, getIcon, getIconByModule, getIconByModuleName, getLucideIcon, getLucideIconByModule, getLucideIconByModuleName, getTableComponents, getTableOptions, getValueFromPath, rehydrate, rehydrateList, setClientGlobalErrorHandler, translateData, translateResponse, useComposedRefs, useIsMobile, userObjectSchema };