@intlayer/design-system 4.1.5 → 4.1.7

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.
@@ -1,6 +1,6 @@
1
1
  import { IntlayerConfig } from '@intlayer/config/client';
2
2
  export declare const useCSRF: (intlayerConfiguration?: IntlayerConfig) => {
3
- csrfToken: any;
3
+ csrfToken: string | undefined;
4
4
  csrfTokenFetched: boolean;
5
5
  };
6
6
  //# sourceMappingURL=useCSRF.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { IntlayerConfig } from '@intlayer/config/client';
2
2
  export declare const useOAuth2: (csrfToken: string | null | undefined, intlayerConfiguration?: IntlayerConfig) => {
3
- oAuth2AccessToken: any;
3
+ oAuth2AccessToken: import('@intlayer/backend').OAuth2Token | null | undefined;
4
4
  };
5
5
  //# sourceMappingURL=useOAuth2.d.ts.map
@@ -39,10 +39,14 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
39
39
  );
40
40
  const onSubmitSuccess = require$$0.useCallback(async () => {
41
41
  if (!editedContent?.[dictionary.key]) return;
42
+ const updatedDictionary = {
43
+ ...dictionary,
44
+ ...editedContent?.[dictionary.key]
45
+ };
42
46
  if (mode === "remote") {
43
- await pushDictionaries([editedContent?.[dictionary.key]]);
47
+ await pushDictionaries([updatedDictionary]);
44
48
  } else {
45
- await writeDictionary(editedContent?.[dictionary.key]);
49
+ await writeDictionary(updatedDictionary);
46
50
  }
47
51
  setLocaleDictionary(editedContent?.[dictionary.key]);
48
52
  restoreEditedContent(dictionary.key);
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary, mode }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(validDictionaryChangeButtonsContent);\n\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary } = useWriteDictionary();\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n if (mode === 'remote') {\n await pushDictionaries([editedContent?.[dictionary.key]]);\n } else {\n await writeDictionary(editedContent?.[dictionary.key]);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n </div>\n );\n};\n"],"names":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","useDictionariesRecordActions","useWriteDictionary","usePushDictionaries","useEditedContent","useForm","useMemo","useCallback","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;AAsBO,MAAM,+BAET,CAAC,EAAE,YAAY,WAAW;AAC5B,QAAM,2CACJA,+DAAAA,4CAA4C;AAE9C,QAAM,EAAE,aAAa,YAAY,eAAe,eAAe,IAC7DC,4BAAcC,oGAAmC;AAE7C,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AAC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CAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY;AAAA,YACnB,UAAU,CAAC,YAAY;AAAA,YACvB,WAAU;AAAA,YACV,MAAMC,YAAA;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YACX,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,SAAS,WACR,oBACEH,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc;AAAA,YACrB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAME,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEJ,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBL,2BAAA,kBAAA;AAAA,UAACE,sCAAAA,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe;AAAA,YACtB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMI,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;;"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary, mode }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(validDictionaryChangeButtonsContent);\n\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary } = useWriteDictionary();\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n </div>\n );\n};\n"],"names":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","useDictionariesRecordActions","useWriteDictionary","usePushDictionaries","useEditedContent","useForm","useMemo","useCallback","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;AAsBO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OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQtD,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CA2HlC,CAAC"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQtD,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CAgIlC,CAAC"}
@@ -37,10 +37,14 @@ const ValidDictionaryChangeButtons = ({ dictionary, mode }) => {
37
37
  );
