@carlonicora/nextjs-jsonapi 1.5.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/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/AuthComponent-hxOPs9o8.d.mts +11 -0
- package/dist/AuthComponent-hxOPs9o8.d.ts +11 -0
- package/dist/{BlockNoteEditor-G6AK2NWA.js → BlockNoteEditor-7FM7B737.js} +19 -22
- package/dist/BlockNoteEditor-7FM7B737.js.map +1 -0
- package/dist/{BlockNoteEditor-AIEEQM6A.mjs → BlockNoteEditor-RVL76ZAS.mjs} +11 -14
- 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-37NJZ2VD.mjs +637 -0
- 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-VET55IZO.js → chunk-SVX7E6RR.js} +10293 -7536
- 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 -11
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +73 -10
- package/dist/components/index.d.mts +763 -11
- package/dist/components/index.d.ts +763 -11
- package/dist/components/index.js +465 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +466 -12
- 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-CR2aBeAW.d.ts → content.interface-Bs8a7uW6.d.mts} +2 -3
- package/dist/{content.interface-FpLfsaRm.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 -11
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +9 -10
- 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/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-BV6yMdWS.d.ts → useSocket-8vwK_R_c.d.ts} +1 -1
- package/dist/{useSocket-L-An7_Mr.d.mts → useSocket-BWJUXuOl.d.mts} +1 -1
- package/package.json +12 -52
- 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/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/AuthComponent-B_Ps2Vb9.d.ts +0 -78
- package/dist/AuthComponent-CxnGgvoh.d.mts +0 -78
- package/dist/BlockNoteEditor-AIEEQM6A.mjs.map +0 -1
- package/dist/BlockNoteEditor-G6AK2NWA.js.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-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-J7YDGYSW.mjs +0 -9332
- package/dist/chunk-J7YDGYSW.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-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-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-VET55IZO.js.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 -477
- package/dist/features/index.d.ts +0 -477
- package/dist/features/index.js +0 -108
- package/dist/features/index.js.map +0 -1
- package/dist/features/index.mjs +0 -108
- package/dist/hooks/index.d.mts +0 -69
- package/dist/hooks/index.d.ts +0 -69
- package/dist/hooks/index.js +0 -55
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -55
- 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-B2BrLoDA.d.mts +0 -14
- package/dist/notification.interface-DlZLnAfg.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-CooB1R79.d.mts +0 -85
- package/dist/user.interface-KnIT9pVY.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
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
interface JsonApiHydratedDataInterface {
|
|
4
|
+
jsonApi: any;
|
|
5
|
+
included: any[];
|
|
6
|
+
allData?: any[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ApiDataInterface {
|
|
10
|
+
get included(): any[];
|
|
11
|
+
get type(): string;
|
|
12
|
+
get id(): string;
|
|
13
|
+
get createdAt(): Date;
|
|
14
|
+
get updatedAt(): Date;
|
|
15
|
+
get self(): string | undefined;
|
|
16
|
+
get jsonApi(): any;
|
|
17
|
+
generateApiUrl(params?: any): string;
|
|
18
|
+
dehydrate(): JsonApiHydratedDataInterface;
|
|
19
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
20
|
+
createJsonApi(data: any): any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type GetterKeys<T> = {
|
|
24
|
+
[K in keyof T]: T[K] extends () => any ? never : K;
|
|
25
|
+
}[keyof T];
|
|
26
|
+
type FieldSelector<T> = {
|
|
27
|
+
type: string;
|
|
28
|
+
fields: ReadonlyArray<GetterKeys<T>>;
|
|
29
|
+
};
|
|
30
|
+
declare function createJsonApiInclusion<T>(dataType: string, fields: ReadonlyArray<GetterKeys<T>>): FieldSelector<T>;
|
|
31
|
+
|
|
32
|
+
type ApiRequestDataTypeInterface = {
|
|
33
|
+
name: string;
|
|
34
|
+
cache?: string;
|
|
35
|
+
inclusions?: Record<string, {
|
|
36
|
+
types?: string[];
|
|
37
|
+
fields?: FieldSelector<any>[];
|
|
38
|
+
}>;
|
|
39
|
+
model: new () => any;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Permission actions
|
|
44
|
+
*/
|
|
45
|
+
declare enum Action {
|
|
46
|
+
Read = "read",
|
|
47
|
+
Create = "create",
|
|
48
|
+
Update = "update",
|
|
49
|
+
Delete = "delete"
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Generic permission check type.
|
|
53
|
+
* Can be a boolean or a function that checks permissions dynamically.
|
|
54
|
+
* @template T - The data type being checked
|
|
55
|
+
* @template U - The user type (defaults to PermissionUser)
|
|
56
|
+
*/
|
|
57
|
+
type PermissionCheck<T, U = PermissionUser> = boolean | ((user?: U | string, data?: T) => boolean);
|
|
58
|
+
/**
|
|
59
|
+
* Page URL configuration for modules
|
|
60
|
+
*/
|
|
61
|
+
type PageUrl = {
|
|
62
|
+
pageUrl?: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Module permission definition wrapper
|
|
66
|
+
*/
|
|
67
|
+
type ModulePermissionDefinition<T> = {
|
|
68
|
+
interface: T;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Base module definition
|
|
72
|
+
*/
|
|
73
|
+
type ModuleDefinition = {
|
|
74
|
+
pageUrl?: string;
|
|
75
|
+
name: string;
|
|
76
|
+
model: any;
|
|
77
|
+
feature?: string;
|
|
78
|
+
moduleId?: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Permission configuration for a module.
|
|
82
|
+
* Can be a boolean (allow/deny all) or a string path for dynamic checks.
|
|
83
|
+
*/
|
|
84
|
+
interface PermissionConfig {
|
|
85
|
+
create: boolean | string;
|
|
86
|
+
read: boolean | string;
|
|
87
|
+
update: boolean | string;
|
|
88
|
+
delete: boolean | string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Generic interface for a module that has permissions.
|
|
92
|
+
* Apps should ensure their Module class implements this.
|
|
93
|
+
*/
|
|
94
|
+
interface PermissionModule {
|
|
95
|
+
id: string;
|
|
96
|
+
permissions: PermissionConfig;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Generic interface for a user that has modules with permissions.
|
|
100
|
+
* Apps should ensure their User class implements this.
|
|
101
|
+
*/
|
|
102
|
+
interface PermissionUser {
|
|
103
|
+
id: string;
|
|
104
|
+
modules: PermissionModule[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Module definition with permissions - extends ApiRequestDataTypeInterface
|
|
108
|
+
*/
|
|
109
|
+
type ModuleWithPermissions = ApiRequestDataTypeInterface & {
|
|
110
|
+
pageUrl?: string;
|
|
111
|
+
feature?: string;
|
|
112
|
+
moduleId?: string;
|
|
113
|
+
icon?: LucideIcon;
|
|
114
|
+
inclusions?: Record<string, {
|
|
115
|
+
types?: string[];
|
|
116
|
+
fields?: FieldSelector<any>[];
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Factory type for creating module definitions
|
|
121
|
+
*/
|
|
122
|
+
type ModuleFactory = (params: {
|
|
123
|
+
pageUrl?: string;
|
|
124
|
+
name: string;
|
|
125
|
+
cache?: string | "days" | "default" | "hours" | "max" | "minutes" | "seconds" | "weeks";
|
|
126
|
+
model: any;
|
|
127
|
+
feature?: string;
|
|
128
|
+
moduleId?: string;
|
|
129
|
+
icon?: LucideIcon;
|
|
130
|
+
inclusions?: Record<string, {
|
|
131
|
+
types?: string[];
|
|
132
|
+
fields?: FieldSelector<any>[];
|
|
133
|
+
}>;
|
|
134
|
+
}) => ModuleWithPermissions;
|
|
135
|
+
|
|
136
|
+
interface ModuleInterface extends ApiDataInterface {
|
|
137
|
+
get name(): string;
|
|
138
|
+
get isCore(): boolean;
|
|
139
|
+
get permissions(): {
|
|
140
|
+
create: boolean | string;
|
|
141
|
+
read: boolean | string;
|
|
142
|
+
update: boolean | string;
|
|
143
|
+
delete: boolean | string;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface FeatureInterface extends ApiDataInterface {
|
|
148
|
+
get name(): string;
|
|
149
|
+
get isProduction(): boolean;
|
|
150
|
+
get modules(): ModuleInterface[];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
type CompanyInput = {
|
|
154
|
+
id: string;
|
|
155
|
+
name?: string;
|
|
156
|
+
logo?: string;
|
|
157
|
+
configurations?: any;
|
|
158
|
+
license?: string;
|
|
159
|
+
privateKey?: string;
|
|
160
|
+
featureIds?: string[];
|
|
161
|
+
moduleIds?: string[];
|
|
162
|
+
};
|
|
163
|
+
interface CompanyInterface extends ApiDataInterface {
|
|
164
|
+
get name(): string;
|
|
165
|
+
get configurations(): any;
|
|
166
|
+
get logo(): string | undefined;
|
|
167
|
+
get logoUrl(): string | undefined;
|
|
168
|
+
get licenseExpirationDate(): Date | undefined;
|
|
169
|
+
get features(): FeatureInterface[];
|
|
170
|
+
get modules(): ModuleInterface[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
type RoleInput = {
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
description?: string;
|
|
177
|
+
};
|
|
178
|
+
interface RoleInterface extends ApiDataInterface {
|
|
179
|
+
get name(): string;
|
|
180
|
+
get description(): string;
|
|
181
|
+
get isSelectable(): boolean;
|
|
182
|
+
get requiredFeature(): FeatureInterface | undefined;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
type UserInput = {
|
|
186
|
+
id: string;
|
|
187
|
+
email?: string | undefined | null;
|
|
188
|
+
name?: string;
|
|
189
|
+
title?: string;
|
|
190
|
+
bio?: string;
|
|
191
|
+
password?: string | undefined;
|
|
192
|
+
roleIds?: string[];
|
|
193
|
+
sendInvitationEmail?: boolean;
|
|
194
|
+
companyId?: string;
|
|
195
|
+
adminCreated?: boolean;
|
|
196
|
+
avatar?: string;
|
|
197
|
+
phone?: string;
|
|
198
|
+
rate?: number;
|
|
199
|
+
};
|
|
200
|
+
interface UserInterface extends ApiDataInterface {
|
|
201
|
+
get email(): string;
|
|
202
|
+
get name(): string;
|
|
203
|
+
get title(): string;
|
|
204
|
+
get bio(): string;
|
|
205
|
+
get avatar(): string | undefined;
|
|
206
|
+
get avatarUrl(): string | undefined;
|
|
207
|
+
get phone(): string | undefined;
|
|
208
|
+
get rate(): number | undefined;
|
|
209
|
+
get isActivated(): boolean;
|
|
210
|
+
get isDeleted(): boolean;
|
|
211
|
+
get lastLogin(): Date | undefined;
|
|
212
|
+
get relevance(): number | undefined;
|
|
213
|
+
get roles(): RoleInterface[];
|
|
214
|
+
get company(): CompanyInterface | undefined;
|
|
215
|
+
get modules(): ModuleInterface[];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
type NotificationInput = {
|
|
219
|
+
id: string;
|
|
220
|
+
isRead: boolean;
|
|
221
|
+
};
|
|
222
|
+
interface NotificationInterface extends ApiDataInterface {
|
|
223
|
+
get notificationType(): string;
|
|
224
|
+
get isRead(): boolean;
|
|
225
|
+
get actor(): UserInterface | undefined;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export { type ApiDataInterface as A, type CompanyInput as C, type FieldSelector as F, type GetterKeys as G, type JsonApiHydratedDataInterface as J, type ModuleWithPermissions as M, type NotificationInterface as N, type PermissionUser as P, type RoleInput as R, type UserInterface as U, type ApiRequestDataTypeInterface as a, Action as b, type PermissionModule as c, createJsonApiInclusion as d, type CompanyInterface as e, type FeatureInterface as f, type ModuleInterface as g, type NotificationInput as h, type RoleInterface as i, type UserInput as j, type PermissionCheck as k, type PageUrl as l, type ModulePermissionDefinition as m, type ModuleDefinition as n, type PermissionConfig as o, type ModuleFactory as p };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk3ZPK4QOBjs = require('./chunk-3ZPK4QOB.js');
|
|
4
|
+
require('./chunk-7QVYU63E.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.serverRequest = _chunk3ZPK4QOBjs.serverRequest;
|
|
8
|
+
//# sourceMappingURL=request-GBLBPYFM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/request-GBLBPYFM.js"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACF,uDAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/request-GBLBPYFM.js"}
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import { A as ApiDataInterface,
|
|
2
|
-
import { A as ApiRequestDataTypeInterface } from './types-t2PyXhDu.js';
|
|
3
|
-
|
|
4
|
-
declare abstract class AbstractApiData implements ApiDataInterface {
|
|
5
|
-
protected _jsonApi?: any;
|
|
6
|
-
protected _included?: any[];
|
|
7
|
-
protected _id?: string;
|
|
8
|
-
protected _type?: string;
|
|
9
|
-
protected _createdAt?: Date;
|
|
10
|
-
protected _updatedAt?: Date;
|
|
11
|
-
protected _self?: string;
|
|
12
|
-
get type(): string;
|
|
13
|
-
get id(): string;
|
|
14
|
-
get self(): string | undefined;
|
|
15
|
-
get createdAt(): Date;
|
|
16
|
-
get updatedAt(): Date;
|
|
17
|
-
get included(): any[];
|
|
18
|
-
get jsonApi(): any;
|
|
19
|
-
ingestJsonApi(_data: JsonApiHydratedDataInterface): void;
|
|
20
|
-
generateApiUrl(_params?: any): string;
|
|
21
|
-
createJsonApi(_data?: any): any;
|
|
22
|
-
protected _readIncluded<T extends ApiDataInterface>(data: JsonApiHydratedDataInterface, type: string, dataType: ApiRequestDataTypeInterface): T | T[] | undefined;
|
|
23
|
-
dehydrate(): JsonApiHydratedDataInterface;
|
|
24
|
-
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
25
|
-
}
|
|
1
|
+
import { a as ApiRequestDataTypeInterface, A as ApiDataInterface, U as UserInterface } from './notification.interface-BdcwkuQE.js';
|
|
26
2
|
|
|
27
3
|
declare enum HttpMethod {
|
|
28
4
|
GET = "GET",
|
|
@@ -106,4 +82,38 @@ declare abstract class AbstractService {
|
|
|
106
82
|
}): Promise<any>;
|
|
107
83
|
}
|
|
108
84
|
|
|
109
|
-
|
|
85
|
+
type AuthInput = {
|
|
86
|
+
id?: string;
|
|
87
|
+
email?: string | undefined | null;
|
|
88
|
+
password?: string | undefined;
|
|
89
|
+
name?: string;
|
|
90
|
+
companyName?: string;
|
|
91
|
+
partitaIva?: string;
|
|
92
|
+
codiceFiscale?: string;
|
|
93
|
+
};
|
|
94
|
+
type AuthQuery = {
|
|
95
|
+
userId?: string;
|
|
96
|
+
tokenCode?: string;
|
|
97
|
+
refreshToken?: string;
|
|
98
|
+
login?: boolean;
|
|
99
|
+
forgot?: boolean;
|
|
100
|
+
code?: string;
|
|
101
|
+
activationCode?: string;
|
|
102
|
+
checkUsername?: string;
|
|
103
|
+
};
|
|
104
|
+
interface AuthInterface extends ApiDataInterface {
|
|
105
|
+
get token(): string;
|
|
106
|
+
get refreshToken(): string;
|
|
107
|
+
get user(): UserInterface;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type S3Input = {
|
|
111
|
+
key: string;
|
|
112
|
+
contentType?: string;
|
|
113
|
+
};
|
|
114
|
+
interface S3Interface extends ApiDataInterface {
|
|
115
|
+
get url(): string;
|
|
116
|
+
get headers(): Record<string, string>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { AbstractService as A, HttpMethod as H, type NextRef as N, type PreviousRef as P, type SelfRef as S, type AuthInput as a, type AuthQuery as b, type AuthInterface as c, type S3Input as d, type S3Interface as e, getGlobalErrorHandler as g, setGlobalErrorHandler as s };
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import { A as ApiDataInterface,
|
|
2
|
-
import { A as ApiRequestDataTypeInterface } from './types-t2PyXhDu.mjs';
|
|
3
|
-
|
|
4
|
-
declare abstract class AbstractApiData implements ApiDataInterface {
|
|
5
|
-
protected _jsonApi?: any;
|
|
6
|
-
protected _included?: any[];
|
|
7
|
-
protected _id?: string;
|
|
8
|
-
protected _type?: string;
|
|
9
|
-
protected _createdAt?: Date;
|
|
10
|
-
protected _updatedAt?: Date;
|
|
11
|
-
protected _self?: string;
|
|
12
|
-
get type(): string;
|
|
13
|
-
get id(): string;
|
|
14
|
-
get self(): string | undefined;
|
|
15
|
-
get createdAt(): Date;
|
|
16
|
-
get updatedAt(): Date;
|
|
17
|
-
get included(): any[];
|
|
18
|
-
get jsonApi(): any;
|
|
19
|
-
ingestJsonApi(_data: JsonApiHydratedDataInterface): void;
|
|
20
|
-
generateApiUrl(_params?: any): string;
|
|
21
|
-
createJsonApi(_data?: any): any;
|
|
22
|
-
protected _readIncluded<T extends ApiDataInterface>(data: JsonApiHydratedDataInterface, type: string, dataType: ApiRequestDataTypeInterface): T | T[] | undefined;
|
|
23
|
-
dehydrate(): JsonApiHydratedDataInterface;
|
|
24
|
-
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
25
|
-
}
|
|
1
|
+
import { a as ApiRequestDataTypeInterface, A as ApiDataInterface, U as UserInterface } from './notification.interface-BdcwkuQE.mjs';
|
|
26
2
|
|
|
27
3
|
declare enum HttpMethod {
|
|
28
4
|
GET = "GET",
|
|
@@ -106,4 +82,38 @@ declare abstract class AbstractService {
|
|
|
106
82
|
}): Promise<any>;
|
|
107
83
|
}
|
|
108
84
|
|
|
109
|
-
|
|
85
|
+
type AuthInput = {
|
|
86
|
+
id?: string;
|
|
87
|
+
email?: string | undefined | null;
|
|
88
|
+
password?: string | undefined;
|
|
89
|
+
name?: string;
|
|
90
|
+
companyName?: string;
|
|
91
|
+
partitaIva?: string;
|
|
92
|
+
codiceFiscale?: string;
|
|
93
|
+
};
|
|
94
|
+
type AuthQuery = {
|
|
95
|
+
userId?: string;
|
|
96
|
+
tokenCode?: string;
|
|
97
|
+
refreshToken?: string;
|
|
98
|
+
login?: boolean;
|
|
99
|
+
forgot?: boolean;
|
|
100
|
+
code?: string;
|
|
101
|
+
activationCode?: string;
|
|
102
|
+
checkUsername?: string;
|
|
103
|
+
};
|
|
104
|
+
interface AuthInterface extends ApiDataInterface {
|
|
105
|
+
get token(): string;
|
|
106
|
+
get refreshToken(): string;
|
|
107
|
+
get user(): UserInterface;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type S3Input = {
|
|
111
|
+
key: string;
|
|
112
|
+
contentType?: string;
|
|
113
|
+
};
|
|
114
|
+
interface S3Interface extends ApiDataInterface {
|
|
115
|
+
get url(): string;
|
|
116
|
+
get headers(): Record<string, string>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { AbstractService as A, HttpMethod as H, type NextRef as N, type PreviousRef as P, type SelfRef as S, type AuthInput as a, type AuthQuery as b, type AuthInterface as c, type S3Input as d, type S3Interface as e, getGlobalErrorHandler as g, setGlobalErrorHandler as s };
|
package/dist/server/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { A as ApiData } from '../
|
|
2
|
-
import { M as ModuleWithPermissions,
|
|
1
|
+
import { A as ApiData, a as ApiResponseInterface } from '../ApiResponseInterface-CfcC7pPC.mjs';
|
|
2
|
+
import { M as ModuleWithPermissions, b as Action, a as ApiRequestDataTypeInterface, U as UserInterface, J as JsonApiHydratedDataInterface, j as UserInput, e as CompanyInterface, C as CompanyInput, i as RoleInterface, N as NotificationInterface, f as FeatureInterface } from '../notification.interface-BdcwkuQE.mjs';
|
|
3
|
+
import { A as AbstractService, a as AuthInput, c as AuthInterface, N as NextRef, P as PreviousRef, e as S3Interface } from '../s3.interface-DlaMDRTn.mjs';
|
|
4
|
+
import { a as ContentInterface } from '../content.interface-Bs8a7uW6.mjs';
|
|
3
5
|
import 'lucide-react';
|
|
4
6
|
|
|
5
7
|
type CacheProfile = "seconds" | "minutes" | "hours" | "days" | "weeks" | "max" | "default";
|
|
@@ -34,7 +36,7 @@ interface ServerRequestParams {
|
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Server-side request with Next.js caching support.
|
|
37
|
-
* Uses
|
|
39
|
+
* Uses fetch's native caching options for Next.js compatibility.
|
|
38
40
|
*/
|
|
39
41
|
declare function serverRequest(params: ServerRequestParams): Promise<ApiData>;
|
|
40
42
|
|
|
@@ -62,4 +64,297 @@ declare class ServerSession {
|
|
|
62
64
|
*/
|
|
63
65
|
declare function getServerToken(): Promise<string | undefined>;
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Configure the JSON:API server client.
|
|
69
|
+
* Call this in your Bootstrapper or server initialization.
|
|
70
|
+
*/
|
|
71
|
+
declare function configureServerJsonApi(config: {
|
|
72
|
+
apiUrl: string;
|
|
73
|
+
appUrl?: string;
|
|
74
|
+
trackablePages?: ModuleWithPermissions[];
|
|
75
|
+
bootstrapper?: () => void;
|
|
76
|
+
additionalHeaders?: Record<string, string>;
|
|
77
|
+
}): void;
|
|
78
|
+
declare function getServerApiUrl(): string;
|
|
79
|
+
declare function getServerAppUrl(): string;
|
|
80
|
+
declare function getServerTrackablePages(): ModuleWithPermissions[];
|
|
81
|
+
declare function ServerJsonApiGet(params: {
|
|
82
|
+
classKey: ApiRequestDataTypeInterface;
|
|
83
|
+
endpoint: string;
|
|
84
|
+
companyId?: string;
|
|
85
|
+
language: string;
|
|
86
|
+
}): Promise<ApiResponseInterface>;
|
|
87
|
+
declare function ServerJsonApiPost(params: {
|
|
88
|
+
classKey: ApiRequestDataTypeInterface;
|
|
89
|
+
endpoint: string;
|
|
90
|
+
companyId?: string;
|
|
91
|
+
body?: any;
|
|
92
|
+
overridesJsonApiCreation?: boolean;
|
|
93
|
+
files?: {
|
|
94
|
+
[key: string]: File | Blob;
|
|
95
|
+
} | File | Blob;
|
|
96
|
+
language: string;
|
|
97
|
+
responseType?: ApiRequestDataTypeInterface;
|
|
98
|
+
}): Promise<ApiResponseInterface>;
|
|
99
|
+
declare function ServerJsonApiPut(params: {
|
|
100
|
+
classKey: ApiRequestDataTypeInterface;
|
|
101
|
+
endpoint: string;
|
|
102
|
+
companyId?: string;
|
|
103
|
+
body?: any;
|
|
104
|
+
files?: {
|
|
105
|
+
[key: string]: File | Blob;
|
|
106
|
+
} | File | Blob;
|
|
107
|
+
language: string;
|
|
108
|
+
responseType?: ApiRequestDataTypeInterface;
|
|
109
|
+
}): Promise<ApiResponseInterface>;
|
|
110
|
+
declare function ServerJsonApiPatch(params: {
|
|
111
|
+
classKey: ApiRequestDataTypeInterface;
|
|
112
|
+
endpoint: string;
|
|
113
|
+
companyId?: string;
|
|
114
|
+
body?: any;
|
|
115
|
+
files?: {
|
|
116
|
+
[key: string]: File | Blob;
|
|
117
|
+
} | File | Blob;
|
|
118
|
+
overridesJsonApiCreation?: boolean;
|
|
119
|
+
responseType?: ApiRequestDataTypeInterface;
|
|
120
|
+
language: string;
|
|
121
|
+
}): Promise<ApiResponseInterface>;
|
|
122
|
+
declare function ServerJsonApiDelete(params: {
|
|
123
|
+
classKey: ApiRequestDataTypeInterface;
|
|
124
|
+
endpoint: string;
|
|
125
|
+
companyId?: string;
|
|
126
|
+
language: string;
|
|
127
|
+
responseType?: ApiRequestDataTypeInterface;
|
|
128
|
+
}): Promise<ApiResponseInterface>;
|
|
129
|
+
|
|
130
|
+
declare class AuthService extends AbstractService {
|
|
131
|
+
static login(params: {
|
|
132
|
+
email: string;
|
|
133
|
+
password: string;
|
|
134
|
+
language?: string;
|
|
135
|
+
}): Promise<UserInterface>;
|
|
136
|
+
static logout(params?: {
|
|
137
|
+
language?: string;
|
|
138
|
+
}): Promise<void>;
|
|
139
|
+
static initialiseForgotPassword(params: {
|
|
140
|
+
email: string;
|
|
141
|
+
language?: string;
|
|
142
|
+
}): Promise<void>;
|
|
143
|
+
static register(params: AuthInput): Promise<void>;
|
|
144
|
+
static activate(params: {
|
|
145
|
+
activationCode: string;
|
|
146
|
+
}): Promise<void>;
|
|
147
|
+
static validateCode(params: {
|
|
148
|
+
code: string;
|
|
149
|
+
language?: string;
|
|
150
|
+
}): Promise<void>;
|
|
151
|
+
static resetPassword(params: {
|
|
152
|
+
code: string;
|
|
153
|
+
password: string;
|
|
154
|
+
}): Promise<void>;
|
|
155
|
+
static acceptInvitation(params: {
|
|
156
|
+
code: string;
|
|
157
|
+
password: string;
|
|
158
|
+
}): Promise<void>;
|
|
159
|
+
static findToken(params: {
|
|
160
|
+
tokenCode: string;
|
|
161
|
+
}): Promise<AuthInterface>;
|
|
162
|
+
static saveToken(params: {
|
|
163
|
+
dehydratedAuth: JsonApiHydratedDataInterface;
|
|
164
|
+
}): Promise<void>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare class UserService extends AbstractService {
|
|
168
|
+
static findFullUser(): Promise<UserInterface>;
|
|
169
|
+
static findById(params: {
|
|
170
|
+
userId: string;
|
|
171
|
+
}): Promise<UserInterface>;
|
|
172
|
+
static findByEmail(params: {
|
|
173
|
+
email: string;
|
|
174
|
+
}): Promise<UserInterface>;
|
|
175
|
+
static findMany(params: {
|
|
176
|
+
roleId?: string;
|
|
177
|
+
search?: string;
|
|
178
|
+
fetchAll?: boolean;
|
|
179
|
+
includeDeleted?: boolean;
|
|
180
|
+
next?: NextRef;
|
|
181
|
+
prev?: PreviousRef;
|
|
182
|
+
}): Promise<UserInterface[]>;
|
|
183
|
+
static findManyByContentIds(params: {
|
|
184
|
+
contentIds: string[];
|
|
185
|
+
search?: string;
|
|
186
|
+
next?: NextRef;
|
|
187
|
+
prev?: PreviousRef;
|
|
188
|
+
}): Promise<UserInterface[]>;
|
|
189
|
+
static findRelevant(params: {
|
|
190
|
+
id: string;
|
|
191
|
+
next?: NextRef;
|
|
192
|
+
prev?: PreviousRef;
|
|
193
|
+
}): Promise<UserInterface[]>;
|
|
194
|
+
static findManyForAmin(params: {
|
|
195
|
+
companyId?: string;
|
|
196
|
+
search?: string;
|
|
197
|
+
next?: NextRef;
|
|
198
|
+
prev?: PreviousRef;
|
|
199
|
+
}): Promise<UserInterface[]>;
|
|
200
|
+
static findAllUsers(params: {
|
|
201
|
+
companyId: string;
|
|
202
|
+
search?: string;
|
|
203
|
+
limitToRoles?: string[];
|
|
204
|
+
isDeleted?: boolean;
|
|
205
|
+
next?: NextRef;
|
|
206
|
+
prev?: PreviousRef;
|
|
207
|
+
}): Promise<UserInterface[]>;
|
|
208
|
+
static findAllUsersByRole(params: {
|
|
209
|
+
roleId: string;
|
|
210
|
+
search?: string;
|
|
211
|
+
next?: NextRef;
|
|
212
|
+
prev?: PreviousRef;
|
|
213
|
+
}): Promise<UserInterface[]>;
|
|
214
|
+
static findAllUsersNotInRole(params: {
|
|
215
|
+
roleId: string;
|
|
216
|
+
search?: string;
|
|
217
|
+
next?: NextRef;
|
|
218
|
+
prev?: PreviousRef;
|
|
219
|
+
}): Promise<UserInterface[]>;
|
|
220
|
+
static create(params: UserInput): Promise<UserInterface>;
|
|
221
|
+
static reactivate(params: {
|
|
222
|
+
userId: string;
|
|
223
|
+
}): Promise<UserInterface>;
|
|
224
|
+
static sendInvitation(params: {
|
|
225
|
+
userId: string;
|
|
226
|
+
companyId?: string;
|
|
227
|
+
}): Promise<void>;
|
|
228
|
+
static update(params: UserInput): Promise<UserInterface>;
|
|
229
|
+
static patchRate(params: UserInput): Promise<UserInterface>;
|
|
230
|
+
static delete(params: {
|
|
231
|
+
userId: string;
|
|
232
|
+
companyId: string;
|
|
233
|
+
}): Promise<void>;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
declare class CompanyService extends AbstractService {
|
|
237
|
+
static findOne(params: {
|
|
238
|
+
companyId: string;
|
|
239
|
+
}): Promise<CompanyInterface>;
|
|
240
|
+
static findMany(params: {
|
|
241
|
+
search?: string;
|
|
242
|
+
next?: NextRef;
|
|
243
|
+
}): Promise<CompanyInterface[]>;
|
|
244
|
+
static delete(params: {
|
|
245
|
+
companyId: string;
|
|
246
|
+
}): Promise<void>;
|
|
247
|
+
static create(params: CompanyInput): Promise<CompanyInterface>;
|
|
248
|
+
static update(params: CompanyInput): Promise<CompanyInterface>;
|
|
249
|
+
static updateConfigurations(params: CompanyInput): Promise<CompanyInterface>;
|
|
250
|
+
static activateLicense(params: CompanyInput): Promise<CompanyInterface>;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare class RoleService extends AbstractService {
|
|
254
|
+
static findById(params: {
|
|
255
|
+
roleId: string;
|
|
256
|
+
}): Promise<RoleInterface>;
|
|
257
|
+
static findAllRoles(params: {
|
|
258
|
+
search?: string;
|
|
259
|
+
next?: NextRef;
|
|
260
|
+
}): Promise<RoleInterface[]>;
|
|
261
|
+
static findAllRolesByUser(params: {
|
|
262
|
+
userId: string;
|
|
263
|
+
search?: string;
|
|
264
|
+
next?: NextRef;
|
|
265
|
+
prev?: PreviousRef;
|
|
266
|
+
}): Promise<RoleInterface[]>;
|
|
267
|
+
static findAllRolesUserNotIn(params: {
|
|
268
|
+
userId: string;
|
|
269
|
+
search?: string;
|
|
270
|
+
next?: NextRef;
|
|
271
|
+
prev?: PreviousRef;
|
|
272
|
+
}): Promise<RoleInterface[]>;
|
|
273
|
+
static addUserToRole(params: {
|
|
274
|
+
userId: string;
|
|
275
|
+
roleId: string;
|
|
276
|
+
}): Promise<void>;
|
|
277
|
+
static removeUserFromRole(params: {
|
|
278
|
+
userId: string;
|
|
279
|
+
roleId: string;
|
|
280
|
+
}): Promise<void>;
|
|
281
|
+
static create(params: {
|
|
282
|
+
roleId: string;
|
|
283
|
+
name: string;
|
|
284
|
+
description?: string;
|
|
285
|
+
}): Promise<RoleInterface>;
|
|
286
|
+
static update(params: {
|
|
287
|
+
roleId: string;
|
|
288
|
+
name: string;
|
|
289
|
+
description?: string;
|
|
290
|
+
}): Promise<RoleInterface>;
|
|
291
|
+
static delete(params: {
|
|
292
|
+
roleId: string;
|
|
293
|
+
}): Promise<RoleInterface>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
declare class ContentService extends AbstractService {
|
|
297
|
+
static findMany(params: {
|
|
298
|
+
contentIds?: string[];
|
|
299
|
+
search?: string;
|
|
300
|
+
fetchAll?: boolean;
|
|
301
|
+
next?: NextRef;
|
|
302
|
+
prev?: PreviousRef;
|
|
303
|
+
}): Promise<ContentInterface[]>;
|
|
304
|
+
static findRelevant(params: {
|
|
305
|
+
id: string;
|
|
306
|
+
next?: NextRef;
|
|
307
|
+
prev?: PreviousRef;
|
|
308
|
+
}): Promise<ContentInterface[]>;
|
|
309
|
+
static findManyByAuthor(params: {
|
|
310
|
+
userId: string;
|
|
311
|
+
search?: string;
|
|
312
|
+
fetchAll?: boolean;
|
|
313
|
+
next?: NextRef;
|
|
314
|
+
prev?: PreviousRef;
|
|
315
|
+
}): Promise<ContentInterface[]>;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
declare class NotificationService extends AbstractService {
|
|
319
|
+
static findMany(params: {
|
|
320
|
+
isArchived?: boolean;
|
|
321
|
+
next?: NextRef;
|
|
322
|
+
}): Promise<NotificationInterface[]>;
|
|
323
|
+
static markAsRead(params: {
|
|
324
|
+
data: any;
|
|
325
|
+
}): Promise<void>;
|
|
326
|
+
static archive(params: {
|
|
327
|
+
id: string;
|
|
328
|
+
}): Promise<void>;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare class FeatureService extends AbstractService {
|
|
332
|
+
static findMany(params: {
|
|
333
|
+
companyId?: string;
|
|
334
|
+
search?: string;
|
|
335
|
+
next?: NextRef;
|
|
336
|
+
}): Promise<FeatureInterface[]>;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
declare class PushService extends AbstractService {
|
|
340
|
+
static register(params: {
|
|
341
|
+
data: any;
|
|
342
|
+
}): Promise<void>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
declare class S3Service extends AbstractService {
|
|
346
|
+
static getPreSignedUrl(params: {
|
|
347
|
+
key: string;
|
|
348
|
+
contentType: string;
|
|
349
|
+
isPublic?: boolean;
|
|
350
|
+
}): Promise<S3Interface>;
|
|
351
|
+
static getSignedUrl(params: {
|
|
352
|
+
key: string;
|
|
353
|
+
isPublic?: boolean;
|
|
354
|
+
}): Promise<S3Interface>;
|
|
355
|
+
static deleteFile(params: {
|
|
356
|
+
key: string;
|
|
357
|
+
}): Promise<void>;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export { type CacheProfile, AuthService as ServerAuthService, CompanyService as ServerCompanyService, ContentService as ServerContentService, FeatureService as ServerFeatureService, ServerJsonApiDelete, ServerJsonApiGet, ServerJsonApiPatch, ServerJsonApiPost, ServerJsonApiPut, NotificationService as ServerNotificationService, PushService as ServerPushService, type ServerRequestParams, RoleService as ServerRoleService, S3Service as ServerS3Service, ServerSession, UserService as ServerUserService, configureServerJsonApi, getServerApiUrl, getServerAppUrl, getServerToken, getServerTrackablePages, invalidateCacheTag, invalidateCacheTags, serverRequest };
|