@intlayer/design-system 5.8.1 → 6.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +34 -106
- package/dist/better-auth.CMQ3rA-I-7umXOENE.js.map +1 -1
- package/dist/better-auth.CMQ3rA-I-C2nBKRMa.cjs.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.cjs +3 -1
- package/dist/components/Breadcrumb/breadcrumb.content.cjs.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts +3 -0
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.mjs +3 -1
- package/dist/components/Breadcrumb/breadcrumb.content.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.cjs +3 -1
- package/dist/components/CopyButton/CopyButton.content.cjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.d.ts +3 -0
- package/dist/components/CopyButton/CopyButton.content.d.ts.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.mjs +3 -1
- package/dist/components/CopyButton/CopyButton.content.mjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +7 -3
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs +7 -3
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +83 -34
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +83 -34
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +13 -9
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +12 -8
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs +27 -13
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +27 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +27 -13
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs +9 -4
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs +9 -4
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +29 -25
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +27 -23
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +37 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +64 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +37 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs +25 -12
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +25 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs +25 -12
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +4 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +4 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +25 -12
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +25 -12
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +36 -31
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +36 -31
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +32 -28
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +32 -5
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +32 -28
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -5
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -5
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs +9 -4
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs +9 -4
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +4 -6
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +4 -6
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs +7 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs +7 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs +9 -6
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +9 -4
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs +9 -6
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +28 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +29 -2
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +28 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/DropDown/index.cjs +2 -2
- package/dist/components/DropDown/index.cjs.map +1 -1
- package/dist/components/DropDown/index.d.ts.map +1 -1
- package/dist/components/DropDown/index.mjs +2 -2
- package/dist/components/DropDown/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -5
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -5
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.cjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts +2 -2
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.cjs +5 -2
- package/dist/components/ExpandCollapse/expandCollapse.content.cjs.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.d.ts +3 -0
- package/dist/components/ExpandCollapse/expandCollapse.content.d.ts.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.mjs +5 -2
- package/dist/components/ExpandCollapse/expandCollapse.content.mjs.map +1 -1
- package/dist/components/Flags/Flag.cjs +2 -1
- package/dist/components/Flags/Flag.cjs.map +1 -1
- package/dist/components/Flags/Flag.d.ts.map +1 -1
- package/dist/components/Flags/Flag.mjs +2 -1
- package/dist/components/Flags/Flag.mjs.map +1 -1
- package/dist/components/IDE/Code.cjs +8 -8
- package/dist/components/IDE/Code.cjs.map +1 -1
- package/dist/components/IDE/Code.mjs +8 -8
- package/dist/components/IDE/Code.mjs.map +1 -1
- package/dist/components/IDE/CodeBlockClient.cjs +1 -1
- package/dist/components/IDE/CodeBlockClient.cjs.map +1 -1
- package/dist/components/IDE/CodeBlockClient.d.ts +1 -1
- package/dist/components/IDE/CodeBlockClient.d.ts.map +1 -1
- package/dist/components/IDE/CodeBlockClient.mjs +1 -1
- package/dist/components/IDE/CodeBlockClient.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +1 -3
- package/dist/components/IDE/CodeContext.cjs.map +1 -1
- package/dist/components/IDE/CodeContext.mjs +1 -3
- package/dist/components/IDE/CodeContext.mjs.map +1 -1
- package/dist/components/IDE/code.content.cjs +5 -2
- package/dist/components/IDE/code.content.cjs.map +1 -1
- package/dist/components/IDE/code.content.d.ts +5 -0
- package/dist/components/IDE/code.content.d.ts.map +1 -1
- package/dist/components/IDE/code.content.mjs +5 -2
- package/dist/components/IDE/code.content.mjs.map +1 -1
- package/dist/components/IDE/copyCode.content.cjs +5 -2
- package/dist/components/IDE/copyCode.content.cjs.map +1 -1
- package/dist/components/IDE/copyCode.content.d.ts +5 -0
- package/dist/components/IDE/copyCode.content.d.ts.map +1 -1
- package/dist/components/IDE/copyCode.content.mjs +5 -2
- package/dist/components/IDE/copyCode.content.mjs.map +1 -1
- package/dist/components/Input/Checkbox.cjs.map +1 -1
- package/dist/components/Input/Checkbox.d.ts +2 -2
- package/dist/components/Input/Checkbox.d.ts.map +1 -1
- package/dist/components/Input/Checkbox.mjs.map +1 -1
- package/dist/components/Loader/index.content.cjs +6 -1
- package/dist/components/Loader/index.content.cjs.map +1 -1
- package/dist/components/Loader/index.content.d.ts +33 -2
- package/dist/components/Loader/index.content.d.ts.map +1 -1
- package/dist/components/Loader/index.content.mjs +6 -1
- package/dist/components/Loader/index.content.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs +17 -8
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs +17 -8
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs +13 -6
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -0
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs +13 -6
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +2 -4
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs +2 -4
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -3
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -3
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs +2 -4
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs +2 -4
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -3
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -3
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -3
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -3
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/components/Table/table.content.cjs +3 -1
- package/dist/components/Table/table.content.cjs.map +1 -1
- package/dist/components/Table/table.content.d.ts +3 -0
- package/dist/components/Table/table.content.d.ts.map +1 -1
- package/dist/components/Table/table.content.mjs +3 -1
- package/dist/components/Table/table.content.mjs.map +1 -1
- package/dist/components/Tag/index.cjs +22 -88
- package/dist/components/Tag/index.cjs.map +1 -1
- package/dist/components/Tag/index.d.ts +5 -5
- package/dist/components/Tag/index.mjs +22 -88
- package/dist/components/Tag/index.mjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.cjs +20 -21
- package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.mjs +20 -21
- package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
- package/dist/hooks/auth.cjs +26 -11
- package/dist/hooks/auth.cjs.map +1 -1
- package/dist/hooks/auth.mjs +26 -11
- package/dist/hooks/auth.mjs.map +1 -1
- package/dist/hooks/index.cjs +65 -66
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -3
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +4 -8
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/reactQuery.cjs +648 -0
- package/dist/hooks/reactQuery.cjs.map +1 -0
- package/dist/hooks/reactQuery.d.ts +899 -0
- package/dist/hooks/reactQuery.d.ts.map +1 -0
- package/dist/hooks/reactQuery.mjs +646 -0
- package/dist/hooks/reactQuery.mjs.map +1 -0
- package/dist/hooks/useAuth/useOAuth2.cjs +13 -10
- package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.mjs +13 -10
- package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/hooks/useAuth/useSession.cjs +23 -26
- package/dist/hooks/useAuth/useSession.cjs.map +1 -1
- package/dist/hooks/useAuth/useSession.d.ts +4 -352
- package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
- package/dist/hooks/useAuth/useSession.mjs +23 -26
- package/dist/hooks/useAuth/useSession.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +2 -3
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +2 -3
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useUser/index.cjs +6 -9
- package/dist/hooks/useUser/index.cjs.map +1 -1
- package/dist/hooks/useUser/index.d.ts +2 -18
- package/dist/hooks/useUser/index.d.ts.map +1 -1
- package/dist/hooks/useUser/index.mjs +6 -9
- package/dist/hooks/useUser/index.mjs.map +1 -1
- package/dist/index-BCuMWKyy.js.map +1 -1
- package/dist/index-BYzBot7l.cjs.map +1 -1
- package/dist/providers/ReactQueryProvider.cjs +85 -0
- package/dist/providers/ReactQueryProvider.cjs.map +1 -0
- package/dist/providers/ReactQueryProvider.d.ts +13 -0
- package/dist/providers/ReactQueryProvider.d.ts.map +1 -0
- package/dist/providers/ReactQueryProvider.mjs +85 -0
- package/dist/providers/ReactQueryProvider.mjs.map +1 -0
- package/dist/providers/index.cjs +5 -0
- package/dist/{hooks/useAsync → providers}/index.cjs.map +1 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.mjs +5 -0
- package/dist/{hooks/useAsync → providers}/index.mjs.map +1 -1
- package/package.json +30 -20
- package/dist/hooks/intlayerAPIHooks.cjs +0 -542
- package/dist/hooks/intlayerAPIHooks.cjs.map +0 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +0 -968
- package/dist/hooks/intlayerAPIHooks.d.ts.map +0 -1
- package/dist/hooks/intlayerAPIHooks.mjs +0 -542
- package/dist/hooks/intlayerAPIHooks.mjs.map +0 -1
- package/dist/hooks/useAsync/index.cjs +0 -8
- package/dist/hooks/useAsync/index.d.ts +0 -3
- package/dist/hooks/useAsync/index.d.ts.map +0 -1
- package/dist/hooks/useAsync/index.mjs +0 -8
- package/dist/hooks/useAsync/useAsync.cjs +0 -244
- package/dist/hooks/useAsync/useAsync.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsync.d.ts +0 -73
- package/dist/hooks/useAsync/useAsync.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsync.mjs +0 -244
- package/dist/hooks/useAsync/useAsync.mjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +0 -150
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts +0 -52
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +0 -150
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.cjs +0 -10
- package/dist/hooks/useAsync/useAsyncWrapper.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.d.ts +0 -37
- package/dist/hooks/useAsync/useAsyncWrapper.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.mjs +0 -10
- package/dist/hooks/useAsync/useAsyncWrapper.mjs.map +0 -1
- package/dist/hooks/useGetAllDictionaries.cjs +0 -35
- package/dist/hooks/useGetAllDictionaries.cjs.map +0 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +0 -11
- package/dist/hooks/useGetAllDictionaries.d.ts.map +0 -1
- package/dist/hooks/useGetAllDictionaries.mjs +0 -35
- package/dist/hooks/useGetAllDictionaries.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerAPIHooks.d.ts","sourceRoot":"","sources":["../../src/hooks/intlayerAPIHooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,qBAAqB,CAAC;AAmJrE;;GAEG;AAEH,eAAO,MAAM,QAAQ,GACnB,OAAO,eAAe,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;qBAmhB/D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDA9gBJ,CAAC;AAEL,eAAO,MAAM,uBAAuB,GAClC,OAAO,eAAe,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;qBA2gBtE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDArgBL,CAAC;AAEJ,eAAO,MAAM,WAAW,GACtB,OAAO,eAAe,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;qBAkgB/D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDA7fJ,CAAC;AAEL,eAAO,MAAM,SAAS,GACpB,OAAO,eAAe,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,SAAS,CAAC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er/editor-react";
|
|
3
|
-
import "../components/Toaster/Toast.mjs";
|
|
4
|
-
import { useToast } from "../components/Toaster/useToast.mjs";
|
|
5
|
-
import "react/jsx-runtime";
|
|
6
|
-
import { useAsync } from "./useAsync/useAsync.mjs";
|
|
7
|
-
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
8
|
-
import "@intlayer/api";
|
|
9
|
-
import "@intlayer/config/built";
|
|
10
|
-
import "../better-auth.CMQ3rA-I-7umXOENE.js";
|
|
11
|
-
import "./useAsync/useAsyncStateStore.mjs";
|
|
12
|
-
import { useIntlayerAuth, useIntlayerOAuth } from "./useIntlayerAPI.mjs";
|
|
13
|
-
var define_process_env_default = {};
|
|
14
|
-
const formatErrorCode = (errorCode) => errorCode.split("_").join(" ");
|
|
15
|
-
const useErrorHandling = (options) => {
|
|
16
|
-
const { toast } = useToast();
|
|
17
|
-
return {
|
|
18
|
-
...options,
|
|
19
|
-
onError: (errorMessage) => {
|
|
20
|
-
let error;
|
|
21
|
-
try {
|
|
22
|
-
if (typeof errorMessage === "undefined") return;
|
|
23
|
-
error = JSON.parse(errorMessage);
|
|
24
|
-
} catch (e) {
|
|
25
|
-
error = errorMessage;
|
|
26
|
-
}
|
|
27
|
-
[error].flatMap((error2) => error2).forEach(
|
|
28
|
-
(error2) => toast({
|
|
29
|
-
title: formatErrorCode(
|
|
30
|
-
(define_process_env_default.NODE_ENV === "production" ? error2.title : error2.code) ?? "Error"
|
|
31
|
-
),
|
|
32
|
-
description: error2.message ?? errorMessage ?? "An error occurred",
|
|
33
|
-
variant: "error"
|
|
34
|
-
})
|
|
35
|
-
);
|
|
36
|
-
options.onError?.(errorMessage);
|
|
37
|
-
},
|
|
38
|
-
onSuccess: (data) => {
|
|
39
|
-
if (data?.error) {
|
|
40
|
-
toast({
|
|
41
|
-
title: formatErrorCode(
|
|
42
|
-
data.error.title ?? data.error.code ?? "Error"
|
|
43
|
-
),
|
|
44
|
-
description: data.error.message ?? data.error.code ?? "An error occurred",
|
|
45
|
-
variant: "error"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (data?.message)
|
|
49
|
-
toast({
|
|
50
|
-
title: data.message,
|
|
51
|
-
description: data.description,
|
|
52
|
-
variant: "success"
|
|
53
|
-
});
|
|
54
|
-
options.onSuccess?.(data);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
const useAuthEnable = (options, { requireUser, requireProject, requireOrganization } = {}) => {
|
|
59
|
-
const configuration = useConfiguration();
|
|
60
|
-
const { oAuth2AccessToken, session } = useAuth({
|
|
61
|
-
intlayerConfiguration: configuration
|
|
62
|
-
});
|
|
63
|
-
const isEnabledOption = options?.enable ?? true;
|
|
64
|
-
const user = session ? session.user : oAuth2AccessToken?.user;
|
|
65
|
-
const organization = session ? session.organization : oAuth2AccessToken?.organization;
|
|
66
|
-
const project = session ? session.project : oAuth2AccessToken?.project;
|
|
67
|
-
const isUserEnabled = requireUser ? Boolean(user) : true;
|
|
68
|
-
const isProjectEnabled = requireProject ? Boolean(project) : true;
|
|
69
|
-
const isOrganizationEnabled = requireOrganization ? Boolean(organization) : true;
|
|
70
|
-
const isEnabled = isEnabledOption && isUserEnabled && isProjectEnabled && isOrganizationEnabled;
|
|
71
|
-
return {
|
|
72
|
-
...options,
|
|
73
|
-
enable: isEnabled
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
const useAppAsync = (key, asyncFunction, options, authOptions) => {
|
|
77
|
-
const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);
|
|
78
|
-
const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);
|
|
79
|
-
return useAsync(key, asyncFunction, optionsWithErrorHandling);
|
|
80
|
-
};
|
|
81
|
-
const useEditorAsync = (key, asyncFunction, options) => {
|
|
82
|
-
const optionsWithErrorHandling = useErrorHandling(options ?? {});
|
|
83
|
-
return useAsync(key, asyncFunction, optionsWithErrorHandling);
|
|
84
|
-
};
|
|
85
|
-
const useLogin = (args) => useAppAsync("login", useIntlayerAuth().signInEmail, {
|
|
86
|
-
invalidateQueries: ["getSession"],
|
|
87
|
-
...args
|
|
88
|
-
});
|
|
89
|
-
const useGetVerifyEmailStatus = (args) => useAppAsync(
|
|
90
|
-
"getVerifyEmailStatus",
|
|
91
|
-
useIntlayerAuth().verifyEmailSession,
|
|
92
|
-
args
|
|
93
|
-
);
|
|
94
|
-
const useRegister = (args) => useAppAsync("register", useIntlayerAuth().signUpEmail, {
|
|
95
|
-
invalidateQueries: ["getSession"],
|
|
96
|
-
...args
|
|
97
|
-
});
|
|
98
|
-
const useLogout = (args) => useAppAsync("logout", useIntlayerAuth().signOut, {
|
|
99
|
-
...args
|
|
100
|
-
});
|
|
101
|
-
const useChangePassword = (args) => useAppAsync("changePassword", useIntlayerAuth().changePasswordSession, args);
|
|
102
|
-
const useAskResetPassword = (args) => useAppAsync(
|
|
103
|
-
"askResetPassword",
|
|
104
|
-
useIntlayerAuth().requestPasswordResetSession,
|
|
105
|
-
args
|
|
106
|
-
);
|
|
107
|
-
const useResetPassword = (args) => useAppAsync("resetPassword", useIntlayerAuth().resetPassword, args);
|
|
108
|
-
const useVerifyEmail = (args) => useAppAsync("verifyEmail", useIntlayerAuth().verifyEmailSession, args);
|
|
109
|
-
const useGetUserByAccount = (args) => useAppAsync("getUserByAccount", useIntlayerAuth().accountInfo, args);
|
|
110
|
-
const useGetUsers = (args) => useAppAsync(
|
|
111
|
-
"getUsers",
|
|
112
|
-
useIntlayerOAuth().user.getUsers,
|
|
113
|
-
{
|
|
114
|
-
cache: true,
|
|
115
|
-
store: true,
|
|
116
|
-
retryLimit: 3,
|
|
117
|
-
autoFetch: true,
|
|
118
|
-
revalidateTime: 5 * 60 * 1e3,
|
|
119
|
-
// 5 minutes
|
|
120
|
-
...args
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
requireUser: true
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
const useCreateUser = (args) => useAppAsync("createUser", useIntlayerAuth().updateUser, {
|
|
127
|
-
invalidateQueries: ["getUsers"],
|
|
128
|
-
...args
|
|
129
|
-
});
|
|
130
|
-
const useUpdateUser = (args) => useAppAsync("updateUser", useIntlayerOAuth().user.updateUser, {
|
|
131
|
-
invalidateQueries: ["getSession"],
|
|
132
|
-
...args
|
|
133
|
-
});
|
|
134
|
-
const useDeleteUser = (args) => useAppAsync("deleteUser", useIntlayerOAuth().user.deleteUser, {
|
|
135
|
-
invalidateQueries: ["getUsers"],
|
|
136
|
-
...args
|
|
137
|
-
});
|
|
138
|
-
const useGetOrganizations = (args) => useAppAsync(
|
|
139
|
-
"getOrganizations",
|
|
140
|
-
useIntlayerOAuth().organization.getOrganizations,
|
|
141
|
-
{
|
|
142
|
-
cache: true,
|
|
143
|
-
store: true,
|
|
144
|
-
retryLimit: 3,
|
|
145
|
-
autoFetch: true,
|
|
146
|
-
revalidation: true,
|
|
147
|
-
revalidateTime: 5 * 60 * 1e3,
|
|
148
|
-
// 5 minutes
|
|
149
|
-
...args
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
requireUser: true
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
const useAddOrganization = (args) => useAppAsync(
|
|
156
|
-
"addOrganization",
|
|
157
|
-
useIntlayerOAuth().organization.addOrganization,
|
|
158
|
-
{
|
|
159
|
-
invalidateQueries: ["getOrganizations"],
|
|
160
|
-
...args
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
const useUpdateOrganization = (args) => useAppAsync(
|
|
164
|
-
"updateOrganization",
|
|
165
|
-
useIntlayerOAuth().organization.updateOrganization,
|
|
166
|
-
{
|
|
167
|
-
invalidateQueries: ["getSession"],
|
|
168
|
-
...args
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
const useUpdateOrganizationMembers = (args) => useAppAsync(
|
|
172
|
-
"updateOrganizationMembers",
|
|
173
|
-
useIntlayerOAuth().organization.updateOrganizationMembers,
|
|
174
|
-
{
|
|
175
|
-
invalidateQueries: ["getOrganizations", "getSession"],
|
|
176
|
-
...args
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
const useAddOrganizationMember = (args) => useAppAsync(
|
|
180
|
-
"addOrganizationMember",
|
|
181
|
-
useIntlayerOAuth().organization.addOrganizationMember,
|
|
182
|
-
{
|
|
183
|
-
invalidateQueries: ["getOrganizations", "getSession"],
|
|
184
|
-
...args
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
const useDeleteOrganization = (args) => useAppAsync(
|
|
188
|
-
"deleteOrganization",
|
|
189
|
-
useIntlayerOAuth().organization.deleteOrganization,
|
|
190
|
-
{
|
|
191
|
-
invalidateQueries: ["getOrganizations", "getSession"],
|
|
192
|
-
...args
|
|
193
|
-
}
|
|
194
|
-
);
|
|
195
|
-
const useSelectOrganization = (args) => useAppAsync(
|
|
196
|
-
"selectOrganization",
|
|
197
|
-
useIntlayerOAuth().organization.selectOrganization,
|
|
198
|
-
{
|
|
199
|
-
invalidateQueries: ["getSession"],
|
|
200
|
-
...args
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
const useUnselectOrganization = (args) => useAppAsync(
|
|
204
|
-
"unselectOrganization",
|
|
205
|
-
useIntlayerOAuth().organization.unselectOrganization,
|
|
206
|
-
{
|
|
207
|
-
invalidateQueries: ["getSession"],
|
|
208
|
-
...args
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
const useGetProjects = (args) => useAppAsync(
|
|
212
|
-
"getProjects",
|
|
213
|
-
useIntlayerOAuth().project.getProjects,
|
|
214
|
-
{
|
|
215
|
-
cache: true,
|
|
216
|
-
store: true,
|
|
217
|
-
retryLimit: 3,
|
|
218
|
-
autoFetch: true,
|
|
219
|
-
revalidation: true,
|
|
220
|
-
revalidateTime: 5 * 60 * 1e3,
|
|
221
|
-
// 5 minutes
|
|
222
|
-
...args
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
requireUser: true,
|
|
226
|
-
requireOrganization: true
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
const useAddProject = (args) => useAppAsync("addProject", useIntlayerOAuth().project.addProject, {
|
|
230
|
-
invalidateQueries: ["getProjects"],
|
|
231
|
-
...args
|
|
232
|
-
});
|
|
233
|
-
const useUpdateProject = (args) => useAppAsync("updateProject", useIntlayerOAuth().project.updateProject, {
|
|
234
|
-
invalidateQueries: ["getSession"],
|
|
235
|
-
...args
|
|
236
|
-
});
|
|
237
|
-
const useUpdateProjectMembers = (args) => useAppAsync(
|
|
238
|
-
"updateProjectMembers",
|
|
239
|
-
useIntlayerOAuth().project.updateProjectMembers,
|
|
240
|
-
{
|
|
241
|
-
invalidateQueries: ["getSession"],
|
|
242
|
-
...args
|
|
243
|
-
}
|
|
244
|
-
);
|
|
245
|
-
const useDeleteProject = (args) => useAppAsync("deleteProject", useIntlayerOAuth().project.deleteProject, {
|
|
246
|
-
invalidateQueries: ["getProjects", "getSession"],
|
|
247
|
-
...args
|
|
248
|
-
});
|
|
249
|
-
const useSelectProject = (args) => useAppAsync("selectProject", useIntlayerOAuth().project.selectProject, {
|
|
250
|
-
invalidateQueries: ["getSession"],
|
|
251
|
-
...args
|
|
252
|
-
});
|
|
253
|
-
const useUnselectProject = (args) => useAppAsync("unselectProject", useIntlayerOAuth().project.unselectProject, {
|
|
254
|
-
invalidateQueries: ["getSession"],
|
|
255
|
-
...args
|
|
256
|
-
});
|
|
257
|
-
const useAddNewAccessKey = (args) => useAppAsync("addNewAccessKey", useIntlayerOAuth().project.addNewAccessKey, {
|
|
258
|
-
invalidateQueries: ["getSession"],
|
|
259
|
-
...args
|
|
260
|
-
});
|
|
261
|
-
const useDeleteAccessKey = (args) => useAppAsync("deleteAccessKey", useIntlayerOAuth().project.deleteAccessKey, {
|
|
262
|
-
invalidateQueries: ["getSession"],
|
|
263
|
-
...args
|
|
264
|
-
});
|
|
265
|
-
const useRefreshAccessKey = (args) => useAppAsync("refreshAccessKey", useIntlayerOAuth().project.refreshAccessKey, {
|
|
266
|
-
invalidateQueries: ["getSession"],
|
|
267
|
-
...args
|
|
268
|
-
});
|
|
269
|
-
const useGetDictionaries = (args) => useAppAsync(
|
|
270
|
-
"getDictionaries",
|
|
271
|
-
useIntlayerOAuth().dictionary.getDictionaries,
|
|
272
|
-
{
|
|
273
|
-
cache: true,
|
|
274
|
-
store: true,
|
|
275
|
-
retryLimit: 3,
|
|
276
|
-
autoFetch: true,
|
|
277
|
-
revalidation: true,
|
|
278
|
-
revalidateTime: 5 * 60 * 1e3,
|
|
279
|
-
// 5 minutes
|
|
280
|
-
...args
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
requireUser: true,
|
|
284
|
-
requireOrganization: true,
|
|
285
|
-
requireProject: true
|
|
286
|
-
}
|
|
287
|
-
);
|
|
288
|
-
const useGetDictionariesKeys = (args) => useAppAsync(
|
|
289
|
-
"getDictionariesKeys",
|
|
290
|
-
useIntlayerOAuth().dictionary.getDictionariesKeys,
|
|
291
|
-
{
|
|
292
|
-
cache: true,
|
|
293
|
-
store: true,
|
|
294
|
-
retryLimit: 3,
|
|
295
|
-
autoFetch: true,
|
|
296
|
-
revalidation: true,
|
|
297
|
-
revalidateTime: 5 * 60 * 1e3,
|
|
298
|
-
// 5 minutes
|
|
299
|
-
...args
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
requireUser: true,
|
|
303
|
-
requireOrganization: true,
|
|
304
|
-
requireProject: true
|
|
305
|
-
}
|
|
306
|
-
);
|
|
307
|
-
const useGetDictionary = (args) => useAppAsync(
|
|
308
|
-
"getDictionary",
|
|
309
|
-
useIntlayerOAuth().dictionary.getDictionary,
|
|
310
|
-
{
|
|
311
|
-
cache: true,
|
|
312
|
-
store: true,
|
|
313
|
-
retryLimit: 3,
|
|
314
|
-
revalidation: true,
|
|
315
|
-
revalidateTime: 5 * 60 * 1e3,
|
|
316
|
-
// 5 minutes
|
|
317
|
-
...args
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
requireUser: true,
|
|
321
|
-
requireOrganization: true,
|
|
322
|
-
requireProject: true
|
|
323
|
-
}
|
|
324
|
-
);
|
|
325
|
-
const useAddDictionary = (args) => useAppAsync("addDictionary", useIntlayerOAuth().dictionary.addDictionary, {
|
|
326
|
-
invalidateQueries: ["getDictionaries", "getDictionariesKeys"],
|
|
327
|
-
...args
|
|
328
|
-
});
|
|
329
|
-
const usePushDictionaries = (args) => useAppAsync(
|
|
330
|
-
"pushDictionaries",
|
|
331
|
-
useIntlayerOAuth().dictionary.pushDictionaries,
|
|
332
|
-
{
|
|
333
|
-
invalidateQueries: [
|
|
334
|
-
"getDictionaries",
|
|
335
|
-
"getDictionary",
|
|
336
|
-
"getDictionariesKeys"
|
|
337
|
-
],
|
|
338
|
-
...args
|
|
339
|
-
}
|
|
340
|
-
);
|
|
341
|
-
const useUpdateDictionary = (args) => useAppAsync(
|
|
342
|
-
"updateDictionary",
|
|
343
|
-
useIntlayerOAuth().dictionary.updateDictionary,
|
|
344
|
-
{
|
|
345
|
-
invalidateQueries: ["getDictionaries", "getDictionary"],
|
|
346
|
-
...args
|
|
347
|
-
}
|
|
348
|
-
);
|
|
349
|
-
const useDeleteDictionary = (args) => useAppAsync(
|
|
350
|
-
"deleteDictionary",
|
|
351
|
-
useIntlayerOAuth().dictionary.deleteDictionary,
|
|
352
|
-
{
|
|
353
|
-
invalidateQueries: [
|
|
354
|
-
"getDictionaries",
|
|
355
|
-
"getDictionary",
|
|
356
|
-
"getDictionariesKeys"
|
|
357
|
-
],
|
|
358
|
-
...args
|
|
359
|
-
}
|
|
360
|
-
);
|
|
361
|
-
const useGetTags = (args) => useAppAsync(
|
|
362
|
-
"getTags",
|
|
363
|
-
useIntlayerOAuth().tag.getTags,
|
|
364
|
-
{
|
|
365
|
-
cache: true,
|
|
366
|
-
store: true,
|
|
367
|
-
retryLimit: 3,
|
|
368
|
-
autoFetch: true,
|
|
369
|
-
revalidation: true,
|
|
370
|
-
revalidateTime: 5 * 60 * 1e3,
|
|
371
|
-
// 5 minutes
|
|
372
|
-
...args
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
requireUser: true,
|
|
376
|
-
requireOrganization: true
|
|
377
|
-
}
|
|
378
|
-
);
|
|
379
|
-
const useAddTag = (args) => useAppAsync("addTag", useIntlayerOAuth().tag.addTag, {
|
|
380
|
-
invalidateQueries: ["getTags"],
|
|
381
|
-
...args
|
|
382
|
-
});
|
|
383
|
-
const useUpdateTag = (args) => useAppAsync("updateTag", useIntlayerOAuth().tag.updateTag, {
|
|
384
|
-
invalidateQueries: ["getTags"],
|
|
385
|
-
...args
|
|
386
|
-
});
|
|
387
|
-
const useDeleteTag = (args) => useAppAsync("deleteTag", useIntlayerOAuth().tag.deleteTag, {
|
|
388
|
-
invalidateQueries: ["getTags"],
|
|
389
|
-
...args
|
|
390
|
-
});
|
|
391
|
-
const useGetPricing = (args) => useAppAsync("getPricing", useIntlayerOAuth().stripe.getPricing, {
|
|
392
|
-
store: true,
|
|
393
|
-
cache: true,
|
|
394
|
-
...args
|
|
395
|
-
});
|
|
396
|
-
const useGetSubscription = (args) => useAppAsync(
|
|
397
|
-
"getSubscription",
|
|
398
|
-
useIntlayerOAuth().stripe.getSubscription,
|
|
399
|
-
args,
|
|
400
|
-
{
|
|
401
|
-
requireUser: true,
|
|
402
|
-
requireOrganization: true
|
|
403
|
-
}
|
|
404
|
-
);
|
|
405
|
-
const useCancelSubscription = (args) => useAppAsync(
|
|
406
|
-
"cancelSubscription",
|
|
407
|
-
useIntlayerOAuth().stripe.cancelSubscription,
|
|
408
|
-
{ invalidateQueries: ["getSession"], ...args },
|
|
409
|
-
{
|
|
410
|
-
requireUser: true,
|
|
411
|
-
requireOrganization: true
|
|
412
|
-
}
|
|
413
|
-
);
|
|
414
|
-
const useTranslateJSONDeclaration = (args) => useAppAsync("translateJSON", useIntlayerOAuth().ai.translateJSON, args, {
|
|
415
|
-
requireUser: true,
|
|
416
|
-
requireOrganization: true,
|
|
417
|
-
requireProject: true
|
|
418
|
-
});
|
|
419
|
-
const useAuditContentDeclaration = (args) => useAppAsync(
|
|
420
|
-
"auditContentDeclaration",
|
|
421
|
-
useIntlayerOAuth().ai.auditContentDeclaration,
|
|
422
|
-
args,
|
|
423
|
-
{
|
|
424
|
-
requireUser: true,
|
|
425
|
-
requireOrganization: true,
|
|
426
|
-
requireProject: true
|
|
427
|
-
}
|
|
428
|
-
);
|
|
429
|
-
const useAuditContentDeclarationMetadata = (args) => useAppAsync(
|
|
430
|
-
"auditContentDeclaration",
|
|
431
|
-
useIntlayerOAuth().ai.auditContentDeclarationMetadata,
|
|
432
|
-
args,
|
|
433
|
-
{
|
|
434
|
-
requireUser: true,
|
|
435
|
-
requireOrganization: true,
|
|
436
|
-
requireProject: true
|
|
437
|
-
}
|
|
438
|
-
);
|
|
439
|
-
const useAuditContentDeclarationField = (args) => useAppAsync(
|
|
440
|
-
"auditContentDeclarationField",
|
|
441
|
-
useIntlayerOAuth().ai.auditContentDeclarationField,
|
|
442
|
-
args,
|
|
443
|
-
{
|
|
444
|
-
requireUser: true,
|
|
445
|
-
requireOrganization: true,
|
|
446
|
-
requireProject: true
|
|
447
|
-
}
|
|
448
|
-
);
|
|
449
|
-
const useAuditTag = (args) => useAppAsync("auditTag", useIntlayerOAuth().ai.auditTag, args, {
|
|
450
|
-
requireUser: true,
|
|
451
|
-
requireOrganization: true,
|
|
452
|
-
requireProject: true
|
|
453
|
-
});
|
|
454
|
-
const useAskDocQuestion = (args) => useAppAsync("askDocQuestion", useIntlayerOAuth().ai.askDocQuestion, args);
|
|
455
|
-
const useAutocomplete = (args) => useAppAsync("autocomplete", useIntlayerOAuth().ai.autocomplete, args);
|
|
456
|
-
const useSearchDoc = (args) => useAppAsync("searchDoc", useIntlayerOAuth().search.searchDoc, args);
|
|
457
|
-
const useSubscribeToNewsletter = (args) => useAppAsync(
|
|
458
|
-
"subscribeToNewsletter",
|
|
459
|
-
useIntlayerOAuth().newsletter.subscribeToNewsletter,
|
|
460
|
-
args
|
|
461
|
-
);
|
|
462
|
-
const useUnsubscribeFromNewsletter = (args) => useAppAsync(
|
|
463
|
-
"unsubscribeFromNewsletter",
|
|
464
|
-
useIntlayerOAuth().newsletter.unsubscribeFromNewsletter,
|
|
465
|
-
args
|
|
466
|
-
);
|
|
467
|
-
const useGetNewsletterStatus = (args) => useAppAsync(
|
|
468
|
-
"getNewsletterStatus",
|
|
469
|
-
useIntlayerOAuth().newsletter.getNewsletterStatus,
|
|
470
|
-
args
|
|
471
|
-
);
|
|
472
|
-
const useWriteDictionary = (args) => useEditorAsync(
|
|
473
|
-
"writeDictionary",
|
|
474
|
-
useIntlayerOAuth().editor.writeDictionary,
|
|
475
|
-
args
|
|
476
|
-
);
|
|
477
|
-
const useGetEditorDictionaries = (args) => useEditorAsync("getDictionaries", useIntlayerOAuth().editor.getDictionaries, {
|
|
478
|
-
store: true,
|
|
479
|
-
cache: true,
|
|
480
|
-
...args
|
|
481
|
-
});
|
|
482
|
-
export {
|
|
483
|
-
useAddDictionary,
|
|
484
|
-
useAddNewAccessKey,
|
|
485
|
-
useAddOrganization,
|
|
486
|
-
useAddOrganizationMember,
|
|
487
|
-
useAddProject,
|
|
488
|
-
useAddTag,
|
|
489
|
-
useAskDocQuestion,
|
|
490
|
-
useAskResetPassword,
|
|
491
|
-
useAuditContentDeclaration,
|
|
492
|
-
useAuditContentDeclarationField,
|
|
493
|
-
useAuditContentDeclarationMetadata,
|
|
494
|
-
useAuditTag,
|
|
495
|
-
useAutocomplete,
|
|
496
|
-
useCancelSubscription,
|
|
497
|
-
useChangePassword,
|
|
498
|
-
useCreateUser,
|
|
499
|
-
useDeleteAccessKey,
|
|
500
|
-
useDeleteDictionary,
|
|
501
|
-
useDeleteOrganization,
|
|
502
|
-
useDeleteProject,
|
|
503
|
-
useDeleteTag,
|
|
504
|
-
useDeleteUser,
|
|
505
|
-
useGetDictionaries,
|
|
506
|
-
useGetDictionariesKeys,
|
|
507
|
-
useGetDictionary,
|
|
508
|
-
useGetEditorDictionaries,
|
|
509
|
-
useGetNewsletterStatus,
|
|
510
|
-
useGetOrganizations,
|
|
511
|
-
useGetPricing,
|
|
512
|
-
useGetProjects,
|
|
513
|
-
useGetSubscription,
|
|
514
|
-
useGetTags,
|
|
515
|
-
useGetUserByAccount,
|
|
516
|
-
useGetUsers,
|
|
517
|
-
useGetVerifyEmailStatus,
|
|
518
|
-
useLogin,
|
|
519
|
-
useLogout,
|
|
520
|
-
usePushDictionaries,
|
|
521
|
-
useRefreshAccessKey,
|
|
522
|
-
useRegister,
|
|
523
|
-
useResetPassword,
|
|
524
|
-
useSearchDoc,
|
|
525
|
-
useSelectOrganization,
|
|
526
|
-
useSelectProject,
|
|
527
|
-
useSubscribeToNewsletter,
|
|
528
|
-
useTranslateJSONDeclaration,
|
|
529
|
-
useUnselectOrganization,
|
|
530
|
-
useUnselectProject,
|
|
531
|
-
useUnsubscribeFromNewsletter,
|
|
532
|
-
useUpdateDictionary,
|
|
533
|
-
useUpdateOrganization,
|
|
534
|
-
useUpdateOrganizationMembers,
|
|
535
|
-
useUpdateProject,
|
|
536
|
-
useUpdateProjectMembers,
|
|
537
|
-
useUpdateTag,
|
|
538
|
-
useUpdateUser,
|
|
539
|
-
useVerifyEmail,
|
|
540
|
-
useWriteDictionary
|
|
541
|
-
};
|
|
542
|
-
//# sourceMappingURL=intlayerAPIHooks.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerAPIHooks.mjs","sources":["../../src/hooks/intlayerAPIHooks.ts"],"sourcesContent":["'use client';\n\nimport type { IntlayerAPI } from '@intlayer/api';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useToast } from '../components/Toaster';\nimport { getAuthAPI } from './auth';\nimport { type UseAsyncOptions, useAsync } from './useAsync/useAsync';\nimport { useAuth } from './useAuth';\nimport { useIntlayerAuth, useIntlayerOAuth } from './useIntlayerAPI';\n\nconst formatErrorCode = (errorCode: string) => errorCode.split('_').join(' ');\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 if (typeof errorMessage === 'undefined') return;\n\n error = JSON.parse(errorMessage);\n } catch (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: formatErrorCode(\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error'\n ),\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data?.error) {\n toast({\n title: formatErrorCode(\n data.error.title ?? data.error.code ?? 'Error'\n ),\n description:\n data.error.message ?? data.error.code ?? 'An error occurred',\n variant: 'error',\n });\n }\n\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 { 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 isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled;\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<ReturnType<typeof getAuthAPI>['signInEmail']>\n) =>\n useAppAsync('login', useIntlayerAuth().signInEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useGetVerifyEmailStatus = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['verifyEmailSession']>\n) =>\n useAppAsync(\n 'getVerifyEmailStatus',\n useIntlayerAuth().verifyEmailSession,\n args\n );\n\nexport const useRegister = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signUpEmail']>\n) =>\n useAppAsync('register', useIntlayerAuth().signUpEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useLogout = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signOut']>\n) =>\n useAppAsync('logout', useIntlayerAuth().signOut, {\n ...args,\n });\n\nexport const useChangePassword = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['changePasswordSession']>\n) =>\n useAppAsync('changePassword', useIntlayerAuth().changePasswordSession, args);\n\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<\n ReturnType<typeof getAuthAPI>['requestPasswordResetSession']\n >\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().requestPasswordResetSession,\n args\n );\n\nexport const useResetPassword = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['resetPassword']>\n) => useAppAsync('resetPassword', useIntlayerAuth().resetPassword, args);\n\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['verifyEmailSession']>\n) => useAppAsync('verifyEmail', useIntlayerAuth().verifyEmailSession, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['accountInfo']>\n) => useAppAsync('getUserByAccount', useIntlayerAuth().accountInfo, args);\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n args?: UseAsyncOptions<IntlayerAPI['user']['getUsers']>\n) =>\n useAppAsync(\n 'getUsers',\n useIntlayerOAuth().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 );\n\nexport const useCreateUser = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['updateUser']>\n) =>\n useAppAsync('createUser', useIntlayerAuth().updateUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\nexport const useUpdateUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['updateUser']>\n) =>\n useAppAsync('updateUser', useIntlayerOAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useDeleteUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['deleteUser']>\n) =>\n useAppAsync('deleteUser', useIntlayerOAuth().user.deleteUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['getOrganizations']>\n) =>\n useAppAsync(\n 'getOrganizations',\n useIntlayerOAuth().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<IntlayerAPI['organization']['addOrganization']>\n) =>\n useAppAsync(\n 'addOrganization',\n useIntlayerOAuth().organization.addOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\n\nexport const useUpdateOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['updateOrganization']>\n) =>\n useAppAsync(\n 'updateOrganization',\n useIntlayerOAuth().organization.updateOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useUpdateOrganizationMembers = (\n args?: UseAsyncOptions<\n IntlayerAPI['organization']['updateOrganizationMembers']\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerOAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['addOrganizationMember']>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerOAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['deleteOrganization']>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerOAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['selectOrganization']>\n) =>\n useAppAsync(\n 'selectOrganization',\n useIntlayerOAuth().organization.selectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useUnselectOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['unselectOrganization']>\n) =>\n useAppAsync(\n 'unselectOrganization',\n useIntlayerOAuth().organization.unselectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n args?: UseAsyncOptions<IntlayerAPI['project']['getProjects']>\n) =>\n useAppAsync(\n 'getProjects',\n useIntlayerOAuth().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 );\n\nexport const useAddProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addProject']>\n) =>\n useAppAsync('addProject', useIntlayerOAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\n\nexport const useUpdateProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProject']>\n) =>\n useAppAsync('updateProject', useIntlayerOAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProjectMembers']>\n) =>\n useAppAsync(\n 'updateProjectMembers',\n useIntlayerOAuth().project.updateProjectMembers,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useDeleteProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteProject']>\n) =>\n useAppAsync('deleteProject', useIntlayerOAuth().project.deleteProject, {\n invalidateQueries: ['getProjects', 'getSession'],\n ...args,\n });\n\nexport const useSelectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['selectProject']>\n) =>\n useAppAsync('selectProject', useIntlayerOAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useUnselectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['unselectProject']>\n) =>\n useAppAsync('unselectProject', useIntlayerOAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addNewAccessKey']>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerOAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteAccessKey']>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerOAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['refreshAccessKey']>\n) =>\n useAppAsync('refreshAccessKey', useIntlayerOAuth().project.refreshAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['getDictionaries']>\n) =>\n useAppAsync(\n 'getDictionaries',\n useIntlayerOAuth().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<IntlayerAPI['dictionary']['getDictionariesKeys']>\n) =>\n useAppAsync(\n 'getDictionariesKeys',\n useIntlayerOAuth().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<IntlayerAPI['dictionary']['getDictionary']>\n) =>\n useAppAsync(\n 'getDictionary',\n useIntlayerOAuth().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 );\n\nexport const useAddDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['addDictionary']>\n) =>\n useAppAsync('addDictionary', useIntlayerOAuth().dictionary.addDictionary, {\n invalidateQueries: ['getDictionaries', 'getDictionariesKeys'],\n ...args,\n });\n\nexport const usePushDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['pushDictionaries']>\n) =>\n useAppAsync(\n 'pushDictionaries',\n useIntlayerOAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['updateDictionary']>\n) =>\n useAppAsync(\n 'updateDictionary',\n useIntlayerOAuth().dictionary.updateDictionary,\n {\n invalidateQueries: ['getDictionaries', 'getDictionary'],\n ...args,\n }\n );\n\nexport const useDeleteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['deleteDictionary']>\n) =>\n useAppAsync(\n 'deleteDictionary',\n useIntlayerOAuth().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<IntlayerAPI['tag']['getTags']>\n) =>\n useAppAsync(\n 'getTags',\n useIntlayerOAuth().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 );\n\nexport const useAddTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['addTag']>\n) =>\n useAppAsync('addTag', useIntlayerOAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\nexport const useUpdateTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['updateTag']>\n) =>\n useAppAsync('updateTag', useIntlayerOAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\nexport const useDeleteTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['deleteTag']>\n) =>\n useAppAsync('deleteTag', useIntlayerOAuth().tag.deleteTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\n/**\n * Stripe\n */\n\nexport const useGetPricing = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['getPricing']>\n) =>\n useAppAsync('getPricing', useIntlayerOAuth().stripe.getPricing, {\n store: true,\n cache: true,\n ...args,\n });\n\nexport const useGetSubscription = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['getSubscription']>\n) =>\n useAppAsync(\n 'getSubscription',\n useIntlayerOAuth().stripe.getSubscription,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useCancelSubscription = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['cancelSubscription']>\n) =>\n useAppAsync(\n 'cancelSubscription',\n useIntlayerOAuth().stripe.cancelSubscription,\n { invalidateQueries: ['getSession'], ...args },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\n/**\n * AI\n */\n\nexport const useTranslateJSONDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['translateJSON']>\n) =>\n useAppAsync('translateJSON', useIntlayerOAuth().ai.translateJSON, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclaration']>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerOAuth().ai.auditContentDeclaration,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationMetadata = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclarationMetadata']>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerOAuth().ai.auditContentDeclarationMetadata,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationField = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclarationField']>\n) =>\n useAppAsync(\n 'auditContentDeclarationField',\n useIntlayerOAuth().ai.auditContentDeclarationField,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditTag = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditTag']>\n) =>\n useAppAsync('auditTag', useIntlayerOAuth().ai.auditTag, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAskDocQuestion = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['askDocQuestion']>\n) => useAppAsync('askDocQuestion', useIntlayerOAuth().ai.askDocQuestion, args);\n\nexport const useAutocomplete = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['autocomplete']>\n) => useAppAsync('autocomplete', useIntlayerOAuth().ai.autocomplete, args);\n\n/**\n * Search\n */\n\nexport const useSearchDoc = (\n args?: UseAsyncOptions<IntlayerAPI['search']['searchDoc']>\n) => useAppAsync('searchDoc', useIntlayerOAuth().search.searchDoc, args);\n\n/**\n * Newsletter\n */\n\nexport const useSubscribeToNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['subscribeToNewsletter']>\n) =>\n useAppAsync(\n 'subscribeToNewsletter',\n useIntlayerOAuth().newsletter.subscribeToNewsletter,\n args\n );\n\nexport const useUnsubscribeFromNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['unsubscribeFromNewsletter']>\n) =>\n useAppAsync(\n 'unsubscribeFromNewsletter',\n useIntlayerOAuth().newsletter.unsubscribeFromNewsletter,\n args\n );\n\nexport const useGetNewsletterStatus = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['getNewsletterStatus']>\n) =>\n useAppAsync(\n 'getNewsletterStatus',\n useIntlayerOAuth().newsletter.getNewsletterStatus,\n args\n );\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['writeDictionary']>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerOAuth().editor.writeDictionary,\n args\n );\n\nexport const useGetEditorDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['getDictionaries']>\n) =>\n useEditorAsync('getDictionaries', useIntlayerOAuth().editor.getDictionaries, {\n store: true,\n cache: true,\n ...args,\n });\n"],"names":["error"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,kBAAkB,CAAC,cAAsB,UAAU,MAAM,GAAG,EAAE,KAAK,GAAG;AAK5E,MAAM,mBAAmB,CAAiC,YAAkB;AAC1E,QAAM,EAAE,MAAA,IAAU,SAAA;AAElB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACzB,UAAI;AAGJ,UAAI;AACF,YAAI,OAAO,iBAAiB,YAAa;AAEzC,gBAAQ,KAAK,MAAM,YAAY;AAAA,MACjC,SAAS,GAAG;AAGV,gBAAQ;AAAA,MACV;AAIA,OAAC,KAAK,EACH,QAAQ,CAACA,WAAUA,MAAK,EACxB;AAAA,QAAQ,CAACA,WACR,MAAM;AAAA,UACJ,OAAO;AAAA,aACJ,2BAAY,aAAa,eACtBA,OAAM,QACNA,OAAM,SAAS;AAAA,UAAA;AAAA,UAErB,aAAaA,OAAM,WAAW,gBAAgB;AAAA,UAC9C,SAAS;AAAA,QAAA,CACV;AAAA,MAAA;AAEL,cAAQ,UAAU,YAAY;AAAA,IAChC;AAAA,IACA,WAAW,CAAC,SAAS;AACnB,UAAI,MAAM,OAAO;AACf,cAAM;AAAA,UACJ,OAAO;AAAA,YACL,KAAK,MAAM,SAAS,KAAK,MAAM,QAAQ;AAAA,UAAA;AAAA,UAEzC,aACE,KAAK,MAAM,WAAW,KAAK,MAAM,QAAQ;AAAA,UAC3C,SAAS;AAAA,QAAA,CACV;AAAA,MACH;AAEA,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AAA,EACP,OAAO;AAAA,EACP,GAAG;AACL,CAAC;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hooks_useAsync_useAsync = require("./useAsync.cjs");
|
|
4
|
-
const hooks_useAsync_useAsyncStateStore = require("./useAsyncStateStore.cjs");
|
|
5
|
-
exports.useAsync = hooks_useAsync_useAsync.useAsync;
|
|
6
|
-
exports.AsyncStateProvider = hooks_useAsync_useAsyncStateStore.AsyncStateProvider;
|
|
7
|
-
exports.useAsyncState = hooks_useAsync_useAsyncStateStore.useAsyncState;
|
|
8
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAsync/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC"}
|