@carlonicora/nextjs-jsonapi 1.1.1 → 1.2.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/{BlockNoteEditor-6NVBI7XL.js → BlockNoteEditor-CNXQ3WL3.js} +7 -7
- package/dist/{BlockNoteEditor-6NVBI7XL.js.map → BlockNoteEditor-CNXQ3WL3.js.map} +1 -1
- package/dist/{BlockNoteEditor-4VOBTXWC.mjs → BlockNoteEditor-DC33K4IF.mjs} +3 -3
- package/dist/{chunk-KPRHIJO6.js → chunk-KDFDGXCX.js} +53 -53
- package/dist/{chunk-KPRHIJO6.js.map → chunk-KDFDGXCX.js.map} +1 -1
- package/dist/{chunk-FYRFMABS.js → chunk-L6LH7WA4.js} +21 -2
- package/dist/chunk-L6LH7WA4.js.map +1 -0
- package/dist/{chunk-MA2L2PL2.mjs → chunk-MHVXFWZY.mjs} +20 -1
- package/dist/chunk-MHVXFWZY.mjs.map +1 -0
- package/dist/{chunk-HP4Q5ZVG.mjs → chunk-Y4XI3AZR.mjs} +3 -3
- package/dist/client/index.js +3 -3
- package/dist/client/index.mjs +2 -2
- package/dist/components/index.js +3 -3
- package/dist/components/index.mjs +2 -2
- package/dist/contexts/index.js +3 -3
- package/dist/contexts/index.mjs +2 -2
- package/dist/features/index.d.mts +3 -1
- package/dist/features/index.d.ts +3 -1
- package/dist/features/index.js +4 -2
- package/dist/features/index.js.map +1 -1
- package/dist/features/index.mjs +3 -1
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/index.mjs +2 -2
- package/package.json +1 -1
- package/src/features/user/index.ts +1 -1
- package/dist/chunk-FYRFMABS.js.map +0 -1
- package/dist/chunk-MA2L2PL2.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-4VOBTXWC.mjs.map → BlockNoteEditor-DC33K4IF.mjs.map} +0 -0
- /package/dist/{chunk-HP4Q5ZVG.mjs.map → chunk-Y4XI3AZR.mjs.map} +0 -0
|
@@ -109,7 +109,7 @@ var _chunkLJRD4SRVjs = require('./chunk-LJRD4SRV.js');
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
var
|
|
112
|
+
var _chunkL6LH7WA4js = require('./chunk-L6LH7WA4.js');
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
|
|
@@ -1040,7 +1040,7 @@ function usePushNotifications() {
|
|
|
1040
1040
|
};
|
|
1041
1041
|
const subscriptionHash = btoa(JSON.stringify(plainSubscription));
|
|
1042
1042
|
if (lastRegisteredSubscription !== subscriptionHash) {
|
|
1043
|
-
await
|
|
1043
|
+
await _chunkL6LH7WA4js.PushService.register({ data: plainSubscription });
|
|
1044
1044
|
sessionStorage.setItem(sessionKey, subscriptionHash);
|
|
1045
1045
|
}
|
|
1046
1046
|
} catch (error) {
|
|
@@ -1771,7 +1771,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsersListContainer, "UsersListContainer");
|
|
|
1771
1771
|
function AdminUsersListInternal({ company }) {
|
|
1772
1772
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1773
1773
|
const data = useDataListRetriever({
|
|
1774
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1774
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.UserService.findManyForAmin(params), "retriever"),
|
|
1775
1775
|
retrieverParams: { companyId: company.id },
|
|
1776
1776
|
module: _chunkWZJDLITGjs.Modules.User
|
|
1777
1777
|
});
|
|
@@ -1803,7 +1803,7 @@ function CompanyUsersList({ isDeleted }) {
|
|
|
1803
1803
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1804
1804
|
const data = useDataListRetriever({
|
|
1805
1805
|
ready: !!company,
|
|
1806
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1806
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.UserService.findAllUsers(params), "retriever"),
|
|
1807
1807
|
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _48 => _48.id]), isDeleted },
|
|
1808
1808
|
module: _chunkWZJDLITGjs.Modules.User
|
|
1809
1809
|
});
|
|
@@ -1860,7 +1860,7 @@ function RelevantUsersList({ id }) {
|
|
|
1860
1860
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1861
1861
|
const data = useDataListRetriever({
|
|
1862
1862
|
module: _chunkWZJDLITGjs.Modules.User,
|
|
1863
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1863
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.UserService.findRelevant(params), "retriever"),
|
|
1864
1864
|
retrieverParams: { id }
|
|
1865
1865
|
});
|
|
1866
1866
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1881,7 +1881,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, RelevantUsersList, "RelevantUsersList");
|
|
|
1881
1881
|
function RoleUsersList({ role }) {
|
|
1882
1882
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1883
1883
|
const data = useDataListRetriever({
|
|
1884
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1884
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.UserService.findAllUsersByRole(params), "retriever"),
|
|
1885
1885
|
retrieverParams: { roleId: role.id },
|
|
1886
1886
|
module: _chunkWZJDLITGjs.Modules.User
|
|
1887
1887
|
});
|
|
@@ -1954,7 +1954,7 @@ function UsersListByContentIds({ contentIds }) {
|
|
|
1954
1954
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1955
1955
|
const data = useDataListRetriever({
|
|
1956
1956
|
module: _chunkWZJDLITGjs.Modules.User,
|
|
1957
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1957
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.UserService.findManyByContentIds(params), "retriever"),
|
|
1958
1958
|
retrieverParams: { contentIds }
|
|
1959
1959
|
});
|
|
1960
1960
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1984,7 +1984,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, AllowedUsersDetails, "AllowedUsersDetails")
|
|
|
1984
1984
|
var _dynamic = require('next/dynamic'); var _dynamic2 = _interopRequireDefault(_dynamic);
|
|
1985
1985
|
|
|
1986
1986
|
|
|
1987
|
-
var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-
|
|
1987
|
+
var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-CNXQ3WL3.js"))), {
|
|
1988
1988
|
ssr: false
|
|
1989
1989
|
});
|
|
1990
1990
|
var BlockNoteEditorContainer = React4.default.memo(/* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, function EditorContainer(props) {
|
|
@@ -4308,7 +4308,7 @@ var useUserSearch = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
|
4308
4308
|
if (search === searchQueryRef.current && users.length > 0) return;
|
|
4309
4309
|
setIsLoading(true);
|
|
4310
4310
|
searchQueryRef.current = search;
|
|
4311
|
-
const fetchedUsers = await
|
|
4311
|
+
const fetchedUsers = await _chunkL6LH7WA4js.UserService.findMany({ search, fetchAll: true });
|
|
4312
4312
|
setUsers(fetchedUsers);
|
|
4313
4313
|
} catch (error) {
|
|
4314
4314
|
console.error("Failed to load users:", error);
|
|
@@ -4777,7 +4777,7 @@ function Register() {
|
|
|
4777
4777
|
email: values.email,
|
|
4778
4778
|
password: values.password
|
|
4779
4779
|
};
|
|
4780
|
-
await
|
|
4780
|
+
await _chunkL6LH7WA4js.AuthService.register(payload);
|
|
4781
4781
|
setShowConfirmation(true);
|
|
4782
4782
|
} catch (e) {
|
|
4783
4783
|
errorToast({ error: e });
|
|
@@ -4967,7 +4967,7 @@ function AcceptInvitation() {
|
|
|
4967
4967
|
const payload = {
|
|
4968
4968
|
code
|
|
4969
4969
|
};
|
|
4970
|
-
await
|
|
4970
|
+
await _chunkL6LH7WA4js.AuthService.validateCode(payload);
|
|
4971
4971
|
} catch (e) {
|
|
4972
4972
|
setError(e instanceof Error ? e.message : String(e));
|
|
4973
4973
|
errorToast({ title: t(`generic.errors.error`), error: e });
|
|
@@ -5005,7 +5005,7 @@ function AcceptInvitation() {
|
|
|
5005
5005
|
code: _optionalChain([params, 'optionalAccess', _139 => _139.code]),
|
|
5006
5006
|
password: values.password
|
|
5007
5007
|
};
|
|
5008
|
-
await
|
|
5008
|
+
await _chunkL6LH7WA4js.AuthService.acceptInvitation(payload);
|
|
5009
5009
|
setShowConfirmation(true);
|
|
5010
5010
|
_sonner.toast.success(t("foundations.auth.account_activated"), {
|
|
5011
5011
|
description: t("foundations.auth.account_activated_description")
|
|
@@ -5068,7 +5068,7 @@ function ActivateAccount() {
|
|
|
5068
5068
|
const payload = {
|
|
5069
5069
|
activationCode: code
|
|
5070
5070
|
};
|
|
5071
|
-
await
|
|
5071
|
+
await _chunkL6LH7WA4js.AuthService.activate(payload);
|
|
5072
5072
|
setShowConfirmation(true);
|
|
5073
5073
|
setParams(void 0);
|
|
5074
5074
|
_sonner.toast.success(t("foundations.auth.account_activated"), {
|
|
@@ -5111,7 +5111,7 @@ function Cookies({ dehydratedAuth, page }) {
|
|
|
5111
5111
|
_react.useEffect.call(void 0, () => {
|
|
5112
5112
|
if (hasSaved) return;
|
|
5113
5113
|
async function saveTokenOnServer() {
|
|
5114
|
-
await
|
|
5114
|
+
await _chunkL6LH7WA4js.AuthService.saveToken({ dehydratedAuth });
|
|
5115
5115
|
const auth = _chunkWZJDLITGjs.rehydrate.call(void 0, _chunkWZJDLITGjs.Modules.Auth, dehydratedAuth);
|
|
5116
5116
|
setUser(auth.user);
|
|
5117
5117
|
setHasSaved(true);
|
|
@@ -5155,7 +5155,7 @@ function ForgotPassword() {
|
|
|
5155
5155
|
const payload = {
|
|
5156
5156
|
email: values.email
|
|
5157
5157
|
};
|
|
5158
|
-
await
|
|
5158
|
+
await _chunkL6LH7WA4js.AuthService.initialiseForgotPassword(payload);
|
|
5159
5159
|
setShowConfirmation(true);
|
|
5160
5160
|
} catch (e) {
|
|
5161
5161
|
errorToast({ error: e });
|
|
@@ -5226,7 +5226,7 @@ function Login() {
|
|
|
5226
5226
|
});
|
|
5227
5227
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
5228
5228
|
try {
|
|
5229
|
-
const user = await
|
|
5229
|
+
const user = await _chunkL6LH7WA4js.AuthService.login({
|
|
5230
5230
|
email: values.email,
|
|
5231
5231
|
password: values.password
|
|
5232
5232
|
});
|
|
@@ -5305,7 +5305,7 @@ function Logout() {
|
|
|
5305
5305
|
const generateUrl = usePageUrlGenerator();
|
|
5306
5306
|
_react.useEffect.call(void 0, () => {
|
|
5307
5307
|
const logOut = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
5308
|
-
await
|
|
5308
|
+
await _chunkL6LH7WA4js.AuthService.logout();
|
|
5309
5309
|
window.location.href = generateUrl({ page: `/` });
|
|
5310
5310
|
}, "logOut");
|
|
5311
5311
|
logOut();
|
|
@@ -5320,7 +5320,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, Logout, "Logout");
|
|
|
5320
5320
|
function RefreshUser() {
|
|
5321
5321
|
const { setUser } = useCurrentUserContext();
|
|
5322
5322
|
const loadFullUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
5323
|
-
const fullUser = await
|
|
5323
|
+
const fullUser = await _chunkL6LH7WA4js.UserService.findFullUser();
|
|
5324
5324
|
if (fullUser) {
|
|
5325
5325
|
setUser(fullUser);
|
|
5326
5326
|
const token = {
|
|
@@ -5365,7 +5365,7 @@ function ResetPassword() {
|
|
|
5365
5365
|
const payload = {
|
|
5366
5366
|
code
|
|
5367
5367
|
};
|
|
5368
|
-
await
|
|
5368
|
+
await _chunkL6LH7WA4js.AuthService.validateCode(payload);
|
|
5369
5369
|
} catch (e) {
|
|
5370
5370
|
setError(e instanceof Error ? e.message : String(e));
|
|
5371
5371
|
errorToast({ title: t(`generic.errors.error`), error: e });
|
|
@@ -5403,7 +5403,7 @@ function ResetPassword() {
|
|
|
5403
5403
|
code: _optionalChain([params, 'optionalAccess', _151 => _151.code]),
|
|
5404
5404
|
password: values.password
|
|
5405
5405
|
};
|
|
5406
|
-
await
|
|
5406
|
+
await _chunkL6LH7WA4js.AuthService.resetPassword(payload);
|
|
5407
5407
|
setShowConfirmation(true);
|
|
5408
5408
|
_sonner.toast.success(t(`foundations.auth.reset_success`), {
|
|
5409
5409
|
description: t(`foundations.auth.reset_success_description`)
|
|
@@ -5600,8 +5600,8 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
5600
5600
|
}
|
|
5601
5601
|
};
|
|
5602
5602
|
try {
|
|
5603
|
-
await
|
|
5604
|
-
const fullUser = await
|
|
5603
|
+
await _chunkL6LH7WA4js.CompanyService.updateConfigurations(payload);
|
|
5604
|
+
const fullUser = await _chunkL6LH7WA4js.UserService.findFullUser();
|
|
5605
5605
|
if (fullUser) {
|
|
5606
5606
|
setUser(fullUser);
|
|
5607
5607
|
}
|
|
@@ -5656,7 +5656,7 @@ function CompanyDeleterInternal({ company }) {
|
|
|
5656
5656
|
const handleDelete = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
5657
5657
|
setIsDeleting(true);
|
|
5658
5658
|
try {
|
|
5659
|
-
await
|
|
5659
|
+
await _chunkL6LH7WA4js.CompanyService.delete({ companyId: company.id });
|
|
5660
5660
|
router.push("/");
|
|
5661
5661
|
} catch (error) {
|
|
5662
5662
|
errorToast({ title: t(`generic.errors.delete`), error });
|
|
@@ -5774,7 +5774,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5774
5774
|
});
|
|
5775
5775
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
5776
5776
|
if (values.logo && contentType) {
|
|
5777
|
-
const s3 = await
|
|
5777
|
+
const s3 = await _chunkL6LH7WA4js.S3Service.getPreSignedUrl({
|
|
5778
5778
|
key: values.logo,
|
|
5779
5779
|
contentType,
|
|
5780
5780
|
isPublic: true
|
|
@@ -5793,7 +5793,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5793
5793
|
moduleIds: values.moduleIds
|
|
5794
5794
|
};
|
|
5795
5795
|
try {
|
|
5796
|
-
const updatedCompany = company ? await
|
|
5796
|
+
const updatedCompany = company ? await _chunkL6LH7WA4js.CompanyService.update(payload) : await _chunkL6LH7WA4js.CompanyService.create(payload);
|
|
5797
5797
|
if (onRevalidate) {
|
|
5798
5798
|
await onRevalidate(generateUrl({ page: _chunkWZJDLITGjs.Modules.Company, id: updatedCompany.id, language: `[locale]` }));
|
|
5799
5799
|
}
|
|
@@ -5813,7 +5813,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5813
5813
|
}, "onSubmit");
|
|
5814
5814
|
_react.useEffect.call(void 0, () => {
|
|
5815
5815
|
async function fetchFeatures() {
|
|
5816
|
-
const allfeatures = await
|
|
5816
|
+
const allfeatures = await _chunkL6LH7WA4js.FeatureService.findMany({});
|
|
5817
5817
|
if (hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator)) {
|
|
5818
5818
|
setFeatures(allfeatures);
|
|
5819
5819
|
} else {
|
|
@@ -5927,7 +5927,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, CompanyEditor, "CompanyEditor");
|
|
|
5927
5927
|
function CompaniesList() {
|
|
5928
5928
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
5929
5929
|
const data = useDataListRetriever({
|
|
5930
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
5930
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.CompanyService.findMany(params), "retriever"),
|
|
5931
5931
|
retrieverParams: {},
|
|
5932
5932
|
module: _chunkWZJDLITGjs.Modules.Company
|
|
5933
5933
|
});
|
|
@@ -5983,7 +5983,7 @@ function ContentsListById({ contentIds }) {
|
|
|
5983
5983
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
5984
5984
|
const data = useDataListRetriever({
|
|
5985
5985
|
module: _chunkWZJDLITGjs.Modules.Content,
|
|
5986
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
5986
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.ContentService.findMany(params), "retriever"),
|
|
5987
5987
|
retrieverParams: { contentIds }
|
|
5988
5988
|
});
|
|
5989
5989
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6005,7 +6005,7 @@ function RelevantContentsList({ id }) {
|
|
|
6005
6005
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6006
6006
|
const data = useDataListRetriever({
|
|
6007
6007
|
module: _chunkWZJDLITGjs.Modules.Content,
|
|
6008
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6008
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.ContentService.findRelevant(params), "retriever"),
|
|
6009
6009
|
retrieverParams: { id }
|
|
6010
6010
|
});
|
|
6011
6011
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6149,7 +6149,7 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
|
|
|
6149
6149
|
setIsLoading(true);
|
|
6150
6150
|
setError(null);
|
|
6151
6151
|
try {
|
|
6152
|
-
const fetchedNotifications = await
|
|
6152
|
+
const fetchedNotifications = await _chunkL6LH7WA4js.NotificationService.findMany({});
|
|
6153
6153
|
setNotifications(fetchedNotifications);
|
|
6154
6154
|
setLastLoaded(Date.now());
|
|
6155
6155
|
} catch (error2) {
|
|
@@ -6174,8 +6174,8 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
|
|
|
6174
6174
|
relationships: {}
|
|
6175
6175
|
}))
|
|
6176
6176
|
};
|
|
6177
|
-
await
|
|
6178
|
-
const allNotifications = await
|
|
6177
|
+
await _chunkL6LH7WA4js.NotificationService.markAsRead({ data });
|
|
6178
|
+
const allNotifications = await _chunkL6LH7WA4js.NotificationService.findMany({});
|
|
6179
6179
|
setNotifications(allNotifications);
|
|
6180
6180
|
setLastLoaded(Date.now());
|
|
6181
6181
|
} catch (error2) {
|
|
@@ -6242,12 +6242,12 @@ function NotificationsList({ archived }) {
|
|
|
6242
6242
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6243
6243
|
const generateUrl = usePageUrlGenerator();
|
|
6244
6244
|
const data = useDataListRetriever({
|
|
6245
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6245
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.NotificationService.findMany(params), "retriever"),
|
|
6246
6246
|
retrieverParams: { isArchived: archived },
|
|
6247
6247
|
module: _chunkWZJDLITGjs.Modules.Notification
|
|
6248
6248
|
});
|
|
6249
6249
|
const archiveNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (notification) => {
|
|
6250
|
-
await
|
|
6250
|
+
await _chunkL6LH7WA4js.NotificationService.archive({ id: notification.id });
|
|
6251
6251
|
data.removeElement(notification);
|
|
6252
6252
|
}, "archiveNotification");
|
|
6253
6253
|
const LoadingSkeleton = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { className: "p-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center", children: [
|
|
@@ -6624,7 +6624,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
6624
6624
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6625
6625
|
_react.useEffect.call(void 0, () => {
|
|
6626
6626
|
async function checkCompanyAdminDeletability() {
|
|
6627
|
-
const roleUsers = await
|
|
6627
|
+
const roleUsers = await _chunkL6LH7WA4js.UserService.findAllUsersByRole({
|
|
6628
6628
|
roleId: role.id
|
|
6629
6629
|
});
|
|
6630
6630
|
if (roleUsers.length > 1) setCanRemove(true);
|
|
@@ -6638,7 +6638,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
6638
6638
|
}, [role]);
|
|
6639
6639
|
const remove = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
6640
6640
|
try {
|
|
6641
|
-
await
|
|
6641
|
+
await _chunkL6LH7WA4js.RoleService.removeUserFromRole({
|
|
6642
6642
|
roleId: role.id,
|
|
6643
6643
|
userId: user.id
|
|
6644
6644
|
});
|
|
@@ -6702,7 +6702,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
6702
6702
|
const [roles, setRoles] = _react.useState.call(void 0, []);
|
|
6703
6703
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6704
6704
|
const addUserToRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (role) => {
|
|
6705
|
-
await
|
|
6705
|
+
await _chunkL6LH7WA4js.RoleService.addUserToRole({
|
|
6706
6706
|
roleId: role.id,
|
|
6707
6707
|
userId: user.id
|
|
6708
6708
|
});
|
|
@@ -6726,7 +6726,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
6726
6726
|
const searchRoles = _react.useCallback.call(void 0,
|
|
6727
6727
|
async (term) => {
|
|
6728
6728
|
setRoles(
|
|
6729
|
-
await
|
|
6729
|
+
await _chunkL6LH7WA4js.RoleService.findAllRolesUserNotIn({
|
|
6730
6730
|
search: term,
|
|
6731
6731
|
userId: user.id
|
|
6732
6732
|
})
|
|
@@ -6794,7 +6794,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, UserRoleAdd, "UserRoleAdd");
|
|
|
6794
6794
|
function RolesList() {
|
|
6795
6795
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6796
6796
|
const data = useDataListRetriever({
|
|
6797
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6797
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.RoleService.findAllRoles(params), "retriever"),
|
|
6798
6798
|
retrieverParams: {},
|
|
6799
6799
|
module: _chunkWZJDLITGjs.Modules.Role
|
|
6800
6800
|
});
|
|
@@ -6816,7 +6816,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, RolesList, "RolesList");
|
|
|
6816
6816
|
function UserRolesList({ user }) {
|
|
6817
6817
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6818
6818
|
const data = useDataListRetriever({
|
|
6819
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6819
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.RoleService.findAllRolesByUser(params), "retriever"),
|
|
6820
6820
|
retrieverParams: { userId: user.id },
|
|
6821
6821
|
module: _chunkWZJDLITGjs.Modules.Role
|
|
6822
6822
|
});
|
|
@@ -6842,7 +6842,7 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
6842
6842
|
const [existingUsers, setExistingUsers] = _react.useState.call(void 0, null);
|
|
6843
6843
|
_react.useEffect.call(void 0, () => {
|
|
6844
6844
|
const fetchExistingUsers = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
6845
|
-
setExistingUsers(await
|
|
6845
|
+
setExistingUsers(await _chunkL6LH7WA4js.UserService.findMany({ roleId: role.id, fetchAll: true }));
|
|
6846
6846
|
}, "fetchExistingUsers");
|
|
6847
6847
|
if (show) {
|
|
6848
6848
|
setExistingUsers(null);
|
|
@@ -6850,7 +6850,7 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
6850
6850
|
}
|
|
6851
6851
|
}, [show]);
|
|
6852
6852
|
const addUserToRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (user) => {
|
|
6853
|
-
await
|
|
6853
|
+
await _chunkL6LH7WA4js.RoleService.addUserToRole({
|
|
6854
6854
|
roleId: role.id,
|
|
6855
6855
|
userId: user.id
|
|
6856
6856
|
});
|
|
@@ -6866,7 +6866,7 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
6866
6866
|
}, "addUserToRole");
|
|
6867
6867
|
const data = useDataListRetriever({
|
|
6868
6868
|
ready: !!company && show,
|
|
6869
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6869
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkL6LH7WA4js.UserService.findAllUsers(params), "retriever"),
|
|
6870
6870
|
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _190 => _190.id]) },
|
|
6871
6871
|
module: _chunkWZJDLITGjs.Modules.User
|
|
6872
6872
|
});
|
|
@@ -6984,7 +6984,7 @@ function UserDeleterInternal({ user, onDeleted, companyId }) {
|
|
|
6984
6984
|
CommonDeleter,
|
|
6985
6985
|
{
|
|
6986
6986
|
type: `users`,
|
|
6987
|
-
deleteFunction: () =>
|
|
6987
|
+
deleteFunction: () => _chunkL6LH7WA4js.UserService.delete({ userId: user.id, companyId: cId }).then(
|
|
6988
6988
|
() => onDeleted ? onDeleted() : router.push(generateUrl({ page: _chunkWZJDLITGjs.Modules.User }))
|
|
6989
6989
|
)
|
|
6990
6990
|
}
|
|
@@ -7057,7 +7057,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7057
7057
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
7058
7058
|
if (!user) {
|
|
7059
7059
|
try {
|
|
7060
|
-
const existingUser = await
|
|
7060
|
+
const existingUser = await _chunkL6LH7WA4js.UserService.findByEmail({ email: values.email });
|
|
7061
7061
|
if (existingUser) {
|
|
7062
7062
|
form.setError("email", {
|
|
7063
7063
|
type: "manual",
|
|
@@ -7070,7 +7070,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7070
7070
|
}
|
|
7071
7071
|
}
|
|
7072
7072
|
if (values.avatar && contentType) {
|
|
7073
|
-
const s3 = await
|
|
7073
|
+
const s3 = await _chunkL6LH7WA4js.S3Service.getPreSignedUrl({
|
|
7074
7074
|
key: values.avatar,
|
|
7075
7075
|
contentType,
|
|
7076
7076
|
isPublic: true
|
|
@@ -7096,7 +7096,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7096
7096
|
adminCreated
|
|
7097
7097
|
};
|
|
7098
7098
|
try {
|
|
7099
|
-
const updatedUser = user ? await
|
|
7099
|
+
const updatedUser = user ? await _chunkL6LH7WA4js.UserService.update(payload) : await _chunkL6LH7WA4js.UserService.create(payload);
|
|
7100
7100
|
if (_optionalChain([currentUser, 'optionalAccess', _207 => _207.id]) === updatedUser.id) setUser(updatedUser);
|
|
7101
7101
|
if (onRevalidate) {
|
|
7102
7102
|
await onRevalidate(generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: updatedUser.id, language: `[locale]` }));
|
|
@@ -7113,7 +7113,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7113
7113
|
}, "onSubmit");
|
|
7114
7114
|
_react.useEffect.call(void 0, () => {
|
|
7115
7115
|
async function fetchRoles() {
|
|
7116
|
-
const roles2 = await
|
|
7116
|
+
const roles2 = await _chunkL6LH7WA4js.RoleService.findAllRoles({});
|
|
7117
7117
|
const availableRoles = roles2.filter(
|
|
7118
7118
|
(role) => role.id !== _chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator && (role.requiredFeature === void 0 || _optionalChain([company, 'optionalAccess', _208 => _208.features, 'access', _209 => _209.some, 'call', _210 => _210((feature) => feature.id === _optionalChain([role, 'access', _211 => _211.requiredFeature, 'optionalAccess', _212 => _212.id]))]))
|
|
7119
7119
|
);
|
|
@@ -7297,7 +7297,7 @@ function UserMultiSelect({
|
|
|
7297
7297
|
const data = useDataListRetriever({
|
|
7298
7298
|
ready: !!company,
|
|
7299
7299
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
7300
|
-
return
|
|
7300
|
+
return _chunkL6LH7WA4js.UserService.findAllUsers(params);
|
|
7301
7301
|
}, "retriever"),
|
|
7302
7302
|
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _224 => _224.id]) },
|
|
7303
7303
|
module: _chunkWZJDLITGjs.Modules.User
|
|
@@ -7411,7 +7411,7 @@ function UserReactivatorInterface({ user, propagateChanges }) {
|
|
|
7411
7411
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
7412
7412
|
const reactivateUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
7413
7413
|
try {
|
|
7414
|
-
const updatedUser = await
|
|
7414
|
+
const updatedUser = await _chunkL6LH7WA4js.UserService.reactivate({ userId: user.id });
|
|
7415
7415
|
setOpen(false);
|
|
7416
7416
|
propagateChanges(updatedUser);
|
|
7417
7417
|
} catch (error) {
|
|
@@ -7465,7 +7465,7 @@ function UserResentInvitationEmailInternal({ user }) {
|
|
|
7465
7465
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
7466
7466
|
const sendInvitationEmail = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
7467
7467
|
try {
|
|
7468
|
-
await
|
|
7468
|
+
await _chunkL6LH7WA4js.UserService.sendInvitation({ userId: user.id, companyId: user.company.id });
|
|
7469
7469
|
setOpen(false);
|
|
7470
7470
|
_sonner.toast.message(t(`foundations.user.resend_activation.email_sent`), {
|
|
7471
7471
|
description: t(`foundations.user.resend_activation.email_sent_description`, { email: user.email })
|
|
@@ -7523,7 +7523,7 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
7523
7523
|
const [isSearching, setIsSearching] = _react.useState.call(void 0, false);
|
|
7524
7524
|
const data = useDataListRetriever({
|
|
7525
7525
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
7526
|
-
return
|
|
7526
|
+
return _chunkL6LH7WA4js.UserService.findMany(params);
|
|
7527
7527
|
}, "retriever"),
|
|
7528
7528
|
retrieverParams: {},
|
|
7529
7529
|
module: _chunkWZJDLITGjs.Modules.User
|
|
@@ -7968,4 +7968,4 @@ var useSocketContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () =
|
|
|
7968
7968
|
|
|
7969
7969
|
|
|
7970
7970
|
exports.TableGeneratorRegistry = TableGeneratorRegistry; exports.tableGeneratorRegistry = tableGeneratorRegistry; exports.usePageUrlGenerator = usePageUrlGenerator; exports.useUrlRewriter = useUrlRewriter; exports.useDataListRetriever = useDataListRetriever; exports.useDebounce = useDebounce; exports.registerTableGenerator = registerTableGenerator; exports.useTableGenerator = useTableGenerator; exports.useCustomD3Graph = useCustomD3Graph; exports.CurrentUserProvider = CurrentUserProvider; exports.useCurrentUserContext = useCurrentUserContext; exports.AddUserToRole = AddUserToRole; exports.UserAvatarEditor = UserAvatarEditor; exports.UserDeleter = UserDeleter; exports.UserEditor = UserEditor; exports.UserMultiSelect = UserMultiSelect; exports.UserReactivator = UserReactivator; exports.UserResentInvitationEmail = UserResentInvitationEmail; exports.UserAvatar = UserAvatar; exports.UserSelector = UserSelector; exports.UserProvider = UserProvider; exports.useUserContext = useUserContext; exports.UserDetails = UserDetails; exports.UserIndexDetails = UserIndexDetails; exports.UserContainer = UserContainer; exports.UserIndexContainer = UserIndexContainer; exports.UsersListContainer = UsersListContainer; exports.AdminUsersList = AdminUsersList; exports.CompanyUsersList = CompanyUsersList; exports.ContributorsList = ContributorsList; exports.RelevantUsersList = RelevantUsersList; exports.RoleUsersList = RoleUsersList; exports.UserListInAdd = UserListInAdd; exports.UsersList = UsersList; exports.UsersListByContentIds = UsersListByContentIds; exports.CompanyDetails = CompanyDetails; exports.AdminCompanyContainer = AdminCompanyContainer; exports.CompanyContainer = CompanyContainer; exports.CompanyConfigurationSecurityForm = CompanyConfigurationSecurityForm; exports.CompanyConfigurationEditor = CompanyConfigurationEditor; exports.CompanyDeleter = CompanyDeleter; exports.CompanyEditor = CompanyEditor; exports.CompaniesList = CompaniesList; exports.CompanyProvider = CompanyProvider; exports.useCompanyContext = useCompanyContext; exports.generateNotificationData = generateNotificationData; exports.NotificationToast = NotificationToast; exports.NotificationMenuItem = NotificationMenuItem; exports.NotificationContextProvider = NotificationContextProvider; exports.useNotificationContext = useNotificationContext; exports.RoleProvider = RoleProvider; exports.useRoleContext = useRoleContext; exports.SharedProvider = SharedProvider; exports.useSharedContext = useSharedContext; exports.CommonProvider = CommonProvider; exports.useCommonContext = useCommonContext; exports.SocketContext = SocketContext; exports.SocketProvider = SocketProvider; exports.useSocketContext = useSocketContext; exports.useNotificationSync = useNotificationSync; exports.usePageTracker = usePageTracker; exports.useSocket = useSocket; exports.Breadcrumb = Breadcrumb2; exports.ContentTitle = ContentTitle; exports.Header = Header; exports.ModeToggleSwitch = ModeToggleSwitch; exports.PageSection = PageSection; exports.RecentPagesNavigator = RecentPagesNavigator; exports.PageContainer = PageContainer; exports.ReactMarkdownContainer = ReactMarkdownContainer; exports.TabsContainer = TabsContainer; exports.AttributeElement = AttributeElement; exports.AllowedUsersDetails = AllowedUsersDetails; exports.ErrorDetails = ErrorDetails; exports.errorToast = errorToast; exports.BlockNoteEditorContainer = BlockNoteEditorContainer; exports.CommonAssociationTrigger = CommonAssociationTrigger; exports.CommonAssociationCommandDialog = CommonAssociationCommandDialog; exports.triggerAssociationToast = triggerAssociationToast; exports.CommonDeleter = CommonDeleter; exports.CommonEditorButtons = CommonEditorButtons; exports.CommonEditorHeader = CommonEditorHeader; exports.CommonEditorTrigger = CommonEditorTrigger; exports.DatePickerPopover = DatePickerPopover; exports.DateRangeSelector = DateRangeSelector; exports.useFileUpload = useFileUpload; exports.FileUploader = FileUploader; exports.FileUploaderContent = FileUploaderContent; exports.FileUploaderItem = FileUploaderItem; exports.FileInput = FileInput; exports.FormCheckbox = FormCheckbox; exports.FormContainerGeneric = FormContainerGeneric; exports.FormDate = FormDate; exports.FormDateTime = FormDateTime; exports.FormInput = FormInput; exports.PasswordInput = PasswordInput; exports.FormPassword = FormPassword; exports.FormPlaceAutocomplete = FormPlaceAutocomplete; exports.FormSelect = FormSelect; exports.FormSlider = FormSlider; exports.FormSwitch = FormSwitch; exports.FormTextarea = FormTextarea; exports.FormFeatures = FormFeatures; exports.PageContainerContentDetails = PageContainerContentDetails; exports.PageContentContainer = PageContentContainer; exports.cellComponent = cellComponent; exports.cellDate = cellDate; exports.cellId = cellId; exports.cellLink = cellLink; exports.cellUrl = cellUrl; exports.JsonApiContext = JsonApiContext; exports.useJsonApiConfig = useJsonApiConfig; exports.useJsonApiConfigOptional = useJsonApiConfigOptional; exports.JsonApiProvider = JsonApiProvider; exports.useJsonApiGet = useJsonApiGet; exports.useJsonApiMutation = useJsonApiMutation; exports.useRehydration = useRehydration; exports.useRehydrationList = useRehydrationList; exports.useRoleTableStructure = useRoleTableStructure; exports.useUserSearch = useUserSearch; exports.useUserTableStructure = useUserTableStructure; exports.useContentTableStructure = useContentTableStructure; exports.ContentTableSearch = ContentTableSearch; exports.ContentListTable = ContentListTable; exports.AuthContainer = AuthContainer; exports.LandingComponent = LandingComponent; exports.AcceptInvitation = AcceptInvitation; exports.ActivateAccount = ActivateAccount; exports.Cookies = Cookies; exports.ForgotPassword = ForgotPassword; exports.Login = Login; exports.Logout = Logout; exports.RefreshUser = RefreshUser; exports.ResetPassword = ResetPassword; exports.ContentsList = ContentsList; exports.ContentsListById = ContentsListById; exports.RelevantContentsList = RelevantContentsList; exports.NotificationErrorBoundary = NotificationErrorBoundary; exports.NotificationsList = NotificationsList; exports.NotificationsListContainer = NotificationsListContainer; exports.NotificationModal = NotificationModal; exports.PushNotificationProvider = PushNotificationProvider; exports.RoleDetails = RoleDetails; exports.RoleContainer = RoleContainer; exports.FormRoles = FormRoles; exports.RemoveUserFromRole = RemoveUserFromRole; exports.UserRoleAdd = UserRoleAdd; exports.RolesList = RolesList; exports.UserRolesList = UserRolesList;
|
|
7971
|
-
//# sourceMappingURL=chunk-
|
|
7971
|
+
//# sourceMappingURL=chunk-KDFDGXCX.js.map
|