38
38
  const onSubmitSuccess = useCallback(async () => {
39
39
  if (!editedContent?.[dictionary.key]) return;
40
+ const updatedDictionary = {
41
+ ...dictionary,
42
+ ...editedContent?.[dictionary.key]
43
+ };
40
44
  if (mode === "remote") {
41
- await pushDictionaries([editedContent?.[dictionary.key]]);
45
+ await pushDictionaries([updatedDictionary]);
42
46
  } else {
43
- await writeDictionary(editedContent?.[dictionary.key]);
47
+ await writeDictionary(updatedDictionary);
44
48
  }
45
49
  setLocaleDictionary(editedContent?.[dictionary.key]);
46
50
  restoreEditedContent(dictionary.key);
@@ -1 +1 @@
1
- {"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary, mode }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(validDictionaryChangeButtonsContent);\n\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary } = useWriteDictionary();\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n if (mode === 'remote') {\n await pushDictionaries([editedContent?.[dictionary.key]]);\n } else {\n await writeDictionary(editedContent?.[dictionary.key]);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </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;"}
1
+ {"version":3,"file":"ValidDictionaryChangeButtons.mjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { ArrowUpFromLine, Download, RotateCcw, Save } from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries, useWriteDictionary } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary, mode }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton, downloadButton } =\n useDictionary(validDictionaryChangeButtonsContent);\n\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { writeDictionary } = useWriteDictionary();\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n </div>\n );\n};\n"],"names":["jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAM,+BAET,CAAC,EAAE,YAAY,WAAW;AAC5B,QAA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0.useCallback(async () => {
75
75
  if (!editedContent?.[dictionary.key]) return;
76
+ const updatedDictionary = {
77
+ ...dictionary,
78
+ ...editedContent?.[dictionary.key]
79
+ };
76
80
  if (mode === "remote") {
77
- await pushDictionaries([editedContent?.[dictionary.key]]);
81
+ await pushDictionaries([updatedDictionary]);
78
82
  } else {
79
- await writeDictionary(editedContent?.[dictionary.key]);
83
+ await writeDictionary(updatedDictionary);
80
84
  }
81
85
  setLocaleDictionary(editedContent?.[dictionary.key]);
82
86
  restoreEditedContent(dictionary.key);
@@ -90,8 +94,10 @@ const SaveForm = ({ dictionary, mode }) => {
90
94
  mode
91
95
  ]);
92
96
  const handleOnAuditFile = async () => await auditContentDeclaration({
93
- defaultLocale: project?.defaultLocale ?? intlayer.Locales.ENGLISH,
94
- locales: project?.locales ?? [intlayer.Locales.ENGLISH],
97
+ defaultLocale: project?.configuration?.internationalization?.defaultLocale ?? intlayer.Locales.ENGLISH,
98
+ locales: project?.configuration?.internationalization?.locales ?? [
99
+ intlayer.Locales.ENGLISH
100
+ ],
95
101
  fileContent: JSON.stringify(editedDictionary ?? dictionary)
96
102
  }).then((response) => {
97
103
  if (!response.data) return;
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useGetAllDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(() => {\n if (mode === 'remote') {\n return (\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content)\n );\n } else if (mode === 'local') {\n return (\n editedDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content)\n );\n }\n }, [onlineDictionary, editedDictionary, dictionary, mode]);\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n if (mode === 'remote') {\n await pushDictionaries([editedContent?.[dictionary.key]]);\n } else {\n await writeDictionary(editedContent?.[dictionary.key]);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,\n locales: project?.locales ?? [Locales.ENGLISH],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","useDictionariesRecordActions","usePushDictionaries","useWriteDictionary","getSaveFormSchema","useGetAllDictionaries","useAuditContentDeclaration","useEditedContent","useForm","useDictionary","saveDictionaryContent","useMemo","useCallback","Locales","editedDictionary","jsxs","Form","jsx","WandSparkles","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,MAAM,WAAuC,CAAC,EAAE,YAAY,WAAW;AACtE,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,QAAA,EAAE,oBAAoB,IAAIC,yCAA6B;AACvD,QAAA,EAAE,iBAAiB,IAAIC,2CAAoB;AAC3C,QAAA,EAAE,gBAAgB,IAAIC,0CAAmB;AAC/C,QAAM,iBAAiBC,yDAAAA,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAIC,kDAAsB;AACzC,QAAM,EAAE,WAAW,YAAY,wBAAA,IAC7BC,uBAAAA,2BAA2B;AAE7B,QAAM,EAAE,eAAe,sBAAsB,iBAAA,IAC3CC,YAAAA,iBAAiB;AACnB,QAAM,EAAE,MAAM,iBAAiBC,yBAAAA,QAAQ,cAAc;AAC/C,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACEC,cAAAA,cAAcC,2DAAAA,qBAAqB;AAEvC,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,gBAAgB,WAAW,GAAG;AAAA,IACpC,CAAC,eAAe,WAAW,GAAG;AAAA,EAChC;AAEM,QAAA,mBAAmBA,WAAAA,QAAQ,MAAM;AAC9B,WAAA,SAAS,WAAW,GAAG;AAAA,EAC7B,GAAA,CAAC,QAAQ,WAAW,GAAG,CAAC;AAErB,QAAA,WAAWA,WAAAA,QAAQ,MAAM;AAC7B,QAAI,SAAS,UAAU;AAEnB,aAAA,oBACA,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;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe;AAAA,YACtB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAMM,YAAA;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;;"}
1
+ {"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useGetAllDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(() => {\n if (mode === 'remote') {\n return (\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content)\n );\n } else if (mode === 'local') {\n return (\n editedDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content)\n );\n }\n }, [onlineDictionary, editedDictionary, dictionary, mode]);\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale:\n project?.configuration?.internationalization?.defaultLocale ??\n Locales.ENGLISH,\n locales: project?.configuration?.internationalization?.locales ?? [\n Locales.ENGLISH,\n ],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["useAuth","useDictionariesRecordActions","usePushDictionaries","useWriteDictionary","getSaveFormSchema","useGetAllDictionaries","useAuditContentDeclaration","useEditedContent","useForm","useDictionary","saveDictionaryContent","useMemo","useCallback","Locales","editedDictionary","jsxs","Form","jsx","WandSparkles","RotateCcw","ArrowUpFromLine","Save","Download"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,MAAM,WAAuC,CAAC,EAAE,YAAY,WAAW;AACtE,QAAA,EAAE,QAAQ,IAAIA,sCAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,Q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ryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAa5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AActD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAqK/C,CAAC"}
1
+ {"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAa5C,OAAO,EAAwB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AActD,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CA8K/C,CAAC"}
@@ -71,10 +71,14 @@ const SaveForm = ({ dictionary, mode }) => {
71
71
  );
72
72
  const onSubmitSuccess = useCallback(async () => {
73
73
  if (!editedContent?.[dictionary.key]) return;
74
+ const updatedDictionary = {
75
+ ...dictionary,
76
+ ...editedContent?.[dictionary.key]
77
+ };
74
78
  if (mode === "remote") {
75
- await pushDictionaries([editedContent?.[dictionary.key]]);
79
+ await pushDictionaries([updatedDictionary]);
76
80
  } else {
77
- await writeDictionary(editedContent?.[dictionary.key]);
81
+ await writeDictionary(updatedDictionary);
78
82
  }
79
83
  setLocaleDictionary(editedContent?.[dictionary.key]);
80
84
  restoreEditedContent(dictionary.key);
@@ -88,8 +92,10 @@ const SaveForm = ({ dictionary, mode }) => {
88
92
  mode
89
93
  ]);
90
94
  const handleOnAuditFile = async () => await auditContentDeclaration({
91
- defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,
92
- locales: project?.locales ?? [Locales.ENGLISH],
95
+ defaultLocale: project?.configuration?.internationalization?.defaultLocale ?? Locales.ENGLISH,
96
+ locales: project?.configuration?.internationalization?.locales ?? [
97
+ Locales.ENGLISH
98
+ ],
93
99
  fileContent: JSON.stringify(editedDictionary ?? dictionary)
94
100
  }).then((response) => {
95
101
  if (!response.data) return;
@@ -1 +1 @@
1
- {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useGetAllDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(() => {\n if (mode === 'remote') {\n return (\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content)\n );\n } else if (mode === 'local') {\n return (\n editedDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content)\n );\n }\n }, [onlineDictionary, editedDictionary, dictionary, mode]);\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n if (mode === 'remote') {\n await pushDictionaries([editedContent?.[dictionary.key]]);\n } else {\n await writeDictionary(editedContent?.[dictionary.key]);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale: project?.defaultLocale ?? Locales.ENGLISH,\n locales: project?.locales ?? [Locales.ENGLISH],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["editedDictionary","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,MAAM,WAAuC,CAAC,EAAE,YAAY,WAAW;AACtE,QAAA,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,UAAU,SAAS;AACnB,QAAA,EAAE,oBAAoB,IAAI,6BAA6B;AACvD,QAAA,EAAE,iBAAiB,IAAI,oBAAoB;AAC3C,QAAA,EAAE,gBAAgB,IAAI,mBAAmB;AAC/C,QAAM,iBAAiB,kBAAkB;AACnC,QAAA,EAAE,OAAO,IAAI,sBAAsB;AACzC,QAAM,EAAE,WAAW,YAAY,wBAAA,IAC7B,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,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe;AAAA,YACtB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
1
+ {"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport { Locales } from 'intlayer';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n WandSparkles,\n} from 'lucide-react';\nimport { useCallback, useMemo, type FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport {\n usePushDictionaries,\n useGetAllDictionaries,\n useAuditContentDeclaration,\n useWriteDictionary,\n} from '../../../hooks';\nimport { useAuth } from '../../Auth';\nimport { Form, useForm } from '../../Form';\nimport { saveDictionaryContent } from './saveForm.content';\nimport { getSaveFormSchema } from './SaveFormSchema';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: 'local' | 'remote';\n};\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({ dictionary, mode }) => {\n const { session } = useAuth();\n const project = session?.project;\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { pushDictionaries } = usePushDictionaries();\n const { writeDictionary } = useWriteDictionary();\n const SaveFormSchema = getSaveFormSchema();\n const { online } = useGetAllDictionaries();\n const { isLoading: isAuditing, auditContentDeclaration } =\n useAuditContentDeclaration();\n\n const { editedContent, restoreEditedContent, setEditedContent } =\n useEditedContent();\n const { form, isSubmitting } = useForm(SaveFormSchema);\n const {\n auditButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n } = useDictionary(saveDictionaryContent);\n\n const editedDictionary = useMemo(\n () => editedContent?.[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const onlineDictionary = useMemo(() => {\n return online?.[dictionary.key];\n }, [online, dictionary.key]);\n\n const isEdited = useMemo(() => {\n if (mode === 'remote') {\n return (\n editedDictionary &&\n onlineDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(onlineDictionary.content)\n );\n } else if (mode === 'local') {\n return (\n editedDictionary &&\n JSON.stringify(editedDictionary.content) !==\n JSON.stringify(dictionary.content)\n );\n }\n }, [onlineDictionary, editedDictionary, dictionary, mode]);\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = useCallback(async () => {\n if (!editedContent?.[dictionary.key]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.key],\n };\n\n if (mode === 'remote') {\n await pushDictionaries([updatedDictionary]);\n } else {\n await writeDictionary(updatedDictionary);\n }\n setLocaleDictionary(editedContent?.[dictionary.key]);\n restoreEditedContent(dictionary.key);\n }, [\n dictionary,\n editedContent,\n pushDictionaries,\n setLocaleDictionary,\n writeDictionary,\n restoreEditedContent,\n mode,\n ]);\n\n const handleOnAuditFile = async () =>\n await auditContentDeclaration({\n defaultLocale:\n project?.configuration?.internationalization?.defaultLocale ??\n Locales.ENGLISH,\n locales: project?.configuration?.internationalization?.locales ?? [\n Locales.ENGLISH,\n ],\n fileContent: JSON.stringify(editedDictionary ?? dictionary),\n }).then((response) => {\n if (!response.data) return;\n\n const editedDictionary = JSON.parse(\n response.data.fileContent\n ) as Dictionary;\n\n setEditedContent(dictionary.key, editedDictionary.content);\n });\n\n return (\n <Form\n className=\"flex w-full flex-1 flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={SaveFormSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n <Form.Button\n type=\"button\"\n label={auditButton.label}\n disabled={isSubmitting}\n Icon={WandSparkles}\n variant=\"outline\"\n color=\"text\"\n className=\"ml-auto max-md:w-full\"\n isLoading={isAuditing}\n onClick={handleOnAuditFile}\n >\n {auditButton.text}\n </Form.Button>\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode === 'remote' ? (\n isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )\n ) : (\n <Form.Button\n type=\"submit\"\n label={downloadButton.label}\n disabled={!isEdited || isSubmitting}\n Icon={Download}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isSubmitting}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n </Form>\n );\n};\n"],"names":["editedDictionary","jsx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A,YAER,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QACC,YACCA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,YAAY;AAAA,YACnB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAS,MAAM,qBAAqB,WAAW,GAAG;AAAA,YAEjD,UAAY,YAAA;AAAA,UAAA;AAAA,QACf;AAAA,QAED,SAAS,WACR,oBACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,cAAc;AAAA,YACrB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAc,cAAA;AAAA,UAAA;AAAA,YAGjB,YACEA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,WAAW;AAAA,YAClB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QAAA,IAKlBA,kCAAA;AAAA,UAAC,KAAK;AAAA,UAAL;AAAA,YACC,MAAK;AAAA,YACL,OAAO,eAAe;AAAA,YACtB,UAAU,CAAC,YAAY;AAAA,YACvB,MAAM;AAAA,YACN,OAAM;AAAA,YACN,WAAU;AAAA,YACV,WAAW;AAAA,YAEV,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
@@ -8,7 +8,7 @@ const components_Toaster_useToast = require("../components/Toaster/useToast.cjs"
8
8
  require("../jsx-runtime-CgFM7lM3.cjs");
9
9
  const hooks_useAsync_useAsync = require("./useAsync/useAsync.cjs");
10
10
  const hooks_useIntlayerAPI = require("./useIntlayerAPI.cjs");
11
- const process = {};
11
+ var define_process_env_default = {};
12
12
  const useErrorHandling = (options) => {
13
13
  const { toast } = components_Toaster_useToast.useToast();
14
14
  return {
@@ -23,7 +23,7 @@ const useErrorHandling = (options) => {
23
23
  }
24
24
  [error].flatMap((error2) => error2).forEach(
25
25
  (error2) => toast({
26
- title: (process.env.NODE_ENV === "production" ? error2.title : error2.code) ?? "Error",
26
+ title: (define_process_env_default.NODE_ENV === "production" ? error2.title : error2.code) ?? "Error",
27
27
  description: error2.message ?? errorMessage ?? "An error occurred",
28
28
  variant: "error"
29
29
  })
@@ -1 +1 @@
1
- {"version":3,"file":"intlayerAPIHooks.cjs","sources":["../../__vite-browser-external","../../src/hooks/intlayerAPIHooks.ts"],"sourcesContent":["export default {}","/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport process from 'process';\nimport { intlayerAPI } from '@intlayer/api';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAuth } from '../components/Auth/useAuth/index';\nimport { useToast } from '../components/Toaster';\nimport { useAsync, UseAsyncOptions } from './useAsync/useAsync';\nimport { useIntlayerAuth } from './useIntlayerAPI';\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useErrorHandling = <T extends UseAsyncOptions<any>>(options: T): T => {\n const { toast } = useToast();\n\n return {\n ...options,\n onError: (errorMessage) => {\n let error;\n\n // If json is valid, parse it\n try {\n error = JSON.parse(errorMessage);\n } catch (e) {\n console.error(e);\n // If json is not valid, set error to the original errorMessage\n\n error = errorMessage;\n }\n\n // render toast for each error if there is more than one\n // otherwise render the toast with the error message\n [error]\n .flatMap((error) => error)\n .forEach((error) =>\n toast({\n title:\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error',\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data.message)\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n options.onSuccess?.(data);\n },\n };\n};\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = <T extends UseAsyncOptions<any>>(\n options: T,\n { requireUser, requireProject, requireOrganization }: AuthEnableOptions = {}\n): T => {\n const configuration = useConfiguration();\n const { csrfToken, oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const isEnabledOption = options?.enable ?? true;\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isCSRFEnabled =\n Boolean(csrfToken) ||\n // If auth using session, csrf token is not required\n (!session && Boolean(oAuth2AccessToken));\n\n const isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled &&\n isCSRFEnabled;\n\n return {\n ...options,\n enable: isEnabled,\n };\n};\n\nconst useAppAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>,\n authOptions?: AuthEnableOptions\n) => {\n // Enhance options using custom hooks\n const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);\n\n const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\nconst useEditorAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n) => {\n const optionsWithErrorHandling = useErrorHandling(options ?? {});\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\n/**\n * Auth\n */\n\nexport const useLogin = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.login>\n) =>\n useAppAsync('login', useIntlayerAuth().auth.login, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRegister = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.register>\n) =>\n useAppAsync('register', useIntlayerAuth().auth.register, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useLogout = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.logout>\n) =>\n useAppAsync('logout', useIntlayerAuth().auth.logout, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useChangePassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.changePassword>\n) => useAppAsync('changePassword', useIntlayerAuth().auth.changePassword, args);\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.askResetPassword>\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().auth.askResetPassword,\n args\n );\nexport const useResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.resetPassword>\n) => useAppAsync('resetPassword', useIntlayerAuth().auth.resetPassword, args);\nexport const useCheckIfUserHasPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.checkIfUserHasPassword>\n) =>\n useAppAsync(\n 'checkIfUserHasPassword',\n useIntlayerAuth().auth.checkIfUserHasPassword,\n args,\n {\n requireUser: true,\n }\n );\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.verifyEmail>\n) => useAppAsync('verifyEmail', useIntlayerAuth().auth.verifyEmail, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUserByAccount>\n) =>\n useAppAsync(\n 'getUserByAccount',\n useIntlayerAuth().user.getUserByAccount,\n args\n );\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUsers>\n) =>\n useAppAsync(\n 'getUsers',\n useIntlayerAuth().user.getUsers,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\nexport const useCreateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.createUser>\n) =>\n useAppAsync('createUser', useIntlayerAuth().user.createUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\nexport const useUpdateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.updateUser>\n) =>\n useAppAsync('updateUser', useIntlayerAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.deleteUser>\n) =>\n useAppAsync('deleteUser', useIntlayerAuth().user.deleteUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.getOrganizations>\n) =>\n useAppAsync(\n 'getOrganizations',\n useIntlayerAuth().organization.getOrganizations,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useAddOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganization>\n) =>\n useAppAsync(\n 'addOrganization',\n useIntlayerAuth().organization.addOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useUpdateOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganization>\n) =>\n useAppAsync(\n 'updateOrganization',\n useIntlayerAuth().organization.updateOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUpdateOrganizationMembers = (\n args?: UseAsyncOptions<\n typeof intlayerAPI.organization.updateOrganizationMembers\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganizationMember>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.deleteOrganization>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.selectOrganization>\n) =>\n useAppAsync(\n 'selectOrganization',\n useIntlayerAuth().organization.selectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUnselectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.unselectOrganization>\n) =>\n useAppAsync(\n 'unselectOrganization',\n useIntlayerAuth().organization.unselectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.getProjects>\n) =>\n useAppAsync(\n 'getProjects',\n useIntlayerAuth().project.getProjects,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addProject>\n) =>\n useAppAsync('addProject', useIntlayerAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useUpdateProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProject>\n) =>\n useAppAsync('updateProject', useIntlayerAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProjectMembers>\n) =>\n useAppAsync(\n 'updateProjectMembers',\n useIntlayerAuth().project.updateProjectMembers,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useDeleteProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteProject>\n) =>\n useAppAsync('deleteProject', useIntlayerAuth().project.deleteProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useSelectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.selectProject>\n) =>\n useAppAsync('selectProject', useIntlayerAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUnselectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.unselectProject>\n) =>\n useAppAsync('unselectProject', useIntlayerAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addNewAccessKey>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteAccessKey>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.refreshAccessKey>\n) =>\n useAppAsync('refreshAccessKey', useIntlayerAuth().project.refreshAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionaries>\n) =>\n useAppAsync(\n 'getDictionaries',\n useIntlayerAuth().dictionary.getDictionaries,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionariesKeys = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionariesKeys>\n) =>\n useAppAsync(\n 'getDictionariesKeys',\n useIntlayerAuth().dictionary.getDictionariesKeys,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionary>\n) =>\n useAppAsync(\n 'getDictionary',\n useIntlayerAuth().dictionary.getDictionary,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\nexport const useAddDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.addDictionary>\n) =>\n useAppAsync('addDictionary', useIntlayerAuth().dictionary.addDictionary, {\n invalidateQueries: ['getDictionaries', 'getDictionariesKeys'],\n ...args,\n });\n\nexport const usePushDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.pushDictionaries>\n) =>\n useAppAsync(\n 'pushDictionaries',\n useIntlayerAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.updateDictionary>\n) =>\n useAppAsync(\n 'updateDictionary',\n useIntlayerAuth().dictionary.updateDictionary,\n {\n invalidateQueries: ['getDictionaries', 'getDictionary'],\n ...args,\n }\n );\nexport const useDeleteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.deleteDictionary>\n) =>\n useAppAsync(\n 'deleteDictionary',\n useIntlayerAuth().dictionary.deleteDictionary,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.getTags>\n) =>\n useAppAsync(\n 'getTags',\n useIntlayerAuth().tag.getTags,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.addTag>\n) =>\n useAppAsync('addTag', useIntlayerAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useUpdateTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.updateTag>\n) =>\n useAppAsync('updateTag', useIntlayerAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useDeleteTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.deleteTag>\n) =>\n useAppAsync('deleteTag', useIntlayerAuth().tag.deleteTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\n/**\n * Stripe\n */\n\nexport const useGetSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.getSubscription>\n) =>\n useAppAsync(\n 'getSubscription',\n useIntlayerAuth().stripe.getSubscription,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useCancelSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.cancelSubscription>\n) =>\n useAppAsync(\n 'cancelSubscription',\n useIntlayerAuth().stripe.cancelSubscription,\n { invalidateQueries: ['getSession'], ...args },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\n/**\n * AI\n */\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclaration>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclaration,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationMetadata = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationMetadata>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclarationMetadata,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationField = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationField>\n) =>\n useAppAsync(\n 'auditContentDeclarationField',\n useIntlayerAuth().ai.auditContentDeclarationField,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditTag>\n) =>\n useAppAsync('auditTag', useIntlayerAuth().ai.auditTag, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAskDocQuestion = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.askDocQuestion>\n) => useAppAsync('askDocQuestion', useIntlayerAuth().ai.askDocQuestion, args);\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.editor.writeDictionary>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerAuth().editor.writeDictionary,\n args\n );\n"],"names":["useToast","error","useConfiguration","useAuth","useAsync","useIntlayerAuth"],"mappings":";;;;;;;;;;AAAA,MAAe,UAAA,CAAA;ACcf,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAIA,qCAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAAA;AACM,gBAAA,KAAK,MAAM,YAAY;AAAA,eACxB,GAAG;AACV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O;AAAA,EACzB;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"intlayerAPIHooks.cjs","sources":["../../src/hooks/intlayerAPIHooks.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { intlayerAPI } from '@intlayer/api';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAuth } from '../components/Auth/useAuth/index';\nimport { useToast } from '../components/Toaster';\nimport { useAsync, UseAsyncOptions } from './useAsync/useAsync';\nimport { useIntlayerAuth } from './useIntlayerAPI';\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useErrorHandling = <T extends UseAsyncOptions<any>>(options: T): T => {\n const { toast } = useToast();\n\n return {\n ...options,\n onError: (errorMessage) => {\n let error;\n\n // If json is valid, parse it\n try {\n error = JSON.parse(errorMessage);\n } catch (e) {\n console.error(e);\n // If json is not valid, set error to the original errorMessage\n\n error = errorMessage;\n }\n\n // render toast for each error if there is more than one\n // otherwise render the toast with the error message\n [error]\n .flatMap((error) => error)\n .forEach((error) =>\n toast({\n title:\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error',\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data.message)\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n options.onSuccess?.(data);\n },\n };\n};\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = <T extends UseAsyncOptions<any>>(\n options: T,\n { requireUser, requireProject, requireOrganization }: AuthEnableOptions = {}\n): T => {\n const configuration = useConfiguration();\n const { csrfToken, oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const isEnabledOption = options?.enable ?? true;\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isCSRFEnabled =\n Boolean(csrfToken) ||\n // If auth using session, csrf token is not required\n (!session && Boolean(oAuth2AccessToken));\n\n const isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled &&\n isCSRFEnabled;\n\n return {\n ...options,\n enable: isEnabled,\n };\n};\n\nconst useAppAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>,\n authOptions?: AuthEnableOptions\n) => {\n // Enhance options using custom hooks\n const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);\n\n const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\nconst useEditorAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n) => {\n const optionsWithErrorHandling = useErrorHandling(options ?? {});\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\n/**\n * Auth\n */\n\nexport const useLogin = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.login>\n) =>\n useAppAsync('login', useIntlayerAuth().auth.login, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRegister = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.register>\n) =>\n useAppAsync('register', useIntlayerAuth().auth.register, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useLogout = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.logout>\n) =>\n useAppAsync('logout', useIntlayerAuth().auth.logout, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useChangePassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.changePassword>\n) => useAppAsync('changePassword', useIntlayerAuth().auth.changePassword, args);\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.askResetPassword>\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().auth.askResetPassword,\n args\n );\nexport const useResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.resetPassword>\n) => useAppAsync('resetPassword', useIntlayerAuth().auth.resetPassword, args);\nexport const useCheckIfUserHasPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.checkIfUserHasPassword>\n) =>\n useAppAsync(\n 'checkIfUserHasPassword',\n useIntlayerAuth().auth.checkIfUserHasPassword,\n args,\n {\n requireUser: true,\n }\n );\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.verifyEmail>\n) => useAppAsync('verifyEmail', useIntlayerAuth().auth.verifyEmail, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUserByAccount>\n) =>\n useAppAsync(\n 'getUserByAccount',\n useIntlayerAuth().user.getUserByAccount,\n args\n );\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUsers>\n) =>\n useAppAsync(\n 'getUsers',\n useIntlayerAuth().user.getUsers,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\nexport const useCreateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.createUser>\n) =>\n useAppAsync('createUser', useIntlayerAuth().user.createUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\nexport const useUpdateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.updateUser>\n) =>\n useAppAsync('updateUser', useIntlayerAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.deleteUser>\n) =>\n useAppAsync('deleteUser', useIntlayerAuth().user.deleteUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.getOrganizations>\n) =>\n useAppAsync(\n 'getOrganizations',\n useIntlayerAuth().organization.getOrganizations,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useAddOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganization>\n) =>\n useAppAsync(\n 'addOrganization',\n useIntlayerAuth().organization.addOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useUpdateOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganization>\n) =>\n useAppAsync(\n 'updateOrganization',\n useIntlayerAuth().organization.updateOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUpdateOrganizationMembers = (\n args?: UseAsyncOptions<\n typeof intlayerAPI.organization.updateOrganizationMembers\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganizationMember>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.deleteOrganization>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.selectOrganization>\n) =>\n useAppAsync(\n 'selectOrganization',\n useIntlayerAuth().organization.selectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUnselectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.unselectOrganization>\n) =>\n useAppAsync(\n 'unselectOrganization',\n useIntlayerAuth().organization.unselectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.getProjects>\n) =>\n useAppAsync(\n 'getProjects',\n useIntlayerAuth().project.getProjects,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addProject>\n) =>\n useAppAsync('addProject', useIntlayerAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useUpdateProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProject>\n) =>\n useAppAsync('updateProject', useIntlayerAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProjectMembers>\n) =>\n useAppAsync(\n 'updateProjectMembers',\n useIntlayerAuth().project.updateProjectMembers,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useDeleteProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteProject>\n) =>\n useAppAsync('deleteProject', useIntlayerAuth().project.deleteProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useSelectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.selectProject>\n) =>\n useAppAsync('selectProject', useIntlayerAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUnselectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.unselectProject>\n) =>\n useAppAsync('unselectProject', useIntlayerAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addNewAccessKey>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteAccessKey>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.refreshAccessKey>\n) =>\n useAppAsync('refreshAccessKey', useIntlayerAuth().project.refreshAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionaries>\n) =>\n useAppAsync(\n 'getDictionaries',\n useIntlayerAuth().dictionary.getDictionaries,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionariesKeys = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionariesKeys>\n) =>\n useAppAsync(\n 'getDictionariesKeys',\n useIntlayerAuth().dictionary.getDictionariesKeys,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionary>\n) =>\n useAppAsync(\n 'getDictionary',\n useIntlayerAuth().dictionary.getDictionary,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\nexport const useAddDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.addDictionary>\n) =>\n useAppAsync('addDictionary', useIntlayerAuth().dictionary.addDictionary, {\n invalidateQueries: ['getDictionaries', 'getDictionariesKeys'],\n ...args,\n });\n\nexport const usePushDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.pushDictionaries>\n) =>\n useAppAsync(\n 'pushDictionaries',\n useIntlayerAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.updateDictionary>\n) =>\n useAppAsync(\n 'updateDictionary',\n useIntlayerAuth().dictionary.updateDictionary,\n {\n invalidateQueries: ['getDictionaries', 'getDictionary'],\n ...args,\n }\n );\nexport const useDeleteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.deleteDictionary>\n) =>\n useAppAsync(\n 'deleteDictionary',\n useIntlayerAuth().dictionary.deleteDictionary,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.getTags>\n) =>\n useAppAsync(\n 'getTags',\n useIntlayerAuth().tag.getTags,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.addTag>\n) =>\n useAppAsync('addTag', useIntlayerAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useUpdateTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.updateTag>\n) =>\n useAppAsync('updateTag', useIntlayerAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useDeleteTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.deleteTag>\n) =>\n useAppAsync('deleteTag', useIntlayerAuth().tag.deleteTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\n/**\n * Stripe\n */\n\nexport const useGetSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.getSubscription>\n) =>\n useAppAsync(\n 'getSubscription',\n useIntlayerAuth().stripe.getSubscription,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useCancelSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.cancelSubscription>\n) =>\n useAppAsync(\n 'cancelSubscription',\n useIntlayerAuth().stripe.cancelSubscription,\n { invalidateQueries: ['getSession'], ...args },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\n/**\n * AI\n */\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclaration>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclaration,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationMetadata = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationMetadata>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclarationMetadata,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationField = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationField>\n) =>\n useAppAsync(\n 'auditContentDeclarationField',\n useIntlayerAuth().ai.auditContentDeclarationField,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditTag>\n) =>\n useAppAsync('auditTag', useIntlayerAuth().ai.auditTag, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAskDocQuestion = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.askDocQuestion>\n) => useAppAsync('askDocQuestion', useIntlayerAuth().ai.askDocQuestion, args);\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.editor.writeDictionary>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerAuth().editor.writeDictionary,\n args\n );\n"],"names":["useToast","error","useConfiguration","useAuth","useAsync","useIntlayerAuth"],"mappings":";;;;;;;;;;;AAaA,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAIA,qCAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAAA;AACM,gBAAA,KAAK,MAAM,YAAY;AAAA,eACxB,GAAG;AACV,gBAAQ,MAAM,CAAC;AAGP,gBAAA;AAAA,MAAA;AAKV,OAAC,KAAK,EACH,QAAQ,CAACC,WAAUA,MAAK,EACxB;AAAA,QAAQ,CAACA,WACR,MAAM;AAAA,UACJ,QACG,2BAAY,aAAa,eACtBA,OAAM,QACNA,OAAM,SAAS;AAAA,UACrB,aAAaA,OAAM,WAAW,gBAAgB;AAAA,UAC9C,SAAS;AAAA,QACV,CAAA;AAAA,MACH;AACF,cAAQ,UAAU,YAAY;AAAA,IAChC;AAAA,IACA,WAAW,CAAC,SAAS;AACnB,UAAI,KAAK;AACD,cAAA;AAAA,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6B,CACxC,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,gBAAA,EAAkB,GAAG;AAAA,EACrB;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,gBAAgB;AAAA,EAAA;AAEpB;AAEW,MAAA,qCAAqC,CAChD,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,gBAAA,EAAkB,GAAG;AAAA,EACrB;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,gBAAgB;AAAA,EAAA;AAEpB;AAEW,MAAA,kCAAkC,CAC7C,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,gBAAA,EAAkB,GAAG;AAAA,EACrB;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,gBAAgB;AAAA,EAAA;AAEpB;AAEW,MAAA,cAAc,CACzB,SAEA,YAAY,YAAYA,qBAAAA,kBAAkB,GAAG,UAAU,MAAM;AAAA,EAC3D,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,gBAAgB;AAClB,CAAC;AAEU,MAAA,oBAAoB,CAC/B,SACG,YAAY,kBAAkBA,qBAAAA,kBAAkB,GAAG,gBAAgB,IAAI;AAM/D,MAAA,qBAAqB,CAChC,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,gBAAA,EAAkB,OAAO;AAAA,EACzB;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,76 +3,76 @@ import { UseAsyncOptions } from './useAsync/useAsync';
3
3
  /**
4
4
  * Auth
5
5
  */
6
- export declare const useLogin: (args?: UseAsyncOptions<typeof intlayerAPI.auth.login>) => import('./useAsync').UseAsyncResult<"login", (user: LoginBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<LoginResult>>;
7
- export declare const useRegister: (args?: UseAsyncOptions<typeof intlayerAPI.auth.register>) => import('./useAsync').UseAsyncResult<"register", (user: RegisterBody, query?: RegisterQuery, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<RegisterResult>>;
6
+ export declare const useLogin: (args?: UseAsyncOptions<typeof intlayerAPI.auth.login>) => import('./useAsync').UseAsyncResult<"login", (user: import('@intlayer/backend').LoginBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').LoginResult>>;
7
+ export declare const useRegister: (args?: UseAsyncOptions<typeof intlayerAPI.auth.register>) => import('./useAsync').UseAsyncResult<"register", (user: import('@intlayer/backend').RegisterBody, query?: import('@intlayer/backend').RegisterQuery, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').RegisterResult>>;
8
8
  export declare const useLogout: (args?: UseAsyncOptions<typeof intlayerAPI.auth.logout>) => import('./useAsync').UseAsyncResult<"logout", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<void>>;
9
- export declare const useChangePassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.changePassword>) => import('./useAsync').UseAsyncResult<"changePassword", (data: UpdatePasswordBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdatePasswordResult>>;
10
- export declare const useAskResetPassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.askResetPassword>) => import('./useAsync').UseAsyncResult<"askResetPassword", (email: AskResetPasswordBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AskResetPasswordResult>>;
11
- export declare const useResetPassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.resetPassword>) => import('./useAsync').UseAsyncResult<"resetPassword", (params: ResetPasswordParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<ResetPasswordResult>>;
12
- export declare const useCheckIfUserHasPassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.checkIfUserHasPassword>) => import('./useAsync').UseAsyncResult<"checkIfUserHasPassword", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<CheckIfUserHasPasswordResult>>;
13
- export declare const useVerifyEmail: (args?: UseAsyncOptions<typeof intlayerAPI.auth.verifyEmail>) => import('./useAsync').UseAsyncResult<"verifyEmail", ({ userId, secret }: ValidEmailParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<ValidEmailResult>>;
14
- export declare const useGetUserByAccount: (args?: UseAsyncOptions<typeof intlayerAPI.user.getUserByAccount>) => import('./useAsync').UseAsyncResult<"getUserByAccount", (providerAccountId: GetUserByAccountParams, provider: GetUserByAccountParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetUserByAccountResult>>;
9
+ export declare const useChangePassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.changePassword>) => import('./useAsync').UseAsyncResult<"changePassword", (data: import('@intlayer/backend').UpdatePasswordBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdatePasswordResult>>;
10
+ export declare const useAskResetPassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.askResetPassword>) => import('./useAsync').UseAsyncResult<"askResetPassword", (email: import('@intlayer/backend').AskResetPasswordBody["email"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AskResetPasswordResult>>;
11
+ export declare const useResetPassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.resetPassword>) => import('./useAsync').UseAsyncResult<"resetPassword", (params: import('@intlayer/backend').ResetPasswordParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').ResetPasswordResult>>;
12
+ export declare const useCheckIfUserHasPassword: (args?: UseAsyncOptions<typeof intlayerAPI.auth.checkIfUserHasPassword>) => import('./useAsync').UseAsyncResult<"checkIfUserHasPassword", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').CheckIfUserHasPasswordResult>>;
13
+ export declare const useVerifyEmail: (args?: UseAsyncOptions<typeof intlayerAPI.auth.verifyEmail>) => import('./useAsync').UseAsyncResult<"verifyEmail", ({ userId, secret }: import('@intlayer/backend').ValidEmailParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').ValidEmailResult>>;
14
+ export declare const useGetUserByAccount: (args?: UseAsyncOptions<typeof intlayerAPI.user.getUserByAccount>) => import('./useAsync').UseAsyncResult<"getUserByAccount", (providerAccountId: import('@intlayer/backend').GetUserByAccountParams["providerAccountId"], provider: import('@intlayer/backend').GetUserByAccountParams["provider"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetUserByAccountResult>>;
15
15
  /**
16
16
  * User
17
17
  */
18
- export declare const useGetUsers: (args?: UseAsyncOptions<typeof intlayerAPI.user.getUsers>) => import('./useAsync').UseAsyncResult<"getUsers", (filters?: GetUsersParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetUsersResult>>;
19
- export declare const useCreateUser: (args?: UseAsyncOptions<typeof intlayerAPI.user.createUser>) => import('./useAsync').UseAsyncResult<"createUser", (user: CreateUserBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<CreateUserResult>>;
20
- export declare const useUpdateUser: (args?: UseAsyncOptions<typeof intlayerAPI.user.updateUser>) => import('./useAsync').UseAsyncResult<"updateUser", (user: UpdateUserBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateUserResult>>;
21
- export declare const useDeleteUser: (args?: UseAsyncOptions<typeof intlayerAPI.user.deleteUser>) => import('./useAsync').UseAsyncResult<"deleteUser", (userId: string, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateUserResult>>;
18
+ export declare const useGetUsers: (args?: UseAsyncOptions<typeof intlayerAPI.user.getUsers>) => import('./useAsync').UseAsyncResult<"getUsers", (filters?: import('@intlayer/backend').GetUsersParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetUsersResult>>;
19
+ export declare const useCreateUser: (args?: UseAsyncOptions<typeof intlayerAPI.user.createUser>) => import('./useAsync').UseAsyncResult<"createUser", (user: import('@intlayer/backend').CreateUserBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').CreateUserResult>>;
20
+ export declare const useUpdateUser: (args?: UseAsyncOptions<typeof intlayerAPI.user.updateUser>) => import('./useAsync').UseAsyncResult<"updateUser", (user: import('@intlayer/backend').UpdateUserBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>>;
21
+ export declare const useDeleteUser: (args?: UseAsyncOptions<typeof intlayerAPI.user.deleteUser>) => import('./useAsync').UseAsyncResult<"deleteUser", (userId: string, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>>;
22
22
  /**
23
23
  * Organization
24
24
  */
25
- export declare const useGetOrganizations: (args?: UseAsyncOptions<typeof intlayerAPI.organization.getOrganizations>) => import('./useAsync').UseAsyncResult<"getOrganizations", (filters?: GetOrganizationsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetOrganizationsResult>>;
26
- export declare const useAddOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganization>) => import('./useAsync').UseAsyncResult<"addOrganization", (organization: AddOrganizationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AddOrganizationResult>>;
27
- export declare const useUpdateOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganization>) => import('./useAsync').UseAsyncResult<"updateOrganization", (organization: UpdateOrganizationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateOrganizationResult>>;
28
- export declare const useUpdateOrganizationMembers: (args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganizationMembers>) => import('./useAsync').UseAsyncResult<"updateOrganizationMembers", (body: UpdateOrganizationMembersBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateOrganizationMembersResult>>;
29
- export declare const useAddOrganizationMember: (args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganizationMember>) => import('./useAsync').UseAsyncResult<"addOrganizationMember", (body: AddOrganizationMemberBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AddOrganizationMemberResult>>;
30
- export declare const useDeleteOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.deleteOrganization>) => import('./useAsync').UseAsyncResult<"deleteOrganization", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<DeleteOrganizationResult>>;
31
- export declare const useSelectOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.selectOrganization>) => import('./useAsync').UseAsyncResult<"selectOrganization", (organizationId: SelectOrganizationParam, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<SelectOrganizationResult>>;
32
- export declare const useUnselectOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.unselectOrganization>) => import('./useAsync').UseAsyncResult<"unselectOrganization", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UnselectOrganizationResult>>;
25
+ export declare const useGetOrganizations: (args?: UseAsyncOptions<typeof intlayerAPI.organization.getOrganizations>) => import('./useAsync').UseAsyncResult<"getOrganizations", (filters?: import('@intlayer/backend').GetOrganizationsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetOrganizationsResult>>;
26
+ export declare const useAddOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganization>) => import('./useAsync').UseAsyncResult<"addOrganization", (organization: import('@intlayer/backend').AddOrganizationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationResult>>;
27
+ export declare const useUpdateOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganization>) => import('./useAsync').UseAsyncResult<"updateOrganization", (organization: import('@intlayer/backend').UpdateOrganizationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationResult>>;
28
+ export declare const useUpdateOrganizationMembers: (args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganizationMembers>) => import('./useAsync').UseAsyncResult<"updateOrganizationMembers", (body: import('@intlayer/backend').UpdateOrganizationMembersBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationMembersResult>>;
29
+ export declare const useAddOrganizationMember: (args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganizationMember>) => import('./useAsync').UseAsyncResult<"addOrganizationMember", (body: import('@intlayer/backend').AddOrganizationMemberBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationMemberResult>>;
30
+ export declare const useDeleteOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.deleteOrganization>) => import('./useAsync').UseAsyncResult<"deleteOrganization", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteOrganizationResult>>;
31
+ export declare const useSelectOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.selectOrganization>) => import('./useAsync').UseAsyncResult<"selectOrganization", (organizationId: import('@intlayer/backend').SelectOrganizationParam["organizationId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').SelectOrganizationResult>>;
32
+ export declare const useUnselectOrganization: (args?: UseAsyncOptions<typeof intlayerAPI.organization.unselectOrganization>) => import('./useAsync').UseAsyncResult<"unselectOrganization", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UnselectOrganizationResult>>;
33
33
  /**
34
34
  * Project
35
35
  */
36
- export declare const useGetProjects: (args?: UseAsyncOptions<typeof intlayerAPI.project.getProjects>) => import('./useAsync').UseAsyncResult<"getProjects", (filters?: GetProjectsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetProjectsResult>>;
37
- export declare const useAddProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.addProject>) => import('./useAsync').UseAsyncResult<"addProject", (project: AddProjectBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AddProjectResult>>;
38
- export declare const useUpdateProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.updateProject>) => import('./useAsync').UseAsyncResult<"updateProject", (project: UpdateProjectBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateProjectResult>>;
39
- export declare const useUpdateProjectMembers: (args?: UseAsyncOptions<typeof intlayerAPI.project.updateProjectMembers>) => import('./useAsync').UseAsyncResult<"updateProjectMembers", (body: UpdateProjectMembersBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateProjectMembersResult>>;
40
- export declare const useDeleteProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.deleteProject>) => import('./useAsync').UseAsyncResult<"deleteProject", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<DeleteProjectResult>>;
41
- export declare const useSelectProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.selectProject>) => import('./useAsync').UseAsyncResult<"selectProject", (projectId: SelectProjectParam, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<SelectProjectResult>>;
42
- export declare const useUnselectProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.unselectProject>) => import('./useAsync').UseAsyncResult<"unselectProject", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UnselectProjectResult>>;
43
- export declare const useAddNewAccessKey: (args?: UseAsyncOptions<typeof intlayerAPI.project.addNewAccessKey>) => import('./useAsync').UseAsyncResult<"addNewAccessKey", (accessKey: AddNewAccessKeyBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AddNewAccessKeyResponse>>;
44
- export declare const useDeleteAccessKey: (args?: UseAsyncOptions<typeof intlayerAPI.project.deleteAccessKey>) => import('./useAsync').UseAsyncResult<"deleteAccessKey", (clientId: DeleteAccessKeyBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<DeleteAccessKeyResponse>>;
45
- export declare const useRefreshAccessKey: (args?: UseAsyncOptions<typeof intlayerAPI.project.refreshAccessKey>) => import('./useAsync').UseAsyncResult<"refreshAccessKey", (clientId: RefreshAccessKeyBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<RefreshAccessKeyResponse>>;
36
+ export declare const useGetProjects: (args?: UseAsyncOptions<typeof intlayerAPI.project.getProjects>) => import('./useAsync').UseAsyncResult<"getProjects", (filters?: import('@intlayer/backend').GetProjectsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetProjectsResult>>;
37
+ export declare const useAddProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.addProject>) => import('./useAsync').UseAsyncResult<"addProject", (project: import('@intlayer/backend').AddProjectBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddProjectResult>>;
38
+ export declare const useUpdateProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.updateProject>) => import('./useAsync').UseAsyncResult<"updateProject", (project: import('@intlayer/backend').UpdateProjectBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectResult>>;
39
+ export declare const useUpdateProjectMembers: (args?: UseAsyncOptions<typeof intlayerAPI.project.updateProjectMembers>) => import('./useAsync').UseAsyncResult<"updateProjectMembers", (body: import('@intlayer/backend').UpdateProjectMembersBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectMembersResult>>;
40
+ export declare const useDeleteProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.deleteProject>) => import('./useAsync').UseAsyncResult<"deleteProject", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteProjectResult>>;
41
+ export declare const useSelectProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.selectProject>) => import('./useAsync').UseAsyncResult<"selectProject", (projectId: import('@intlayer/backend').SelectProjectParam["projectId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').SelectProjectResult>>;
42
+ export declare const useUnselectProject: (args?: UseAsyncOptions<typeof intlayerAPI.project.unselectProject>) => import('./useAsync').UseAsyncResult<"unselectProject", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UnselectProjectResult>>;
43
+ export declare const useAddNewAccessKey: (args?: UseAsyncOptions<typeof intlayerAPI.project.addNewAccessKey>) => import('./useAsync').UseAsyncResult<"addNewAccessKey", (accessKey: import('@intlayer/backend').AddNewAccessKeyBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddNewAccessKeyResponse>>;
44
+ export declare const useDeleteAccessKey: (args?: UseAsyncOptions<typeof intlayerAPI.project.deleteAccessKey>) => import('./useAsync').UseAsyncResult<"deleteAccessKey", (clientId: import('@intlayer/backend').DeleteAccessKeyBody["clientId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteAccessKeyResponse>>;
45
+ export declare const useRefreshAccessKey: (args?: UseAsyncOptions<typeof intlayerAPI.project.refreshAccessKey>) => import('./useAsync').UseAsyncResult<"refreshAccessKey", (clientId: import('@intlayer/backend').RefreshAccessKeyBody["clientId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').RefreshAccessKeyResponse>>;
46
46
  /**
47
47
  * Dictionary
48
48
  */
49
- export declare const useGetDictionaries: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionaries>) => import('./useAsync').UseAsyncResult<"getDictionaries", (filters?: GetDictionariesParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetDictionariesResult>>;
50
- export declare const useGetDictionariesKeys: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionariesKeys>) => import('./useAsync').UseAsyncResult<"getDictionariesKeys", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetDictionariesKeysResult>>;
51
- export declare const useGetDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionary>) => import('./useAsync').UseAsyncResult<"getDictionary", (dictionaryKey: GetDictionaryParams, version?: GetDictionaryQuery, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetDictionaryResult>>;
52
- export declare const useAddDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.addDictionary>) => import('./useAsync').UseAsyncResult<"addDictionary", (dictionary: AddDictionaryBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AddDictionaryResult>>;
53
- export declare const usePushDictionaries: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.pushDictionaries>) => import('./useAsync').UseAsyncResult<"pushDictionaries", (dictionaries: PushDictionariesBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<PushDictionariesResult>>;
54
- export declare const useUpdateDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.updateDictionary>) => import('./useAsync').UseAsyncResult<"updateDictionary", (dictionaryId: UpdateDictionaryParam, dictionary: UpdateDictionaryBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateDictionaryResult>>;
55
- export declare const useDeleteDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.deleteDictionary>) => import('./useAsync').UseAsyncResult<"deleteDictionary", (id: DeleteDictionaryParam, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<DeleteDictionaryResult>>;
49
+ export declare const useGetDictionaries: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionaries>) => import('./useAsync').UseAsyncResult<"getDictionaries", (filters?: import('@intlayer/backend').GetDictionariesParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesResult>>;
50
+ export declare const useGetDictionariesKeys: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionariesKeys>) => import('./useAsync').UseAsyncResult<"getDictionariesKeys", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesKeysResult>>;
51
+ export declare const useGetDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionary>) => import('./useAsync').UseAsyncResult<"getDictionary", (dictionaryKey: import('@intlayer/backend').GetDictionaryParams["dictionaryKey"], version?: import('@intlayer/backend').GetDictionaryQuery["version"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetDictionaryResult>>;
52
+ export declare const useAddDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.addDictionary>) => import('./useAsync').UseAsyncResult<"addDictionary", (dictionary: import('@intlayer/backend').AddDictionaryBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddDictionaryResult>>;
53
+ export declare const usePushDictionaries: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.pushDictionaries>) => import('./useAsync').UseAsyncResult<"pushDictionaries", (dictionaries: import('@intlayer/backend').PushDictionariesBody["dictionaries"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').PushDictionariesResult>>;
54
+ export declare const useUpdateDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.updateDictionary>) => import('./useAsync').UseAsyncResult<"updateDictionary", (dictionaryId: import('@intlayer/backend').UpdateDictionaryParam["dictionaryId"], dictionary: import('@intlayer/backend').UpdateDictionaryBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateDictionaryResult>>;
55
+ export declare const useDeleteDictionary: (args?: UseAsyncOptions<typeof intlayerAPI.dictionary.deleteDictionary>) => import('./useAsync').UseAsyncResult<"deleteDictionary", (id: import('@intlayer/backend').DeleteDictionaryParam["dictionaryId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteDictionaryResult>>;
56
56
  /**
57
57
  * Tag
58
58
  */
59
- export declare const useGetTags: (args?: UseAsyncOptions<typeof intlayerAPI.tag.getTags>) => import('./useAsync').UseAsyncResult<"getTags", (filters?: GetTagsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetTagsResult>>;
60
- export declare const useAddTag: (args?: UseAsyncOptions<typeof intlayerAPI.tag.addTag>) => import('./useAsync').UseAsyncResult<"addTag", (tag: AddTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AddTagResult>>;
61
- export declare const useUpdateTag: (args?: UseAsyncOptions<typeof intlayerAPI.tag.updateTag>) => import('./useAsync').UseAsyncResult<"updateTag", (tagId: UpdateTagParams, tag: UpdateTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<UpdateTagResult>>;
62
- export declare const useDeleteTag: (args?: UseAsyncOptions<typeof intlayerAPI.tag.deleteTag>) => import('./useAsync').UseAsyncResult<"deleteTag", (tagId: DeleteTagParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<DeleteTagResult>>;
59
+ export declare const useGetTags: (args?: UseAsyncOptions<typeof intlayerAPI.tag.getTags>) => import('./useAsync').UseAsyncResult<"getTags", (filters?: import('@intlayer/backend').GetTagsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetTagsResult>>;
60
+ export declare const useAddTag: (args?: UseAsyncOptions<typeof intlayerAPI.tag.addTag>) => import('./useAsync').UseAsyncResult<"addTag", (tag: import('@intlayer/backend').AddTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddTagResult>>;
61
+ export declare const useUpdateTag: (args?: UseAsyncOptions<typeof intlayerAPI.tag.updateTag>) => import('./useAsync').UseAsyncResult<"updateTag", (tagId: import('@intlayer/backend').UpdateTagParams["tagId"], tag: import('@intlayer/backend').UpdateTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateTagResult>>;
62
+ export declare const useDeleteTag: (args?: UseAsyncOptions<typeof intlayerAPI.tag.deleteTag>) => import('./useAsync').UseAsyncResult<"deleteTag", (tagId: import('@intlayer/backend').DeleteTagParams["tagId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteTagResult>>;
63
63
  /**
64
64
  * Stripe
65
65
  */
66
- export declare const useGetSubscription: (args?: UseAsyncOptions<typeof intlayerAPI.stripe.getSubscription>) => import('./useAsync').UseAsyncResult<"getSubscription", (body?: GetCheckoutSessionBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetCheckoutSessionResult>>;
67
- export declare const useCancelSubscription: (args?: UseAsyncOptions<typeof intlayerAPI.stripe.cancelSubscription>) => import('./useAsync').UseAsyncResult<"cancelSubscription", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetCheckoutSessionResult>>;
66
+ export declare const useGetSubscription: (args?: UseAsyncOptions<typeof intlayerAPI.stripe.getSubscription>) => import('./useAsync').UseAsyncResult<"getSubscription", (body?: import('@intlayer/backend').GetCheckoutSessionBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>>;
67
+ export declare const useCancelSubscription: (args?: UseAsyncOptions<typeof intlayerAPI.stripe.cancelSubscription>) => import('./useAsync').UseAsyncResult<"cancelSubscription", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>>;
68
68
  /**
69
69
  * AI
70
70
  */
71
- export declare const useAuditContentDeclaration: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclaration>) => import('./useAsync').UseAsyncResult<"auditContentDeclaration", (body?: AuditContentDeclarationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AuditContentDeclarationResult>>;
72
- export declare const useAuditContentDeclarationMetadata: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationMetadata>) => import('./useAsync').UseAsyncResult<"auditContentDeclaration", (body?: AuditContentDeclarationMetadataBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AuditContentDeclarationMetadataResult>>;
73
- export declare const useAuditContentDeclarationField: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationField>) => import('./useAsync').UseAsyncResult<"auditContentDeclarationField", (body?: AuditContentDeclarationFieldBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AuditContentDeclarationFieldResult>>;
74
- export declare const useAuditTag: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditTag>) => import('./useAsync').UseAsyncResult<"auditTag", (body?: AuditTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AuditTagResult>>;
75
- export declare const useAskDocQuestion: (args?: UseAsyncOptions<typeof intlayerAPI.ai.askDocQuestion>) => import('./useAsync').UseAsyncResult<"askDocQuestion", (body?: AskDocQuestionBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<AskDocQuestionResult>>;
71
+ export declare const useAuditContentDeclaration: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclaration>) => import('./useAsync').UseAsyncResult<"auditContentDeclaration", (body?: import('@intlayer/backend').AuditContentDeclarationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationResult>>;
72
+ export declare const useAuditContentDeclarationMetadata: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationMetadata>) => import('./useAsync').UseAsyncResult<"auditContentDeclaration", (body?: import('@intlayer/backend').AuditContentDeclarationMetadataBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationMetadataResult>>;
73
+ export declare const useAuditContentDeclarationField: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationField>) => import('./useAsync').UseAsyncResult<"auditContentDeclarationField", (body?: import('@intlayer/backend').AuditContentDeclarationFieldBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationFieldResult>>;
74
+ export declare const useAuditTag: (args?: UseAsyncOptions<typeof intlayerAPI.ai.auditTag>) => import('./useAsync').UseAsyncResult<"auditTag", (body?: import('@intlayer/backend').AuditTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditTagResult>>;
75
+ export declare const useAskDocQuestion: (args?: UseAsyncOptions<typeof intlayerAPI.ai.askDocQuestion>) => import('./useAsync').UseAsyncResult<"askDocQuestion", (body?: import('@intlayer/backend').AskDocQuestionBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AskDocQuestionResult>>;
76
76
  /**
77
77
  * Editor
78
78
  */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7E,CAAC;AAEL,eAAO,MAAM,iBAAiB,UACrB,eAAe,CAAC,OAAO,WAAW,CAAC,EAAE,CAAC,cAAc,CAAC,0EAes7E,mBAAmB,+FAAuE,mBAAmB,wBAdphF,CAAC;AAE9E;;GAEG;AAEH,eAAO,MAAM,kBAAkB,UACtB,eAAe,CAAC,OAAO,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,yEAOm5G,2BAA4B,0EAD/+G,CAAC"}
@@ -6,7 +6,7 @@ import { useToast } from "../components/Toaster/useToast.mjs";
6
6
  import "../jsx-runtime-DQkoUcjV.js";
7
7
  import { useAsync } from "./useAsync/useAsync.mjs";
8
8
  import { useIntlayerAuth } from "./useIntlayerAPI.mjs";
9
- const process = {};
9
+ var define_process_env_default = {};
10
10
  const useErrorHandling = (options) => {
11
11
  const { toast } = useToast();
12
12
  return {
@@ -21,7 +21,7 @@ const useErrorHandling = (options) => {
21
21
  }
22
22
  [error].flatMap((error2) => error2).forEach(
23
23
  (error2) => toast({
24
- title: (process.env.NODE_ENV === "production" ? error2.title : error2.code) ?? "Error",
24
+ title: (define_process_env_default.NODE_ENV === "production" ? error2.title : error2.code) ?? "Error",
25
25
  description: error2.message ?? errorMessage ?? "An error occurred",
26
26
  variant: "error"
27
27
  })
@@ -1 +1 @@
1
- {"version":3,"file":"intlayerAPIHooks.mjs","sources":["../../__vite-browser-external","../../src/hooks/intlayerAPIHooks.ts"],"sourcesContent":["export default {}","/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport process from 'process';\nimport { intlayerAPI } from '@intlayer/api';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAuth } from '../components/Auth/useAuth/index';\nimport { useToast } from '../components/Toaster';\nimport { useAsync, UseAsyncOptions } from './useAsync/useAsync';\nimport { useIntlayerAuth } from './useIntlayerAPI';\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useErrorHandling = <T extends UseAsyncOptions<any>>(options: T): T => {\n const { toast } = useToast();\n\n return {\n ...options,\n onError: (errorMessage) => {\n let error;\n\n // If json is valid, parse it\n try {\n error = JSON.parse(errorMessage);\n } catch (e) {\n console.error(e);\n // If json is not valid, set error to the original errorMessage\n\n error = errorMessage;\n }\n\n // render toast for each error if there is more than one\n // otherwise render the toast with the error message\n [error]\n .flatMap((error) => error)\n .forEach((error) =>\n toast({\n title:\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error',\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data.message)\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n options.onSuccess?.(data);\n },\n };\n};\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = <T extends UseAsyncOptions<any>>(\n options: T,\n { requireUser, requireProject, requireOrganization }: AuthEnableOptions = {}\n): T => {\n const configuration = useConfiguration();\n const { csrfToken, oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const isEnabledOption = options?.enable ?? true;\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isCSRFEnabled =\n Boolean(csrfToken) ||\n // If auth using session, csrf token is not required\n (!session && Boolean(oAuth2AccessToken));\n\n const isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled &&\n isCSRFEnabled;\n\n return {\n ...options,\n enable: isEnabled,\n };\n};\n\nconst useAppAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>,\n authOptions?: AuthEnableOptions\n) => {\n // Enhance options using custom hooks\n const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);\n\n const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\nconst useEditorAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n) => {\n const optionsWithErrorHandling = useErrorHandling(options ?? {});\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\n/**\n * Auth\n */\n\nexport const useLogin = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.login>\n) =>\n useAppAsync('login', useIntlayerAuth().auth.login, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRegister = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.register>\n) =>\n useAppAsync('register', useIntlayerAuth().auth.register, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useLogout = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.logout>\n) =>\n useAppAsync('logout', useIntlayerAuth().auth.logout, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useChangePassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.changePassword>\n) => useAppAsync('changePassword', useIntlayerAuth().auth.changePassword, args);\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.askResetPassword>\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().auth.askResetPassword,\n args\n );\nexport const useResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.resetPassword>\n) => useAppAsync('resetPassword', useIntlayerAuth().auth.resetPassword, args);\nexport const useCheckIfUserHasPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.checkIfUserHasPassword>\n) =>\n useAppAsync(\n 'checkIfUserHasPassword',\n useIntlayerAuth().auth.checkIfUserHasPassword,\n args,\n {\n requireUser: true,\n }\n );\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.verifyEmail>\n) => useAppAsync('verifyEmail', useIntlayerAuth().auth.verifyEmail, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUserByAccount>\n) =>\n useAppAsync(\n 'getUserByAccount',\n useIntlayerAuth().user.getUserByAccount,\n args\n );\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUsers>\n) =>\n useAppAsync(\n 'getUsers',\n useIntlayerAuth().user.getUsers,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\nexport const useCreateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.createUser>\n) =>\n useAppAsync('createUser', useIntlayerAuth().user.createUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\nexport const useUpdateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.updateUser>\n) =>\n useAppAsync('updateUser', useIntlayerAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.deleteUser>\n) =>\n useAppAsync('deleteUser', useIntlayerAuth().user.deleteUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.getOrganizations>\n) =>\n useAppAsync(\n 'getOrganizations',\n useIntlayerAuth().organization.getOrganizations,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useAddOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganization>\n) =>\n useAppAsync(\n 'addOrganization',\n useIntlayerAuth().organization.addOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useUpdateOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganization>\n) =>\n useAppAsync(\n 'updateOrganization',\n useIntlayerAuth().organization.updateOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUpdateOrganizationMembers = (\n args?: UseAsyncOptions<\n typeof intlayerAPI.organization.updateOrganizationMembers\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganizationMember>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.deleteOrganization>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.selectOrganization>\n) =>\n useAppAsync(\n 'selectOrganization',\n useIntlayerAuth().organization.selectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUnselectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.unselectOrganization>\n) =>\n useAppAsync(\n 'unselectOrganization',\n useIntlayerAuth().organization.unselectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.getProjects>\n) =>\n useAppAsync(\n 'getProjects',\n useIntlayerAuth().project.getProjects,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addProject>\n) =>\n useAppAsync('addProject', useIntlayerAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useUpdateProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProject>\n) =>\n useAppAsync('updateProject', useIntlayerAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProjectMembers>\n) =>\n useAppAsync(\n 'updateProjectMembers',\n useIntlayerAuth().project.updateProjectMembers,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useDeleteProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteProject>\n) =>\n useAppAsync('deleteProject', useIntlayerAuth().project.deleteProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useSelectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.selectProject>\n) =>\n useAppAsync('selectProject', useIntlayerAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUnselectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.unselectProject>\n) =>\n useAppAsync('unselectProject', useIntlayerAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addNewAccessKey>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteAccessKey>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.refreshAccessKey>\n) =>\n useAppAsync('refreshAccessKey', useIntlayerAuth().project.refreshAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionaries>\n) =>\n useAppAsync(\n 'getDictionaries',\n useIntlayerAuth().dictionary.getDictionaries,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionariesKeys = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionariesKeys>\n) =>\n useAppAsync(\n 'getDictionariesKeys',\n useIntlayerAuth().dictionary.getDictionariesKeys,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionary>\n) =>\n useAppAsync(\n 'getDictionary',\n useIntlayerAuth().dictionary.getDictionary,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\nexport const useAddDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.addDictionary>\n) =>\n useAppAsync('addDictionary', useIntlayerAuth().dictionary.addDictionary, {\n invalidateQueries: ['getDictionaries', 'getDictionariesKeys'],\n ...args,\n });\n\nexport const usePushDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.pushDictionaries>\n) =>\n useAppAsync(\n 'pushDictionaries',\n useIntlayerAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.updateDictionary>\n) =>\n useAppAsync(\n 'updateDictionary',\n useIntlayerAuth().dictionary.updateDictionary,\n {\n invalidateQueries: ['getDictionaries', 'getDictionary'],\n ...args,\n }\n );\nexport const useDeleteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.deleteDictionary>\n) =>\n useAppAsync(\n 'deleteDictionary',\n useIntlayerAuth().dictionary.deleteDictionary,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.getTags>\n) =>\n useAppAsync(\n 'getTags',\n useIntlayerAuth().tag.getTags,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.addTag>\n) =>\n useAppAsync('addTag', useIntlayerAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useUpdateTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.updateTag>\n) =>\n useAppAsync('updateTag', useIntlayerAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useDeleteTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.deleteTag>\n) =>\n useAppAsync('deleteTag', useIntlayerAuth().tag.deleteTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\n/**\n * Stripe\n */\n\nexport const useGetSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.getSubscription>\n) =>\n useAppAsync(\n 'getSubscription',\n useIntlayerAuth().stripe.getSubscription,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useCancelSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.cancelSubscription>\n) =>\n useAppAsync(\n 'cancelSubscription',\n useIntlayerAuth().stripe.cancelSubscription,\n { invalidateQueries: ['getSession'], ...args },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\n/**\n * AI\n */\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclaration>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclaration,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationMetadata = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationMetadata>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclarationMetadata,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationField = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationField>\n) =>\n useAppAsync(\n 'auditContentDeclarationField',\n useIntlayerAuth().ai.auditContentDeclarationField,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditTag>\n) =>\n useAppAsync('auditTag', useIntlayerAuth().ai.auditTag, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAskDocQuestion = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.askDocQuestion>\n) => useAppAsync('askDocQuestion', useIntlayerAuth().ai.askDocQuestion, args);\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.editor.writeDictionary>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerAuth().editor.writeDictionary,\n args\n );\n"],"names":["error"],"mappings":";;;;;;;;AAAA,MAAe,UAAA,CAAA;ACcf,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAI,SAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAAA;AACM,gBAAA,KAAK,MAAM,YAAY;AAAA,eACxB,GAAG;AACV,gBAAQ,MAAM,CAAC;AAGP,gBAAA;AAAA,MAAA;AAKV,OAAC,KAAK,EACH,QAAQ,CAACA,WAAUA,MAAK,EACxB;AAAA,QAAQ,CAACA,WACR,MAAM;AAAA,UACJ,QACG,QAAQ,IAAI,aAAa,eACtBA,OAAM,QACNA,OAAM,SAAS;AAAA,UACrB,aAAaA,OAAM,WAAW,gBAAgB;AAAA,UAC9C,SAAS;AAAA,QACV,CAAA;AAAA,MACH;AACF,cAAQ,UAAU,YAAY;AAAA,IAChC;AAAA,IACA,WAAW,CAAC,SAAS;AACnB,UAAI,KAAK;AACD,cAAA;AAAA,UACJ,OAAO,KAAK;AAAA,UACZ,aAAa,KAAK;AAAA,UAClB,SAAS;AAAA,QAAA,CACV;AACH,cAAQ,YAAY,IAAI;AAAA,IAAA;AAAA,EAE5B;AACF;AAWA,MAAM,gBAAgB,CACpB,SACA,EAAE,aAAa,gBAAgB,oBAA2C,IAAA,OACpE;AACN,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,EAAE,WAAW,mBAAmB,QAAA,IAAY,QAAQ;AAAA,IACxD,uBAAuB;AAAA,EAAA,CACxB;AAEK,QAAA,kBAAkB,SAAS,UAAU;AAC3C,QAAM,OAAO,UAAU,QAAQ,OAAO,mBAAmB;AAEzD,QAAM,eAAe,UACjB,QAAQ,eACR,mBAAmB;AAEvB,QAAM,UAAU,UAAU,QAAQ,UAAU,mBAAmB;AAE/D,Q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A,EACA,gBAAA,EAAkB,OAAO;AAAA,EACzB;AACF;"}
1
+ {"version":3,"file":"intlayerAPIHooks.mjs","sources":["../../src/hooks/intlayerAPIHooks.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n'use client';\n\nimport { intlayerAPI } from '@intlayer/api';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAuth } from '../components/Auth/useAuth/index';\nimport { useToast } from '../components/Toaster';\nimport { useAsync, UseAsyncOptions } from './useAsync/useAsync';\nimport { useIntlayerAuth } from './useIntlayerAPI';\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useErrorHandling = <T extends UseAsyncOptions<any>>(options: T): T => {\n const { toast } = useToast();\n\n return {\n ...options,\n onError: (errorMessage) => {\n let error;\n\n // If json is valid, parse it\n try {\n error = JSON.parse(errorMessage);\n } catch (e) {\n console.error(e);\n // If json is not valid, set error to the original errorMessage\n\n error = errorMessage;\n }\n\n // render toast for each error if there is more than one\n // otherwise render the toast with the error message\n [error]\n .flatMap((error) => error)\n .forEach((error) =>\n toast({\n title:\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error',\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data.message)\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n options.onSuccess?.(data);\n },\n };\n};\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = <T extends UseAsyncOptions<any>>(\n options: T,\n { requireUser, requireProject, requireOrganization }: AuthEnableOptions = {}\n): T => {\n const configuration = useConfiguration();\n const { csrfToken, oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const isEnabledOption = options?.enable ?? true;\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isCSRFEnabled =\n Boolean(csrfToken) ||\n // If auth using session, csrf token is not required\n (!session && Boolean(oAuth2AccessToken));\n\n const isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled &&\n isCSRFEnabled;\n\n return {\n ...options,\n enable: isEnabled,\n };\n};\n\nconst useAppAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>,\n authOptions?: AuthEnableOptions\n) => {\n // Enhance options using custom hooks\n const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);\n\n const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\nconst useEditorAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n) => {\n const optionsWithErrorHandling = useErrorHandling(options ?? {});\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\n/**\n * Auth\n */\n\nexport const useLogin = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.login>\n) =>\n useAppAsync('login', useIntlayerAuth().auth.login, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRegister = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.register>\n) =>\n useAppAsync('register', useIntlayerAuth().auth.register, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useLogout = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.logout>\n) =>\n useAppAsync('logout', useIntlayerAuth().auth.logout, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useChangePassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.changePassword>\n) => useAppAsync('changePassword', useIntlayerAuth().auth.changePassword, args);\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.askResetPassword>\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().auth.askResetPassword,\n args\n );\nexport const useResetPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.resetPassword>\n) => useAppAsync('resetPassword', useIntlayerAuth().auth.resetPassword, args);\nexport const useCheckIfUserHasPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.checkIfUserHasPassword>\n) =>\n useAppAsync(\n 'checkIfUserHasPassword',\n useIntlayerAuth().auth.checkIfUserHasPassword,\n args,\n {\n requireUser: true,\n }\n );\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.verifyEmail>\n) => useAppAsync('verifyEmail', useIntlayerAuth().auth.verifyEmail, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUserByAccount>\n) =>\n useAppAsync(\n 'getUserByAccount',\n useIntlayerAuth().user.getUserByAccount,\n args\n );\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.getUsers>\n) =>\n useAppAsync(\n 'getUsers',\n useIntlayerAuth().user.getUsers,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\nexport const useCreateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.createUser>\n) =>\n useAppAsync('createUser', useIntlayerAuth().user.createUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\nexport const useUpdateUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.updateUser>\n) =>\n useAppAsync('updateUser', useIntlayerAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteUser = (\n args?: UseAsyncOptions<typeof intlayerAPI.user.deleteUser>\n) =>\n useAppAsync('deleteUser', useIntlayerAuth().user.deleteUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.getOrganizations>\n) =>\n useAppAsync(\n 'getOrganizations',\n useIntlayerAuth().organization.getOrganizations,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useAddOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganization>\n) =>\n useAppAsync(\n 'addOrganization',\n useIntlayerAuth().organization.addOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useUpdateOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.updateOrganization>\n) =>\n useAppAsync(\n 'updateOrganization',\n useIntlayerAuth().organization.updateOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUpdateOrganizationMembers = (\n args?: UseAsyncOptions<\n typeof intlayerAPI.organization.updateOrganizationMembers\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.addOrganizationMember>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.deleteOrganization>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.selectOrganization>\n) =>\n useAppAsync(\n 'selectOrganization',\n useIntlayerAuth().organization.selectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useUnselectOrganization = (\n args?: UseAsyncOptions<typeof intlayerAPI.organization.unselectOrganization>\n) =>\n useAppAsync(\n 'unselectOrganization',\n useIntlayerAuth().organization.unselectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.getProjects>\n) =>\n useAppAsync(\n 'getProjects',\n useIntlayerAuth().project.getProjects,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addProject>\n) =>\n useAppAsync('addProject', useIntlayerAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useUpdateProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProject>\n) =>\n useAppAsync('updateProject', useIntlayerAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.updateProjectMembers>\n) =>\n useAppAsync(\n 'updateProjectMembers',\n useIntlayerAuth().project.updateProjectMembers,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\nexport const useDeleteProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteProject>\n) =>\n useAppAsync('deleteProject', useIntlayerAuth().project.deleteProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useSelectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.selectProject>\n) =>\n useAppAsync('selectProject', useIntlayerAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUnselectProject = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.unselectProject>\n) =>\n useAppAsync('unselectProject', useIntlayerAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.addNewAccessKey>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.deleteAccessKey>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<typeof intlayerAPI.project.refreshAccessKey>\n) =>\n useAppAsync('refreshAccessKey', useIntlayerAuth().project.refreshAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionaries>\n) =>\n useAppAsync(\n 'getDictionaries',\n useIntlayerAuth().dictionary.getDictionaries,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionariesKeys = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionariesKeys>\n) =>\n useAppAsync(\n 'getDictionariesKeys',\n useIntlayerAuth().dictionary.getDictionariesKeys,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.getDictionary>\n) =>\n useAppAsync(\n 'getDictionary',\n useIntlayerAuth().dictionary.getDictionary,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\nexport const useAddDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.addDictionary>\n) =>\n useAppAsync('addDictionary', useIntlayerAuth().dictionary.addDictionary, {\n invalidateQueries: ['getDictionaries', 'getDictionariesKeys'],\n ...args,\n });\n\nexport const usePushDictionaries = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.pushDictionaries>\n) =>\n useAppAsync(\n 'pushDictionaries',\n useIntlayerAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.updateDictionary>\n) =>\n useAppAsync(\n 'updateDictionary',\n useIntlayerAuth().dictionary.updateDictionary,\n {\n invalidateQueries: ['getDictionaries', 'getDictionary'],\n ...args,\n }\n );\nexport const useDeleteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.dictionary.deleteDictionary>\n) =>\n useAppAsync(\n 'deleteDictionary',\n useIntlayerAuth().dictionary.deleteDictionary,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.getTags>\n) =>\n useAppAsync(\n 'getTags',\n useIntlayerAuth().tag.getTags,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\nexport const useAddTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.addTag>\n) =>\n useAppAsync('addTag', useIntlayerAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useUpdateTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.updateTag>\n) =>\n useAppAsync('updateTag', useIntlayerAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useDeleteTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.tag.deleteTag>\n) =>\n useAppAsync('deleteTag', useIntlayerAuth().tag.deleteTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\n/**\n * Stripe\n */\n\nexport const useGetSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.getSubscription>\n) =>\n useAppAsync(\n 'getSubscription',\n useIntlayerAuth().stripe.getSubscription,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useCancelSubscription = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.cancelSubscription>\n) =>\n useAppAsync(\n 'cancelSubscription',\n useIntlayerAuth().stripe.cancelSubscription,\n { invalidateQueries: ['getSession'], ...args },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\n/**\n * AI\n */\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclaration>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclaration,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationMetadata = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationMetadata>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerAuth().ai.auditContentDeclarationMetadata,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationField = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditContentDeclarationField>\n) =>\n useAppAsync(\n 'auditContentDeclarationField',\n useIntlayerAuth().ai.auditContentDeclarationField,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditTag = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.auditTag>\n) =>\n useAppAsync('auditTag', useIntlayerAuth().ai.auditTag, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAskDocQuestion = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.askDocQuestion>\n) => useAppAsync('askDocQuestion', useIntlayerAuth().ai.askDocQuestion, args);\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<typeof intlayerAPI.editor.writeDictionary>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerAuth().editor.writeDictionary,\n args\n );\n"],"names":["error"],"mappings":";;;;;;;;;AAaA,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAI,SAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAAA;AACM,gBAAA,KAAK,MAAM,YAAY;AAAA,eACxB,GAAG;AACV,gBAAQ,MAAM,CAAC;AAGP,gBAAA;AAAA,MAAA;AAKV,OAAC,KAAK,EACH,QAAQ,CAACA,WAAUA,MAAK,EACxB;AAAA,QAAQ,CAACA,WACR,MAAM;AAAA,UACJ,QACG,2BAAY,aAAa,eACtBA,OAAM,QACNA,OAAM,SAAS;AAAA,UACrB,aAAaA,OAAM,WAAW,gBAAgB;AAAA,UAC9C,SAAS;AAAA,QACV,CAAA;AAAA,MACH;AACF,cAAQ,UAAU,YAAY;AAAA,IAChC;AAAA,IACA,WAAW,CAAC,SAAS;AACnB,UAAI,KAAK;AACD,cAAA;AAAA,UACJ,OAAO,KAAK;AAAA,UACZ,aAAa,KAAK;AAAA,UAClB,SAAS;AAAA,QAAA,CACV;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CAAkC,CAC7C,SAEA;AAAA,EACE;AAAA,EACA,gBAAA,EAAkB,GAAG;AAAA,EACrB;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,gBAAgB;AAAA,EAAA;AAEpB;AAEW,MAAA,cAAc,CACzB,SAEA,YAAY,YAAY,kBAAkB,GAAG,UAAU,MAAM;AAAA,EAC3D,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,gBAAgB;AAClB,CAAC;AAEU,MAAA,oBAAoB,CAC/B,SACG,YAAY,kBAAkB,kBAAkB,GAAG,gBAAgB,IAAI;AAM/D,MAAA,qBAAqB,CAChC,SAEA;AAAA,EACE;AAAA,EACA,gBAAA,EAAkB,OAAO;AAAA,EACzB;AACF;"}
@@ -1,7 +1,7 @@
1
1
  import { Dictionary } from '@intlayer/core';
2
2
  import { useGetDictionaries } from './intlayerAPIHooks';
3
3
  type Args = Parameters<typeof useGetDictionaries>;
4
- export declare const useGetAllDictionaries: (args?: import('./useAsync').UseAsyncOptions<(filters?: GetDictionariesParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<GetDictionariesResult>> | undefined) => {
4
+ export declare const useGetAllDictionaries: (args?: import('./useAsync').UseAsyncOptions<(filters?: import('@intlayer/backend').GetDictionariesParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesResult>> | undefined) => {
5
5
  online: Record<string, Dictionary>;
6
6
  locale: import('@intlayer/editor-react').DictionaryContent;
7
7
  all: Record<string, Dictionary>;
@@ -1 +1 @@
1
- {"version":3,"file":"useGetAllDictionaries.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetAllDictionaries.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElD,eAAO,MAAM,qBAAqB,0DA8B64V,qBAAsB,oEAA4C,qBAAqB;;;;;CADrgW,CAAC"}
1
+ {"version":3,"file":"useGetAllDictionaries.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetAllDictionaries.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElD,eAAO,MAAM,qBAAqB,iEA8BmzgB,mBAAmB,kGAA0E,mBAAmB;;;;;CADp8gB,CAAC"}
@@ -6,80 +6,80 @@ type UseIntlayerAuthProps = {
6
6
  };
7
7
  export declare const useIntlayerAuth: (props?: UseIntlayerAuthProps) => {
8
8
  organization: {
9
- getOrganizations: (filters?: GetOrganizationsParams, otherOptions?: FetcherOptions) => Promise<GetOrganizationsResult>;
10
- getOrganization: (organizationId: GetOrganizationParam, otherOptions?: FetcherOptions) => Promise<GetOrganizationResult>;
11
- addOrganization: (organization: AddOrganizationBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationResult>;
12
- addOrganizationMember: (body: AddOrganizationMemberBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationMemberResult>;
13
- updateOrganization: (organization: UpdateOrganizationBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationResult>;
14
- updateOrganizationMembers: (body: UpdateOrganizationMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationMembersResult>;
15
- deleteOrganization: (otherOptions?: FetcherOptions) => Promise<DeleteOrganizationResult>;
16
- selectOrganization: (organizationId: SelectOrganizationParam, otherOptions?: FetcherOptions) => Promise<SelectOrganizationResult>;
17
- unselectOrganization: (otherOptions?: FetcherOptions) => Promise<UnselectOrganizationResult>;
9
+ getOrganizations: (filters?: import('@intlayer/backend').GetOrganizationsParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetOrganizationsResult>;
10
+ getOrganization: (organizationId: import('@intlayer/backend').GetOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetOrganizationResult>;
11
+ addOrganization: (organization: import('@intlayer/backend').AddOrganizationBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationResult>;
12
+ addOrganizationMember: (body: import('@intlayer/backend').AddOrganizationMemberBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationMemberResult>;
13
+ updateOrganization: (organization: import('@intlayer/backend').UpdateOrganizationBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationResult>;
14
+ updateOrganizationMembers: (body: import('@intlayer/backend').UpdateOrganizationMembersBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationMembersResult>;
15
+ deleteOrganization: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteOrganizationResult>;
16
+ selectOrganization: (organizationId: import('@intlayer/backend').SelectOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').SelectOrganizationResult>;
17
+ unselectOrganization: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UnselectOrganizationResult>;
18
18
  };
19
19
  project: {
20
- getProjects: (filters?: GetProjectsParams, otherOptions?: FetcherOptions) => Promise<GetProjectsResult>;
21
- addProject: (project: AddProjectBody, otherOptions?: FetcherOptions) => Promise<AddProjectResult>;
22
- updateProject: (project: UpdateProjectBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectResult>;
23
- updateProjectMembers: (body: UpdateProjectMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectMembersResult>;
24
- pushProjectConfiguration: (projectConfiguration: PushProjectConfigurationBody, otherOptions?: FetcherOptions) => Promise<PushProjectConfigurationResult>;
25
- deleteProject: (otherOptions?: FetcherOptions) => Promise<DeleteProjectResult>;
26
- selectProject: (projectId: SelectProjectParam, otherOptions?: FetcherOptions) => Promise<SelectProjectResult>;
27
- unselectProject: (otherOptions?: FetcherOptions) => Promise<UnselectProjectResult>;
28
- addNewAccessKey: (accessKey: AddNewAccessKeyBody, otherOptions?: FetcherOptions) => Promise<AddNewAccessKeyResponse>;
29
- deleteAccessKey: (clientId: DeleteAccessKeyBody, otherOptions?: FetcherOptions) => Promise<DeleteAccessKeyResponse>;
30
- refreshAccessKey: (clientId: RefreshAccessKeyBody, otherOptions?: FetcherOptions) => Promise<RefreshAccessKeyResponse>;
20
+ getProjects: (filters?: import('@intlayer/backend').GetProjectsParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetProjectsResult>;
21
+ addProject: (project: import('@intlayer/backend').AddProjectBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddProjectResult>;
22
+ updateProject: (project: import('@intlayer/backend').UpdateProjectBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectResult>;
23
+ updateProjectMembers: (body: import('@intlayer/backend').UpdateProjectMembersBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectMembersResult>;
24
+ pushProjectConfiguration: (projectConfiguration: import('@intlayer/backend').PushProjectConfigurationBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').PushProjectConfigurationResult>;
25
+ deleteProject: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteProjectResult>;
26
+ selectProject: (projectId: import('@intlayer/backend').SelectProjectParam["projectId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').SelectProjectResult>;
27
+ unselectProject: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UnselectProjectResult>;
28
+ addNewAccessKey: (accessKey: import('@intlayer/backend').AddNewAccessKeyBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddNewAccessKeyResponse>;
29
+ deleteAccessKey: (clientId: import('@intlayer/backend').DeleteAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteAccessKeyResponse>;
30
+ refreshAccessKey: (clientId: import('@intlayer/backend').RefreshAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').RefreshAccessKeyResponse>;
31
31
  };
32
32
  user: {
33
- createUser: (user: CreateUserBody, otherOptions?: FetcherOptions) => Promise<CreateUserResult>;
34
- getUsers: (filters?: GetUsersParams, otherOptions?: FetcherOptions) => Promise<GetUsersResult>;
35
- getUserById: (userId: GetUserByIdParams, otherOptions?: FetcherOptions) => Promise<GetUserByIdResult>;
36
- getUserByAccount: (providerAccountId: GetUserByAccountParams, provider: GetUserByAccountParams, otherOptions?: FetcherOptions) => Promise<GetUserByAccountResult>;
37
- getUserByEmail: (email: GetUserByEmailParams, otherOptions?: FetcherOptions) => Promise<GetUserByEmailResult>;
38
- updateUser: (user: UpdateUserBody, otherOptions?: FetcherOptions) => Promise<UpdateUserResult>;
39
- deleteUser: (userId: string, otherOptions?: FetcherOptions) => Promise<UpdateUserResult>;
33
+ createUser: (user: import('@intlayer/backend').CreateUserBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').CreateUserResult>;
34
+ getUsers: (filters?: import('@intlayer/backend').GetUsersParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUsersResult>;
35
+ getUserById: (userId: import('@intlayer/backend').GetUserByIdParams["userId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUserByIdResult>;
36
+ getUserByAccount: (providerAccountId: import('@intlayer/backend').GetUserByAccountParams["providerAccountId"], provider: import('@intlayer/backend').GetUserByAccountParams["provider"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUserByAccountResult>;
37
+ getUserByEmail: (email: import('@intlayer/backend').GetUserByEmailParams["email"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetUserByEmailResult>;
38
+ updateUser: (user: import('@intlayer/backend').UpdateUserBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>;
39
+ deleteUser: (userId: string, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>;
40
40
  };
41
41
  auth: {
42
- login: (user: LoginBody, otherOptions?: FetcherOptions) => Promise<LoginResult>;
43
- getLoginWithGitHubURL: (params: GithubLoginQueryParams) => string;
44
- getLoginWithGoogleURL: (params: GoogleLoginQueryParams) => string;
45
- register: (user: RegisterBody, query?: RegisterQuery, otherOptions?: FetcherOptions) => Promise<RegisterResult>;
42
+ login: (user: import('@intlayer/backend').LoginBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').LoginResult>;
43
+ getLoginWithGitHubURL: (params: import('@intlayer/backend').GithubLoginQueryParams) => string;
44
+ getLoginWithGoogleURL: (params: import('@intlayer/backend').GoogleLoginQueryParams) => string;
45
+ register: (user: import('@intlayer/backend').RegisterBody, query?: import('@intlayer/backend').RegisterQuery, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').RegisterResult>;
46
46
  logout: (otherOptions?: FetcherOptions) => Promise<void>;
47
- resetPassword: (params: ResetPasswordParams, otherOptions?: FetcherOptions) => Promise<ResetPasswordResult>;
48
- askResetPassword: (email: AskResetPasswordBody, otherOptions?: FetcherOptions) => Promise<AskResetPasswordResult>;
49
- checkIfUserHasPassword: (otherOptions?: FetcherOptions) => Promise<CheckIfUserHasPasswordResult>;
50
- verifyEmail: ({ userId, secret }: ValidEmailParams, otherOptions?: FetcherOptions) => Promise<ValidEmailResult>;
51
- getVerifyEmailStatusURL: (userId: string | UserAPI) => string;
52
- changePassword: (data: UpdatePasswordBody, otherOptions?: FetcherOptions) => Promise<UpdatePasswordResult>;
53
- createSession: (data: CreateSessionBody, otherOptions?: FetcherOptions) => Promise<CreateSessionResult>;
54
- getSession: (sessionToken?: GetSessionInformationQuery, otherOptions?: FetcherOptions) => Promise<GetSessionInformationResult>;
55
- getCSRFToken: (otherOptions?: FetcherOptions) => Promise<SetCSRFTokenResult>;
56
- getOAuth2AccessToken: (otherOptions?: FetcherOptions) => Promise<GetOAuth2TokenResult>;
47
+ resetPassword: (params: import('@intlayer/backend').ResetPasswordParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').ResetPasswordResult>;
48
+ askResetPassword: (email: import('@intlayer/backend').AskResetPasswordBody["email"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AskResetPasswordResult>;
49
+ checkIfUserHasPassword: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').CheckIfUserHasPasswordResult>;
50
+ verifyEmail: ({ userId, secret }: import('@intlayer/backend').ValidEmailParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').ValidEmailResult>;
51
+ getVerifyEmailStatusURL: (userId: string | import('@intlayer/backend').UserAPI["_id"]) => string;
52
+ changePassword: (data: import('@intlayer/backend').UpdatePasswordBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdatePasswordResult>;
53
+ createSession: (data: import('@intlayer/backend').CreateSessionBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').CreateSessionResult>;
54
+ getSession: (sessionToken?: import('@intlayer/backend').GetSessionInformationQuery["session_token"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetSessionInformationResult>;
55
+ getCSRFToken: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').SetCSRFTokenResult>;
56
+ getOAuth2AccessToken: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetOAuth2TokenResult>;
57
57
  };
58
58
  dictionary: {
59
- getDictionaries: (filters?: GetDictionariesParams, otherOptions?: FetcherOptions) => Promise<GetDictionariesResult>;
60
- getDictionariesKeys: (otherOptions?: FetcherOptions) => Promise<GetDictionariesKeysResult>;
61
- getDictionary: (dictionaryKey: GetDictionaryParams, version?: GetDictionaryQuery, otherOptions?: FetcherOptions) => Promise<GetDictionaryResult>;
62
- pushDictionaries: (dictionaries: PushDictionariesBody, otherOptions?: FetcherOptions) => Promise<PushDictionariesResult>;
63
- addDictionary: (dictionary: AddDictionaryBody, otherOptions?: FetcherOptions) => Promise<AddDictionaryResult>;
64
- updateDictionary: (dictionaryId: UpdateDictionaryParam, dictionary: UpdateDictionaryBody, otherOptions?: FetcherOptions) => Promise<UpdateDictionaryResult>;
65
- deleteDictionary: (id: DeleteDictionaryParam, otherOptions?: FetcherOptions) => Promise<DeleteDictionaryResult>;
59
+ getDictionaries: (filters?: import('@intlayer/backend').GetDictionariesParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesResult>;
60
+ getDictionariesKeys: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesKeysResult>;
61
+ getDictionary: (dictionaryKey: import('@intlayer/backend').GetDictionaryParams["dictionaryKey"], version?: import('@intlayer/backend').GetDictionaryQuery["version"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetDictionaryResult>;
62
+ pushDictionaries: (dictionaries: import('@intlayer/backend').PushDictionariesBody["dictionaries"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').PushDictionariesResult>;
63
+ addDictionary: (dictionary: import('@intlayer/backend').AddDictionaryBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddDictionaryResult>;
64
+ updateDictionary: (dictionaryId: import('@intlayer/backend').UpdateDictionaryParam["dictionaryId"], dictionary: import('@intlayer/backend').UpdateDictionaryBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateDictionaryResult>;
65
+ deleteDictionary: (id: import('@intlayer/backend').DeleteDictionaryParam["dictionaryId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteDictionaryResult>;
66
66
  };
67
67
  stripe: {
68
- getSubscription: (body?: GetCheckoutSessionBody, otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
69
- cancelSubscription: (otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
68
+ getSubscription: (body?: import('@intlayer/backend').GetCheckoutSessionBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>;
69
+ cancelSubscription: (otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>;
70
70
  };
71
71
  ai: {
72
- auditContentDeclaration: (body?: AuditContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationResult>;
73
- auditContentDeclarationField: (body?: AuditContentDeclarationFieldBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationFieldResult>;
74
- auditContentDeclarationMetadata: (body?: AuditContentDeclarationMetadataBody, otherOptions?: FetcherOptions) => Promise<AuditContentDeclarationMetadataResult>;
75
- auditTag: (body?: AuditTagBody, otherOptions?: FetcherOptions) => Promise<AuditTagResult>;
76
- askDocQuestion: (body?: AskDocQuestionBody, otherOptions?: FetcherOptions) => Promise<AskDocQuestionResult>;
72
+ auditContentDeclaration: (body?: import('@intlayer/backend').AuditContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationResult>;
73
+ auditContentDeclarationField: (body?: import('@intlayer/backend').AuditContentDeclarationFieldBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationFieldResult>;
74
+ auditContentDeclarationMetadata: (body?: import('@intlayer/backend').AuditContentDeclarationMetadataBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationMetadataResult>;
75
+ auditTag: (body?: import('@intlayer/backend').AuditTagBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AuditTagResult>;
76
+ askDocQuestion: (body?: import('@intlayer/backend').AskDocQuestionBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AskDocQuestionResult>;
77
77
  };
78
78
  tag: {
79
- getTags: (filters?: GetTagsParams, otherOptions?: FetcherOptions) => Promise<GetTagsResult>;
80
- addTag: (tag: AddTagBody, otherOptions?: FetcherOptions) => Promise<AddTagResult>;
81
- updateTag: (tagId: UpdateTagParams, tag: UpdateTagBody, otherOptions?: FetcherOptions) => Promise<UpdateTagResult>;
82
- deleteTag: (tagId: DeleteTagParams, otherOptions?: FetcherOptions) => Promise<DeleteTagResult>;
79
+ getTags: (filters?: import('@intlayer/backend').GetTagsParams, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').GetTagsResult>;
80
+ addTag: (tag: import('@intlayer/backend').AddTagBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').AddTagResult>;
81
+ updateTag: (tagId: import('@intlayer/backend').UpdateTagParams["tagId"], tag: import('@intlayer/backend').UpdateTagBody, otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').UpdateTagResult>;
82
+ deleteTag: (tagId: import('@intlayer/backend').DeleteTagParams["tagId"], otherOptions?: FetcherOptions) => Promise<import('@intlayer/backend').DeleteTagResult>;
83
83
  };
84
84
  editor: {
85
85
  getConfiguration: (otherOptions?: FetcherOptions) => Promise<GetConfigurationResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayerAPI.d.ts","sourceRoot":"","sources":["../../src/hooks/useIntlayerAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,KAAK,oBAAoB,GAAG;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qBAAqB,CAAC,EAAE,cAAc,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,oBAAoB;;kCAJlC,CAAC,EACzB,sBAAqB,cAAc,CAAC,6BAGjB,sBAAsB;0CACtB,oBAAoB,cAEvC,CAAD,6BACG,qBACU;wCAEF,mBAAe,cAAc,CAAC,6BAChC,qBACA;sCACmB,yBAGjB,cACR,CAAD,6BAA6B,2BAA2B;2CAKvD,sBACU,cACN,CAAD,6BAEG,wBACK;0CAEJ,6BACP,cACK,CAAC,6BAGC,+BAA+B;yCAA4C,CAAC,6BAA6B,wBAAwB;6CAA+C,uBAAwB,cAAc,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oCAAoC,CAAC,oCAAoC,mBAAmB;sCAAiE,mBAAmB,qDAAqD,CAAC,oCAAoC,mBAAmB;;;8BAA8E,CAAC,SAAS,mBAAmB,sCAAsC,CAAC,oCAAoC,mBAAmB;yCAAsE,CAAC,oCAAoC,mBAAmB;;;sCAAoF,CAAC,SAAS,mBAAmB,2CAA2C,CAAC,oCAAoC,mBAAmB;2CAA6E,CAAC,SAAS,mBAAmB,gDAAgD,CAAC,oCAAoC,mBAAmB;8CAAqF,CAAC,SAAS,mBAAmB,mDAAmD,CAAC,oCAAoC,mBAAmB;uBAAiE,CAAC,SAAS,mBAAmB,4BAA4B,CAAC,oCAAoC,mBAAmB;6BAAgD,CAAC,SAAS,mBAAmB,kCAAkC,CAAC,oCAAoC,mBAAmB;;;yBAAoE,CAAC,SAAS,mBAAmB,6BAA6B,CAAC,oCAAoC,mBAAmB;6BAA+C,mBAAmB,0BAA0B,CAAC,oCAAoC,mBAAmB;kCAAmD,mBAAmB,wCAAwC,mBAAmB,6BAA6B,CAAC,oCAAoC,mBAAmB;kCAAsD,mBAAmB,wCAAwC,CAAC,oCAAoC,mBAAmB;;;uCAAgF,CAAC,6BAA6B,sBAAsB;sCAAwC,2BAA4B,cAAc,CAAC;;CADxsT,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/design-system",
3
- "version": "4.1.5",
3
+ "version": "4.1.7",
4
4
  "private": false,
5
5
  "description": "Intlayer design system, including UI components used in the Intlayer editor, website, and visual editor/CMS.",
6
6
  "keywords": [
@@ -77,13 +77,13 @@
77
77
  "tailwind-merge": "^2.6.0",
78
78
  "zod": "^3.24.1",
79
79
  "zustand": "^4.5.6",
80
- "@intlayer/config": "4.1.5",
81
- "@intlayer/core": "4.1.5",
82
- "@intlayer/dictionaries-entry": "4.1.5",
83
- "@intlayer/editor-react": "4.1.5",
84
- "react-intlayer": "4.1.5",
85
- "@intlayer/editor": "4.1.5",
86
- "@intlayer/api": "4.1.5"
80
+ "@intlayer/config": "4.1.7",
81
+ "@intlayer/api": "4.1.7",
82
+ "@intlayer/core": "4.1.7",
83
+ "@intlayer/editor": "4.1.7",
84
+ "react-intlayer": "4.1.7",
85
+ "@intlayer/dictionaries-entry": "4.1.7",
86
+ "@intlayer/editor-react": "4.1.7"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@chromatic-com/storybook": "^3.2.3",
@@ -116,11 +116,11 @@
116
116
  "vite": "^6.0.11",
117
117
  "vite-plugin-dts": "^4.5.0",
118
118
  "vitest": "^2.1.8",
119
- "@intlayer/backend": "4.1.5",
120
- "@utils/ts-config": "1.0.4",
119
+ "@utils/eslint-config": "1.0.4",
121
120
  "@utils/ts-config-types": "1.0.4",
122
121
  "@utils/tsup-config": "1.0.4",
123
- "@utils/eslint-config": "1.0.4"
122
+ "@utils/ts-config": "1.0.4",
123
+ "@intlayer/backend": "4.1.7"
124
124
  },
125
125
  "peerDependencies": {
126
126
  "@monaco-editor/react": "^4.6.0",
@@ -131,14 +131,14 @@
131
131
  "react-dom": ">=16.0.0",
132
132
  "tailwind-merge": "^2.6.0",
133
133
  "zustand": "^4.5.6",
134
- "@intlayer/api": "4.1.5",
135
- "@intlayer/core": "4.1.5",
136
- "@intlayer/dictionaries-entry": "4.1.5",
137
- "@intlayer/editor": "4.1.5",
138
- "@intlayer/editor-react": "4.1.5",
139
- "intlayer": "4.1.5",
140
- "react-intlayer": "4.1.5",
141
- "@intlayer/config": "4.1.5"
134
+ "@intlayer/api": "4.1.7",
135
+ "@intlayer/config": "4.1.7",
136
+ "@intlayer/core": "4.1.7",
137
+ "@intlayer/dictionaries-entry": "4.1.7",
138
+ "@intlayer/editor": "4.1.7",
139
+ "@intlayer/editor-react": "4.1.7",
140
+ "intlayer": "4.1.7",
141
+ "react-intlayer": "4.1.7"
142
142
  },
143
143
  "scripts": {
144
144
  "build": "pnpm build:package && pnpm build:css",