@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
package/dist/core/index.mjs
CHANGED
|
@@ -1,43 +1,145 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AbstractApiData,
|
|
3
3
|
AbstractService,
|
|
4
|
+
Auth,
|
|
5
|
+
AuthComponent,
|
|
6
|
+
AuthModule,
|
|
7
|
+
AuthorModule,
|
|
8
|
+
BlockNoteDiffUtil,
|
|
9
|
+
BlockNoteWordDiffRendererUtil,
|
|
10
|
+
ClientAbstractService,
|
|
11
|
+
ClientHttpMethod,
|
|
12
|
+
Company,
|
|
13
|
+
CompanyFields,
|
|
14
|
+
CompanyModule,
|
|
15
|
+
Content,
|
|
16
|
+
ContentFields,
|
|
17
|
+
ContentModule,
|
|
4
18
|
EndpointCreator,
|
|
19
|
+
Feature,
|
|
20
|
+
FeatureModule,
|
|
5
21
|
HttpMethod,
|
|
22
|
+
Module,
|
|
23
|
+
ModuleModule,
|
|
6
24
|
ModuleRegistrar,
|
|
7
25
|
ModuleRegistry,
|
|
8
26
|
Modules,
|
|
27
|
+
Notification,
|
|
28
|
+
NotificationFields,
|
|
29
|
+
NotificationModule,
|
|
30
|
+
Push,
|
|
31
|
+
PushModule,
|
|
9
32
|
RehydrationFactory,
|
|
33
|
+
Role,
|
|
34
|
+
RoleFields,
|
|
35
|
+
RoleModule,
|
|
36
|
+
S3,
|
|
37
|
+
S3Module,
|
|
38
|
+
TableOptions,
|
|
39
|
+
User,
|
|
40
|
+
UserFields,
|
|
41
|
+
UserModule,
|
|
42
|
+
cn,
|
|
43
|
+
composeRefs,
|
|
10
44
|
createJsonApiInclusion,
|
|
45
|
+
entityObjectSchema,
|
|
46
|
+
exists,
|
|
47
|
+
formatDate,
|
|
48
|
+
getClientGlobalErrorHandler,
|
|
11
49
|
getGlobalErrorHandler,
|
|
50
|
+
getIcon,
|
|
51
|
+
getIconByModule,
|
|
52
|
+
getIconByModuleName,
|
|
53
|
+
getLucideIcon,
|
|
54
|
+
getLucideIconByModule,
|
|
55
|
+
getLucideIconByModuleName,
|
|
56
|
+
getTableComponents,
|
|
57
|
+
getTableOptions,
|
|
12
58
|
rehydrate,
|
|
13
59
|
rehydrateList,
|
|
14
|
-
|
|
15
|
-
|
|
60
|
+
setClientGlobalErrorHandler,
|
|
61
|
+
setGlobalErrorHandler,
|
|
62
|
+
useComposedRefs,
|
|
63
|
+
useIsMobile,
|
|
64
|
+
userObjectSchema
|
|
65
|
+
} from "../chunk-KFL5ZFM4.mjs";
|
|
66
|
+
import "../chunk-C7C7VY4F.mjs";
|
|
16
67
|
import {
|
|
17
68
|
DataClassRegistry,
|
|
18
69
|
JsonApiDataFactory,
|
|
19
70
|
translateData,
|
|
20
71
|
translateResponse
|
|
21
72
|
} from "../chunk-RBIVEH2K.mjs";
|
|
73
|
+
import "../chunk-AUXK7QSA.mjs";
|
|
22
74
|
import "../chunk-PAWJFY3S.mjs";
|
|
23
75
|
export {
|
|
24
76
|
AbstractApiData,
|
|
25
77
|
AbstractService,
|
|
78
|
+
Auth,
|
|
79
|
+
AuthComponent,
|
|
80
|
+
AuthModule,
|
|
81
|
+
AuthorModule,
|
|
82
|
+
BlockNoteDiffUtil,
|
|
83
|
+
BlockNoteWordDiffRendererUtil,
|
|
84
|
+
ClientAbstractService,
|
|
85
|
+
ClientHttpMethod,
|
|
86
|
+
Company,
|
|
87
|
+
CompanyFields,
|
|
88
|
+
CompanyModule,
|
|
89
|
+
Content,
|
|
90
|
+
ContentFields,
|
|
91
|
+
ContentModule,
|
|
26
92
|
DataClassRegistry as DataClass,
|
|
27
93
|
DataClassRegistry,
|
|
28
94
|
EndpointCreator,
|
|
95
|
+
Feature,
|
|
96
|
+
FeatureModule,
|
|
29
97
|
HttpMethod,
|
|
30
98
|
JsonApiDataFactory,
|
|
99
|
+
Module,
|
|
100
|
+
ModuleModule,
|
|
31
101
|
ModuleRegistrar,
|
|
32
102
|
ModuleRegistry,
|
|
33
103
|
Modules,
|
|
104
|
+
Notification,
|
|
105
|
+
NotificationFields,
|
|
106
|
+
NotificationModule,
|
|
107
|
+
Push,
|
|
108
|
+
PushModule,
|
|
34
109
|
RehydrationFactory,
|
|
110
|
+
Role,
|
|
111
|
+
RoleFields,
|
|
112
|
+
RoleModule,
|
|
113
|
+
S3,
|
|
114
|
+
S3Module,
|
|
115
|
+
TableOptions,
|
|
116
|
+
User,
|
|
117
|
+
UserFields,
|
|
118
|
+
UserModule,
|
|
119
|
+
cn,
|
|
120
|
+
composeRefs,
|
|
35
121
|
createJsonApiInclusion,
|
|
122
|
+
entityObjectSchema,
|
|
123
|
+
exists,
|
|
124
|
+
formatDate,
|
|
125
|
+
getClientGlobalErrorHandler,
|
|
36
126
|
getGlobalErrorHandler,
|
|
127
|
+
getIcon,
|
|
128
|
+
getIconByModule,
|
|
129
|
+
getIconByModuleName,
|
|
130
|
+
getLucideIcon,
|
|
131
|
+
getLucideIconByModule,
|
|
132
|
+
getLucideIconByModuleName,
|
|
133
|
+
getTableComponents,
|
|
134
|
+
getTableOptions,
|
|
37
135
|
rehydrate,
|
|
38
136
|
rehydrateList,
|
|
137
|
+
setClientGlobalErrorHandler,
|
|
39
138
|
setGlobalErrorHandler,
|
|
40
139
|
translateData,
|
|
41
|
-
translateResponse
|
|
140
|
+
translateResponse,
|
|
141
|
+
useComposedRefs,
|
|
142
|
+
useIsMobile,
|
|
143
|
+
userObjectSchema
|
|
42
144
|
};
|
|
43
145
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,78 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export { A as
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
1
|
+
export { A as ApiData, a as ApiResponseInterface } from './ApiResponseInterface-CfcC7pPC.mjs';
|
|
2
|
+
import { P as PermissionUser, M as ModuleWithPermissions, b as Action, c as PermissionModule } from './notification.interface-BdcwkuQE.mjs';
|
|
3
|
+
export { A as ApiDataInterface, a as ApiRequestDataTypeInterface, C as CompanyInput, e as CompanyInterface, f as FeatureInterface, F as FieldSelector, G as GetterKeys, J as JsonApiHydratedDataInterface, n as ModuleDefinition, p as ModuleFactory, g as ModuleInterface, m as ModulePermissionDefinition, h as NotificationInput, N as NotificationInterface, l as PageUrl, k as PermissionCheck, o as PermissionConfig, R as RoleInput, i as RoleInterface, j as UserInput, U as UserInterface, d as createJsonApiInclusion } from './notification.interface-BdcwkuQE.mjs';
|
|
4
|
+
export { AbstractApiData, AppModuleDefinitions, Auth, AuthModule, AuthorModule, BlockDiffOptions, BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, ClientAbstractService, ClientHttpMethod, ClientNextRef, ClientPreviousRef, ClientSelfRef, Company, CompanyFields, CompanyModule, Content, ContentModule, DataClass, DataClass as DataClassRegistry, DiffBlock, DiffResult, EndpointCreator, EndpointQuery, EntityObject, Feature, FeatureModule, FormatOption, FoundationModuleDefinitions, JsonApiDataFactory, Module, ModuleDefinitions, ModuleModule, ModuleRegistrar, ModuleRegistry, Modules, Notification, NotificationFields, NotificationModule, Push, PushInput, PushInterface, PushModule, RehydrationFactory, Role, RoleModule, S3, S3Module, SearchResultInterface, TableOptions, User, UserModule, UserObject, WordDiff, cn, composeRefs, entityObjectSchema, exists, formatDate, getClientGlobalErrorHandler, getIcon, getIconByModule, getIconByModuleName, getLucideIcon, getLucideIconByModule, getLucideIconByModuleName, getTableComponents, getTableOptions, rehydrate, rehydrateList, setClientGlobalErrorHandler, translateData, translateResponse, useComposedRefs, useIsMobile, userObjectSchema } from './core/index.mjs';
|
|
5
|
+
export { A as AbstractService, a as AuthInput, c as AuthInterface, b as AuthQuery, H as HttpMethod, N as NextRef, P as PreviousRef, d as S3Input, e as S3Interface, S as SelfRef, g as getGlobalErrorHandler, s as setGlobalErrorHandler } from './s3.interface-DlaMDRTn.mjs';
|
|
6
|
+
export { B as BreadcrumbItemData } from './breadcrumb.item.data.interface-CgB4_1EE.mjs';
|
|
7
|
+
export { C as ContentFields, D as D3Link, a as D3Node, R as RoleFields, U as UserFields } from './content.fields-Ck5lkQ5d.mjs';
|
|
8
|
+
export { ClassValue } from 'clsx';
|
|
9
|
+
export { A as AuthComponent } from './AuthComponent-hxOPs9o8.mjs';
|
|
10
|
+
export { C as ContentInput, a as ContentInterface } from './content.interface-Bs8a7uW6.mjs';
|
|
11
|
+
export { I as I18nConfig, d as configureI18n, c as configureJsonApi, g as getApiUrl, a as getAppUrl, b as getTrackablePages } from './config-B43zxEvn.mjs';
|
|
12
12
|
import 'lucide-react';
|
|
13
13
|
import 'react';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import '@blocknote/core';
|
|
16
|
+
import 'd3';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
19
|
+
* Check if a user has permission to perform an action on a module.
|
|
20
|
+
*
|
|
21
|
+
* @param module - The module to check permissions for
|
|
22
|
+
* @param action - The action to check (read, create, update, delete)
|
|
23
|
+
* @param user - The user with their modules and permissions
|
|
24
|
+
* @param data - Optional data object for path-based permission checks
|
|
18
25
|
*/
|
|
19
|
-
declare function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
declare function checkPermissions<T extends PermissionUser>(params: {
|
|
27
|
+
module: ModuleWithPermissions;
|
|
28
|
+
action: Action;
|
|
29
|
+
user: T;
|
|
30
|
+
data?: any;
|
|
31
|
+
}): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Check permissions from server context where user object is not fully available.
|
|
34
|
+
*
|
|
35
|
+
* @param module - The module to check permissions for
|
|
36
|
+
* @param action - The action to check
|
|
37
|
+
* @param userId - The user's ID
|
|
38
|
+
* @param selectedModule - The selected module with its permissions
|
|
39
|
+
* @param data - Optional data object for path-based permission checks
|
|
40
|
+
*/
|
|
41
|
+
declare function checkPermissionsFromServer(params: {
|
|
42
|
+
module: ModuleWithPermissions;
|
|
43
|
+
action: Action;
|
|
44
|
+
userId: string;
|
|
45
|
+
selectedModule?: PermissionModule;
|
|
46
|
+
data?: any;
|
|
47
|
+
}): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Traverse an object path and check if the value matches the user ID.
|
|
50
|
+
* Handles nested objects, arrays, and various data structures.
|
|
51
|
+
*/
|
|
52
|
+
declare function getValueFromPath(obj: any, path: string, userId: string): any;
|
|
53
|
+
|
|
54
|
+
declare function configureDiscord(params: {
|
|
55
|
+
useDiscord: boolean;
|
|
56
|
+
useInternalAuth: boolean;
|
|
25
57
|
}): void;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
overridesJsonApiCreation?: boolean;
|
|
67
|
-
responseType?: ApiRequestDataTypeInterface;
|
|
68
|
-
language: string;
|
|
69
|
-
}): Promise<ApiResponseInterface>;
|
|
70
|
-
declare function JsonApiDelete(params: {
|
|
71
|
-
classKey: ApiRequestDataTypeInterface;
|
|
72
|
-
endpoint: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Role ID configuration interface
|
|
61
|
+
* Apps provide their role IDs via configureRoles()
|
|
62
|
+
*/
|
|
63
|
+
interface RoleIdConfig {
|
|
64
|
+
Administrator: string;
|
|
65
|
+
CompanyAdministrator: string;
|
|
66
|
+
[key: string]: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Configure role IDs for the library
|
|
70
|
+
* Call this at app startup to provide role ID constants
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* import { configureRoles } from "@carlonicora/nextjs-jsonapi";
|
|
75
|
+
* import { RoleId } from "@phlow/shared";
|
|
76
|
+
*
|
|
77
|
+
* configureRoles(RoleId);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare function configureRoles(roleId: RoleIdConfig): void;
|
|
81
|
+
/**
|
|
82
|
+
* Get configured role IDs
|
|
83
|
+
* @throws Error if roles not configured
|
|
84
|
+
*/
|
|
85
|
+
declare function getRoleId(): RoleIdConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Check if roles have been configured
|
|
88
|
+
*/
|
|
89
|
+
declare function isRolesConfigured(): boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Token parameters for authentication cookie management
|
|
93
|
+
*/
|
|
94
|
+
interface TokenParams {
|
|
95
|
+
token?: string;
|
|
96
|
+
refreshToken?: string;
|
|
97
|
+
userId?: string;
|
|
73
98
|
companyId?: string;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
99
|
+
licenseExpirationDate?: Date;
|
|
100
|
+
roles?: string[];
|
|
101
|
+
features?: string[];
|
|
102
|
+
modules?: {
|
|
103
|
+
id: string;
|
|
104
|
+
permissions: {
|
|
105
|
+
create: boolean | string;
|
|
106
|
+
read: boolean | string;
|
|
107
|
+
update: boolean | string;
|
|
108
|
+
delete: boolean | string;
|
|
109
|
+
};
|
|
110
|
+
}[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Token handler interface for dependency injection
|
|
114
|
+
* Apps must provide implementations of these functions via configureAuth()
|
|
115
|
+
*/
|
|
116
|
+
interface TokenHandler {
|
|
117
|
+
updateToken: (params: TokenParams) => Promise<void>;
|
|
118
|
+
removeToken: () => Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Configure authentication token handling
|
|
122
|
+
* Call this at app startup to provide Server Actions for cookie management
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import { configureAuth } from "@carlonicora/nextjs-jsonapi/features";
|
|
127
|
+
* import { updateToken, removeToken } from "@/features/auth/utils/AuthCookies";
|
|
128
|
+
*
|
|
129
|
+
* configureAuth({ updateToken, removeToken });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
declare function configureAuth(handler: TokenHandler): void;
|
|
133
|
+
/**
|
|
134
|
+
* Internal getter for AuthService to access the token handler
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
declare function getTokenHandler(): TokenHandler | null;
|
|
77
138
|
|
|
78
|
-
export {
|
|
139
|
+
export { Action, ModuleWithPermissions, PermissionModule, PermissionUser, type RoleIdConfig, type TokenHandler, type TokenParams, checkPermissions, checkPermissionsFromServer, configureAuth, configureDiscord, configureRoles, getRoleId, getTokenHandler, getValueFromPath, isRolesConfigured };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,78 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export { A as
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
1
|
+
export { A as ApiData, a as ApiResponseInterface } from './ApiResponseInterface-DTBJaV5R.js';
|
|
2
|
+
import { P as PermissionUser, M as ModuleWithPermissions, b as Action, c as PermissionModule } from './notification.interface-BdcwkuQE.js';
|
|
3
|
+
export { A as ApiDataInterface, a as ApiRequestDataTypeInterface, C as CompanyInput, e as CompanyInterface, f as FeatureInterface, F as FieldSelector, G as GetterKeys, J as JsonApiHydratedDataInterface, n as ModuleDefinition, p as ModuleFactory, g as ModuleInterface, m as ModulePermissionDefinition, h as NotificationInput, N as NotificationInterface, l as PageUrl, k as PermissionCheck, o as PermissionConfig, R as RoleInput, i as RoleInterface, j as UserInput, U as UserInterface, d as createJsonApiInclusion } from './notification.interface-BdcwkuQE.js';
|
|
4
|
+
export { AbstractApiData, AppModuleDefinitions, Auth, AuthModule, AuthorModule, BlockDiffOptions, BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, ClientAbstractService, ClientHttpMethod, ClientNextRef, ClientPreviousRef, ClientSelfRef, Company, CompanyFields, CompanyModule, Content, ContentModule, DataClass, DataClass as DataClassRegistry, DiffBlock, DiffResult, EndpointCreator, EndpointQuery, EntityObject, Feature, FeatureModule, FormatOption, FoundationModuleDefinitions, JsonApiDataFactory, Module, ModuleDefinitions, ModuleModule, ModuleRegistrar, ModuleRegistry, Modules, Notification, NotificationFields, NotificationModule, Push, PushInput, PushInterface, PushModule, RehydrationFactory, Role, RoleModule, S3, S3Module, SearchResultInterface, TableOptions, User, UserModule, UserObject, WordDiff, cn, composeRefs, entityObjectSchema, exists, formatDate, getClientGlobalErrorHandler, getIcon, getIconByModule, getIconByModuleName, getLucideIcon, getLucideIconByModule, getLucideIconByModuleName, getTableComponents, getTableOptions, rehydrate, rehydrateList, setClientGlobalErrorHandler, translateData, translateResponse, useComposedRefs, useIsMobile, userObjectSchema } from './core/index.js';
|
|
5
|
+
export { A as AbstractService, a as AuthInput, c as AuthInterface, b as AuthQuery, H as HttpMethod, N as NextRef, P as PreviousRef, d as S3Input, e as S3Interface, S as SelfRef, g as getGlobalErrorHandler, s as setGlobalErrorHandler } from './s3.interface-D7ttGatc.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
|
+
export { ClassValue } from 'clsx';
|
|
9
|
+
export { A as AuthComponent } from './AuthComponent-hxOPs9o8.js';
|
|
10
|
+
export { C as ContentInput, a as ContentInterface } from './content.interface-UtsJ-mzs.js';
|
|
11
|
+
export { I as I18nConfig, d as configureI18n, c as configureJsonApi, g as getApiUrl, a as getAppUrl, b as getTrackablePages } from './config-D2OUrI_G.js';
|
|
12
12
|
import 'lucide-react';
|
|
13
13
|
import 'react';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import '@blocknote/core';
|
|
16
|
+
import 'd3';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
19
|
+
* Check if a user has permission to perform an action on a module.
|
|
20
|
+
*
|
|
21
|
+
* @param module - The module to check permissions for
|
|
22
|
+
* @param action - The action to check (read, create, update, delete)
|
|
23
|
+
* @param user - The user with their modules and permissions
|
|
24
|
+
* @param data - Optional data object for path-based permission checks
|
|
18
25
|
*/
|
|
19
|
-
declare function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
declare function checkPermissions<T extends PermissionUser>(params: {
|
|
27
|
+
module: ModuleWithPermissions;
|
|
28
|
+
action: Action;
|
|
29
|
+
user: T;
|
|
30
|
+
data?: any;
|
|
31
|
+
}): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Check permissions from server context where user object is not fully available.
|
|
34
|
+
*
|
|
35
|
+
* @param module - The module to check permissions for
|
|
36
|
+
* @param action - The action to check
|
|
37
|
+
* @param userId - The user's ID
|
|
38
|
+
* @param selectedModule - The selected module with its permissions
|
|
39
|
+
* @param data - Optional data object for path-based permission checks
|
|
40
|
+
*/
|
|
41
|
+
declare function checkPermissionsFromServer(params: {
|
|
42
|
+
module: ModuleWithPermissions;
|
|
43
|
+
action: Action;
|
|
44
|
+
userId: string;
|
|
45
|
+
selectedModule?: PermissionModule;
|
|
46
|
+
data?: any;
|
|
47
|
+
}): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Traverse an object path and check if the value matches the user ID.
|
|
50
|
+
* Handles nested objects, arrays, and various data structures.
|
|
51
|
+
*/
|
|
52
|
+
declare function getValueFromPath(obj: any, path: string, userId: string): any;
|
|
53
|
+
|
|
54
|
+
declare function configureDiscord(params: {
|
|
55
|
+
useDiscord: boolean;
|
|
56
|
+
useInternalAuth: boolean;
|
|
25
57
|
}): void;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
overridesJsonApiCreation?: boolean;
|
|
67
|
-
responseType?: ApiRequestDataTypeInterface;
|
|
68
|
-
language: string;
|
|
69
|
-
}): Promise<ApiResponseInterface>;
|
|
70
|
-
declare function JsonApiDelete(params: {
|
|
71
|
-
classKey: ApiRequestDataTypeInterface;
|
|
72
|
-
endpoint: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Role ID configuration interface
|
|
61
|
+
* Apps provide their role IDs via configureRoles()
|
|
62
|
+
*/
|
|
63
|
+
interface RoleIdConfig {
|
|
64
|
+
Administrator: string;
|
|
65
|
+
CompanyAdministrator: string;
|
|
66
|
+
[key: string]: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Configure role IDs for the library
|
|
70
|
+
* Call this at app startup to provide role ID constants
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* import { configureRoles } from "@carlonicora/nextjs-jsonapi";
|
|
75
|
+
* import { RoleId } from "@phlow/shared";
|
|
76
|
+
*
|
|
77
|
+
* configureRoles(RoleId);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare function configureRoles(roleId: RoleIdConfig): void;
|
|
81
|
+
/**
|
|
82
|
+
* Get configured role IDs
|
|
83
|
+
* @throws Error if roles not configured
|
|
84
|
+
*/
|
|
85
|
+
declare function getRoleId(): RoleIdConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Check if roles have been configured
|
|
88
|
+
*/
|
|
89
|
+
declare function isRolesConfigured(): boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Token parameters for authentication cookie management
|
|
93
|
+
*/
|
|
94
|
+
interface TokenParams {
|
|
95
|
+
token?: string;
|
|
96
|
+
refreshToken?: string;
|
|
97
|
+
userId?: string;
|
|
73
98
|
companyId?: string;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
99
|
+
licenseExpirationDate?: Date;
|
|
100
|
+
roles?: string[];
|
|
101
|
+
features?: string[];
|
|
102
|
+
modules?: {
|
|
103
|
+
id: string;
|
|
104
|
+
permissions: {
|
|
105
|
+
create: boolean | string;
|
|
106
|
+
read: boolean | string;
|
|
107
|
+
update: boolean | string;
|
|
108
|
+
delete: boolean | string;
|
|
109
|
+
};
|
|
110
|
+
}[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Token handler interface for dependency injection
|
|
114
|
+
* Apps must provide implementations of these functions via configureAuth()
|
|
115
|
+
*/
|
|
116
|
+
interface TokenHandler {
|
|
117
|
+
updateToken: (params: TokenParams) => Promise<void>;
|
|
118
|
+
removeToken: () => Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Configure authentication token handling
|
|
122
|
+
* Call this at app startup to provide Server Actions for cookie management
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import { configureAuth } from "@carlonicora/nextjs-jsonapi/features";
|
|
127
|
+
* import { updateToken, removeToken } from "@/features/auth/utils/AuthCookies";
|
|
128
|
+
*
|
|
129
|
+
* configureAuth({ updateToken, removeToken });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
declare function configureAuth(handler: TokenHandler): void;
|
|
133
|
+
/**
|
|
134
|
+
* Internal getter for AuthService to access the token handler
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
declare function getTokenHandler(): TokenHandler | null;
|
|
77
138
|
|
|
78
|
-
export {
|
|
139
|
+
export { Action, ModuleWithPermissions, PermissionModule, PermissionUser, type RoleIdConfig, type TokenHandler, type TokenParams, checkPermissions, checkPermissionsFromServer, configureAuth, configureDiscord, configureRoles, getRoleId, getTokenHandler, getValueFromPath, isRolesConfigured };
|