@intlayer/design-system 4.0.3 → 4.0.5
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/.vite/manifest.json +34 -43
- package/dist/components/Auth/AuthModal/index.cjs +1 -1
- package/dist/components/Auth/AuthModal/index.mjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/useAuth/index.cjs +8 -4
- package/dist/components/Auth/useAuth/index.cjs.map +1 -1
- package/dist/components/Auth/useAuth/index.d.ts +3 -1
- package/dist/components/Auth/useAuth/index.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/index.mjs +8 -4
- package/dist/components/Auth/useAuth/index.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.cjs +6 -3
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.d.ts +2 -1
- package/dist/components/Auth/useAuth/useCSRF.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs +5 -2
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs +6 -5
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +2 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs +5 -4
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.cjs +6 -3
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.d.ts +2 -1
- package/dist/components/Auth/useAuth/useSession.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs +6 -3
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
- package/dist/components/Auth/useUser/index.cjs +1 -1
- package/dist/components/Auth/useUser/index.mjs +1 -1
- package/dist/components/Button/Button.cjs +9 -9
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.mjs +9 -9
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Container/index.d.ts +2 -2
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +5 -4
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.d.ts +1 -0
- package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs +5 -4
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +2 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +3 -3
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +29 -12
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts +1 -0
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +31 -14
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +32 -0
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts +4 -0
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +32 -0
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +5 -3
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +5 -3
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +4 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +4 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +45 -14
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +48 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +32 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +4 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +32 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +7 -15
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +8 -16
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +8 -5
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +7 -4
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +6 -5
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +1 -9
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +2 -10
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +2 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +2 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +51 -22
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +1 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +52 -23
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +32 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +4 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +32 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +2 -2
- package/dist/components/EditableField/EditableFieldLayout.cjs +8 -4
- package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.mjs +8 -4
- package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +2 -2
- package/dist/components/IDE/CodeContext.mjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +4 -4
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +4 -4
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +2 -2
- package/dist/components/Modal/Modal.cjs +11 -7
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.mjs +11 -7
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +2 -2
- package/dist/components/Navbar/MobileNavbar.mjs +2 -2
- package/dist/components/Navbar/index.cjs +2 -2
- package/dist/components/Navbar/index.mjs +2 -2
- package/dist/components/RightDrawer/RightDrawer.cjs +32 -15
- package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.mjs +32 -15
- package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +2 -2
- package/dist/components/SwitchSelector/index.mjs +2 -2
- package/dist/components/TabSelector/TabSelector.cjs +2 -2
- package/dist/components/TabSelector/TabSelector.mjs +2 -2
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +3 -2
- package/dist/hooks/intlayerAPIHooks.cjs +15 -1
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +53 -49
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +16 -2
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +14 -0
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +14 -0
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs +3 -2
- package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +2 -2
- package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
- package/dist/hooks/useGetAllDictionaries.mjs +3 -2
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +10 -7
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +11 -2
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +10 -7
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/usePersistedStore.cjs +25 -18
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.d.ts +2 -2
- package/dist/hooks/usePersistedStore.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.mjs +26 -19
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/index-B-VAyQ9R.js +673 -0
- package/dist/index-B-VAyQ9R.js.map +1 -0
- package/dist/index-B-adg6xa.js +206 -0
- package/dist/index-B-adg6xa.js.map +1 -0
- package/dist/index-B1nU1-65.cjs +690 -0
- package/dist/index-B1nU1-65.cjs.map +1 -0
- package/dist/index-BIV0x_z2.js +206 -0
- package/dist/index-BIV0x_z2.js.map +1 -0
- package/dist/index-BIyA5LAs.js +691 -0
- package/dist/index-BIyA5LAs.js.map +1 -0
- package/dist/index-BNH9wXVj.cjs +205 -0
- package/dist/index-BNH9wXVj.cjs.map +1 -0
- package/dist/index-BqZwP4Lr.js +691 -0
- package/dist/index-BqZwP4Lr.js.map +1 -0
- package/dist/index-Buecpjbh.cjs +690 -0
- package/dist/index-Buecpjbh.cjs.map +1 -0
- package/dist/index-CDEJjmId.js +694 -0
- package/dist/index-CDEJjmId.js.map +1 -0
- package/dist/index-CTAyk6RY.cjs +693 -0
- package/dist/index-CTAyk6RY.cjs.map +1 -0
- package/dist/index-CVC2sfEj.js +693 -0
- package/dist/index-CVC2sfEj.js.map +1 -0
- package/dist/index-CVz0RdK6.js +691 -0
- package/dist/index-CVz0RdK6.js.map +1 -0
- package/dist/index-CjF2ksU7.cjs +693 -0
- package/dist/index-CjF2ksU7.cjs.map +1 -0
- package/dist/index-CuQs5759.cjs +692 -0
- package/dist/index-CuQs5759.cjs.map +1 -0
- package/dist/index-D69JRZcQ.js +206 -0
- package/dist/index-D69JRZcQ.js.map +1 -0
- package/dist/index-DAsui9u9.cjs +205 -0
- package/dist/index-DAsui9u9.cjs.map +1 -0
- package/dist/index-D_MDocy7.cjs +690 -0
- package/dist/index-D_MDocy7.cjs.map +1 -0
- package/dist/index-Djo2Jnua.cjs +693 -0
- package/dist/index-Djo2Jnua.cjs.map +1 -0
- package/dist/index-LFTthFne.js +694 -0
- package/dist/index-LFTthFne.js.map +1 -0
- package/dist/index-SOIahRpS.cjs +205 -0
- package/dist/index-SOIahRpS.cjs.map +1 -0
- package/dist/index-T-TjVQoD.js +671 -0
- package/dist/index-T-TjVQoD.js.map +1 -0
- package/dist/index-f8_VC6c8.cjs +672 -0
- package/dist/index-f8_VC6c8.cjs.map +1 -0
- package/dist/index-llGIfxqV.cjs +670 -0
- package/dist/index-llGIfxqV.cjs.map +1 -0
- package/dist/index-xZoGTokf.js +694 -0
- package/dist/index-xZoGTokf.js.map +1 -0
- package/dist/tailwind.config.cjs.map +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs +34 -0
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs.map +1 -0
- package/dist/useGetAllDictionaries-BbH8vTkY.js +35 -0
- package/dist/useGetAllDictionaries-BbH8vTkY.js.map +1 -0
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs +34 -0
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs.map +1 -0
- package/dist/useGetAllDictionaries-D8ma3h41.cjs +33 -0
- package/dist/useGetAllDictionaries-D8ma3h41.cjs.map +1 -0
- package/dist/useGetAllDictionaries-DHgHEbD5.js +34 -0
- package/dist/useGetAllDictionaries-DHgHEbD5.js.map +1 -0
- package/dist/useGetAllDictionaries-DUzm0rIa.js +35 -0
- package/dist/useGetAllDictionaries-DUzm0rIa.js.map +1 -0
- package/package.json +21 -16
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
+
const fetcherOptions = {
|
|
3
|
+
method: "GET",
|
|
4
|
+
// Default HTTP method
|
|
5
|
+
headers: {
|
|
6
|
+
"Content-Type": "application/json"
|
|
7
|
+
// Default content type
|
|
8
|
+
},
|
|
9
|
+
credentials: "include"
|
|
10
|
+
// Include cookies in the request
|
|
11
|
+
};
|
|
12
|
+
const removeUndefined = (obj) => {
|
|
13
|
+
Object.keys(obj).forEach((key) => {
|
|
14
|
+
if (obj[key] === void 0) {
|
|
15
|
+
delete obj[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return obj;
|
|
19
|
+
};
|
|
20
|
+
const deepMerge = (objects) => objects.reduce((acc, obj) => {
|
|
21
|
+
const acc1 = acc ?? {};
|
|
22
|
+
const obj1 = removeUndefined(obj ?? {});
|
|
23
|
+
if (typeof acc1 === "object" && typeof obj1 === "object") {
|
|
24
|
+
return { ...acc1, ...obj1 };
|
|
25
|
+
}
|
|
26
|
+
return obj1 ?? acc1;
|
|
27
|
+
}, {});
|
|
28
|
+
const fetcher = async (url, ...options) => {
|
|
29
|
+
const { signal } = new AbortController();
|
|
30
|
+
let paramsString = "";
|
|
31
|
+
let bodyString = void 0;
|
|
32
|
+
const otherOptions = options.map(
|
|
33
|
+
({ body, params: params2, headers, ...otherOptions2 }) => otherOptions2
|
|
34
|
+
);
|
|
35
|
+
const mergedOptions = deepMerge([fetcherOptions, ...otherOptions]);
|
|
36
|
+
const mergedHeaders = deepMerge([
|
|
37
|
+
fetcherOptions.headers,
|
|
38
|
+
...options.map((option) => option.headers)
|
|
39
|
+
]);
|
|
40
|
+
const params = deepMerge(options.map((option) => option.params));
|
|
41
|
+
const method = mergedOptions.method;
|
|
42
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
43
|
+
const body = deepMerge(options.map((option) => option.body));
|
|
44
|
+
if (mergedHeaders?.["Content-Type"] === "application/x-www-form-urlencoded") {
|
|
45
|
+
bodyString = new URLSearchParams(
|
|
46
|
+
body
|
|
47
|
+
).toString();
|
|
48
|
+
} else {
|
|
49
|
+
bodyString = JSON.stringify(body);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (Object.entries(params).length > 0) {
|
|
53
|
+
paramsString = `?${new URLSearchParams(
|
|
54
|
+
params
|
|
55
|
+
).toString()}`;
|
|
56
|
+
}
|
|
57
|
+
const formattedOptions = {
|
|
58
|
+
...mergedOptions,
|
|
59
|
+
headers: mergedHeaders,
|
|
60
|
+
body: bodyString,
|
|
61
|
+
signal
|
|
62
|
+
};
|
|
63
|
+
const urlResult = `${url}${paramsString}`;
|
|
64
|
+
const response = await fetch(urlResult, formattedOptions);
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
const result = await response.json();
|
|
67
|
+
console.error(result);
|
|
68
|
+
throw new Error(JSON.stringify(result.error) ?? "An error occurred");
|
|
69
|
+
}
|
|
70
|
+
return await response.json();
|
|
71
|
+
};
|
|
72
|
+
const getAiAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
73
|
+
const { backendURL } = getConfiguration().editor;
|
|
74
|
+
const AI_API_ROUTE = `${backendURL}/api/ai`;
|
|
75
|
+
const auditContentDeclaration = async (body, otherOptions = {}) => await fetcher(
|
|
76
|
+
`${AI_API_ROUTE}/audit/content-declaration`,
|
|
77
|
+
authAPIOptions,
|
|
78
|
+
otherOptions,
|
|
79
|
+
{
|
|
80
|
+
method: "POST",
|
|
81
|
+
body
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
const auditContentDeclarationField = async (body, otherOptions = {}) => await fetcher(
|
|
85
|
+
`${AI_API_ROUTE}/audit/content-declaration/field`,
|
|
86
|
+
authAPIOptions,
|
|
87
|
+
otherOptions,
|
|
88
|
+
{
|
|
89
|
+
method: "POST",
|
|
90
|
+
body
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
const auditContentDeclarationMetadata = async (body, otherOptions = {}) => await fetcher(
|
|
94
|
+
`${AI_API_ROUTE}/audit/content-declaration/metadata`,
|
|
95
|
+
authAPIOptions,
|
|
96
|
+
otherOptions,
|
|
97
|
+
{
|
|
98
|
+
method: "POST",
|
|
99
|
+
body
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
const auditTag = async (body, otherOptions = {}) => await fetcher(
|
|
103
|
+
`${AI_API_ROUTE}/audit/tag`,
|
|
104
|
+
authAPIOptions,
|
|
105
|
+
otherOptions,
|
|
106
|
+
{
|
|
107
|
+
method: "POST",
|
|
108
|
+
body
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
const askDocQuestion = async (body, otherOptions = {}) => await fetcher(
|
|
112
|
+
`${AI_API_ROUTE}/ask`,
|
|
113
|
+
authAPIOptions,
|
|
114
|
+
otherOptions,
|
|
115
|
+
{
|
|
116
|
+
method: "POST",
|
|
117
|
+
body
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
return {
|
|
121
|
+
auditContentDeclaration,
|
|
122
|
+
auditContentDeclarationField,
|
|
123
|
+
auditContentDeclarationMetadata,
|
|
124
|
+
auditTag,
|
|
125
|
+
askDocQuestion
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
getAiAPI();
|
|
129
|
+
const getAuthAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
130
|
+
const { backendURL, clientId, clientSecret } = getConfiguration().editor;
|
|
131
|
+
const AUTH_API_ROUTE = `${backendURL}/api/auth`;
|
|
132
|
+
const login = async (user, otherOptions = {}) => await fetcher(
|
|
133
|
+
`${AUTH_API_ROUTE}/login`,
|
|
134
|
+
authAPIOptions,
|
|
135
|
+
otherOptions,
|
|
136
|
+
{
|
|
137
|
+
method: "POST",
|
|
138
|
+
body: user
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
const getLoginWithGitHubURL = (params) => {
|
|
142
|
+
const searchParams = new URLSearchParams(params);
|
|
143
|
+
return `${AUTH_API_ROUTE}/login/github?${searchParams.toString()}`;
|
|
144
|
+
};
|
|
145
|
+
const getLoginWithGoogleURL = (params) => {
|
|
146
|
+
const searchParams = new URLSearchParams(params);
|
|
147
|
+
return `${AUTH_API_ROUTE}/login/google?${searchParams.toString()}`;
|
|
148
|
+
};
|
|
149
|
+
const register = async (user, query = {}, otherOptions = {}) => await fetcher(
|
|
150
|
+
`${AUTH_API_ROUTE}/register`,
|
|
151
|
+
authAPIOptions,
|
|
152
|
+
otherOptions,
|
|
153
|
+
{
|
|
154
|
+
method: "POST",
|
|
155
|
+
body: user,
|
|
156
|
+
params: query
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
const logout = async (otherOptions = {}) => await fetcher(
|
|
160
|
+
`${AUTH_API_ROUTE}/logout`,
|
|
161
|
+
authAPIOptions,
|
|
162
|
+
otherOptions,
|
|
163
|
+
{
|
|
164
|
+
method: "POST"
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
const askResetPassword = async (email, otherOptions = {}) => await fetcher(
|
|
168
|
+
`${AUTH_API_ROUTE}/password/reset`,
|
|
169
|
+
authAPIOptions,
|
|
170
|
+
otherOptions,
|
|
171
|
+
{
|
|
172
|
+
method: "POST",
|
|
173
|
+
body: { email }
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
const resetPassword = async (params, otherOptions = {}) => await fetcher(
|
|
177
|
+
`${AUTH_API_ROUTE}/password/reset`,
|
|
178
|
+
authAPIOptions,
|
|
179
|
+
otherOptions,
|
|
180
|
+
{ params, method: "POST" }
|
|
181
|
+
);
|
|
182
|
+
const changePassword = async (data, otherOptions = {}) => await fetcher(
|
|
183
|
+
`${AUTH_API_ROUTE}/password`,
|
|
184
|
+
authAPIOptions,
|
|
185
|
+
otherOptions,
|
|
186
|
+
{
|
|
187
|
+
method: "PUT",
|
|
188
|
+
body: data
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
const checkIfUserHasPassword = async (otherOptions = {}) => await fetcher(
|
|
192
|
+
`${AUTH_API_ROUTE}/password/has`,
|
|
193
|
+
authAPIOptions,
|
|
194
|
+
otherOptions,
|
|
195
|
+
{
|
|
196
|
+
method: "GET"
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
const verifyEmail = async ({ userId, secret }, otherOptions = {}) => await fetcher(
|
|
200
|
+
`${AUTH_API_ROUTE}/active/${userId}/${secret}`,
|
|
201
|
+
authAPIOptions,
|
|
202
|
+
otherOptions,
|
|
203
|
+
{
|
|
204
|
+
method: "PUT"
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
const getVerifyEmailStatusURL = (userId) => `${AUTH_API_ROUTE}/verify-email-status/${String(userId)}`;
|
|
208
|
+
const createSession = async (data, otherOptions = {}) => await fetcher(
|
|
209
|
+
`${AUTH_API_ROUTE}/session`,
|
|
210
|
+
authAPIOptions,
|
|
211
|
+
otherOptions,
|
|
212
|
+
{
|
|
213
|
+
method: "POST",
|
|
214
|
+
body: data
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
const getSession = async (sessionToken, otherOptions = {}) => await fetcher(
|
|
218
|
+
`${backendURL}/session`,
|
|
219
|
+
authAPIOptions,
|
|
220
|
+
otherOptions,
|
|
221
|
+
{ params: { session_token: sessionToken } }
|
|
222
|
+
);
|
|
223
|
+
const getCSRFToken = async (otherOptions = {}) => await fetcher(
|
|
224
|
+
`${backendURL}/csrf-token`,
|
|
225
|
+
authAPIOptions,
|
|
226
|
+
otherOptions
|
|
227
|
+
);
|
|
228
|
+
const getOAuth2AccessToken = async (otherOptions = {}) => await fetcher(
|
|
229
|
+
`${backendURL}/oauth2/token`,
|
|
230
|
+
authAPIOptions,
|
|
231
|
+
otherOptions,
|
|
232
|
+
{
|
|
233
|
+
method: "POST",
|
|
234
|
+
headers: {
|
|
235
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
236
|
+
},
|
|
237
|
+
body: {
|
|
238
|
+
grant_type: "client_credentials",
|
|
239
|
+
client_id: clientId,
|
|
240
|
+
client_secret: clientSecret
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
return {
|
|
245
|
+
login,
|
|
246
|
+
getLoginWithGitHubURL,
|
|
247
|
+
getLoginWithGoogleURL,
|
|
248
|
+
register,
|
|
249
|
+
logout,
|
|
250
|
+
resetPassword,
|
|
251
|
+
askResetPassword,
|
|
252
|
+
checkIfUserHasPassword,
|
|
253
|
+
verifyEmail,
|
|
254
|
+
getVerifyEmailStatusURL,
|
|
255
|
+
changePassword,
|
|
256
|
+
createSession,
|
|
257
|
+
getSession,
|
|
258
|
+
getCSRFToken,
|
|
259
|
+
getOAuth2AccessToken
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
getAuthAPI();
|
|
263
|
+
const getDictionaryAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
264
|
+
const { backendURL } = getConfiguration().editor;
|
|
265
|
+
const PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;
|
|
266
|
+
const getDictionaries = async (filters, otherOptions = {}) => await fetcher(
|
|
267
|
+
PROJECT_API_ROUTE,
|
|
268
|
+
authAPIOptions,
|
|
269
|
+
otherOptions,
|
|
270
|
+
{
|
|
271
|
+
params: filters
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
const getDictionariesKeys = async (otherOptions = {}) => await fetcher(
|
|
275
|
+
`${PROJECT_API_ROUTE}/keys`,
|
|
276
|
+
authAPIOptions,
|
|
277
|
+
otherOptions
|
|
278
|
+
);
|
|
279
|
+
const getDictionary = async (dictionaryKey, version, otherOptions = {}) => await fetcher(
|
|
280
|
+
`${PROJECT_API_ROUTE}/${dictionaryKey}`,
|
|
281
|
+
authAPIOptions,
|
|
282
|
+
otherOptions,
|
|
283
|
+
{
|
|
284
|
+
params: version ? { version: version.toString() } : void 0
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
const addDictionary = async (dictionary, otherOptions = {}) => await fetcher(
|
|
288
|
+
`${PROJECT_API_ROUTE}`,
|
|
289
|
+
authAPIOptions,
|
|
290
|
+
otherOptions,
|
|
291
|
+
{
|
|
292
|
+
method: "POST",
|
|
293
|
+
body: dictionary
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
const pushDictionaries = async (dictionaries, otherOptions = {}) => await fetcher(
|
|
297
|
+
`${PROJECT_API_ROUTE}`,
|
|
298
|
+
authAPIOptions,
|
|
299
|
+
otherOptions,
|
|
300
|
+
{
|
|
301
|
+
method: "PATCH",
|
|
302
|
+
body: { dictionaries }
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
const updateDictionary = async (dictionaryId, dictionary, otherOptions = {}) => await fetcher(
|
|
306
|
+
`${PROJECT_API_ROUTE}/${dictionaryId}`,
|
|
307
|
+
authAPIOptions,
|
|
308
|
+
otherOptions,
|
|
309
|
+
{
|
|
310
|
+
method: "PUT",
|
|
311
|
+
body: dictionary
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
const deleteDictionary = async (id, otherOptions = {}) => await fetcher(
|
|
315
|
+
`${PROJECT_API_ROUTE}`,
|
|
316
|
+
authAPIOptions,
|
|
317
|
+
otherOptions,
|
|
318
|
+
{
|
|
319
|
+
method: "DELETE",
|
|
320
|
+
body: { id }
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
return {
|
|
324
|
+
getDictionaries,
|
|
325
|
+
getDictionariesKeys,
|
|
326
|
+
getDictionary,
|
|
327
|
+
pushDictionaries,
|
|
328
|
+
addDictionary,
|
|
329
|
+
updateDictionary,
|
|
330
|
+
deleteDictionary
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
getDictionaryAPI();
|
|
334
|
+
const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
335
|
+
const { editorURL } = getConfiguration().editor;
|
|
336
|
+
const EDITOR_API_ROUTE = `${editorURL}/api`;
|
|
337
|
+
console.log(getConfiguration());
|
|
338
|
+
const writeDictionary = async (dictionary, otherOptions = {}) => {
|
|
339
|
+
await fetcher(
|
|
340
|
+
`${EDITOR_API_ROUTE}/dictionary`,
|
|
341
|
+
authAPIOptions,
|
|
342
|
+
otherOptions,
|
|
343
|
+
{
|
|
344
|
+
method: "POST",
|
|
345
|
+
body: dictionary
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
};
|
|
349
|
+
return {
|
|
350
|
+
writeDictionary
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
getEditorAPI();
|
|
354
|
+
const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
355
|
+
const { backendURL } = getConfiguration().editor;
|
|
356
|
+
const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
|
|
357
|
+
const getOrganizations = async (filters, otherOptions = {}) => await fetcher(
|
|
358
|
+
ORGANIZATION_API_ROUTE,
|
|
359
|
+
authAPIOptions,
|
|
360
|
+
otherOptions,
|
|
361
|
+
{
|
|
362
|
+
params: filters
|
|
363
|
+
}
|
|
364
|
+
);
|
|
365
|
+
const getOrganization = async (organizationId, otherOptions = {}) => await fetcher(
|
|
366
|
+
`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
|
|
367
|
+
authAPIOptions,
|
|
368
|
+
otherOptions
|
|
369
|
+
);
|
|
370
|
+
const addOrganization = async (organization, otherOptions = {}) => await fetcher(
|
|
371
|
+
ORGANIZATION_API_ROUTE,
|
|
372
|
+
authAPIOptions,
|
|
373
|
+
otherOptions,
|
|
374
|
+
{
|
|
375
|
+
method: "POST",
|
|
376
|
+
body: organization
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
const updateOrganization = async (organization, otherOptions = {}) => fetcher(
|
|
380
|
+
ORGANIZATION_API_ROUTE,
|
|
381
|
+
authAPIOptions,
|
|
382
|
+
otherOptions,
|
|
383
|
+
{
|
|
384
|
+
method: "PUT",
|
|
385
|
+
body: organization
|
|
386
|
+
}
|
|
387
|
+
);
|
|
388
|
+
const updateOrganizationMembers = async (body, otherOptions = {}) => fetcher(
|
|
389
|
+
`${ORGANIZATION_API_ROUTE}/members`,
|
|
390
|
+
authAPIOptions,
|
|
391
|
+
otherOptions,
|
|
392
|
+
{
|
|
393
|
+
method: "PUT",
|
|
394
|
+
body
|
|
395
|
+
}
|
|
396
|
+
);
|
|
397
|
+
const addOrganizationMember = async (body, otherOptions = {}) => fetcher(
|
|
398
|
+
`${ORGANIZATION_API_ROUTE}/member`,
|
|
399
|
+
authAPIOptions,
|
|
400
|
+
otherOptions,
|
|
401
|
+
{
|
|
402
|
+
method: "POST",
|
|
403
|
+
body
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
const deleteOrganization = async (otherOptions = {}) => await fetcher(
|
|
407
|
+
ORGANIZATION_API_ROUTE,
|
|
408
|
+
authAPIOptions,
|
|
409
|
+
otherOptions,
|
|
410
|
+
{
|
|
411
|
+
method: "DELETE"
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
const selectOrganization = async (organizationId, otherOptions = {}) => await fetcher(
|
|
415
|
+
`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
|
|
416
|
+
authAPIOptions,
|
|
417
|
+
otherOptions,
|
|
418
|
+
{
|
|
419
|
+
method: "PUT"
|
|
420
|
+
}
|
|
421
|
+
);
|
|
422
|
+
const unselectOrganization = async (otherOptions = {}) => await fetcher(
|
|
423
|
+
`${ORGANIZATION_API_ROUTE}/logout`,
|
|
424
|
+
authAPIOptions,
|
|
425
|
+
otherOptions,
|
|
426
|
+
{
|
|
427
|
+
method: "POST"
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
return {
|
|
431
|
+
getOrganizations,
|
|
432
|
+
getOrganization,
|
|
433
|
+
addOrganization,
|
|
434
|
+
addOrganizationMember,
|
|
435
|
+
updateOrganization,
|
|
436
|
+
updateOrganizationMembers,
|
|
437
|
+
deleteOrganization,
|
|
438
|
+
selectOrganization,
|
|
439
|
+
unselectOrganization
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
getOrganizationAPI();
|
|
443
|
+
const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
444
|
+
const { backendURL } = getConfiguration().editor;
|
|
445
|
+
const PROJECT_API_ROUTE = `${backendURL}/api/project`;
|
|
446
|
+
const getProjects = async (filters, otherOptions = {}) => await fetcher(
|
|
447
|
+
PROJECT_API_ROUTE,
|
|
448
|
+
authAPIOptions,
|
|
449
|
+
otherOptions,
|
|
450
|
+
{
|
|
451
|
+
params: filters
|
|
452
|
+
}
|
|
453
|
+
);
|
|
454
|
+
const addProject = async (project, otherOptions = {}) => await fetcher(
|
|
455
|
+
`${PROJECT_API_ROUTE}`,
|
|
456
|
+
authAPIOptions,
|
|
457
|
+
otherOptions,
|
|
458
|
+
{
|
|
459
|
+
method: "POST",
|
|
460
|
+
body: project
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
const updateProject = async (project, otherOptions = {}) => await fetcher(
|
|
464
|
+
`${PROJECT_API_ROUTE}`,
|
|
465
|
+
authAPIOptions,
|
|
466
|
+
otherOptions,
|
|
467
|
+
{
|
|
468
|
+
method: "PUT",
|
|
469
|
+
body: project
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
const updateProjectMembers = async (body, otherOptions = {}) => await fetcher(
|
|
473
|
+
`${PROJECT_API_ROUTE}/members`,
|
|
474
|
+
authAPIOptions,
|
|
475
|
+
otherOptions,
|
|
476
|
+
{
|
|
477
|
+
method: "PUT",
|
|
478
|
+
body
|
|
479
|
+
}
|
|
480
|
+
);
|
|
481
|
+
const deleteProject = async (otherOptions = {}) => await fetcher(
|
|
482
|
+
`${PROJECT_API_ROUTE}`,
|
|
483
|
+
authAPIOptions,
|
|
484
|
+
otherOptions,
|
|
485
|
+
{
|
|
486
|
+
method: "DELETE"
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
const selectProject = async (projectId, otherOptions = {}) => await fetcher(
|
|
490
|
+
`${PROJECT_API_ROUTE}/${String(projectId)}`,
|
|
491
|
+
authAPIOptions,
|
|
492
|
+
otherOptions,
|
|
493
|
+
{
|
|
494
|
+
method: "PUT"
|
|
495
|
+
}
|
|
496
|
+
);
|
|
497
|
+
const unselectProject = async (otherOptions = {}) => await fetcher(
|
|
498
|
+
`${PROJECT_API_ROUTE}/logout`,
|
|
499
|
+
authAPIOptions,
|
|
500
|
+
otherOptions,
|
|
501
|
+
{
|
|
502
|
+
method: "POST"
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
const addNewAccessKey = async (accessKey, otherOptions = {}) => await fetcher(
|
|
506
|
+
`${PROJECT_API_ROUTE}/access_key`,
|
|
507
|
+
authAPIOptions,
|
|
508
|
+
otherOptions,
|
|
509
|
+
{
|
|
510
|
+
method: "POST",
|
|
511
|
+
body: accessKey
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
const deleteAccessKey = async (clientId, otherOptions = {}) => await fetcher(
|
|
515
|
+
`${PROJECT_API_ROUTE}/access_key`,
|
|
516
|
+
authAPIOptions,
|
|
517
|
+
otherOptions,
|
|
518
|
+
{
|
|
519
|
+
method: "DELETE",
|
|
520
|
+
body: { clientId }
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
const refreshAccessKey = async (clientId, otherOptions = {}) => await fetcher(
|
|
524
|
+
`${PROJECT_API_ROUTE}/access_key`,
|
|
525
|
+
authAPIOptions,
|
|
526
|
+
otherOptions,
|
|
527
|
+
{
|
|
528
|
+
method: "PATCH",
|
|
529
|
+
body: { clientId }
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
return {
|
|
533
|
+
getProjects,
|
|
534
|
+
addProject,
|
|
535
|
+
updateProject,
|
|
536
|
+
updateProjectMembers,
|
|
537
|
+
deleteProject,
|
|
538
|
+
selectProject,
|
|
539
|
+
unselectProject,
|
|
540
|
+
addNewAccessKey,
|
|
541
|
+
deleteAccessKey,
|
|
542
|
+
refreshAccessKey
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
getProjectAPI();
|
|
546
|
+
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
547
|
+
const backendURL = getConfiguration().editor.backendURL;
|
|
548
|
+
const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
|
|
549
|
+
const getSubscription = async (body, otherOptions = {}) => await fetcher(
|
|
550
|
+
`${STRIPE_API_ROUTE}/create-subscription`,
|
|
551
|
+
authAPIOptions,
|
|
552
|
+
otherOptions,
|
|
553
|
+
{
|
|
554
|
+
method: "POST",
|
|
555
|
+
body
|
|
556
|
+
}
|
|
557
|
+
);
|
|
558
|
+
const cancelSubscription = async (otherOptions = {}) => await fetcher(
|
|
559
|
+
`${STRIPE_API_ROUTE}/cancel-subscription`,
|
|
560
|
+
authAPIOptions,
|
|
561
|
+
otherOptions,
|
|
562
|
+
{
|
|
563
|
+
method: "POST"
|
|
564
|
+
}
|
|
565
|
+
);
|
|
566
|
+
return {
|
|
567
|
+
getSubscription,
|
|
568
|
+
cancelSubscription
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
572
|
+
const { backendURL } = getConfiguration().editor;
|
|
573
|
+
const PROJECT_API_ROUTE = `${backendURL}/api/tag`;
|
|
574
|
+
const getTags = async (filters, otherOptions = {}) => await fetcher(
|
|
575
|
+
PROJECT_API_ROUTE,
|
|
576
|
+
authAPIOptions,
|
|
577
|
+
otherOptions,
|
|
578
|
+
{
|
|
579
|
+
params: filters
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
const addTag = async (tag, otherOptions = {}) => await fetcher(
|
|
583
|
+
`${PROJECT_API_ROUTE}`,
|
|
584
|
+
authAPIOptions,
|
|
585
|
+
otherOptions,
|
|
586
|
+
{
|
|
587
|
+
method: "POST",
|
|
588
|
+
body: tag
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
const updateTag = async (tagId, tag, otherOptions = {}) => await fetcher(
|
|
592
|
+
`${PROJECT_API_ROUTE}/${tagId}`,
|
|
593
|
+
authAPIOptions,
|
|
594
|
+
otherOptions,
|
|
595
|
+
{
|
|
596
|
+
method: "PUT",
|
|
597
|
+
body: tag
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
const deleteTag = async (tagId, otherOptions = {}) => await fetcher(
|
|
601
|
+
`${PROJECT_API_ROUTE}/${tagId}`,
|
|
602
|
+
authAPIOptions,
|
|
603
|
+
otherOptions,
|
|
604
|
+
{
|
|
605
|
+
method: "DELETE"
|
|
606
|
+
}
|
|
607
|
+
);
|
|
608
|
+
return {
|
|
609
|
+
getTags,
|
|
610
|
+
addTag,
|
|
611
|
+
updateTag,
|
|
612
|
+
deleteTag
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
getTagAPI();
|
|
616
|
+
const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
617
|
+
const { backendURL } = getConfiguration().editor;
|
|
618
|
+
const USER_API_ROUTE = `${backendURL}/api/user`;
|
|
619
|
+
const getUsers = async (filters, otherOptions = {}) => await fetcher(
|
|
620
|
+
USER_API_ROUTE,
|
|
621
|
+
authAPIOptions,
|
|
622
|
+
otherOptions,
|
|
623
|
+
{
|
|
624
|
+
params: filters
|
|
625
|
+
}
|
|
626
|
+
);
|
|
627
|
+
const getUserById = async (userId, otherOptions = {}) => await fetcher(
|
|
628
|
+
`${USER_API_ROUTE}/${userId}`,
|
|
629
|
+
authAPIOptions,
|
|
630
|
+
otherOptions
|
|
631
|
+
);
|
|
632
|
+
const getUserByEmail = async (email, otherOptions = {}) => await fetcher(
|
|
633
|
+
`${USER_API_ROUTE}/email/${email}`,
|
|
634
|
+
authAPIOptions,
|
|
635
|
+
otherOptions
|
|
636
|
+
);
|
|
637
|
+
const getUserByAccount = async (providerAccountId, provider, otherOptions = {}) => await fetcher(
|
|
638
|
+
`${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,
|
|
639
|
+
authAPIOptions,
|
|
640
|
+
otherOptions
|
|
641
|
+
);
|
|
642
|
+
const createUser = async (user, otherOptions = {}) => await fetcher(
|
|
643
|
+
`${USER_API_ROUTE}/`,
|
|
644
|
+
authAPIOptions,
|
|
645
|
+
otherOptions,
|
|
646
|
+
{
|
|
647
|
+
method: "POST",
|
|
648
|
+
body: user
|
|
649
|
+
}
|
|
650
|
+
);
|
|
651
|
+
const updateUser = async (user, otherOptions = {}) => await fetcher(
|
|
652
|
+
`${USER_API_ROUTE}`,
|
|
653
|
+
authAPIOptions,
|
|
654
|
+
otherOptions,
|
|
655
|
+
{
|
|
656
|
+
method: "PUT",
|
|
657
|
+
body: user
|
|
658
|
+
}
|
|
659
|
+
);
|
|
660
|
+
const deleteUser = async (userId, otherOptions = {}) => await fetcher(
|
|
661
|
+
`${USER_API_ROUTE}/${userId}`,
|
|
662
|
+
authAPIOptions,
|
|
663
|
+
otherOptions,
|
|
664
|
+
{
|
|
665
|
+
method: "DELETE"
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
return {
|
|
669
|
+
createUser,
|
|
670
|
+
getUsers,
|
|
671
|
+
getUserById,
|
|
672
|
+
getUserByAccount,
|
|
673
|
+
getUserByEmail,
|
|
674
|
+
updateUser,
|
|
675
|
+
deleteUser
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
getUserAPI();
|
|
679
|
+
const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
|
|
680
|
+
organization: getOrganizationAPI(authAPIOptions),
|
|
681
|
+
project: getProjectAPI(authAPIOptions),
|
|
682
|
+
user: getUserAPI(authAPIOptions),
|
|
683
|
+
auth: getAuthAPI(authAPIOptions),
|
|
684
|
+
dictionary: getDictionaryAPI(authAPIOptions),
|
|
685
|
+
stripe: getStripeAPI(authAPIOptions),
|
|
686
|
+
ai: getAiAPI(authAPIOptions),
|
|
687
|
+
tag: getTagAPI(authAPIOptions),
|
|
688
|
+
editor: getEditorAPI(authAPIOptions)
|
|
689
|
+
});
|
|
690
|
+
const intlayerAPI = getIntlayerAPI();
|
|
691
|
+
export {
|
|
692
|
+
intlayerAPI as i
|
|
693
|
+
};
|
|
694
|
+
//# sourceMappingURL=index-xZoGTokf.js.map
|