@intlayer/design-system 8.10.1 → 8.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/api/hooks/ai.mjs +66 -0
- package/dist/esm/api/hooks/ai.mjs.map +1 -0
- package/dist/esm/api/hooks/audit.mjs +34 -0
- package/dist/esm/api/hooks/audit.mjs.map +1 -0
- package/dist/esm/api/hooks/auth.mjs +217 -0
- package/dist/esm/api/hooks/auth.mjs.map +1 -0
- package/dist/esm/api/hooks/bitbucket.mjs +39 -0
- package/dist/esm/api/hooks/bitbucket.mjs.map +1 -0
- package/dist/esm/api/hooks/dictionary.mjs +105 -0
- package/dist/esm/api/hooks/dictionary.mjs.map +1 -0
- package/dist/esm/api/hooks/discussions.mjs +37 -0
- package/dist/esm/api/hooks/discussions.mjs.map +1 -0
- package/dist/esm/api/hooks/editor.mjs +24 -0
- package/dist/esm/api/hooks/editor.mjs.map +1 -0
- package/dist/esm/api/hooks/github.mjs +54 -0
- package/dist/esm/api/hooks/github.mjs.map +1 -0
- package/dist/esm/api/hooks/gitlab.mjs +43 -0
- package/dist/esm/api/hooks/gitlab.mjs.map +1 -0
- package/dist/esm/api/hooks/newsletter.mjs +31 -0
- package/dist/esm/api/hooks/newsletter.mjs.map +1 -0
- package/dist/esm/api/hooks/organization.mjs +123 -0
- package/dist/esm/api/hooks/organization.mjs.map +1 -0
- package/dist/esm/api/hooks/project.mjs +187 -0
- package/dist/esm/api/hooks/project.mjs.map +1 -0
- package/dist/esm/api/hooks/reviewer.mjs +288 -0
- package/dist/esm/api/hooks/reviewer.mjs.map +1 -0
- package/dist/esm/api/hooks/search.mjs +18 -0
- package/dist/esm/api/hooks/search.mjs.map +1 -0
- package/dist/esm/api/hooks/showcaseProject.mjs +95 -0
- package/dist/esm/api/hooks/showcaseProject.mjs.map +1 -0
- package/dist/esm/api/hooks/stripe.mjs +261 -0
- package/dist/esm/api/hooks/stripe.mjs.map +1 -0
- package/dist/esm/api/hooks/tag.mjs +45 -0
- package/dist/esm/api/hooks/tag.mjs.map +1 -0
- package/dist/esm/api/hooks/translate.mjs +47 -0
- package/dist/esm/api/hooks/translate.mjs.map +1 -0
- package/dist/esm/api/hooks/user.mjs +58 -0
- package/dist/esm/api/hooks/user.mjs.map +1 -0
- package/dist/esm/api/hooks/utils.mjs +30 -0
- package/dist/esm/api/hooks/utils.mjs.map +1 -0
- package/dist/esm/api/index.mjs +26 -0
- package/dist/esm/{hooks → api}/useAuth/useAuth.mjs +1 -1
- package/dist/esm/api/useAuth/useAuth.mjs.map +1 -0
- package/dist/esm/{hooks → api}/useAuth/useOAuth2.mjs +3 -3
- package/dist/esm/api/useAuth/useOAuth2.mjs.map +1 -0
- package/dist/esm/{hooks → api}/useAuth/useSession.mjs +3 -4
- package/dist/esm/api/useAuth/useSession.mjs.map +1 -0
- package/dist/esm/api/useIntlayerAPI.mjs +123 -0
- package/dist/esm/api/useIntlayerAPI.mjs.map +1 -0
- package/dist/esm/{hooks → api}/useUser/index.mjs +2 -2
- package/dist/esm/api/useUser/index.mjs.map +1 -0
- package/dist/esm/components/Badge/index.mjs +1 -3
- package/dist/esm/components/Badge/index.mjs.map +1 -1
- package/dist/esm/components/Breadcrumb/index.mjs +0 -1
- package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/esm/components/Button/Button.mjs +3 -5
- package/dist/esm/components/Button/Button.mjs.map +1 -1
- package/dist/esm/components/Carousel/index.mjs +3 -3
- package/dist/esm/components/Carousel/index.mjs.map +1 -1
- package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
- package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +3 -2
- package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +4 -2
- package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +3 -2
- package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs +2 -2
- package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
- package/dist/esm/components/IDE/FileList.mjs +1 -1
- package/dist/esm/components/IDE/FileList.mjs.map +1 -1
- package/dist/esm/components/IDE/IDE.mjs +1 -1
- package/dist/esm/components/IDE/IDE.mjs.map +1 -1
- package/dist/esm/components/Input/Checkbox.mjs +1 -3
- package/dist/esm/components/Input/Checkbox.mjs.map +1 -1
- package/dist/esm/components/Label/index.mjs +2 -2
- package/dist/esm/components/Label/index.mjs.map +1 -1
- package/dist/esm/components/LanguageBackground/LanguageSection.mjs +8 -6
- package/dist/esm/components/LanguageBackground/LanguageSection.mjs.map +1 -1
- package/dist/esm/components/LanguageBackground/index.mjs +13 -5
- package/dist/esm/components/LanguageBackground/index.mjs.map +1 -1
- package/dist/esm/components/Link/Link.mjs +0 -7
- package/dist/esm/components/Link/Link.mjs.map +1 -1
- package/dist/esm/components/Loader/spinner.mjs +1 -1
- package/dist/esm/components/Loader/spinner.mjs.map +1 -1
- package/dist/esm/components/Pagination/Pagination.mjs +1 -2
- package/dist/esm/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/esm/components/Popover/dynamic.mjs +2 -2
- package/dist/esm/components/Popover/dynamic.mjs.map +1 -1
- package/dist/esm/components/SwitchSelector/SwitchSelector.mjs +3 -5
- package/dist/esm/components/SwitchSelector/SwitchSelector.mjs.map +1 -1
- package/dist/esm/components/SwitchSelector/VerticalSwitchSelector.mjs +3 -3
- package/dist/esm/components/SwitchSelector/VerticalSwitchSelector.mjs.map +1 -1
- package/dist/esm/components/TabSelector/TabSelector.mjs +3 -3
- package/dist/esm/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/esm/components/Tag/index.mjs +1 -1
- package/dist/esm/components/Tag/index.mjs.map +1 -1
- package/dist/esm/components/Terminal/Terminal.mjs +1 -1
- package/dist/esm/components/Terminal/Terminal.mjs.map +1 -1
- package/dist/esm/components/TextArea/AutoSizeTextArea.mjs +2 -2
- package/dist/esm/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
- package/dist/esm/components/TextArea/ContentEditableTextArea.mjs +3 -3
- package/dist/esm/components/TextArea/ContentEditableTextArea.mjs.map +1 -1
- package/dist/esm/components/Toaster/Toast.mjs +3 -3
- package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
- package/dist/esm/components/WithResizer/index.mjs +7 -2
- package/dist/esm/components/WithResizer/index.mjs.map +1 -1
- package/dist/esm/hooks/index.mjs +1 -7
- package/dist/esm/libs/auth.mjs +1 -1
- package/dist/esm/routes.mjs +23 -1
- package/dist/esm/routes.mjs.map +1 -1
- package/dist/types/api/hooks/ai.d.ts +12 -0
- package/dist/types/api/hooks/ai.d.ts.map +1 -0
- package/dist/types/api/hooks/audit.d.ts +10 -0
- package/dist/types/api/hooks/audit.d.ts.map +1 -0
- package/dist/types/api/hooks/auth.d.ts +29 -0
- package/dist/types/api/hooks/auth.d.ts.map +1 -0
- package/dist/types/api/hooks/bitbucket.d.ts +8 -0
- package/dist/types/api/hooks/bitbucket.d.ts.map +1 -0
- package/dist/types/api/hooks/dictionary.d.ts +15 -0
- package/dist/types/api/hooks/dictionary.d.ts.map +1 -0
- package/dist/types/api/hooks/discussions.d.ts +8 -0
- package/dist/types/api/hooks/discussions.d.ts.map +1 -0
- package/dist/types/api/hooks/editor.d.ts +6 -0
- package/dist/types/api/hooks/editor.d.ts.map +1 -0
- package/dist/types/api/hooks/github.d.ts +12 -0
- package/dist/types/api/hooks/github.d.ts.map +1 -0
- package/dist/types/api/hooks/gitlab.d.ts +8 -0
- package/dist/types/api/hooks/gitlab.d.ts.map +1 -0
- package/dist/types/api/hooks/newsletter.d.ts +7 -0
- package/dist/types/api/hooks/newsletter.d.ts.map +1 -0
- package/dist/types/api/hooks/organization.d.ts +16 -0
- package/dist/types/api/hooks/organization.d.ts.map +1 -0
- package/dist/types/api/hooks/project.d.ts +23 -0
- package/dist/types/api/hooks/project.d.ts.map +1 -0
- package/dist/types/api/hooks/reviewer.d.ts +39 -0
- package/dist/types/api/hooks/reviewer.d.ts.map +1 -0
- package/dist/types/api/hooks/search.d.ts +7 -0
- package/dist/types/api/hooks/search.d.ts.map +1 -0
- package/dist/types/api/hooks/showcaseProject.d.ts +16 -0
- package/dist/types/api/hooks/showcaseProject.d.ts.map +1 -0
- package/dist/types/api/hooks/stripe.d.ts +33 -0
- package/dist/types/api/hooks/stripe.d.ts.map +1 -0
- package/dist/types/api/hooks/tag.d.ts +11 -0
- package/dist/types/api/hooks/tag.d.ts.map +1 -0
- package/dist/types/api/hooks/translate.d.ts +8 -0
- package/dist/types/api/hooks/translate.d.ts.map +1 -0
- package/dist/types/api/hooks/user.d.ts +13 -0
- package/dist/types/api/hooks/user.d.ts.map +1 -0
- package/dist/types/api/hooks/utils.d.ts +23 -0
- package/dist/types/api/hooks/utils.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +25 -0
- package/dist/types/{hooks → api}/useAuth/useAuth.d.ts +1 -1
- package/dist/types/api/useAuth/useAuth.d.ts.map +1 -0
- package/dist/types/{hooks → api}/useAuth/useOAuth2.d.ts +1 -1
- package/dist/types/api/useAuth/useOAuth2.d.ts.map +1 -0
- package/dist/types/{hooks → api}/useAuth/useSession.d.ts +1 -1
- package/dist/types/api/useAuth/useSession.d.ts.map +1 -0
- package/dist/types/api/useIntlayerAPI.d.ts +297 -0
- package/dist/types/api/useIntlayerAPI.d.ts.map +1 -0
- package/dist/types/{hooks → api}/useUser/index.d.ts +1 -1
- package/dist/types/api/useUser/index.d.ts.map +1 -0
- package/dist/types/components/Badge/index.d.ts +3 -4
- package/dist/types/components/Badge/index.d.ts.map +1 -1
- package/dist/types/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/types/components/Button/Button.d.ts +5 -6
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Carousel/index.d.ts.map +1 -1
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
- package/dist/types/components/Container/index.d.ts +4 -4
- package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/types/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +1 -2
- package/dist/types/components/Input/Checkbox.d.ts.map +1 -1
- package/dist/types/components/LanguageBackground/index.d.ts.map +1 -1
- package/dist/types/components/Link/Link.d.ts +2 -3
- package/dist/types/components/Link/Link.d.ts.map +1 -1
- package/dist/types/components/Loader/spinner.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +2 -3
- package/dist/types/components/SwitchSelector/SwitchSelector.d.ts.map +1 -1
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +1 -1
- package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts.map +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +2 -2
- package/dist/types/components/TabSelector/TabSelector.d.ts.map +1 -1
- package/dist/types/components/Tag/index.d.ts +2 -2
- package/dist/types/components/TextArea/ContentEditableTextArea.d.ts.map +1 -1
- package/dist/types/components/Toaster/Toast.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +1 -7
- package/dist/types/providers/ReactQueryProvider.d.ts +1 -1
- package/dist/types/routes.d.ts +23 -1
- package/dist/types/routes.d.ts.map +1 -1
- package/package.json +35 -30
- package/tailwind.css +0 -19
- package/dist/esm/hooks/reactQuery.mjs +0 -1187
- package/dist/esm/hooks/reactQuery.mjs.map +0 -1
- package/dist/esm/hooks/useAuth/useAuth.mjs.map +0 -1
- package/dist/esm/hooks/useAuth/useOAuth2.mjs.map +0 -1
- package/dist/esm/hooks/useAuth/useSession.mjs.map +0 -1
- package/dist/esm/hooks/useIntlayerAPI.mjs +0 -22
- package/dist/esm/hooks/useIntlayerAPI.mjs.map +0 -1
- package/dist/esm/hooks/useUser/index.mjs.map +0 -1
- package/dist/types/hooks/reactQuery.d.ts +0 -188
- package/dist/types/hooks/reactQuery.d.ts.map +0 -1
- package/dist/types/hooks/useAuth/useAuth.d.ts.map +0 -1
- package/dist/types/hooks/useAuth/useOAuth2.d.ts.map +0 -1
- package/dist/types/hooks/useAuth/useSession.d.ts.map +0 -1
- package/dist/types/hooks/useIntlayerAPI.d.ts +0 -14
- package/dist/types/hooks/useIntlayerAPI.d.ts.map +0 -1
- package/dist/types/hooks/useUser/index.d.ts.map +0 -1
- /package/dist/esm/{hooks → api}/useAuth/index.mjs +0 -0
- /package/dist/types/{hooks → api}/useAuth/index.d.ts +0 -0
|
@@ -1,1187 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
4
|
-
import { useIntlayerAuth, useIntlayerOAuth } from "./useIntlayerAPI.mjs";
|
|
5
|
-
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import { useConfiguration } from "@intlayer/editor-react";
|
|
7
|
-
|
|
8
|
-
//#region src/hooks/reactQuery.ts
|
|
9
|
-
/**
|
|
10
|
-
* Hook to enable authentication
|
|
11
|
-
*/
|
|
12
|
-
const useAuthEnable = ({ requireUser, requireProject, requireOrganization }) => {
|
|
13
|
-
const { oAuth2AccessToken, session } = useAuth({ intlayerConfiguration: useConfiguration() });
|
|
14
|
-
const user = session ? session.user : oAuth2AccessToken?.user;
|
|
15
|
-
const organization = session ? session.organization : oAuth2AccessToken?.organization;
|
|
16
|
-
const project = session ? session.project : oAuth2AccessToken?.project;
|
|
17
|
-
return { enable: (requireUser ? Boolean(user) : true) && (requireProject ? Boolean(project) : true) && (requireOrganization ? Boolean(organization) : true) };
|
|
18
|
-
};
|
|
19
|
-
const useAppQuery = (options) => {
|
|
20
|
-
const { requireUser, requireProject, requireOrganization, ...rest } = options;
|
|
21
|
-
const { enable } = useAuthEnable({
|
|
22
|
-
requireUser,
|
|
23
|
-
requireProject,
|
|
24
|
-
requireOrganization
|
|
25
|
-
});
|
|
26
|
-
return useQuery({
|
|
27
|
-
enabled: rest?.enabled === false ? false : enable,
|
|
28
|
-
...rest
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Auth
|
|
33
|
-
*/
|
|
34
|
-
const useLogin = () => {
|
|
35
|
-
const intlayerAuth = useIntlayerAuth();
|
|
36
|
-
const queryClient = useQueryClient();
|
|
37
|
-
return useMutation({
|
|
38
|
-
mutationKey: ["login"],
|
|
39
|
-
mutationFn: (args) => intlayerAuth.signInEmail(args),
|
|
40
|
-
onSuccess: (data) => {
|
|
41
|
-
const session = queryClient.getQueryData(["session"]);
|
|
42
|
-
queryClient.setQueryData(["session"], {
|
|
43
|
-
...session,
|
|
44
|
-
user: data.data.user
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
const useListAccounts = () => {
|
|
50
|
-
const intlayerAuth = useIntlayerAuth();
|
|
51
|
-
return useQuery({
|
|
52
|
-
queryKey: ["listAccounts"],
|
|
53
|
-
queryFn: () => intlayerAuth.listAccounts()
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
const useUnlinkAccount = () => {
|
|
57
|
-
const intlayerAuth = useIntlayerAuth();
|
|
58
|
-
const queryClient = useQueryClient();
|
|
59
|
-
return useMutation({
|
|
60
|
-
mutationKey: ["unlinkAccount"],
|
|
61
|
-
mutationFn: (args) => intlayerAuth.unlinkAccount(args),
|
|
62
|
-
onSuccess: () => {
|
|
63
|
-
queryClient.invalidateQueries({ queryKey: ["listAccounts"] });
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const useLinkSocial = () => {
|
|
68
|
-
const intlayerAuth = useIntlayerAuth();
|
|
69
|
-
const queryClient = useQueryClient();
|
|
70
|
-
return useMutation({
|
|
71
|
-
mutationKey: ["linkSocial"],
|
|
72
|
-
mutationFn: (args) => intlayerAuth.linkSocial(args),
|
|
73
|
-
onSuccess: () => {
|
|
74
|
-
queryClient.invalidateQueries({ queryKey: ["listAccounts"] });
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
const useGetVerifyEmailStatus = () => {
|
|
79
|
-
const intlayerAuth = useIntlayerAuth();
|
|
80
|
-
return useMutation({
|
|
81
|
-
mutationKey: ["getVerifyEmailStatus"],
|
|
82
|
-
mutationFn: (args) => intlayerAuth.verifyEmailSession(...args)
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
const useRegister = () => {
|
|
86
|
-
const intlayerAuth = useIntlayerAuth();
|
|
87
|
-
return useMutation({
|
|
88
|
-
mutationKey: ["register"],
|
|
89
|
-
mutationFn: (args) => intlayerAuth.signUpEmail(args)
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
const useLogout = () => {
|
|
93
|
-
const intlayerAuth = useIntlayerAuth();
|
|
94
|
-
return useMutation({
|
|
95
|
-
mutationKey: ["logout"],
|
|
96
|
-
mutationFn: () => intlayerAuth.signOut(),
|
|
97
|
-
meta: { resetQueries: [
|
|
98
|
-
["session"],
|
|
99
|
-
["users"],
|
|
100
|
-
["organizations"],
|
|
101
|
-
["projects"],
|
|
102
|
-
["dictionaries"],
|
|
103
|
-
["tags"]
|
|
104
|
-
] }
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
const useChangePassword = () => {
|
|
108
|
-
const intlayerAuth = useIntlayerAuth();
|
|
109
|
-
return useMutation({
|
|
110
|
-
mutationKey: ["changePassword"],
|
|
111
|
-
mutationFn: (args) => intlayerAuth.changePasswordSession(...args)
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
const useAskResetPassword = () => {
|
|
115
|
-
const intlayerAuth = useIntlayerAuth();
|
|
116
|
-
return useMutation({
|
|
117
|
-
mutationKey: ["askResetPassword"],
|
|
118
|
-
mutationFn: (args) => intlayerAuth.requestPasswordResetSession(args)
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
const useResetPassword = () => {
|
|
122
|
-
const intlayerAuth = useIntlayerAuth();
|
|
123
|
-
return useMutation({
|
|
124
|
-
mutationKey: ["resetPassword"],
|
|
125
|
-
mutationFn: (args) => intlayerAuth.resetPassword(args)
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
const useVerifyEmail = () => {
|
|
129
|
-
const intlayerAuth = useIntlayerAuth();
|
|
130
|
-
return useMutation({
|
|
131
|
-
mutationKey: ["verifyEmail"],
|
|
132
|
-
mutationFn: (args) => intlayerAuth.verifyEmailSession(args)
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
const useGetUserByAccount = () => {
|
|
136
|
-
const intlayerAuth = useIntlayerAuth();
|
|
137
|
-
return useMutation({
|
|
138
|
-
mutationKey: ["user"],
|
|
139
|
-
mutationFn: (args) => intlayerAuth.accountInfo(args)
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
const useEnableTwoFactor = () => {
|
|
143
|
-
const intlayerAuth = useIntlayerAuth();
|
|
144
|
-
return useMutation({
|
|
145
|
-
mutationKey: ["enableTwoFactor"],
|
|
146
|
-
mutationFn: (args) => intlayerAuth.enableTwoFactor(args)
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
const useDisableTwoFactor = () => {
|
|
150
|
-
const intlayerAuth = useIntlayerAuth();
|
|
151
|
-
return useMutation({
|
|
152
|
-
mutationKey: ["disableTwoFactor"],
|
|
153
|
-
mutationFn: (args) => intlayerAuth.disableTwoFactor(args)
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
const useVerifyTotp = () => {
|
|
157
|
-
const intlayerAuth = useIntlayerAuth();
|
|
158
|
-
return useMutation({
|
|
159
|
-
mutationKey: ["verifyTotp"],
|
|
160
|
-
mutationFn: (args) => intlayerAuth.verifyTotp(args)
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
const useVerifyBackupCode = () => {
|
|
164
|
-
const intlayerAuth = useIntlayerAuth();
|
|
165
|
-
return useMutation({
|
|
166
|
-
mutationKey: ["verifyBackupCode"],
|
|
167
|
-
mutationFn: (args) => intlayerAuth.verifyBackupCode(args)
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
const useAddPasskey = () => {
|
|
171
|
-
const intlayerAuth = useIntlayerAuth();
|
|
172
|
-
return useMutation({
|
|
173
|
-
mutationKey: ["addPasskey"],
|
|
174
|
-
mutationFn: (args) => intlayerAuth.addPasskey(args)
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
const useSignInPasskey = () => {
|
|
178
|
-
const intlayerAuth = useIntlayerAuth();
|
|
179
|
-
return useMutation({
|
|
180
|
-
mutationKey: ["signInPasskey"],
|
|
181
|
-
mutationFn: (args) => intlayerAuth.signInPasskey(args)
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
const useDeletePasskey = () => {
|
|
185
|
-
const intlayerAuth = useIntlayerAuth();
|
|
186
|
-
return useMutation({
|
|
187
|
-
mutationKey: ["deletePasskey"],
|
|
188
|
-
mutationFn: (args) => intlayerAuth.deletePasskey(args)
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
const useListPasskeys = () => {
|
|
192
|
-
const intlayerAuth = useIntlayerAuth();
|
|
193
|
-
return useQuery({
|
|
194
|
-
queryKey: ["listPasskeys"],
|
|
195
|
-
queryFn: () => intlayerAuth.listPasskeys()
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
const useSignInMagicLink = () => {
|
|
199
|
-
const intlayerAuth = useIntlayerAuth();
|
|
200
|
-
return useMutation({
|
|
201
|
-
mutationKey: ["signInMagicLink"],
|
|
202
|
-
mutationFn: (args) => intlayerAuth.signInMagicLink(args)
|
|
203
|
-
});
|
|
204
|
-
};
|
|
205
|
-
const useRegisterSSO = () => {
|
|
206
|
-
const intlayerAuth = useIntlayerAuth();
|
|
207
|
-
const queryClient = useQueryClient();
|
|
208
|
-
return useMutation({
|
|
209
|
-
mutationKey: ["registerSSO"],
|
|
210
|
-
mutationFn: (args) => intlayerAuth.registerSSO(args),
|
|
211
|
-
onSuccess: () => {
|
|
212
|
-
queryClient.invalidateQueries({ queryKey: ["ssoProviders"] });
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
const useSignInSSO = () => {
|
|
217
|
-
const intlayerAuth = useIntlayerAuth();
|
|
218
|
-
return useMutation({
|
|
219
|
-
mutationKey: ["signInSSO"],
|
|
220
|
-
mutationFn: (args) => intlayerAuth.signInSSO(args)
|
|
221
|
-
});
|
|
222
|
-
};
|
|
223
|
-
const useListSSOProviders = () => {
|
|
224
|
-
const intlayerAuth = useIntlayerAuth();
|
|
225
|
-
return useQuery({
|
|
226
|
-
queryKey: ["ssoProviders"],
|
|
227
|
-
queryFn: () => intlayerAuth.listSSOProviders()
|
|
228
|
-
});
|
|
229
|
-
};
|
|
230
|
-
const useDeleteSSOProvider = () => {
|
|
231
|
-
const intlayerAuth = useIntlayerAuth();
|
|
232
|
-
const queryClient = useQueryClient();
|
|
233
|
-
return useMutation({
|
|
234
|
-
mutationKey: ["deleteSSOProvider"],
|
|
235
|
-
mutationFn: (args) => intlayerAuth.deleteSSOProvider(args),
|
|
236
|
-
onSuccess: () => {
|
|
237
|
-
queryClient.invalidateQueries({ queryKey: ["ssoProviders"] });
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
/**
|
|
242
|
-
* User
|
|
243
|
-
*/
|
|
244
|
-
const useGetUsers = (filters, options) => {
|
|
245
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
246
|
-
return useAppQuery({
|
|
247
|
-
queryKey: ["users", filters],
|
|
248
|
-
queryFn: () => intlayerOAuth.user.getUsers(filters),
|
|
249
|
-
requireUser: true,
|
|
250
|
-
...options
|
|
251
|
-
});
|
|
252
|
-
};
|
|
253
|
-
const useGetUserById = (userId) => {
|
|
254
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
255
|
-
return useAppQuery({
|
|
256
|
-
queryKey: ["users", userId],
|
|
257
|
-
queryFn: () => intlayerOAuth.user.getUserById(userId),
|
|
258
|
-
requireUser: true
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
const useCreateUser = () => {
|
|
262
|
-
const intlayerAuth = useIntlayerOAuth();
|
|
263
|
-
return useMutation({
|
|
264
|
-
mutationKey: ["users"],
|
|
265
|
-
mutationFn: (args) => intlayerAuth.user.createUser(args)
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
const useUpdateUser = () => {
|
|
269
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
270
|
-
return useMutation({
|
|
271
|
-
mutationKey: ["users"],
|
|
272
|
-
mutationFn: (args) => intlayerOAuth.user.updateUser(args)
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
const useDeleteUser = () => {
|
|
276
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
277
|
-
return useMutation({
|
|
278
|
-
mutationKey: ["users"],
|
|
279
|
-
mutationFn: (args) => intlayerOAuth.user.deleteUser(args),
|
|
280
|
-
meta: { invalidateQueries: [["users"]] }
|
|
281
|
-
});
|
|
282
|
-
};
|
|
283
|
-
const useUploadUserAvatar = () => {
|
|
284
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
285
|
-
return useMutation({
|
|
286
|
-
mutationKey: ["users", "avatar"],
|
|
287
|
-
mutationFn: (file) => intlayerOAuth.user.uploadAvatar(file),
|
|
288
|
-
meta: { invalidateQueries: [["session"]] }
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* Organization
|
|
293
|
-
*/
|
|
294
|
-
const useGetOrganizations = (filters) => {
|
|
295
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
296
|
-
return useAppQuery({
|
|
297
|
-
queryKey: ["organizations", filters],
|
|
298
|
-
queryFn: ({ signal }) => intlayerOAuth.organization.getOrganizations(filters, { signal }),
|
|
299
|
-
requireUser: true
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
|
-
const useAddOrganization = () => {
|
|
303
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
304
|
-
return useMutation({
|
|
305
|
-
mutationKey: ["organizations"],
|
|
306
|
-
mutationFn: (args) => intlayerOAuth.organization.addOrganization(args),
|
|
307
|
-
meta: { invalidateQueries: [["organizations"]] }
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
|
-
const useUpdateOrganization = () => {
|
|
311
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
312
|
-
return useMutation({
|
|
313
|
-
mutationKey: ["organizations"],
|
|
314
|
-
mutationFn: (args) => intlayerOAuth.organization.updateOrganization(args)
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
const useUpdateOrganizationMembers = () => {
|
|
318
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
319
|
-
return useMutation({
|
|
320
|
-
mutationKey: ["organizations"],
|
|
321
|
-
mutationFn: (args) => intlayerOAuth.organization.updateOrganizationMembers(args),
|
|
322
|
-
meta: { invalidateQueries: [["organizations"], ["users"]] }
|
|
323
|
-
});
|
|
324
|
-
};
|
|
325
|
-
const useUpdateOrganizationMembersById = () => {
|
|
326
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
327
|
-
return useMutation({
|
|
328
|
-
mutationKey: ["organizations"],
|
|
329
|
-
mutationFn: ({ organizationId, ...body }) => intlayerOAuth.organization.updateOrganizationMembersById(organizationId, body),
|
|
330
|
-
meta: { invalidateQueries: [["organizations"], ["users"]] }
|
|
331
|
-
});
|
|
332
|
-
};
|
|
333
|
-
const useAddOrganizationMember = () => {
|
|
334
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
335
|
-
return useMutation({
|
|
336
|
-
mutationKey: ["organizations"],
|
|
337
|
-
mutationFn: (args) => intlayerOAuth.organization.addOrganizationMember(args),
|
|
338
|
-
meta: { invalidateQueries: [["organizations"]] }
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
const useDeleteOrganization = () => {
|
|
342
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
343
|
-
return useMutation({
|
|
344
|
-
mutationKey: ["organizations"],
|
|
345
|
-
mutationFn: () => intlayerOAuth.organization.deleteOrganization(),
|
|
346
|
-
meta: { invalidateQueries: [["organizations"], ["session"]] }
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
const useDeleteOrganizationById = () => {
|
|
350
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
351
|
-
return useMutation({
|
|
352
|
-
mutationKey: ["organizations"],
|
|
353
|
-
mutationFn: (organizationId) => intlayerOAuth.organization.deleteOrganizationByIdAdmin(organizationId),
|
|
354
|
-
meta: { invalidateQueries: [["organizations"]] }
|
|
355
|
-
});
|
|
356
|
-
};
|
|
357
|
-
const useSelectOrganization = () => {
|
|
358
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
359
|
-
const queryClient = useQueryClient();
|
|
360
|
-
return useMutation({
|
|
361
|
-
mutationKey: ["session-organizations"],
|
|
362
|
-
mutationFn: (args) => intlayerOAuth.organization.selectOrganization(args),
|
|
363
|
-
meta: { invalidateQueries: [
|
|
364
|
-
["session"],
|
|
365
|
-
["organizations"],
|
|
366
|
-
["projects"],
|
|
367
|
-
["dictionaries"],
|
|
368
|
-
["tags"],
|
|
369
|
-
["subscription"],
|
|
370
|
-
["users"]
|
|
371
|
-
] },
|
|
372
|
-
onSuccess: (data) => {
|
|
373
|
-
const session = queryClient.getQueryData(["session"]);
|
|
374
|
-
queryClient.setQueryData(["session"], {
|
|
375
|
-
...session ?? {},
|
|
376
|
-
organization: data.data
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
};
|
|
381
|
-
const useUnselectOrganization = () => {
|
|
382
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
383
|
-
const queryClient = useQueryClient();
|
|
384
|
-
return useMutation({
|
|
385
|
-
mutationKey: ["session-organizations"],
|
|
386
|
-
mutationFn: () => intlayerOAuth.organization.unselectOrganization(),
|
|
387
|
-
meta: { resetQueries: [
|
|
388
|
-
["session"],
|
|
389
|
-
["organizations"],
|
|
390
|
-
["projects"],
|
|
391
|
-
["dictionaries"],
|
|
392
|
-
["tags"],
|
|
393
|
-
["subscription"],
|
|
394
|
-
["users"]
|
|
395
|
-
] },
|
|
396
|
-
onSuccess: () => {
|
|
397
|
-
const session = queryClient.getQueryData(["session"]);
|
|
398
|
-
queryClient.setQueryData(["session"], {
|
|
399
|
-
...session ?? {},
|
|
400
|
-
organization: null,
|
|
401
|
-
project: null
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
};
|
|
406
|
-
/**
|
|
407
|
-
* Project
|
|
408
|
-
*/
|
|
409
|
-
const useGetProjects = (filters, options) => {
|
|
410
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
411
|
-
return useAppQuery({
|
|
412
|
-
queryKey: ["projects", filters],
|
|
413
|
-
queryFn: ({ signal }) => intlayerOAuth.project.getProjects(filters, { signal }),
|
|
414
|
-
requireUser: true,
|
|
415
|
-
requireOrganization: true,
|
|
416
|
-
...options
|
|
417
|
-
});
|
|
418
|
-
};
|
|
419
|
-
const useAddProject = () => {
|
|
420
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
421
|
-
return useMutation({
|
|
422
|
-
mutationKey: ["projects"],
|
|
423
|
-
mutationFn: (args) => intlayerOAuth.project.addProject(args),
|
|
424
|
-
meta: { invalidateQueries: [["projects"]] }
|
|
425
|
-
});
|
|
426
|
-
};
|
|
427
|
-
const useUpdateProject = () => {
|
|
428
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
429
|
-
const queryClient = useQueryClient();
|
|
430
|
-
return useMutation({
|
|
431
|
-
mutationKey: ["projects"],
|
|
432
|
-
mutationFn: (args) => intlayerOAuth.project.updateProject(args),
|
|
433
|
-
meta: { invalidateQueries: [["projects"]] },
|
|
434
|
-
onSuccess: (data) => {
|
|
435
|
-
const session = queryClient.getQueryData(["session"]);
|
|
436
|
-
queryClient.setQueryData(["session"], {
|
|
437
|
-
...session ?? {},
|
|
438
|
-
project: data.data
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
};
|
|
443
|
-
const usePushProjectConfiguration = () => {
|
|
444
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
445
|
-
const queryClient = useQueryClient();
|
|
446
|
-
return useMutation({
|
|
447
|
-
mutationKey: ["project", "push-configuration"],
|
|
448
|
-
mutationFn: (args) => intlayerOAuth.project.pushProjectConfiguration(args),
|
|
449
|
-
onSuccess: (data) => {
|
|
450
|
-
const session = queryClient.getQueryData(["session"]);
|
|
451
|
-
queryClient.setQueryData(["session"], {
|
|
452
|
-
...session ?? {},
|
|
453
|
-
project: data.data
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
};
|
|
458
|
-
const useUpdateProjectMembers = () => {
|
|
459
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
460
|
-
return useMutation({
|
|
461
|
-
mutationKey: ["projects"],
|
|
462
|
-
mutationFn: (args) => intlayerOAuth.project.updateProjectMembers(args),
|
|
463
|
-
meta: { invalidateQueries: [["projects"]] }
|
|
464
|
-
});
|
|
465
|
-
};
|
|
466
|
-
const useDeleteProject = () => {
|
|
467
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
468
|
-
return useMutation({
|
|
469
|
-
mutationKey: ["projects"],
|
|
470
|
-
mutationFn: () => intlayerOAuth.project.deleteProject(),
|
|
471
|
-
meta: { invalidateQueries: [["projects"]] }
|
|
472
|
-
});
|
|
473
|
-
};
|
|
474
|
-
const useDeleteProjectById = () => {
|
|
475
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
476
|
-
return useMutation({
|
|
477
|
-
mutationKey: ["projects"],
|
|
478
|
-
mutationFn: (projectId) => intlayerOAuth.project.deleteProjectByIdAdmin(projectId),
|
|
479
|
-
meta: { invalidateQueries: [["projects"]] }
|
|
480
|
-
});
|
|
481
|
-
};
|
|
482
|
-
const useSelectProject = () => {
|
|
483
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
484
|
-
const queryClient = useQueryClient();
|
|
485
|
-
return useMutation({
|
|
486
|
-
mutationKey: ["session-projects"],
|
|
487
|
-
mutationFn: (args) => intlayerOAuth.project.selectProject(args),
|
|
488
|
-
meta: { invalidateQueries: [
|
|
489
|
-
["session"],
|
|
490
|
-
["projects"],
|
|
491
|
-
["dictionaries"],
|
|
492
|
-
["tags"],
|
|
493
|
-
["subscription"],
|
|
494
|
-
["users"]
|
|
495
|
-
] },
|
|
496
|
-
onSuccess: (data) => {
|
|
497
|
-
const session = queryClient.getQueryData(["session"]);
|
|
498
|
-
queryClient.setQueryData(["session"], {
|
|
499
|
-
...session ?? {},
|
|
500
|
-
project: data.data
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
};
|
|
505
|
-
const useUnselectProject = () => {
|
|
506
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
507
|
-
const queryClient = useQueryClient();
|
|
508
|
-
return useMutation({
|
|
509
|
-
mutationKey: ["session-projects"],
|
|
510
|
-
mutationFn: () => intlayerOAuth.project.unselectProject(),
|
|
511
|
-
meta: { resetQueries: [
|
|
512
|
-
["session"],
|
|
513
|
-
["projects"],
|
|
514
|
-
["dictionaries"],
|
|
515
|
-
["tags"],
|
|
516
|
-
["subscription"],
|
|
517
|
-
["users"]
|
|
518
|
-
] },
|
|
519
|
-
onSuccess: () => {
|
|
520
|
-
const session = queryClient.getQueryData(["session"]);
|
|
521
|
-
queryClient.setQueryData(["session"], {
|
|
522
|
-
...session ?? {},
|
|
523
|
-
project: null
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
});
|
|
527
|
-
};
|
|
528
|
-
const useGetCIConfig = (options) => {
|
|
529
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
530
|
-
return useAppQuery({
|
|
531
|
-
queryKey: ["ci-config"],
|
|
532
|
-
queryFn: ({ signal }) => intlayerOAuth.project.getCIConfig({ signal }),
|
|
533
|
-
requireProject: true,
|
|
534
|
-
...options
|
|
535
|
-
});
|
|
536
|
-
};
|
|
537
|
-
const usePushCIConfig = () => {
|
|
538
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
539
|
-
return useMutation({
|
|
540
|
-
mutationKey: ["ci-config"],
|
|
541
|
-
mutationFn: () => intlayerOAuth.project.pushCIConfig(),
|
|
542
|
-
meta: { invalidateQueries: [["ci-config"]] }
|
|
543
|
-
});
|
|
544
|
-
};
|
|
545
|
-
const useTriggerBuild = () => {
|
|
546
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
547
|
-
return useMutation({
|
|
548
|
-
mutationKey: ["projects", "build"],
|
|
549
|
-
mutationFn: () => intlayerOAuth.project.triggerBuild(),
|
|
550
|
-
meta: { invalidateQueries: [["projects"]] }
|
|
551
|
-
});
|
|
552
|
-
};
|
|
553
|
-
const useTriggerWebhook = () => {
|
|
554
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
555
|
-
return useMutation({
|
|
556
|
-
mutationKey: ["projects", "webhook"],
|
|
557
|
-
mutationFn: (webhookIndex) => intlayerOAuth.project.triggerWebhook(webhookIndex),
|
|
558
|
-
meta: { invalidateQueries: [["projects"]] }
|
|
559
|
-
});
|
|
560
|
-
};
|
|
561
|
-
const useAddNewAccessKey = () => {
|
|
562
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
563
|
-
return useMutation({
|
|
564
|
-
mutationKey: ["session", "access-keys"],
|
|
565
|
-
mutationFn: (args) => intlayerOAuth.project.addNewAccessKey(args),
|
|
566
|
-
meta: { invalidateQueries: [["session"]] }
|
|
567
|
-
});
|
|
568
|
-
};
|
|
569
|
-
const useDeleteAccessKey = () => {
|
|
570
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
571
|
-
return useMutation({
|
|
572
|
-
mutationKey: ["session", "access-keys"],
|
|
573
|
-
mutationFn: (args) => intlayerOAuth.project.deleteAccessKey(args),
|
|
574
|
-
meta: { invalidateQueries: [["session"]] }
|
|
575
|
-
});
|
|
576
|
-
};
|
|
577
|
-
const useRefreshAccessKey = () => {
|
|
578
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
579
|
-
return useMutation({
|
|
580
|
-
mutationKey: ["session", "access-keys"],
|
|
581
|
-
mutationFn: (args) => intlayerOAuth.project.refreshAccessKey(args),
|
|
582
|
-
meta: { invalidateQueries: [["session"]] }
|
|
583
|
-
});
|
|
584
|
-
};
|
|
585
|
-
/**
|
|
586
|
-
* Dictionary
|
|
587
|
-
*/
|
|
588
|
-
const useGetDictionaries = (filters, options) => {
|
|
589
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
590
|
-
return useAppQuery({
|
|
591
|
-
queryKey: ["dictionaries", filters],
|
|
592
|
-
queryFn: ({ signal }) => intlayerOAuth.dictionary.getDictionaries(filters, { signal }),
|
|
593
|
-
requireUser: true,
|
|
594
|
-
requireOrganization: true,
|
|
595
|
-
requireProject: true,
|
|
596
|
-
...options
|
|
597
|
-
});
|
|
598
|
-
};
|
|
599
|
-
const useInfiniteGetDictionaries = (filters, options) => {
|
|
600
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
601
|
-
const { enable } = useAuthEnable({
|
|
602
|
-
requireUser: true,
|
|
603
|
-
requireOrganization: true,
|
|
604
|
-
requireProject: true
|
|
605
|
-
});
|
|
606
|
-
return useInfiniteQuery({
|
|
607
|
-
queryKey: [
|
|
608
|
-
"dictionaries",
|
|
609
|
-
"infinite",
|
|
610
|
-
filters
|
|
611
|
-
],
|
|
612
|
-
queryFn: async ({ pageParam = 1, signal }) => {
|
|
613
|
-
return await intlayerOAuth.dictionary.getDictionaries({
|
|
614
|
-
...filters,
|
|
615
|
-
page: pageParam
|
|
616
|
-
}, { signal });
|
|
617
|
-
},
|
|
618
|
-
getNextPageParam: (lastPage) => {
|
|
619
|
-
if (lastPage.data.length === 0) return void 0;
|
|
620
|
-
const currentPage = lastPage.page ?? 1;
|
|
621
|
-
return currentPage < (lastPage.total_pages ?? 1) ? currentPage + 1 : void 0;
|
|
622
|
-
},
|
|
623
|
-
initialPageParam: 1,
|
|
624
|
-
enabled: options?.enabled === false ? false : enable,
|
|
625
|
-
...options
|
|
626
|
-
});
|
|
627
|
-
};
|
|
628
|
-
const useGetDictionariesKeys = (options) => {
|
|
629
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
630
|
-
return useAppQuery({
|
|
631
|
-
queryKey: ["dictionariesKeys"],
|
|
632
|
-
queryFn: () => intlayerOAuth.dictionary.getDictionariesKeys(),
|
|
633
|
-
requireUser: true,
|
|
634
|
-
requireOrganization: true,
|
|
635
|
-
requireProject: true,
|
|
636
|
-
...options
|
|
637
|
-
});
|
|
638
|
-
};
|
|
639
|
-
const useGetDictionary = (dictionaryKey, version, options) => {
|
|
640
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
641
|
-
return useAppQuery({
|
|
642
|
-
queryKey: ["dictionary", dictionaryKey],
|
|
643
|
-
queryFn: ({ signal }) => intlayerOAuth.dictionary.getDictionary(dictionaryKey, version, { signal }),
|
|
644
|
-
requireUser: true,
|
|
645
|
-
requireOrganization: true,
|
|
646
|
-
requireProject: true,
|
|
647
|
-
...options
|
|
648
|
-
});
|
|
649
|
-
};
|
|
650
|
-
const useAddDictionary = () => {
|
|
651
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
652
|
-
return useMutation({
|
|
653
|
-
mutationKey: ["dictionaries"],
|
|
654
|
-
mutationFn: (args) => intlayerOAuth.dictionary.addDictionary(args),
|
|
655
|
-
meta: { invalidateQueries: [["dictionaries"], ["dictionariesKeys"]] }
|
|
656
|
-
});
|
|
657
|
-
};
|
|
658
|
-
const usePushDictionaries = () => {
|
|
659
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
660
|
-
return useMutation({
|
|
661
|
-
mutationKey: ["dictionaries"],
|
|
662
|
-
mutationFn: (args) => intlayerOAuth.dictionary.pushDictionaries(args.dictionaries),
|
|
663
|
-
meta: { invalidateQueries: [["dictionaries"], ["dictionariesKeys"]] }
|
|
664
|
-
});
|
|
665
|
-
};
|
|
666
|
-
const useUpdateDictionary = () => {
|
|
667
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
668
|
-
return useMutation({
|
|
669
|
-
mutationKey: ["dictionaries"],
|
|
670
|
-
mutationFn: (args) => intlayerOAuth.dictionary.updateDictionary(args),
|
|
671
|
-
meta: { invalidateQueries: [["dictionaries"], ["dictionariesKeys"]] }
|
|
672
|
-
});
|
|
673
|
-
};
|
|
674
|
-
const useDeleteDictionary = () => {
|
|
675
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
676
|
-
return useMutation({
|
|
677
|
-
mutationKey: ["dictionaries"],
|
|
678
|
-
mutationFn: (args) => intlayerOAuth.dictionary.deleteDictionary(args.dictionaryId),
|
|
679
|
-
meta: { invalidateQueries: [["dictionaries"], ["dictionariesKeys"]] }
|
|
680
|
-
});
|
|
681
|
-
};
|
|
682
|
-
/**
|
|
683
|
-
* Tag
|
|
684
|
-
*/
|
|
685
|
-
const useGetTags = (filters, options) => {
|
|
686
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
687
|
-
return useAppQuery({
|
|
688
|
-
queryKey: ["tags", filters],
|
|
689
|
-
queryFn: ({ signal }) => intlayerOAuth.tag.getTags(filters, { signal }),
|
|
690
|
-
requireUser: true,
|
|
691
|
-
requireOrganization: true,
|
|
692
|
-
...options
|
|
693
|
-
});
|
|
694
|
-
};
|
|
695
|
-
const useAddTag = () => {
|
|
696
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
697
|
-
return useMutation({
|
|
698
|
-
mutationKey: ["tags"],
|
|
699
|
-
mutationFn: (args) => intlayerOAuth.tag.addTag(args),
|
|
700
|
-
meta: { invalidateQueries: [["tags"]] }
|
|
701
|
-
});
|
|
702
|
-
};
|
|
703
|
-
const useUpdateTag = () => {
|
|
704
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
705
|
-
return useMutation({
|
|
706
|
-
mutationKey: ["tags"],
|
|
707
|
-
mutationFn: (v) => intlayerOAuth.tag.updateTag(v.tagId, v.tag),
|
|
708
|
-
meta: { invalidateQueries: [["tags"]] }
|
|
709
|
-
});
|
|
710
|
-
};
|
|
711
|
-
const useDeleteTag = () => {
|
|
712
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
713
|
-
return useMutation({
|
|
714
|
-
mutationKey: ["tags"],
|
|
715
|
-
mutationFn: (args) => intlayerOAuth.tag.deleteTag(args),
|
|
716
|
-
meta: { invalidateQueries: [["tags"]] }
|
|
717
|
-
});
|
|
718
|
-
};
|
|
719
|
-
/**
|
|
720
|
-
* Stripe
|
|
721
|
-
*/
|
|
722
|
-
const useGetPricing = (body, options) => {
|
|
723
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
724
|
-
return useQuery({
|
|
725
|
-
queryKey: ["pricing", body],
|
|
726
|
-
queryFn: ({ signal }) => intlayerOAuth.stripe.getPricing(body, { signal }),
|
|
727
|
-
...options
|
|
728
|
-
});
|
|
729
|
-
};
|
|
730
|
-
const useGetSubscription = (body, options) => {
|
|
731
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
732
|
-
return useAppQuery({
|
|
733
|
-
queryKey: ["subscription", body],
|
|
734
|
-
queryFn: ({ signal }) => intlayerOAuth.stripe.getSubscription(body, { signal }),
|
|
735
|
-
requireUser: true,
|
|
736
|
-
requireOrganization: true,
|
|
737
|
-
...options
|
|
738
|
-
});
|
|
739
|
-
};
|
|
740
|
-
const useCancelSubscription = () => {
|
|
741
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
742
|
-
return useMutation({
|
|
743
|
-
mutationKey: ["subscription"],
|
|
744
|
-
mutationFn: () => intlayerOAuth.stripe.cancelSubscription(),
|
|
745
|
-
meta: { invalidateQueries: [["session"], ["subscription"]] }
|
|
746
|
-
});
|
|
747
|
-
};
|
|
748
|
-
const useGetInvoices = (options) => {
|
|
749
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
750
|
-
return useAppQuery({
|
|
751
|
-
queryKey: ["invoices"],
|
|
752
|
-
queryFn: ({ signal }) => intlayerOAuth.stripe.getInvoices({ signal }),
|
|
753
|
-
requireUser: true,
|
|
754
|
-
requireOrganization: true,
|
|
755
|
-
...options
|
|
756
|
-
});
|
|
757
|
-
};
|
|
758
|
-
const useGetPaymentMethod = (options) => {
|
|
759
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
760
|
-
return useAppQuery({
|
|
761
|
-
queryKey: ["paymentMethod"],
|
|
762
|
-
queryFn: ({ signal }) => intlayerOAuth.stripe.getPaymentMethod({ signal }),
|
|
763
|
-
requireUser: true,
|
|
764
|
-
requireOrganization: true,
|
|
765
|
-
...options
|
|
766
|
-
});
|
|
767
|
-
};
|
|
768
|
-
const useCreatePortalSession = () => {
|
|
769
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
770
|
-
return useMutation({
|
|
771
|
-
mutationKey: ["portalSession"],
|
|
772
|
-
mutationFn: () => intlayerOAuth.stripe.createPortalSession()
|
|
773
|
-
});
|
|
774
|
-
};
|
|
775
|
-
/**
|
|
776
|
-
* AI
|
|
777
|
-
*/
|
|
778
|
-
const useTranslateJSONDeclaration = () => {
|
|
779
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
780
|
-
return useMutation({
|
|
781
|
-
mutationKey: ["ai-translateJSON"],
|
|
782
|
-
mutationFn: (args) => intlayerOAuth.ai.translateJSON(args)
|
|
783
|
-
});
|
|
784
|
-
};
|
|
785
|
-
const useAuditContentDeclaration = () => {
|
|
786
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
787
|
-
return useMutation({
|
|
788
|
-
mutationKey: ["ai-auditContentDeclaration"],
|
|
789
|
-
mutationFn: (args) => intlayerOAuth.ai.auditContentDeclaration(args)
|
|
790
|
-
});
|
|
791
|
-
};
|
|
792
|
-
const useAuditContentDeclarationMetadata = () => {
|
|
793
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
794
|
-
return useMutation({
|
|
795
|
-
mutationKey: ["ai-auditContentDeclarationMetadata"],
|
|
796
|
-
mutationFn: (args) => intlayerOAuth.ai.auditContentDeclarationMetadata(args)
|
|
797
|
-
});
|
|
798
|
-
};
|
|
799
|
-
const useAuditContentDeclarationField = () => {
|
|
800
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
801
|
-
return useMutation({
|
|
802
|
-
mutationKey: ["ai-auditContentDeclarationField"],
|
|
803
|
-
mutationFn: (args) => intlayerOAuth.ai.auditContentDeclarationField(args)
|
|
804
|
-
});
|
|
805
|
-
};
|
|
806
|
-
const useAuditTag = () => {
|
|
807
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
808
|
-
return useMutation({
|
|
809
|
-
mutationKey: ["ai-auditTag"],
|
|
810
|
-
mutationFn: (args) => intlayerOAuth.ai.auditTag(args)
|
|
811
|
-
});
|
|
812
|
-
};
|
|
813
|
-
const useAskDocQuestion = () => {
|
|
814
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
815
|
-
return useMutation({
|
|
816
|
-
mutationKey: [],
|
|
817
|
-
mutationFn: (args) => intlayerOAuth.ai.askDocQuestion(args)
|
|
818
|
-
});
|
|
819
|
-
};
|
|
820
|
-
const useChat = () => {
|
|
821
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
822
|
-
return useMutation({
|
|
823
|
-
mutationKey: ["ai-chat"],
|
|
824
|
-
mutationFn: (args) => intlayerOAuth.ai.chat(args)
|
|
825
|
-
});
|
|
826
|
-
};
|
|
827
|
-
const useAutocomplete = () => {
|
|
828
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
829
|
-
return useMutation({
|
|
830
|
-
mutationKey: ["ai-autocomplete"],
|
|
831
|
-
mutationFn: (args) => intlayerOAuth.ai.autocomplete(args)
|
|
832
|
-
});
|
|
833
|
-
};
|
|
834
|
-
/**
|
|
835
|
-
* Audit
|
|
836
|
-
*/
|
|
837
|
-
const useAuditScan = () => {
|
|
838
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
839
|
-
return useMutation({
|
|
840
|
-
mutationKey: ["audit-scan"],
|
|
841
|
-
mutationFn: (args) => intlayerOAuth.audit.scanUrl(args)
|
|
842
|
-
});
|
|
843
|
-
};
|
|
844
|
-
const useStartRecursiveAudit = () => {
|
|
845
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
846
|
-
return useMutation({
|
|
847
|
-
mutationKey: ["audit-recursive-start"],
|
|
848
|
-
mutationFn: (args) => intlayerOAuth.audit.startRecursiveAudit(args)
|
|
849
|
-
});
|
|
850
|
-
};
|
|
851
|
-
const useGetRecursiveAuditStatus = (params, options) => {
|
|
852
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
853
|
-
return useAppQuery({
|
|
854
|
-
queryKey: ["audit-recursive-status", params?.jobId],
|
|
855
|
-
queryFn: ({ signal }) => intlayerOAuth.audit.getRecursiveAuditStatus(params, { signal }),
|
|
856
|
-
enabled: Boolean(params?.jobId),
|
|
857
|
-
...options
|
|
858
|
-
});
|
|
859
|
-
};
|
|
860
|
-
/**
|
|
861
|
-
* Discussions
|
|
862
|
-
*/
|
|
863
|
-
const useGetDiscussions = (params, options) => {
|
|
864
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
865
|
-
return useAppQuery({
|
|
866
|
-
queryKey: ["discussions", params],
|
|
867
|
-
queryFn: ({ signal }) => intlayerOAuth.ai.getDiscussions(params, {
|
|
868
|
-
signal,
|
|
869
|
-
cache: "no-store"
|
|
870
|
-
}),
|
|
871
|
-
requireUser: true,
|
|
872
|
-
...options
|
|
873
|
-
});
|
|
874
|
-
};
|
|
875
|
-
const useGetDiscussionsData = (params, options) => {
|
|
876
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
877
|
-
return useAppQuery({
|
|
878
|
-
queryKey: ["discussions-data", params],
|
|
879
|
-
queryFn: ({ signal }) => intlayerOAuth.ai.getDiscussions({
|
|
880
|
-
includeMessages: "false",
|
|
881
|
-
...params ?? {}
|
|
882
|
-
}, {
|
|
883
|
-
signal,
|
|
884
|
-
cache: "no-store"
|
|
885
|
-
}),
|
|
886
|
-
requireUser: true,
|
|
887
|
-
...options
|
|
888
|
-
});
|
|
889
|
-
};
|
|
890
|
-
/**
|
|
891
|
-
* Search
|
|
892
|
-
*/
|
|
893
|
-
const useSearchDoc = (params) => {
|
|
894
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
895
|
-
return useQuery({
|
|
896
|
-
queryKey: ["search", params],
|
|
897
|
-
queryFn: () => intlayerOAuth.search.searchDoc(params),
|
|
898
|
-
enabled: (params?.input?.length ?? 0) > 3
|
|
899
|
-
});
|
|
900
|
-
};
|
|
901
|
-
/**
|
|
902
|
-
* Newsletter
|
|
903
|
-
*/
|
|
904
|
-
const useSubscribeToNewsletter = () => {
|
|
905
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
906
|
-
return useMutation({
|
|
907
|
-
mutationKey: ["newsletter"],
|
|
908
|
-
mutationFn: (args) => intlayerOAuth.newsletter.subscribeToNewsletter(args)
|
|
909
|
-
});
|
|
910
|
-
};
|
|
911
|
-
const useUnsubscribeFromNewsletter = () => {
|
|
912
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
913
|
-
return useMutation({
|
|
914
|
-
mutationKey: ["newsletter"],
|
|
915
|
-
mutationFn: (args) => intlayerOAuth.newsletter.unsubscribeFromNewsletter(args)
|
|
916
|
-
});
|
|
917
|
-
};
|
|
918
|
-
const useGetNewsletterStatus = () => {
|
|
919
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
920
|
-
return useMutation({
|
|
921
|
-
mutationKey: ["newsletter"],
|
|
922
|
-
mutationFn: () => intlayerOAuth.newsletter.getNewsletterStatus()
|
|
923
|
-
});
|
|
924
|
-
};
|
|
925
|
-
/**
|
|
926
|
-
* GitHub
|
|
927
|
-
*/
|
|
928
|
-
const useGithubGetAuthUrl = () => {
|
|
929
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
930
|
-
return useMutation({
|
|
931
|
-
mutationKey: ["github", "auth-url"],
|
|
932
|
-
mutationFn: (redirectUri) => intlayerOAuth.github.getAuthUrl(redirectUri)
|
|
933
|
-
});
|
|
934
|
-
};
|
|
935
|
-
const useGithubAuth = () => {
|
|
936
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
937
|
-
return useMutation({
|
|
938
|
-
mutationKey: ["github", "auth"],
|
|
939
|
-
mutationFn: (code) => intlayerOAuth.github.authenticate(code)
|
|
940
|
-
});
|
|
941
|
-
};
|
|
942
|
-
const useGithubRepos = (enabled = true) => {
|
|
943
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
944
|
-
return useQuery({
|
|
945
|
-
queryKey: ["github", "repos"],
|
|
946
|
-
queryFn: () => intlayerOAuth.github.getRepositories(),
|
|
947
|
-
enabled
|
|
948
|
-
});
|
|
949
|
-
};
|
|
950
|
-
const useGithubCheckConfig = () => {
|
|
951
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
952
|
-
return useMutation({
|
|
953
|
-
mutationKey: ["github", "check-config"],
|
|
954
|
-
mutationFn: (args) => intlayerOAuth.github.checkIntlayerConfig(void 0, args.owner, args.repository, args.branch)
|
|
955
|
-
});
|
|
956
|
-
};
|
|
957
|
-
const useGithubGetConfigFile = () => {
|
|
958
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
959
|
-
return useMutation({
|
|
960
|
-
mutationKey: ["github", "get-config-file"],
|
|
961
|
-
mutationFn: (args) => intlayerOAuth.github.getConfigFile(void 0, args.owner, args.repository, args.branch, args.path)
|
|
962
|
-
});
|
|
963
|
-
};
|
|
964
|
-
const useGithubToken = (options) => {
|
|
965
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
966
|
-
return useQuery({
|
|
967
|
-
queryKey: ["github", "token"],
|
|
968
|
-
queryFn: () => intlayerOAuth.github.getToken(),
|
|
969
|
-
...options
|
|
970
|
-
});
|
|
971
|
-
};
|
|
972
|
-
/**
|
|
973
|
-
* GitLab
|
|
974
|
-
*/
|
|
975
|
-
const useGitlabAuth = () => {
|
|
976
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
977
|
-
return useMutation({
|
|
978
|
-
mutationKey: ["gitlab", "auth"],
|
|
979
|
-
mutationFn: (args) => intlayerOAuth.gitlab.authenticate(args.code, args.redirectUri, args.instanceUrl)
|
|
980
|
-
});
|
|
981
|
-
};
|
|
982
|
-
const useGitlabProjects = (enabled = true, instanceUrl) => {
|
|
983
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
984
|
-
return useQuery({
|
|
985
|
-
queryKey: [
|
|
986
|
-
"gitlab",
|
|
987
|
-
"projects",
|
|
988
|
-
instanceUrl
|
|
989
|
-
],
|
|
990
|
-
queryFn: () => intlayerOAuth.gitlab.getProjects(void 0, instanceUrl),
|
|
991
|
-
enabled
|
|
992
|
-
});
|
|
993
|
-
};
|
|
994
|
-
const useGitlabCheckConfig = () => {
|
|
995
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
996
|
-
return useMutation({
|
|
997
|
-
mutationKey: ["gitlab", "check-config"],
|
|
998
|
-
mutationFn: (args) => intlayerOAuth.gitlab.checkIntlayerConfig(void 0, args.projectId, args.branch, args.instanceUrl)
|
|
999
|
-
});
|
|
1000
|
-
};
|
|
1001
|
-
const useGitlabGetConfigFile = () => {
|
|
1002
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1003
|
-
return useMutation({
|
|
1004
|
-
mutationKey: ["gitlab", "get-config-file"],
|
|
1005
|
-
mutationFn: (args) => intlayerOAuth.gitlab.getConfigFile(void 0, args.projectId, args.branch, args.path, args.instanceUrl)
|
|
1006
|
-
});
|
|
1007
|
-
};
|
|
1008
|
-
/**
|
|
1009
|
-
* Bitbucket
|
|
1010
|
-
*/
|
|
1011
|
-
const useBitbucketAuth = () => {
|
|
1012
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1013
|
-
return useMutation({
|
|
1014
|
-
mutationKey: ["bitbucket", "auth"],
|
|
1015
|
-
mutationFn: (code) => intlayerOAuth.bitbucket.authenticate(code)
|
|
1016
|
-
});
|
|
1017
|
-
};
|
|
1018
|
-
const useBitbucketRepos = (enabled = true) => {
|
|
1019
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1020
|
-
return useQuery({
|
|
1021
|
-
queryKey: ["bitbucket", "repos"],
|
|
1022
|
-
queryFn: () => intlayerOAuth.bitbucket.getRepositories(),
|
|
1023
|
-
enabled
|
|
1024
|
-
});
|
|
1025
|
-
};
|
|
1026
|
-
const useBitbucketCheckConfig = () => {
|
|
1027
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1028
|
-
return useMutation({
|
|
1029
|
-
mutationKey: ["bitbucket", "check-config"],
|
|
1030
|
-
mutationFn: (args) => intlayerOAuth.bitbucket.checkIntlayerConfig(void 0, args.workspace, args.repoSlug, args.branch)
|
|
1031
|
-
});
|
|
1032
|
-
};
|
|
1033
|
-
const useBitbucketGetConfigFile = () => {
|
|
1034
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1035
|
-
return useMutation({
|
|
1036
|
-
mutationKey: ["bitbucket", "get-config-file"],
|
|
1037
|
-
mutationFn: (args) => intlayerOAuth.bitbucket.getConfigFile(void 0, args.workspace, args.repoSlug, args.branch, args.path)
|
|
1038
|
-
});
|
|
1039
|
-
};
|
|
1040
|
-
/**
|
|
1041
|
-
* Editor
|
|
1042
|
-
*/
|
|
1043
|
-
const useGetEditorDictionaries = () => {
|
|
1044
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1045
|
-
return useQuery({
|
|
1046
|
-
queryKey: ["editor", "dictionaries"],
|
|
1047
|
-
queryFn: () => intlayerOAuth.editor.getDictionaries()
|
|
1048
|
-
});
|
|
1049
|
-
};
|
|
1050
|
-
const useWriteDictionary = () => {
|
|
1051
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1052
|
-
return useMutation({
|
|
1053
|
-
mutationKey: ["editor", "dictionaries"],
|
|
1054
|
-
mutationFn: (args) => intlayerOAuth.editor.writeDictionary(args)
|
|
1055
|
-
});
|
|
1056
|
-
};
|
|
1057
|
-
/**
|
|
1058
|
-
* Showcase
|
|
1059
|
-
*/
|
|
1060
|
-
const useGetShowcaseProjects = (query, options) => {
|
|
1061
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1062
|
-
return useQuery({
|
|
1063
|
-
queryKey: [
|
|
1064
|
-
"showcase",
|
|
1065
|
-
"projects",
|
|
1066
|
-
query
|
|
1067
|
-
],
|
|
1068
|
-
queryFn: ({ signal }) => intlayerOAuth.showcaseProject.getShowcaseProjects(query, { signal }),
|
|
1069
|
-
...options
|
|
1070
|
-
});
|
|
1071
|
-
};
|
|
1072
|
-
const useGetShowcaseProjectById = (projectId, options) => {
|
|
1073
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1074
|
-
return useQuery({
|
|
1075
|
-
queryKey: [
|
|
1076
|
-
"showcase",
|
|
1077
|
-
"project",
|
|
1078
|
-
projectId
|
|
1079
|
-
],
|
|
1080
|
-
queryFn: ({ signal }) => intlayerOAuth.showcaseProject.getShowcaseProjectById(projectId, { signal }),
|
|
1081
|
-
enabled: Boolean(projectId),
|
|
1082
|
-
...options
|
|
1083
|
-
});
|
|
1084
|
-
};
|
|
1085
|
-
const useGetOtherShowcaseProjects = (query, options) => {
|
|
1086
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1087
|
-
return useQuery({
|
|
1088
|
-
queryKey: [
|
|
1089
|
-
"showcase",
|
|
1090
|
-
"other-projects",
|
|
1091
|
-
query
|
|
1092
|
-
],
|
|
1093
|
-
queryFn: ({ signal }) => intlayerOAuth.showcaseProject.getOtherShowcaseProjects(query, { signal }),
|
|
1094
|
-
enabled: Boolean(query.excludeId),
|
|
1095
|
-
...options
|
|
1096
|
-
});
|
|
1097
|
-
};
|
|
1098
|
-
const useSubmitShowcaseProject = (props) => {
|
|
1099
|
-
const intlayerOAuth = useIntlayerOAuth(props);
|
|
1100
|
-
const queryClient = useQueryClient();
|
|
1101
|
-
return useMutation({
|
|
1102
|
-
mutationKey: ["showcase", "submit"],
|
|
1103
|
-
mutationFn: (body) => intlayerOAuth.showcaseProject.submitShowcaseProject(body),
|
|
1104
|
-
onSuccess: () => {
|
|
1105
|
-
queryClient.invalidateQueries({ queryKey: ["showcase"] });
|
|
1106
|
-
}
|
|
1107
|
-
});
|
|
1108
|
-
};
|
|
1109
|
-
const useDeleteShowcaseProject = (props) => {
|
|
1110
|
-
const intlayerOAuth = useIntlayerOAuth(props);
|
|
1111
|
-
const queryClient = useQueryClient();
|
|
1112
|
-
return useMutation({
|
|
1113
|
-
mutationKey: ["showcase", "delete"],
|
|
1114
|
-
mutationFn: (projectId) => intlayerOAuth.showcaseProject.deleteShowcaseProject(projectId),
|
|
1115
|
-
onSuccess: () => {
|
|
1116
|
-
queryClient.invalidateQueries({ queryKey: ["showcase"] });
|
|
1117
|
-
}
|
|
1118
|
-
});
|
|
1119
|
-
};
|
|
1120
|
-
const useToggleShowcaseUpvote = (props) => {
|
|
1121
|
-
const intlayerOAuth = useIntlayerOAuth(props);
|
|
1122
|
-
return useMutation({
|
|
1123
|
-
mutationKey: ["showcase", "upvote"],
|
|
1124
|
-
mutationFn: (projectId) => intlayerOAuth.showcaseProject.toggleShowcaseUpvote({ projectId })
|
|
1125
|
-
});
|
|
1126
|
-
};
|
|
1127
|
-
const useToggleShowcaseDownvote = (props) => {
|
|
1128
|
-
const intlayerOAuth = useIntlayerOAuth(props);
|
|
1129
|
-
return useMutation({
|
|
1130
|
-
mutationKey: ["showcase", "downvote"],
|
|
1131
|
-
mutationFn: (projectId) => intlayerOAuth.showcaseProject.toggleShowcaseDownvote({ projectId })
|
|
1132
|
-
});
|
|
1133
|
-
};
|
|
1134
|
-
const useUpdateShowcaseProject = (props) => {
|
|
1135
|
-
const intlayerOAuth = useIntlayerOAuth(props);
|
|
1136
|
-
const queryClient = useQueryClient();
|
|
1137
|
-
return useMutation({
|
|
1138
|
-
mutationKey: ["showcase", "update"],
|
|
1139
|
-
mutationFn: ({ projectId, ...body }) => intlayerOAuth.showcaseProject.updateShowcaseProject(projectId, body),
|
|
1140
|
-
onSuccess: () => {
|
|
1141
|
-
queryClient.invalidateQueries({ queryKey: ["showcase"] });
|
|
1142
|
-
}
|
|
1143
|
-
});
|
|
1144
|
-
};
|
|
1145
|
-
/**
|
|
1146
|
-
* Translation
|
|
1147
|
-
*/
|
|
1148
|
-
const useFillAllTranslations = () => {
|
|
1149
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1150
|
-
return useMutation({
|
|
1151
|
-
mutationKey: ["fill-all-translations"],
|
|
1152
|
-
mutationFn: async (args) => {
|
|
1153
|
-
let dictionaryIds = args.dictionaryIds;
|
|
1154
|
-
if (!dictionaryIds || dictionaryIds.length === 0) dictionaryIds = ((await intlayerOAuth.dictionary.getDictionaries({ pageSize: 1e3 }))?.data ?? []).map((d) => d.id);
|
|
1155
|
-
return intlayerOAuth.translate.translateDictionaries({
|
|
1156
|
-
dictionaryIds,
|
|
1157
|
-
targetLocales: args.targetLocales,
|
|
1158
|
-
mode: args.mode
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
});
|
|
1162
|
-
};
|
|
1163
|
-
const useStopTranslationJob = () => {
|
|
1164
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1165
|
-
return useMutation({
|
|
1166
|
-
mutationKey: ["stop-translation-job"],
|
|
1167
|
-
mutationFn: (jobId) => intlayerOAuth.translate.stopTranslationJob(jobId)
|
|
1168
|
-
});
|
|
1169
|
-
};
|
|
1170
|
-
const usePauseTranslationJob = () => {
|
|
1171
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1172
|
-
return useMutation({
|
|
1173
|
-
mutationKey: ["pause-translation-job"],
|
|
1174
|
-
mutationFn: (jobId) => intlayerOAuth.translate.pauseTranslationJob(jobId)
|
|
1175
|
-
});
|
|
1176
|
-
};
|
|
1177
|
-
const useResumeTranslationJob = () => {
|
|
1178
|
-
const intlayerOAuth = useIntlayerOAuth();
|
|
1179
|
-
return useMutation({
|
|
1180
|
-
mutationKey: ["resume-translation-job"],
|
|
1181
|
-
mutationFn: (jobId) => intlayerOAuth.translate.resumeTranslationJob(jobId)
|
|
1182
|
-
});
|
|
1183
|
-
};
|
|
1184
|
-
|
|
1185
|
-
//#endregion
|
|
1186
|
-
export { useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAppQuery, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAutocomplete, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useChat, useCreatePortalSession, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeleteOrganizationById, useDeletePasskey, useDeleteProject, useDeleteProjectById, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDisableTwoFactor, useEnableTwoFactor, useFillAllTranslations, useGetCIConfig, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetInvoices, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPaymentMethod, useGetPricing, useGetProjects, useGetRecursiveAuditStatus, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useInfiniteGetDictionaries, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, usePauseTranslationJob, usePushCIConfig, usePushDictionaries, usePushProjectConfiguration, useQueryClient, useRefreshAccessKey, useRegister, useRegisterSSO, useResetPassword, useResumeTranslationJob, useSearchDoc, useSelectOrganization, useSelectProject, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useSubmitShowcaseProject, useSubscribeToNewsletter, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnlinkAccount, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUploadUserAvatar, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
|
|
1187
|
-
//# sourceMappingURL=reactQuery.mjs.map
|