@intlayer/design-system 5.3.3 → 5.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +67 -49
- package/dist/{Form-MjLzPGze.js → Form-CriPBaZk.js} +11 -1
- package/dist/Form-CriPBaZk.js.map +1 -0
- package/dist/{Form-BpxW17v4.cjs → Form-DJrUK3mm.cjs} +11 -1
- package/dist/Form-DJrUK3mm.cjs.map +1 -0
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +1 -1
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs +1 -1
- package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +1 -1
- package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +1 -1
- package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.d.ts +3 -2
- package/dist/components/ContentEditor/ContentEditor.d.ts.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +2 -1
- 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 +2 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/FileWrapper.cjs +58 -0
- package/dist/components/DictionaryEditor/NodeWrapper/FileWrapper.cjs.map +1 -0
- package/dist/components/DictionaryEditor/NodeWrapper/FileWrapper.d.ts +9 -0
- package/dist/components/DictionaryEditor/NodeWrapper/FileWrapper.d.ts.map +1 -0
- package/dist/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +58 -0
- package/dist/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs.map +1 -0
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.cjs +7 -0
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.cjs.map +1 -0
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts +9 -0
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts.map +1 -0
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.mjs +7 -0
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.mjs.map +1 -0
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.cjs +4 -15
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs +4 -15
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs +8 -5
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +8 -5
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts +4 -2
- package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +102 -22
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +3 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +102 -22
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +48 -114
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +49 -115
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +0 -51
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +0 -105
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +0 -51
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +6 -5
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +7 -6
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +117 -78
- 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 +120 -81
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +108 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +231 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +108 -0
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.cjs +10 -2
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.mjs +11 -3
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +30 -0
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +66 -0
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +30 -0
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/Form/Form.cjs +1 -1
- package/dist/components/Form/Form.mjs +1 -1
- package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs +1 -1
- package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs +1 -1
- package/dist/components/Form/elements/CheckboxElement.cjs +1 -1
- package/dist/components/Form/elements/CheckboxElement.mjs +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.cjs +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts +2 -2
- package/dist/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.mjs +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts +2 -2
- package/dist/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +1 -1
- package/dist/components/Form/elements/FormElement.cjs +1 -1
- package/dist/components/Form/elements/FormElement.mjs +1 -1
- package/dist/components/Form/elements/InputElement.cjs +1 -1
- package/dist/components/Form/elements/InputElement.d.ts +2 -2
- package/dist/components/Form/elements/InputElement.d.ts.map +1 -1
- package/dist/components/Form/elements/InputElement.mjs +1 -1
- package/dist/components/Form/elements/InputPasswordElement.cjs +1 -1
- package/dist/components/Form/elements/InputPasswordElement.d.ts +2 -2
- package/dist/components/Form/elements/InputPasswordElement.d.ts.map +1 -1
- package/dist/components/Form/elements/InputPasswordElement.mjs +1 -1
- package/dist/components/Form/elements/MultiselectElement.cjs +1 -1
- package/dist/components/Form/elements/MultiselectElement.mjs +1 -1
- package/dist/components/Form/elements/SelectElement.cjs +1 -1
- package/dist/components/Form/elements/SelectElement.mjs +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.cjs +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.mjs +1 -1
- package/dist/components/Form/elements/TextAreaElement.cjs +1 -1
- package/dist/components/Form/elements/TextAreaElement.d.ts +3 -3
- package/dist/components/Form/elements/TextAreaElement.d.ts.map +1 -1
- package/dist/components/Form/elements/TextAreaElement.mjs +1 -1
- package/dist/components/Form/elements/index.cjs +1 -1
- package/dist/components/Form/elements/index.mjs +1 -1
- package/dist/components/Form/index.cjs +1 -1
- package/dist/components/Form/index.mjs +1 -1
- package/dist/components/Form/layout/FormItemLayout.cjs +1 -1
- package/dist/components/Form/layout/FormItemLayout.mjs +1 -1
- package/dist/components/Form/layout/FormLabelLayout.cjs +12 -4
- package/dist/components/Form/layout/FormLabelLayout.cjs.map +1 -1
- package/dist/components/Form/layout/FormLabelLayout.d.ts.map +1 -1
- package/dist/components/Form/layout/FormLabelLayout.mjs +12 -4
- package/dist/components/Form/layout/FormLabelLayout.mjs.map +1 -1
- package/dist/components/Form/layout/index.cjs +1 -1
- package/dist/components/Form/layout/index.mjs +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.ts +1 -7
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -7
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +54 -54
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/{index-CVTE3oHq.js → index-CEoL1j7H.js} +48 -3
- package/dist/index-CEoL1j7H.js.map +1 -0
- package/dist/{index-BpCAhDMe.cjs → index-s_Ar0FDw.cjs} +48 -3
- package/dist/index-s_Ar0FDw.cjs.map +1 -0
- package/dist/utils/camelCase.cjs +2 -2
- package/dist/utils/camelCase.cjs.map +1 -1
- package/dist/utils/camelCase.d.ts +1 -1
- package/dist/utils/camelCase.d.ts.map +1 -1
- package/dist/utils/camelCase.mjs +2 -2
- package/dist/utils/camelCase.mjs.map +1 -1
- package/package.json +17 -19
- package/dist/Form-BpxW17v4.cjs.map +0 -1
- package/dist/Form-MjLzPGze.js.map +0 -1
- package/dist/index-BpCAhDMe.cjs.map +0 -1
- package/dist/index-CVTE3oHq.js.map +0 -1
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntlayerAPI } from '@intlayer/api';
|
|
2
2
|
import { UseAsyncOptions } from './useAsync/useAsync';
|
|
3
3
|
/**
|
|
4
4
|
* Auth
|
|
5
5
|
*/
|
|
6
|
-
export declare const useLogin: (args?: UseAsyncOptions<
|
|
7
|
-
export declare const useRegister: (args?: UseAsyncOptions<
|
|
8
|
-
export declare const useLogout: (args?: UseAsyncOptions<
|
|
9
|
-
export declare const useChangePassword: (args?: UseAsyncOptions<
|
|
10
|
-
export declare const useAskResetPassword: (args?: UseAsyncOptions<
|
|
11
|
-
export declare const useResetPassword: (args?: UseAsyncOptions<
|
|
12
|
-
export declare const useDefineNewPassword: (args?: UseAsyncOptions<
|
|
13
|
-
export declare const useCheckIfUserHasPassword: (args?: UseAsyncOptions<
|
|
14
|
-
export declare const useVerifyEmail: (args?: UseAsyncOptions<
|
|
15
|
-
export declare const useGetUserByAccount: (args?: UseAsyncOptions<
|
|
6
|
+
export declare const useLogin: (args?: UseAsyncOptions<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<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
|
+
export declare const useLogout: (args?: UseAsyncOptions<IntlayerAPI["auth"]["logout"]>) => import('./useAsync').UseAsyncResult<"logout", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<void>>;
|
|
9
|
+
export declare const useChangePassword: (args?: UseAsyncOptions<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<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<IntlayerAPI["auth"]["resetPassword"]>) => import('./useAsync').UseAsyncResult<"resetPassword", (params: ResetPasswordParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<ResetPasswordResult>>;
|
|
12
|
+
export declare const useDefineNewPassword: (args?: UseAsyncOptions<IntlayerAPI["auth"]["defineNewPassword"]>) => import('./useAsync').UseAsyncResult<"defineNewPassword", (data: import('@intlayer/backend').DefinePasswordBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DefinePasswordResult>>;
|
|
13
|
+
export declare const useCheckIfUserHasPassword: (args?: UseAsyncOptions<IntlayerAPI["auth"]["checkIfUserHasPassword"]>) => import('./useAsync').UseAsyncResult<"checkIfUserHasPassword", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').CheckIfUserHasPasswordResult>>;
|
|
14
|
+
export declare const useVerifyEmail: (args?: UseAsyncOptions<IntlayerAPI["auth"]["verifyEmail"]>) => import('./useAsync').UseAsyncResult<"verifyEmail", ({ userId, secret }: import('@intlayer/backend').ValidEmailParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').ValidEmailResult>>;
|
|
15
|
+
export declare const useGetUserByAccount: (args?: UseAsyncOptions<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>>;
|
|
16
16
|
/**
|
|
17
17
|
* User
|
|
18
18
|
*/
|
|
19
|
-
export declare const useGetUsers: (args?: UseAsyncOptions<
|
|
20
|
-
export declare const useCreateUser: (args?: UseAsyncOptions<
|
|
21
|
-
export declare const useUpdateUser: (args?: UseAsyncOptions<
|
|
22
|
-
export declare const useDeleteUser: (args?: UseAsyncOptions<
|
|
19
|
+
export declare const useGetUsers: (args?: UseAsyncOptions<IntlayerAPI["user"]["getUsers"]>) => import('./useAsync').UseAsyncResult<"getUsers", (filters?: import('@intlayer/backend').GetUsersParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetUsersResult>>;
|
|
20
|
+
export declare const useCreateUser: (args?: UseAsyncOptions<IntlayerAPI["user"]["createUser"]>) => import('./useAsync').UseAsyncResult<"createUser", (user: import('@intlayer/backend').CreateUserBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').CreateUserResult>>;
|
|
21
|
+
export declare const useUpdateUser: (args?: UseAsyncOptions<IntlayerAPI["user"]["updateUser"]>) => import('./useAsync').UseAsyncResult<"updateUser", (user: import('@intlayer/backend').UpdateUserBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>>;
|
|
22
|
+
export declare const useDeleteUser: (args?: UseAsyncOptions<IntlayerAPI["user"]["deleteUser"]>) => import('./useAsync').UseAsyncResult<"deleteUser", (userId: string, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateUserResult>>;
|
|
23
23
|
/**
|
|
24
24
|
* Organization
|
|
25
25
|
*/
|
|
26
|
-
export declare const useGetOrganizations: (args?: UseAsyncOptions<
|
|
27
|
-
export declare const useAddOrganization: (args?: UseAsyncOptions<
|
|
28
|
-
export declare const useUpdateOrganization: (args?: UseAsyncOptions<
|
|
29
|
-
export declare const useUpdateOrganizationMembers: (args?: UseAsyncOptions<
|
|
30
|
-
export declare const useAddOrganizationMember: (args?: UseAsyncOptions<
|
|
31
|
-
export declare const useDeleteOrganization: (args?: UseAsyncOptions<
|
|
32
|
-
export declare const useSelectOrganization: (args?: UseAsyncOptions<
|
|
33
|
-
export declare const useUnselectOrganization: (args?: UseAsyncOptions<
|
|
26
|
+
export declare const useGetOrganizations: (args?: UseAsyncOptions<IntlayerAPI["organization"]["getOrganizations"]>) => import('./useAsync').UseAsyncResult<"getOrganizations", (filters?: import('@intlayer/backend').GetOrganizationsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetOrganizationsResult>>;
|
|
27
|
+
export declare const useAddOrganization: (args?: UseAsyncOptions<IntlayerAPI["organization"]["addOrganization"]>) => import('./useAsync').UseAsyncResult<"addOrganization", (organization: import('@intlayer/backend').AddOrganizationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationResult>>;
|
|
28
|
+
export declare const useUpdateOrganization: (args?: UseAsyncOptions<IntlayerAPI["organization"]["updateOrganization"]>) => import('./useAsync').UseAsyncResult<"updateOrganization", (organization: import('@intlayer/backend').UpdateOrganizationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationResult>>;
|
|
29
|
+
export declare const useUpdateOrganizationMembers: (args?: UseAsyncOptions<IntlayerAPI["organization"]["updateOrganizationMembers"]>) => import('./useAsync').UseAsyncResult<"updateOrganizationMembers", (body: import('@intlayer/backend').UpdateOrganizationMembersBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateOrganizationMembersResult>>;
|
|
30
|
+
export declare const useAddOrganizationMember: (args?: UseAsyncOptions<IntlayerAPI["organization"]["addOrganizationMember"]>) => import('./useAsync').UseAsyncResult<"addOrganizationMember", (body: import('@intlayer/backend').AddOrganizationMemberBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddOrganizationMemberResult>>;
|
|
31
|
+
export declare const useDeleteOrganization: (args?: UseAsyncOptions<IntlayerAPI["organization"]["deleteOrganization"]>) => import('./useAsync').UseAsyncResult<"deleteOrganization", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteOrganizationResult>>;
|
|
32
|
+
export declare const useSelectOrganization: (args?: UseAsyncOptions<IntlayerAPI["organization"]["selectOrganization"]>) => import('./useAsync').UseAsyncResult<"selectOrganization", (organizationId: import('@intlayer/backend').SelectOrganizationParam["organizationId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').SelectOrganizationResult>>;
|
|
33
|
+
export declare const useUnselectOrganization: (args?: UseAsyncOptions<IntlayerAPI["organization"]["unselectOrganization"]>) => import('./useAsync').UseAsyncResult<"unselectOrganization", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UnselectOrganizationResult>>;
|
|
34
34
|
/**
|
|
35
35
|
* Project
|
|
36
36
|
*/
|
|
37
|
-
export declare const useGetProjects: (args?: UseAsyncOptions<
|
|
38
|
-
export declare const useAddProject: (args?: UseAsyncOptions<
|
|
39
|
-
export declare const useUpdateProject: (args?: UseAsyncOptions<
|
|
40
|
-
export declare const useUpdateProjectMembers: (args?: UseAsyncOptions<
|
|
41
|
-
export declare const useDeleteProject: (args?: UseAsyncOptions<
|
|
42
|
-
export declare const useSelectProject: (args?: UseAsyncOptions<
|
|
43
|
-
export declare const useUnselectProject: (args?: UseAsyncOptions<
|
|
44
|
-
export declare const useAddNewAccessKey: (args?: UseAsyncOptions<
|
|
45
|
-
export declare const useDeleteAccessKey: (args?: UseAsyncOptions<
|
|
46
|
-
export declare const useRefreshAccessKey: (args?: UseAsyncOptions<
|
|
37
|
+
export declare const useGetProjects: (args?: UseAsyncOptions<IntlayerAPI["project"]["getProjects"]>) => import('./useAsync').UseAsyncResult<"getProjects", (filters?: import('@intlayer/backend').GetProjectsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetProjectsResult>>;
|
|
38
|
+
export declare const useAddProject: (args?: UseAsyncOptions<IntlayerAPI["project"]["addProject"]>) => import('./useAsync').UseAsyncResult<"addProject", (project: import('@intlayer/backend').AddProjectBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddProjectResult>>;
|
|
39
|
+
export declare const useUpdateProject: (args?: UseAsyncOptions<IntlayerAPI["project"]["updateProject"]>) => import('./useAsync').UseAsyncResult<"updateProject", (project: import('@intlayer/backend').UpdateProjectBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectResult>>;
|
|
40
|
+
export declare const useUpdateProjectMembers: (args?: UseAsyncOptions<IntlayerAPI["project"]["updateProjectMembers"]>) => import('./useAsync').UseAsyncResult<"updateProjectMembers", (body: import('@intlayer/backend').UpdateProjectMembersBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UpdateProjectMembersResult>>;
|
|
41
|
+
export declare const useDeleteProject: (args?: UseAsyncOptions<IntlayerAPI["project"]["deleteProject"]>) => import('./useAsync').UseAsyncResult<"deleteProject", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteProjectResult>>;
|
|
42
|
+
export declare const useSelectProject: (args?: UseAsyncOptions<IntlayerAPI["project"]["selectProject"]>) => import('./useAsync').UseAsyncResult<"selectProject", (projectId: import('@intlayer/backend').SelectProjectParam["projectId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').SelectProjectResult>>;
|
|
43
|
+
export declare const useUnselectProject: (args?: UseAsyncOptions<IntlayerAPI["project"]["unselectProject"]>) => import('./useAsync').UseAsyncResult<"unselectProject", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').UnselectProjectResult>>;
|
|
44
|
+
export declare const useAddNewAccessKey: (args?: UseAsyncOptions<IntlayerAPI["project"]["addNewAccessKey"]>) => import('./useAsync').UseAsyncResult<"addNewAccessKey", (accessKey: import('@intlayer/backend').AddNewAccessKeyBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddNewAccessKeyResponse>>;
|
|
45
|
+
export declare const useDeleteAccessKey: (args?: UseAsyncOptions<IntlayerAPI["project"]["deleteAccessKey"]>) => import('./useAsync').UseAsyncResult<"deleteAccessKey", (clientId: import('@intlayer/backend').DeleteAccessKeyBody["clientId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteAccessKeyResponse>>;
|
|
46
|
+
export declare const useRefreshAccessKey: (args?: UseAsyncOptions<IntlayerAPI["project"]["refreshAccessKey"]>) => import('./useAsync').UseAsyncResult<"refreshAccessKey", (clientId: import('@intlayer/backend').RefreshAccessKeyBody["clientId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').RefreshAccessKeyResponse>>;
|
|
47
47
|
/**
|
|
48
48
|
* Dictionary
|
|
49
49
|
*/
|
|
50
|
-
export declare const useGetDictionaries: (args?: UseAsyncOptions<
|
|
51
|
-
export declare const useGetDictionariesKeys: (args?: UseAsyncOptions<
|
|
52
|
-
export declare const useGetDictionary: (args?: UseAsyncOptions<
|
|
53
|
-
export declare const useAddDictionary: (args?: UseAsyncOptions<
|
|
54
|
-
export declare const usePushDictionaries: (args?: UseAsyncOptions<
|
|
55
|
-
export declare const useUpdateDictionary: (args?: UseAsyncOptions<
|
|
56
|
-
export declare const useDeleteDictionary: (args?: UseAsyncOptions<
|
|
50
|
+
export declare const useGetDictionaries: (args?: UseAsyncOptions<IntlayerAPI["dictionary"]["getDictionaries"]>) => import('./useAsync').UseAsyncResult<"getDictionaries", (filters?: import('@intlayer/backend').GetDictionariesParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesResult>>;
|
|
51
|
+
export declare const useGetDictionariesKeys: (args?: UseAsyncOptions<IntlayerAPI["dictionary"]["getDictionariesKeys"]>) => import('./useAsync').UseAsyncResult<"getDictionariesKeys", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetDictionariesKeysResult>>;
|
|
52
|
+
export declare const useGetDictionary: (args?: UseAsyncOptions<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>>;
|
|
53
|
+
export declare const useAddDictionary: (args?: UseAsyncOptions<IntlayerAPI["dictionary"]["addDictionary"]>) => import('./useAsync').UseAsyncResult<"addDictionary", (body: import('@intlayer/backend').AddDictionaryBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddDictionaryResult>>;
|
|
54
|
+
export declare const usePushDictionaries: (args?: UseAsyncOptions<IntlayerAPI["dictionary"]["pushDictionaries"]>) => import('./useAsync').UseAsyncResult<"pushDictionaries", (dictionaries: import('@intlayer/backend').PushDictionariesBody["dictionaries"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').PushDictionariesResult>>;
|
|
55
|
+
export declare const useUpdateDictionary: (args?: UseAsyncOptions<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>>;
|
|
56
|
+
export declare const useDeleteDictionary: (args?: UseAsyncOptions<IntlayerAPI["dictionary"]["deleteDictionary"]>) => import('./useAsync').UseAsyncResult<"deleteDictionary", (id: import('@intlayer/backend').DeleteDictionaryParam["dictionaryId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteDictionaryResult>>;
|
|
57
57
|
/**
|
|
58
58
|
* Tag
|
|
59
59
|
*/
|
|
60
|
-
export declare const useGetTags: (args?: UseAsyncOptions<
|
|
61
|
-
export declare const useAddTag: (args?: UseAsyncOptions<
|
|
62
|
-
export declare const useUpdateTag: (args?: UseAsyncOptions<
|
|
63
|
-
export declare const useDeleteTag: (args?: UseAsyncOptions<
|
|
60
|
+
export declare const useGetTags: (args?: UseAsyncOptions<IntlayerAPI["tag"]["getTags"]>) => import('./useAsync').UseAsyncResult<"getTags", (filters?: import('@intlayer/backend').GetTagsParams, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetTagsResult>>;
|
|
61
|
+
export declare const useAddTag: (args?: UseAsyncOptions<IntlayerAPI["tag"]["addTag"]>) => import('./useAsync').UseAsyncResult<"addTag", (tag: import('@intlayer/backend').AddTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AddTagResult>>;
|
|
62
|
+
export declare const useUpdateTag: (args?: UseAsyncOptions<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>>;
|
|
63
|
+
export declare const useDeleteTag: (args?: UseAsyncOptions<IntlayerAPI["tag"]["deleteTag"]>) => import('./useAsync').UseAsyncResult<"deleteTag", (tagId: import('@intlayer/backend').DeleteTagParams["tagId"], otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').DeleteTagResult>>;
|
|
64
64
|
/**
|
|
65
65
|
* Stripe
|
|
66
66
|
*/
|
|
67
|
-
export declare const useGetPricing: (args?: UseAsyncOptions<
|
|
68
|
-
export declare const useGetSubscription: (args?: UseAsyncOptions<
|
|
69
|
-
export declare const useCancelSubscription: (args?: UseAsyncOptions<
|
|
67
|
+
export declare const useGetPricing: (args?: UseAsyncOptions<IntlayerAPI["stripe"]["getPricing"]>) => import('./useAsync').UseAsyncResult<"getPricing", (body?: import('@intlayer/backend').GetPricingBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetPricingResult>>;
|
|
68
|
+
export declare const useGetSubscription: (args?: UseAsyncOptions<IntlayerAPI["stripe"]["getSubscription"]>) => import('./useAsync').UseAsyncResult<"getSubscription", (body?: import('@intlayer/backend').GetCheckoutSessionBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>>;
|
|
69
|
+
export declare const useCancelSubscription: (args?: UseAsyncOptions<IntlayerAPI["stripe"]["cancelSubscription"]>) => import('./useAsync').UseAsyncResult<"cancelSubscription", (otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').GetCheckoutSessionResult>>;
|
|
70
70
|
/**
|
|
71
71
|
* AI
|
|
72
72
|
*/
|
|
73
|
-
export declare const useAuditContentDeclaration: (args?: UseAsyncOptions<
|
|
74
|
-
export declare const useAuditContentDeclarationMetadata: (args?: UseAsyncOptions<
|
|
75
|
-
export declare const useAuditContentDeclarationField: (args?: UseAsyncOptions<
|
|
76
|
-
export declare const useAuditTag: (args?: UseAsyncOptions<
|
|
77
|
-
export declare const useAskDocQuestion: (args?: UseAsyncOptions<
|
|
78
|
-
export declare const useAutocomplete: (args?: UseAsyncOptions<
|
|
73
|
+
export declare const useAuditContentDeclaration: (args?: UseAsyncOptions<IntlayerAPI["ai"]["auditContentDeclaration"]>) => import('./useAsync').UseAsyncResult<"auditContentDeclaration", (body?: import('@intlayer/backend').AuditContentDeclarationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationResult>>;
|
|
74
|
+
export declare const useAuditContentDeclarationMetadata: (args?: UseAsyncOptions<IntlayerAPI["ai"]["auditContentDeclarationMetadata"]>) => import('./useAsync').UseAsyncResult<"auditContentDeclaration", (body?: import('@intlayer/backend').AuditContentDeclarationMetadataBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationMetadataResult>>;
|
|
75
|
+
export declare const useAuditContentDeclarationField: (args?: UseAsyncOptions<IntlayerAPI["ai"]["auditContentDeclarationField"]>) => import('./useAsync').UseAsyncResult<"auditContentDeclarationField", (body?: import('@intlayer/backend').AuditContentDeclarationFieldBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditContentDeclarationFieldResult>>;
|
|
76
|
+
export declare const useAuditTag: (args?: UseAsyncOptions<IntlayerAPI["ai"]["auditTag"]>) => import('./useAsync').UseAsyncResult<"auditTag", (body?: import('@intlayer/backend').AuditTagBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AuditTagResult>>;
|
|
77
|
+
export declare const useAskDocQuestion: (args?: UseAsyncOptions<IntlayerAPI["ai"]["askDocQuestion"]>) => import('./useAsync').UseAsyncResult<"askDocQuestion", (body?: import('@intlayer/backend').AskDocQuestionBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AskDocQuestionResult>>;
|
|
78
|
+
export declare const useAutocomplete: (args?: UseAsyncOptions<IntlayerAPI["ai"]["autocomplete"]>) => import('./useAsync').UseAsyncResult<"autocomplete", (body?: import('@intlayer/backend').AutocompleteBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<import('@intlayer/backend').AutocompleteResponse>>;
|
|
79
79
|
/**
|
|
80
80
|
* Editor
|
|
81
81
|
*/
|
|
82
|
-
export declare const useWriteDictionary: (args?: UseAsyncOptions<
|
|
82
|
+
export declare const useWriteDictionary: (args?: UseAsyncOptions<IntlayerAPI["editor"]["writeDictionary"]>) => import('./useAsync').UseAsyncResult<"writeDictionary", (dictionary: WriteContentDeclarationBody, otherOptions?: import('@intlayer/api').FetcherOptions) => Promise<WriteContentDeclarationResult>>;
|
|
83
83
|
//# sourceMappingURL=intlayerAPIHooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerAPIHooks.d.ts","sourceRoot":"","sources":["../../src/hooks/intlayerAPIHooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,qBAAqB,CAAC;AA0IrE;;GAEG;AAEH,eAAO,MAAM,QAAQ,GACnB,OAAO,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"intlayerAPIHooks.d.ts","sourceRoot":"","sources":["../../src/hooks/intlayerAPIHooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,qBAAqB,CAAC;AA0IrE;;GAEG;AAEH,eAAO,MAAM,QAAQ,GACnB,OAAO,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,gEAmCZ,mBAAmB,sFAIlD,mBAAmB,eAlC1B,CAAC;AACL,eAAO,MAAM,WAAW,GACtB,OAAO,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,mEAyCjD,mBAEG,+BAGJ,mBAAkB,0FACkC,mBAC1C,kBA3Cb,CAAC;AACL,eAAO,MAAM,SAAS,GACpB,OAAO,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,4HAKnD,CAAC;AACL,eAAO,MAAM,iBAAiB,GAC5B,OAAO,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,CAAC,yEA6EA,mBAC/C,+FAGa,mBACZ,wBAjF8D,CAAC;AAChF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC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0BAA0B,GACrC,OAAO,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,yBAAyB,CAAC,CAAC,mFApTpD,mBACT,wGAEiB,mBACtB,iCA2TD,CAAC;AAEJ,eAAO,MAAM,kCAAkC,GAC7C,OAAO,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,iCAAiC,CAAC,CAAC,mFA5S3D,mBACJ,gHAKT,mBAAY,yCAiTf,CAAC;AAEJ,eAAO,MAAM,+BAA+B,GAC1C,OAAO,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,8BAA8B,CAAC,CAAC,wFAnU/D,mBAAmB,6GAIlB,mBAAmB,sCA0U7B,CAAC;AAEJ,eAAO,MAAM,WAAW,GACtB,OAAO,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,oEA9T/B,mBACZ,yFAEH,mBAAmB,kBAiUxB,CAAC;AAEL,eAAO,MAAM,iBAAiB,GAC5B,OAAO,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,CAAC,0EAnU3C,mBAAmB,+FAItB,mBAAmB,wBAgU2C,CAAC;AAE9E,eAAO,MAAM,eAAe,GAC1B,OAAO,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,wEAjUlC,mBAAmB,6FAExC,mBAEJ,wBA8TyE,CAAC;AAE1E;;GAEG;AAEH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,yEAzShE,2BAA0B,oEAA4C,6BACjD,EA8SpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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 { useAuth } from '../components/Auth/useAuth/index';\nimport { useToast } from '../components/Toaster';\nimport { type UseAsyncOptions, useAsync } 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 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:\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 useDefineNewPassword = (\n args?: UseAsyncOptions<typeof intlayerAPI.auth.defineNewPassword>\n) =>\n useAppAsync(\n 'defineNewPassword',\n useIntlayerAuth().auth.defineNewPassword,\n args\n );\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', 'getSession'],\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', 'getSession'],\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', 'getSession'],\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', 'getSession'],\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 useGetPricing = (\n args?: UseAsyncOptions<typeof intlayerAPI.stripe.getPricing>\n) =>\n useAppAsync('getPricing', useIntlayerAuth().stripe.getPricing, {\n store: true,\n cache: true,\n ...args,\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\nexport const useAutocomplete = (\n args?: UseAsyncOptions<typeof intlayerAPI.ai.autocomplete>\n) => useAppAsync('autocomplete', useIntlayerAuth().ai.autocomplete, 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":";;;;;;;;;AAYA,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAI,SAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAAA;AACE,YAAA,OAAO,iBAAiB,YAAa;AAEjC,gBAAA,KAAK,MAAM,YAAY;AAAA,eACxB,GAAG;AAGF,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;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AAG,KAAK;AAAA,EAC7C;AAAA,IACE,aAAa;AAAA,IACb,qBAAqB;AAAA,EAAA;AAEzB;AAMW,MAAA,6BAA6B,CACxC,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,qCAAqC,CAChD,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,kCAAkC,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;AAE/D,MAAA,kBAAkB,CAC7B,SACG,YAAY,gBAAgB,kBAAkB,GAAG,cAAc,IAAI;AAM3D,MAAA,qBAAqB,CAChC,SAEA;AAAA,EACE;AAAA,EACA,gBAAA,EAAkB,OAAO;AAAA,EACzB;AACF;"}
|
|
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 { useAuth } from '../components/Auth/useAuth/index';\nimport { useToast } from '../components/Toaster';\nimport { type UseAsyncOptions, useAsync } 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 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:\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<IntlayerAPI['auth']['login']>\n) =>\n useAppAsync('login', useIntlayerAuth().auth.login, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRegister = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['register']>\n) =>\n useAppAsync('register', useIntlayerAuth().auth.register, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useLogout = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['logout']>\n) =>\n useAppAsync('logout', useIntlayerAuth().auth.logout, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useChangePassword = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['changePassword']>\n) => useAppAsync('changePassword', useIntlayerAuth().auth.changePassword, args);\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['askResetPassword']>\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().auth.askResetPassword,\n args\n );\nexport const useResetPassword = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['resetPassword']>\n) => useAppAsync('resetPassword', useIntlayerAuth().auth.resetPassword, args);\nexport const useDefineNewPassword = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['defineNewPassword']>\n) =>\n useAppAsync(\n 'defineNewPassword',\n useIntlayerAuth().auth.defineNewPassword,\n args\n );\nexport const useCheckIfUserHasPassword = (\n args?: UseAsyncOptions<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<IntlayerAPI['auth']['verifyEmail']>\n) => useAppAsync('verifyEmail', useIntlayerAuth().auth.verifyEmail, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<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<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<IntlayerAPI['user']['createUser']>\n) =>\n useAppAsync('createUser', useIntlayerAuth().user.createUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\nexport const useUpdateUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['updateUser']>\n) =>\n useAppAsync('updateUser', useIntlayerAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteUser = (\n args?: UseAsyncOptions<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<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<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<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 IntlayerAPI['organization']['updateOrganizationMembers']\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['addOrganizationMember']>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['deleteOrganization']>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<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<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<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<IntlayerAPI['project']['addProject']>\n) =>\n useAppAsync('addProject', useIntlayerAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\nexport const useUpdateProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProject']>\n) =>\n useAppAsync('updateProject', useIntlayerAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<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<IntlayerAPI['project']['deleteProject']>\n) =>\n useAppAsync('deleteProject', useIntlayerAuth().project.deleteProject, {\n invalidateQueries: ['getProjects', 'getSession'],\n ...args,\n });\nexport const useSelectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['selectProject']>\n) =>\n useAppAsync('selectProject', useIntlayerAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useUnselectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['unselectProject']>\n) =>\n useAppAsync('unselectProject', useIntlayerAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addNewAccessKey']>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteAccessKey']>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<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<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<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<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<IntlayerAPI['dictionary']['addDictionary']>\n) =>\n useAppAsync('addDictionary', useIntlayerAuth().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 useIntlayerAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<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<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<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<IntlayerAPI['tag']['addTag']>\n) =>\n useAppAsync('addTag', useIntlayerAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useUpdateTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['updateTag']>\n) =>\n useAppAsync('updateTag', useIntlayerAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\nexport const useDeleteTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['deleteTag']>\n) =>\n useAppAsync('deleteTag', useIntlayerAuth().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', useIntlayerAuth().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 useIntlayerAuth().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 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<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<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<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<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<IntlayerAPI['ai']['askDocQuestion']>\n) => useAppAsync('askDocQuestion', useIntlayerAuth().ai.askDocQuestion, args);\n\nexport const useAutocomplete = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['autocomplete']>\n) => useAppAsync('autocomplete', useIntlayerAuth().ai.autocomplete, args);\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['writeDictionary']>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerAuth().editor.writeDictionary,\n args\n );\n"],"names":["error"],"mappings":";;;;;;;;;AAYA,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAI,SAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAAA;AACE,YAAA,OAAO,iBAAiB,YAAa;AAEjC,gBAAA,KAAK,MAAM,YAAY;AAAA,eACxB,GAAG;AAGF,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;A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B;AAMW,MAAA,6BAA6B,CACxC,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,qCAAqC,CAChD,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,kCAAkC,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;AAE/D,MAAA,kBAAkB,CAC7B,SACG,YAAY,gBAAgB,kBAAkB,GAAG,cAAc,IAAI;AAM3D,MAAA,qBAAqB,CAChC,SAEA;AAAA,EACE;AAAA,EACA,gBAAA,EAAkB,OAAO;AAAA,EACzB;AACF;"}
|
|
@@ -86,7 +86,7 @@ export declare const useIntlayerAuth: (props?: UseIntlayerAuthProps) => {
|
|
|
86
86
|
};
|
|
87
87
|
editor: {
|
|
88
88
|
getConfiguration: (otherOptions?: FetcherOptions) => Promise<GetConfigurationResult>;
|
|
89
|
-
writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<
|
|
89
|
+
writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<WriteContentDeclarationResult>;
|
|
90
90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;;;yBAAyE,CAAC,SAAS,mBAAmB,8BAA8B,CAAC,oCAAoC,mBAAmB;8BAAmD,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;2BAAoD,CAAC,SAAS,mBAAmB,gCAAgC,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,6BAA6B,6BAA6B;;CADjzU,CAAC"}
|
|
@@ -3,8 +3,8 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import { NodeType, isSameKeyPath, getNodeType } from "@intlayer/core";
|
|
4
4
|
import { ItemLayout } from "./components/DictionaryEditor/ItemLayout.mjs";
|
|
5
5
|
import { createElement } from "react";
|
|
6
|
-
import { MarkdownWrapper } from "./components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs";
|
|
7
6
|
import { StringWrapper } from "./components/DictionaryEditor/NodeWrapper/StringWrapper.mjs";
|
|
7
|
+
import { FileWrapper } from "./components/DictionaryEditor/NodeWrapper/FileWrapper.mjs";
|
|
8
8
|
const ArrayWrapper = (props) => {
|
|
9
9
|
const { keyPath, section, onFocusKeyPath, focusedKeyPath = [] } = props;
|
|
10
10
|
return section.map((subSection, key) => {
|
|
@@ -76,6 +76,17 @@ const EnumerationWrapper = (props) => {
|
|
|
76
76
|
] });
|
|
77
77
|
}) });
|
|
78
78
|
};
|
|
79
|
+
const MarkdownWrapper = (props) => {
|
|
80
|
+
const { keyPath, section } = props;
|
|
81
|
+
const newKeyPath = [
|
|
82
|
+
...keyPath,
|
|
83
|
+
{
|
|
84
|
+
type: NodeType.Markdown
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
const subSection = section[NodeType.Markdown];
|
|
88
|
+
return /* @__PURE__ */ jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: /* @__PURE__ */ jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection }) });
|
|
89
|
+
};
|
|
79
90
|
const NestedObjectWrapper = (props) => {
|
|
80
91
|
const { keyPath, section, focusedKeyPath = [], onFocusKeyPath } = props;
|
|
81
92
|
return Object.keys(section).filter((key) => !traceKeys.includes(key)).map((key) => {
|
|
@@ -108,6 +119,20 @@ const TranslationWrapper = (props) => {
|
|
|
108
119
|
const subSection = section.translation[locale];
|
|
109
120
|
return /* @__PURE__ */ jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection });
|
|
110
121
|
};
|
|
122
|
+
const InsertionWrapper = (props) => {
|
|
123
|
+
const { keyPath, section } = props;
|
|
124
|
+
const newKeyPath = [
|
|
125
|
+
...keyPath,
|
|
126
|
+
{
|
|
127
|
+
type: NodeType.Insertion
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
const subSection = section[NodeType.Insertion];
|
|
131
|
+
return /* @__PURE__ */ jsxs("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: [
|
|
132
|
+
/* @__PURE__ */ jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection }),
|
|
133
|
+
";"
|
|
134
|
+
] });
|
|
135
|
+
};
|
|
111
136
|
const traceKeys = ["filePath", "id", "nodeType"];
|
|
112
137
|
const NodeWrapper = (props) => {
|
|
113
138
|
const { section } = props;
|
|
@@ -120,7 +145,13 @@ const NodeWrapper = (props) => {
|
|
|
120
145
|
return /* @__PURE__ */ jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: "[Nested] Dictionary" });
|
|
121
146
|
}
|
|
122
147
|
if (nodeType === NodeType.Markdown) {
|
|
123
|
-
return /* @__PURE__ */ jsx(
|
|
148
|
+
return /* @__PURE__ */ jsx(
|
|
149
|
+
MarkdownWrapper,
|
|
150
|
+
{
|
|
151
|
+
...props,
|
|
152
|
+
section
|
|
153
|
+
}
|
|
154
|
+
);
|
|
124
155
|
}
|
|
125
156
|
if (nodeType === NodeType.Translation) {
|
|
126
157
|
return /* @__PURE__ */ jsx(
|
|
@@ -149,6 +180,15 @@ const NodeWrapper = (props) => {
|
|
|
149
180
|
}
|
|
150
181
|
);
|
|
151
182
|
}
|
|
183
|
+
if (nodeType === NodeType.Insertion) {
|
|
184
|
+
return /* @__PURE__ */ jsx(
|
|
185
|
+
InsertionWrapper,
|
|
186
|
+
{
|
|
187
|
+
...props,
|
|
188
|
+
section
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
152
192
|
if (nodeType === NodeType.Array) {
|
|
153
193
|
return /* @__PURE__ */ jsx(
|
|
154
194
|
ArrayWrapper,
|
|
@@ -158,6 +198,9 @@ const NodeWrapper = (props) => {
|
|
|
158
198
|
}
|
|
159
199
|
);
|
|
160
200
|
}
|
|
201
|
+
if (nodeType === NodeType.File) {
|
|
202
|
+
return /* @__PURE__ */ jsx(FileWrapper, { ...props, section });
|
|
203
|
+
}
|
|
161
204
|
return /* @__PURE__ */ jsx(
|
|
162
205
|
NestedObjectWrapper,
|
|
163
206
|
{
|
|
@@ -174,9 +217,11 @@ export {
|
|
|
174
217
|
ArrayWrapper as A,
|
|
175
218
|
ConditionWrapper as C,
|
|
176
219
|
EnumerationWrapper as E,
|
|
220
|
+
InsertionWrapper as I,
|
|
221
|
+
MarkdownWrapper as M,
|
|
177
222
|
NodeWrapper as N,
|
|
178
223
|
TranslationWrapper as T,
|
|
179
224
|
NestedObjectWrapper as a,
|
|
180
225
|
traceKeys as t
|
|
181
226
|
};
|
|
182
|
-
//# sourceMappingURL=index-
|
|
227
|
+
//# sourceMappingURL=index-CEoL1j7H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CEoL1j7H.js","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/ConditionWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/InsertionWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["import {\n isSameKeyPath,\n NodeType,\n type ContentNode,\n type KeyPath,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: ContentNode[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const { keyPath, section, onFocusKeyPath, focusedKeyPath = [] } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","import {\n type KeyPath,\n NodeType,\n type ConditionContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype ConditionWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: ConditionContent<ContentNode>;\n};\n\nexport const ConditionWrapper: FC<ConditionWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Condition,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section[NodeType.Condition][\n key as keyof (typeof section)[NodeType.Condition]\n ]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","import {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<ContentNode>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section[NodeType.Enumeration][\n key as keyof (typeof section)[NodeType.Enumeration]\n ]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","import {\n type KeyPath,\n NodeType,\n type MarkdownContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype MarkdownWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: MarkdownContent<ContentNode>;\n};\n\nexport const MarkdownWrapper: FC<MarkdownWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const subSection = section[NodeType.Markdown] as ContentNode;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </div>\n );\n};\n","import {\n type KeyPath,\n isSameKeyPath,\n type ContentNode,\n NodeType,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, ContentNode>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const { keyPath, section, focusedKeyPath = [], onFocusKeyPath } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","import {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<ContentNode>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","import {\n type KeyPath,\n NodeType,\n type InsertionContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype InsertionWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: InsertionContent<ContentNode>;\n};\n\nexport const InsertionWrapper: FC<InsertionWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Insertion,\n },\n ];\n\n const subSection = section[NodeType.Insertion];\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n </div>\n );\n};\n","'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n getNodeType,\n NodeType,\n type ConditionContent,\n type MarkdownContent,\n type EnumerationContent,\n type InsertionContent,\n type TranslationContent,\n type KeyPath,\n type ContentNode,\n type FileContent,\n type Dictionary,\n} from '@intlayer/core';\nimport { ReactNode, type FC } from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { ConditionWrapper } from './ConditionWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { MarkdownWrapper } from './MarkdownWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\nimport { FileWrapper } from './FileWrapper';\nimport { InsertionWrapper } from './InsertionWrapper';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n section: ContentNode;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: ContentNode;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n renderSection?: (content: string) => ReactNode;\n};\n\nexport const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const { section } = props;\n const nodeType = getNodeType(section);\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <span className=\"text-neutral text-xs\">React node not editable</span>\n );\n }\n\n if (nodeType === NodeType.Nested) {\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n [Nested] Dictionary\n </div>\n );\n }\n\n if (nodeType === NodeType.Markdown) {\n return (\n <MarkdownWrapper\n {...props}\n section={section as MarkdownContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Condition) {\n return (\n <ConditionWrapper\n {...props}\n section={section as ConditionContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Insertion) {\n return (\n <InsertionWrapper\n {...props}\n section={section as InsertionContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayWrapper\n {...props}\n section={section as unknown as ContentNode[]}\n />\n );\n }\n\n if (nodeType === NodeType.File) {\n return <FileWrapper {...props} section={section as FileContent} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, ContentNode>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":[],"mappings":";;;;;;;AAca,MAAA,eAAsC,CAAC,UAAU;AAC5D,QAAM,EAAE,SAAS,SAAS,gBAAgB,iBAAiB,OAAO;AAElE,SAAO,QAAQ,IAAI,CAAC,YAAY,QAAQ;AACtC,UAAM,eAAwB;AAAA,MAC5B;AAAA,MACA,MAAM,SAAS;AAAA,IACjB;AACA,UAAM,aAAwB,CAAC,GAAG,SAAS,YAAY;AAGrD,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO,QAAQ;AAAA,QAEf,OAAO,GAAG,GAAG;AAAA,QACb,aAAY;AAAA,QACZ,YAAY,cAAc,YAAY,cAAc;AAAA,QACpD,SAAS,CAAC,MAAM;AACd,YAAE,gBAAgB;AAClB,yBAAe,UAAU;AAAA,QAC3B;AAAA,QAEA,8BAAC,aAAa,EAAA,GAAG,OAAO,SAAS,YAAY,SAAS,WAAY,CAAA;AAAA,MAAA;AAAA,MAT7D,KAAK,UAAU,UAAU;AAAA,IAUhC;AAAA,EAAA,CAEH;AACH;AC3Ba,MAAA,mBAA8C,CAAC,UAAU;AAC9D,QAAA,EAAE,SAAS,QAAA,IAAY;AAE7B,6BACG,OAAI,EAAA,WAAU,wCACZ,UAAO,OAAA,KAAK,OAAO,EACjB,OAAO,CAAC,QAAQ,CAAC,UAAU,SAAS,GAAG,CAAC,EACxC,IAAI,CAAC,QAAQ;AACZ,UAAM,eAAwB;AAAA,MAC5B,MAAM,SAAS;AAAA,MACf;AAAA,IACF;AACA,UAAM,aAAwB,CAAC,GAAG,SAAS,YAAY;AAEvD,UAAM,aACJ,QAAQ,SAAS,SAAS,EACxB,GACF;AAEF,WAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAC,oBAAA,QAAA,EAAK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