@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,637 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkZUEEIQHWjs = require('./chunk-ZUEEIQHW.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunk2Z56AS2Sjs = require('./chunk-2Z56AS2S.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunk7QVYU63Ejs = require('./chunk-7QVYU63E.js');
|
|
16
|
+
|
|
17
|
+
// src/features/auth/data/auth.service.ts
|
|
18
|
+
var AuthService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
19
|
+
static {
|
|
20
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "AuthService");
|
|
21
|
+
}
|
|
22
|
+
static async login(params) {
|
|
23
|
+
const language = params.language || "en-US";
|
|
24
|
+
const apiResponse = await _chunkZUEEIQHWjs.JsonApiPost.call(void 0, {
|
|
25
|
+
classKey: _chunk2Z56AS2Sjs.Modules.Auth,
|
|
26
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth, id: "login" }).generate(),
|
|
27
|
+
body: { email: params.email, password: params.password },
|
|
28
|
+
language
|
|
29
|
+
});
|
|
30
|
+
if (!apiResponse.ok) throw new Error(apiResponse.error);
|
|
31
|
+
const auth = apiResponse.data;
|
|
32
|
+
const handler = _chunk2Z56AS2Sjs.getTokenHandler.call(void 0, );
|
|
33
|
+
if (handler) {
|
|
34
|
+
await handler.updateToken({
|
|
35
|
+
token: auth.token,
|
|
36
|
+
refreshToken: auth.refreshToken,
|
|
37
|
+
userId: auth.user.id,
|
|
38
|
+
companyId: _optionalChain([auth, 'access', _ => _.user, 'access', _2 => _2.company, 'optionalAccess', _3 => _3.id]),
|
|
39
|
+
licenseExpirationDate: _optionalChain([auth, 'access', _4 => _4.user, 'access', _5 => _5.company, 'optionalAccess', _6 => _6.licenseExpirationDate]),
|
|
40
|
+
roles: auth.user.roles.map((role) => role.id),
|
|
41
|
+
features: _nullishCoalesce(_optionalChain([auth, 'access', _7 => _7.user, 'access', _8 => _8.company, 'optionalAccess', _9 => _9.features, 'optionalAccess', _10 => _10.map, 'call', _11 => _11((feature) => feature.id)]), () => ( [])),
|
|
42
|
+
modules: auth.user.modules.map((module) => ({
|
|
43
|
+
id: module.id,
|
|
44
|
+
permissions: module.permissions
|
|
45
|
+
}))
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return auth.user;
|
|
49
|
+
}
|
|
50
|
+
static async logout(params) {
|
|
51
|
+
const language = _optionalChain([params, 'optionalAccess', _12 => _12.language]) || "en-US";
|
|
52
|
+
await _chunkZUEEIQHWjs.JsonApiDelete.call(void 0, {
|
|
53
|
+
classKey: _chunk2Z56AS2Sjs.Modules.Auth,
|
|
54
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth }).generate(),
|
|
55
|
+
language
|
|
56
|
+
});
|
|
57
|
+
const handler = _chunk2Z56AS2Sjs.getTokenHandler.call(void 0, );
|
|
58
|
+
if (handler) {
|
|
59
|
+
await handler.removeToken();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
static async initialiseForgotPassword(params) {
|
|
63
|
+
const language = params.language || "en-US";
|
|
64
|
+
const response = await _chunkZUEEIQHWjs.JsonApiPost.call(void 0, {
|
|
65
|
+
classKey: _chunk2Z56AS2Sjs.Modules.Auth,
|
|
66
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth, id: "forgot" }).generate(),
|
|
67
|
+
body: { email: params.email },
|
|
68
|
+
language
|
|
69
|
+
});
|
|
70
|
+
if (!response.ok) {
|
|
71
|
+
throw new Error(response.error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static async register(params) {
|
|
75
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth, id: "register" });
|
|
76
|
+
await this.callApi({
|
|
77
|
+
type: _chunk2Z56AS2Sjs.Modules.Auth,
|
|
78
|
+
method: "POST" /* POST */,
|
|
79
|
+
endpoint: endpoint.generate(),
|
|
80
|
+
input: params
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
static async activate(params) {
|
|
84
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
85
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Auth,
|
|
86
|
+
id: "activate",
|
|
87
|
+
childEndpoint: params.activationCode
|
|
88
|
+
});
|
|
89
|
+
await this.callApi({ type: _chunk2Z56AS2Sjs.Modules.Auth, method: "POST" /* POST */, endpoint: endpoint.generate() });
|
|
90
|
+
}
|
|
91
|
+
static async validateCode(params) {
|
|
92
|
+
const language = params.language || "en-US";
|
|
93
|
+
const apiResponse = await _chunkZUEEIQHWjs.JsonApiGet.call(void 0, {
|
|
94
|
+
classKey: _chunk2Z56AS2Sjs.Modules.Auth,
|
|
95
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth, id: "validate", childEndpoint: params.code }).generate(),
|
|
96
|
+
language
|
|
97
|
+
});
|
|
98
|
+
if (!apiResponse.ok) throw new Error(apiResponse.error);
|
|
99
|
+
}
|
|
100
|
+
static async resetPassword(params) {
|
|
101
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth, id: "reset", childEndpoint: params.code });
|
|
102
|
+
const input = { password: params.password };
|
|
103
|
+
await this.callApi({ type: _chunk2Z56AS2Sjs.Modules.Auth, method: "POST" /* POST */, endpoint: endpoint.generate(), input });
|
|
104
|
+
}
|
|
105
|
+
static async acceptInvitation(params) {
|
|
106
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth, id: "invitation", childEndpoint: params.code });
|
|
107
|
+
const input = { password: params.password };
|
|
108
|
+
await this.callApi({ type: _chunk2Z56AS2Sjs.Modules.Auth, method: "POST" /* POST */, endpoint: endpoint.generate(), input });
|
|
109
|
+
}
|
|
110
|
+
static async findToken(params) {
|
|
111
|
+
return await this.callApi({
|
|
112
|
+
type: _chunk2Z56AS2Sjs.Modules.Auth,
|
|
113
|
+
method: "POST" /* POST */,
|
|
114
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Auth }).addAdditionalParam("code", params.tokenCode).generate()
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
static async saveToken(params) {
|
|
118
|
+
const auth = _chunk2Z56AS2Sjs.rehydrate.call(void 0, _chunk2Z56AS2Sjs.Modules.Auth, params.dehydratedAuth);
|
|
119
|
+
const handler = _chunk2Z56AS2Sjs.getTokenHandler.call(void 0, );
|
|
120
|
+
if (handler) {
|
|
121
|
+
await handler.updateToken({
|
|
122
|
+
token: auth.token,
|
|
123
|
+
refreshToken: auth.refreshToken,
|
|
124
|
+
userId: auth.user.id,
|
|
125
|
+
companyId: _optionalChain([auth, 'access', _13 => _13.user, 'access', _14 => _14.company, 'optionalAccess', _15 => _15.id]),
|
|
126
|
+
licenseExpirationDate: _optionalChain([auth, 'access', _16 => _16.user, 'access', _17 => _17.company, 'optionalAccess', _18 => _18.licenseExpirationDate]),
|
|
127
|
+
roles: auth.user.roles.map((role) => role.id),
|
|
128
|
+
features: _nullishCoalesce(_optionalChain([auth, 'access', _19 => _19.user, 'access', _20 => _20.company, 'optionalAccess', _21 => _21.features, 'optionalAccess', _22 => _22.map, 'call', _23 => _23((feature) => feature.id)]), () => ( [])),
|
|
129
|
+
modules: auth.user.modules.map((module) => ({
|
|
130
|
+
id: module.id,
|
|
131
|
+
permissions: module.permissions
|
|
132
|
+
}))
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// src/features/user/data/user.service.ts
|
|
139
|
+
var UserService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
140
|
+
static {
|
|
141
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "UserService");
|
|
142
|
+
}
|
|
143
|
+
static async findFullUser() {
|
|
144
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: "me", childEndpoint: "full" });
|
|
145
|
+
return this.callApi({
|
|
146
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
147
|
+
method: "GET" /* GET */,
|
|
148
|
+
endpoint: endpoint.generate()
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
static async findById(params) {
|
|
152
|
+
return this.callApi({
|
|
153
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
154
|
+
method: "GET" /* GET */,
|
|
155
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: params.userId }).generate()
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
static async findByEmail(params) {
|
|
159
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: "email", childEndpoint: params.email });
|
|
160
|
+
return this.callApi({ type: _chunk2Z56AS2Sjs.Modules.User, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
161
|
+
}
|
|
162
|
+
static async findMany(params) {
|
|
163
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User });
|
|
164
|
+
if (params.roleId) endpoint.addAdditionalParam("roleId", params.roleId);
|
|
165
|
+
if (params.includeDeleted) endpoint.addAdditionalParam("includeDeleted", "true");
|
|
166
|
+
if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
|
|
167
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
168
|
+
return this.callApi({
|
|
169
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
170
|
+
method: "GET" /* GET */,
|
|
171
|
+
endpoint: endpoint.generate(),
|
|
172
|
+
next: params.next
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
static async findManyByContentIds(params) {
|
|
176
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User });
|
|
177
|
+
endpoint.addAdditionalParam("contentIds", params.contentIds.map((id) => id).join(","));
|
|
178
|
+
endpoint.addAdditionalParam("includeDeleted", "true");
|
|
179
|
+
endpoint.addAdditionalParam("fetchAll", "true");
|
|
180
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
181
|
+
return this.callApi({
|
|
182
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
183
|
+
method: "GET" /* GET */,
|
|
184
|
+
endpoint: endpoint.generate(),
|
|
185
|
+
next: params.next
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
static async findRelevant(params) {
|
|
189
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
190
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Content,
|
|
191
|
+
id: params.id,
|
|
192
|
+
childEndpoint: "user-relevance"
|
|
193
|
+
});
|
|
194
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _24 => _24.User, 'access', _25 => _25.inclusions, 'optionalAccess', _26 => _26.lists, 'optionalAccess', _27 => _27.fields])) endpoint.limitToFields(_chunk2Z56AS2Sjs.Modules.User.inclusions.lists.fields);
|
|
195
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _28 => _28.User, 'access', _29 => _29.inclusions, 'optionalAccess', _30 => _30.lists, 'optionalAccess', _31 => _31.types])) endpoint.limitToType(_chunk2Z56AS2Sjs.Modules.User.inclusions.lists.types);
|
|
196
|
+
return this.callApi({
|
|
197
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
198
|
+
method: "GET" /* GET */,
|
|
199
|
+
endpoint: endpoint.generate(),
|
|
200
|
+
next: params.next
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
static async findManyForAmin(params) {
|
|
204
|
+
if (!params.companyId) return [];
|
|
205
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
206
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Company,
|
|
207
|
+
id: params.companyId,
|
|
208
|
+
childEndpoint: _chunk2Z56AS2Sjs.Modules.User
|
|
209
|
+
});
|
|
210
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
211
|
+
return this.callApi({
|
|
212
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
213
|
+
method: "GET" /* GET */,
|
|
214
|
+
endpoint: endpoint.generate(),
|
|
215
|
+
next: params.next,
|
|
216
|
+
previous: params.prev
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
static async findAllUsers(params) {
|
|
220
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
221
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Company,
|
|
222
|
+
id: params.companyId,
|
|
223
|
+
childEndpoint: _chunk2Z56AS2Sjs.Modules.User
|
|
224
|
+
});
|
|
225
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
226
|
+
if (params.isDeleted) endpoint.addAdditionalParam("isDeleted", "true");
|
|
227
|
+
if (params.limitToRoles && params.limitToRoles.length > 0)
|
|
228
|
+
endpoint.addAdditionalParam("limitToRoles", params.limitToRoles.join(","));
|
|
229
|
+
return this.callApi({
|
|
230
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
231
|
+
method: "GET" /* GET */,
|
|
232
|
+
endpoint: endpoint.generate(),
|
|
233
|
+
next: params.next
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
static async findAllUsersByRole(params) {
|
|
237
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Role, id: params.roleId, childEndpoint: _chunk2Z56AS2Sjs.Modules.User });
|
|
238
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
239
|
+
return this.callApi({
|
|
240
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
241
|
+
method: "GET" /* GET */,
|
|
242
|
+
endpoint: endpoint.generate(),
|
|
243
|
+
next: params.next
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
static async findAllUsersNotInRole(params) {
|
|
247
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
248
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Role,
|
|
249
|
+
id: params.roleId,
|
|
250
|
+
childEndpoint: _chunk2Z56AS2Sjs.Modules.User
|
|
251
|
+
}).addAdditionalParam("notInRole", "true");
|
|
252
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
253
|
+
return this.callApi({
|
|
254
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
255
|
+
method: "GET" /* GET */,
|
|
256
|
+
endpoint: endpoint.generate(),
|
|
257
|
+
next: params.next
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
static async create(params) {
|
|
261
|
+
return this.callApi({
|
|
262
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
263
|
+
method: "POST" /* POST */,
|
|
264
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User }).generate(),
|
|
265
|
+
companyId: params.companyId,
|
|
266
|
+
input: params
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
static async reactivate(params) {
|
|
270
|
+
return this.callApi({
|
|
271
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
272
|
+
method: "PATCH" /* PATCH */,
|
|
273
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: params.userId }).generate()
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
static async sendInvitation(params) {
|
|
277
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
278
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.User,
|
|
279
|
+
id: params.userId,
|
|
280
|
+
childEndpoint: "send-invitation-email"
|
|
281
|
+
});
|
|
282
|
+
if (params.companyId) endpoint.addAdditionalParam("companyId", params.companyId);
|
|
283
|
+
this.callApi({
|
|
284
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
285
|
+
method: "POST" /* POST */,
|
|
286
|
+
endpoint: endpoint.generate()
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
static async update(params) {
|
|
290
|
+
return this.callApi({
|
|
291
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
292
|
+
method: "PUT" /* PUT */,
|
|
293
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: params.id }).generate(),
|
|
294
|
+
companyId: params.companyId,
|
|
295
|
+
input: params
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
static async patchRate(params) {
|
|
299
|
+
return this.callApi({
|
|
300
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
301
|
+
method: "PATCH" /* PATCH */,
|
|
302
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: params.id, childEndpoint: "rates" }).generate(),
|
|
303
|
+
companyId: params.companyId,
|
|
304
|
+
input: params
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
static async delete(params) {
|
|
308
|
+
await this.callApi({
|
|
309
|
+
type: _chunk2Z56AS2Sjs.Modules.User,
|
|
310
|
+
method: "DELETE" /* DELETE */,
|
|
311
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: params.userId }).generate(),
|
|
312
|
+
companyId: params.companyId
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// src/features/company/data/company.service.ts
|
|
318
|
+
var CompanyService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
319
|
+
static {
|
|
320
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "CompanyService");
|
|
321
|
+
}
|
|
322
|
+
static async findOne(params) {
|
|
323
|
+
return this.callApi({
|
|
324
|
+
type: _chunk2Z56AS2Sjs.Modules.Company,
|
|
325
|
+
method: "GET" /* GET */,
|
|
326
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Company, id: params.companyId }).generate()
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
static async findMany(params) {
|
|
330
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Company });
|
|
331
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
332
|
+
return this.callApi({
|
|
333
|
+
type: _chunk2Z56AS2Sjs.Modules.Company,
|
|
334
|
+
method: "GET" /* GET */,
|
|
335
|
+
endpoint: endpoint.generate(),
|
|
336
|
+
next: params.next
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
static async delete(params) {
|
|
340
|
+
await this.callApi({
|
|
341
|
+
type: _chunk2Z56AS2Sjs.Modules.Company,
|
|
342
|
+
method: "DELETE" /* DELETE */,
|
|
343
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Company, id: params.companyId }).generate()
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
static async create(params) {
|
|
347
|
+
return this.callApi({
|
|
348
|
+
type: _chunk2Z56AS2Sjs.Modules.Company,
|
|
349
|
+
method: "POST" /* POST */,
|
|
350
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Company }).generate(),
|
|
351
|
+
input: params
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
static async update(params) {
|
|
355
|
+
return this.callApi({
|
|
356
|
+
type: _chunk2Z56AS2Sjs.Modules.Company,
|
|
357
|
+
method: "PUT" /* PUT */,
|
|
358
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Company, id: params.id }).generate(),
|
|
359
|
+
input: params
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
static async updateConfigurations(params) {
|
|
363
|
+
return this.callApi({
|
|
364
|
+
type: _chunk2Z56AS2Sjs.Modules.Company,
|
|
365
|
+
method: "PUT" /* PUT */,
|
|
366
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
367
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Company,
|
|
368
|
+
id: params.id,
|
|
369
|
+
childEndpoint: "configurations"
|
|
370
|
+
}).generate(),
|
|
371
|
+
input: params
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
static async activateLicense(params) {
|
|
375
|
+
return this.callApi({
|
|
376
|
+
type: _chunk2Z56AS2Sjs.Modules.Company,
|
|
377
|
+
method: "PUT" /* PUT */,
|
|
378
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Company, id: params.id, childEndpoint: "license" }).generate(),
|
|
379
|
+
input: params
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// src/features/role/data/role.service.ts
|
|
385
|
+
var RoleService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
386
|
+
static {
|
|
387
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "RoleService");
|
|
388
|
+
}
|
|
389
|
+
static async findById(params) {
|
|
390
|
+
return this.callApi({
|
|
391
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
392
|
+
method: "GET" /* GET */,
|
|
393
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Role, id: params.roleId }).generate()
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
static async findAllRoles(params) {
|
|
397
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Role });
|
|
398
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
399
|
+
return this.callApi({
|
|
400
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
401
|
+
method: "GET" /* GET */,
|
|
402
|
+
endpoint: endpoint.generate(),
|
|
403
|
+
next: params.next
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
static async findAllRolesByUser(params) {
|
|
407
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.User, id: params.userId, childEndpoint: _chunk2Z56AS2Sjs.Modules.Role });
|
|
408
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
409
|
+
return this.callApi({
|
|
410
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
411
|
+
method: "GET" /* GET */,
|
|
412
|
+
endpoint: endpoint.generate(),
|
|
413
|
+
next: params.next
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
static async findAllRolesUserNotIn(params) {
|
|
417
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
418
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.User,
|
|
419
|
+
id: params.userId,
|
|
420
|
+
childEndpoint: _chunk2Z56AS2Sjs.Modules.Role
|
|
421
|
+
}).addAdditionalParam("userNotIn", "true");
|
|
422
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
423
|
+
return this.callApi({
|
|
424
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
425
|
+
method: "GET" /* GET */,
|
|
426
|
+
endpoint: endpoint.generate(),
|
|
427
|
+
next: params.next
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
static async addUserToRole(params) {
|
|
431
|
+
this.callApi({
|
|
432
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
433
|
+
method: "POST" /* POST */,
|
|
434
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
435
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Role,
|
|
436
|
+
id: params.roleId,
|
|
437
|
+
childEndpoint: _chunk2Z56AS2Sjs.Modules.User,
|
|
438
|
+
childId: params.userId
|
|
439
|
+
}).generate()
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
static async removeUserFromRole(params) {
|
|
443
|
+
this.callApi({
|
|
444
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
445
|
+
method: "DELETE" /* DELETE */,
|
|
446
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
447
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Role,
|
|
448
|
+
id: params.roleId,
|
|
449
|
+
childEndpoint: _chunk2Z56AS2Sjs.Modules.User,
|
|
450
|
+
childId: params.userId
|
|
451
|
+
}).generate()
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
static async create(params) {
|
|
455
|
+
return this.callApi({
|
|
456
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
457
|
+
method: "POST" /* POST */,
|
|
458
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Role }).generate(),
|
|
459
|
+
input: { id: params.roleId, name: params.name, description: params.description }
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
static async update(params) {
|
|
463
|
+
return this.callApi({
|
|
464
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
465
|
+
method: "PUT" /* PUT */,
|
|
466
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Role, id: params.roleId }).generate(),
|
|
467
|
+
input: { id: params.roleId, name: params.name, description: params.description }
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
static async delete(params) {
|
|
471
|
+
return this.callApi({
|
|
472
|
+
type: _chunk2Z56AS2Sjs.Modules.Role,
|
|
473
|
+
method: "DELETE" /* DELETE */,
|
|
474
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Role, id: params.roleId }).generate()
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// src/features/content/data/content.service.ts
|
|
480
|
+
var ContentService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
481
|
+
static {
|
|
482
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "ContentService");
|
|
483
|
+
}
|
|
484
|
+
static async findMany(params) {
|
|
485
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Content });
|
|
486
|
+
if (params.contentIds) {
|
|
487
|
+
endpoint.addAdditionalParam("contentIds", params.contentIds.join(","));
|
|
488
|
+
endpoint.addAdditionalParam("fetchAll", "true");
|
|
489
|
+
} else {
|
|
490
|
+
if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
|
|
491
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
492
|
+
}
|
|
493
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _32 => _32.Content, 'access', _33 => _33.inclusions, 'optionalAccess', _34 => _34.lists, 'optionalAccess', _35 => _35.fields])) endpoint.limitToFields(_chunk2Z56AS2Sjs.Modules.Content.inclusions.lists.fields);
|
|
494
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _36 => _36.Content, 'access', _37 => _37.inclusions, 'optionalAccess', _38 => _38.lists, 'optionalAccess', _39 => _39.types])) endpoint.limitToType(_chunk2Z56AS2Sjs.Modules.Content.inclusions.lists.types);
|
|
495
|
+
return this.callApi({
|
|
496
|
+
type: _chunk2Z56AS2Sjs.Modules.Content,
|
|
497
|
+
method: "GET" /* GET */,
|
|
498
|
+
endpoint: endpoint.generate(),
|
|
499
|
+
next: params.next
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
static async findRelevant(params) {
|
|
503
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
504
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Content,
|
|
505
|
+
id: params.id,
|
|
506
|
+
childEndpoint: "relevance"
|
|
507
|
+
});
|
|
508
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _40 => _40.Content, 'access', _41 => _41.inclusions, 'optionalAccess', _42 => _42.lists, 'optionalAccess', _43 => _43.fields])) endpoint.limitToFields(_chunk2Z56AS2Sjs.Modules.Content.inclusions.lists.fields);
|
|
509
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _44 => _44.Content, 'access', _45 => _45.inclusions, 'optionalAccess', _46 => _46.lists, 'optionalAccess', _47 => _47.types])) endpoint.limitToType(_chunk2Z56AS2Sjs.Modules.Content.inclusions.lists.types);
|
|
510
|
+
return this.callApi({
|
|
511
|
+
type: _chunk2Z56AS2Sjs.Modules.Content,
|
|
512
|
+
method: "GET" /* GET */,
|
|
513
|
+
endpoint: endpoint.generate(),
|
|
514
|
+
next: params.next
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
static async findManyByAuthor(params) {
|
|
518
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({
|
|
519
|
+
endpoint: _chunk2Z56AS2Sjs.Modules.Author,
|
|
520
|
+
id: params.userId,
|
|
521
|
+
childEndpoint: _chunk2Z56AS2Sjs.Modules.Content
|
|
522
|
+
});
|
|
523
|
+
if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
|
|
524
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
525
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _48 => _48.Content, 'access', _49 => _49.inclusions, 'optionalAccess', _50 => _50.lists, 'optionalAccess', _51 => _51.fields])) endpoint.limitToFields(_chunk2Z56AS2Sjs.Modules.Content.inclusions.lists.fields);
|
|
526
|
+
if (_optionalChain([_chunk2Z56AS2Sjs.Modules, 'access', _52 => _52.Content, 'access', _53 => _53.inclusions, 'optionalAccess', _54 => _54.lists, 'optionalAccess', _55 => _55.types])) endpoint.limitToType(_chunk2Z56AS2Sjs.Modules.Content.inclusions.lists.types);
|
|
527
|
+
return this.callApi({
|
|
528
|
+
type: _chunk2Z56AS2Sjs.Modules.Content,
|
|
529
|
+
method: "GET" /* GET */,
|
|
530
|
+
endpoint: endpoint.generate(),
|
|
531
|
+
next: params.next
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
// src/features/notification/data/notification.service.ts
|
|
537
|
+
var NotificationService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
538
|
+
static {
|
|
539
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "NotificationService");
|
|
540
|
+
}
|
|
541
|
+
static async findMany(params) {
|
|
542
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Notification });
|
|
543
|
+
if (params.isArchived) endpoint.addAdditionalParam("isArchived", "true");
|
|
544
|
+
return this.callApi({
|
|
545
|
+
type: _chunk2Z56AS2Sjs.Modules.Notification,
|
|
546
|
+
method: "GET" /* GET */,
|
|
547
|
+
endpoint: endpoint.generate(),
|
|
548
|
+
next: params.next
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
static async markAsRead(params) {
|
|
552
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Notification });
|
|
553
|
+
await this.callApi({
|
|
554
|
+
type: _chunk2Z56AS2Sjs.Modules.Notification,
|
|
555
|
+
method: "PATCH" /* PATCH */,
|
|
556
|
+
endpoint: endpoint.generate(),
|
|
557
|
+
input: params.data,
|
|
558
|
+
overridesJsonApiCreation: true
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
static async archive(params) {
|
|
562
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Notification, id: params.id, childEndpoint: "archive" });
|
|
563
|
+
await this.callApi({ type: _chunk2Z56AS2Sjs.Modules.Notification, method: "POST" /* POST */, endpoint: endpoint.generate() });
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
// src/features/feature/data/feature.service.ts
|
|
568
|
+
var FeatureService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
569
|
+
static {
|
|
570
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "FeatureService");
|
|
571
|
+
}
|
|
572
|
+
static async findMany(params) {
|
|
573
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Feature });
|
|
574
|
+
if (params.companyId) endpoint.endpoint(_chunk2Z56AS2Sjs.Modules.Company).id(params.companyId).childEndpoint(_chunk2Z56AS2Sjs.Modules.Feature);
|
|
575
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
576
|
+
return this.callApi({
|
|
577
|
+
type: _chunk2Z56AS2Sjs.Modules.Feature,
|
|
578
|
+
method: "GET" /* GET */,
|
|
579
|
+
endpoint: endpoint.generate(),
|
|
580
|
+
next: params.next
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
// src/features/push/data/push.service.ts
|
|
586
|
+
var PushService = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
587
|
+
static {
|
|
588
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "PushService");
|
|
589
|
+
}
|
|
590
|
+
static async register(params) {
|
|
591
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.Push });
|
|
592
|
+
await this.callApi({
|
|
593
|
+
type: _chunk2Z56AS2Sjs.Modules.Push,
|
|
594
|
+
method: "POST" /* POST */,
|
|
595
|
+
endpoint: endpoint.generate(),
|
|
596
|
+
input: params.data,
|
|
597
|
+
overridesJsonApiCreation: true
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
// src/features/s3/data/s3.service.ts
|
|
603
|
+
var S3Service = class extends _chunk2Z56AS2Sjs.AbstractService {
|
|
604
|
+
static {
|
|
605
|
+
_chunk7QVYU63Ejs.__name.call(void 0, this, "S3Service");
|
|
606
|
+
}
|
|
607
|
+
static async getPreSignedUrl(params) {
|
|
608
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.S3 }).addAdditionalParam("key", params.key).addAdditionalParam("contentType", params.contentType);
|
|
609
|
+
if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
|
|
610
|
+
return this.callApi({ type: _chunk2Z56AS2Sjs.Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
611
|
+
}
|
|
612
|
+
static async getSignedUrl(params) {
|
|
613
|
+
const endpoint = new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.S3, id: "sign" }).addAdditionalParam("key", params.key);
|
|
614
|
+
if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
|
|
615
|
+
return this.callApi({ type: _chunk2Z56AS2Sjs.Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
616
|
+
}
|
|
617
|
+
static async deleteFile(params) {
|
|
618
|
+
this.callApi({
|
|
619
|
+
type: _chunk2Z56AS2Sjs.Modules.S3,
|
|
620
|
+
method: "DELETE" /* DELETE */,
|
|
621
|
+
endpoint: new (0, _chunk2Z56AS2Sjs.EndpointCreator)({ endpoint: _chunk2Z56AS2Sjs.Modules.S3 }).addAdditionalParam("key", params.key).generate()
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
exports.AuthService = AuthService; exports.UserService = UserService; exports.CompanyService = CompanyService; exports.RoleService = RoleService; exports.ContentService = ContentService; exports.NotificationService = NotificationService; exports.FeatureService = FeatureService; exports.PushService = PushService; exports.S3Service = S3Service;
|
|
637
|
+
//# sourceMappingURL=chunk-LOSPCUCF.js.map
|