@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/types-t2PyXhDu.d.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide-react';
|
|
2
|
-
|
|
3
|
-
type GetterKeys<T> = {
|
|
4
|
-
[K in keyof T]: T[K] extends () => any ? never : K;
|
|
5
|
-
}[keyof T];
|
|
6
|
-
type FieldSelector<T> = {
|
|
7
|
-
type: string;
|
|
8
|
-
fields: ReadonlyArray<GetterKeys<T>>;
|
|
9
|
-
};
|
|
10
|
-
declare function createJsonApiInclusion<T>(dataType: string, fields: ReadonlyArray<GetterKeys<T>>): FieldSelector<T>;
|
|
11
|
-
|
|
12
|
-
type ApiRequestDataTypeInterface = {
|
|
13
|
-
name: string;
|
|
14
|
-
cache?: string;
|
|
15
|
-
inclusions?: Record<string, {
|
|
16
|
-
types?: string[];
|
|
17
|
-
fields?: FieldSelector<any>[];
|
|
18
|
-
}>;
|
|
19
|
-
model: new () => any;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Permission actions
|
|
24
|
-
*/
|
|
25
|
-
declare enum Action {
|
|
26
|
-
Read = "read",
|
|
27
|
-
Create = "create",
|
|
28
|
-
Update = "update",
|
|
29
|
-
Delete = "delete"
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Generic permission check type.
|
|
33
|
-
* Can be a boolean or a function that checks permissions dynamically.
|
|
34
|
-
* @template T - The data type being checked
|
|
35
|
-
* @template U - The user type (defaults to PermissionUser)
|
|
36
|
-
*/
|
|
37
|
-
type PermissionCheck<T, U = PermissionUser> = boolean | ((user?: U | string, data?: T) => boolean);
|
|
38
|
-
/**
|
|
39
|
-
* Page URL configuration for modules
|
|
40
|
-
*/
|
|
41
|
-
type PageUrl = {
|
|
42
|
-
pageUrl?: string;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Module permission definition wrapper
|
|
46
|
-
*/
|
|
47
|
-
type ModulePermissionDefinition<T> = {
|
|
48
|
-
interface: T;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Base module definition
|
|
52
|
-
*/
|
|
53
|
-
type ModuleDefinition = {
|
|
54
|
-
pageUrl?: string;
|
|
55
|
-
name: string;
|
|
56
|
-
model: any;
|
|
57
|
-
feature?: string;
|
|
58
|
-
moduleId?: string;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Permission configuration for a module.
|
|
62
|
-
* Can be a boolean (allow/deny all) or a string path for dynamic checks.
|
|
63
|
-
*/
|
|
64
|
-
interface PermissionConfig {
|
|
65
|
-
create: boolean | string;
|
|
66
|
-
read: boolean | string;
|
|
67
|
-
update: boolean | string;
|
|
68
|
-
delete: boolean | string;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Generic interface for a module that has permissions.
|
|
72
|
-
* Apps should ensure their Module class implements this.
|
|
73
|
-
*/
|
|
74
|
-
interface PermissionModule {
|
|
75
|
-
id: string;
|
|
76
|
-
permissions: PermissionConfig;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Generic interface for a user that has modules with permissions.
|
|
80
|
-
* Apps should ensure their User class implements this.
|
|
81
|
-
*/
|
|
82
|
-
interface PermissionUser {
|
|
83
|
-
id: string;
|
|
84
|
-
modules: PermissionModule[];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Module definition with permissions - extends ApiRequestDataTypeInterface
|
|
88
|
-
*/
|
|
89
|
-
type ModuleWithPermissions = ApiRequestDataTypeInterface & {
|
|
90
|
-
pageUrl?: string;
|
|
91
|
-
feature?: string;
|
|
92
|
-
moduleId?: string;
|
|
93
|
-
icon?: LucideIcon;
|
|
94
|
-
inclusions?: Record<string, {
|
|
95
|
-
types?: string[];
|
|
96
|
-
fields?: FieldSelector<any>[];
|
|
97
|
-
}>;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Factory type for creating module definitions
|
|
101
|
-
*/
|
|
102
|
-
type ModuleFactory = (params: {
|
|
103
|
-
pageUrl?: string;
|
|
104
|
-
name: string;
|
|
105
|
-
cache?: string | "days" | "default" | "hours" | "max" | "minutes" | "seconds" | "weeks";
|
|
106
|
-
model: any;
|
|
107
|
-
feature?: string;
|
|
108
|
-
moduleId?: string;
|
|
109
|
-
icon?: LucideIcon;
|
|
110
|
-
inclusions?: Record<string, {
|
|
111
|
-
types?: string[];
|
|
112
|
-
fields?: FieldSelector<any>[];
|
|
113
|
-
}>;
|
|
114
|
-
}) => ModuleWithPermissions;
|
|
115
|
-
|
|
116
|
-
export { type ApiRequestDataTypeInterface as A, type FieldSelector as F, type GetterKeys as G, type ModuleWithPermissions as M, type PermissionCheck as P, Action as a, type PageUrl as b, createJsonApiInclusion as c, type ModulePermissionDefinition as d, type ModuleDefinition as e, type PermissionConfig as f, type PermissionModule as g, type PermissionUser as h, type ModuleFactory as i };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { A as ApiDataInterface } from './ApiDataInterface-DPP8s46n.mjs';
|
|
2
|
-
|
|
3
|
-
interface ModuleInterface extends ApiDataInterface {
|
|
4
|
-
get name(): string;
|
|
5
|
-
get isCore(): boolean;
|
|
6
|
-
get permissions(): {
|
|
7
|
-
create: boolean | string;
|
|
8
|
-
read: boolean | string;
|
|
9
|
-
update: boolean | string;
|
|
10
|
-
delete: boolean | string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface FeatureInterface extends ApiDataInterface {
|
|
15
|
-
get name(): string;
|
|
16
|
-
get isProduction(): boolean;
|
|
17
|
-
get modules(): ModuleInterface[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
type CompanyInput = {
|
|
21
|
-
id: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
logo?: string;
|
|
24
|
-
configurations?: any;
|
|
25
|
-
license?: string;
|
|
26
|
-
privateKey?: string;
|
|
27
|
-
featureIds?: string[];
|
|
28
|
-
moduleIds?: string[];
|
|
29
|
-
};
|
|
30
|
-
interface CompanyInterface extends ApiDataInterface {
|
|
31
|
-
get name(): string;
|
|
32
|
-
get configurations(): any;
|
|
33
|
-
get logo(): string | undefined;
|
|
34
|
-
get logoUrl(): string | undefined;
|
|
35
|
-
get licenseExpirationDate(): Date | undefined;
|
|
36
|
-
get features(): FeatureInterface[];
|
|
37
|
-
get modules(): ModuleInterface[];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
type RoleInput = {
|
|
41
|
-
id: string;
|
|
42
|
-
name: string;
|
|
43
|
-
description?: string;
|
|
44
|
-
};
|
|
45
|
-
interface RoleInterface extends ApiDataInterface {
|
|
46
|
-
get name(): string;
|
|
47
|
-
get description(): string;
|
|
48
|
-
get isSelectable(): boolean;
|
|
49
|
-
get requiredFeature(): FeatureInterface | undefined;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type UserInput = {
|
|
53
|
-
id: string;
|
|
54
|
-
email?: string | undefined | null;
|
|
55
|
-
name?: string;
|
|
56
|
-
title?: string;
|
|
57
|
-
bio?: string;
|
|
58
|
-
password?: string | undefined;
|
|
59
|
-
roleIds?: string[];
|
|
60
|
-
sendInvitationEmail?: boolean;
|
|
61
|
-
companyId?: string;
|
|
62
|
-
adminCreated?: boolean;
|
|
63
|
-
avatar?: string;
|
|
64
|
-
phone?: string;
|
|
65
|
-
rate?: number;
|
|
66
|
-
};
|
|
67
|
-
interface UserInterface extends ApiDataInterface {
|
|
68
|
-
get email(): string;
|
|
69
|
-
get name(): string;
|
|
70
|
-
get title(): string;
|
|
71
|
-
get bio(): string;
|
|
72
|
-
get avatar(): string | undefined;
|
|
73
|
-
get avatarUrl(): string | undefined;
|
|
74
|
-
get phone(): string | undefined;
|
|
75
|
-
get rate(): number | undefined;
|
|
76
|
-
get isActivated(): boolean;
|
|
77
|
-
get isDeleted(): boolean;
|
|
78
|
-
get lastLogin(): Date | undefined;
|
|
79
|
-
get relevance(): number | undefined;
|
|
80
|
-
get roles(): RoleInterface[];
|
|
81
|
-
get company(): CompanyInterface | undefined;
|
|
82
|
-
get modules(): ModuleInterface[];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export type { CompanyInterface as C, FeatureInterface as F, ModuleInterface as M, RoleInterface as R, UserInterface as U, CompanyInput as a, RoleInput as b, UserInput as c };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { A as ApiDataInterface } from './ApiDataInterface-DPP8s46n.js';
|
|
2
|
-
|
|
3
|
-
interface ModuleInterface extends ApiDataInterface {
|
|
4
|
-
get name(): string;
|
|
5
|
-
get isCore(): boolean;
|
|
6
|
-
get permissions(): {
|
|
7
|
-
create: boolean | string;
|
|
8
|
-
read: boolean | string;
|
|
9
|
-
update: boolean | string;
|
|
10
|
-
delete: boolean | string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface FeatureInterface extends ApiDataInterface {
|
|
15
|
-
get name(): string;
|
|
16
|
-
get isProduction(): boolean;
|
|
17
|
-
get modules(): ModuleInterface[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
type CompanyInput = {
|
|
21
|
-
id: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
logo?: string;
|
|
24
|
-
configurations?: any;
|
|
25
|
-
license?: string;
|
|
26
|
-
privateKey?: string;
|
|
27
|
-
featureIds?: string[];
|
|
28
|
-
moduleIds?: string[];
|
|
29
|
-
};
|
|
30
|
-
interface CompanyInterface extends ApiDataInterface {
|
|
31
|
-
get name(): string;
|
|
32
|
-
get configurations(): any;
|
|
33
|
-
get logo(): string | undefined;
|
|
34
|
-
get logoUrl(): string | undefined;
|
|
35
|
-
get licenseExpirationDate(): Date | undefined;
|
|
36
|
-
get features(): FeatureInterface[];
|
|
37
|
-
get modules(): ModuleInterface[];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
type RoleInput = {
|
|
41
|
-
id: string;
|
|
42
|
-
name: string;
|
|
43
|
-
description?: string;
|
|
44
|
-
};
|
|
45
|
-
interface RoleInterface extends ApiDataInterface {
|
|
46
|
-
get name(): string;
|
|
47
|
-
get description(): string;
|
|
48
|
-
get isSelectable(): boolean;
|
|
49
|
-
get requiredFeature(): FeatureInterface | undefined;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type UserInput = {
|
|
53
|
-
id: string;
|
|
54
|
-
email?: string | undefined | null;
|
|
55
|
-
name?: string;
|
|
56
|
-
title?: string;
|
|
57
|
-
bio?: string;
|
|
58
|
-
password?: string | undefined;
|
|
59
|
-
roleIds?: string[];
|
|
60
|
-
sendInvitationEmail?: boolean;
|
|
61
|
-
companyId?: string;
|
|
62
|
-
adminCreated?: boolean;
|
|
63
|
-
avatar?: string;
|
|
64
|
-
phone?: string;
|
|
65
|
-
rate?: number;
|
|
66
|
-
};
|
|
67
|
-
interface UserInterface extends ApiDataInterface {
|
|
68
|
-
get email(): string;
|
|
69
|
-
get name(): string;
|
|
70
|
-
get title(): string;
|
|
71
|
-
get bio(): string;
|
|
72
|
-
get avatar(): string | undefined;
|
|
73
|
-
get avatarUrl(): string | undefined;
|
|
74
|
-
get phone(): string | undefined;
|
|
75
|
-
get rate(): number | undefined;
|
|
76
|
-
get isActivated(): boolean;
|
|
77
|
-
get isDeleted(): boolean;
|
|
78
|
-
get lastLogin(): Date | undefined;
|
|
79
|
-
get relevance(): number | undefined;
|
|
80
|
-
get roles(): RoleInterface[];
|
|
81
|
-
get company(): CompanyInterface | undefined;
|
|
82
|
-
get modules(): ModuleInterface[];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export type { CompanyInterface as C, FeatureInterface as F, ModuleInterface as M, RoleInterface as R, UserInterface as U, CompanyInput as a, RoleInput as b, UserInput as c };
|
package/dist/utils/index.d.mts
DELETED
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { ClassValue } from 'clsx';
|
|
2
|
-
export { ClassValue } from 'clsx';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { ReactElement, ReactNode } from 'react';
|
|
5
|
-
import { M as ModuleWithPermissions, a as Action } from '../types-t2PyXhDu.mjs';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import { PartialBlock } from '@blocknote/core';
|
|
8
|
-
import { LucideIcon } from 'lucide-react';
|
|
9
|
-
import { A as ApiDataInterface } from '../ApiDataInterface-DPP8s46n.mjs';
|
|
10
|
-
|
|
11
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
12
|
-
|
|
13
|
-
type PossibleRef<T> = React.Ref<T> | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* A utility to compose multiple refs together
|
|
16
|
-
* Accepts callback refs and RefObject(s)
|
|
17
|
-
*/
|
|
18
|
-
declare function composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
|
|
19
|
-
/**
|
|
20
|
-
* A custom hook that composes multiple refs
|
|
21
|
-
* Accepts callback refs and RefObject(s)
|
|
22
|
-
*/
|
|
23
|
-
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
|
|
24
|
-
|
|
25
|
-
declare function useIsMobile(): boolean;
|
|
26
|
-
|
|
27
|
-
type FormatOption = "date" | "time" | "dateTime" | "timeSince" | "default";
|
|
28
|
-
declare const formatDate: (eventDate: Date, formatOption: FormatOption) => string;
|
|
29
|
-
|
|
30
|
-
declare const exists: <T>(itemOrArray: T | T[] | null | undefined) => boolean;
|
|
31
|
-
|
|
32
|
-
declare class TableOptions {
|
|
33
|
-
private _components;
|
|
34
|
-
private _hasPermissionToModule;
|
|
35
|
-
constructor(hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
|
|
36
|
-
module: M;
|
|
37
|
-
action: Action;
|
|
38
|
-
data?: any;
|
|
39
|
-
}) => boolean);
|
|
40
|
-
addOption<M extends ModuleWithPermissions>(component: ReactElement<any> | null, module?: M, action?: Action): void;
|
|
41
|
-
getComponents(): ReactElement<any>[];
|
|
42
|
-
getOptions(): ReactElement<any> | null;
|
|
43
|
-
}
|
|
44
|
-
declare function getTableOptions(params: {
|
|
45
|
-
hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
|
|
46
|
-
module: M;
|
|
47
|
-
action: Action;
|
|
48
|
-
data?: any;
|
|
49
|
-
}) => boolean;
|
|
50
|
-
options: {
|
|
51
|
-
component: ReactElement<any> | null;
|
|
52
|
-
module?: ModuleWithPermissions;
|
|
53
|
-
action?: Action;
|
|
54
|
-
}[];
|
|
55
|
-
}): ReactElement<any> | null;
|
|
56
|
-
declare function getTableComponents(params: {
|
|
57
|
-
hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
|
|
58
|
-
module: M;
|
|
59
|
-
action: Action;
|
|
60
|
-
data?: any;
|
|
61
|
-
}) => boolean;
|
|
62
|
-
options: {
|
|
63
|
-
component: ReactElement<any> | null;
|
|
64
|
-
module?: ModuleWithPermissions;
|
|
65
|
-
action?: Action;
|
|
66
|
-
}[];
|
|
67
|
-
}): ReactElement<any>[];
|
|
68
|
-
|
|
69
|
-
declare const userObjectSchema: z.ZodObject<{
|
|
70
|
-
id: z.ZodString;
|
|
71
|
-
name: z.ZodString;
|
|
72
|
-
avatar: z.ZodOptional<z.ZodString>;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
type UserObject = z.infer<typeof userObjectSchema>;
|
|
75
|
-
|
|
76
|
-
declare const entityObjectSchema: z.ZodObject<{
|
|
77
|
-
id: z.ZodUUID;
|
|
78
|
-
name: z.ZodString;
|
|
79
|
-
}, z.core.$strip>;
|
|
80
|
-
type EntityObject = z.infer<typeof entityObjectSchema>;
|
|
81
|
-
|
|
82
|
-
interface WordDiff {
|
|
83
|
-
type: "added" | "removed" | "unchanged";
|
|
84
|
-
text: string;
|
|
85
|
-
diffId: string;
|
|
86
|
-
accepted?: boolean;
|
|
87
|
-
rejected?: boolean;
|
|
88
|
-
}
|
|
89
|
-
interface DiffBlock {
|
|
90
|
-
id?: string;
|
|
91
|
-
type?: string;
|
|
92
|
-
props?: any;
|
|
93
|
-
content?: any;
|
|
94
|
-
children?: DiffBlock[];
|
|
95
|
-
diffType?: "added" | "removed" | "modified" | "unchanged";
|
|
96
|
-
originalContent?: any;
|
|
97
|
-
diffId?: string;
|
|
98
|
-
wordDiffs?: WordDiff[];
|
|
99
|
-
accepted?: boolean;
|
|
100
|
-
rejected?: boolean;
|
|
101
|
-
}
|
|
102
|
-
interface DiffResult {
|
|
103
|
-
blocks: DiffBlock[];
|
|
104
|
-
hasChanges: boolean;
|
|
105
|
-
}
|
|
106
|
-
interface BlockDiffOptions {
|
|
107
|
-
ignoreIds?: boolean;
|
|
108
|
-
compareContent?: boolean;
|
|
109
|
-
similarityThreshold?: number;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* BlockNote Diff Utility
|
|
113
|
-
* Implements a sophisticated diff algorithm for BlockNote document structures
|
|
114
|
-
*/
|
|
115
|
-
declare class BlockNoteDiffUtil {
|
|
116
|
-
private static readonly DEFAULT_OPTIONS;
|
|
117
|
-
/**
|
|
118
|
-
* Compare two BlockNote documents and return diff result
|
|
119
|
-
*/
|
|
120
|
-
static diff(originalBlocks?: PartialBlock[], newBlocks?: PartialBlock[], options?: BlockDiffOptions): DiffResult;
|
|
121
|
-
/**
|
|
122
|
-
* Compare two blocks for equality
|
|
123
|
-
*/
|
|
124
|
-
private static areBlocksEqual;
|
|
125
|
-
/**
|
|
126
|
-
* Deep equality comparison for objects
|
|
127
|
-
*/
|
|
128
|
-
private static deepEqual;
|
|
129
|
-
/**
|
|
130
|
-
* Sort diff blocks to maintain logical order
|
|
131
|
-
*/
|
|
132
|
-
private static sortDiffBlocks;
|
|
133
|
-
/**
|
|
134
|
-
* Calculate similarity between two text contents
|
|
135
|
-
*/
|
|
136
|
-
private static calculateSimilarity;
|
|
137
|
-
/**
|
|
138
|
-
* Extract plain text from BlockNote content array
|
|
139
|
-
*/
|
|
140
|
-
private static extractTextFromContent;
|
|
141
|
-
/**
|
|
142
|
-
* Calculate Levenshtein distance between two strings
|
|
143
|
-
*/
|
|
144
|
-
private static levenshteinDistance;
|
|
145
|
-
/**
|
|
146
|
-
* Generate word-level diffs between two content arrays
|
|
147
|
-
*/
|
|
148
|
-
static generateWordDiffs(originalContent: any, newContent: any, blockId: string): WordDiff[];
|
|
149
|
-
/**
|
|
150
|
-
* Perform word-level diff using word-only approach (no space tokenization)
|
|
151
|
-
*/
|
|
152
|
-
private static diffWords; /**
|
|
153
|
-
* Improved diff algorithm that better handles word insertions
|
|
154
|
-
* Uses a combination of LCS and heuristics to minimize false changes
|
|
155
|
-
*/
|
|
156
|
-
private static myersDiff;
|
|
157
|
-
/**
|
|
158
|
-
* Compute edit script using dynamic programming
|
|
159
|
-
*/
|
|
160
|
-
private static computeEditScript;
|
|
161
|
-
/**
|
|
162
|
-
* Reconstruct the actual diff from the DP table
|
|
163
|
-
*/
|
|
164
|
-
private static reconstructDiff;
|
|
165
|
-
/**
|
|
166
|
-
* Consolidate adjacent changes to reduce fragmentation
|
|
167
|
-
* e.g., if we have: delete "Key", insert "Key!", delete "Challenges"
|
|
168
|
-
* We can consolidate this into: replace ["Key", "Challenges"] with ["Key!"]
|
|
169
|
-
*/
|
|
170
|
-
private static consolidateAdjacentChanges;
|
|
171
|
-
/**
|
|
172
|
-
* Determine if a sequence of changes should be consolidated
|
|
173
|
-
*/
|
|
174
|
-
private static shouldConsolidateChanges;
|
|
175
|
-
/**
|
|
176
|
-
* Check if two words are similar enough to be considered a replacement
|
|
177
|
-
*/
|
|
178
|
-
private static areWordsSimilar;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
declare class BlockNoteWordDiffRendererUtil {
|
|
182
|
-
static renderWordDiffs(diffBlocks: DiffBlock[], onAcceptChange?: (diffId: string) => void, onRejectChange?: (diffId: string) => void, acceptedChanges?: Set<string>, rejectedChanges?: Set<string>): PartialBlock[];
|
|
183
|
-
private static updateWordDiffStates;
|
|
184
|
-
private static renderDiffBlock;
|
|
185
|
-
private static renderBlockLevelDiff;
|
|
186
|
-
private static renderWordLevelDiff;
|
|
187
|
-
private static groupAndRenderWordDiffs;
|
|
188
|
-
private static cleanupSpaces;
|
|
189
|
-
private static isLastDiffInGroup;
|
|
190
|
-
private static createTextContent;
|
|
191
|
-
private static getBlockProps;
|
|
192
|
-
static generateChangeSummary(diffBlocks: DiffBlock[]): {
|
|
193
|
-
totalWords: number;
|
|
194
|
-
addedWords: number;
|
|
195
|
-
removedWords: number;
|
|
196
|
-
acceptedChanges: number;
|
|
197
|
-
rejectedChanges: number;
|
|
198
|
-
pendingChanges: number;
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
declare const getIconByModule: (params: {
|
|
203
|
-
module: ModuleWithPermissions;
|
|
204
|
-
className?: string;
|
|
205
|
-
}) => ReactNode;
|
|
206
|
-
declare const getIcon: (params: {
|
|
207
|
-
element: ApiDataInterface;
|
|
208
|
-
className?: string;
|
|
209
|
-
}) => ReactNode;
|
|
210
|
-
declare const getIconByModuleName: (params: {
|
|
211
|
-
name: string;
|
|
212
|
-
className?: string;
|
|
213
|
-
}) => ReactNode;
|
|
214
|
-
declare const getLucideIcon: (params: {
|
|
215
|
-
element: ApiDataInterface;
|
|
216
|
-
}) => LucideIcon | null;
|
|
217
|
-
declare const getLucideIconByModule: (params: {
|
|
218
|
-
module: ModuleWithPermissions;
|
|
219
|
-
}) => LucideIcon | null;
|
|
220
|
-
declare const getLucideIconByModuleName: (params: {
|
|
221
|
-
name: string;
|
|
222
|
-
}) => LucideIcon | null;
|
|
223
|
-
|
|
224
|
-
export { type BlockDiffOptions, BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, type DiffBlock, type DiffResult, type EntityObject, type FormatOption, TableOptions, type UserObject, type WordDiff, cn, composeRefs, entityObjectSchema, exists, formatDate, getIcon, getIconByModule, getIconByModuleName, getLucideIcon, getLucideIconByModule, getLucideIconByModuleName, getTableComponents, getTableOptions, useComposedRefs, useIsMobile, userObjectSchema };
|