@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
|
@@ -1,75 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getTokenHandler
|
|
3
|
-
} from "./chunk-SM63SZCP.mjs";
|
|
4
1
|
import {
|
|
5
2
|
JsonApiDelete,
|
|
6
3
|
JsonApiGet,
|
|
7
4
|
JsonApiPost
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-F4Y3GZG4.mjs";
|
|
9
6
|
import {
|
|
10
|
-
AbstractApiData,
|
|
11
7
|
AbstractService,
|
|
12
8
|
EndpointCreator,
|
|
13
9
|
Modules,
|
|
14
|
-
|
|
10
|
+
getTokenHandler,
|
|
15
11
|
rehydrate
|
|
16
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KFL5ZFM4.mjs";
|
|
17
13
|
import {
|
|
18
14
|
__name
|
|
19
15
|
} from "./chunk-PAWJFY3S.mjs";
|
|
20
16
|
|
|
21
|
-
// src/features/auth/auth.module.ts
|
|
22
|
-
var AuthModule = /* @__PURE__ */ __name((factory) => factory({
|
|
23
|
-
pageUrl: "/auth",
|
|
24
|
-
name: "auth",
|
|
25
|
-
model: Auth
|
|
26
|
-
}), "AuthModule");
|
|
27
|
-
|
|
28
|
-
// src/features/auth/data/auth.ts
|
|
29
|
-
var Auth = class extends AbstractApiData {
|
|
30
|
-
static {
|
|
31
|
-
__name(this, "Auth");
|
|
32
|
-
}
|
|
33
|
-
_token;
|
|
34
|
-
_refreshToken;
|
|
35
|
-
_user;
|
|
36
|
-
get token() {
|
|
37
|
-
if (!this._token) throw new Error("Token is not defined");
|
|
38
|
-
return this._token;
|
|
39
|
-
}
|
|
40
|
-
get refreshToken() {
|
|
41
|
-
if (!this._refreshToken) throw new Error("Refresh token is not defined");
|
|
42
|
-
return this._refreshToken;
|
|
43
|
-
}
|
|
44
|
-
get user() {
|
|
45
|
-
if (!this._user) throw new Error("User is not defined");
|
|
46
|
-
return this._user;
|
|
47
|
-
}
|
|
48
|
-
rehydrate(data) {
|
|
49
|
-
super.rehydrate(data);
|
|
50
|
-
this._token = data.jsonApi.attributes.token ?? void 0;
|
|
51
|
-
this._refreshToken = data.jsonApi.attributes.refreshToken ?? void 0;
|
|
52
|
-
this._user = this._readIncluded(data, "user", Modules.User);
|
|
53
|
-
return this;
|
|
54
|
-
}
|
|
55
|
-
createJsonApi(data) {
|
|
56
|
-
const response = {
|
|
57
|
-
data: {
|
|
58
|
-
type: Modules.Auth.name,
|
|
59
|
-
attributes: {}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
if (data.id) response.data.id = data.id;
|
|
63
|
-
if (data.email !== void 0) response.data.attributes.email = data.email;
|
|
64
|
-
if (data.name !== void 0) response.data.attributes.name = data.name;
|
|
65
|
-
if (data.companyName !== void 0) response.data.attributes.companyName = data.companyName;
|
|
66
|
-
if (data.password !== void 0) response.data.attributes.password = data.password;
|
|
67
|
-
if (data.partitaIva !== void 0) response.data.attributes.partitaIva = data.partitaIva;
|
|
68
|
-
if (data.codiceFiscale !== void 0) response.data.attributes.codiceFiscale = data.codiceFiscale;
|
|
69
|
-
return response;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
17
|
// src/features/auth/data/auth.service.ts
|
|
74
18
|
var AuthService = class extends AbstractService {
|
|
75
19
|
static {
|
|
@@ -191,116 +135,185 @@ var AuthService = class extends AbstractService {
|
|
|
191
135
|
}
|
|
192
136
|
};
|
|
193
137
|
|
|
194
|
-
// src/features/
|
|
195
|
-
var
|
|
196
|
-
AuthComponent2[AuthComponent2["Login"] = 0] = "Login";
|
|
197
|
-
AuthComponent2[AuthComponent2["ForgotPassword"] = 1] = "ForgotPassword";
|
|
198
|
-
AuthComponent2[AuthComponent2["ResetPassword"] = 2] = "ResetPassword";
|
|
199
|
-
AuthComponent2[AuthComponent2["ActivateAccount"] = 3] = "ActivateAccount";
|
|
200
|
-
AuthComponent2[AuthComponent2["AcceptInvitation"] = 4] = "AcceptInvitation";
|
|
201
|
-
AuthComponent2[AuthComponent2["Register"] = 5] = "Register";
|
|
202
|
-
AuthComponent2[AuthComponent2["Landing"] = 6] = "Landing";
|
|
203
|
-
return AuthComponent2;
|
|
204
|
-
})(AuthComponent || {});
|
|
205
|
-
|
|
206
|
-
// src/features/company/company.module.ts
|
|
207
|
-
var CompanyModule = /* @__PURE__ */ __name((factory) => factory({
|
|
208
|
-
pageUrl: "/companies",
|
|
209
|
-
name: "companies",
|
|
210
|
-
model: Company,
|
|
211
|
-
moduleId: "f9e77c8f-bfd1-4fd4-80b0-e1d891ab7113"
|
|
212
|
-
}), "CompanyModule");
|
|
213
|
-
|
|
214
|
-
// src/features/company/data/company.ts
|
|
215
|
-
var Company = class extends AbstractApiData {
|
|
138
|
+
// src/features/user/data/user.service.ts
|
|
139
|
+
var UserService = class extends AbstractService {
|
|
216
140
|
static {
|
|
217
|
-
__name(this, "
|
|
141
|
+
__name(this, "UserService");
|
|
218
142
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return this.
|
|
143
|
+
static async findFullUser() {
|
|
144
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "me", childEndpoint: "full" });
|
|
145
|
+
return this.callApi({
|
|
146
|
+
type: Modules.User,
|
|
147
|
+
method: "GET" /* GET */,
|
|
148
|
+
endpoint: endpoint.generate()
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
static async findById(params) {
|
|
152
|
+
return this.callApi({
|
|
153
|
+
type: Modules.User,
|
|
154
|
+
method: "GET" /* GET */,
|
|
155
|
+
endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
|
|
156
|
+
});
|
|
229
157
|
}
|
|
230
|
-
|
|
231
|
-
|
|
158
|
+
static async findByEmail(params) {
|
|
159
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "email", childEndpoint: params.email });
|
|
160
|
+
return this.callApi({ type: Modules.User, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
232
161
|
}
|
|
233
|
-
|
|
234
|
-
|
|
162
|
+
static async findMany(params) {
|
|
163
|
+
const endpoint = new EndpointCreator({ endpoint: 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: Modules.User,
|
|
170
|
+
method: "GET" /* GET */,
|
|
171
|
+
endpoint: endpoint.generate(),
|
|
172
|
+
next: params.next
|
|
173
|
+
});
|
|
235
174
|
}
|
|
236
|
-
|
|
237
|
-
|
|
175
|
+
static async findManyByContentIds(params) {
|
|
176
|
+
const endpoint = new EndpointCreator({ endpoint: 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: Modules.User,
|
|
183
|
+
method: "GET" /* GET */,
|
|
184
|
+
endpoint: endpoint.generate(),
|
|
185
|
+
next: params.next
|
|
186
|
+
});
|
|
238
187
|
}
|
|
239
|
-
|
|
240
|
-
|
|
188
|
+
static async findRelevant(params) {
|
|
189
|
+
const endpoint = new EndpointCreator({
|
|
190
|
+
endpoint: Modules.Content,
|
|
191
|
+
id: params.id,
|
|
192
|
+
childEndpoint: "user-relevance"
|
|
193
|
+
});
|
|
194
|
+
if (Modules.User.inclusions?.lists?.fields) endpoint.limitToFields(Modules.User.inclusions.lists.fields);
|
|
195
|
+
if (Modules.User.inclusions?.lists?.types) endpoint.limitToType(Modules.User.inclusions.lists.types);
|
|
196
|
+
return this.callApi({
|
|
197
|
+
type: Modules.User,
|
|
198
|
+
method: "GET" /* GET */,
|
|
199
|
+
endpoint: endpoint.generate(),
|
|
200
|
+
next: params.next
|
|
201
|
+
});
|
|
241
202
|
}
|
|
242
|
-
|
|
243
|
-
|
|
203
|
+
static async findManyForAmin(params) {
|
|
204
|
+
if (!params.companyId) return [];
|
|
205
|
+
const endpoint = new EndpointCreator({
|
|
206
|
+
endpoint: Modules.Company,
|
|
207
|
+
id: params.companyId,
|
|
208
|
+
childEndpoint: Modules.User
|
|
209
|
+
});
|
|
210
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
211
|
+
return this.callApi({
|
|
212
|
+
type: Modules.User,
|
|
213
|
+
method: "GET" /* GET */,
|
|
214
|
+
endpoint: endpoint.generate(),
|
|
215
|
+
next: params.next,
|
|
216
|
+
previous: params.prev
|
|
217
|
+
});
|
|
244
218
|
}
|
|
245
|
-
|
|
246
|
-
|
|
219
|
+
static async findAllUsers(params) {
|
|
220
|
+
const endpoint = new EndpointCreator({
|
|
221
|
+
endpoint: Modules.Company,
|
|
222
|
+
id: params.companyId,
|
|
223
|
+
childEndpoint: 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: Modules.User,
|
|
231
|
+
method: "GET" /* GET */,
|
|
232
|
+
endpoint: endpoint.generate(),
|
|
233
|
+
next: params.next
|
|
234
|
+
});
|
|
247
235
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return this;
|
|
236
|
+
static async findAllUsersByRole(params) {
|
|
237
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Role, id: params.roleId, childEndpoint: Modules.User });
|
|
238
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
239
|
+
return this.callApi({
|
|
240
|
+
type: Modules.User,
|
|
241
|
+
method: "GET" /* GET */,
|
|
242
|
+
endpoint: endpoint.generate(),
|
|
243
|
+
next: params.next
|
|
244
|
+
});
|
|
258
245
|
}
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
246
|
+
static async findAllUsersNotInRole(params) {
|
|
247
|
+
const endpoint = new EndpointCreator({
|
|
248
|
+
endpoint: Modules.Role,
|
|
249
|
+
id: params.roleId,
|
|
250
|
+
childEndpoint: Modules.User
|
|
251
|
+
}).addAdditionalParam("notInRole", "true");
|
|
252
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
253
|
+
return this.callApi({
|
|
254
|
+
type: 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: Modules.User,
|
|
263
|
+
method: "POST" /* POST */,
|
|
264
|
+
endpoint: new EndpointCreator({ endpoint: Modules.User }).generate(),
|
|
265
|
+
companyId: params.companyId,
|
|
266
|
+
input: params
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
static async reactivate(params) {
|
|
270
|
+
return this.callApi({
|
|
271
|
+
type: Modules.User,
|
|
272
|
+
method: "PATCH" /* PATCH */,
|
|
273
|
+
endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
static async sendInvitation(params) {
|
|
277
|
+
const endpoint = new EndpointCreator({
|
|
278
|
+
endpoint: 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: Modules.User,
|
|
285
|
+
method: "POST" /* POST */,
|
|
286
|
+
endpoint: endpoint.generate()
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
static async update(params) {
|
|
290
|
+
return this.callApi({
|
|
291
|
+
type: Modules.User,
|
|
292
|
+
method: "PUT" /* PUT */,
|
|
293
|
+
endpoint: new EndpointCreator({ endpoint: 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: Modules.User,
|
|
301
|
+
method: "PATCH" /* PATCH */,
|
|
302
|
+
endpoint: new EndpointCreator({ endpoint: 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: Modules.User,
|
|
310
|
+
method: "DELETE" /* DELETE */,
|
|
311
|
+
endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate(),
|
|
312
|
+
companyId: params.companyId
|
|
313
|
+
});
|
|
292
314
|
}
|
|
293
315
|
};
|
|
294
316
|
|
|
295
|
-
// src/features/company/data/company.fields.ts
|
|
296
|
-
var CompanyFields = /* @__PURE__ */ ((CompanyFields2) => {
|
|
297
|
-
CompanyFields2["companyId"] = "companyId";
|
|
298
|
-
CompanyFields2["name"] = "name";
|
|
299
|
-
CompanyFields2["createdAt"] = "createdAt";
|
|
300
|
-
CompanyFields2["updatedAt"] = "updatedAt";
|
|
301
|
-
return CompanyFields2;
|
|
302
|
-
})(CompanyFields || {});
|
|
303
|
-
|
|
304
317
|
// src/features/company/data/company.service.ts
|
|
305
318
|
var CompanyService = class extends AbstractService {
|
|
306
319
|
static {
|
|
@@ -368,468 +381,33 @@ var CompanyService = class extends AbstractService {
|
|
|
368
381
|
}
|
|
369
382
|
};
|
|
370
383
|
|
|
371
|
-
// src/features/
|
|
372
|
-
var
|
|
373
|
-
pageUrl: "/contents",
|
|
374
|
-
name: "contents",
|
|
375
|
-
model: Content,
|
|
376
|
-
inclusions: {
|
|
377
|
-
lists: {
|
|
378
|
-
fields: [
|
|
379
|
-
createJsonApiInclusion("content", [`name`, `tldr`, `abstract`, `aiStatus`, `relevance`]),
|
|
380
|
-
createJsonApiInclusion("users", [`name`, `avatar`]),
|
|
381
|
-
createJsonApiInclusion("topics", [`name`]),
|
|
382
|
-
createJsonApiInclusion("expertises", [`name`])
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}), "ContentModule");
|
|
387
|
-
|
|
388
|
-
// src/features/content/data/content.ts
|
|
389
|
-
var Content = class extends AbstractApiData {
|
|
390
|
-
static {
|
|
391
|
-
__name(this, "Content");
|
|
392
|
-
}
|
|
393
|
-
_contentType;
|
|
394
|
-
_name;
|
|
395
|
-
_abstract;
|
|
396
|
-
_tldr;
|
|
397
|
-
_aiStatus;
|
|
398
|
-
_relevance;
|
|
399
|
-
_author;
|
|
400
|
-
_editors;
|
|
401
|
-
get searchResult() {
|
|
402
|
-
return this._name ?? "";
|
|
403
|
-
}
|
|
404
|
-
get contentType() {
|
|
405
|
-
return this._contentType;
|
|
406
|
-
}
|
|
407
|
-
get name() {
|
|
408
|
-
if (this._name === void 0) throw new Error("JsonApi error: content name is missing");
|
|
409
|
-
return this._name;
|
|
410
|
-
}
|
|
411
|
-
get abstract() {
|
|
412
|
-
return this._abstract;
|
|
413
|
-
}
|
|
414
|
-
get tldr() {
|
|
415
|
-
return this._tldr;
|
|
416
|
-
}
|
|
417
|
-
get aiStatus() {
|
|
418
|
-
return this._aiStatus ?? "";
|
|
419
|
-
}
|
|
420
|
-
get relevance() {
|
|
421
|
-
return this._relevance;
|
|
422
|
-
}
|
|
423
|
-
get author() {
|
|
424
|
-
if (this._author === void 0) throw new Error("JsonApi error: document author is missing");
|
|
425
|
-
return this._author;
|
|
426
|
-
}
|
|
427
|
-
get editors() {
|
|
428
|
-
return this._editors ?? [];
|
|
429
|
-
}
|
|
430
|
-
rehydrate(data) {
|
|
431
|
-
super.rehydrate(data);
|
|
432
|
-
this._contentType = data.jsonApi.meta.contentType;
|
|
433
|
-
this._name = data.jsonApi.attributes.name;
|
|
434
|
-
this._abstract = data.jsonApi.attributes.abstract;
|
|
435
|
-
this._tldr = data.jsonApi.attributes.tldr;
|
|
436
|
-
this._aiStatus = data.jsonApi.meta.aiStatus;
|
|
437
|
-
this._relevance = data.jsonApi.meta.relevance;
|
|
438
|
-
this._author = this._readIncluded(data, "author", Modules.User);
|
|
439
|
-
this._editors = this._readIncluded(data, "editors", Modules.User);
|
|
440
|
-
return this;
|
|
441
|
-
}
|
|
442
|
-
addContentInput(response, data) {
|
|
443
|
-
if (data.name) response.data.attributes.name = data.name;
|
|
444
|
-
if (data.authorId) {
|
|
445
|
-
response.data.relationships.author = {
|
|
446
|
-
data: {
|
|
447
|
-
type: Modules.User.name,
|
|
448
|
-
id: data.authorId
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
// src/features/content/data/content.fields.ts
|
|
456
|
-
var ContentFields = /* @__PURE__ */ ((ContentFields2) => {
|
|
457
|
-
ContentFields2["contentId"] = "contentId";
|
|
458
|
-
ContentFields2["name"] = "name";
|
|
459
|
-
ContentFields2["relevance"] = "relevance";
|
|
460
|
-
ContentFields2["authors"] = "authors";
|
|
461
|
-
ContentFields2["createdAt"] = "createdAt";
|
|
462
|
-
ContentFields2["updatedAt"] = "updatedAt";
|
|
463
|
-
return ContentFields2;
|
|
464
|
-
})(ContentFields || {});
|
|
465
|
-
|
|
466
|
-
// src/features/content/data/content.service.ts
|
|
467
|
-
var ContentService = class extends AbstractService {
|
|
384
|
+
// src/features/role/data/role.service.ts
|
|
385
|
+
var RoleService = class extends AbstractService {
|
|
468
386
|
static {
|
|
469
|
-
__name(this, "
|
|
387
|
+
__name(this, "RoleService");
|
|
470
388
|
}
|
|
471
|
-
static async
|
|
472
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.Content });
|
|
473
|
-
if (params.contentIds) {
|
|
474
|
-
endpoint.addAdditionalParam("contentIds", params.contentIds.join(","));
|
|
475
|
-
endpoint.addAdditionalParam("fetchAll", "true");
|
|
476
|
-
} else {
|
|
477
|
-
if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
|
|
478
|
-
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
479
|
-
}
|
|
480
|
-
if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
|
|
481
|
-
if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
|
|
389
|
+
static async findById(params) {
|
|
482
390
|
return this.callApi({
|
|
483
|
-
type: Modules.
|
|
391
|
+
type: Modules.Role,
|
|
484
392
|
method: "GET" /* GET */,
|
|
485
|
-
endpoint: endpoint.generate()
|
|
486
|
-
next: params.next
|
|
393
|
+
endpoint: new EndpointCreator({ endpoint: Modules.Role, id: params.roleId }).generate()
|
|
487
394
|
});
|
|
488
395
|
}
|
|
489
|
-
static async
|
|
490
|
-
const endpoint = new EndpointCreator({
|
|
491
|
-
|
|
492
|
-
id: params.id,
|
|
493
|
-
childEndpoint: "relevance"
|
|
494
|
-
});
|
|
495
|
-
if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
|
|
496
|
-
if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
|
|
396
|
+
static async findAllRoles(params) {
|
|
397
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Role });
|
|
398
|
+
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
497
399
|
return this.callApi({
|
|
498
|
-
type: Modules.
|
|
400
|
+
type: Modules.Role,
|
|
499
401
|
method: "GET" /* GET */,
|
|
500
402
|
endpoint: endpoint.generate(),
|
|
501
403
|
next: params.next
|
|
502
404
|
});
|
|
503
405
|
}
|
|
504
|
-
static async
|
|
505
|
-
const endpoint = new EndpointCreator({
|
|
506
|
-
endpoint: Modules.Author,
|
|
507
|
-
id: params.userId,
|
|
508
|
-
childEndpoint: Modules.Content
|
|
509
|
-
});
|
|
510
|
-
if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
|
|
406
|
+
static async findAllRolesByUser(params) {
|
|
407
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.User, id: params.userId, childEndpoint: Modules.Role });
|
|
511
408
|
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
512
|
-
if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
|
|
513
|
-
if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
|
|
514
409
|
return this.callApi({
|
|
515
|
-
type: Modules.
|
|
516
|
-
method: "GET" /* GET */,
|
|
517
|
-
endpoint: endpoint.generate(),
|
|
518
|
-
next: params.next
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
// src/features/feature/data/feature.ts
|
|
524
|
-
var Feature = class extends AbstractApiData {
|
|
525
|
-
static {
|
|
526
|
-
__name(this, "Feature");
|
|
527
|
-
}
|
|
528
|
-
_name;
|
|
529
|
-
_isProduction;
|
|
530
|
-
_modules = [];
|
|
531
|
-
get name() {
|
|
532
|
-
return this._name ?? "";
|
|
533
|
-
}
|
|
534
|
-
get isProduction() {
|
|
535
|
-
return this._isProduction == true ? true : false;
|
|
536
|
-
}
|
|
537
|
-
get modules() {
|
|
538
|
-
return this._modules;
|
|
539
|
-
}
|
|
540
|
-
rehydrate(data) {
|
|
541
|
-
super.rehydrate(data);
|
|
542
|
-
this._name = data.jsonApi.attributes.name;
|
|
543
|
-
this._isProduction = data.jsonApi.attributes.isProduction ?? false;
|
|
544
|
-
this._modules = this._readIncluded(data, `modules`, Modules.Module);
|
|
545
|
-
return this;
|
|
546
|
-
}
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
// src/features/feature/feature.module.ts
|
|
550
|
-
var FeatureModule = /* @__PURE__ */ __name((factory) => factory({
|
|
551
|
-
pageUrl: "/features",
|
|
552
|
-
name: "features",
|
|
553
|
-
model: Feature,
|
|
554
|
-
moduleId: "025fdd23-2803-4360-9fd9-eaa3612c2e23"
|
|
555
|
-
}), "FeatureModule");
|
|
556
|
-
|
|
557
|
-
// src/features/feature/data/feature.service.ts
|
|
558
|
-
var FeatureService = class extends AbstractService {
|
|
559
|
-
static {
|
|
560
|
-
__name(this, "FeatureService");
|
|
561
|
-
}
|
|
562
|
-
static async findMany(params) {
|
|
563
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.Feature });
|
|
564
|
-
if (params.companyId) endpoint.endpoint(Modules.Company).id(params.companyId).childEndpoint(Modules.Feature);
|
|
565
|
-
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
566
|
-
return this.callApi({
|
|
567
|
-
type: Modules.Feature,
|
|
568
|
-
method: "GET" /* GET */,
|
|
569
|
-
endpoint: endpoint.generate(),
|
|
570
|
-
next: params.next
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
// src/features/module/data/module.ts
|
|
576
|
-
var Module = class extends AbstractApiData {
|
|
577
|
-
static {
|
|
578
|
-
__name(this, "Module");
|
|
579
|
-
}
|
|
580
|
-
_name;
|
|
581
|
-
_isCore;
|
|
582
|
-
_permissions;
|
|
583
|
-
get name() {
|
|
584
|
-
if (!this._name) throw new Error("Name is not defined");
|
|
585
|
-
return this._name ?? "";
|
|
586
|
-
}
|
|
587
|
-
get isCore() {
|
|
588
|
-
return this._isCore ?? false;
|
|
589
|
-
}
|
|
590
|
-
get permissions() {
|
|
591
|
-
if (!this._permissions) throw new Error("Permissions is not defined");
|
|
592
|
-
return this._permissions;
|
|
593
|
-
}
|
|
594
|
-
rehydrate(data) {
|
|
595
|
-
super.rehydrate(data);
|
|
596
|
-
this._name = data.jsonApi.attributes.name;
|
|
597
|
-
this._isCore = data.jsonApi.attributes.isCore;
|
|
598
|
-
this._permissions = data.jsonApi.meta.permissions;
|
|
599
|
-
return this;
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
|
|
603
|
-
// src/features/module/module.module.ts
|
|
604
|
-
var ModuleModule = /* @__PURE__ */ __name((factory) => factory({
|
|
605
|
-
pageUrl: "/modules",
|
|
606
|
-
name: "modules",
|
|
607
|
-
model: Module,
|
|
608
|
-
moduleId: "25ffd868-8341-4ca7-963b-6e1c56b03b1d"
|
|
609
|
-
}), "ModuleModule");
|
|
610
|
-
|
|
611
|
-
// src/features/notification/data/notification.ts
|
|
612
|
-
var Notification = class extends AbstractApiData {
|
|
613
|
-
static {
|
|
614
|
-
__name(this, "Notification");
|
|
615
|
-
}
|
|
616
|
-
_notificationType;
|
|
617
|
-
_isRead;
|
|
618
|
-
_actor;
|
|
619
|
-
get notificationType() {
|
|
620
|
-
if (this._notificationType === void 0) throw new Error("notificationType is not set");
|
|
621
|
-
return this._notificationType;
|
|
622
|
-
}
|
|
623
|
-
get isRead() {
|
|
624
|
-
return this._isRead === void 0 ? false : this._isRead;
|
|
625
|
-
}
|
|
626
|
-
get actor() {
|
|
627
|
-
return this._actor;
|
|
628
|
-
}
|
|
629
|
-
rehydrate(data) {
|
|
630
|
-
super.rehydrate(data);
|
|
631
|
-
this._notificationType = data.jsonApi.attributes.notificationType;
|
|
632
|
-
this._isRead = data.jsonApi.attributes.isRead;
|
|
633
|
-
this._actor = this._readIncluded(data, "actor", Modules.User);
|
|
634
|
-
return this;
|
|
635
|
-
}
|
|
636
|
-
createJsonApi(data) {
|
|
637
|
-
const response = {
|
|
638
|
-
data: {
|
|
639
|
-
type: Modules.Notification.name,
|
|
640
|
-
id: data.id,
|
|
641
|
-
attributes: {
|
|
642
|
-
isRead: data.isRead
|
|
643
|
-
},
|
|
644
|
-
meta: {},
|
|
645
|
-
relationships: {}
|
|
646
|
-
},
|
|
647
|
-
included: []
|
|
648
|
-
};
|
|
649
|
-
return response;
|
|
650
|
-
}
|
|
651
|
-
};
|
|
652
|
-
|
|
653
|
-
// src/features/notification/notification.module.ts
|
|
654
|
-
var NotificationModule = /* @__PURE__ */ __name((factory) => factory({
|
|
655
|
-
pageUrl: "/notifications",
|
|
656
|
-
name: "notifications",
|
|
657
|
-
model: Notification,
|
|
658
|
-
moduleId: "9259d704-c670-4e77-a3a1-a728ffc5be3d"
|
|
659
|
-
}), "NotificationModule");
|
|
660
|
-
|
|
661
|
-
// src/features/notification/data/notification.fields.ts
|
|
662
|
-
var NotificationFields = /* @__PURE__ */ ((NotificationFields2) => {
|
|
663
|
-
NotificationFields2["notificationId"] = "notificationId";
|
|
664
|
-
NotificationFields2["name"] = "name";
|
|
665
|
-
NotificationFields2["createdAt"] = "createdAt";
|
|
666
|
-
NotificationFields2["updatedAt"] = "updatedAt";
|
|
667
|
-
return NotificationFields2;
|
|
668
|
-
})(NotificationFields || {});
|
|
669
|
-
|
|
670
|
-
// src/features/notification/data/notification.service.ts
|
|
671
|
-
var NotificationService = class extends AbstractService {
|
|
672
|
-
static {
|
|
673
|
-
__name(this, "NotificationService");
|
|
674
|
-
}
|
|
675
|
-
static async findMany(params) {
|
|
676
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
|
|
677
|
-
if (params.isArchived) endpoint.addAdditionalParam("isArchived", "true");
|
|
678
|
-
return this.callApi({
|
|
679
|
-
type: Modules.Notification,
|
|
680
|
-
method: "GET" /* GET */,
|
|
681
|
-
endpoint: endpoint.generate(),
|
|
682
|
-
next: params.next
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
static async markAsRead(params) {
|
|
686
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
|
|
687
|
-
await this.callApi({
|
|
688
|
-
type: Modules.Notification,
|
|
689
|
-
method: "PATCH" /* PATCH */,
|
|
690
|
-
endpoint: endpoint.generate(),
|
|
691
|
-
input: params.data,
|
|
692
|
-
overridesJsonApiCreation: true
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
static async archive(params) {
|
|
696
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.Notification, id: params.id, childEndpoint: "archive" });
|
|
697
|
-
await this.callApi({ type: Modules.Notification, method: "POST" /* POST */, endpoint: endpoint.generate() });
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
// src/features/push/data/push.ts
|
|
702
|
-
var Push = class extends AbstractApiData {
|
|
703
|
-
static {
|
|
704
|
-
__name(this, "Push");
|
|
705
|
-
}
|
|
706
|
-
createJsonApi(data) {
|
|
707
|
-
const response = {
|
|
708
|
-
data: {
|
|
709
|
-
type: Modules.Push.name,
|
|
710
|
-
attributes: {
|
|
711
|
-
key: data.key
|
|
712
|
-
}
|
|
713
|
-
},
|
|
714
|
-
included: []
|
|
715
|
-
};
|
|
716
|
-
return response;
|
|
717
|
-
}
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
// src/features/push/push.module.ts
|
|
721
|
-
var PushModule = /* @__PURE__ */ __name((factory) => factory({
|
|
722
|
-
pageUrl: "/push",
|
|
723
|
-
name: "push",
|
|
724
|
-
model: Push,
|
|
725
|
-
moduleId: ""
|
|
726
|
-
}), "PushModule");
|
|
727
|
-
|
|
728
|
-
// src/features/push/data/push.service.ts
|
|
729
|
-
var PushService = class extends AbstractService {
|
|
730
|
-
static {
|
|
731
|
-
__name(this, "PushService");
|
|
732
|
-
}
|
|
733
|
-
static async register(params) {
|
|
734
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.Push });
|
|
735
|
-
await this.callApi({
|
|
736
|
-
type: Modules.Push,
|
|
737
|
-
method: "POST" /* POST */,
|
|
738
|
-
endpoint: endpoint.generate(),
|
|
739
|
-
input: params.data,
|
|
740
|
-
overridesJsonApiCreation: true
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
|
|
745
|
-
// src/features/role/data/role.ts
|
|
746
|
-
var Role = class extends AbstractApiData {
|
|
747
|
-
static {
|
|
748
|
-
__name(this, "Role");
|
|
749
|
-
}
|
|
750
|
-
_name;
|
|
751
|
-
_description;
|
|
752
|
-
_isSelectable;
|
|
753
|
-
_requiredFeature;
|
|
754
|
-
get name() {
|
|
755
|
-
if (!this._name) throw new Error("Name is not defined");
|
|
756
|
-
return this._name;
|
|
757
|
-
}
|
|
758
|
-
get description() {
|
|
759
|
-
return this._description ?? "";
|
|
760
|
-
}
|
|
761
|
-
get isSelectable() {
|
|
762
|
-
return this._isSelectable ?? false;
|
|
763
|
-
}
|
|
764
|
-
get requiredFeature() {
|
|
765
|
-
return this._requiredFeature;
|
|
766
|
-
}
|
|
767
|
-
rehydrate(data) {
|
|
768
|
-
super.rehydrate(data);
|
|
769
|
-
this._name = data.jsonApi.attributes.name ?? void 0;
|
|
770
|
-
this._description = data.jsonApi.attributes.description ?? void 0;
|
|
771
|
-
this._isSelectable = data.jsonApi.attributes.isSelectable ?? void 0;
|
|
772
|
-
this._requiredFeature = this._readIncluded(
|
|
773
|
-
data,
|
|
774
|
-
"requiredFeature",
|
|
775
|
-
Modules.Feature
|
|
776
|
-
);
|
|
777
|
-
return this;
|
|
778
|
-
}
|
|
779
|
-
createJsonApi(data) {
|
|
780
|
-
const response = {
|
|
781
|
-
data: {
|
|
782
|
-
type: Modules.Role.name,
|
|
783
|
-
id: data.id,
|
|
784
|
-
attributes: {
|
|
785
|
-
name: data.name
|
|
786
|
-
},
|
|
787
|
-
meta: {}
|
|
788
|
-
},
|
|
789
|
-
included: []
|
|
790
|
-
};
|
|
791
|
-
if (data.description !== void 0) response.data.attributes.description = data.description;
|
|
792
|
-
return response;
|
|
793
|
-
}
|
|
794
|
-
};
|
|
795
|
-
|
|
796
|
-
// src/features/role/data/role.fields.ts
|
|
797
|
-
var RoleFields = /* @__PURE__ */ ((RoleFields2) => {
|
|
798
|
-
RoleFields2["roleId"] = "roleId";
|
|
799
|
-
RoleFields2["name"] = "name";
|
|
800
|
-
RoleFields2["description"] = "description";
|
|
801
|
-
RoleFields2["createdAt"] = "createdAt";
|
|
802
|
-
RoleFields2["updatedAt"] = "updatedAt";
|
|
803
|
-
return RoleFields2;
|
|
804
|
-
})(RoleFields || {});
|
|
805
|
-
|
|
806
|
-
// src/features/role/data/role.service.ts
|
|
807
|
-
var RoleService = class extends AbstractService {
|
|
808
|
-
static {
|
|
809
|
-
__name(this, "RoleService");
|
|
810
|
-
}
|
|
811
|
-
static async findById(params) {
|
|
812
|
-
return this.callApi({
|
|
813
|
-
type: Modules.Role,
|
|
814
|
-
method: "GET" /* GET */,
|
|
815
|
-
endpoint: new EndpointCreator({ endpoint: Modules.Role, id: params.roleId }).generate()
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
static async findAllRoles(params) {
|
|
819
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.Role });
|
|
820
|
-
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
821
|
-
return this.callApi({
|
|
822
|
-
type: Modules.Role,
|
|
823
|
-
method: "GET" /* GET */,
|
|
824
|
-
endpoint: endpoint.generate(),
|
|
825
|
-
next: params.next
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
static async findAllRolesByUser(params) {
|
|
829
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.User, id: params.userId, childEndpoint: Modules.Role });
|
|
830
|
-
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
831
|
-
return this.callApi({
|
|
832
|
-
type: Modules.Role,
|
|
410
|
+
type: Modules.Role,
|
|
833
411
|
method: "GET" /* GET */,
|
|
834
412
|
endpoint: endpoint.generate(),
|
|
835
413
|
next: params.next
|
|
@@ -898,282 +476,24 @@ var RoleService = class extends AbstractService {
|
|
|
898
476
|
}
|
|
899
477
|
};
|
|
900
478
|
|
|
901
|
-
// src/features/
|
|
902
|
-
var
|
|
903
|
-
pageUrl: "/roles",
|
|
904
|
-
name: "roles",
|
|
905
|
-
model: Role,
|
|
906
|
-
moduleId: "9f6416e6-7b9b-4e1a-a99f-833191eca8a9"
|
|
907
|
-
}), "RoleModule");
|
|
908
|
-
|
|
909
|
-
// src/features/s3/data/s3.ts
|
|
910
|
-
var S3 = class extends AbstractApiData {
|
|
911
|
-
static {
|
|
912
|
-
__name(this, "S3");
|
|
913
|
-
}
|
|
914
|
-
_url;
|
|
915
|
-
_storageType;
|
|
916
|
-
_contentType;
|
|
917
|
-
_blobType;
|
|
918
|
-
_acl;
|
|
919
|
-
get url() {
|
|
920
|
-
if (!this._url) throw new Error("Image URL is not set.");
|
|
921
|
-
return this._url;
|
|
922
|
-
}
|
|
923
|
-
get headers() {
|
|
924
|
-
const headers = {};
|
|
925
|
-
if (this._contentType) {
|
|
926
|
-
headers["Content-Type"] = this._contentType;
|
|
927
|
-
}
|
|
928
|
-
if (this._blobType) {
|
|
929
|
-
headers["x-ms-blob-type"] = this._blobType;
|
|
930
|
-
}
|
|
931
|
-
if (this._acl) {
|
|
932
|
-
headers["x-amz-acl"] = this._acl;
|
|
933
|
-
}
|
|
934
|
-
return headers;
|
|
935
|
-
}
|
|
936
|
-
rehydrate(data) {
|
|
937
|
-
super.rehydrate(data);
|
|
938
|
-
this._url = data.jsonApi.attributes.url ?? void 0;
|
|
939
|
-
this._storageType = data.jsonApi.attributes.storageType ?? void 0;
|
|
940
|
-
this._contentType = data.jsonApi.attributes.contentType ?? void 0;
|
|
941
|
-
this._blobType = data.jsonApi.attributes.blobType ?? void 0;
|
|
942
|
-
this._acl = data.jsonApi.attributes.acl ?? void 0;
|
|
943
|
-
return this;
|
|
944
|
-
}
|
|
945
|
-
createJsonApi(data) {
|
|
946
|
-
const response = {
|
|
947
|
-
data: {
|
|
948
|
-
type: Modules.S3.name,
|
|
949
|
-
attributes: {
|
|
950
|
-
key: data.key
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
included: []
|
|
954
|
-
};
|
|
955
|
-
if (data.contentType) response.data.attributes.contentType = data.contentType;
|
|
956
|
-
return response;
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
|
|
960
|
-
// src/features/s3/s3.module.ts
|
|
961
|
-
var S3Module = /* @__PURE__ */ __name((factory) => factory({
|
|
962
|
-
pageUrl: "/s3",
|
|
963
|
-
name: "s3",
|
|
964
|
-
model: S3,
|
|
965
|
-
moduleId: "db41ba46-e171-4324-8845-99353eba8568"
|
|
966
|
-
}), "S3Module");
|
|
967
|
-
|
|
968
|
-
// src/features/s3/data/s3.service.ts
|
|
969
|
-
var S3Service = class extends AbstractService {
|
|
970
|
-
static {
|
|
971
|
-
__name(this, "S3Service");
|
|
972
|
-
}
|
|
973
|
-
static async getPreSignedUrl(params) {
|
|
974
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).addAdditionalParam("contentType", params.contentType);
|
|
975
|
-
if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
|
|
976
|
-
return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
977
|
-
}
|
|
978
|
-
static async getSignedUrl(params) {
|
|
979
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.S3, id: "sign" }).addAdditionalParam("key", params.key);
|
|
980
|
-
if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
|
|
981
|
-
return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
982
|
-
}
|
|
983
|
-
static async deleteFile(params) {
|
|
984
|
-
this.callApi({
|
|
985
|
-
type: Modules.S3,
|
|
986
|
-
method: "DELETE" /* DELETE */,
|
|
987
|
-
endpoint: new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).generate()
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
};
|
|
991
|
-
|
|
992
|
-
// src/features/user/data/user.ts
|
|
993
|
-
var User = class extends AbstractApiData {
|
|
994
|
-
static {
|
|
995
|
-
__name(this, "User");
|
|
996
|
-
}
|
|
997
|
-
_name;
|
|
998
|
-
_email;
|
|
999
|
-
_title;
|
|
1000
|
-
_bio;
|
|
1001
|
-
_avatar;
|
|
1002
|
-
_avatarUrl;
|
|
1003
|
-
_phone;
|
|
1004
|
-
_rate;
|
|
1005
|
-
_isActivated;
|
|
1006
|
-
_isDeleted;
|
|
1007
|
-
_lastLogin;
|
|
1008
|
-
_relevance;
|
|
1009
|
-
_roles = [];
|
|
1010
|
-
_company;
|
|
1011
|
-
_modules = [];
|
|
1012
|
-
get searchResult() {
|
|
1013
|
-
return this._name ?? "";
|
|
1014
|
-
}
|
|
1015
|
-
get name() {
|
|
1016
|
-
return this._name ?? "";
|
|
1017
|
-
}
|
|
1018
|
-
get email() {
|
|
1019
|
-
return this._email ?? "";
|
|
1020
|
-
}
|
|
1021
|
-
get title() {
|
|
1022
|
-
return this._title ?? "";
|
|
1023
|
-
}
|
|
1024
|
-
get bio() {
|
|
1025
|
-
return this._bio ?? "";
|
|
1026
|
-
}
|
|
1027
|
-
get avatar() {
|
|
1028
|
-
return this._avatar;
|
|
1029
|
-
}
|
|
1030
|
-
get avatarUrl() {
|
|
1031
|
-
return this._avatarUrl;
|
|
1032
|
-
}
|
|
1033
|
-
get phone() {
|
|
1034
|
-
return this._phone;
|
|
1035
|
-
}
|
|
1036
|
-
get rate() {
|
|
1037
|
-
return this._rate;
|
|
1038
|
-
}
|
|
1039
|
-
get relevance() {
|
|
1040
|
-
return this._relevance;
|
|
1041
|
-
}
|
|
1042
|
-
get isActivated() {
|
|
1043
|
-
return this._isActivated ?? false;
|
|
1044
|
-
}
|
|
1045
|
-
get isDeleted() {
|
|
1046
|
-
return this._isDeleted ?? false;
|
|
1047
|
-
}
|
|
1048
|
-
get lastLogin() {
|
|
1049
|
-
return this._lastLogin;
|
|
1050
|
-
}
|
|
1051
|
-
get roles() {
|
|
1052
|
-
return this._roles;
|
|
1053
|
-
}
|
|
1054
|
-
get company() {
|
|
1055
|
-
return this._company;
|
|
1056
|
-
}
|
|
1057
|
-
get modules() {
|
|
1058
|
-
return this._modules;
|
|
1059
|
-
}
|
|
1060
|
-
rehydrate(data) {
|
|
1061
|
-
super.rehydrate(data);
|
|
1062
|
-
this._name = data.jsonApi.attributes.name;
|
|
1063
|
-
this._email = data.jsonApi.attributes.email;
|
|
1064
|
-
this._title = data.jsonApi.attributes.title;
|
|
1065
|
-
this._bio = data.jsonApi.attributes.bio;
|
|
1066
|
-
this._phone = data.jsonApi.attributes.phone;
|
|
1067
|
-
this._rate = data.jsonApi.attributes.rate;
|
|
1068
|
-
this._avatar = data.jsonApi.attributes.avatar;
|
|
1069
|
-
this._avatarUrl = data.jsonApi.attributes.avatarUrl;
|
|
1070
|
-
this._isActivated = data.jsonApi.meta.isActive;
|
|
1071
|
-
this._isDeleted = data.jsonApi.meta.isDeleted;
|
|
1072
|
-
this._lastLogin = data.jsonApi.meta.lastLogin ? new Date(data.jsonApi.meta.lastLogin) : void 0;
|
|
1073
|
-
this._relevance = data.jsonApi.meta.relevance;
|
|
1074
|
-
this._roles = this._readIncluded(data, "roles", Modules.Role);
|
|
1075
|
-
this._company = this._readIncluded(data, "company", Modules.Company);
|
|
1076
|
-
this._modules = this._readIncluded(data, "modules", Modules.Module);
|
|
1077
|
-
return this;
|
|
1078
|
-
}
|
|
1079
|
-
createJsonApi(data) {
|
|
1080
|
-
const response = {
|
|
1081
|
-
data: {
|
|
1082
|
-
type: Modules.User.name,
|
|
1083
|
-
id: data.id,
|
|
1084
|
-
attributes: {
|
|
1085
|
-
name: data.name
|
|
1086
|
-
},
|
|
1087
|
-
meta: {},
|
|
1088
|
-
relationships: {}
|
|
1089
|
-
},
|
|
1090
|
-
included: []
|
|
1091
|
-
};
|
|
1092
|
-
if (data.email !== void 0) response.data.attributes.email = data.email;
|
|
1093
|
-
if (data.title !== void 0) response.data.attributes.title = data.title;
|
|
1094
|
-
if (data.bio !== void 0) response.data.attributes.bio = data.bio;
|
|
1095
|
-
if (data.phone !== void 0) response.data.attributes.phone = data.phone;
|
|
1096
|
-
if (data.password !== void 0) response.data.attributes.password = data.password;
|
|
1097
|
-
if (data.sendInvitationEmail) response.data.attributes.sendInvitationEmail = true;
|
|
1098
|
-
if (data.adminCreated) response.data.attributes.adminCreated = true;
|
|
1099
|
-
if (data.avatar) response.data.attributes.avatar = data.avatar;
|
|
1100
|
-
if (data.rate !== void 0) response.data.attributes.rate = data.rate;
|
|
1101
|
-
if (data.roleIds) {
|
|
1102
|
-
response.data.relationships.roles = {
|
|
1103
|
-
data: data.roleIds.map((roleId) => ({
|
|
1104
|
-
type: Modules.Role.name,
|
|
1105
|
-
id: roleId
|
|
1106
|
-
}))
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
if (data.companyId) {
|
|
1110
|
-
response.data.relationships.company = {
|
|
1111
|
-
data: {
|
|
1112
|
-
type: Modules.Company.name,
|
|
1113
|
-
id: data.companyId
|
|
1114
|
-
}
|
|
1115
|
-
};
|
|
1116
|
-
}
|
|
1117
|
-
return response;
|
|
1118
|
-
}
|
|
1119
|
-
};
|
|
1120
|
-
|
|
1121
|
-
// src/features/user/data/user.fields.ts
|
|
1122
|
-
var UserFields = /* @__PURE__ */ ((UserFields2) => {
|
|
1123
|
-
UserFields2["userId"] = "userId";
|
|
1124
|
-
UserFields2["name"] = "name";
|
|
1125
|
-
UserFields2["email"] = "email";
|
|
1126
|
-
UserFields2["relevance"] = "relevance";
|
|
1127
|
-
UserFields2["createdAt"] = "createdAt";
|
|
1128
|
-
UserFields2["updatedAt"] = "updatedAt";
|
|
1129
|
-
return UserFields2;
|
|
1130
|
-
})(UserFields || {});
|
|
1131
|
-
|
|
1132
|
-
// src/features/user/data/user.service.ts
|
|
1133
|
-
var UserService = class extends AbstractService {
|
|
479
|
+
// src/features/content/data/content.service.ts
|
|
480
|
+
var ContentService = class extends AbstractService {
|
|
1134
481
|
static {
|
|
1135
|
-
__name(this, "
|
|
1136
|
-
}
|
|
1137
|
-
static async findFullUser() {
|
|
1138
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "me", childEndpoint: "full" });
|
|
1139
|
-
return this.callApi({
|
|
1140
|
-
type: Modules.User,
|
|
1141
|
-
method: "GET" /* GET */,
|
|
1142
|
-
endpoint: endpoint.generate()
|
|
1143
|
-
});
|
|
1144
|
-
}
|
|
1145
|
-
static async findById(params) {
|
|
1146
|
-
return this.callApi({
|
|
1147
|
-
type: Modules.User,
|
|
1148
|
-
method: "GET" /* GET */,
|
|
1149
|
-
endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
static async findByEmail(params) {
|
|
1153
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.User, id: "email", childEndpoint: params.email });
|
|
1154
|
-
return this.callApi({ type: Modules.User, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
482
|
+
__name(this, "ContentService");
|
|
1155
483
|
}
|
|
1156
484
|
static async findMany(params) {
|
|
1157
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.
|
|
1158
|
-
if (params.
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
});
|
|
1168
|
-
}
|
|
1169
|
-
static async findManyByContentIds(params) {
|
|
1170
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.User });
|
|
1171
|
-
endpoint.addAdditionalParam("contentIds", params.contentIds.map((id) => id).join(","));
|
|
1172
|
-
endpoint.addAdditionalParam("includeDeleted", "true");
|
|
1173
|
-
endpoint.addAdditionalParam("fetchAll", "true");
|
|
1174
|
-
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
485
|
+
const endpoint = new EndpointCreator({ endpoint: 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 (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
|
|
494
|
+
if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
|
|
1175
495
|
return this.callApi({
|
|
1176
|
-
type: Modules.
|
|
496
|
+
type: Modules.Content,
|
|
1177
497
|
method: "GET" /* GET */,
|
|
1178
498
|
endpoint: endpoint.generate(),
|
|
1179
499
|
next: params.next
|
|
@@ -1183,193 +503,135 @@ var UserService = class extends AbstractService {
|
|
|
1183
503
|
const endpoint = new EndpointCreator({
|
|
1184
504
|
endpoint: Modules.Content,
|
|
1185
505
|
id: params.id,
|
|
1186
|
-
childEndpoint: "
|
|
506
|
+
childEndpoint: "relevance"
|
|
1187
507
|
});
|
|
1188
|
-
if (Modules.
|
|
1189
|
-
if (Modules.
|
|
508
|
+
if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
|
|
509
|
+
if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
|
|
1190
510
|
return this.callApi({
|
|
1191
|
-
type: Modules.
|
|
511
|
+
type: Modules.Content,
|
|
1192
512
|
method: "GET" /* GET */,
|
|
1193
513
|
endpoint: endpoint.generate(),
|
|
1194
514
|
next: params.next
|
|
1195
515
|
});
|
|
1196
516
|
}
|
|
1197
|
-
static async
|
|
1198
|
-
if (!params.companyId) return [];
|
|
517
|
+
static async findManyByAuthor(params) {
|
|
1199
518
|
const endpoint = new EndpointCreator({
|
|
1200
|
-
endpoint: Modules.
|
|
1201
|
-
id: params.
|
|
1202
|
-
childEndpoint: Modules.
|
|
519
|
+
endpoint: Modules.Author,
|
|
520
|
+
id: params.userId,
|
|
521
|
+
childEndpoint: Modules.Content
|
|
1203
522
|
});
|
|
523
|
+
if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
|
|
1204
524
|
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
525
|
+
if (Modules.Content.inclusions?.lists?.fields) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
|
|
526
|
+
if (Modules.Content.inclusions?.lists?.types) endpoint.limitToType(Modules.Content.inclusions.lists.types);
|
|
1205
527
|
return this.callApi({
|
|
1206
|
-
type: Modules.
|
|
528
|
+
type: Modules.Content,
|
|
1207
529
|
method: "GET" /* GET */,
|
|
1208
530
|
endpoint: endpoint.generate(),
|
|
1209
|
-
next: params.next
|
|
1210
|
-
previous: params.prev
|
|
531
|
+
next: params.next
|
|
1211
532
|
});
|
|
1212
533
|
}
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
// src/features/notification/data/notification.service.ts
|
|
537
|
+
var NotificationService = class extends AbstractService {
|
|
538
|
+
static {
|
|
539
|
+
__name(this, "NotificationService");
|
|
540
|
+
}
|
|
541
|
+
static async findMany(params) {
|
|
542
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
|
|
543
|
+
if (params.isArchived) endpoint.addAdditionalParam("isArchived", "true");
|
|
1223
544
|
return this.callApi({
|
|
1224
|
-
type: Modules.
|
|
545
|
+
type: Modules.Notification,
|
|
1225
546
|
method: "GET" /* GET */,
|
|
1226
547
|
endpoint: endpoint.generate(),
|
|
1227
548
|
next: params.next
|
|
1228
549
|
});
|
|
1229
550
|
}
|
|
1230
|
-
static async
|
|
1231
|
-
const endpoint = new EndpointCreator({ endpoint: Modules.
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
method: "GET" /* GET */,
|
|
551
|
+
static async markAsRead(params) {
|
|
552
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Notification });
|
|
553
|
+
await this.callApi({
|
|
554
|
+
type: Modules.Notification,
|
|
555
|
+
method: "PATCH" /* PATCH */,
|
|
1236
556
|
endpoint: endpoint.generate(),
|
|
1237
|
-
|
|
557
|
+
input: params.data,
|
|
558
|
+
overridesJsonApiCreation: true
|
|
1238
559
|
});
|
|
1239
560
|
}
|
|
1240
|
-
static async
|
|
1241
|
-
const endpoint = new EndpointCreator({
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
561
|
+
static async archive(params) {
|
|
562
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Notification, id: params.id, childEndpoint: "archive" });
|
|
563
|
+
await this.callApi({ type: Modules.Notification, method: "POST" /* POST */, endpoint: endpoint.generate() });
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
// src/features/feature/data/feature.service.ts
|
|
568
|
+
var FeatureService = class extends AbstractService {
|
|
569
|
+
static {
|
|
570
|
+
__name(this, "FeatureService");
|
|
571
|
+
}
|
|
572
|
+
static async findMany(params) {
|
|
573
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Feature });
|
|
574
|
+
if (params.companyId) endpoint.endpoint(Modules.Company).id(params.companyId).childEndpoint(Modules.Feature);
|
|
1246
575
|
if (params.search) endpoint.addAdditionalParam("search", params.search);
|
|
1247
576
|
return this.callApi({
|
|
1248
|
-
type: Modules.
|
|
577
|
+
type: Modules.Feature,
|
|
1249
578
|
method: "GET" /* GET */,
|
|
1250
579
|
endpoint: endpoint.generate(),
|
|
1251
580
|
next: params.next
|
|
1252
581
|
});
|
|
1253
582
|
}
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
input: params
|
|
1261
|
-
});
|
|
1262
|
-
}
|
|
1263
|
-
static async reactivate(params) {
|
|
1264
|
-
return this.callApi({
|
|
1265
|
-
type: Modules.User,
|
|
1266
|
-
method: "PATCH" /* PATCH */,
|
|
1267
|
-
endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.userId }).generate()
|
|
1268
|
-
});
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
// src/features/push/data/push.service.ts
|
|
586
|
+
var PushService = class extends AbstractService {
|
|
587
|
+
static {
|
|
588
|
+
__name(this, "PushService");
|
|
1269
589
|
}
|
|
1270
|
-
static async
|
|
1271
|
-
const endpoint = new EndpointCreator({
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
childEndpoint: "send-invitation-email"
|
|
1275
|
-
});
|
|
1276
|
-
if (params.companyId) endpoint.addAdditionalParam("companyId", params.companyId);
|
|
1277
|
-
this.callApi({
|
|
1278
|
-
type: Modules.User,
|
|
590
|
+
static async register(params) {
|
|
591
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Push });
|
|
592
|
+
await this.callApi({
|
|
593
|
+
type: Modules.Push,
|
|
1279
594
|
method: "POST" /* POST */,
|
|
1280
|
-
endpoint: endpoint.generate()
|
|
595
|
+
endpoint: endpoint.generate(),
|
|
596
|
+
input: params.data,
|
|
597
|
+
overridesJsonApiCreation: true
|
|
1281
598
|
});
|
|
1282
599
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
input: params
|
|
1290
|
-
});
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
// src/features/s3/data/s3.service.ts
|
|
603
|
+
var S3Service = class extends AbstractService {
|
|
604
|
+
static {
|
|
605
|
+
__name(this, "S3Service");
|
|
1291
606
|
}
|
|
1292
|
-
static async
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
endpoint: new EndpointCreator({ endpoint: Modules.User, id: params.id, childEndpoint: "rates" }).generate(),
|
|
1297
|
-
companyId: params.companyId,
|
|
1298
|
-
input: params
|
|
1299
|
-
});
|
|
607
|
+
static async getPreSignedUrl(params) {
|
|
608
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).addAdditionalParam("contentType", params.contentType);
|
|
609
|
+
if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
|
|
610
|
+
return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
1300
611
|
}
|
|
1301
|
-
static async
|
|
1302
|
-
|
|
1303
|
-
|
|
612
|
+
static async getSignedUrl(params) {
|
|
613
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.S3, id: "sign" }).addAdditionalParam("key", params.key);
|
|
614
|
+
if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
|
|
615
|
+
return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
|
|
616
|
+
}
|
|
617
|
+
static async deleteFile(params) {
|
|
618
|
+
this.callApi({
|
|
619
|
+
type: Modules.S3,
|
|
1304
620
|
method: "DELETE" /* DELETE */,
|
|
1305
|
-
endpoint: new EndpointCreator({ endpoint: Modules.
|
|
1306
|
-
companyId: params.companyId
|
|
621
|
+
endpoint: new EndpointCreator({ endpoint: Modules.S3 }).addAdditionalParam("key", params.key).generate()
|
|
1307
622
|
});
|
|
1308
623
|
}
|
|
1309
624
|
};
|
|
1310
625
|
|
|
1311
|
-
// src/features/user/author.module.ts
|
|
1312
|
-
var AuthorModule = /* @__PURE__ */ __name((factory) => factory({
|
|
1313
|
-
pageUrl: "/authors",
|
|
1314
|
-
name: "authors",
|
|
1315
|
-
model: User,
|
|
1316
|
-
moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277"
|
|
1317
|
-
}), "AuthorModule");
|
|
1318
|
-
|
|
1319
|
-
// src/features/user/user.module.ts
|
|
1320
|
-
var UserModule = /* @__PURE__ */ __name((factory) => factory({
|
|
1321
|
-
pageUrl: "/users",
|
|
1322
|
-
name: "users",
|
|
1323
|
-
model: User,
|
|
1324
|
-
moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277",
|
|
1325
|
-
inclusions: {
|
|
1326
|
-
lists: {
|
|
1327
|
-
fields: [
|
|
1328
|
-
createJsonApiInclusion("users", [`name`, `email`, `avatar`, `title`]),
|
|
1329
|
-
createJsonApiInclusion("usertopics", [`level`]),
|
|
1330
|
-
createJsonApiInclusion("userexpertises", [`level`]),
|
|
1331
|
-
createJsonApiInclusion("topics", [`name`])
|
|
1332
|
-
]
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
}), "UserModule");
|
|
1336
|
-
|
|
1337
626
|
export {
|
|
1338
|
-
|
|
1339
|
-
RoleFields,
|
|
1340
|
-
RoleService,
|
|
1341
|
-
RoleModule,
|
|
1342
|
-
User,
|
|
1343
|
-
UserFields,
|
|
627
|
+
AuthService,
|
|
1344
628
|
UserService,
|
|
1345
|
-
S3,
|
|
1346
|
-
S3Module,
|
|
1347
|
-
S3Service,
|
|
1348
|
-
AuthorModule,
|
|
1349
|
-
UserModule,
|
|
1350
|
-
Company,
|
|
1351
|
-
CompanyFields,
|
|
1352
629
|
CompanyService,
|
|
1353
|
-
|
|
1354
|
-
FeatureModule,
|
|
1355
|
-
FeatureService,
|
|
1356
|
-
Notification,
|
|
1357
|
-
NotificationFields,
|
|
1358
|
-
NotificationService,
|
|
1359
|
-
AuthModule,
|
|
1360
|
-
Auth,
|
|
1361
|
-
AuthService,
|
|
1362
|
-
AuthComponent,
|
|
1363
|
-
CompanyModule,
|
|
1364
|
-
ContentModule,
|
|
1365
|
-
Content,
|
|
1366
|
-
ContentFields,
|
|
630
|
+
RoleService,
|
|
1367
631
|
ContentService,
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
PushModule,
|
|
1373
|
-
PushService
|
|
632
|
+
NotificationService,
|
|
633
|
+
FeatureService,
|
|
634
|
+
PushService,
|
|
635
|
+
S3Service
|
|
1374
636
|
};
|
|
1375
|
-
//# sourceMappingURL=chunk-
|
|
637
|
+
//# sourceMappingURL=chunk-37NJZ2VD.mjs.map
|