@intlayer/design-system 5.7.2 → 5.7.3
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 +39 -0
- package/dist/better-auth.8zoxzg-F-BEBqzpjz.cjs +40 -0
- package/dist/better-auth.8zoxzg-F-BEBqzpjz.cjs.map +1 -0
- package/dist/better-auth.8zoxzg-F-D8e0X4ys.js +41 -0
- package/dist/better-auth.8zoxzg-F-D8e0X4ys.js.map +1 -0
- package/dist/components/Breadcrumb/index.cjs +1 -0
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts +1 -1
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs +1 -0
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +7 -4
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +2 -2
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +7 -4
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +2 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +2 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +2 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +5 -2
- 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 +5 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +2 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +2 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/Flags/Flag.cjs +23 -1
- package/dist/components/Flags/Flag.cjs.map +1 -1
- package/dist/components/Flags/Flag.d.ts.map +1 -1
- package/dist/components/Flags/Flag.mjs +23 -1
- package/dist/components/Flags/Flag.mjs.map +1 -1
- package/dist/components/Form/FormBase.cjs.map +1 -1
- package/dist/components/Form/FormBase.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +2 -1
- package/dist/components/IDE/CodeContext.cjs.map +1 -1
- package/dist/components/IDE/CodeContext.mjs +2 -1
- package/dist/components/IDE/CodeContext.mjs.map +1 -1
- package/dist/components/Link/Link.cjs +2 -2
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.mjs +2 -2
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +2 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +2 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +2 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +2 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +2 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs +2 -1
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +2 -1
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +2 -1
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs +2 -1
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs +2 -1
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +2 -1
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +2 -1
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +2 -1
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +2 -1
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.cjs +5 -4
- package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.mjs +5 -4
- package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
- package/dist/hooks/auth.cjs +1783 -0
- package/dist/hooks/auth.cjs.map +1 -0
- package/dist/hooks/auth.d.ts +32 -0
- package/dist/hooks/auth.d.ts.map +1 -0
- package/dist/hooks/auth.mjs +1783 -0
- package/dist/hooks/auth.mjs.map +1 -0
- package/dist/hooks/index.cjs +2 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs +58 -61
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +679 -9
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +59 -62
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAuth/useAuth.cjs.map +1 -1
- package/dist/hooks/useAuth/useAuth.d.ts +1 -2
- package/dist/hooks/useAuth/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth/useAuth.mjs.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.cjs +3 -3
- package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.mjs +3 -3
- package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/hooks/useAuth/useSession.cjs +5 -5
- package/dist/hooks/useAuth/useSession.cjs.map +1 -1
- package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
- package/dist/hooks/useAuth/useSession.mjs +5 -5
- package/dist/hooks/useAuth/useSession.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +7 -1
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +11 -0
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -0
- package/dist/hooks/useIntlayerAPI.mjs +8 -2
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useUser/index.cjs +2 -1
- package/dist/hooks/useUser/index.cjs.map +1 -1
- package/dist/hooks/useUser/index.d.ts +2 -2
- package/dist/hooks/useUser/index.mjs +2 -1
- package/dist/hooks/useUser/index.mjs.map +1 -1
- package/package.json +18 -17
- package/dist/tailwind.css +0 -2
|
@@ -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;AAGjD,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,qBAAqB,CAAC;AAmJrE;;GAEG;AAEH,eAAO,MAAM,QAAQ,GACnB,OAAO,eAAe,CAAC,
|
|
1
|
+
{"version":3,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wBAAwB,GACnC,OAAO,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,uBAAuB,CAAC,CAAC,6PAMzE,CAAC;AAEJ,eAAO,MAAM,4BAA4B,GACvC,OAAO,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,2BAA2B,CAAC,CAAC,mQAM7E,CAAC;AAEJ,eAAO,MAAM,sBAAsB,GACjC,OAAO,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,6LAMvE,CAAC;AAEJ;;GAEG;AAEH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,2PAM/D,CAAC;AAEJ,eAAO,MAAM,wBAAwB,GACnC,OAAO,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,oJAM9D,CAAC"}
|
|
@@ -7,8 +7,9 @@ import { useAsync } from "./useAsync/useAsync.mjs";
|
|
|
7
7
|
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
8
8
|
import "@intlayer/api";
|
|
9
9
|
import "@intlayer/config/built";
|
|
10
|
+
import "../better-auth.8zoxzg-F-D8e0X4ys.js";
|
|
10
11
|
import "./useAsync/useAsyncStateStore.mjs";
|
|
11
|
-
import { useIntlayerAuth } from "./useIntlayerAPI.mjs";
|
|
12
|
+
import { useIntlayerAuth, useIntlayerOAuth } from "./useIntlayerAPI.mjs";
|
|
12
13
|
var define_process_env_default = {};
|
|
13
14
|
const formatErrorCode = (errorCode) => errorCode.split("_").join(" ");
|
|
14
15
|
const useErrorHandling = (options) => {
|
|
@@ -81,37 +82,33 @@ const useEditorAsync = (key, asyncFunction, options) => {
|
|
|
81
82
|
const optionsWithErrorHandling = useErrorHandling(options ?? {});
|
|
82
83
|
return useAsync(key, asyncFunction, optionsWithErrorHandling);
|
|
83
84
|
};
|
|
84
|
-
const useLogin = (args) => useAppAsync("login", useIntlayerAuth().
|
|
85
|
+
const useLogin = (args) => useAppAsync("login", useIntlayerAuth().signInEmail, {
|
|
85
86
|
invalidateQueries: ["getSession"],
|
|
86
87
|
...args
|
|
87
88
|
});
|
|
88
|
-
const useRegister = (args) => useAppAsync("register", useIntlayerAuth().
|
|
89
|
+
const useRegister = (args) => useAppAsync("register", useIntlayerAuth().signUpEmail, {
|
|
89
90
|
invalidateQueries: ["getSession"],
|
|
90
91
|
...args
|
|
91
92
|
});
|
|
92
|
-
const useLogout = (args) => useAppAsync("logout", useIntlayerAuth().
|
|
93
|
+
const useLogout = (args) => useAppAsync("logout", useIntlayerAuth().signOut, {
|
|
93
94
|
...args
|
|
94
95
|
});
|
|
95
|
-
const useChangePassword = (args) => useAppAsync(
|
|
96
|
-
"changePassword",
|
|
97
|
-
useIntlayerAuth().auth.changePasswordSession,
|
|
98
|
-
args
|
|
99
|
-
);
|
|
96
|
+
const useChangePassword = (args) => useAppAsync("changePassword", useIntlayerAuth().changePasswordSession, args);
|
|
100
97
|
const useAskResetPassword = (args) => useAppAsync(
|
|
101
98
|
"askResetPassword",
|
|
102
|
-
useIntlayerAuth().
|
|
99
|
+
useIntlayerAuth().requestPasswordResetSession,
|
|
103
100
|
args
|
|
104
101
|
);
|
|
105
102
|
const useDefineNewPassword = (args) => useAppAsync(
|
|
106
103
|
"defineNewPassword",
|
|
107
|
-
useIntlayerAuth().
|
|
104
|
+
useIntlayerAuth().changePasswordSession,
|
|
108
105
|
args
|
|
109
106
|
);
|
|
110
|
-
const useVerifyEmail = (args) => useAppAsync("verifyEmail", useIntlayerAuth().
|
|
111
|
-
const useGetUserByAccount = (args) => useAppAsync("getUserByAccount", useIntlayerAuth().
|
|
107
|
+
const useVerifyEmail = (args) => useAppAsync("verifyEmail", useIntlayerAuth().verifyEmailSession, args);
|
|
108
|
+
const useGetUserByAccount = (args) => useAppAsync("getUserByAccount", useIntlayerAuth().accountInfo, args);
|
|
112
109
|
const useGetUsers = (args) => useAppAsync(
|
|
113
110
|
"getUsers",
|
|
114
|
-
|
|
111
|
+
useIntlayerOAuth().user.getUsers,
|
|
115
112
|
{
|
|
116
113
|
cache: true,
|
|
117
114
|
store: true,
|
|
@@ -125,21 +122,21 @@ const useGetUsers = (args) => useAppAsync(
|
|
|
125
122
|
requireUser: true
|
|
126
123
|
}
|
|
127
124
|
);
|
|
128
|
-
const useCreateUser = (args) => useAppAsync("createUser", useIntlayerAuth().
|
|
125
|
+
const useCreateUser = (args) => useAppAsync("createUser", useIntlayerAuth().updateUser, {
|
|
129
126
|
invalidateQueries: ["getUsers"],
|
|
130
127
|
...args
|
|
131
128
|
});
|
|
132
|
-
const useUpdateUser = (args) => useAppAsync("updateUser",
|
|
129
|
+
const useUpdateUser = (args) => useAppAsync("updateUser", useIntlayerOAuth().user.updateUser, {
|
|
133
130
|
invalidateQueries: ["getSession"],
|
|
134
131
|
...args
|
|
135
132
|
});
|
|
136
|
-
const useDeleteUser = (args) => useAppAsync("deleteUser",
|
|
133
|
+
const useDeleteUser = (args) => useAppAsync("deleteUser", useIntlayerOAuth().user.deleteUser, {
|
|
137
134
|
invalidateQueries: ["getUsers"],
|
|
138
135
|
...args
|
|
139
136
|
});
|
|
140
137
|
const useGetOrganizations = (args) => useAppAsync(
|
|
141
138
|
"getOrganizations",
|
|
142
|
-
|
|
139
|
+
useIntlayerOAuth().organization.getOrganizations,
|
|
143
140
|
{
|
|
144
141
|
cache: true,
|
|
145
142
|
store: true,
|
|
@@ -156,7 +153,7 @@ const useGetOrganizations = (args) => useAppAsync(
|
|
|
156
153
|
);
|
|
157
154
|
const useAddOrganization = (args) => useAppAsync(
|
|
158
155
|
"addOrganization",
|
|
159
|
-
|
|
156
|
+
useIntlayerOAuth().organization.addOrganization,
|
|
160
157
|
{
|
|
161
158
|
invalidateQueries: ["getOrganizations"],
|
|
162
159
|
...args
|
|
@@ -164,7 +161,7 @@ const useAddOrganization = (args) => useAppAsync(
|
|
|
164
161
|
);
|
|
165
162
|
const useUpdateOrganization = (args) => useAppAsync(
|
|
166
163
|
"updateOrganization",
|
|
167
|
-
|
|
164
|
+
useIntlayerOAuth().organization.updateOrganization,
|
|
168
165
|
{
|
|
169
166
|
invalidateQueries: ["getSession"],
|
|
170
167
|
...args
|
|
@@ -172,7 +169,7 @@ const useUpdateOrganization = (args) => useAppAsync(
|
|
|
172
169
|
);
|
|
173
170
|
const useUpdateOrganizationMembers = (args) => useAppAsync(
|
|
174
171
|
"updateOrganizationMembers",
|
|
175
|
-
|
|
172
|
+
useIntlayerOAuth().organization.updateOrganizationMembers,
|
|
176
173
|
{
|
|
177
174
|
invalidateQueries: ["getOrganizations", "getSession"],
|
|
178
175
|
...args
|
|
@@ -180,7 +177,7 @@ const useUpdateOrganizationMembers = (args) => useAppAsync(
|
|
|
180
177
|
);
|
|
181
178
|
const useAddOrganizationMember = (args) => useAppAsync(
|
|
182
179
|
"addOrganizationMember",
|
|
183
|
-
|
|
180
|
+
useIntlayerOAuth().organization.addOrganizationMember,
|
|
184
181
|
{
|
|
185
182
|
invalidateQueries: ["getOrganizations", "getSession"],
|
|
186
183
|
...args
|
|
@@ -188,7 +185,7 @@ const useAddOrganizationMember = (args) => useAppAsync(
|
|
|
188
185
|
);
|
|
189
186
|
const useDeleteOrganization = (args) => useAppAsync(
|
|
190
187
|
"deleteOrganization",
|
|
191
|
-
|
|
188
|
+
useIntlayerOAuth().organization.deleteOrganization,
|
|
192
189
|
{
|
|
193
190
|
invalidateQueries: ["getOrganizations", "getSession"],
|
|
194
191
|
...args
|
|
@@ -196,7 +193,7 @@ const useDeleteOrganization = (args) => useAppAsync(
|
|
|
196
193
|
);
|
|
197
194
|
const useSelectOrganization = (args) => useAppAsync(
|
|
198
195
|
"selectOrganization",
|
|
199
|
-
|
|
196
|
+
useIntlayerOAuth().organization.selectOrganization,
|
|
200
197
|
{
|
|
201
198
|
invalidateQueries: ["getSession"],
|
|
202
199
|
...args
|
|
@@ -204,7 +201,7 @@ const useSelectOrganization = (args) => useAppAsync(
|
|
|
204
201
|
);
|
|
205
202
|
const useUnselectOrganization = (args) => useAppAsync(
|
|
206
203
|
"unselectOrganization",
|
|
207
|
-
|
|
204
|
+
useIntlayerOAuth().organization.unselectOrganization,
|
|
208
205
|
{
|
|
209
206
|
invalidateQueries: ["getSession"],
|
|
210
207
|
...args
|
|
@@ -212,7 +209,7 @@ const useUnselectOrganization = (args) => useAppAsync(
|
|
|
212
209
|
);
|
|
213
210
|
const useGetProjects = (args) => useAppAsync(
|
|
214
211
|
"getProjects",
|
|
215
|
-
|
|
212
|
+
useIntlayerOAuth().project.getProjects,
|
|
216
213
|
{
|
|
217
214
|
cache: true,
|
|
218
215
|
store: true,
|
|
@@ -228,49 +225,49 @@ const useGetProjects = (args) => useAppAsync(
|
|
|
228
225
|
requireOrganization: true
|
|
229
226
|
}
|
|
230
227
|
);
|
|
231
|
-
const useAddProject = (args) => useAppAsync("addProject",
|
|
228
|
+
const useAddProject = (args) => useAppAsync("addProject", useIntlayerOAuth().project.addProject, {
|
|
232
229
|
invalidateQueries: ["getProjects"],
|
|
233
230
|
...args
|
|
234
231
|
});
|
|
235
|
-
const useUpdateProject = (args) => useAppAsync("updateProject",
|
|
232
|
+
const useUpdateProject = (args) => useAppAsync("updateProject", useIntlayerOAuth().project.updateProject, {
|
|
236
233
|
invalidateQueries: ["getSession"],
|
|
237
234
|
...args
|
|
238
235
|
});
|
|
239
236
|
const useUpdateProjectMembers = (args) => useAppAsync(
|
|
240
237
|
"updateProjectMembers",
|
|
241
|
-
|
|
238
|
+
useIntlayerOAuth().project.updateProjectMembers,
|
|
242
239
|
{
|
|
243
240
|
invalidateQueries: ["getSession"],
|
|
244
241
|
...args
|
|
245
242
|
}
|
|
246
243
|
);
|
|
247
|
-
const useDeleteProject = (args) => useAppAsync("deleteProject",
|
|
244
|
+
const useDeleteProject = (args) => useAppAsync("deleteProject", useIntlayerOAuth().project.deleteProject, {
|
|
248
245
|
invalidateQueries: ["getProjects", "getSession"],
|
|
249
246
|
...args
|
|
250
247
|
});
|
|
251
|
-
const useSelectProject = (args) => useAppAsync("selectProject",
|
|
248
|
+
const useSelectProject = (args) => useAppAsync("selectProject", useIntlayerOAuth().project.selectProject, {
|
|
252
249
|
invalidateQueries: ["getSession"],
|
|
253
250
|
...args
|
|
254
251
|
});
|
|
255
|
-
const useUnselectProject = (args) => useAppAsync("unselectProject",
|
|
252
|
+
const useUnselectProject = (args) => useAppAsync("unselectProject", useIntlayerOAuth().project.unselectProject, {
|
|
256
253
|
invalidateQueries: ["getSession"],
|
|
257
254
|
...args
|
|
258
255
|
});
|
|
259
|
-
const useAddNewAccessKey = (args) => useAppAsync("addNewAccessKey",
|
|
256
|
+
const useAddNewAccessKey = (args) => useAppAsync("addNewAccessKey", useIntlayerOAuth().project.addNewAccessKey, {
|
|
260
257
|
invalidateQueries: ["getSession"],
|
|
261
258
|
...args
|
|
262
259
|
});
|
|
263
|
-
const useDeleteAccessKey = (args) => useAppAsync("deleteAccessKey",
|
|
260
|
+
const useDeleteAccessKey = (args) => useAppAsync("deleteAccessKey", useIntlayerOAuth().project.deleteAccessKey, {
|
|
264
261
|
invalidateQueries: ["getSession"],
|
|
265
262
|
...args
|
|
266
263
|
});
|
|
267
|
-
const useRefreshAccessKey = (args) => useAppAsync("refreshAccessKey",
|
|
264
|
+
const useRefreshAccessKey = (args) => useAppAsync("refreshAccessKey", useIntlayerOAuth().project.refreshAccessKey, {
|
|
268
265
|
invalidateQueries: ["getSession"],
|
|
269
266
|
...args
|
|
270
267
|
});
|
|
271
268
|
const useGetDictionaries = (args) => useAppAsync(
|
|
272
269
|
"getDictionaries",
|
|
273
|
-
|
|
270
|
+
useIntlayerOAuth().dictionary.getDictionaries,
|
|
274
271
|
{
|
|
275
272
|
cache: true,
|
|
276
273
|
store: true,
|
|
@@ -289,7 +286,7 @@ const useGetDictionaries = (args) => useAppAsync(
|
|
|
289
286
|
);
|
|
290
287
|
const useGetDictionariesKeys = (args) => useAppAsync(
|
|
291
288
|
"getDictionariesKeys",
|
|
292
|
-
|
|
289
|
+
useIntlayerOAuth().dictionary.getDictionariesKeys,
|
|
293
290
|
{
|
|
294
291
|
cache: true,
|
|
295
292
|
store: true,
|
|
@@ -308,7 +305,7 @@ const useGetDictionariesKeys = (args) => useAppAsync(
|
|
|
308
305
|
);
|
|
309
306
|
const useGetDictionary = (args) => useAppAsync(
|
|
310
307
|
"getDictionary",
|
|
311
|
-
|
|
308
|
+
useIntlayerOAuth().dictionary.getDictionary,
|
|
312
309
|
{
|
|
313
310
|
cache: true,
|
|
314
311
|
store: true,
|
|
@@ -324,13 +321,13 @@ const useGetDictionary = (args) => useAppAsync(
|
|
|
324
321
|
requireProject: true
|
|
325
322
|
}
|
|
326
323
|
);
|
|
327
|
-
const useAddDictionary = (args) => useAppAsync("addDictionary",
|
|
324
|
+
const useAddDictionary = (args) => useAppAsync("addDictionary", useIntlayerOAuth().dictionary.addDictionary, {
|
|
328
325
|
invalidateQueries: ["getDictionaries", "getDictionariesKeys"],
|
|
329
326
|
...args
|
|
330
327
|
});
|
|
331
328
|
const usePushDictionaries = (args) => useAppAsync(
|
|
332
329
|
"pushDictionaries",
|
|
333
|
-
|
|
330
|
+
useIntlayerOAuth().dictionary.pushDictionaries,
|
|
334
331
|
{
|
|
335
332
|
invalidateQueries: [
|
|
336
333
|
"getDictionaries",
|
|
@@ -342,7 +339,7 @@ const usePushDictionaries = (args) => useAppAsync(
|
|
|
342
339
|
);
|
|
343
340
|
const useUpdateDictionary = (args) => useAppAsync(
|
|
344
341
|
"updateDictionary",
|
|
345
|
-
|
|
342
|
+
useIntlayerOAuth().dictionary.updateDictionary,
|
|
346
343
|
{
|
|
347
344
|
invalidateQueries: ["getDictionaries", "getDictionary"],
|
|
348
345
|
...args
|
|
@@ -350,7 +347,7 @@ const useUpdateDictionary = (args) => useAppAsync(
|
|
|
350
347
|
);
|
|
351
348
|
const useDeleteDictionary = (args) => useAppAsync(
|
|
352
349
|
"deleteDictionary",
|
|
353
|
-
|
|
350
|
+
useIntlayerOAuth().dictionary.deleteDictionary,
|
|
354
351
|
{
|
|
355
352
|
invalidateQueries: [
|
|
356
353
|
"getDictionaries",
|
|
@@ -362,7 +359,7 @@ const useDeleteDictionary = (args) => useAppAsync(
|
|
|
362
359
|
);
|
|
363
360
|
const useGetTags = (args) => useAppAsync(
|
|
364
361
|
"getTags",
|
|
365
|
-
|
|
362
|
+
useIntlayerOAuth().tag.getTags,
|
|
366
363
|
{
|
|
367
364
|
cache: true,
|
|
368
365
|
store: true,
|
|
@@ -378,26 +375,26 @@ const useGetTags = (args) => useAppAsync(
|
|
|
378
375
|
requireOrganization: true
|
|
379
376
|
}
|
|
380
377
|
);
|
|
381
|
-
const useAddTag = (args) => useAppAsync("addTag",
|
|
378
|
+
const useAddTag = (args) => useAppAsync("addTag", useIntlayerOAuth().tag.addTag, {
|
|
382
379
|
invalidateQueries: ["getTags"],
|
|
383
380
|
...args
|
|
384
381
|
});
|
|
385
|
-
const useUpdateTag = (args) => useAppAsync("updateTag",
|
|
382
|
+
const useUpdateTag = (args) => useAppAsync("updateTag", useIntlayerOAuth().tag.updateTag, {
|
|
386
383
|
invalidateQueries: ["getTags"],
|
|
387
384
|
...args
|
|
388
385
|
});
|
|
389
|
-
const useDeleteTag = (args) => useAppAsync("deleteTag",
|
|
386
|
+
const useDeleteTag = (args) => useAppAsync("deleteTag", useIntlayerOAuth().tag.deleteTag, {
|
|
390
387
|
invalidateQueries: ["getTags"],
|
|
391
388
|
...args
|
|
392
389
|
});
|
|
393
|
-
const useGetPricing = (args) => useAppAsync("getPricing",
|
|
390
|
+
const useGetPricing = (args) => useAppAsync("getPricing", useIntlayerOAuth().stripe.getPricing, {
|
|
394
391
|
store: true,
|
|
395
392
|
cache: true,
|
|
396
393
|
...args
|
|
397
394
|
});
|
|
398
395
|
const useGetSubscription = (args) => useAppAsync(
|
|
399
396
|
"getSubscription",
|
|
400
|
-
|
|
397
|
+
useIntlayerOAuth().stripe.getSubscription,
|
|
401
398
|
args,
|
|
402
399
|
{
|
|
403
400
|
requireUser: true,
|
|
@@ -406,21 +403,21 @@ const useGetSubscription = (args) => useAppAsync(
|
|
|
406
403
|
);
|
|
407
404
|
const useCancelSubscription = (args) => useAppAsync(
|
|
408
405
|
"cancelSubscription",
|
|
409
|
-
|
|
406
|
+
useIntlayerOAuth().stripe.cancelSubscription,
|
|
410
407
|
{ invalidateQueries: ["getSession"], ...args },
|
|
411
408
|
{
|
|
412
409
|
requireUser: true,
|
|
413
410
|
requireOrganization: true
|
|
414
411
|
}
|
|
415
412
|
);
|
|
416
|
-
const useTranslateJSONDeclaration = (args) => useAppAsync("translateJSON",
|
|
413
|
+
const useTranslateJSONDeclaration = (args) => useAppAsync("translateJSON", useIntlayerOAuth().ai.translateJSON, args, {
|
|
417
414
|
requireUser: true,
|
|
418
415
|
requireOrganization: true,
|
|
419
416
|
requireProject: true
|
|
420
417
|
});
|
|
421
418
|
const useAuditContentDeclaration = (args) => useAppAsync(
|
|
422
419
|
"auditContentDeclaration",
|
|
423
|
-
|
|
420
|
+
useIntlayerOAuth().ai.auditContentDeclaration,
|
|
424
421
|
args,
|
|
425
422
|
{
|
|
426
423
|
requireUser: true,
|
|
@@ -430,7 +427,7 @@ const useAuditContentDeclaration = (args) => useAppAsync(
|
|
|
430
427
|
);
|
|
431
428
|
const useAuditContentDeclarationMetadata = (args) => useAppAsync(
|
|
432
429
|
"auditContentDeclaration",
|
|
433
|
-
|
|
430
|
+
useIntlayerOAuth().ai.auditContentDeclarationMetadata,
|
|
434
431
|
args,
|
|
435
432
|
{
|
|
436
433
|
requireUser: true,
|
|
@@ -440,7 +437,7 @@ const useAuditContentDeclarationMetadata = (args) => useAppAsync(
|
|
|
440
437
|
);
|
|
441
438
|
const useAuditContentDeclarationField = (args) => useAppAsync(
|
|
442
439
|
"auditContentDeclarationField",
|
|
443
|
-
|
|
440
|
+
useIntlayerOAuth().ai.auditContentDeclarationField,
|
|
444
441
|
args,
|
|
445
442
|
{
|
|
446
443
|
requireUser: true,
|
|
@@ -448,35 +445,35 @@ const useAuditContentDeclarationField = (args) => useAppAsync(
|
|
|
448
445
|
requireProject: true
|
|
449
446
|
}
|
|
450
447
|
);
|
|
451
|
-
const useAuditTag = (args) => useAppAsync("auditTag",
|
|
448
|
+
const useAuditTag = (args) => useAppAsync("auditTag", useIntlayerOAuth().ai.auditTag, args, {
|
|
452
449
|
requireUser: true,
|
|
453
450
|
requireOrganization: true,
|
|
454
451
|
requireProject: true
|
|
455
452
|
});
|
|
456
|
-
const useAskDocQuestion = (args) => useAppAsync("askDocQuestion",
|
|
457
|
-
const useAutocomplete = (args) => useAppAsync("autocomplete",
|
|
458
|
-
const useSearchDoc = (args) => useAppAsync("searchDoc",
|
|
453
|
+
const useAskDocQuestion = (args) => useAppAsync("askDocQuestion", useIntlayerOAuth().ai.askDocQuestion, args);
|
|
454
|
+
const useAutocomplete = (args) => useAppAsync("autocomplete", useIntlayerOAuth().ai.autocomplete, args);
|
|
455
|
+
const useSearchDoc = (args) => useAppAsync("searchDoc", useIntlayerOAuth().search.searchDoc, args);
|
|
459
456
|
const useSubscribeToNewsletter = (args) => useAppAsync(
|
|
460
457
|
"subscribeToNewsletter",
|
|
461
|
-
|
|
458
|
+
useIntlayerOAuth().newsletter.subscribeToNewsletter,
|
|
462
459
|
args
|
|
463
460
|
);
|
|
464
461
|
const useUnsubscribeFromNewsletter = (args) => useAppAsync(
|
|
465
462
|
"unsubscribeFromNewsletter",
|
|
466
|
-
|
|
463
|
+
useIntlayerOAuth().newsletter.unsubscribeFromNewsletter,
|
|
467
464
|
args
|
|
468
465
|
);
|
|
469
466
|
const useGetNewsletterStatus = (args) => useAppAsync(
|
|
470
467
|
"getNewsletterStatus",
|
|
471
|
-
|
|
468
|
+
useIntlayerOAuth().newsletter.getNewsletterStatus,
|
|
472
469
|
args
|
|
473
470
|
);
|
|
474
471
|
const useWriteDictionary = (args) => useEditorAsync(
|
|
475
472
|
"writeDictionary",
|
|
476
|
-
|
|
473
|
+
useIntlayerOAuth().editor.writeDictionary,
|
|
477
474
|
args
|
|
478
475
|
);
|
|
479
|
-
const useGetEditorDictionaries = (args) => useEditorAsync("getDictionaries",
|
|
476
|
+
const useGetEditorDictionaries = (args) => useEditorAsync("getDictionaries", useIntlayerOAuth().editor.getDictionaries, {
|
|
480
477
|
store: true,
|
|
481
478
|
cache: true,
|
|
482
479
|
...args
|
|
@@ -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 { useToast } from '../components/Toaster';\nimport { type UseAsyncOptions, useAsync } from './useAsync/useAsync';\nimport { useAuth } from './useAuth';\nimport { useIntlayerAuth } from './useIntlayerAPI';\n\nconst formatErrorCode = (errorCode: string) => errorCode.split('_').join(' ');\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useErrorHandling = <T extends UseAsyncOptions<any>>(options: T): T => {\n const { toast } = useToast();\n\n return {\n ...options,\n onError: (errorMessage) => {\n let error;\n\n // If json is valid, parse it\n try {\n if (typeof errorMessage === 'undefined') return;\n\n error = JSON.parse(errorMessage);\n } catch (e) {\n // If json is not valid, set error to the original errorMessage\n\n error = errorMessage;\n }\n\n // render toast for each error if there is more than one\n // otherwise render the toast with the error message\n [error]\n .flatMap((error) => error)\n .forEach((error) =>\n toast({\n title: formatErrorCode(\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error'\n ),\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data?.error) {\n toast({\n title: formatErrorCode(\n data.error.title ?? data.error.code ?? 'Error'\n ),\n description:\n data.error.message ?? data.error.code ?? 'An error occurred',\n variant: 'error',\n });\n }\n\n if (data?.message)\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n options.onSuccess?.(data);\n },\n };\n};\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = <T extends UseAsyncOptions<any>>(\n options: T,\n { requireUser, requireProject, requireOrganization }: AuthEnableOptions = {}\n): T => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const isEnabledOption = options?.enable ?? true;\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled;\n\n return {\n ...options,\n enable: isEnabled,\n };\n};\n\nconst useAppAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>,\n authOptions?: AuthEnableOptions\n) => {\n // Enhance options using custom hooks\n const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);\n\n const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\nconst useEditorAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n) => {\n const optionsWithErrorHandling = useErrorHandling(options ?? {});\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\n/**\n * Auth\n */\n\nexport const useLogin = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['signInEmail']>\n) =>\n useAppAsync('login', useIntlayerAuth().auth.signInEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useRegister = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['signUpEmail']>\n) =>\n useAppAsync('register', useIntlayerAuth().auth.signUpEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useLogout = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['signOut']>\n) =>\n useAppAsync('logout', useIntlayerAuth().auth.signOut, {\n ...args,\n });\n\nexport const useChangePassword = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['changePasswordSession']>\n) =>\n useAppAsync(\n 'changePassword',\n useIntlayerAuth().auth.changePasswordSession,\n args\n );\n\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['requestPasswordResetSession']>\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().auth.requestPasswordResetSession,\n args\n );\n\nexport const useDefineNewPassword = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['changePasswordSession']>\n) =>\n useAppAsync(\n 'defineNewPassword',\n useIntlayerAuth().auth.changePasswordSession,\n args\n );\n\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['verifyEmailSession']>\n) =>\n useAppAsync('verifyEmail', useIntlayerAuth().auth.verifyEmailSession, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['accountInfo']>\n) => useAppAsync('getUserByAccount', useIntlayerAuth().auth.accountInfo, args);\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 );\n\nexport const useCreateUser = (\n args?: UseAsyncOptions<IntlayerAPI['auth']['updateUser']>\n) =>\n useAppAsync('createUser', useIntlayerAuth().auth.updateUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\nexport const useUpdateUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['updateUser']>\n) =>\n useAppAsync('updateUser', useIntlayerAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\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 );\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 );\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 );\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 );\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 );\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 );\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 );\n\nexport const useAddProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addProject']>\n) =>\n useAppAsync('addProject', useIntlayerAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\n\nexport const useUpdateProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProject']>\n) =>\n useAppAsync('updateProject', useIntlayerAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\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 );\n\nexport const useDeleteProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteProject']>\n) =>\n useAppAsync('deleteProject', useIntlayerAuth().project.deleteProject, {\n invalidateQueries: ['getProjects', 'getSession'],\n ...args,\n });\n\nexport const useSelectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['selectProject']>\n) =>\n useAppAsync('selectProject', useIntlayerAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useUnselectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['unselectProject']>\n) =>\n useAppAsync('unselectProject', useIntlayerAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addNewAccessKey']>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteAccessKey']>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\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 );\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 );\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 );\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 );\n\nexport const useAddTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['addTag']>\n) =>\n useAppAsync('addTag', useIntlayerAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\nexport const useUpdateTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['updateTag']>\n) =>\n useAppAsync('updateTag', useIntlayerAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\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 useTranslateJSONDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['translateJSON']>\n) =>\n useAppAsync('translateJSON', useIntlayerAuth().ai.translateJSON, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclaration']>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n 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 * Search\n */\n\nexport const useSearchDoc = (\n args?: UseAsyncOptions<IntlayerAPI['search']['searchDoc']>\n) => useAppAsync('searchDoc', useIntlayerAuth().search.searchDoc, args);\n\n/**\n * Newsletter\n */\n\nexport const useSubscribeToNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['subscribeToNewsletter']>\n) =>\n useAppAsync(\n 'subscribeToNewsletter',\n useIntlayerAuth().newsletter.subscribeToNewsletter,\n args\n );\n\nexport const useUnsubscribeFromNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['unsubscribeFromNewsletter']>\n) =>\n useAppAsync(\n 'unsubscribeFromNewsletter',\n useIntlayerAuth().newsletter.unsubscribeFromNewsletter,\n args\n );\n\nexport const useGetNewsletterStatus = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['getNewsletterStatus']>\n) =>\n useAppAsync(\n 'getNewsletterStatus',\n useIntlayerAuth().newsletter.getNewsletterStatus,\n args\n );\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['writeDictionary']>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerAuth().editor.writeDictionary,\n args\n );\n\nexport const useGetEditorDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['getDictionaries']>\n) =>\n useEditorAsync('getDictionaries', useIntlayerAuth().editor.getDictionaries, {\n store: true,\n cache: true,\n ...args,\n });\n"],"names":["error"],"mappings":";;;;;;;;;;;;AASA,MAAM,kBAAkB,CAAC,cAAsB,UAAU,MAAM,GAAG,EAAE,KAAK,GAAG;AAK5E,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,OAAO;AAAA,aACJ,2BAAY,aAAa,eACtBA,OAAM,QACNA,OAAM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+BAA+B,CAC1C,SAEA;AAAA,EACE;AAAA,EACA,gBAAA,EAAkB,WAAW;AAAA,EAC7B;AACF;AAEW,MAAA,yBAAyB,CACpC,SAEA;AAAA,EACE;AAAA,EACA,gBAAA,EAAkB,WAAW;AAAA,EAC7B;AACF;AAMW,MAAA,qBAAqB,CAChC,SAEA;AAAA,EACE;AAAA,EACA,gBAAA,EAAkB,OAAO;AAAA,EACzB;AACF;AAEW,MAAA,2BAA2B,CACtC,SAEA,eAAe,mBAAmB,gBAAgB,EAAE,OAAO,iBAAiB;AAAA,EAC1E,OAAO;AAAA,EACP,OAAO;AAAA,EACP,GAAG;AACL,CAAC;"}
|
|
1
|
+
{"version":3,"file":"intlayerAPIHooks.mjs","sources":["../../src/hooks/intlayerAPIHooks.ts"],"sourcesContent":["'use client';\n\nimport type { IntlayerAPI } from '@intlayer/api';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useToast } from '../components/Toaster';\nimport { getAuthAPI } from './auth';\nimport { type UseAsyncOptions, useAsync } from './useAsync/useAsync';\nimport { useAuth } from './useAuth';\nimport { useIntlayerAuth, useIntlayerOAuth } from './useIntlayerAPI';\n\nconst formatErrorCode = (errorCode: string) => errorCode.split('_').join(' ');\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useErrorHandling = <T extends UseAsyncOptions<any>>(options: T): T => {\n const { toast } = useToast();\n\n return {\n ...options,\n onError: (errorMessage) => {\n let error;\n\n // If json is valid, parse it\n try {\n if (typeof errorMessage === 'undefined') return;\n\n error = JSON.parse(errorMessage);\n } catch (e) {\n // If json is not valid, set error to the original errorMessage\n\n error = errorMessage;\n }\n\n // render toast for each error if there is more than one\n // otherwise render the toast with the error message\n [error]\n .flatMap((error) => error)\n .forEach((error) =>\n toast({\n title: formatErrorCode(\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error'\n ),\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data?.error) {\n toast({\n title: formatErrorCode(\n data.error.title ?? data.error.code ?? 'Error'\n ),\n description:\n data.error.message ?? data.error.code ?? 'An error occurred',\n variant: 'error',\n });\n }\n\n if (data?.message)\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n options.onSuccess?.(data);\n },\n };\n};\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = <T extends UseAsyncOptions<any>>(\n options: T,\n { requireUser, requireProject, requireOrganization }: AuthEnableOptions = {}\n): T => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const isEnabledOption = options?.enable ?? true;\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled;\n\n return {\n ...options,\n enable: isEnabled,\n };\n};\n\nconst useAppAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>,\n authOptions?: AuthEnableOptions\n) => {\n // Enhance options using custom hooks\n const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);\n\n const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\nconst useEditorAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n) => {\n const optionsWithErrorHandling = useErrorHandling(options ?? {});\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\n/**\n * Auth\n */\n\nexport const useLogin = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signInEmail']>\n) =>\n useAppAsync('login', useIntlayerAuth().signInEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useRegister = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signUpEmail']>\n) =>\n useAppAsync('register', useIntlayerAuth().signUpEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useLogout = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signOut']>\n) =>\n useAppAsync('logout', useIntlayerAuth().signOut, {\n ...args,\n });\n\nexport const useChangePassword = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['changePasswordSession']>\n) =>\n useAppAsync('changePassword', useIntlayerAuth().changePasswordSession, args);\n\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<\n ReturnType<typeof getAuthAPI>['requestPasswordResetSession']\n >\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().requestPasswordResetSession,\n args\n );\n\nexport const useDefineNewPassword = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['changePasswordSession']>\n) =>\n useAppAsync(\n 'defineNewPassword',\n useIntlayerAuth().changePasswordSession,\n args\n );\n\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['verifyEmailSession']>\n) => useAppAsync('verifyEmail', useIntlayerAuth().verifyEmailSession, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['accountInfo']>\n) => useAppAsync('getUserByAccount', useIntlayerAuth().accountInfo, args);\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n args?: UseAsyncOptions<IntlayerAPI['user']['getUsers']>\n) =>\n useAppAsync(\n 'getUsers',\n useIntlayerOAuth().user.getUsers,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useCreateUser = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['updateUser']>\n) =>\n useAppAsync('createUser', useIntlayerAuth().updateUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\nexport const useUpdateUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['updateUser']>\n) =>\n useAppAsync('updateUser', useIntlayerOAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useDeleteUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['deleteUser']>\n) =>\n useAppAsync('deleteUser', useIntlayerOAuth().user.deleteUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['getOrganizations']>\n) =>\n useAppAsync(\n 'getOrganizations',\n useIntlayerOAuth().organization.getOrganizations,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useAddOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['addOrganization']>\n) =>\n useAppAsync(\n 'addOrganization',\n useIntlayerOAuth().organization.addOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\n\nexport const useUpdateOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['updateOrganization']>\n) =>\n useAppAsync(\n 'updateOrganization',\n useIntlayerOAuth().organization.updateOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useUpdateOrganizationMembers = (\n args?: UseAsyncOptions<\n IntlayerAPI['organization']['updateOrganizationMembers']\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerOAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['addOrganizationMember']>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerOAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['deleteOrganization']>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerOAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['selectOrganization']>\n) =>\n useAppAsync(\n 'selectOrganization',\n useIntlayerOAuth().organization.selectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useUnselectOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['unselectOrganization']>\n) =>\n useAppAsync(\n 'unselectOrganization',\n useIntlayerOAuth().organization.unselectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n args?: UseAsyncOptions<IntlayerAPI['project']['getProjects']>\n) =>\n useAppAsync(\n 'getProjects',\n useIntlayerOAuth().project.getProjects,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useAddProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addProject']>\n) =>\n useAppAsync('addProject', useIntlayerOAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\n\nexport const useUpdateProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProject']>\n) =>\n useAppAsync('updateProject', useIntlayerOAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProjectMembers']>\n) =>\n useAppAsync(\n 'updateProjectMembers',\n useIntlayerOAuth().project.updateProjectMembers,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useDeleteProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteProject']>\n) =>\n useAppAsync('deleteProject', useIntlayerOAuth().project.deleteProject, {\n invalidateQueries: ['getProjects', 'getSession'],\n ...args,\n });\n\nexport const useSelectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['selectProject']>\n) =>\n useAppAsync('selectProject', useIntlayerOAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useUnselectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['unselectProject']>\n) =>\n useAppAsync('unselectProject', useIntlayerOAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addNewAccessKey']>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerOAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteAccessKey']>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerOAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['refreshAccessKey']>\n) =>\n useAppAsync('refreshAccessKey', useIntlayerOAuth().project.refreshAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['getDictionaries']>\n) =>\n useAppAsync(\n 'getDictionaries',\n useIntlayerOAuth().dictionary.getDictionaries,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionariesKeys = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['getDictionariesKeys']>\n) =>\n useAppAsync(\n 'getDictionariesKeys',\n useIntlayerOAuth().dictionary.getDictionariesKeys,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['getDictionary']>\n) =>\n useAppAsync(\n 'getDictionary',\n useIntlayerOAuth().dictionary.getDictionary,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAddDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['addDictionary']>\n) =>\n useAppAsync('addDictionary', useIntlayerOAuth().dictionary.addDictionary, {\n invalidateQueries: ['getDictionaries', 'getDictionariesKeys'],\n ...args,\n });\n\nexport const usePushDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['pushDictionaries']>\n) =>\n useAppAsync(\n 'pushDictionaries',\n useIntlayerOAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['updateDictionary']>\n) =>\n useAppAsync(\n 'updateDictionary',\n useIntlayerOAuth().dictionary.updateDictionary,\n {\n invalidateQueries: ['getDictionaries', 'getDictionary'],\n ...args,\n }\n );\n\nexport const useDeleteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['deleteDictionary']>\n) =>\n useAppAsync(\n 'deleteDictionary',\n useIntlayerOAuth().dictionary.deleteDictionary,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['getTags']>\n) =>\n useAppAsync(\n 'getTags',\n useIntlayerOAuth().tag.getTags,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useAddTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['addTag']>\n) =>\n useAppAsync('addTag', useIntlayerOAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\nexport const useUpdateTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['updateTag']>\n) =>\n useAppAsync('updateTag', useIntlayerOAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\nexport const useDeleteTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['deleteTag']>\n) =>\n useAppAsync('deleteTag', useIntlayerOAuth().tag.deleteTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\n/**\n * Stripe\n */\n\nexport const useGetPricing = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['getPricing']>\n) =>\n useAppAsync('getPricing', useIntlayerOAuth().stripe.getPricing, {\n store: true,\n cache: true,\n ...args,\n });\n\nexport const useGetSubscription = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['getSubscription']>\n) =>\n useAppAsync(\n 'getSubscription',\n useIntlayerOAuth().stripe.getSubscription,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useCancelSubscription = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['cancelSubscription']>\n) =>\n useAppAsync(\n 'cancelSubscription',\n useIntlayerOAuth().stripe.cancelSubscription,\n { invalidateQueries: ['getSession'], ...args },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\n/**\n * AI\n */\n\nexport const useTranslateJSONDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['translateJSON']>\n) =>\n useAppAsync('translateJSON', useIntlayerOAuth().ai.translateJSON, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclaration']>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerOAuth().ai.auditContentDeclaration,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationMetadata = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclarationMetadata']>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerOAuth().ai.auditContentDeclarationMetadata,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationField = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclarationField']>\n) =>\n useAppAsync(\n 'auditContentDeclarationField',\n useIntlayerOAuth().ai.auditContentDeclarationField,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditTag = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditTag']>\n) =>\n useAppAsync('auditTag', useIntlayerOAuth().ai.auditTag, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAskDocQuestion = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['askDocQuestion']>\n) => useAppAsync('askDocQuestion', useIntlayerOAuth().ai.askDocQuestion, args);\n\nexport const useAutocomplete = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['autocomplete']>\n) => useAppAsync('autocomplete', useIntlayerOAuth().ai.autocomplete, args);\n\n/**\n * Search\n */\n\nexport const useSearchDoc = (\n args?: UseAsyncOptions<IntlayerAPI['search']['searchDoc']>\n) => useAppAsync('searchDoc', useIntlayerOAuth().search.searchDoc, args);\n\n/**\n * Newsletter\n */\n\nexport const useSubscribeToNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['subscribeToNewsletter']>\n) =>\n useAppAsync(\n 'subscribeToNewsletter',\n useIntlayerOAuth().newsletter.subscribeToNewsletter,\n args\n );\n\nexport const useUnsubscribeFromNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['unsubscribeFromNewsletter']>\n) =>\n useAppAsync(\n 'unsubscribeFromNewsletter',\n useIntlayerOAuth().newsletter.unsubscribeFromNewsletter,\n args\n );\n\nexport const useGetNewsletterStatus = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['getNewsletterStatus']>\n) =>\n useAppAsync(\n 'getNewsletterStatus',\n useIntlayerOAuth().newsletter.getNewsletterStatus,\n args\n );\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['writeDictionary']>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerOAuth().editor.writeDictionary,\n args\n );\n\nexport const useGetEditorDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['getDictionaries']>\n) =>\n useEditorAsync('getDictionaries', useIntlayerOAuth().editor.getDictionaries, {\n store: true,\n cache: true,\n ...args,\n });\n"],"names":["error"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,kBAAkB,CAAC,cAAsB,UAAU,MAAM,GAAG,EAAE,KAAK,GAAG;AAK5E,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAI,SAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAA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I;AAM5D,MAAA,eAAe,CAC1B,SACG,YAAY,aAAa,mBAAmB,OAAO,WAAW,IAAI;AAM1D,MAAA,2BAA2B,CACtC,SAEA;AAAA,EACE;AAAA,EACA,iBAAA,EAAmB,WAAW;AAAA,EAC9B;AACF;AAEW,MAAA,+BAA+B,CAC1C,SAEA;AAAA,EACE;AAAA,EACA,iBAAA,EAAmB,WAAW;AAAA,EAC9B;AACF;AAEW,MAAA,yBAAyB,CACpC,SAEA;AAAA,EACE;AAAA,EACA,iBAAA,EAAmB,WAAW;AAAA,EAC9B;AACF;AAMW,MAAA,qBAAqB,CAChC,SAEA;AAAA,EACE;AAAA,EACA,iBAAA,EAAmB,OAAO;AAAA,EAC1B;AACF;AAEW,MAAA,2BAA2B,CACtC,SAEA,eAAe,mBAAmB,iBAAiB,EAAE,OAAO,iBAAiB;AAAA,EAC3E,OAAO;AAAA,EACP,OAAO;AAAA,EACP,GAAG;AACL,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.cjs","sources":["../../../src/hooks/useAuth/useAuth.ts"],"sourcesContent":["'use client';\n\nimport { OAuth2Token } from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport {
|
|
1
|
+
{"version":3,"file":"useAuth.cjs","sources":["../../../src/hooks/useAuth/useAuth.ts"],"sourcesContent":["'use client';\n\nimport type { OAuth2Token, Session } from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useOAuth2 } from './useOAuth2';\nimport { useSession } from './useSession';\n\ntype SessionContextProps = {\n session: Session | null | undefined;\n setSession: (session: Session | null) => void;\n fetchSession: () => Promise<Session | null | undefined>;\n revalidateSession: () => Promise<Session | null | undefined>;\n isAuthenticated: boolean;\n oAuth2AccessToken: OAuth2Token | null | undefined;\n};\n\nexport const useAuth = ({\n session: sessionProp,\n intlayerConfiguration,\n}: {\n session?: Session | null;\n intlayerConfiguration?: IntlayerConfig;\n} = {}): SessionContextProps => {\n const { session, fetchSession, revalidateSession, setSession } = useSession(\n sessionProp,\n intlayerConfiguration\n );\n const { oAuth2AccessToken } = useOAuth2(intlayerConfiguration);\n\n return {\n session,\n fetchSession,\n setSession,\n revalidateSession,\n oAuth2AccessToken,\n isAuthenticated: Boolean(session?.user || oAuth2AccessToken),\n };\n};\n"],"names":["useSession","useOAuth2"],"mappings":";;;;;AAgBO,MAAM,UAAU,CAAC;AAAA,EACtB,SAAS;AAAA,EACT;AACF,IAGI,OAA4B;AAC9B,QAAM,EAAE,SAAS,cAAc,mBAAmB,WAAe,IAAAA,yBAAA;AAAA,IAC/D;AAAA,IACA;AAAA,EACF;AACA,QAAM,EAAE,kBAAA,IAAsBC,wBAAA,UAAU,qBAAqB;AAEtD,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,QAAQ,SAAS,QAAQ,iBAAiB;AAAA,EAC7D;AACF;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { OAuth2Token } from '@intlayer/backend';
|
|
1
|
+
import { OAuth2Token, Session } from '@intlayer/backend';
|
|
2
2
|
import { IntlayerConfig } from '@intlayer/config/client';
|
|
3
|
-
import { Session } from './index';
|
|
4
3
|
type SessionContextProps = {
|
|
5
4
|
session: Session | null | undefined;
|
|
6
5
|
setSession: (session: Session | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/useAuth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/useAuth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACxD,iBAAiB,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAC7D,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,mDAGrB;IACD,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,qBAAqB,CAAC,EAAE,cAAc,CAAC;CACnC,KAAG,mBAeR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.mjs","sources":["../../../src/hooks/useAuth/useAuth.ts"],"sourcesContent":["'use client';\n\nimport { OAuth2Token } from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport {
|
|
1
|
+
{"version":3,"file":"useAuth.mjs","sources":["../../../src/hooks/useAuth/useAuth.ts"],"sourcesContent":["'use client';\n\nimport type { OAuth2Token, Session } from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useOAuth2 } from './useOAuth2';\nimport { useSession } from './useSession';\n\ntype SessionContextProps = {\n session: Session | null | undefined;\n setSession: (session: Session | null) => void;\n fetchSession: () => Promise<Session | null | undefined>;\n revalidateSession: () => Promise<Session | null | undefined>;\n isAuthenticated: boolean;\n oAuth2AccessToken: OAuth2Token | null | undefined;\n};\n\nexport const useAuth = ({\n session: sessionProp,\n intlayerConfiguration,\n}: {\n session?: Session | null;\n intlayerConfiguration?: IntlayerConfig;\n} = {}): SessionContextProps => {\n const { session, fetchSession, revalidateSession, setSession } = useSession(\n sessionProp,\n intlayerConfiguration\n );\n const { oAuth2AccessToken } = useOAuth2(intlayerConfiguration);\n\n return {\n session,\n fetchSession,\n setSession,\n revalidateSession,\n oAuth2AccessToken,\n isAuthenticated: Boolean(session?.user || oAuth2AccessToken),\n };\n};\n"],"names":[],"mappings":";;;AAgBO,MAAM,UAAU,CAAC;AAAA,EACtB,SAAS;AAAA,EACT;AACF,IAGI,OAA4B;AAC9B,QAAM,EAAE,SAAS,cAAc,mBAAmB,WAAe,IAAA;AAAA,IAC/D;AAAA,IACA;AAAA,EACF;AACA,QAAM,EAAE,kBAAA,IAAsB,UAAU,qBAAqB;AAEtD,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,QAAQ,SAAS,QAAQ,iBAAiB;AAAA,EAC7D;AACF;"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const api = require("@intlayer/api");
|
|
5
|
-
const
|
|
5
|
+
const configuration = require("@intlayer/config/built");
|
|
6
6
|
const editorReact = require("@intlayer/editor-react");
|
|
7
7
|
const hooks_useAsync_useAsync = require("../useAsync/useAsync.cjs");
|
|
8
8
|
const useOAuth2 = (intlayerConfiguration) => {
|
|
9
|
-
const configuration = editorReact.useConfiguration();
|
|
10
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
9
|
+
const configuration$1 = editorReact.useConfiguration();
|
|
10
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
11
11
|
const intlayerAPI = api.getOAuthAPI(config);
|
|
12
12
|
const { data } = hooks_useAsync_useAsync.useAsync(
|
|
13
13
|
"getOAuth2AccessToken",
|