@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.
- package/README.md +208 -127
- package/dist/{ApiResponseInterface-DDI7QQPR.d.ts → ApiResponseInterface-CfcC7pPC.d.mts} +11 -2
- package/dist/{ApiResponseInterface-BHN5D9r5.d.mts → ApiResponseInterface-DTBJaV5R.d.ts} +11 -2
- package/dist/{BlockNoteEditor-QV6ESIQA.js → BlockNoteEditor-7FM7B737.js} +19 -24
- package/dist/BlockNoteEditor-7FM7B737.js.map +1 -0
- package/dist/{BlockNoteEditor-U2IHUVUF.mjs → BlockNoteEditor-RVL76ZAS.mjs} +11 -16
- package/dist/BlockNoteEditor-RVL76ZAS.mjs.map +1 -0
- package/dist/JsonApiRequest-KOKGVPBI.js +25 -0
- package/dist/{JsonApiRequest-UJ7FGIVI.js.map → JsonApiRequest-KOKGVPBI.js.map} +1 -1
- package/dist/{JsonApiRequest-6UR7DIAR.mjs → JsonApiRequest-VCCRO732.mjs} +2 -2
- package/dist/chunk-2Z56AS2S.js +2723 -0
- package/dist/chunk-2Z56AS2S.js.map +1 -0
- package/dist/{chunk-HTLEKZND.mjs → chunk-37NJZ2VD.mjs} +281 -1019
- package/dist/chunk-37NJZ2VD.mjs.map +1 -0
- package/dist/{chunk-2K3Q24UF.js → chunk-3ZPK4QOB.js} +24 -14
- package/dist/chunk-3ZPK4QOB.js.map +1 -0
- package/dist/chunk-AGWQ75PQ.js +142 -0
- package/dist/chunk-AGWQ75PQ.js.map +1 -0
- package/dist/{chunk-32HM6MDD.js → chunk-CSM6AIAP.js} +1 -1
- package/dist/{chunk-32HM6MDD.js.map → chunk-CSM6AIAP.js.map} +1 -1
- package/dist/{chunk-IKBA4AHN.mjs → chunk-F4Y3GZG4.mjs} +3 -3
- package/dist/{chunk-YF5XQZDR.mjs → chunk-F5UNXZ3J.mjs} +1 -1
- package/dist/chunk-F5UNXZ3J.mjs.map +1 -0
- package/dist/chunk-IGOWVLJH.mjs +142 -0
- package/dist/chunk-IGOWVLJH.mjs.map +1 -0
- package/dist/{chunk-HAG77QBV.mjs → chunk-K4W5QXL5.mjs} +1 -1
- package/dist/chunk-KFL5ZFM4.mjs +2723 -0
- package/dist/chunk-KFL5ZFM4.mjs.map +1 -0
- package/dist/{chunk-HR4H2FP7.mjs → chunk-KJ4ETLJB.mjs} +24 -14
- package/dist/chunk-KJ4ETLJB.mjs.map +1 -0
- package/dist/chunk-LOSPCUCF.js +637 -0
- package/dist/chunk-LOSPCUCF.js.map +1 -0
- package/dist/{chunk-E2HRC2OG.js → chunk-SVX7E6RR.js} +10360 -6256
- package/dist/chunk-SVX7E6RR.js.map +1 -0
- package/dist/{chunk-EFJEWLRL.js → chunk-YUO55Q5A.js} +1 -1
- package/dist/chunk-YUO55Q5A.js.map +1 -0
- package/dist/chunk-ZQTFZKLJ.mjs +12089 -0
- package/dist/chunk-ZQTFZKLJ.mjs.map +1 -0
- package/dist/{chunk-PMXG5WBC.js → chunk-ZUEEIQHW.js} +3 -3
- package/dist/{chunk-PMXG5WBC.js.map → chunk-ZUEEIQHW.js.map} +1 -1
- package/dist/client/index.d.mts +161 -11
- package/dist/client/index.d.ts +161 -11
- package/dist/client/index.js +74 -12
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +73 -11
- package/dist/components/index.d.mts +762 -73
- package/dist/components/index.d.ts +762 -73
- package/dist/components/index.js +465 -12
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +466 -13
- package/dist/config-B43zxEvn.d.mts +69 -0
- package/dist/config-D2OUrI_G.d.ts +69 -0
- package/dist/content.fields-Ck5lkQ5d.d.mts +47 -0
- package/dist/content.fields-Ck5lkQ5d.d.ts +47 -0
- package/dist/{content.interface-C_PGZMuy.d.ts → content.interface-Bs8a7uW6.d.mts} +2 -3
- package/dist/{content.interface-D_WS6CrB.d.mts → content.interface-UtsJ-mzs.d.ts} +2 -3
- package/dist/contexts/index.d.mts +13 -6
- package/dist/contexts/index.d.ts +13 -6
- package/dist/contexts/index.js +10 -12
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +9 -11
- package/dist/core/index.d.mts +539 -8
- package/dist/core/index.d.ts +539 -8
- package/dist/core/index.js +104 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +105 -3
- package/dist/index.d.mts +131 -70
- package/dist/index.d.ts +131 -70
- package/dist/index.js +97 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +118 -28
- package/dist/notification.interface-BdcwkuQE.d.mts +228 -0
- package/dist/notification.interface-BdcwkuQE.d.ts +228 -0
- package/dist/request-GBLBPYFM.js +8 -0
- package/dist/request-GBLBPYFM.js.map +1 -0
- package/dist/request-XABCMU25.mjs +8 -0
- package/dist/{AbstractService-wLid8dB0.d.ts → s3.interface-D7ttGatc.d.ts} +36 -26
- package/dist/{AbstractService-BsY6W3Ej.d.mts → s3.interface-DlaMDRTn.d.mts} +36 -26
- package/dist/scripts/generate-web-module/generator.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/generator.js +8 -5
- package/dist/scripts/generate-web-module/generator.js.map +1 -1
- package/dist/scripts/generate-web-module/index.js +1 -1
- package/dist/scripts/generate-web-module/index.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.js +8 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
- package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts +4 -3
- package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/transformers/parent-detector.js +9 -3
- package/dist/scripts/generate-web-module/transformers/parent-detector.js.map +1 -1
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts +11 -0
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.js +36 -9
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.js.map +1 -1
- package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts +2 -0
- package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts +1 -0
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts +4 -3
- package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/utils/i18n-updater.js +9 -9
- package/dist/scripts/generate-web-module/utils/i18n-updater.js.map +1 -1
- package/dist/scripts/generate-web-module/validators/json-schema-validator.js +3 -3
- package/dist/scripts/generate-web-module/validators/json-schema-validator.js.map +1 -1
- package/dist/server/index.d.mts +299 -4
- package/dist/server/index.d.ts +299 -4
- package/dist/server/index.js +215 -5
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +214 -4
- package/dist/server/index.mjs.map +1 -1
- package/dist/token-2UWQJY5T.js +8 -0
- package/dist/token-2UWQJY5T.js.map +1 -0
- package/dist/token-EOK3N45S.mjs +8 -0
- package/dist/{useSocket-DzMKRKCA.d.ts → useSocket-8vwK_R_c.d.ts} +1 -1
- package/dist/{useSocket-Cn7fB_B1.d.mts → useSocket-BWJUXuOl.d.mts} +1 -1
- package/package.json +12 -52
- package/scripts/generate-web-module/generator.ts +8 -5
- package/scripts/generate-web-module/index.ts +1 -1
- package/scripts/generate-web-module/templates/components/editor.template.ts +7 -2
- package/scripts/generate-web-module/transformers/parent-detector.ts +10 -3
- package/scripts/generate-web-module/transformers/relationship-resolver.ts +36 -9
- package/scripts/generate-web-module/types/json-schema.interface.ts +2 -0
- package/scripts/generate-web-module/types/template-data.interface.ts +1 -0
- package/scripts/generate-web-module/utils/i18n-updater.ts +9 -9
- package/scripts/generate-web-module/validators/json-schema-validator.ts +3 -3
- package/src/client/JsonApiClient.ts +248 -0
- package/src/client/config.ts +78 -0
- package/src/client/index.ts +6 -1
- package/src/components/containers/TabsContainer.tsx +1 -1
- package/src/components/editors/BlockNoteEditor.tsx +3 -1
- package/src/components/index.ts +4 -0
- package/src/components/navigations/Breadcrumb.tsx +1 -1
- package/src/components/navigations/Header.tsx +2 -2
- package/src/contexts/CommonContext.tsx +1 -1
- package/src/contexts/SocketContext.tsx +1 -1
- package/src/contexts/index.ts +3 -0
- package/src/core/abstracts/ClientAbstractService.ts +255 -0
- package/src/core/abstracts/ServerAbstractService.ts +180 -0
- package/src/core/abstracts/index.ts +2 -0
- package/src/core/index.ts +32 -3
- package/src/discord/config.ts +15 -0
- package/src/discord/index.ts +1 -0
- package/src/features/auth/components/details/LandingComponent.tsx +2 -2
- package/src/features/auth/components/forms/AcceptInvitation.tsx +1 -1
- package/src/features/auth/components/forms/ActivateAccount.tsx +1 -1
- package/src/features/auth/components/forms/Cookies.tsx +2 -1
- package/src/features/auth/components/forms/ForgotPassword.tsx +1 -1
- package/src/features/auth/components/forms/Login.tsx +1 -1
- package/src/features/auth/components/forms/Logout.tsx +1 -1
- package/src/features/auth/components/forms/RefreshUser.tsx +2 -1
- package/src/features/auth/components/forms/Register.tsx +1 -1
- package/src/features/auth/components/forms/ResetPassword.tsx +1 -1
- package/src/features/auth/data/auth.service.ts +1 -1
- package/src/features/auth/data/index.ts +0 -1
- package/src/features/auth/utils/AuthCookies.ts +1 -1
- package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +4 -2
- package/src/features/company/components/forms/CompanyDeleter.tsx +2 -1
- package/src/features/company/components/forms/CompanyEditor.tsx +6 -3
- package/src/features/company/components/forms/CompanyLicense.tsx +4 -2
- package/src/features/company/components/lists/CompaniesList.tsx +2 -1
- package/src/features/company/data/index.ts +0 -1
- package/src/features/content/components/lists/ContentsListById.tsx +2 -1
- package/src/features/content/components/lists/RelevantContentsList.tsx +2 -1
- package/src/features/content/data/index.ts +0 -1
- package/src/features/feature/data/index.ts +0 -1
- package/src/features/notification/components/lists/NotificationsList.tsx +2 -1
- package/src/features/notification/contexts/NotificationContext.tsx +2 -1
- package/src/features/notification/data/index.ts +0 -1
- package/src/features/push/data/index.ts +0 -1
- package/src/features/role/components/forms/RemoveUserFromRole.tsx +4 -2
- package/src/features/role/components/forms/UserRoleAdd.tsx +2 -1
- package/src/features/role/components/lists/RolesList.tsx +2 -1
- package/src/features/role/components/lists/UserRolesList.tsx +2 -1
- package/src/features/role/data/index.ts +0 -1
- package/src/features/s3/data/index.ts +0 -1
- package/src/features/user/components/forms/RoleUserAdd.tsx +4 -2
- package/src/features/user/components/forms/UserDeleter.tsx +2 -1
- package/src/features/user/components/forms/UserEditor.tsx +6 -3
- package/src/features/user/components/forms/UserMultiSelect.tsx +2 -1
- package/src/features/user/components/forms/UserReactivator.tsx +2 -1
- package/src/features/user/components/forms/UserResentInvitationEmail.tsx +2 -1
- package/src/features/user/components/forms/UserSelector.tsx +2 -1
- package/src/features/user/components/lists/AdminUsersList.tsx +2 -1
- package/src/features/user/components/lists/CompanyUsersList.tsx +2 -1
- package/src/features/user/components/lists/RelevantUsersList.tsx +2 -1
- package/src/features/user/components/lists/RoleUsersList.tsx +2 -1
- package/src/features/user/components/lists/UsersListByContentIds.tsx +2 -1
- package/src/features/user/data/index.ts +0 -1
- package/src/features/user/hooks/useUserSearch.ts +2 -1
- package/src/features/user/index.ts +1 -0
- package/src/hooks/useDataListRetriever.ts +4 -4
- package/src/hooks/usePageTracker.ts +1 -1
- package/src/hooks/usePushNotifications.ts +3 -2
- package/src/hooks/useSocket.ts +1 -1
- package/src/index.ts +7 -2
- package/src/roles/config.ts +0 -15
- package/src/roles/index.ts +1 -9
- package/src/server/JsonApiServer.ts +249 -0
- package/src/server/cache.ts +1 -1
- package/src/server/index.ts +13 -0
- package/src/server/request.ts +32 -18
- package/src/server/token.ts +1 -1
- package/dist/ApiData-DPKNfY-9.d.mts +0 -10
- package/dist/ApiData-DPKNfY-9.d.ts +0 -10
- package/dist/ApiDataInterface-DPP8s46n.d.mts +0 -21
- package/dist/ApiDataInterface-DPP8s46n.d.ts +0 -21
- package/dist/BlockNoteEditor-QV6ESIQA.js.map +0 -1
- package/dist/BlockNoteEditor-U2IHUVUF.mjs.map +0 -1
- package/dist/JsonApiRequest-UJ7FGIVI.js +0 -25
- package/dist/atoms/index.d.mts +0 -12
- package/dist/atoms/index.d.ts +0 -12
- package/dist/atoms/index.js +0 -9
- package/dist/atoms/index.js.map +0 -1
- package/dist/atoms/index.mjs +0 -9
- package/dist/chunk-2K3Q24UF.js.map +0 -1
- package/dist/chunk-3FBCC4G3.js +0 -8
- package/dist/chunk-3FBCC4G3.js.map +0 -1
- package/dist/chunk-3UELCPIN.js +0 -46
- package/dist/chunk-3UELCPIN.js.map +0 -1
- package/dist/chunk-5IET37O4.js +0 -4210
- package/dist/chunk-5IET37O4.js.map +0 -1
- package/dist/chunk-AYHKQWHH.js +0 -68
- package/dist/chunk-AYHKQWHH.js.map +0 -1
- package/dist/chunk-DEYKTLA3.js +0 -1131
- package/dist/chunk-DEYKTLA3.js.map +0 -1
- package/dist/chunk-E2HRC2OG.js.map +0 -1
- package/dist/chunk-EFJEWLRL.js.map +0 -1
- package/dist/chunk-FMBQZAIP.mjs +0 -490
- package/dist/chunk-FMBQZAIP.mjs.map +0 -1
- package/dist/chunk-HR4H2FP7.mjs.map +0 -1
- package/dist/chunk-HTLEKZND.mjs.map +0 -1
- package/dist/chunk-JGFWIT2E.mjs +0 -1131
- package/dist/chunk-JGFWIT2E.mjs.map +0 -1
- package/dist/chunk-P2F54I7Q.mjs +0 -4210
- package/dist/chunk-P2F54I7Q.mjs.map +0 -1
- package/dist/chunk-PO5Q3H5I.js +0 -1375
- package/dist/chunk-PO5Q3H5I.js.map +0 -1
- package/dist/chunk-Q2N6SQYW.mjs +0 -8
- package/dist/chunk-Q2N6SQYW.mjs.map +0 -1
- package/dist/chunk-Q4FXESVT.js +0 -490
- package/dist/chunk-Q4FXESVT.js.map +0 -1
- package/dist/chunk-R2ONK22M.mjs +0 -7985
- package/dist/chunk-R2ONK22M.mjs.map +0 -1
- package/dist/chunk-SM63SZCP.mjs +0 -68
- package/dist/chunk-SM63SZCP.mjs.map +0 -1
- package/dist/chunk-SZZYEG3P.mjs +0 -46
- package/dist/chunk-SZZYEG3P.mjs.map +0 -1
- package/dist/chunk-YF5XQZDR.mjs.map +0 -1
- package/dist/config-BmnK65TD.d.mts +0 -35
- package/dist/config-BmnK65TD.d.ts +0 -35
- package/dist/config-DQeAo9Kf.d.mts +0 -49
- package/dist/config-DQeAo9Kf.d.ts +0 -49
- package/dist/content.fields-cHPdM8GJ.d.mts +0 -27
- package/dist/content.fields-cHPdM8GJ.d.ts +0 -27
- package/dist/d3.link.interface-ClC4Irqp.d.mts +0 -21
- package/dist/d3.link.interface-ClC4Irqp.d.ts +0 -21
- package/dist/features/index.d.mts +0 -476
- package/dist/features/index.d.ts +0 -476
- package/dist/features/index.js +0 -87
- package/dist/features/index.js.map +0 -1
- package/dist/features/index.mjs +0 -87
- package/dist/hooks/index.d.mts +0 -69
- package/dist/hooks/index.d.ts +0 -69
- package/dist/hooks/index.js +0 -56
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -56
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/interfaces/index.d.mts +0 -4
- package/dist/interfaces/index.d.ts +0 -4
- package/dist/interfaces/index.js +0 -2
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/index.mjs +0 -2
- package/dist/interfaces/index.mjs.map +0 -1
- package/dist/notification.interface-BBgMUdLR.d.mts +0 -14
- package/dist/notification.interface-gyvT-Z2F.d.ts +0 -14
- package/dist/permissions/index.d.mts +0 -41
- package/dist/permissions/index.d.ts +0 -41
- package/dist/permissions/index.js +0 -14
- package/dist/permissions/index.js.map +0 -1
- package/dist/permissions/index.mjs +0 -14
- package/dist/permissions/index.mjs.map +0 -1
- package/dist/request-7FE3LJLV.mjs +0 -9
- package/dist/request-7FE3LJLV.mjs.map +0 -1
- package/dist/request-QFS7NEIE.js +0 -9
- package/dist/request-QFS7NEIE.js.map +0 -1
- package/dist/roles/index.d.mts +0 -39
- package/dist/roles/index.d.ts +0 -39
- package/dist/roles/index.js +0 -18
- package/dist/roles/index.js.map +0 -1
- package/dist/roles/index.mjs +0 -18
- package/dist/roles/index.mjs.map +0 -1
- package/dist/shadcnui/index.d.mts +0 -698
- package/dist/shadcnui/index.d.ts +0 -698
- package/dist/shadcnui/index.js +0 -468
- package/dist/shadcnui/index.js.map +0 -1
- package/dist/shadcnui/index.mjs +0 -467
- package/dist/shadcnui/index.mjs.map +0 -1
- package/dist/token-IJSPOMW6.mjs +0 -9
- package/dist/token-IJSPOMW6.mjs.map +0 -1
- package/dist/token-UYE7CV6X.js +0 -9
- package/dist/token-UYE7CV6X.js.map +0 -1
- package/dist/types-B2QRyqyK.d.ts +0 -39
- package/dist/types-CgvNmxTd.d.mts +0 -39
- package/dist/types-t2PyXhDu.d.mts +0 -116
- package/dist/types-t2PyXhDu.d.ts +0 -116
- package/dist/user.interface-CAsTIbuQ.d.mts +0 -85
- package/dist/user.interface-CbWqMaaU.d.ts +0 -85
- package/dist/utils/index.d.mts +0 -224
- package/dist/utils/index.d.ts +0 -224
- package/dist/utils/index.js +0 -46
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs +0 -46
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/{JsonApiRequest-6UR7DIAR.mjs.map → JsonApiRequest-VCCRO732.mjs.map} +0 -0
- /package/dist/{chunk-IKBA4AHN.mjs.map → chunk-F4Y3GZG4.mjs.map} +0 -0
- /package/dist/{chunk-HAG77QBV.mjs.map → chunk-K4W5QXL5.mjs.map} +0 -0
- /package/dist/{atoms/index.mjs.map → request-XABCMU25.mjs.map} +0 -0
- /package/dist/{features/index.mjs.map → token-EOK3N45S.mjs.map} +0 -0
|
@@ -25,9 +25,11 @@ import {
|
|
|
25
25
|
Label,
|
|
26
26
|
Link,
|
|
27
27
|
} from "../../../../shadcnui";
|
|
28
|
-
import { UserInterface
|
|
28
|
+
import { UserInterface } from "../../../user";
|
|
29
|
+
import { UserService } from "../../../user/data/user.service";
|
|
29
30
|
import { useCurrentUserContext } from "../../../user/contexts";
|
|
30
|
-
import { CompanyInput
|
|
31
|
+
import { CompanyInput } from "../../data";
|
|
32
|
+
import { CompanyService } from "../../data/company.service";
|
|
31
33
|
|
|
32
34
|
type TokenPayload = {
|
|
33
35
|
userId: string;
|
|
@@ -5,7 +5,8 @@ import { ReactNode } from "react";
|
|
|
5
5
|
import { ContentListTable } from "../../../../components";
|
|
6
6
|
import { Modules } from "../../../../core";
|
|
7
7
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
8
|
-
import { CompanyFields, CompanyInterface
|
|
8
|
+
import { CompanyFields, CompanyInterface } from "../../data";
|
|
9
|
+
import { CompanyService } from "../../data/company.service";
|
|
9
10
|
import { CompanyEditor } from "../forms/CompanyEditor";
|
|
10
11
|
|
|
11
12
|
export function CompaniesList() {
|
|
@@ -4,7 +4,8 @@ import { useTranslations } from "next-intl";
|
|
|
4
4
|
import { ContentListTable } from "../../../../components";
|
|
5
5
|
import { Modules } from "../../../../core";
|
|
6
6
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
7
|
-
import { ContentFields, ContentInterface
|
|
7
|
+
import { ContentFields, ContentInterface } from "../../data";
|
|
8
|
+
import { ContentService } from "../../data/content.service";
|
|
8
9
|
|
|
9
10
|
type ContentsListByIdProps = {
|
|
10
11
|
contentIds: string[];
|
|
@@ -4,7 +4,8 @@ import { useTranslations } from "next-intl";
|
|
|
4
4
|
import { ContentListTable } from "../../../../components";
|
|
5
5
|
import { Modules } from "../../../../core";
|
|
6
6
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
7
|
-
import { ContentFields, ContentInterface
|
|
7
|
+
import { ContentFields, ContentInterface } from "../../data";
|
|
8
|
+
import { ContentService } from "../../data/content.service";
|
|
8
9
|
|
|
9
10
|
type RelevantContentsListProps = {
|
|
10
11
|
id: string;
|
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
TooltipTrigger,
|
|
16
16
|
} from "../../../../shadcnui";
|
|
17
17
|
import { UserAvatar } from "../../../user/components";
|
|
18
|
-
import { NotificationInterface
|
|
18
|
+
import { NotificationInterface } from "../../data";
|
|
19
|
+
import { NotificationService } from "../../data/notification.service";
|
|
19
20
|
import { generateNotificationData } from "../notifications/Notification";
|
|
20
21
|
|
|
21
22
|
type NotificationsListProps = {
|
|
@@ -7,7 +7,8 @@ import { Modules } from "../../../core";
|
|
|
7
7
|
import { useI18nRouter } from "../../../i18n";
|
|
8
8
|
import { BreadcrumbItemData } from "../../../interfaces";
|
|
9
9
|
import { NotificationMenuItem, NotificationToast } from "../components/notifications/Notification";
|
|
10
|
-
import { NotificationInterface
|
|
10
|
+
import { NotificationInterface } from "../data";
|
|
11
|
+
import { NotificationService } from "../data/notification.service";
|
|
11
12
|
|
|
12
13
|
interface NotificationContextType {
|
|
13
14
|
notifications: NotificationInterface[];
|
|
@@ -13,8 +13,10 @@ import {
|
|
|
13
13
|
DialogTitle,
|
|
14
14
|
DialogTrigger,
|
|
15
15
|
} from "../../../../shadcnui";
|
|
16
|
-
import { UserInterface
|
|
17
|
-
import {
|
|
16
|
+
import { UserInterface } from "../../../user";
|
|
17
|
+
import { UserService } from "../../../user/data/user.service";
|
|
18
|
+
import { RoleInterface } from "../../data";
|
|
19
|
+
import { RoleService } from "../../data/role.service";
|
|
18
20
|
|
|
19
21
|
type RemoveUserFromRoleProps = {
|
|
20
22
|
user: UserInterface;
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
DialogTitle,
|
|
18
18
|
} from "../../../../shadcnui";
|
|
19
19
|
import { UserInterface } from "../../../user";
|
|
20
|
-
import { RoleInterface
|
|
20
|
+
import { RoleInterface } from "../../data";
|
|
21
|
+
import { RoleService } from "../../data/role.service";
|
|
21
22
|
|
|
22
23
|
type UserRoleAddProps = {
|
|
23
24
|
user: UserInterface;
|
|
@@ -4,7 +4,8 @@ import { useTranslations } from "next-intl";
|
|
|
4
4
|
import { ContentListTable } from "../../../../components";
|
|
5
5
|
import { Modules } from "../../../../core";
|
|
6
6
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
7
|
-
import { RoleFields, RoleInterface
|
|
7
|
+
import { RoleFields, RoleInterface } from "../../data";
|
|
8
|
+
import { RoleService } from "../../data/role.service";
|
|
8
9
|
import "../../hooks/useRoleTableStructure";
|
|
9
10
|
|
|
10
11
|
export function RolesList() {
|
|
@@ -5,7 +5,8 @@ import { ContentListTable } from "../../../../components";
|
|
|
5
5
|
import { Modules } from "../../../../core";
|
|
6
6
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
7
7
|
import { UserInterface } from "../../../user";
|
|
8
|
-
import { RoleFields, RoleInterface
|
|
8
|
+
import { RoleFields, RoleInterface } from "../../data";
|
|
9
|
+
import { RoleService } from "../../data/role.service";
|
|
9
10
|
|
|
10
11
|
type UserRolesListProps = {
|
|
11
12
|
user: UserInterface;
|
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
} from "../../../../components";
|
|
11
11
|
import { Modules } from "../../../../core";
|
|
12
12
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
13
|
-
import { RoleInterface
|
|
13
|
+
import { RoleInterface } from "../../../role";
|
|
14
|
+
import { RoleService } from "../../../role/data/role.service";
|
|
14
15
|
import { useCurrentUserContext } from "../../contexts";
|
|
15
|
-
import { UserInterface
|
|
16
|
+
import { UserInterface } from "../../data";
|
|
17
|
+
import { UserService } from "../../data/user.service";
|
|
16
18
|
|
|
17
19
|
type AddUserToRoleProps = {
|
|
18
20
|
role: RoleInterface;
|
|
@@ -7,7 +7,8 @@ import { useI18nRouter, usePageUrlGenerator } from "../../../../hooks";
|
|
|
7
7
|
import { Action } from "../../../../permissions";
|
|
8
8
|
import { getRoleId } from "../../../../roles";
|
|
9
9
|
import { useCurrentUserContext } from "../../contexts";
|
|
10
|
-
import { UserInterface
|
|
10
|
+
import { UserInterface } from "../../data";
|
|
11
|
+
import { UserService } from "../../data/user.service";
|
|
11
12
|
|
|
12
13
|
type UserDeleterProps = {
|
|
13
14
|
user: UserInterface;
|
|
@@ -24,10 +24,13 @@ import { Action } from "../../../../permissions";
|
|
|
24
24
|
import { getRoleId } from "../../../../roles";
|
|
25
25
|
import { Dialog, DialogContent, DialogTrigger, Form } from "../../../../shadcnui";
|
|
26
26
|
import { CompanyInterface } from "../../../company";
|
|
27
|
-
import { RoleInterface
|
|
28
|
-
import { S3Interface
|
|
27
|
+
import { RoleInterface } from "../../../role";
|
|
28
|
+
import { S3Interface } from "../../../s3";
|
|
29
|
+
import { RoleService } from "../../../role/data/role.service";
|
|
30
|
+
import { S3Service } from "../../../s3/data/s3.service";
|
|
29
31
|
import { useCurrentUserContext } from "../../contexts";
|
|
30
|
-
import { UserInput, UserInterface
|
|
32
|
+
import { UserInput, UserInterface } from "../../data";
|
|
33
|
+
import { UserService } from "../../data/user.service";
|
|
31
34
|
import { UserAvatarEditor } from "./UserAvatarEditor";
|
|
32
35
|
import { UserDeleter } from "./UserDeleter";
|
|
33
36
|
|
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
MultiSelect,
|
|
17
17
|
} from "../../../../shadcnui";
|
|
18
18
|
import { useCurrentUserContext } from "../../contexts";
|
|
19
|
-
import { UserInterface
|
|
19
|
+
import { UserInterface } from "../../data";
|
|
20
|
+
import { UserService } from "../../data/user.service";
|
|
20
21
|
|
|
21
22
|
// Type for user objects in the form
|
|
22
23
|
type UserSelectType = {
|
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
DialogTrigger,
|
|
17
17
|
} from "../../../../shadcnui";
|
|
18
18
|
import { useCurrentUserContext } from "../../contexts";
|
|
19
|
-
import { UserInterface
|
|
19
|
+
import { UserInterface } from "../../data";
|
|
20
|
+
import { UserService } from "../../data/user.service";
|
|
20
21
|
|
|
21
22
|
type UserReactivatorProps = {
|
|
22
23
|
user: UserInterface;
|
|
@@ -20,7 +20,8 @@ import {
|
|
|
20
20
|
TooltipTrigger,
|
|
21
21
|
} from "../../../../shadcnui";
|
|
22
22
|
import { useCurrentUserContext } from "../../contexts";
|
|
23
|
-
import { UserInterface
|
|
23
|
+
import { UserInterface } from "../../data";
|
|
24
|
+
import { UserService } from "../../data/user.service";
|
|
24
25
|
|
|
25
26
|
type UserResentInvitationEmailProps = {
|
|
26
27
|
user: UserInterface;
|
|
@@ -22,7 +22,8 @@ import {
|
|
|
22
22
|
PopoverContent,
|
|
23
23
|
PopoverTrigger,
|
|
24
24
|
} from "../../../../shadcnui";
|
|
25
|
-
import { UserInterface
|
|
25
|
+
import { UserInterface } from "../../data";
|
|
26
|
+
import { UserService } from "../../data/user.service";
|
|
26
27
|
import { UserAvatar } from "../widgets";
|
|
27
28
|
|
|
28
29
|
type UserSelectorProps = {
|
|
@@ -6,7 +6,8 @@ import { useCompanyContext } from "../../../../contexts";
|
|
|
6
6
|
import { Modules } from "../../../../core";
|
|
7
7
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
8
8
|
import { CompanyInterface } from "../../../company";
|
|
9
|
-
import { UserFields, UserInterface
|
|
9
|
+
import { UserFields, UserInterface } from "../../data";
|
|
10
|
+
import { UserService } from "../../data/user.service";
|
|
10
11
|
import { UserEditor } from "../forms";
|
|
11
12
|
|
|
12
13
|
type AdminUsersListProps = {
|
|
@@ -6,7 +6,8 @@ import { ContentListTable } from "../../../../components";
|
|
|
6
6
|
import { Modules } from "../../../../core";
|
|
7
7
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
8
8
|
import { useCurrentUserContext } from "../../contexts";
|
|
9
|
-
import { UserFields, UserInterface
|
|
9
|
+
import { UserFields, UserInterface } from "../../data";
|
|
10
|
+
import { UserService } from "../../data/user.service";
|
|
10
11
|
import { UserEditor } from "../forms";
|
|
11
12
|
|
|
12
13
|
type CompanyUsersListProps = {
|
|
@@ -4,7 +4,8 @@ import { useTranslations } from "next-intl";
|
|
|
4
4
|
import { ContentListTable } from "../../../../components";
|
|
5
5
|
import { Modules } from "../../../../core";
|
|
6
6
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
7
|
-
import { UserFields, UserInterface
|
|
7
|
+
import { UserFields, UserInterface } from "../../data";
|
|
8
|
+
import { UserService } from "../../data/user.service";
|
|
8
9
|
|
|
9
10
|
type RelevantUsersListProps = {
|
|
10
11
|
id: string;
|
|
@@ -5,7 +5,8 @@ import { ContentListTable } from "../../../../components";
|
|
|
5
5
|
import { Modules } from "../../../../core";
|
|
6
6
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
7
7
|
import { RoleInterface } from "../../../role";
|
|
8
|
-
import { UserFields, UserInterface
|
|
8
|
+
import { UserFields, UserInterface } from "../../data";
|
|
9
|
+
import { UserService } from "../../data/user.service";
|
|
9
10
|
|
|
10
11
|
type RoleUsersListProps = {
|
|
11
12
|
role: RoleInterface;
|
|
@@ -4,7 +4,8 @@ import { useTranslations } from "next-intl";
|
|
|
4
4
|
import { ContentListTable } from "../../../../components";
|
|
5
5
|
import { Modules } from "../../../../core";
|
|
6
6
|
import { DataListRetriever, useDataListRetriever } from "../../../../hooks";
|
|
7
|
-
import { UserFields, UserInterface
|
|
7
|
+
import { UserFields, UserInterface } from "../../data";
|
|
8
|
+
import { UserService } from "../../data/user.service";
|
|
8
9
|
|
|
9
10
|
type UsersListByContentIdsProps = {
|
|
10
11
|
contentIds: string[];
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useDebounce } from "../../../hooks/useDebounce";
|
|
5
|
-
import { UserInterface
|
|
5
|
+
import { UserInterface } from "../data";
|
|
6
|
+
import { UserService } from "../data/user.service";
|
|
6
7
|
|
|
7
8
|
export const useUserSearch = () => {
|
|
8
9
|
const [users, setUsers] = useState<UserInterface[]>([]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { ClientAbstractService } from "../core/abstracts/ClientAbstractService";
|
|
5
5
|
|
|
6
6
|
export type PageInfo = {
|
|
7
7
|
startItem: number;
|
|
@@ -47,7 +47,7 @@ export function useDataListRetriever<T>(params: {
|
|
|
47
47
|
const isFetchingRef = useRef(false);
|
|
48
48
|
|
|
49
49
|
const resolvedType = params.module;
|
|
50
|
-
const resolvedService =
|
|
50
|
+
const resolvedService = ClientAbstractService; // We'll just use ClientAbstractService directly for pagination
|
|
51
51
|
|
|
52
52
|
// Helper to parse page params from pagination URLs
|
|
53
53
|
const parsePageParams = useCallback((url: string | undefined): { offset: number; size: number } | null => {
|
|
@@ -152,7 +152,7 @@ export function useDataListRetriever<T>(params: {
|
|
|
152
152
|
const selfRef = { self: undefined };
|
|
153
153
|
|
|
154
154
|
if (nextPage && fetchParams?.callNext && fetchParams?.isRefine !== true) {
|
|
155
|
-
const ServiceClass = stableParams.service as typeof
|
|
155
|
+
const ServiceClass = stableParams.service as typeof ClientAbstractService;
|
|
156
156
|
|
|
157
157
|
response = await ServiceClass.next<T[]>({
|
|
158
158
|
type: stableParams.type,
|
|
@@ -162,7 +162,7 @@ export function useDataListRetriever<T>(params: {
|
|
|
162
162
|
self: selfRef,
|
|
163
163
|
});
|
|
164
164
|
} else if (previousPage && fetchParams?.callPrevious && fetchParams?.isRefine !== true) {
|
|
165
|
-
const ServiceClass = stableParams.service as typeof
|
|
165
|
+
const ServiceClass = stableParams.service as typeof ClientAbstractService;
|
|
166
166
|
|
|
167
167
|
response = await ServiceClass.previous<T[]>({
|
|
168
168
|
type: stableParams.type,
|
|
@@ -4,7 +4,7 @@ import { useAtom } from "jotai";
|
|
|
4
4
|
import { usePathname } from "next/navigation";
|
|
5
5
|
import { useEffect } from "react";
|
|
6
6
|
import { RecentPage, recentPagesAtom } from "../atoms";
|
|
7
|
-
import { getTrackablePages } from "../
|
|
7
|
+
import { getTrackablePages } from "../client/config";
|
|
8
8
|
|
|
9
9
|
// Routes to exclude from tracking
|
|
10
10
|
const EXCLUDED_ROUTES = ["/", "/login", "/register", "/forgot-password", "/reset-password", "/activate"];
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import { useCurrentUserContext } from "../contexts";
|
|
5
|
-
import {
|
|
5
|
+
import { UserInterface } from "../features/user/data";
|
|
6
|
+
import { PushService } from "../features/push/data/push.service";
|
|
6
7
|
import { getRoleId } from "../roles";
|
|
7
|
-
import { getAppUrl } from "../
|
|
8
|
+
import { getAppUrl } from "../client/config";
|
|
8
9
|
|
|
9
10
|
function urlBase64ToUint8Array(base64String: string): Uint8Array {
|
|
10
11
|
const padding = "=".repeat((4 - (base64String.length % 4)) % 4);
|
package/src/hooks/useSocket.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import io from "socket.io-client";
|
|
5
5
|
import { Modules, rehydrate } from "../core";
|
|
6
|
-
import { NotificationInterface } from "../features";
|
|
6
|
+
import { NotificationInterface } from "../features/notification/data";
|
|
7
7
|
|
|
8
8
|
type Socket = ReturnType<typeof io>;
|
|
9
9
|
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
// NOTE: "./unified" is NOT exported here because it contains dynamic imports
|
|
2
|
+
// of server code which cannot be bundled with client components.
|
|
3
|
+
// Services use unified internally via relative imports.
|
|
3
4
|
|
|
4
5
|
// Core exports for convenience
|
|
5
6
|
export * from "./core";
|
|
@@ -7,11 +8,15 @@ export * from "./core";
|
|
|
7
8
|
// Permissions
|
|
8
9
|
export * from "./permissions";
|
|
9
10
|
|
|
11
|
+
// JSON:API configuration (client-safe)
|
|
12
|
+
export { configureJsonApi, getApiUrl, getAppUrl, getTrackablePages } from "./client/config";
|
|
13
|
+
|
|
10
14
|
// I18n configuration (NOT hooks - those are in /hooks with "use client")
|
|
11
15
|
export { configureI18n } from "./i18n";
|
|
12
16
|
export type { I18nConfig } from "./i18n";
|
|
13
17
|
|
|
14
18
|
// Roles configuration
|
|
19
|
+
export { configureDiscord } from "./discord";
|
|
15
20
|
export { configureRoles, getRoleId, isRolesConfigured } from "./roles";
|
|
16
21
|
export type { RoleIdConfig } from "./roles";
|
|
17
22
|
|
package/src/roles/config.ts
CHANGED
|
@@ -10,8 +10,6 @@ export interface RoleIdConfig {
|
|
|
10
10
|
|
|
11
11
|
// Private storage for the injected role IDs
|
|
12
12
|
let _roleId: RoleIdConfig | null = null;
|
|
13
|
-
let _useDiscord: boolean = false;
|
|
14
|
-
let _useInternalAuth: boolean = true;
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* Configure role IDs for the library
|
|
@@ -29,11 +27,6 @@ export function configureRoles(roleId: RoleIdConfig): void {
|
|
|
29
27
|
_roleId = roleId;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
export function configureDiscord(params: { useDiscord: boolean; useInternalAuth: boolean }): void {
|
|
33
|
-
_useDiscord = params.useDiscord;
|
|
34
|
-
_useInternalAuth = params.useInternalAuth;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
30
|
/**
|
|
38
31
|
* Get configured role IDs
|
|
39
32
|
* @throws Error if roles not configured
|
|
@@ -51,11 +44,3 @@ export function getRoleId(): RoleIdConfig {
|
|
|
51
44
|
export function isRolesConfigured(): boolean {
|
|
52
45
|
return _roleId !== null;
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
export function isDiscordConfigured(): boolean {
|
|
56
|
-
return _useDiscord;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function isInternalAuthConfigured(): boolean {
|
|
60
|
-
return _useInternalAuth;
|
|
61
|
-
}
|
package/src/roles/index.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
configureDiscord,
|
|
3
|
-
configureRoles,
|
|
4
|
-
getRoleId,
|
|
5
|
-
isDiscordConfigured,
|
|
6
|
-
isInternalAuthConfigured,
|
|
7
|
-
isRolesConfigured,
|
|
8
|
-
type RoleIdConfig,
|
|
9
|
-
} from "./config";
|
|
1
|
+
export { configureRoles, getRoleId, isRolesConfigured, type RoleIdConfig } from "./config";
|